code: def _check_not_called_concurrently(lock):
      """Checks the returned context is not executed concurrently with any other."""
      if not lock.acquire(False):  # Non-blocking.
          raise RuntimeError(
              "Detected concurrent execution of TFPyEnvironment ops. Make sure the "
              "appropriate step_state is passed to step()."
          )
      try:
          yield
      finally:
          lock.release()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  from multiprocessing import pool
  import threading
  from typing import Any, Optional, Text
  from absl import logging
  import gin
  import numpy
  import tensorflow
  from tf_agents.environments import batched_py_environment
  from tf_agents.environments import py_environment
  from tf_agents.environments import tf_environment
  from tf_agents.specs import tensor_spec
  from tf_agents.typing import types
  from tensorflow.python.framework import tensor_shape
label_desc: Use image node_id 2 for calling a global function with example usage: _check_not_called_concurrently(lock) without return types