(cls, t)
Checks if ``t`` is subclass of ``BaseType`` or if a mapping
        is known.

        >>> BaseType.__ensure__(Int)
        scalar Int
        >>> BaseType.__ensure__(int)
        scalar Int
        >>> BaseType.__ensure__(bytes)
        Traceback (most recent call last):
           ...
        TypeError: Not BaseType or mapped: <class 'bytes'>
Checks if ``t`` is subclass of ``BaseType`` or if a mapping
        is known.
Checks if t is subclass of BaseType or if a mapping is known .
def __ensure__(cls, t):
        '''Checks if ``t`` is subclass of ``BaseType`` or if a mapping
        is known.

        >>> BaseType.__ensure__(Int)
        scalar Int
        >>> BaseType.__ensure__(int)
        scalar Int
        >>> BaseType.__ensure__(bytes)
        Traceback (most recent call last):
           ...
        TypeError: Not BaseType or mapped: <class 'bytes'>
        '''
        if isinstance(t, type) and issubclass(t, cls):
            return t
        try:
            return map_python_to_graphql[t]
        except KeyError as exc:
            raise TypeError('Not %s or mapped: %s' % (cls, t)) from exc
def __ensure__ ( cls , t ) : if isinstance ( t , type ) and issubclass ( t , cls ) : return t try : return map_python_to_graphql [ t ] except KeyError as exc : raise TypeError ( 'Not %s or mapped: %s' % ( cls , t ) ) from exc