Returns a set of all of the prefixes seen in the main document dir
324741
def _diagnose_prefixes(self):
        
        from peyotl.phylesystem import STUDY_ID_PATTERN
        p = set()
        for name in os.listdir(self.doc_dir):
            if STUDY_ID_PATTERN.match(name):
                p.add(name[:3])
        return p
1331621
def get_search_names(name):
    
    parts = re.split('[-_.]', name)
    if len(parts) == 1:
        return parts

    result = set()
    for i in range(len(parts) - 1, 0, -1):
        for s1 in '-_.':
            prefix = s1.join(parts[:i])
            for s2 in '-_.':
                suffix = s2.join(parts[i:])
                for s3 in '-_.':
                    result.add(s3.join([prefix, suffix]))
    return list(result)
809334
def dirpaths(self):
        
        parts = self.parts()
        result = [DotPath(parts[0] or '/')]
        for name in parts[1:]:
            result.append(result[-1] / name)
        return result
466003
def generateDirectoryNodeDocuments(self):
        '''
        
        '''
        all_dirs = []
        for d in self.dirs:
            d.findNestedDirectories(all_dirs)

        for d in all_dirs:
            self.generateDirectoryNodeRST(d)
87691
def findNamespaceURI(self, prefix, node):
        """"""
        attrkey = (self.NS_XMLNS, prefix)
        DOCUMENT_NODE = node.DOCUMENT_NODE
        ELEMENT_NODE = node.ELEMENT_NODE
        while 1:
            if node is None:
                raise DOMException('Value for prefix %s not found.' % prefix)
            if node.nodeType != ELEMENT_NODE:
                node = node.parentNode
                continue
            result = node._attrsNS.get(attrkey, None)
            if result is not None:
                return result.value
            if hasattr(node, '__imported__'):
                raise DOMException('Value for prefix %s not found.' % prefix)
            node = node.parentNode
            if node.nodeType == DOCUMENT_NODE:
                raise DOMException('Value for prefix %s not found.' % prefix)
1338503
function findInternalPrefixes(property, noAutofill) {
		var result = [];
		var prefixes = findVendorPrefixes(property);
		
		if (prefixes) {
			var prefixMap = {};
			Object.keys(vendorPrefixes).forEach(function(key) {
				prefixMap[vendorPrefixes[key].prefix] = key;
			});

			result = prefixes.map(function(prefix) {
				return prefixMap[prefix];
			});
		}
		
		if (!result.length && !noAutofill) {
			// add all non-obsolete prefixes
			Object.keys(vendorPrefixes).forEach(function(prefix) {
				if (!vendorPrefixes[prefix].obsolete) {
					result.push(prefix);
				}
			});
		}
		
		return result;
	}
27984
def get_prefix_source(cls):
        """"""
        try:
            return cls.override_prefix()
        except AttributeError:
            if hasattr(cls, '_prefix_source'):
                return cls.site + cls._prefix_source
            else:
                return cls.site
484939
private String getPrefix()
    {
        final String prefix;
        if (loader.isPresent())
        {
            prefix = loader.get().getPackage().getName().replace(Constant.DOT, File.separator);
        }
        else
        {
            prefix = resourcesDir;
        }
        return prefix;
    }
660213
def _file_prefix(
            self):
        
        self.log.info('starting the ``_file_prefix`` method')

        if self.ra:
            now = datetime.now()
            prefix = now.strftime("%Y%m%dt%H%M%S%f_tns_conesearch_")
        elif self.name:
            prefix = self.name + "_tns_conesearch_"
        elif self.internal_name:
            prefix = self.internal_name + "_tns_conesearch_"
        elif self.discInLastDays:
            discInLastDays = str(self.discInLastDays)
            now = datetime.now()
            prefix = now.strftime(
                discInLastDays + "d_since_%Y%m%d_tns_conesearch_")

        self.log.info('completed the ``_file_prefix`` method')
        return prefix
357717
public static File [] getFilesWithPrefix(File dir, final String prefix) {
        FileFilter prefixFilter = new FileFilter() {
                public boolean accept(File pathname)
                {
                    return pathname.getName().toLowerCase().
                        startsWith(prefix.toLowerCase());
                }
            };
        return dir.listFiles(prefixFilter);
    }
733249
def visitPrefixDecl(self, ctx: ShExDocParser.PrefixDeclContext):
        
        iri = self.context.iriref_to_shexj_iriref(ctx.IRIREF())
        prefix = ctx.PNAME_NS().getText()
        if iri not in self.context.ld_prefixes:
            self.context.prefixes.setdefault(prefix, iri.val)
417803
def get_prefix_dir(archive):
    
    names = archive.namelist()
    shortest_name = sorted(names, key=len)[0]
    candidate_prefixes = [
        shortest_name[:length]
        for length in range(len(shortest_name), -1, -1)
    ]
    for prefix in candidate_prefixes:
        if all(name.startswith(prefix) for name in names):
            return prefix
    return ''
1252642
def list_extmods():
    '''
    
    '''
    ret = {}
    ext_dir = os.path.join(__opts__['cachedir'], 'extmods')
    mod_types = os.listdir(ext_dir)
    for mod_type in mod_types:
        ret[mod_type] = set()
        for _, _, files in salt.utils.path.os_walk(os.path.join(ext_dir, mod_type)):
            for fh_ in files:
                ret[mod_type].add(fh_.split('.')[0])
        ret[mod_type] = list(ret[mod_type])
    return ret
659523
def prefix_list(self, prefix, values):
        
        return list(map(lambda value: prefix + " " + value, values))
417097
def keys(self, prefix=None, delimiter=None):
        
        if delimiter:
            # WE REALLY DO NOT GET KEYS, BUT RATHER Prefix OBJECTS
            # AT LEAST THEY ARE UNIQUE
            candidates = [k.name.rstrip(delimiter) for k in self.bucket.list(prefix=prefix, delimiter=delimiter)]
        else:
            candidates = [strip_extension(k.key) for k in self.bucket.list(prefix=prefix)]

        if prefix == None:
            return set(c for c in candidates if c != "0.json")
        else:
            return set(k for k in candidates if k == prefix or k.startswith(prefix + ".") or k.startswith(prefix + ":"))
470430
def _get_cropped_file_names(self):
        """"""
        files = [ff.name for ff in self.files]
        prefix = commonprefix(files)
        suffix = commonprefix([f[::-1] for f in files])[::-1]
        cropped = [f[len(prefix):-len(suffix)] for f in files]
        return cropped
1192306
def attributes(self):
        """"""
        return [
            obj[len(IMPL_PREFIX) :] for obj in dir(self) if obj.startswith(IMPL_PREFIX)
        ]