def interpret_distro_name(location, basename, metadata, py_version=None, precedence=SOURCE_DIST, platform=None):
 parts = basename.split('-')
 if (not py_version):
  for (i, p) in enumerate(parts[2:]):
   if ((len(p) == 5) and p.startswith('py2.')):
    return
 for p in range(1, (len(parts) + 1)):
  (yield Distribution(location, metadata, '-'.join(parts[:p]), '-'.join(parts[p:]), py_version=py_version, precedence=precedence, platform=platform))

def interpret_distro_name ( location , basename , metadata , py_version = None , precedence = SOURCE_DIST , platform = None ) : parts = basename . split ( '-' ) if ( not py_version ) : for ( i , p ) in enumerate ( parts [ 2 : ] ) : if ( ( len ( p ) == 5 ) and p . startswith ( 'py2.' ) ) : return for p in range ( 1 , ( len ( parts ) + 1 ) ) : ( yield Distribution ( location , metadata , '-' . join ( parts [ : p ] ) , '-' . join ( parts [ p : ] ) , py_version = py_version , precedence = precedence , platform = platform ) )
generate alternative interpretations of a source distro name note: if location is a filesystem filename .