@classmethod
    def by_python_type(cls, p_type):
        """
        Takes any Python type, and returns an appropriate ``JSONType``. If the
        type provided isn't supported, a ``ValueError`` is raised.
        """
        for key, python_types in cls.json_types.iteritems():
            if not key == 'any' and p_type in python_types:
                return cls(key)

        raise ValueError(u'{t} is not a valid JSON type'.format(t=p_type))
dataset/ETHPy150Open orokusaki/django-jsonrpc-2-0/jsonrpc/jsontype.py/JSONType.by_python_type/original