Find everything in the given prefix
346680
def find_all(self, prefix):
        '''
        
        '''
        prefix = ip_network(prefix)

        # Check that we are authoritative for the given prefix
        if not self.prefix.overlaps(prefix) \
        or self.prefix[0] > prefix[0] \
        or self.prefix[-1] < prefix[-1]:
            raise NotAuthoritativeError('This node is not authoritative for %r'
                                        % prefix)

        # Find all matching existing prefixes and return them in a set
        matches = set()
        for child in self.children:
            if prefix.overlaps(child.prefix):
                matches.add(child)

        return matches
221734
public FunctionList prefix(final String prefix) {
        return filter(new Filter() {
            public boolean keep(Function m) {
                return m.getName().startsWith(prefix);
            }
        });
    }
1279156
def is_prefix(pre_path, path):
    """"""
    pre_path = pre_path.strip('.')
    path = path.strip('.')
    return not pre_path or path.startswith(pre_path + '.')
908718
def extract_config(config, prefix):
    """"""
    prefix = prefix.strip('.') + '.'
    plen = len(prefix)
    value = {}
    for k, v in config.items():
        if k.startswith(prefix):
            value[k[plen:]] = v
    return value
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;
	}
358812
def find_by_prefix(prefix)
      @machines.each do |uuid, data|
        return data.merge("id" => uuid) if uuid.start_with?(prefix)
      end

      nil
    end
181851
def namespace_for_prefix(self, prefix):
        
        try:
            ni = self.__lookup_prefix(prefix)
        except PrefixNotFoundError:
            return None
        else:
            return ni.uri
938905
def _filter_settings(settings, prefix):
    
    ret = {}
    for skey in settings.keys():
        if skey.startswith(prefix):
            key = skey[len(prefix):]
            ret[key] = settings[skey]
    return ret
375832
def trim_common_prefixes(strs, min_len=0):
    """"""

    trimmed = 0

    if len(strs) > 1:
        s1 = min(strs)
        s2 = max(strs)

        for i in range(len(s1) - min_len):
            if s1[i] != s2[i]:
                break
            trimmed = i + 1

    if trimmed > 0:
        strs = [s[trimmed:] for s in strs]

    return trimmed, strs
856398
public function find_by_prefix($prefix) {
        $return = [];
        foreach ($this->find_all() as $key) {
            if (strpos($key, $prefix) === 0) {
                $return[] = $key;
            }
        }
        return $return;
    }
1141813
def prefix(self, prefix):
        
        original_prefix = self._prefix
        self._prefix += prefix
        yield self
        self._prefix = original_prefix
1172786
private Stack getPrefixStack(String prefix) {
        Stack fs = (Stack) m_namespaces.get(prefix);
        return fs;
    }
529468
def find_best_match(path, prefixes):
    """"""
    path_parts = path.split('.')
    for p in prefixes:
        if len(p) <= len(path_parts) and p == path_parts[:len(p)]:
            return '.'.join(p), '.'.join(path_parts[len(p):])
    return '', path
853869
def prefix_search(self, job_name_prefix):
        """"""
        json = self._fetch_json()
        jobs = json['response']
        for job in jobs:
            if job.startswith(job_name_prefix):
                yield self._build_results(jobs, job)
1100727
def extract_prefix_attr(cls, req):
        

        # TODO: add more?
        attr = {}
        if 'id' in req:
            attr['id'] = int(req['id'])
        if 'prefix' in req:
            attr['prefix'] = req['prefix']
        if 'pool' in req:
            attr['pool_id'] = int(req['pool'])
        if 'node' in req:
            attr['node'] = req['node']
        if 'type' in req:
            attr['type'] = req['type']
        if 'country' in req:
            attr['country'] = req['country']
        if 'indent' in req:
            attr['indent'] = req['indent']

        return attr
876167
def make_prefix(self, prefix, iterable):
        
        if not prefix:
            yield from iterable

        for key, value in iterable:
            yield f"{prefix}_{key}", value
576233
def prefixed(self, prefix):
        """"""
        old_prefix = self._prefix
        if old_prefix is None:
            self._prefix = prefix
        else:
            self._prefix = "{}{}".format(old_prefix, prefix)
        yield self
        self._prefix = old_prefix