Utility method to find all converters from a given type.

        :param from_type:
        :return:
6349
def get_all_conversion_chains_from_type(self, from_type: Type[Any]) \
            -> Tuple[List[Converter], List[Converter], List[Converter]]:
        
        return self.get_all_conversion_chains(from_type=from_type)
709638
def restore_type(self, type):
        

        # Mapping
        mapping = {
            'BOOLEAN': 'boolean',
            'DATE': 'date',
            'DATETIME': 'datetime',
            'INTEGER': 'integer',
            'FLOAT': 'number',
            'STRING': 'string',
            'TIME': 'time',
        }

        # Not supported type
        if type not in mapping:
            message = 'Type %s is not supported' % type
            raise tableschema.exceptions.StorageError(message)

        return mapping[type]
1141088
def itemtypes(cls, mapped_types, coll_type, visitor):
        
        rv = list(v for k, v in mapped_types)
        return rv[0] if len(rv) == 1 else rv
1294251
def get_default_config_converters(conv_finder: ConversionFinder) -> List[Union[Converter[Any, ConfigParser], Converter[ConfigParser, Any]]]:
    
    return [ConverterFunction(ConfigParser, DictOfDict, config_to_dict_of_dict, custom_name='config_to_dict_of_dict',
                              function_args={'conversion_finder': conv_finder}),
            ConverterFunction(ConfigParser, dict, merge_all_config_sections_into_a_single_dict,
                              custom_name='merge_all_config_sections_into_a_single_dict',
                              function_args={'conversion_finder': conv_finder})]
418114
private List<ParameterConverter> methodReturningConverters(final Class<?> type) {
        final List<ParameterConverter> converters = new ArrayList<>();
        for (final Method method : type.getMethods()) {
            if (method.isAnnotationPresent(AsParameterConverter.class)) {
                converters.add(new MethodReturningConverter(method, type, this));
            }
        }
        return converters;
    }
752601
def register_annotype_converter(cls, types, is_array=False,
                                    is_mapping=False):
        # type: (Union[Sequence[type], type], bool, bool) -> Any
        """"""
        if not isinstance(types, Sequence):
            types = [types]

        def decorator(subclass):
            for typ in types:
                cls._annotype_lookup[(typ, is_array, is_mapping)] = subclass
            return subclass

        return decorator
335982
def oftype(self, typ):
        ''''''
        for key, val in self.items():
            if val.type == typ:
                yield key
672286
def _convert(self, desired_type: Type[T], source_obj: S, logger: Logger, options: Dict[str, Dict[str, Any]]) -> T:
        
        try:
            if self.unpack_options:
                opts = self.get_applicable_options(options)
                if self.function_args is not None:
                    return self.conversion_method(desired_type, source_obj, logger, **self.function_args, **opts)
                else:
                    return self.conversion_method(desired_type, source_obj, logger, **opts)
            else:
                if self.function_args is not None:
                    return self.conversion_method(desired_type, source_obj, logger, options, **self.function_args)
                else:
                    return self.conversion_method(desired_type, source_obj, logger, options)

        except TypeError as e:
            raise CaughtTypeError.create(self.conversion_method, e)
1220848
def _get_converter_type(identifier):
    """"""
    if isinstance(identifier, str):
        return ConverterType[identifier]
    if isinstance(identifier, ConverterType):
        return identifier
    return ConverterType(identifier)
1255611
public PriorityConverter getConverter(Type type) {
        PriorityConverter converter = converters.get(type);
        return converter;
    }
425939
def converters
      @converters ||= site.converters.select { |c| c.matches(document.extname) }.sort
    end
1253137
def sorted_converters_keys(self):
        
        keys = sorted(self.converters.keys(),
                      key=cmp_to_key(tuple_type_compare))
        return {k: self.converters[k] for k in keys}
1152712
def GetConvertersByClass(value_cls):
    """"""
    try:
      return ExportConverter.converters_cache[value_cls]
    except KeyError:
      results = [
          cls for cls in itervalues(ExportConverter.classes)
          if cls.input_rdf_type == value_cls
      ]
      if not results:
        results = [DataAgnosticExportConverter]

      ExportConverter.converters_cache[value_cls] = results
      return results
820418
def is_enum_type(type_):
    

    return isinstance(type_, type) and issubclass(type_, tuple(_get_types(Types.ENUM)))
890789
def _ConvertAllTypes(self, allTypes):
      
      # Generate lists good for VmomiSupport.CreateXYZType
      enumTypes = self._Filter(self._ConvertEnumType, allTypes.enumTypeInfo)
      dataTypes = self._Filter(self._ConvertDataType, allTypes.dataTypeInfo)
      managedTypes = self._Filter(self._ConvertManagedType,
                                  allTypes.managedTypeInfo)
      retAllTypes = (enumTypes, dataTypes, managedTypes)
      return retAllTypes
227223
def _gather_keys_by_type(self, type):
        
        foreign = self._foreign_key

        keys = (
            BaseCollection.make(list(self._dictionary[type].values()))
            .map(lambda models: getattr(models[0], foreign))
            .unique()
        )

        return keys
775413
def types_from_module(pb_module):
    '''
    
    '''
    types = pb_module.DESCRIPTOR.message_types_by_name
    return [getattr(pb_module, name) for name in types]