Search for a type_info instance which describes this key.
321878
def FindTypeInfo(self, name):
    """"""
    result = self.type_infos.get(name)
    if result is None:
      # Not found, assume string.
      result = type_info.String(name=name, default="")

    return result
1173719
def search(self, type, **args):
        """"""
        if type not in VALID_SEARCH_TYPES:
            raise GraphAPIError(
                "Valid types are: %s" % ", ".join(VALID_SEARCH_TYPES)
            )

        args["type"] = type
        return self.request(self.version + "/search/", args)
4
def key_to_kind(cls, key):
    
    if key.kind() == Kind.KIND_NAME:
      return key.id()
    else:
      return key.parent().id()
1115042
def typename(obj):
    """"""
    if hasattr(obj, '__class__'):
        return getattr(obj, '__class__').__name__
    else:
        return type(obj).__name__
376623
def get_type(type_):
    
    if isinstance(type_, list):
        type_ = tuple(type_)

    for k, v in TYPE_MAP.iteritems():
        if k == type_:
            return v

    raise KeyError("Unknown type %r" % (type_,))
110315
def _get_key_info(self):
        """"""
        vkey_scan = LoByte(VkKeyScan(self.key))

        return (vkey_scan, MapVirtualKey(vkey_scan, 0), 0)
1143567
def query_info(self, name, like, kind):
        """"""
        kind = self._make_kind_id(kind)
        # Database from VS2015 does not have assoc_text.
        #
        # sql = 'select name, kind, file_id, type, assoc_text ' \
        #       'from code_items ' \
        #       'where name {} ?'.format('like' if like else '=')
        sql = 'select name, kind, file_id, type ' \
              'from code_items ' \
              'where name {} ?'.format('like' if like else '=')
        args = (name,)
        if like:
            sql += ' escape ?'
            args = (name, '\\')
        if kind:
            sql += ' and kind = ?'
            args = (name, kind)
        if like and kind:
            args = (name, '\\', kind)
        logging.debug('%s %s', sql, args)
        self.cursor.execute(sql, args)
        return self.cursor.fetchall(), self
910748
def type_info(type, elem)
    scimfo = {
        user: {
            path: '/Users',
            name_attr: 'userName',
            origin_attr: 'origin'
        },
        group: {
            path: '/Groups',
            name_attr: 'displayName',
            origin_attr: 'zoneid'
        },
        client: {
            path: '/oauth/clients',
            name_attr: 'client_id'
        },
        user_id: {
            path: '/ids/Users',
            name_attr: 'userName',
            origin_attr: 'origin',
        },
        group_mapping: {
            path: '/Groups/External',
            name_attr: 'externalGroup',
            origin_attr: 'origin'
        }
    }

    type_info = scimfo[type]

    unless type_info
      raise ArgumentError, "scim resource type must be one of #{scimfo.keys.inspect}"
    end

    value = type_info[elem]

    unless value
      raise ArgumentError, "scim schema element must be one of #{type_info.keys.inspect}"
    end

    value
  end
954766
def has_key(self, key):
        """"""
        try:
            if type(self.attrs) == dict:
                return key in self.attrs
            else:
                raise AttributeError    # if attrs is not a dict
        except AttributeError:          # if attrs doesnt exist
            raise NotImplementedError
289392
def type_map(gtype, fn):
    """"""

    cb = ffi.callback('VipsTypeMap2Fn', fn)
    return vips_lib.vips_type_map(gtype, cb, ffi.NULL, ffi.NULL)
634298
def get_type_name(t):
    
    # Lookup in the mapping
    try:
        return __type_names[t]
    except KeyError:
        # Specific types
        if issubclass(t, six.integer_types):
            return _(u'Integer number')

        # Get name from the Type itself
        return six.text_type(t.__name__).capitalize()
947366
function get_type()
    {
        if ($this->subkeys[0]->has_private)
            return enigma_key::TYPE_KEYPAIR;
        else if (!empty($this->subkeys[0]))
            return enigma_key::TYPE_PUBLIC;

        return enigma_key::TYPE_UNKNOWN;
    }
998727
def query_get_kb_by_type(kbtype):
    
    return models.KnwKB.query.filter_by(
        kbtype=models.KnwKB.KNWKB_TYPES[kbtype])
794438
def is_config_type(type_):
    

    return (
        isinstance(type_, type)
        and hasattr(type_, "__attrs_attrs__")
        and hasattr(type_, CONFIG_KEY)
    )
638627
def __GetTypeInfo(self, attrs, name_hint):
        """"""

        type_ref = self.__names.ClassName(attrs.get('$ref'))
        type_name = attrs.get('type')
        if not (type_ref or type_name):
            raise ValueError('No type found for %s' % attrs)

        if type_ref:
            self.__AddIfUnknown(type_ref)
            # We don't actually know this is a message -- it might be an
            # enum. However, we can't check that until we've created all the
            # types, so we come back and fix this up later.
            return TypeInfo(
                type_name=type_ref, variant=messages.Variant.MESSAGE)

        if 'enum' in attrs:
            enum_name = '%sValuesEnum' % name_hint
            return self.__DeclareEnum(enum_name, attrs)

        if 'format' in attrs:
            type_info = self.PRIMITIVE_FORMAT_MAP.get(attrs['format'])
            if type_info is None:
                # If we don't recognize the format, the spec says we fall back
                # to just using the type name.
                if type_name in self.PRIMITIVE_TYPE_INFO_MAP:
                    return self.PRIMITIVE_TYPE_INFO_MAP[type_name]
                raise ValueError('Unknown type/format "%s"/"%s"' % (
                    attrs['format'], type_name))
            if type_info.type_name.startswith((
                    'apitools.base.protorpclite.message_types.',
                    'message_types.')):
                self.__AddImport(
                    'from %s import message_types as _message_types' %
                    self.__protorpc_package)
            if type_info.type_name.startswith('extra_types.'):
                self.__AddImport(
                    'from %s import extra_types' % self.__base_files_package)
            return type_info

        if type_name in self.PRIMITIVE_TYPE_INFO_MAP:
            type_info = self.PRIMITIVE_TYPE_INFO_MAP[type_name]
            if type_info.type_name.startswith('extra_types.'):
                self.__AddImport(
                    'from %s import extra_types' % self.__base_files_package)
            return type_info

        if type_name == 'array':
            items = attrs.get('items')
            if not items:
                raise ValueError('Array type with no item type: %s' % attrs)
            entry_name_hint = self.__names.ClassName(
                items.get('title') or '%sListEntry' % name_hint)
            entry_label = self.__ComputeLabel(items)
            if entry_label == descriptor.FieldDescriptor.Label.REPEATED:
                parent_name = self.__names.ClassName(
                    items.get('title') or name_hint)
                entry_type_name = self.__AddEntryType(
                    entry_name_hint, items.get('items'), parent_name)
                return TypeInfo(type_name=entry_type_name,
                                variant=messages.Variant.MESSAGE)
            return self.__GetTypeInfo(items, entry_name_hint)
        elif type_name == 'any':
            self.__AddImport('from %s import extra_types' %
                             self.__base_files_package)
            return self.PRIMITIVE_TYPE_INFO_MAP['any']
        elif type_name == 'object':
            # TODO(craigcitro): Think of a better way to come up with names.
            if not name_hint:
                raise ValueError(
                    'Cannot create subtype without some name hint')
            schema = dict(attrs)
            schema['id'] = name_hint
            self.AddDescriptorFromSchema(name_hint, schema)
            self.__AddIfUnknown(name_hint)
            return TypeInfo(
                type_name=name_hint, variant=messages.Variant.MESSAGE)

        raise ValueError('Unknown type: %s' % type_name)
485774
public TypeInfo getSchemaTypeInfo() {
	// dynamic load to support jre 1.4 and 1.5
	try {
	    Method m = element.getClass().getMethod("getSchemaTypeInfo", new Class[] {});
	    return (TypeInfo) m.invoke(element, ArrayUtil.OBJECT_EMPTY);
	}
	catch (Exception e) {
	    throw new PageRuntimeException(Caster.toPageException(e));
	}
    }
882054
def _lookup_vultrid(which_key, availkey, keyname):
    '''
    
    '''
    if DETAILS == {}:
        _cache_provider_details()

    which_key = six.text_type(which_key)
    try:
        return DETAILS[availkey][which_key][keyname]
    except KeyError:
        return False