code: def _update_shared_with(
      child: EdgeOrNode,
      qspec: QuantizationSpecBase,
      shared_with_map: Dict[EdgeOrNode, EdgeOrNode],
  ):
      """Update the `shared_with_map` based on the qspec, this applies the `SharedQuantizationSpec`
      configuration and established the relationship between `edge_or_node` with the edge/node that it
      is pointing to, we'll use this information in the end to get the group id
      """
      if isinstance(qspec, SharedQuantizationSpec):
          parent = qspec.edge_or_node
          # we point from edge_or_node to the node that it is sharing_with, e.g.
          # qspec for a = SharedQuantizationSpec(b) means `a` points to `b`
          _union(parent, child, shared_with_map)
  
imports: import torch
  from torch._subclasses import FakeTensor
  from torch.ao.quantization.fx.prepare import _insert_obs_or_fq, _save_state, _is_activation_post_process_node, _create_obs_or_fq_from_qspec
  from torch.fx import GraphModule, Graph, Node
  from torch.fx.node import Argument
  from torch.ao.quantization import QConfigMapping
  from torch.ao.quantization.qconfig import QConfigAny
  from torch.ao.quantization.fx.custom_config import PrepareCustomConfig
  from typing import Dict, Tuple, Union, Any, Optional
  from torch.ao.quantization.quantizer import EdgeOrNode, SharedQuantizationSpec, QuantizationSpecBase
  from torch.ao.quantization import ObserverOrFakeQuantize
label_desc: Use image node_id 3 for calling a global function with example usage: _update_shared_with(child, qspec, shared_with_map) without return types