<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, db_file=ALL_SETS_PATH):
 """Reads card data from a JSON-file. :param db_file: A file-like object or a path. :return: A new :class:`~mtgjson.CardDb` instance. """

        if callable(getattr(db_file, 'read', None)):
            return cls(json.load(db_file))

        with io.open(db_file, encoding='utf8') as inp:
            return cls(json.load(inp))