parameters: (filename)
return_statement: return ports
docstring: Open a file and find all PORT_TABLE_REGEX matches.
  
      Args:
          filename (str): filename
  
      Returns:
          set: all PORT_TABLE_REGEX matches
docstring_summary: Open a file and find all PORT_TABLE_REGEX matches.
docstring_tokens: Open a file and find all PORT_TABLE_REGEX matches .
function: def read_port_table(filename):
      """Open a file and find all PORT_TABLE_REGEX matches.
  
      Args:
          filename (str): filename
  
      Returns:
          set: all PORT_TABLE_REGEX matches
      """
      ports = {}
      with open(filename, 'r') as fp:
          matches = PORT_TABLE_REGEX.findall(fp.read())
          for match in matches:
              line_len = sum([len(part) for part in match])
              ports[match[0]] = {
                  "dir_ref": match[1],
                  "name": match[2].strip(),
                  "version": match[4].strip(),
                  "url": match[5].strip(),
                  "line_len": line_len
              }
      return ports
function_tokens: def read_port_table ( filename ) : ports = { } with open ( filename , 'r' ) as fp : matches = PORT_TABLE_REGEX . findall ( fp . read ( ) ) for match in matches : line_len = sum ( [ len ( part ) for part in match ] ) ports [ match [ 0 ] ] = { "dir_ref" : match [ 1 ] , "name" : match [ 2 ] . strip ( ) , "version" : match [ 4 ] . strip ( ) , "url" : match [ 5 ] . strip ( ) , "line_len" : line_len } return ports