class_docstr: GraphItem is a TensorFlow Graph wrapper.
  
  It represents the states in-between consecutive AutoDist.kernel graph transformations.
  tf.Graph is the primary property of GraphItem, whereas MetaGraph is exported/generated on demand.
  
  A GraphItem can be constructed with either a `tf.Graph` or a `GraphDef`.
docstr: Given an iterator of ops or op names, return the corresponding ops in self graph.
  
  Args:
      op_iter (Iterable[Union[ops.Operation, str]]): Ops or ops names
  
  Returns:
      Iterable
docstr_tok: ["Given","an","iterator","of","ops","or","op","names",",","return","the","corresponding","ops","in","self","graph",".","Args",":","op_iter","(","Iterable","[","Union","[","ops.Operation",",","str","]","]",")",":","Ops","or","ops","names","Returns",":","Iterable"]
code: def get_ops_in_graph(self, op_iter):
      """
      Given an iterator of ops or op names, return the corresponding ops in self graph.
  
      Args:
          op_iter (Iterable[Union[ops.Operation, str]]): Ops or ops names
  
      Returns:
          Iterable
      """
      return type(op_iter)(
          (
              self.graph.get_operation_by_name(
                  o if isinstance(o, str) else o.name
              )
              for o in op_iter
          )
      )
  
imports: import contextlib
  import copy
  import functools
  from collections import defaultdict
  from typing import Union, Callable
  from google.protobuf.any_pb2 import Any
  from tensorflow.core.framework.graph_pb2 import GraphDef
  from tensorflow.core.framework.variable_pb2 import VariableDef
  from tensorflow.core.protobuf.saver_pb2 import SaverDef
  from tensorflow.python.framework import ops
  from tensorflow.python.framework.importer import import_graph_def
  from tensorflow.python.ops.resource_variable_ops import _from_proto_fn
  from tensorflow.python.ops.variables import Variable
  from autodist.const import COLOCATION_PREFIX
  from autodist.kernel.common import op_info
  from autodist.kernel.common.utils import parse_name_scope, get_op_name
  from autodist.proto import graphitem_pb2
  from autodist.utils import logging
label_desc: Use image node_id 21 for calling the GraphItem obj's underlying member method code with example usage: obj.get_ops_in_graph(op_iter) and returns: type