def file2tuple(thing):
    """
    Function that converts a filename to a tuple of the type: (filename,string containing file)
    Input can be filename or tuple with filename and content in a string.
    """
    
    if isinstance(thing,tuple):  # it is a tuple with filename and content in a string
        filename,string = thing
        output = (filename.split('/')[-1],string)
    else:    # it is a filename
        filename = thing
        file = open(filename)
        output = (filename.split('/')[-1],file.read())
        file.close()   
        
    return output