parameters: (source, name)
return_statement: return ensure_str(info_dir)
docstring: Returns the name of the contained .dist-info directory.
  
      Raises AssertionError or UnsupportedWheel if not found, >1 found, or
      it doesn't match the provided name.
docstring_summary: Returns the name of the contained .dist-info directory.
docstring_tokens: Returns the name of the contained . dist - info directory .
function: def wheel_dist_info_dir(source, name):
      # type: (ZipFile, str) -> str
      """Returns the name of the contained .dist-info directory.
  
      Raises AssertionError or UnsupportedWheel if not found, >1 found, or
      it doesn't match the provided name.
      """
      # Zip file path separators must be /
      subdirs = {p.split("/", 1)[0] for p in source.namelist()}
  
      info_dirs = [s for s in subdirs if s.endswith('.dist-info')]
  
      if not info_dirs:
          raise UnsupportedWheel(".dist-info directory not found")
  
      if len(info_dirs) > 1:
          raise UnsupportedWheel(
              "multiple .dist-info directories found: {}".format(
                  ", ".join(info_dirs)
              )
          )
  
      info_dir = info_dirs[0]
  
      info_dir_name = canonicalize_name(info_dir)
      canonical_name = canonicalize_name(name)
      if not info_dir_name.startswith(canonical_name):
          raise UnsupportedWheel(
              ".dist-info directory {!r} does not start with {!r}".format(
                  info_dir, canonical_name
              )
          )
  
      # Zip file paths can be unicode or str depending on the zip entry flags,
      # so normalize it.
      return ensure_str(info_dir)
function_tokens: def wheel_dist_info_dir ( source , name ) : # type: (ZipFile, str) -> str # Zip file path separators must be / subdirs = { p . split ( "/" , 1 ) [ 0 ] for p in source . namelist ( ) } info_dirs = [ s for s in subdirs if s . endswith ( '.dist-info' ) ] if not info_dirs : raise UnsupportedWheel ( ".dist-info directory not found" ) if len ( info_dirs ) > 1 : raise UnsupportedWheel ( "multiple .dist-info directories found: {}" . format ( ", " . join ( info_dirs ) ) ) info_dir = info_dirs [ 0 ] info_dir_name = canonicalize_name ( info_dir ) canonical_name = canonicalize_name ( name ) if not info_dir_name . startswith ( canonical_name ) : raise UnsupportedWheel ( ".dist-info directory {!r} does not start with {!r}" . format ( info_dir , canonical_name ) ) # Zip file paths can be unicode or str depending on the zip entry flags, # so normalize it. return ensure_str ( info_dir )