Find a I{port} by name (string) or index (integer).
        @param name: The name (or index) of a port.
        @type name: (int|str)
        @return: A L{MethodSelector} for the found port.
        @rtype: L{MethodSelector}.
505144
def __find(self, name):
        
        port = None
        if not len(self.__ports):
            raise Exception('No ports defined: %s' % self.__qn)
        if isinstance(name, int):
            qn = '%s[%d]' % (self.__qn, name)
            try:
                port = self.__ports[name]
            except IndexError:
                raise PortNotFound(qn)
        else:
            qn = '.'.join((self.__qn, name))
            for p in self.__ports:
                if name == p.name:
                    port = p
                    break
        if port is None:
            raise PortNotFound(qn)
        qn = '.'.join((self.__qn, port.name))
        return MethodSelector(self.__client, port.methods, qn)
231478
public static String getByName(String name) {
        String val = multipoints.get(name);
        if (val != null)
            return val;
        int codepoint = extended.codepointForName(name);
        if (codepoint != empty)
            return new String(new int[]{codepoint}, 0, 1);
        return emptyName;
    }
971177
def findport(self, port):
        
        for p in self.ports:
            if p[0] == p:
                return p
        p = (port, [])
        self.ports.append(p)
        return p
30219
private Parameter getParameterByName(String name)
    {
        if (getParameters() != null)
        {
            for (Parameter p : parameters)
            {
                if (name.equals(p.getName()))
                {
                    return p;
                }
            }
        }

        return null;
    }
851948
def get_by_name(self, name):
        
        scopes = self._client.get_all()
        result = [x for x in scopes if x['name'] == name]
        return result[0] if result else None
938167
protected int findVarDef( String name)
    {
    int varCount = name==null? 0 : vars_.size();
    int i;
    for( i = 0; i < varCount && !name.equals( vars_.get(i).getName()); i++);
    return i < varCount? i : -1;
    }
961347
public TypeName findParameterTypeByAliasOrName(String name) {
		if (parameterAlias2NameField.containsKey(name)) {
			return findParameterType(parameterAlias2NameField.get(name));
		}

		return findParameterType(name);
	}
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
676410
public int idxForName(final String name) {
    final Integer id = this.name2idx.get(name);
    return id == null ? -1 : id;
  }
692619
public ModuleItem find(String name) {
        if (children == null)
            return null;
        else
            return (ModuleItem) children.get(name);

        /*
         * for(int i=0; i<children.size(); i++)
         * {
         * ModuleItem item = (ModuleItem)children.get(i);
         * if(item.instance != null)
         * {
         * if(item.instance.getName().equals(name))
         * return item;
         * }
         * }
         * return null;
         */
    }
723596
def get_methods_by_name(self, name):
        

        return (m for m in self.methods if m.get_name() == name)
851391
public T get(final String name) {
        for (final T i : this) {
            if (i.getName().equals(name)) {
                return i;
            }
        }
        return null;
    }
71903
public static OptionElement findByName(List<OptionElement> options, String name) {
    checkNotNull(options, "options");
    checkNotNull(name, "name");

    OptionElement found = null;
    for (OptionElement option : options) {
      if (option.name().equals(name)) {
        if (found != null) {
          throw new IllegalStateException("Multiple options match name: " + name);
        }
        found = option;
      }
    }
    return found;
  }
207089
public IndexDef getIndex(String name)
    {
        String   realName = (name == null ? "" : name);
        IndexDef def      = null;

        for (Iterator it = getIndices(); it.hasNext();)
        {
            def = (IndexDef)it.next();
            if (def.getName().equals(realName))
            {
                return def;
            }
        }
        return null;
    }
986561
public IVarDef getMember( String name)
    {
    int i = findMember( name);
    return i >= 0? members_.get(i) : null;
    }
412656
public String get(String name) {
        Parameter param = parameters.get(name);
        if (param != null)
            return param.value;
        else
            return null;
    }
1367320
public String find(String name) {
        String value = null;
        for (DataBinder top = this; top != null && (value = top.get(name)) == null; top = top.getLower());
        return value;
    }