code: def scope_vars(scope, trainable_only=False):
      """
      Get variables inside a scope
      The scope can be specified as a string
  
      :param scope: (str or VariableScope) scope in which the variables reside.
      :param trainable_only: (bool) whether or not to return only the variables that were marked as trainable.
      :return: ([TensorFlow Tensor]) vars: list of variables in `scope`.
      """
      return tf.get_collection(
          tf.GraphKeys.TRAINABLE_VARIABLES
          if trainable_only
          else tf.GraphKeys.GLOBAL_VARIABLES,
          scope=scope if isinstance(scope, str) else scope.name,
      )
  
file_path: stable-baselines/stable_baselines/deepq/build_graph.py
imports: import tensorflow
  from gym.spaces import MultiDiscrete
  from stable_baselines.common import tf_util
label_desc: Use image node_id 1 for calling a global function with example usage: scope_vars(scope, trainable_only) and returns: tf