docs: def _canonicalize_edge_modifications(edge_data: EdgeData) -> Optional[Tuple]:
      """Return the SUBJECT or OBJECT entry of a PyBEL edge data dictionary as a canonical tuple."""
      if edge_data is None:
          return
  
      modifier = edge_data.get(MODIFIER)
      location = edge_data.get(LOCATION)
      effect = edge_data.get(EFFECT)
  
      if modifier is None and location is None:
          return
  
      result = []
  
      if modifier == ACTIVITY:
          if effect:
              effect_name = effect.get(NAME)
              effect_identifier = effect.get(IDENTIFIER)
  
              t = (
                  ACTIVITY,
                  effect[NAMESPACE],
                  effect_name or effect_identifier,
              )
  
          else:
              t = (ACTIVITY,)
  
          result.append(t)
  
      elif modifier == DEGRADATION:
          t = (DEGRADATION,)
          result.append(t)
  
      elif modifier == TRANSLOCATION:
          if effect:
              from_loc_name = effect[FROM_LOC].get(NAME)
              from_loc_identifier = effect[FROM_LOC].get(IDENTIFIER)
              to_loc_name = effect[TO_LOC].get(NAME)
              to_loc_identifier = effect[TO_LOC].get(IDENTIFIER)
  
              t = (
                  TRANSLOCATION,
                  edge_data[EFFECT][FROM_LOC][NAMESPACE],
                  from_loc_name or from_loc_identifier,
                  edge_data[EFFECT][TO_LOC][NAMESPACE],
                  to_loc_name or to_loc_identifier,
              )
          else:
              t = (TRANSLOCATION,)
          result.append(t)
  
      if location:
          location_name = location.get(NAME)
          location_identifier = location.get(IDENTIFIER)
  
          t = (
              LOCATION,
              location[NAMESPACE],
              location_name or location_identifier,
          )
          result.append(t)
  
      if not result:
          raise ValueError('Invalid data: {}'.format(edge_data))
  
      return tuple(result)