@staticmethod<EOL><INDENT>def parse(file_path, content=None):<DEDENT>
try:<EOL><INDENT>if content is None:<EOL><INDENT>with open(file_path) as f:<EOL><INDENT>content = f.read()<EOL><DEDENT><DEDENT>py_tree = _parser.parse(<EOL>content, path=file_path, error_recovery=False)<EOL>return ParsoPythonFile(file_path, py_tree)<EOL><DEDENT>except parso.parser.ParserSyntaxError as ex:<EOL><INDENT>logging.error("<STR_LIT>", file_path,<EOL>ex.error_leaf.line, ex.error_leaf.get_code())<EOL><DEDENT>
Create a PythonFile object with specified file_path and content.
If content is None then, it is loaded from the file_path method.
Otherwise, file_path is only used for reporting errors.