<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_file(cls, schema_filepath, *args, **kwargs):
 """Create an instance from a YAML or JSON schema file. Any additional args or kwargs will be passed on when constructing the new schema instance (useful for subclasses). :param str schema_filepath: Path to the schema file. :returns: an instance of the class. :raises SchemaLoadingError: for invalid input files. """

        schema_filepath = os.path.abspath(schema_filepath)
        try:
            with open(schema_filepath, 'r') as schema_file:
                schema = yaml.load(schema_file.read())
        except Exception:
            msg = 'Error loading schema file {}'.format(schema_filepath)
            logging.exception(msg)
            raise SchemaLoadingError(msg)
        return cls(schema, *args, schema_path=os.path.dirname(schema_filepath),
                   **kwargs)