def extract_schemas_from_file(source_path):
logging.info("<STR_LIT>", source_path)<EOL>try:<EOL><INDENT>with open(source_path, '<STR_LIT:r>') as source_file:<EOL><INDENT>source = source_file.read()<EOL><DEDENT><DEDENT>except (FileNotFoundError, PermissionError) as e:<EOL><INDENT>logging.error("<STR_LIT>", e.strerror)<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>schemas = extract_schemas_from_source(source, source_path)<EOL><DEDENT>except SyntaxError as e:<EOL><INDENT>logging.error("<STR_LIT>", str(e))<EOL><DEDENT>else:<EOL><INDENT>logging.info(<EOL>"<STR_LIT>",<EOL>len(schemas),<EOL>"<STR_LIT>" if len(schemas) == <NUM_LIT:1> else "<STR_LIT>")<EOL>return schemas<EOL><DEDENT><DEDENT>
Extract schemas from 'source_path'.

    :returns: a list of ViewSchema objects on success, None if no schemas
        could be extracted.