Sets a new BLE device name for this SK8.

        Args:
            new_name (str): the new device name as an ASCII string, max 20 characters.

        Returns:
            True if the name was updated successfully, False otherwise.
493903
def set_device_name(self, new_name):
        

        device_name = self.get_characteristic_handle_from_uuid(UUID_DEVICE_NAME)
        if device_name is None:
            logger.warn('Failed to find handle for device name')
            return False
        
        if len(new_name) > MAX_DEVICE_NAME_LEN:
            logger.error('Device name exceeds maximum length ({} > {})'.format(len(new_name), MAX_DEVICE_NAME_LEN))
            return False

        if self.dongle._write_attribute(self.conn_handle, device_name, new_name.encode('ascii')):
            self.name = new_name
            return True

        return False
425805
def update(self, name):
        

        if name is None:
            return

        if name not in self._names:
            # add the name if it isn't already tracked
            self._names[name] = len(self._names)

        result = self._names[name] - self._current
        self._current = self._names[name]
        return result
906497
def set_device(self, device_name):
    
    device_name = unify_device_name(device_name)
    self.device_name = device_name
    for layer in self.layers:
      layer.device_name = device_name
1222394
def _set_name(self, name, inplace=False):
        
        inplace = validate_bool_kwarg(inplace, 'inplace')
        ser = self if inplace else self.copy()
        ser.name = name
        return ser
68708
def add_device(self, resource_name, device):
        

        if device.resource_name is not None:
            msg = 'The device %r is already assigned to %s'
            raise ValueError(msg % (device, device.resource_name))

        device.resource_name = resource_name

        self._internal[device.resource_name] = device
706518
def rename(self, new_name):
        

        yield from self._hypervisor.send("nio rename {name} {new_name}".format(name=self._name, new_name=new_name))

        log.info("NIO {name} renamed to {new_name}".format(name=self._name, new_name=new_name))
        self._name = new_name
296214
def update_name(self, new_name):
        

        if not dtoolcore.utils.name_is_valid(new_name):
            raise(DtoolCoreInvalidNameError())

        self._admin_metadata['name'] = new_name
        if self._storage_broker.has_admin_metadata():
            self._storage_broker.put_admin_metadata(self._admin_metadata)
711842
def rename(self, name):
        
        self.update(name='{} node {}'.format(name, self.nodeid))
335575
def setName( self, name ):
        
        self._name = projex.text.nativestring(name)
        self.setText(0, ' '.join(projex.text.words(self._name)))
240411
def new_name(self, template=u"xxx_todo_changeme"):
        
        name = template
        while name in self.used_names:
            name = template + unicode(self.numbers.next())
        self.used_names.add(name)
        return name
921287
def set_user_name(self, uid, name):
        
        data = [uid]
        if len(name) > 16:
            raise Exception('name must be less than or = 16 chars')
        name = name.ljust(16, "\x00")
        data.extend([ord(x) for x in name])
        self.xraw_command(netfn=0x06, command=0x45, data=data)
        return True
1146841
def new(self, name):
        
        #XXX:dc: assert that the name is somewhat sane and follows python
        # naming conventions
        next_id = 0
        cls_name = '_'.join((name, next_id))
        with open(pjoin(self.migration_home, name), "w+") as new_migration:
            print >> new_migration, migration_tmpl.format(
                cls_name=cls_name, migration_name=name)
949905
def renames(self, new):
        
        os.renames(self, new)
        return self._next_class(new)
21078
def name(self, new_name):
        

        if self.script_file:
            content = self.startup_script
            content = content.replace(self._name, new_name)
            escaped_name = new_name.replace('\\', '')
            content = re.sub(r"^set pcname .+$", "set pcname " + escaped_name, content, flags=re.MULTILINE)
            self.startup_script = content

        super(VPCSVM, VPCSVM).name.__set__(self, new_name)
289684
def _set_name(self, version=AUTO):
        """"""

        name = 'python'

        if version:
            if version is AUTO:
                version = sys.version_info[0]

                if version == 2:
                    version = ''

            name = '%s%s' % (name, version)

        self.name = name
1336709
def get_sanitized_bot_name(dict: Dict[str, int], name: str) -> str:
    
    if name not in dict:
        new_name = name[:31]  # Make sure name does not exceed 31 characters
        dict[name] = 1
    else:
        count = dict[name]
        new_name = name[:27] + "(" + str(count + 1) + ")"  # Truncate at 27 because we can have up to '(10)' appended
        assert new_name not in dict  # TODO: Fix collision between ["foo", "foo", "foo(1)"]
        dict[name] = count + 1

    return new_name
67254
def _buildNewKeyname(self,key,prepend):
        

        if len(prepend+key) <= 8: _new_key = prepend+key
        else: _new_key = str(prepend+key)[:8]

        return _new_key