Return list of extensions with given Oid
322731
def find(self, oid):
        
        if not isinstance(oid, Oid):
            raise TypeError("Need crytypescrypto.oid.Oid as argument")
        found = []
        index = -1
        end = len(self)
        while True:
            index = libcrypto.X509_get_ext_by_NID(self.cert.cert, oid.nid,
                                                  index)
            if index >= end or index < 0:
                break
            found.append(self[index])
        return found
1116636
public Extension getExtension(ObjectIdentifier oid) {
        if (info == null) {
            return null;
        }
        try {
            CertificateExtensions extensions;
            try {
                extensions = (CertificateExtensions)info.get(CertificateExtensions.NAME);
            } catch (CertificateException ce) {
                return null;
            }
            if (extensions == null) {
                return null;
            } else {
                Extension ex = extensions.getExtension(oid.toString());
                if (ex != null) {
                    return ex;
                }
                for (Extension ex2: extensions.getAllExtensions()) {
                    if (ex2.getExtensionId().equals((Object)oid)) {
                        //XXXX May want to consider cloning this
                        return ex2;
                    }
                }
                /* no such extension in this certificate */
                return null;
            }
        } catch (IOException ioe) {
            return null;
        }
    }
229666
public List<Extension> getLoadedExtensions() {
		if (loadedExtensions == null) {
			return Collections.emptyList();
		}
		return Collections.unmodifiableList(loadedExtensions);
	}
309439
def get_extensions(cls):
        
        assemblies = []
        for waldur_extension in pkg_resources.iter_entry_points('waldur_extensions'):
            extension_module = waldur_extension.load()
            if inspect.isclass(extension_module) and issubclass(extension_module, cls):
                if not extension_module.is_assembly():
                    yield extension_module
                else:
                    assemblies.append(extension_module)
        for assembly in assemblies:
            yield assembly
555177
public static List<ScopeListExtension> findAll(Collection<? extends Extension> extensions)
    {
        List<ScopeListExtension> result = new ArrayList<ScopeListExtension>();
        for (Extension extension : extensions)
        {
            if (SCOPE_LIST_EXTENSION_ID == extension.getId())
                result.add((ScopeListExtension)extension);
        }
        return result;
    }
917274
def get_extensions(extstr):
    """"""
    # Extension examples:
    #   has_direct_input(UniProtKB:P37840),occurs_in(GO:0005576)
    #   part_of(UBERON:0006618),part_of(UBERON:0002302)
    #   occurs_in(CL:0000988)|occurs_in(CL:0001021)
    if not extstr:
        return None
    exts = []
    for ext_lst in extstr.split('|'):
        grp = []
        for ext in ext_lst.split(','):
            idx = ext.find('(')
            if idx != -1 and ext[-1] == ')':
                grp.append(AnnotationExtension(ext[:idx], ext[idx+1:-1]))
            else:
                # Ignore improperly formatted Extensions
                sys.stdout.write('BAD Extension({E})\n'.format(E=ext))
        exts.append(grp)
    return AnnotationExtensions(exts)
1252293
def iter_extensions(self):
        """"""
        return iter(sorted(self.extensions.values(),
                           key=lambda x: x.priority))
433875
def listAttachments(self, oid):
        
        url = self._url + "/%s/attachments" % oid
        params = {
            "f":"json"
        }
        return self._get(url, params,
                            securityHandler=self._securityHandler,
                            proxy_port=self._proxy_port,
                            proxy_url=self._proxy_url)
678693
def get_methods(extension_name):
    
    extension = get_extension(extension_name)
    methods = {}
    for name, i in inspect.getmembers(extension):
        if hasattr(i, 'nago_access'):
            api_name = i.nago_name
            methods[api_name] = i
    return methods
72272
function findTypeForExtend(types, extend) {
  var orig = types.find(ea => ea.name === extend.name && ea.type !== "extend");
  if (!orig) throw new Error("Cannot find original for extension " + JSON.stringify(extend, null, 2));
  return orig;
}
1118832
def match_extension(f):
    ''''''
    (root,ext) = os.path.splitext(f)
    return ext.lower() in extensions
54864
def extensions(self):
        
        encoded_extensions = []
        for ext in self._extension_files:
            file_ = open(ext, 'rb')
            # Should not use base64.encodestring() which inserts newlines every
            # 76 characters (per RFC 1521).  Chromedriver has to remove those
            # unnecessary newlines before decoding, causing performance hit.
            encoded_extensions.append(base64.b64encode(file_.read()).decode('UTF-8'))

            file_.close()
        return encoded_extensions + self._extensions
722003
def list(self, domain=None):
        """"""
        # pylint: disable=arguments-differ
        if domain:
            return self._list(domain)
        url = "{base}".format(
            base="domains"
        )
        domains = self.core.get(url)
        res = []
        for dom in domains:
            domain_uuid = dom.get('identifier')
            url = "{base}".format(
                base=self.local_base_url
            )
            param = {
                'domainUuid': domain_uuid
            }
            encode = urllib.urlencode(param)
            if encode:
                url += "?"
                url += encode
            res += self.core.list(url)
        return res
859399
public static List<AttributeListExtension> findAll(Collection<? extends Extension> extensions)
    {
        List<AttributeListExtension> result = new ArrayList<AttributeListExtension>();
        for (Extension extension : extensions)
        {
            if (ATTRIBUTE_LIST_EXTENSION_ID == extension.getId())
                result.add((AttributeListExtension)extension);
        }
        return result;
    }
1193604
def walk_oid(self, oid):
        """"""
        var = netsnmp.Varbind(oid)
        varlist = netsnmp.VarList(var)
        data = self.walk(varlist)
        if len(data) == 0:
            raise SnmpException("SNMP walk response incomplete")
        return varlist
343617
public List<Extensions> queryByExtension(String extensionName)
			throws SQLException {

		QueryBuilder<Extensions, Void> qb = queryBuilder();

		setUniqueWhere(qb.where(), extensionName, false, null, false, null);

		List<Extensions> extensions = qb.query();

		return extensions;
	}
591946
public static List<File> getFilesByExtension(File dir, String[] extensions)
    {
        if (!dir.isDirectory() || extensions == null)
            return Collections.emptyList();
        List<File> files = new ArrayList<File>();
        addFilesByExtension(files, dir, extensions);
        return files;
    }