<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _generate_args(pipeline, future, queue_name, base_path):
 """Generate the params used to describe a Pipeline's depedencies. The arguments passed to this method may be normal values, Slot instances (for named outputs), or PipelineFuture instances (for referring to the default output slot). Args: pipeline: The Pipeline instance to generate args for. future: The PipelineFuture for the Pipeline these arguments correspond to. queue_name: The queue to run the pipeline on. base_path: Relative URL for pipeline URL handlers. Returns: Tuple (dependent_slots, output_slot_keys, params_text, params_blob) where: dependent_slots: List of db.Key instances of _SlotRecords on which this pipeline will need to block before execution (passed to create a _BarrierRecord for running the pipeline). output_slot_keys: List of db.Key instances of _SlotRecords that will be filled by this pipeline during its execution (passed to create a _BarrierRecord for finalizing the pipeline). params_text: JSON dictionary of pipeline parameters to be serialized and saved in a corresponding _PipelineRecord. Will be None if the params are too big and must be saved in a blob instead. params_blob: JSON dictionary of pipeline parameters to be serialized and saved in a Blob file, and then attached to a _PipelineRecord. Will be None if the params data size was small enough to fit in the entity. """

  params = {
      'args': [],
      'kwargs': {},
      'after_all': [],
      'output_slots': {},
      'class_path': pipeline._class_path,
      'queue_name': queue_name,
      'base_path': base_path,
      'backoff_seconds': pipeline.backoff_seconds,
      'backoff_factor': pipeline.backoff_factor,
      'max_attempts': pipeline.max_attempts,
      'task_retry': pipeline.task_retry,
      'target': pipeline.target,
  }
  dependent_slots = set()

  arg_list = params['args']
  for current_arg in pipeline.args:
    if isinstance(current_arg, PipelineFuture):
      current_arg = current_arg.default
    if isinstance(current_arg, Slot):
      arg_list.append({'type': 'slot', 'slot_key': str(current_arg.key)})
      dependent_slots.add(current_arg.key)
    else:
      arg_list.append({'type': 'value', 'value': current_arg})

  kwarg_dict = params['kwargs']
  for name, current_arg in pipeline.kwargs.iteritems():
    if isinstance(current_arg, PipelineFuture):
      current_arg = current_arg.default
    if isinstance(current_arg, Slot):
      kwarg_dict[name] = {'type': 'slot', 'slot_key': str(current_arg.key)}
      dependent_slots.add(current_arg.key)
    else:
      kwarg_dict[name] = {'type': 'value', 'value': current_arg}

  after_all = params['after_all']
  for other_future in future._after_all_pipelines:
    slot_key = other_future._output_dict['default'].key
    after_all.append(str(slot_key))
    dependent_slots.add(slot_key)

  output_slots = params['output_slots']
  output_slot_keys = set()
  for name, slot in future._output_dict.iteritems():
    output_slot_keys.add(slot.key)
    output_slots[name] = str(slot.key)

  params_encoded = json.dumps(params, cls=mr_util.JsonEncoder)
  params_text = None
  params_blob = None
  if len(params_encoded) > _MAX_JSON_SIZE:
    params_blob = _write_json_blob(params_encoded, pipeline.pipeline_id)
  else:
    params_text = params_encoded

  return dependent_slots, output_slot_keys, params_text, params_blob