parameters: (project_id, opt_class_map=None,
          opt_relation_map=None, check_root_ci=True)
return_statement: return all_good, missing_classes, missing_relations, missing_classinstances
docstring: Checks if all classes and relations needed by the tracing system are
      available. It returns a four-tuple with a boolean indicating if all is
      setup, the missing class names, the missing relation names and the missing
      class instance names. Allows avoidng tests for root class instances and
      passing already available class and relation maps.
docstring_summary: Checks if all classes and relations needed by the tracing system are
      available. It returns a four-tuple with a boolean indicating if all is
      setup, the missing class names, the missing relation names and the missing
      class instance names. Allows avoidng tests for root class instances and
      passing already available class and relation maps.
docstring_tokens: Checks if all classes and relations needed by the tracing system are available . It returns a four - tuple with a boolean indicating if all is setup the missing class names the missing relation names and the missing class instance names . Allows avoidng tests for root class instances and passing already available class and relation maps .
function: def check_tracing_setup_detailed(project_id, opt_class_map=None,
          opt_relation_map=None, check_root_ci=True) -> Tuple[bool, List, List, List]:
      """ Checks if all classes and relations needed by the tracing system are
      available. It returns a four-tuple with a boolean indicating if all is
      setup, the missing class names, the missing relation names and the missing
      class instance names. Allows avoidng tests for root class instances and
      passing already available class and relation maps.
      """
      # Get class and relation data. If available, use the provided one.
      class_map = opt_class_map or get_class_to_id_map(project_id)
      relation_map = opt_relation_map or get_relation_to_id_map(project_id)
  
      # Check if all classes and relations are available
      all_good = True
      missing_classes = []
      missing_relations = []
      missing_classinstances = []
  
      for c in needed_classes:
          if c not in class_map:
              all_good = False
              missing_classes.append(c)
      for r in needed_relations:
          if r not in relation_map:
              all_good = False
              missing_relations.append(r)
      # Check if the root node is there if requested
      if check_root_ci:
          if 'root' in class_map:
              exists = ClassInstance.objects.filter(
                  class_column=class_map['root'],
                  project_id=project_id).exists()
              if not exists:
                  all_good = False
                  missing_classinstances.append('root')
          else:
              missing_classinstances.append('root')
  
      return all_good, missing_classes, missing_relations, missing_classinstances
function_tokens: def check_tracing_setup_detailed ( project_id , opt_class_map = None , opt_relation_map = None , check_root_ci = True ) -> Tuple [ bool , List , List , List ] : # Get class and relation data. If available, use the provided one. class_map = opt_class_map or get_class_to_id_map ( project_id ) relation_map = opt_relation_map or get_relation_to_id_map ( project_id ) # Check if all classes and relations are available all_good = True missing_classes = [ ] missing_relations = [ ] missing_classinstances = [ ] for c in needed_classes : if c not in class_map : all_good = False missing_classes . append ( c ) for r in needed_relations : if r not in relation_map : all_good = False missing_relations . append ( r ) # Check if the root node is there if requested if check_root_ci : if 'root' in class_map : exists = ClassInstance . objects . filter ( class_column = class_map [ 'root' ] , project_id = project_id ) . exists ( ) if not exists : all_good = False missing_classinstances . append ( 'root' ) else : missing_classinstances . append ( 'root' ) return all_good , missing_classes , missing_relations , missing_classinstances