docs: def _decanonicalize_edge_node(node: BaseEntity, edge_data: EdgeData, node_position: str) -> str:
      """Canonicalize a node with its modifiers stored in the given edge to a BEL string.
  
      :param node: A PyBEL node data dictionary
      :param edge_data: A PyBEL edge data dictionary
      :param node_position: Either :data:`pybel.constants.SUBJECT` or :data:`pybel.constants.OBJECT`
      """
      node_str = node.as_bel()
  
      if node_position not in edge_data:
          return node_str
  
      node_edge_data = edge_data[node_position]
  
      if LOCATION in node_edge_data:
          node_str = postpend_location(node_str, node_edge_data[LOCATION])
  
      modifier = node_edge_data.get(MODIFIER)
  
      if modifier is None:
          return node_str
  
      if DEGRADATION == modifier:
          return "deg({})".format(node_str)
  
      effect = node_edge_data.get(EFFECT)
  
      if ACTIVITY == modifier:
          if effect is None:
              return "act({})".format(node_str)
  
          if effect[NAMESPACE] == BEL_DEFAULT_NAMESPACE:
              return "act({}, ma({}))".format(node_str, effect[NAME])
  
          return "act({}, ma({}:{}))".format(node_str, effect[NAMESPACE], ensure_quotes(effect[NAME]))
  
      if TRANSLOCATION == modifier:
          if effect is None:
              return 'tloc({})'.format(node_str)
  
          to_loc_data = effect[TO_LOC]
          from_loc_data = effect[FROM_LOC]
  
          if from_loc_data[NAMESPACE] == BEL_DEFAULT_NAMESPACE and from_loc_data[NAME] == INTRACELLULAR:
              if to_loc_data[NAMESPACE] == BEL_DEFAULT_NAMESPACE and to_loc_data[NAME] == EXTRACELLULAR:
                  return 'sec({})'.format(node_str)
              if to_loc_data[NAMESPACE] == BEL_DEFAULT_NAMESPACE and to_loc_data[NAME] == CELL_SURFACE:
                  return 'surf({})'.format(node_str)
  
          from_loc = _get_tloc_terminal('fromLoc', from_loc_data)
          to_loc = _get_tloc_terminal('toLoc', to_loc_data)
  
          return "tloc({}, {}, {})".format(node_str, from_loc, to_loc)
  
      raise ValueError('invalid modifier: {}'.format(modifier))