code: def count_op(graph, target_str):
      return len(
          [
              n
              for n in graph.nodes
              if isinstance(n.target, torch._ops.OpOverload)
              and n.target.name() == target_str
          ]
      )
  
file_path: pytorch/test/export/test_upgrade.py
imports: import unittest
  from unittest.mock import patch
  import torch
  import torch._dynamo
  from torch.export import export
  from torch._export.serde.serialize import GraphModuleOpUpgrader
  from torch._export.serde.upgrade import get_target_version, get_upgraders
  from torch.testing._internal.common_utils import run_tests, TestCase
label_desc: Use image node_id 1 for calling a global function with example usage: count_op(graph, target_str) and returns: len