def getsourcefile(object):
    filename = getfile(object)
    if filename[-4:].lower() in ['.pyc', '.pyo']:
        filename = filename[:-4] + '.py'
    for suffix, mode, kind in imp.get_suffixes():
        if 'b' in mode and filename[-len(suffix):].lower() == suffix:
            # Looks like a binary file.  We want to only return a text file.
            return None
    if os.path.exists(filename):
        return filename

# -------------------------------------------------- stack frame extraction
Creates an empty Cursor object for information to be copied into.
dataset/ETHPy150Open cournape/Bento/bento/compat/inspect.py/getsourcefile--crossover with--dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/cursor.py/Cursor._clone_base