If XML-API (http://www.homematic-inside.de/software/addons/item/xmlapi) is installed on CCU this function will add names to CCU devices
554215
def addDeviceNames(self, remote):
        
        LOG.debug("RPCFunctions.addDeviceNames")

        # First try to get names from metadata when nur credentials are set
        if self.remotes[remote]['resolvenames'] == 'metadata':
            for address in self.devices[remote]:
                try:
                    name = self.devices[remote][
                        address]._proxy.getMetadata(address, 'NAME')
                    self.devices[remote][address].NAME = name
                    for address, device in self.devices[remote][address].CHANNELS.items():
                        device.NAME = name
                        self.devices_all[remote][device.ADDRESS].NAME = name
                except Exception as err:
                    LOG.debug(
                        "RPCFunctions.addDeviceNames: Unable to get name for %s from metadata." % str(address))

        # Then try to get names via JSON-RPC
        elif (self.remotes[remote]['resolvenames'] == 'json' and
              self.remotes[remote]['username'] and
              self.remotes[remote]['password']):
            LOG.debug("RPCFunctions.addDeviceNames: Getting names via JSON-RPC")
            try:
                session = False
                params = {"username": self.remotes[remote][
                    'username'], "password": self.remotes[remote]['password']}
                response = self.jsonRpcPost(
                    self.remotes[remote]['ip'], self.remotes[remote].get('jsonport', DEFAULT_JSONPORT), "Session.login", params)
                if response['error'] is None and response['result']:
                    session = response['result']

                if not session:
                    LOG.warning(
                        "RPCFunctions.addDeviceNames: Unable to open session.")
                    return

                params = {"_session_id_": session}
                response = self.jsonRpcPost(
                    self.remotes[remote]['ip'], self.remotes[remote].get('jsonport', DEFAULT_JSONPORT), "Interface.listInterfaces", params)
                interface = False
                if response['error'] is None and response['result']:
                    for i in response['result']:
                        if i['port'] in [self.remotes[remote]['port'], self.remotes[remote]['port'] + 30000]:
                            interface = i['name']
                            break
                LOG.debug(
                    "RPCFunctions.addDeviceNames: Got interface: %s" % interface)
                if not interface:
                    params = {"_session_id_": session}
                    response = self.jsonRpcPost(
                        self.remotes[remote]['ip'], self.remotes[remote].get('jsonport', DEFAULT_JSONPORT), "Session.logout", params)
                    return

                params = {"_session_id_": session}
                response = self.jsonRpcPost(
                    self.remotes[remote]['ip'], self.remotes[remote].get('jsonport', DEFAULT_JSONPORT), "Device.listAllDetail", params)

                if response['error'] is None and response['result']:
                    LOG.debug(
                        "RPCFunctions.addDeviceNames: Resolving devicenames")
                    for i in response['result']:
                        try:
                            if i.get('address') in self.devices[remote]:
                                self.devices[remote][
                                    i['address']].NAME = i['name']
                        except Exception as err:
                            LOG.warning(
                                "RPCFunctions.addDeviceNames: Exception: %s" % str(err))

                params = {"_session_id_": session}
                response = self.jsonRpcPost(
                    self.remotes[remote]['ip'], self.remotes[remote].get('jsonport', DEFAULT_JSONPORT), "Session.logout", params)
            except Exception as err:
                params = {"_session_id_": session}
                response = self.jsonRpcPost(
                    self.remotes[remote]['ip'], self.remotes[remote].get('jsonport', DEFAULT_JSONPORT), "Session.logout", params)
                LOG.warning(
                    "RPCFunctions.addDeviceNames: Exception: %s" % str(err))

        # Then try to get names from XML-API
        elif self.remotes[remote]['resolvenames'] == 'xml':
            LOG.warning("Resolving names with the XML-API addon will be disabled in a future release. Please switch to json.")
            try:
                response = urllib.request.urlopen(
                    "http://%s%s" % (self.remotes[remote]['ip'], XML_API_URL), timeout=5)
                device_list = response.read().decode("ISO-8859-1")
            except Exception as err:
                LOG.warning(
                    "RPCFunctions.addDeviceNames: Could not access XML-API: %s" % (str(err), ))
                return
            device_list_tree = ET.ElementTree(ET.fromstring(device_list))
            for device in device_list_tree.getroot():
                address = device.attrib['address']
                name = device.attrib['name']
                if address in self.devices[remote]:
                    self.devices[remote][address].NAME = name
                    for address, device in self.devices[remote][address].CHANNELS.items():
                        device.NAME = name
                        self.devices_all[remote][device.ADDRESS].NAME = name
200928
public void addNamespace(String prefix, String namespaceURI) {
        if (prefix == null || namespaceURI == null) {
            throw new IllegalArgumentException("null arguments not allowed.");
        }
        if (namespaceURI.equals(XMLConstants.XML_NS_URI)) {
            throw new IllegalArgumentException("Adding a new namespace for " +
                XMLConstants.XML_NS_URI + "not allowed.");
        } else if (namespaceURI.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
            throw new IllegalArgumentException("Adding a new namespace for " +
                XMLConstants.XMLNS_ATTRIBUTE_NS_URI + "not allowed.");
        }
        prefix2ns.put(prefix, namespaceURI);
    }
1111870
function(xmlElement) {
    var name = xmlElement.getAttribute('name');
    this.renameProcedure(this.getProcedureCall(), name);
    var args = [];
    var paramIds = [];
    for (var i = 0, childNode; childNode = xmlElement.childNodes[i]; i++) {
      if (childNode.nodeName.toLowerCase() == 'arg') {
        args.push(childNode.getAttribute('name'));
        paramIds.push(childNode.getAttribute('paramId'));
      }
    }
    this.setProcedureParameters_(args, paramIds);
  }
696690
def _add_interface(self, interface_id, mgt=None, **kw):
        
        _kw = copy.deepcopy(kw) # Preserve original kw, especially lists
        mgt = mgt if mgt else {}
        
        if 'cvi_mode' in _kw:
            self.data.update(cvi_mode=_kw.pop('cvi_mode'))
        
        if 'macaddress' in _kw:
            self.data.update(
                macaddress=_kw.pop('macaddress'))
            if 'cvi_mode' not in self.data:
                self.data.update(cvi_mode='packetdispatch')
        
        if 'zone_ref' in _kw:
            zone_ref = _kw.pop('zone_ref')
            self.data.update(zone_ref=zone_helper(zone_ref) if zone_ref else None)
        
        if 'comment' in _kw:
            self.data.update(comment=_kw.pop('comment'))

        interfaces = _kw.pop('interfaces', [])
        for interface in interfaces:
            vlan_id = interface.pop('vlan_id', None)
            if vlan_id:
                _interface_id = '{}.{}'.format(interface_id, vlan_id)
            else:
                _interface_id = interface_id
    
            _interface = []
            if_mgt = {k: str(v) == str(_interface_id) for k, v in mgt.items()}
            
            if 'cluster_virtual' in interface and 'network_value' in interface:
                cluster_virtual = interface.pop('cluster_virtual')
                network_value = interface.pop('network_value')
                if cluster_virtual and network_value:
                    cvi = ClusterVirtualInterface.create(
                        _interface_id, cluster_virtual, network_value,
                        auth_request=True if if_mgt.get('primary_mgt') else False)
                      
                    _interface.append({cvi.typeof: cvi.data})
    
            for node in interface.pop('nodes', []):
                _node = if_mgt.copy()
                _node.update(outgoing=True if if_mgt.get('primary_mgt') else False)
                # Add node specific key/value pairs set on the node. This can
                # also be used to override management settings
                _node.update(node)
                ndi = NodeInterface.create(
                    interface_id=_interface_id, **_node)
                _interface.append({ndi.typeof: ndi.data})

            if vlan_id:
                vlan_interface = {
                    'interface_id': _interface_id,
                    'zone_ref': zone_helper(interface.pop('zone_ref', None)),
                    'comment': interface.pop('comment', None),
                    'interfaces': _interface}
                # Add remaining kwargs on vlan level to VLAN physical interface
                for name, value in interface.items():
                    vlan_interface[name] = value
                self.data.setdefault('vlanInterfaces', []).append(
                    vlan_interface)
            else:
                self.data.setdefault('interfaces', []).extend(
                    _interface)

        # Remaining kw go to base level interface
        for name, value in _kw.items():
            self.data[name] = value
948220
def auto_name_prefix(self):
        
        # if the platform is not native, auto_name would clobber native downloads.
        # make a prefix to avoid this
        native_system = std_platform.system()
        native_machine = self.CPU_ALIASES.get(std_platform.machine(), std_platform.machine())
        if native_system == self.system and native_machine == self.machine:
            return ''
        platform = {
            'linux': 'linux32',
            'android-api-16': 'android-arm',
            'android-aarch64': 'android-arm64',
        }.get(self.gecko_platform, self.gecko_platform)
        return platform + '-'
333261
public Collection<String> getInstalledFeatureNames() {
        if (installAssets == null)
            return null;
        Collection<String> installed = new ArrayList<String>();
        for (List<InstallAsset> iaList : installAssets) {
            for (InstallAsset asset : iaList) {
                if (asset.isFeature()) {
                    ESAAsset esa = (ESAAsset) asset;
                    if (esa.isPublic()) {
                        String esaName = esa.getShortName();
                        if (esaName == null || esaName.isEmpty())
                            esaName = esa.getFeatureName();
                        installed.add(esaName);
                    }
                }
            }
        }
        return installed;
    }
580481
function(apiKey, pieceTitle, categories,
        fromAddress, toAddress, ccAddress, bccAddress, subject, textBody,
        htmlBody, contentType, mergeContext) {}
1180117
function getDeviceTagAlias (registrationId, callback) {
  var url = HOST_NAME_SSL + DEVICE_PATH + '/' + registrationId
  return _request(this, url, null, 'GET', callback)
}
669280
def set_device_name(self, newname):
        
        return self.write(request.SetDeviceName(self.seq, *self.prep_str(newname)))
220369
private static void updateConfKeys(Configuration conf, String suffix,
      String nameserviceId) {
    String value = conf.get(FSConstants.DFS_NAMENODE_HTTP_ADDRESS_KEY + suffix
        + (nameserviceId.isEmpty() ? "" : ("." + nameserviceId)));
    if (value != null) {
      conf.set(FSConstants.DFS_NAMENODE_HTTP_ADDRESS_KEY, value);
    }
  }
376921
def add_vm_ethernet_ports(self):
        
        for i in range(self.node['properties']['adapters']):
            port = {'id': self.port_id,
                    'name': 'Ethernet%s' % i,
                    'port_number': i}
            self.node['ports'].append(port)
            self.port_id += 1
665525
function (rootdir, platform, preferenceMappingData) {
        var configData = lib.parseConfigXml(rootdir, platform, preferenceMappingData),
            platformPath = path.join(rootdir, 'platforms', platform),
            projectName = lib.getConfigXml(rootdir).findtext('name'),
            targetFile;

        for (var targetFileName in configData) {
            if (configData.hasOwnProperty(targetFileName)) {
                var configItems = configData[targetFileName];

                if (platform === 'ios') {
                    if (targetFileName.indexOf("Info.plist") > -1) {
                        targetFile = path.join(platformPath, projectName, projectName + '-Info.plist');
                        lib.updateIosPlist(targetFile, configItems);
                    } else if (targetFileName.indexOf("-Prefix.pch") > -1) {
                        targetFile = path.join(platformPath, projectName, projectName + '-Prefix.pch');
                        lib.updatePrefixPch(targetFile, configItems);
                    }
                }
            }
        }
    }
1293980
def add_connectionmanager_api(mock):
    ''''''

    iface = 'org.ofono.ConnectionManager'
    mock.AddProperties(iface, {
        'Attached': _parameters.get('Attached', True),
        'Bearer': _parameters.get('Bearer', 'gprs'),
        'RoamingAllowed': _parameters.get('RoamingAllowed', False),
        'Powered': _parameters.get('ConnectionPowered', True),
    })
    mock.AddMethods(iface, [
        ('GetProperties', '', 'a{sv}', 'ret = self.GetAll("%s")' % iface),
        ('SetProperty', 'sv', '', 'self.Set("%(i)s", args[0], args[1]); '
         'self.EmitSignal("%(i)s", "PropertyChanged", "sv", [args[0], args[1]])' % {'i': iface}),
        ('AddContext', 's', 'o', 'ret = "/"'),
        ('RemoveContext', 'o', '', ''),
        ('DeactivateAll', '', '', ''),
        ('GetContexts', '', 'a(oa{sv})', 'ret = dbus.Array([])'),
    ])
1150769
def register_element(self, dev_name, idx=None):
        
        if dev_name not in self.devices:
            logger.error(
                'Device {} missing. call add_device before adding elements'.
                format(dev_name))
            return
        group_name = self.system.__dict__[dev_name]._group
        if idx is None:  # "if not idx" will fail for idx==0.0
            idx = dev_name + '_' + str(len(self.group[group_name].keys()))
        self.group[group_name][idx] = dev_name
        return idx
29707
private void readNameToApps(CoronaSerializer coronaSerializer)
    throws IOException {
    coronaSerializer.readField("nameToApps");
    // Expecting the START_OBJECT token for nameToApps
    coronaSerializer.readStartObjectToken("nameToApps");
    JsonToken current = coronaSerializer.nextToken();

    while (current != JsonToken.END_OBJECT) {
      String nodeName = coronaSerializer.getFieldName();
      // Expecting the START_OBJECT token for the Apps
      coronaSerializer.readStartObjectToken(nodeName);
      Map<String, String> appMap = coronaSerializer.readValueAs(Map.class);
      Map<ResourceType, String> appsOnNode =
        new HashMap<ResourceType, String>();

      for (Map.Entry<String, String> entry : appMap.entrySet()) {
        appsOnNode.put(ResourceType.valueOf(entry.getKey()),
          entry.getValue());
      }

      nameToApps.put(nodeName, appsOnNode);
      current = coronaSerializer.nextToken();
    }
  }
344683
function addDevices(deviceArr) {
      deviceArr.forEach(function(el, i) {
        self.devices.push({
          name: deviceArr[i]['name'],
          deviceId: deviceArr[i]['id']
        });
      });
    }
1116331
def add_x10_device(self, housecode, unitcode, feature='OnOff'):
        
        device = insteonplm.devices.create_x10(self, housecode,
                                               unitcode, feature)
        if device:
            self.devices[device.address.id] = device
        return device