Adds the specified *prefix* to the last path element in *subject*.
  If *prefix* is a callable, it must accept exactly one argument, which
  is the last path element, and return a modified value.
422650
def addprefix(subject, prefix):
  

  if not prefix:
    return subject
  dir_, base = split(subject)
  if callable(prefix):
    base = prefix(base)
  else:
    base = prefix + base
  return join(dir_, base)
575102
def remove_prefix(self, prefix):
        
        if prefix not in self.__prefix_map:
            return

        ni = self.__lookup_prefix(prefix)
        ni.prefixes.discard(prefix)
        del self.__prefix_map[prefix]

        # If we removed the preferred prefix, find a new one.
        if ni.preferred_prefix == prefix:
            ni.preferred_prefix = next(iter(ni.prefixes), None)
271988
def add_prefix(network):
    
    p = new_prefix()
    p.prefix = str(network['network'])
    p.type = "assignment"
    p.description = network['description']
    p.tags = ['ipplan-import']
    p.comment = ""

    if 'additional' in network:
        p.comment += network['additional']
    if len(network['comment']) > 0:
        p.comment += network['comment']
    return p
1171740
def add_prefix(prefix, s):
    ""
    # tokenize the XPath expression
    toks = xpath_lexer.scan(s)
    # add default prefix to unprefixed names
    toks2 = [_add_prefix(prefix, tok) for tok in toks]
    # build a string of the patched expression
    ls = [x.value for x in toks2]
    return ''.join(ls)
206135
def rename_with_prefix(self, prefix="", new_path=None, in_place=True, remove_desc=True):
        """"""
        # Temporary path #
        if new_path is None: prefixed = self.__class__(new_temp_path())
        else:                prefixed = self.__class__(new_path)
        # Generator #
        def prefixed_iterator():
            for i,read in enumerate(self):
                read.id = prefix + read.id
                if remove_desc: read.description = ""
                yield read
        # Do it #
        prefixed.write(prefixed_iterator())
        prefixed.close()
        # Replace it #
        if in_place:
            os.remove(self.path)
            shutil.move(prefixed, self.path)
        return prefixed
1357334
def setup_prefix_suffix(self):
        

        self.compile_prefix = 'compile_'
        self.sourcepath_suffix = '_sourcepath'
        self.modpath_suffix = '_modpaths'
        self.targetpath_suffix = '_targetpaths'
626221
def add_attribute(self, path, name, value):
        
        node = self.add(path)
        node.attribs.append((name, value))
        return node
988942
def addsuffix(subject, suffix, replace=False):
  

  if not suffix and not replace:
    return subject
  if replace:
    subject = rmvsuffix(subject)
  if suffix and callable(suffix):
    subject = suffix(subject)
  elif suffix:
    subject += suffix
  return subject
656912
def add_child(self, label_str, type_str):
        """"""
        child_node = SubjectInfoNode(label_str, type_str)
        child_node.parent = self
        self.child_list.append(child_node)
        return child_node
1175892
def add(map, use_offsets=true)
      raise ArgumentError, 'XmlSitemap::Map object required!' unless map.kind_of?(XmlSitemap::Map)
      raise ArgumentError, 'Map is empty!' if map.empty?
      
      @maps << {
        :loc     => use_offsets ? map.index_url(@offsets[map.group], @secure) : map.plain_index_url(@secure),
        :lastmod => map.created_at.utc.iso8601
      }
      @offsets[map.group] += 1
    end
1359628
def expandPath (pathname, prefix=None):
    
    if prefix is None:
        prefix = ''

    expanded = pathname

    if pathname[0] == '~':
        expanded = os.path.expanduser(pathname)
    elif pathname[0] != '/':
        expanded = os.path.join(prefix, pathname)

    return os.path.abspath(expanded)
1117947
def addlast(self, item, new_priority=None):
        """"""

        with self.lock:

            self_data = self.data
            maxlen = self._maxlen

            if maxlen is not None and maxlen == len(self_data):
                return

            try:
                priority = self_data[-1][1]
                if new_priority is not None:
                    if new_priority > priority:
                        raise ValueError('Priority must be <= '
                                         'lowest priority.')
                    else:
                        priority = new_priority
            except IndexError:
                priority = 0 if new_priority is None else new_priority

            self_data.append((item, priority))
            self_items = self.items

            try:
                self_items[item] += 1
            except TypeError:
                self_items[repr(item)] += 1
289703
private void addLastOfType() {
		for (Node node : nodes) {
			Index index = helper.getIndexInParent(node, true);
			if (index.index == (index.size-1))
				result.add(node);
		}
	}
353047
def addNodeLabelPrefix(self, prefix=None, copy=False):
        '''
        
        '''
        nxgraph = Topology.__relabel_graph(self.__nxgraph, prefix)
        if copy:
            newtopo = copy.deepcopy(self)
            newtopo.nxgraph = nxgraph
            return newtopo
        else:
            # looks like it was done in place
            self.__nxgraph = nxgraph
18160
def add_ap(self, id_, label=None, addPrefix=True):
        
        self.add_trip(id_, rdf.type, owl.AnnotationProperty)
        if label:
            self.add_trip(id_, rdfs.label, label)
            if addPrefix:
                prefix = ''.join([s.capitalize() for s in label.split()])
                namespace = self.expand(id_)
                self.add_namespace(prefix, namespace)
238681
def prefix(self, name):
        
        a_node = self.adapter.get_node_attribute_node(self.impl_element, name)
        if a_node is None:
            return None
        return a_node.prefix
735274
def add_static_path(self, prefix: str, path: str) -> None:
        
        pattern = prefix
        if not pattern.startswith('/'):
            pattern = '/' + pattern
        if not pattern.endswith('/(.*)'):
            pattern = pattern + '/(.*)'
        self.add_handlers(
            r'.*',  # add static path for all virtual host
            [(pattern, StaticFileHandler, dict(path=path))]
        )