r'''
    Creates a private IP for the specified Linode.

    linode_id
        The ID of the Linode to create the IP address for.
774894
def create_private_ip(linode_id):
    
    '''
    kwargs = {'LinodeID': linode_id}
    result = _query('linode', 'ip.addprivate', args=kwargs)

    return _clean_data(result)
239457
public void setPrivateIpAddresses(java.util.Collection<NetworkInterfacePrivateIpAddress> privateIpAddresses) {
        if (privateIpAddresses == null) {
            this.privateIpAddresses = null;
            return;
        }

        this.privateIpAddresses = new com.amazonaws.internal.SdkInternalList<NetworkInterfacePrivateIpAddress>(privateIpAddresses);
    }
121194
def ip(args):
    
    if len(args) != 0:
        sys.exit(not p.print_help())

    s = InstanceSkeleton()
    print("IP address:", s.private_ip_address, file=sys.stderr)
    print("Instance type:", s.instance_type, file=sys.stderr)
1026362
def create(cls, interface_id, logical_interface_ref, **kw):
        
        data = {'inspect_unspecified_vlans': True,
                'logical_interface_ref': logical_interface_ref,
                'nicid': str(interface_id)}
        
        if 'reset_interface_nicid' in kw:
            data.update(reset_interface_nicid=kw.get('reset_interface_nicid'))

        return cls(data)
1351676
def set_id(self,pid):
        
        if self.type == 'KAF':
            return self.node.set('pid',pid)
        elif self.type == 'NAF':
            return self.node.set('id',pid)
828925
def ipcidr(self, *args):
        
        call_args = list(args)
        return self.random.choice(IPNetwork(call_args.pop(0)))
1145898
def build_from_id(id)
      @image = ::Docker::Image.get(id)
      add_repository_tag
    rescue ::Docker::Error::NotFoundError
      @image = ::Docker::Image.create('fromImage' => id)
      add_repository_tag
    rescue ::Docker::Error::DockerError => e
      DockerExceptionParser.new(e)
    end
451707
def remove_ip(self, ip_id):
        
        ip_id = '    "IpAddressResourceId": %s' % ip_id
        json_scheme = self.gen_def_json_scheme('SetRemoveIpAddress', ip_id)
        json_obj = self.call_method_post(method='SetRemoveIpAddress', json_scheme=json_scheme)
        pprint(json_obj)
        return True if json_obj['Success'] is True else False
590360
function createProviders(networkIds) {
  const providers = {}

  // Create a provider for each of the network id.
  for (const networkId of networkIds) {
    let mnemonic
    let providerUrl
    let privateKey

    switch (networkId) {
      case MAINNET_NETWORK_ID:
        privateKey = process.env.MAINNET_PRIVATE_KEY
        mnemonic = process.env.MAINNET_MNEMONIC
        if (!privateKey && !mnemonic) {
          throw 'Must have either MAINNET_PRIVATE_KEY or MAINNET_MNEMONIC env var'
        }
        if (!process.env.INFURA_ACCESS_TOKEN) {
          throw 'Missing INFURA_ACCESS_TOKEN env var'
        }
        providerUrl = `https://mainnet.infura.io/${process.env.INFURA_ACCESS_TOKEN}`
        break
      case ROPSTEN_NETWORK_ID:
        privateKey = process.env.ROPSTEN_PRIVATE_KEY
        mnemonic = process.env.ROPSTEN_MNEMONIC
        if (!privateKey && !mnemonic) {
          throw 'Must have either ROPSTEN_PRIVATE_KEY or ROPSTEN_MNEMONIC env var'
        }
        if (!process.env.INFURA_ACCESS_TOKEN) {
          throw 'Missing INFURA_ACCESS_TOKEN env var'
        }
        providerUrl = `https://ropsten.infura.io/${process.env.INFURA_ACCESS_TOKEN}`
        break
      case RINKEBY_NETWORK_ID:
        privateKey = process.env.RINKEBY_PRIVATE_KEY
        mnemonic = process.env.RINKEBY_MNEMONIC
        if (!privateKey && !mnemonic) {
          throw 'Must have either RINKEBY_PRIVATE_KEY or RINKEBY_MNEMONIC env var'
        }
        if (!process.env.INFURA_ACCESS_TOKEN) {
          throw 'Missing INFURA_ACCESS_TOKEN env var'
        }
        providerUrl = `https://rinkeby.infura.io/${process.env.INFURA_ACCESS_TOKEN}`
        break
      case LOCAL_NETWORK_ID:
        privateKey = process.env.LOCAL_PRIVATE_KEY
        mnemonic = process.env.LOCAL_MNEMONIC || DEFAULT_MNEMONIC
        providerUrl = 'http://localhost:8545'
        break
      case ORIGIN_NETWORK_ID:
        privateKey = process.env.ORIGIN_PRIVATE_KEY
        mnemonic = process.env.ORIGIN_MNEMONIC
        if (!privateKey && !mnemonic) {
          throw 'Must have either ORIGIN_PRIVATE_KEY or ORIGIN_MNEMONIC env var'
        }
        providerUrl = 'https://eth.dev.originprotocol.com/rpc'
        break
      default:
        throw `Unsupported network id ${networkId}`
    }
    // Private key takes precedence
    if (privateKey) {
      console.log(`Network=${networkId} URL=${providerUrl} Using private key`)
      providers[networkId] = new PrivateKeyProvider(privateKey, providerUrl)
    } else {
      const displayMnemonic = (networkId === LOCAL_NETWORK_ID) ? mnemonic : '[redacted]'
      console.log(`Network=${networkId} Url=${providerUrl} Mnemonic=${displayMnemonic}`)
      providers[networkId] = new HDWalletProvider(mnemonic, providerUrl)
    }
  }
  return providers
}
721822
def create_port_forwarding_rule(ip_address_id, private_port, protocol, public_port, virtual_machine_id)
      params = {
          'command' => 'createPortForwardingRule',
          'ipAddressId' => ip_address_id,
          'privatePort' => private_port,
          'protocol' => protocol,
          'publicPort' => public_port,
          'virtualMachineId' => virtual_machine_id
      }
      json = send_async_request(params)
      json['portforwardingrule']
    end
90248
def get_linode_id_from_name(name):
    '''
    
    '''
    nodes = _query('linode', 'list')['DATA']

    linode_id = ''
    for node in nodes:
        if name == node['LABEL']:
            linode_id = node['LINODEID']
            return linode_id

    if not linode_id:
        raise SaltCloudNotFound(
            'The specified name, {0}, could not be found.'.format(name)
        )
56512
def initialize(self, id=None, text=None):
        self.id = none_or(id, int)
        

        self.text = none_or(text, str)
        """
        Username or IP address of the user at the time of the edit : str | None
        """
1108997
def is_private_addr(x):
    """"""
    paddrs = ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16']
    found = False
    for ipr in paddrs:
        try:
            if ipaddress.ip_address(x) in ipaddress.ip_network(ipr):
                found = True
                continue
        except:
            break
    return found
808116
def create_id(self, prefix="guid"):
        
        if self.method == IDGenerator.METHOD_UUID:
            id_ = str(uuid.uuid4())
        elif self.method == IDGenerator.METHOD_INT:
            id_ = self.next_int
            self.next_int += 1
        else:
            raise InvalidMethodError(self.method)

        return "%s:%s-%s" % (self.namespace.prefix, prefix, id_)
480934
def get_ips(linode_id=None):
    '''
    
    '''
    if linode_id:
        ips = _query('linode', 'ip.list', args={'LinodeID': linode_id})
    else:
        ips = _query('linode', 'ip.list')

    ips = ips['DATA']
    ret = {}

    for item in ips:
        node_id = six.text_type(item['LINODEID'])
        if item['ISPUBLIC'] == 1:
            key = 'public_ips'
        else:
            key = 'private_ips'

        if ret.get(node_id) is None:
            ret.update({node_id: {'public_ips': [], 'private_ips': []}})
        ret[node_id][key].append(item['IPADDRESS'])

    # If linode_id was specified, only return the ips, and not the
    # dictionary based on the linode ID as a key.
    if linode_id:
        _all_ips = {'public_ips': [], 'private_ips': []}
        matching_id = ret.get(six.text_type(linode_id))
        if matching_id:
            _all_ips['private_ips'] = matching_id['private_ips']
            _all_ips['public_ips'] = matching_id['public_ips']

        ret = _all_ips

    return ret
1328644
def generate_unique_host_id():
    """"""
    host = ".".join(reversed(socket.gethostname().split(".")))
    pid = os.getpid()
    return "%s.%d" % (host, pid)
1025541
def create_dhcprelay_ipv6(self):
        """"""
        return DHCPRelayIPv6(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)