Get type from vmodl name
895
def GetVmodlType(name):
   

   # If the input is already a type, just return
   if isinstance(name, type):
      return name

   # Try to get type from vmodl type names table
   typ = vmodlTypes.get(name)
   if typ:
      return typ

   # Else get the type from the _wsdlTypeMap
   isArray = name.endswith("[]")
   if isArray:
      name = name[:-2]
   ns, wsdlName = _GetWsdlInfo(name)
   try:
      typ = GetWsdlType(ns, wsdlName)
   except KeyError:
      raise KeyError(name)
   if typ:
      return isArray and typ.Array or typ
   else:
      raise KeyError(name)
273397
def get_index_text(self, modname, name_cls):
        """"""
        if self.objtype.endswith('function'):
            if not modname:
                return _('%s() (built-in %s)') % \
                    (name_cls[0], self.chpl_type_name)
            return _('%s() (in module %s)') % (name_cls[0], modname)
        elif self.objtype in ('data', 'type', 'enum'):
            if not modname:
                type_name = self.objtype
                if type_name == 'data':
                    type_name = 'variable'
                return _('%s (built-in %s)') % (name_cls[0], type_name)
            return _('%s (in module %s)') % (name_cls[0], modname)
        else:
            return ''
1354796
def _gettype(self):
        '''
        
        
        '''
        current = self
        lastname = getattr(current._parser, 'typedef', None)
        while hasattr(current, '_sub'):
            current = current._sub
            tn = getattr(current._parser, 'typedef', None)
            if tn is not None:
                lastname = tn
        return lastname
1189286
def get_network_adapter_type(adapter_type):
    '''
    
    '''
    if adapter_type == 'vmxnet':
        return vim.vm.device.VirtualVmxnet()
    elif adapter_type == 'vmxnet2':
        return vim.vm.device.VirtualVmxnet2()
    elif adapter_type == 'vmxnet3':
        return vim.vm.device.VirtualVmxnet3()
    elif adapter_type == 'e1000':
        return vim.vm.device.VirtualE1000()
    elif adapter_type == 'e1000e':
        return vim.vm.device.VirtualE1000e()

    raise ValueError('An unknown network adapter object type name.')
1180846
static List<ScriptObjectMirror> getModulesByType(String type,Object value) {
        //print("getModuleByType: " + type + ":" + value);
        List<ScriptObjectMirror> list = new ArrayList<>();
        ScriptObjectMirror requires = requires();

        //print("ModuleUtils.getRequiredFileById for modid: "+modid);
        for ( Map.Entry<String,Object> entry : requires.entrySet()) {

            if (entry.getValue() instanceof ScriptObjectMirror)
            {
                ScriptObjectMirror som = (ScriptObjectMirror)entry.getValue();
                Object v = som.getMember(type);
                if (value.equals(v))
                    list.add(som);
            }
        }
        return list;
    }
1347173
def get_id_from_cstring(name):
        """"""
        for key in list(LogTocElement.types.keys()):
            if (LogTocElement.types[key][0] == name):
                return key
        raise KeyError('Type [%s] not found in LogTocElement.types!' % name)
298930
def get_network_adapter_object_type(adapter_object):
    '''
    
    '''
    if isinstance(adapter_object, vim.vm.device.VirtualVmxnet2):
        return 'vmxnet2'
    if isinstance(adapter_object, vim.vm.device.VirtualVmxnet3):
        return 'vmxnet3'
    if isinstance(adapter_object, vim.vm.device.VirtualVmxnet):
        return 'vmxnet'
    if isinstance(adapter_object, vim.vm.device.VirtualE1000e):
        return 'e1000e'
    if isinstance(adapter_object, vim.vm.device.VirtualE1000):
        return 'e1000'

    raise ValueError('An unknown network adapter object type.')
1039476
def getTypesModuleName(self):
        
        if self.types_module_name is not None:
            return self.types_module_name

        name = GetModuleBaseNameFromWSDL(self._wsdl)
        if not name:
            raise WsdlGeneratorError, 'could not determine a service name'
        
        if self.types_module_suffix is None:
            return name

        return '%s%s' %(name, self.types_module_suffix)
234198
def extern_get_type_for(self, context_handle, val):
    """"""
    c = self._ffi.from_handle(context_handle)
    obj = self._ffi.from_handle(val[0])
    type_id = c.to_id(type(obj))
    return TypeId(type_id)
607059
def _get_server_type(doc):
    """"""
    if not doc.get('ok'):
        return SERVER_TYPE.Unknown

    if doc.get('isreplicaset'):
        return SERVER_TYPE.RSGhost
    elif doc.get('setName'):
        if doc.get('hidden'):
            return SERVER_TYPE.RSOther
        elif doc.get('ismaster'):
            return SERVER_TYPE.RSPrimary
        elif doc.get('secondary'):
            return SERVER_TYPE.RSSecondary
        elif doc.get('arbiterOnly'):
            return SERVER_TYPE.RSArbiter
        else:
            return SERVER_TYPE.RSOther
    elif doc.get('msg') == 'isdbgrid':
        return SERVER_TYPE.Mongos
    else:
        return SERVER_TYPE.Standalone
983633
def _ConvertEnumType(self, enumType):
      
      if enumType:
         vmodlName = enumType.name
         wsdlName = enumType.wsdlName
         version = enumType.version
         values = enumType.value
         enumType = (vmodlName, wsdlName, version, values)
      else:
         enumType = None
      return enumType
640165
def get_block_type(self, def_id):
        """"""
        try:
            return self._definitions[def_id]
        except KeyError:
            try:
                return def_id.aside_type
            except AttributeError:
                raise NoSuchDefinition(repr(def_id))
90126
function tryGetName(node) {
            if (node.kind === 225 /* ModuleDeclaration */) {
                return getModuleName(node);
            }
            var decl = node;
            if (decl.name) {
                return ts.getPropertyNameForPropertyNameNode(decl.name);
            }
            switch (node.kind) {
                case 179 /* FunctionExpression */:
                case 180 /* ArrowFunction */:
                case 192 /* ClassExpression */:
                    return getFunctionOrClassName(node);
                case 279 /* JSDocTypedefTag */:
                    return getJSDocTypedefTagName(node);
                default:
                    return undefined;
            }
        }
785731
def get_type_data(name):
    
    name = name.upper()
    try:
        return {
            'authority': 'gnu.org',
            'namespace': 'Basic Numeric Formats',
            'identifier': name,
            'domain': 'Numeric Format Types',
            'display_name': GNU_BASIC_NUMERIC_FORMAT_TYPES[name] + ' Numeric Format Type',
            'display_label': GNU_BASIC_NUMERIC_FORMAT_TYPES[name],
            'description': ('The type for the ' +
                            GNU_BASIC_NUMERIC_FORMAT_TYPES[name] +
                            ' numeric format.')
        }
    except KeyError:
        raise NotFound('NumericFormat Type: ' + name)
334238
def get_typeof_error name
      pspec = get_pspec name
      raise Vips::Error unless pspec

      pspec[:value][:value_type]
    end
715708
def get_type(full_path):
    """"""
    status = {'type': []}
    if os.path.ismount(full_path):
        status['type'] += ['mount-point']
    elif os.path.islink(full_path):
        status['type'] += ['symlink']
    if os.path.isfile(full_path):
        status['type'] += ['file']
    elif os.path.isdir(full_path):
        status['type'] += ['dir']
    if not status['type']:
        if os.stat.S_ISSOCK(status['mode']):
            status['type'] += ['socket']
        elif os.stat.S_ISCHR(status['mode']):
            status['type'] += ['special']
        elif os.stat.S_ISBLK(status['mode']):
            status['type'] += ['block-device']
        elif os.stat.S_ISFIFO(status['mode']):
            status['type'] += ['pipe']
    if not status['type']:
        status['type'] += ['unknown']
    elif status['type'] and status['type'][-1] == 'symlink':
        status['type'] += ['broken']
    return status['type']
1201220
def type_name(value):
    """"""
    return type(value).__name__ if isinstance(value, EncapsulatedNode) else \
           "struct" if isinstance(value, dict) else \
           "sequence" if isinstance(value, (tuple, list)) else \
           type(value).__name__