code: def generate_op_args_and_env(
      op_cmd,
      flag_vals,
      resolve_params,
      force_flag_args=False,
  ):
      """Generates command args and env, returning them as a tuple.
  
      The result contains encoded arguments and environment variables
      according to `op_cmd.cmd_args` and `op_cmd.cmd_flags`. The special
      cmd arg value '__flag_args__' is replaced by encoded values from
      `flag_vals` for corresponding entries in `op_cmd.cmd_flags`.
  
      If `force_flag_args` is True, includes encoded flag values in the
      result even when they don't have a corresponding entry in
      `op_cmd.cmd_flags`.
      """
      return (
          _gen_args(op_cmd, flag_vals, resolve_params, force_flag_args),
          _gen_env(op_cmd, flag_vals),
      )
  
imports: import logging
  import pprint
  from guild import flag_util
  from guild import util
  from guild import yaml_util
label_desc: Use image node_id 1 for calling a global function with example usage: generate_op_args_and_env(op_cmd, flag_vals, resolve_params, force_flag_args) and returns: _gen_args,  _gen_env