code: def scope_vars(scope, trainable_only=False):
      """
      Get variables inside a scope
      The scope can be specified as a string
      Parameters
      ----------
      scope: str or VariableScope
          scope in which the variables reside.
      trainable_only: bool
          whether or not to return only the variables that were marked as trainable.
      Returns
      -------
      vars: [tf.Variable]
          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: baselines/baselines/deepq/build_graph.py
imports: import tensorflow
  import baselines.common.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