def __init__(self, arg):
if arg is not None:<EOL><INDENT>if isinstance(arg, string_types):<EOL><INDENT>self._filepath = arg<EOL><DEDENT>else:<EOL><INDENT>self._filepath = arg.filepath<EOL><DEDENT>if self._filepath is not None:<EOL><INDENT>self._basepath = os.path.dirname(self._filepath)<EOL><DEDENT>else:<EOL><INDENT>self._basepath = None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self._filepath = None<EOL>self._basepath = None<EOL><DEDENT>
Create new context from a path or existing context