original_docstring: Set all of the used ips into a global list.
  
      :param user_defined_config: ``dict`` User defined configuration
      :param inventory: ``dict`` Living inventory of containers and hosts
      
docstring: Set all of the used ips into a global list.
docstring_tokens: Set all of the used ips into a global list .
code: def _set_used_ips(user_defined_config, inventory):
      """Set all of the used ips into a global list.
  
      :param user_defined_config: ``dict`` User defined configuration
      :param inventory: ``dict`` Living inventory of containers and hosts
      """
      used_ips = user_defined_config.get('used_ips')
      if isinstance(used_ips, list):
          for ip in used_ips:
              split_ip = ip.split(',')
              if len(split_ip) >= 2:
                  ip_range = list(
                      netaddr.iter_iprange(
                          split_ip[0],
                          split_ip[-1]
                      )
                  )
                  USED_IPS.extend([str(i) for i in ip_range])
              else:
                  append_if(array=USED_IPS, item=split_ip[0])
  
      # Find all used IP addresses and ensure that they are not used again
      for host_entry in inventory['_meta']['hostvars'].values():
          if 'ansible_ssh_host' in host_entry:
              append_if(array=USED_IPS, item=host_entry['ansible_ssh_host'])
  
          for key, value in host_entry.iteritems():
              if key.endswith('address'):
                  append_if(array=USED_IPS, item=value)
code_tokens: def _set_used_ips ( user_defined_config , inventory ) : used_ips = user_defined_config . get ( 'used_ips' ) if isinstance ( used_ips , list ) : for ip in used_ips : split_ip = ip . split ( ',' ) if len ( split_ip ) >= 2 : ip_range = list ( netaddr . iter_iprange ( split_ip [ 0 ] , split_ip [ - 1 ] ) ) USED_IPS . extend ( [ str ( i ) for i in ip_range ] ) else : append_if ( array = USED_IPS , item = split_ip [ 0 ] ) for host_entry in inventory [ '_meta' ] [ 'hostvars' ] . values ( ) : if 'ansible_ssh_host' in host_entry : append_if ( array = USED_IPS , item = host_entry [ 'ansible_ssh_host' ] ) for key , value in host_entry . iteritems ( ) : if key . endswith ( 'address' ) : append_if ( array = USED_IPS , item = value )
short_docstring: Set all of the used ips into a global list.
short_docstring_tokens: Set all of the used ips into a global list .
comment: """Set all of the used ips into a global list.
  
      :param user_defined_config: ``dict`` User defined configuration
      :param inventory: ``dict`` Living inventory of containers and hosts
      """$SEP$# Find all used IP addresses and ensure that they are not used again