def import_path_from_file(filename, as_list=False):
    module_path = []
    basename = os.path.splitext(os.path.basename(filename))[0]
    if basename != '__init__':
        module_path.append(basename)

    dirname = os.path.dirname(filename)
    while os.path.isfile(os.path.join(dirname, '__init__.py')):
        dirname, tail = os.path.split(dirname)
        module_path.insert(0, tail)

    if as_list:
        return module_path, dirname
    return '.'.join(module_path), dirname
An HTML ``<input/>`` element to be included with all POST forms.
dataset/ETHPy150Open tweekmonster/moult/moult/utils.py/import_path_from_file--crossover with--dataset/ETHPy150Open RobotWebTools/rosbridge_suite/rosbridge_server/src/tornado/web.py/RequestHandler.xsrf_form_html