code: def get_metadata(item):
      
      for metadata_key in ('METADATA', 'PKG-INFO'):
          try:
              metadata_lines = item.get_metadata_lines(metadata_key)
              break
          except (KeyError, IOError):
              # The package will be shown in the report without any license information
              # if a metadata key is not found.
              metadata_lines = []
  
      return metadata_lines
docs: Get metadata information from the distribution.
  
      Depending on the package this may either be in METADATA or PKG-INFO
  
      :param item: pkg_resources WorkingSet item
      :returns: metadata resource as list of non-blank non-comment lines