def is_relative(modname, from_file):
if not os.path.isdir(from_file):<EOL><INDENT>from_file = os.path.dirname(from_file)<EOL><DEDENT>if from_file in sys.path:<EOL><INDENT>return False<EOL><DEDENT>try:<EOL><INDENT>stream, _, _ = imp.find_module(modname.split("<STR_LIT:.>")[<NUM_LIT:0>], [from_file])<EOL>if stream:<EOL><INDENT>stream.close()<EOL><DEDENT>return True<EOL><DEDENT>except ImportError:<EOL><INDENT>return False<EOL><DEDENT>
return true if the given module name is relative to the given
    file name

    :type modname: str
    :param modname: name of the module we are interested in

    :type from_file: str
    :param from_file:
      path of the module from which modname has been imported

    :rtype: bool
    :return:
      true if the module has been imported relatively to `from_file`