def get_descriptor_base_path(descriptor):
<EOL>if isinstance(descriptor, six.string_types):<EOL><INDENT>if os.path.exists(descriptor):<EOL><INDENT>base_path = os.path.dirname(os.path.abspath(descriptor))<EOL><DEDENT>else:<EOL><INDENT>base_path = os.path.dirname(descriptor)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>base_path = '<STR_LIT:.>'<EOL><DEDENT>return base_path<EOL>
Get descriptor base path if string or return None.