def METHOD_NAME(self):
    global name
    if name == None:
        name = str(uuid.uuid1())
        # Add extension to name
        if 'data' in locals() or 'data' in globals():
            name = name + self.extension
        else:
            matches = re.search('(?i)([a-z0-9]{1,})$', self.files.name)
            if matches.group(1):
                name = name + '.' + matches.group(1)
    return name