@classmethod
    def from_codes(cls, codes, categories, ordered=False, name=None):
        if name is not None:
            msg = ("the 'name' keyword is removed, use 'name' with consumers "
                   "of the categorical instead (e.g. 'Series(cat, "
                   "name=\"something\")'")
            warn(msg, UserWarning, stacklevel=2)

        try:
            codes = np.asarray(codes, np.int64)
        except:
            raise ValueError(
                "codes need to be convertible to an arrays of integers")

        categories = cls._validate_categories(categories)

        if len(codes) and (codes.max() >= len(categories) or codes.min() < -1):
            raise ValueError("codes need to be between -1 and "
                             "len(categories)-1")

        return Categorical(codes, categories=categories, ordered=ordered,
                           fastpath=True)
Free temporary resources that do not need to persist between requests,
dataset/ETHPy150Open pydata/pandas/pandas/core/categorical.py/Categorical.from_codes--crossover with--dataset/ETHPy150Open sassoftware/conary/conary/repository/netrepos/netserver.py/NetworkRepositoryServer.reset