parameters: (f)
return_statement: return None
docstring: Try to look at the parent identifier from a docker image.
  
    The identifier is expected to be in the 'top' file for our rule so we look at
    it first ('./top', 'top'). If it's not found, then we use the 'repositories'
    file and tries to parse it to get the first declared repository (so we can
    actually parse a file generated by 'docker save').
  
    Args:
      f: the input tar file.
    Returns:
      The identifier of the docker image, or None if no identifier was found.
docstring_summary: Try to look at the parent identifier from a docker image.
docstring_tokens: Try to look at the parent identifier from a docker image .
function: def GetParentIdentifier(f):
    """Try to look at the parent identifier from a docker image.
  
    The identifier is expected to be in the 'top' file for our rule so we look at
    it first ('./top', 'top'). If it's not found, then we use the 'repositories'
    file and tries to parse it to get the first declared repository (so we can
    actually parse a file generated by 'docker save').
  
    Args:
      f: the input tar file.
    Returns:
      The identifier of the docker image, or None if no identifier was found.
    """
    # TODO(dmarting): Maybe we could drop the 'top' file all together?
    top = utils.GetTarFile(f, 'top')
    if top:
      return top.strip()
    repositories = utils.GetTarFile(f, 'repositories')
    if repositories:
      data = json.loads(repositories)
      for k1 in data:
        for k2 in data[k1]:
          # Returns the first found key
          return data[k1][k2].strip()
    return None
function_tokens: def GetParentIdentifier ( f ) : # TODO(dmarting): Maybe we could drop the 'top' file all together? top = utils . GetTarFile ( f , 'top' ) if top : return top . strip ( ) repositories = utils . GetTarFile ( f , 'repositories' ) if repositories : data = json . loads ( repositories ) for k1 in data : for k2 in data [ k1 ] : # Returns the first found key return data [ k1 ] [ k2 ] . strip ( ) return None