def METHOD_NAME(data, thistype): 
    if data == None:
        return "Empty"
    if "int" in thistype:
        try:
            return int(data)
        except ValueError:
            print("ValueError while casting %s" % data)
            return data
    if "lower" in thistype:
        return data.lower()
    if "upper" in thistype:
        return data.upper()
    if "trim" in thistype:
        return data.strip()
    if "strip" in thistype:
        return data.strip()
    if "split" in thistype:
        # Should be able to split anything
        return data.split()
    if "len" in thistype or "length" in thistype:
        return len(data)
    if "parse" in thistype:
        splitvalues = []
        default_error = """Error. Expected syntax: parse(["hello","test1"],0:1)""" 
        if "," in data:
            splitvalues = data.split(",")
            for item in range(len(splitvalues)):
                splitvalues[item] = splitvalues[item].strip()
        else:
            return default_error 
        lastsplit = []
        if ":" in splitvalues[-1]:
            lastsplit = splitvalues[-1].split(":")
        else:
            try:
                lastsplit = [int(splitvalues[-1])]
            except ValueError:
                return default_error
        try:
            parsedlist = ",".join(splitvalues[0:-1])
            print(parsedlist)
            print(lastsplit)
            if len(lastsplit) > 1:
                tmp = json.loads(parsedlist)[int(lastsplit[0]):int(lastsplit[1])]
            else:
                tmp = json.loads(parsedlist)[lastsplit[0]]
            print(tmp)
            return tmp
        except IndexError as e:
            return default_error