parameters: (hits)
return_statement: return list(packages.values())
docstring: The list from pypi is really a list of versions. We want a list of
      packages with the list of versions stored inline. This converts the
      list from pypi into one we can use.
docstring_summary: The list from pypi is really a list of versions. We want a list of
      packages with the list of versions stored inline. This converts the
      list from pypi into one we can use.
docstring_tokens: The list from pypi is really a list of versions . We want a list of packages with the list of versions stored inline . This converts the list from pypi into one we can use .
function: def transform_hits(hits):
      # type: (List[Dict[str, str]]) -> List[TransformedHit]
      """
      The list from pypi is really a list of versions. We want a list of
      packages with the list of versions stored inline. This converts the
      list from pypi into one we can use.
      """
      packages = OrderedDict()  # type: OrderedDict[str, TransformedHit]
      for hit in hits:
          name = hit['name']
          summary = hit['summary']
          version = hit['version']
  
          if name not in packages.keys():
              packages[name] = {
                  'name': name,
                  'summary': summary,
                  'versions': [version],
              }
          else:
              packages[name]['versions'].append(version)
  
              # if this is the highest version, replace summary and score
              if version == highest_version(packages[name]['versions']):
                  packages[name]['summary'] = summary
  
      return list(packages.values())
function_tokens: def transform_hits ( hits ) : # type: (List[Dict[str, str]]) -> List[TransformedHit] packages = OrderedDict ( ) # type: OrderedDict[str, TransformedHit] for hit in hits : name = hit [ 'name' ] summary = hit [ 'summary' ] version = hit [ 'version' ] if name not in packages . keys ( ) : packages [ name ] = { 'name' : name , 'summary' : summary , 'versions' : [ version ] , } else : packages [ name ] [ 'versions' ] . append ( version ) # if this is the highest version, replace summary and score if version == highest_version ( packages [ name ] [ 'versions' ] ) : packages [ name ] [ 'summary' ] = summary return list ( packages . values ( ) )