def _handle_precomputed_bsgs(base, strong_gens, transversals=None, basic_orbits=None, strong_gens_distr=None):
 if (strong_gens_distr is None):
  strong_gens_distr = _distribute_gens_by_base(base, strong_gens)
 if (transversals is None):
  if (basic_orbits is None):
   (basic_orbits, transversals) = _orbits_transversals_from_bsgs(base, strong_gens_distr)
  else:
   transversals = _orbits_transversals_from_bsgs(base, strong_gens_distr, transversals_only=True)
 elif (basic_orbits is None):
  base_len = len(base)
  basic_orbits = ([None] * base_len)
  for i in range(base_len):
   basic_orbits[i] = list(transversals[i].keys())
 return (transversals, basic_orbits, strong_gens_distr)

def _handle_precomputed_bsgs ( base , strong_gens , transversals = None , basic_orbits = None , strong_gens_distr = None ) : if ( strong_gens_distr is None ) : strong_gens_distr = _distribute_gens_by_base ( base , strong_gens ) if ( transversals is None ) : if ( basic_orbits is None ) : ( basic_orbits , transversals ) = _orbits_transversals_from_bsgs ( base , strong_gens_distr ) else : transversals = _orbits_transversals_from_bsgs ( base , strong_gens_distr , transversals_only = True ) elif ( basic_orbits is None ) : base_len = len ( base ) basic_orbits = ( [ None ] * base_len ) for i in range ( base_len ) : basic_orbits [ i ] = list ( transversals [ i ] . keys ( ) ) return ( transversals , basic_orbits , strong_gens_distr )
calculate bsgs-related structures from those present .