def load_schema(file_or_fp):
    """Load schema from file.

    :param file_or_fp: File name or file object
    :type file_or_fp: str, file
    :raise: IOError if file cannot be opened or read, ValueError if
            file is not valid JSON or JSON is not a valid schema.
    """
    fp = open(file_or_fp, 'r') if isinstance(file_or_fp, str) else file_or_fp
    obj = json.load(fp)
    schema = Schema(obj)
    return schema
def load_schema ( file_or_fp ) : fp = open ( file_or_fp , 'r' ) if isinstance ( file_or_fp , str ) else file_or_fp obj = json . load ( fp ) schema = Schema ( obj ) return schema
Load schema from file.

    :param file_or_fp: File name or file object
    :type file_or_fp: str, file
    :raise: IOError if file cannot be opened or read, ValueError if
            file is not valid JSON or JSON is not a valid schema.