Prefix a collection name
5156
function(metric_type, metric) {
	var ary = metric.split('.');
	if (options.prefix) ary.shift();
	ary.unshift(metric_type);
	return ary.join('.')+'_'+options.rate;
}
377226
def add_prefix_and_suffix(specified_name, type, property_set):
    """"""

    property_set = b2.util.jam_to_value_maybe(property_set)

    suffix = ""
    if type:
        suffix = b2.build.type.generated_target_suffix(type, property_set)

    # Handle suffixes for which no leading dot is desired.  Those are
    # specified by enclosing them in <...>.  Needed by python so it
    # can create "_d.so" extensions, for example.
    if get_grist(suffix):
        suffix = ungrist(suffix)
    elif suffix:
        suffix = "." + suffix

    prefix = ""
    if type:
        prefix = b2.build.type.generated_target_prefix(type, property_set)

    if specified_name.startswith(prefix):
        prefix = ""

    if not prefix:
        prefix = ""
    if not suffix:
        suffix = ""
    return prefix + specified_name + suffix
700416
def prefix(self, format="sparql"):
        ''' 
        '''

        lg = logging.getLogger("%s.%s" % (self.ln, inspect.stack()[0][3]))
        lg.setLevel(self.log_level)

        _return_str = ""
        if format.lower() == "sparql":
            return "\n".join([ns._sparql_ for ns in self.namespaces])
        elif format.lower() in ["turtle", "ttl"]:
            return "\n".join([ns._ttl_ for ns in self.namespaces])
        elif format.lower() in ["rdf", "xml", "rdf/xml"]:
            return "<rdf:RDF %s>" % \
                    " ".join([ns._xml_ for ns in self.namespaces])
        else:
            raise NotImplementedError("'%s' is not a valid prefix type." %
                                      format)
61397
def regenerate_prefixes(self, *args):
        """"""
        nick = self.controller.client.user.nick
        self.prefixes = set([
            nick + ": ",
            nick + ", ",
            nick + " - ",
        ])
        # Include lower-case versions as well, but not caps
        self.prefixes.update([p.lower() for p in self.prefixes])
        if self.sigil:
            self.prefixes.add(self.sigil)
1069350
function prefix(event, properties) {
  var prefixed = {};
  each(properties, function(key, val) {
    if (key === 'Billing Amount') {
      prefixed[key] = val;
    } else {
      prefixed[event + ' - ' + key] = val;
    }
  });
  return prefixed;
}
728996
def get_prefix(dir="../"):
    
    prefix = glob(dir + "*.gkpStore")[0]
    prefix = op.basename(prefix).rsplit(".", 1)[0]

    return prefix
987383
def parse_collection(self, item_file_prefix: str, base_item_type: Type[T], item_name_for_log: str = None,
                         file_mapping_conf: FileMappingConfiguration = None,
                         options: Dict[str, Dict[str, Any]] = None) -> Dict[str, T]:
        
        # -- item_name_for_log
        item_name_for_log = item_name_for_log or ''
        check_var(item_name_for_log, var_types=str, var_name='item_name_for_log')

        # creating the wrapping dictionary type
        collection_type = Dict[str, base_item_type]
        if len(item_name_for_log) > 0:
            item_name_for_log = item_name_for_log + ' '
        self.logger.debug('**** Starting to parse ' + item_name_for_log + 'collection of <'
                          + get_pretty_type_str(base_item_type) + '> at location ' + item_file_prefix +' ****')

        # common steps
        return self._parse__item(collection_type, item_file_prefix, file_mapping_conf, options=options)
1122386
private ArtifactNotification collectNotificationsForPrefix(String prefix, Collection<String> paths) {
        Set<String> gatheredPaths = new HashSet<String>();
        boolean notRecurse = prefix.startsWith("!");
        if (notRecurse) {
            prefix = prefix.substring(1);
        }

        if ("/".equals(prefix)) {
            gatheredPaths.addAll(paths);
        } else {
            for (String path : paths) {
                if (path.startsWith(prefix + "/") || path.equals(prefix)) {
                    if (notRecurse) {
                        //needs a bit more care.. user asked for prefix, and immediate children..
                        //strip the prefix from the front.. this should always work.. as path has to be at least one char, as does prefix.
                        String fragment = path.substring(prefix.length());
                        //if resulting fragment has no path seps, notify on it.
                        // <1 lets / exist as first char or not at all
                        if (fragment.indexOf("/") < 1) {
                            gatheredPaths.add(path);
                        }
                    } else {
                        gatheredPaths.add(path);
                    }
                }
            }
        }
        return new DefaultArtifactNotification(root, gatheredPaths);
    }
531216
function pluck(collection, propertyName) {
  if (!collection || typeof collection != 'object') {
    return new Error('expected first argument to be an object or array');
  }

  var result, len, i, keys, key;
  if (Array.isArray(collection)) {
    result = [];
    len = collection.length;
    for (i = 0; i < len; i++) {
      result.push(collection[i][propertyName]);
    }
  } else {
    result = {};
    keys = Object.keys(collection);
    len = keys.length;
    for (i = 0; i < len; i++) {
      key = keys[i];
      result[key] = collection[key][propertyName];
    }
  }
  return result;
}
102287
def collection_names
      namespaces = self["system.namespaces"].find(name: { "$not" => /#{name}\.system\.|\$/ })
      namespaces.map do |doc|
        _name = doc["name"]
        _name[name.length + 1, _name.length]
      end
    end
393449
def prefixed_name(self) -> Tuple[YangIdentifier, Optional[YangIdentifier]]:
        """"""
        i1 = self.yang_identifier()
        try:
            next = self.peek()
        except EndOfInput:
            return (i1, None)
        if next != ":":
            return (i1, None)
        self.offset += 1
        return (self.yang_identifier(), i1)
84144
def get_prefix(self):
        """"""
        prefix = self.bucket
        if self.prefix:
            prefix += self.separator + self.prefix
        return prefix
28205
def path(name):
    """"""
    try:
        coll = Collection.query.filter(Collection.name == name).one()
        tr = LeftAligned(
            traverse=CollTraversalPathToRoot(coll.path_to_root().all()))
        click.echo(tr(coll))
    except NoResultFound:
        raise click.UsageError('Collection {0} not found'.format(name))
894149
function prefixKey(key) {
    if (self.nameSpace.length > 0 && !key.startsWith(self.nameSpace)) {
      return `${self.nameSpace}:${key}`
    }
    return key;
  }
378432
function (collection, settings, html, oldIndex, newIndex, oldKey, newKey) {
            var toReplace = new RegExp(pregQuote(settings.name_prefix + '[' + oldKey + ']'), 'g');
            var replaceWith = settings.name_prefix + '[' + newKey + ']';
            html = html.replace(toReplace, replaceWith);

            toReplace = new RegExp(pregQuote(collection.attr('id') + '_' + oldIndex), 'g');
            replaceWith = collection.attr('id') + '_' + newIndex;
            html = html.replace(toReplace, replaceWith);

            return html;
        }
558242
function prefix(pattern) {
        if (!pattern) {
            pattern = 'grunt-available-tasks';
        }
        pattern = pattern.replace(/^node_modules\//, '');
        var ret;
        if (grunt.file.expand('node_modules/' + pattern).length) {
            ret = 'node_modules/';
        } else if (grunt.file.expand('../../node_modules/' + pattern).length) {
            ret = '../../node_modules/';
        } else if (grunt.file.expand('node_modules/chronicles_of_grunt/node_modules/' + pattern).length) {
            ret = 'node_modules/chronicles_of_grunt/node_modules/';
        } else {
            grunt.fail.fatal("Cannot find module path for " + pattern);
        }
        return ret;
    }
424619
def prefix_iter(self, ns_uri):
        """"""
        ni = self.__lookup_uri(ns_uri)
        return iter(ni.prefixes)