Do the lookupInstance command.
559768
private void lookupInstance(String args[]) {
        String serviceName = args[1];
        System.out.println("lookupInstance, serviceName=" + serviceName);
        try {
            ServiceInstance instance = ServiceDirectory.getLookupManager().lookupInstance(serviceName);
            printServiceInstance(instance);
        } catch (ServiceException e) {
            e.printStackTrace();
            fail(e.getServiceDirectoryError().getErrorMessage());
        }
    }
1029511
def get_instances_by_name(name, sort_by_order=('cloud', 'name'), projects=None, raw=True, regions=None, gcp_credentials=None, clouds=SUPPORTED_CLOUDS):
    """"""
    matching_instances = all_clouds_get_instances_by_name(
        name, projects, raw, credentials=gcp_credentials, clouds=clouds)
    if regions:
        matching_instances = [instance for instance in matching_instances if instance.region in regions]
    matching_instances.sort(key=lambda instance: [getattr(instance, field) for field in sort_by_order])
    return matching_instances
167900
def lookupfile(filename):
    """"""
    logger.info('Looking up %s'%(filename))

    # First open cache file to see if we already looked up this stuff
    dirname=os.path.dirname(filename)
    basefilename=os.path.basename(filename)

    CACHE_FILE = os.path.join(dirname,'.'+basefilename+'.gpscache')
    cache=loadCacheFile(CACHE_FILE)

    # Get the input file
    positions=parsePositionFile(filename)

    # If load didn't work, read again and lookup
    if not cache:
        logger.info("%s - No cache file found, looking up location"\
                %(basefilename))
        cache=lookupGeoInfo(positions)
        # Save to DB
        json.dump(cache,open(CACHE_FILE,'w'))
    else:
        logger.info("%s - Found cache file for locations"\
                %(basefilename))

    return positions,cache
1047593
def _traverse_command(self, name, *args, **kwargs):
        """"""
        args = list(args)
        args.insert(0, self.name)
        return super(InstanceHashField, self)._traverse_command(name, *args, **kwargs)
905782
def lookup(schema):
    
    if not isinstance(schema, dict) or "$ref" not in schema:
        return None

    ref = schema["$ref"]

    return REGISTRY.get(ref)
1249433
def _dict_lookup(cls, item, **kwargs):
        '''
        
        '''
        log.debug('item == %s', item)
        value_lookup = kwargs.get('value_lookup', False)
        if 'lookup' in kwargs:
            for k, v in six.iteritems(kwargs['lookup']):
                if value_lookup:
                    if six.text_type(v).lower() == six.text_type(item).lower():
                        log.debug('returning key %s', k)
                        return k
                else:
                    if six.text_type(k).lower() == six.text_type(item).lower():
                        log.debug('returning value %s', v)
                        return v
        return 'Invalid Value'
1032104
def get_custom_values(self, key):
        """"""
        self._handled.add(key)
        return self._lookup[key]
1147099
function lookup(obj, type, name) {
  while (obj) {
    if (obj[type] && obj[type].hasOwnProperty(name)) {
      return obj[type][name];
    }
    obj = obj.parent;
  }
}
1068574
def find_instance(self, name, module=None):
        """"""
        module = module if module is not None else ffi.NULL
        definstance = lib.EnvFindInstance(self._env, module, name.encode(), 1)
        if definstance == ffi.NULL:
            raise LookupError("Instance '%s' not found" % name)

        return Instance(self._env, definstance)
836243
def lookupProcessor(name):
    """"""
    if name in _proc_lookup:
        return _proc_lookup[name]
    else:
        error_string = 'If you are creating a new processor, please read the\
documentation on creating a new processor'
        raise LookupError("Unknown processor %s\n%s" % (name, error_string))
378816
def _lookup(self, skip_cache, fun, *args, **kwargs):
        
        if args not in self.cache or skip_cache:
            self.cache[args] = fun(*args, **kwargs)
        return self.cache[args]
412173
def get_prep_lookup(self, lookup_name, rhs):
        
        if lookup_name == 'exact':
            if not isinstance(rhs, Model):
                raise FilteredGenericForeignKeyFilteringException(
                    "For exact lookup, please pass a single Model instance.")

        elif lookup_name in ['in', 'in_raw']:
            if type(rhs) == QuerySet:
                return rhs, None

            if not is_iterable(rhs):
                raise FilteredGenericForeignKeyFilteringException(
                    "For 'in' lookup, please pass an iterable or a QuerySet.")

        else:
            raise FilteredGenericForeignKeyFilteringException(
                "Lookup %s not supported." % lookup_name)

        return rhs, None
539407
def find(cls, name):
        ''''''
        if not cls.mapping:  # pragma: no branch
            for _, obj in inspect.getmembers(exceptions):
                if inspect.isclass(obj):
                    if issubclass(obj, exceptions.NSQException):  # pragma: no branch
                        if hasattr(obj, 'name'):
                            cls.mapping[obj.name] = obj
        klass = cls.mapping.get(name)
        if klass == None:
            raise TypeError('No matching exception for %s' % name)
        return klass
111641
def _lookup_drill(name, rdtype, timeout=None, servers=None, secure=None):
    '''
    
    '''
    cmd = 'drill '
    if secure:
        cmd += '-D -o ad '
    cmd += '{0} {1} '.format(rdtype, name)
    if servers:
        cmd += ''.join(['@{0} '.format(srv) for srv in servers])
    cmd = __salt__['cmd.run_all'](
        cmd, timeout=timeout,
        python_shell=False, output_loglevel='quiet')

    if cmd['retcode'] != 0:
        log.warning('drill returned (%s): %s', cmd['retcode'], cmd['stderr'])
        return False

    lookup_res = iter(cmd['stdout'].splitlines())
    validated = False
    res = []
    try:
        line = ''
        while 'ANSWER SECTION' not in line:
            line = next(lookup_res)
        while True:
            line = next(lookup_res)
            line = line.strip()
            if not line or line.startswith(';;'):
                break

            l_type, l_rec = line.split(None, 4)[-2:]
            if l_type == 'CNAME' and rdtype != 'CNAME':
                continue
            elif l_type == 'RRSIG':
                validated = True
                continue
            elif l_type != rdtype:
                raise ValueError('Invalid DNS type {}'.format(rdtype))

            res.append(_data_clean(l_rec))

    except StopIteration:
        pass

    if res and secure and not validated:
        return False
    else:
        return res
468127
public Object lookup(String id,String toFind)
    {
	return lookup(id,new MyWrapper(toFind));
    }
37610
function LookupList(id, capacity) {
    if (!(id instanceof Id))
        throw new Error('invalid id or selfId');
    if (!(typeof capacity === 'number' && capacity > 0))
        throw new Error('invalid capacity');
    this._id = id;
    this._capacity = capacity;
    this._slots = [];
}
173127
def _lookup_parent(self, cls):
        """"""
        codeobj = self.parent
        while codeobj is not None and not isinstance(codeobj, cls):
            codeobj = codeobj.parent
        return codeobj