docs: def parsed_top_level_errors(parsed, errors, component_type: str = "") -> Errors:
      """Check full parse for errors
  
      Args:
          parsed:
          errors:
          component_type: Empty string or 'subject' or 'object' to indicate that we
              are parsing the subject or object field input
      """
  
      # Error check
      fn_cnt = 0
      rel_cnt = 0
      nested_cnt = 0
      for key in parsed:
          if parsed[key]["type"] == "Function":
              fn_cnt += 1
          if parsed[key]["type"] == "Relation":
              rel_cnt += 1
          if parsed[key]["type"] == "Nested":
              nested_cnt += 1
  
      if not component_type:
          if nested_cnt > 1:
              errors.append(
                  (
                      "Error",
                      "Too many nested objects - can only have one per BEL Assertion",
                  )
              )
  
          if nested_cnt:
              if rel_cnt > 2:
                  errors.append(
                      (
                          "Error",
                          "Too many relations - can only have two in a nested BEL Assertion",
                      )
                  )
              elif fn_cnt > 4:
                  errors.append(("Error", "Too many BEL subject and object candidates"))
  
          else:
              if rel_cnt > 1:
                  errors.append(
                      (
                          "Error",
                          "Too many relations - can only have one in a BEL Assertion",
                      )
                  )
              elif fn_cnt > 2:
                  errors.append(("Error", "Too many BEL subject and object candidates"))
  
      elif component_type == "subject":
          if rel_cnt > 0:
              errors.append(
                  ("Error", "Too many relations - cannot have any in a BEL Subject")
              )
          elif fn_cnt > 1:
              errors.append(
                  ("Error", "Too many BEL subject candidates - can only have one")
              )
  
      elif component_type == "object":
          if nested_cnt:
              if rel_cnt > 1:
                  errors.append(
                      (
                          "Error",
                          "Too many relations - can only have one in a nested BEL object",
                      )
                  )
              elif fn_cnt > 2:
                  errors.append(
                      (
                          "Error",
                          "Too many BEL subject and object candidates in a nested BEL object",
                      )
                  )
          else:
              if rel_cnt > 0:
                  errors.append(
                      ("Error", "Too many relations - cannot have any in a BEL Subject")
                  )
              elif fn_cnt > 1:
                  errors.append(
                      ("Error", "Too many BEL subject candidates - can only have one")
                  )
  
      return errors