parameters: (inpstr)
return_statement: return data
docstring: parse_address Parse a pci_address from the input string
  
          Args:
              inpstr: A string to parse
          Returns:
              A dictionary of the pci_address fields (segment, bus, device, etc.)
              If the parsing failed, an empty dictionary is returned.
          Note:
              If the input string does not contain a segment number, this will
              set it to 0000 in the returned dictionary.
docstring_summary: parse_address Parse a pci_address from the input string
docstring_tokens: parse_address Parse a pci_address from the input string
function: def parse_address(inpstr):
          """parse_address Parse a pci_address from the input string
  
          Args:
              inpstr: A string to parse
          Returns:
              A dictionary of the pci_address fields (segment, bus, device, etc.)
              If the parsing failed, an empty dictionary is returned.
          Note:
              If the input string does not contain a segment number, this will
              set it to 0000 in the returned dictionary.
  
          """
          data = {}
          try:
              m = PCI_ADDRESS_RE.match(inpstr)
          except TypeError as err:
              LOG('parse_address').warn(err)
          else:
              if m:
                  data = m.groupdict()
                  if data['segment'] is None:
                      data['segment'] = '0000'
                      pci_address = '{segment}:{pci_address}'.format(**data)
                      data['pci_address'] = pci_address
          return data
function_tokens: def parse_address ( inpstr ) : data = { } try : m = PCI_ADDRESS_RE . match ( inpstr ) except TypeError as err : LOG ( 'parse_address' ) . warn ( err ) else : if m : data = m . groupdict ( ) if data [ 'segment' ] is None : data [ 'segment' ] = '0000' pci_address = '{segment}:{pci_address}' . format ( * * data ) data [ 'pci_address' ] = pci_address return data