Construct a staiion name.
320942
def __getStationName(name, id):
    """"""
    name = name.replace("Meetstation", "")
    name = name.strip()
    name += " (%s)" % id
    return name
684688
def name_replace(self, to_replace, replacement):
        """"""
        self.name = self.name.replace(to_replace, replacement)
781724
def __username(self, fname, lname):  # pragma: no cover
        """"""
        self.username = '.'.join([i.lower() for i in [fname, lname]])
1224574
def generate_unique_name(self, basename):
        """"""
        counts = self.__counts
        try:
            count = counts[basename]
            counts[basename] += 1
        except KeyError:
            count = 0
            counts[basename] = 1
            
        prefix = self.Naming_prefix

        if count == 0:
            name = prefix + basename
        else:
            name = prefix + basename + "_" + str(count)
            
        if prefix != "" or count != 0:
            try:
                count = counts[name]
                return self.generate_unique_name(name)
            except KeyError:
                # wasn't already used so return it
                counts[name] = 1
        return name
717804
def get_name(self):
        """"""
        if self.given_name is None:
            # Name according to host
            if self.hostname is None:
                name = _("Console")
            else:
                name = self.hostname
            # Adding id to name
            client_id = self.id_['int_id'] + u'/' + self.id_['str_id']
            name = name + u' ' + client_id
        elif self.given_name in ["Pylab", "SymPy", "Cython"]:
            client_id = self.id_['int_id'] + u'/' + self.id_['str_id']
            name = self.given_name + u' ' + client_id
        else:
            name = self.given_name + u'/' + self.id_['str_id']
        return name
58788
def _generate_unique_name(seed, existing_names):
        '''
        
        '''
        if seed == '':
            raise ValueError('Name seed must be an non-empty string')

        # Make the seed meet C-style naming convention
        seed = re.sub('[^0-9a-zA-Z]', '_', seed)  # Only alphabets and numbers are allowed
        if re.match('^[0-9]', seed):  # The first symbol cannot be a number
            seed = '_' + seed

        # If seed has never been seen, we return it as it is. Otherwise, we will append an number to make it unique.
        if seed not in existing_names:
            existing_names.add(seed)
            return seed
        else:
            i = 1
            while seed + str(i) in existing_names:
                i += 1
            new_name = seed + str(i)
            existing_names.add(new_name)
            return new_name
1193648
def random_name_gen(size=6):
    """"""

    return ''.join(
        [random.choice(string.ascii_uppercase)] +
        [random.choice(string.ascii_uppercase + string.digits) for i in range(size - 1)]
    ) if size > 0 else ''
171962
def __StripName(self, name):
        """"""
        if not name:
            return name
        for prefix in self.__strip_prefixes:
            if name.startswith(prefix):
                return name[len(prefix):]
        return name
178917
def _process_name(name):
    """"""

    # Unescape HTML entities
    name = unescape(name)

    # Remove bracketed stuff on the end
    name = NG_RE.sub('', name).strip()  # Nomenclature groups
    name = END_RE.sub('', name).strip(', ')  # Words
    name = RATIO_RE.sub('', name).strip(', ')  # Ratios

    # Remove stuff off start
    name = START_RE.sub('', name).strip()

    # Remove balanced start and end brackets if none in between
    name = BRACKET_RE.sub('\g<1>', name)

    # Un-invert CAS style names
    comps = name.split(', ')
    if len(comps) == 2:
        if comps[1].endswith('-'):
            name = comps[0]
            name = '%s%s' % (comps[1], name)
    elif len(comps) > 2:
        name = comps[0]
        for i in range(1, len(comps)):
            if comps[i].endswith('-'):
                name = '%s%s' % (comps[i], name)
            else:
                name = '%s %s' % (name, comps[i])
    return name
1013872
def _init_name_core(self, name: str):
        """"""
        self.__regex = re.compile(rf'^{self._pattern}$')
        self.name = name
177741
def unique(self, name):
    """"""
    # Make sure the name is valid
    name = self.valid(name)
    # Make sure it's not too long
    name = self.trim(name)
    # Now make sure it's unique
    unique_name = name
    i = 2
    while unique_name in self.names:
      unique_name = name + str(i)
      i += 1
    self.names.add(unique_name)
    return unique_name
1183065
def _prepend_name(self, prefix, dict_):
        ''''''
        return dict(['.'.join([prefix, name]), msg]
                    for name, msg in dict_.iteritems())
919959
def name(self):
        """"""
        name = self.__class__.__name__
        for i, character in enumerate(name):
            if character.isdigit():
                return name[:i] + "-" + name[i:]
        return name
601707
def buildQName(ncname, prefix, memory, len):
    
    ret = libxml2mod.xmlBuildQName(ncname, prefix, memory, len)
    return ret
564698
def name(self):
        """"""
        for arg in self.args:
            if arg.startswith("--"):
                return arg[2:].replace("-", "_")
            elif arg.startswith("-"):
                continue
            else:
                return arg.replace("-", "_")
583017
def _gen_name(self):
        
        """
        n = [0]
        for item in self.keys():
            if item.startswith('sim_'):
                n.append(int(item.split('sim_')[1]))
        name = 'sim_'+str(max(n)+1).zfill(2)
        return name
479622
def t_name(self, s):
        '
        if s in RESERVED_WORDS:
            self.add_token(s.upper(), s)
        else:
            self.add_token('NAME', s)