human
Write me a the Python program you requested given the following:
Complete the below
def getTokens(command):

    ''''Return list of token tuples for command.'
    '''
assistant
#Here is the Python program you requested.
    if (type(command) == str):
        try:
            command = command.encode(wx.GetDefaultPyEncoding())
        except UnicodeEncodeError:
            pass
    f = io.StringIO(command)
    tokens = []
    try:
        def eater(*args):
            tokens.append(args)
        tokenize.tokenize_loop(f.readline, eater)
    except tokenize.TokenError:
        pass
    return tokens