<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lookup(self, tokens):
 """Return a list of possible lemmata and their probabilities for each token"""

        lemmatized_tokens = []
        if type(tokens) == list:
            for token in tokens:
                # look for token in lemma dict keys
                if token.lower() in self.lemmata.keys():
                    # `lemmas` is a list of possible lemmata. Probability values must be assigned.
                    # `lemmalist` is a list of the form [(LEMMA, PROBABILITY), (LEMMA, PROBABILITY)]
                    # `lemmaobj` is a tuple with the form (LEMMA, LIST)
                    lemmas = self.lemmata[token.lower()]
                    lemmalist = []
                    for lemma in lemmas:
                        lemmalist.append((lemma, 1/len(lemmas)))
                    lemmaobj = (token, lemmalist)
                else:
                # if token not found in lemma-headword list, return the token itself
                    lemmalist = []
                    lemmalist.append((token, 1))
                    lemmaobj = (token, lemmalist)
                lemmatized_tokens.append(lemmaobj)
        if type(tokens) == str:
            if tokens.lower() in self.lemmata.keys():
                # `lemmas` is a list of possible lemmata. Probability values must be assigned.
                # `lemmalist` is a list of the form [(LEMMA, PROBABILITY), (LEMMA, PROBABILITY)]
                # `lemmaobj` is a tuple with the form (LEMMA, LIST)
                lemmas = self.lemmata[tokens.lower()]
                lemmalist = []
                for lemma in lemmas:
                    lemmalist.append((lemma, 1/len(lemmas)))
                lemmaobj = (tokens, lemmalist)
            else:
            # if token not found in lemma-headword list, return the token itself
                lemmalist = []
                lemmalist.append((tokens, 1))
                lemmaobj = (tokens, lemmalist)
            lemmatized_tokens.append(lemmaobj)
        return lemmatized_tokens