hunk.code_window:         checkpoints_df = checkpoints_df.sort_values(by=sort)
       print_format_output(checkpoints_df)
   def list_experiments(project_path,
                        sort=None,
  
hunk.labels: keep keep keep add keep keep keep
hunk.after_edit:     if output:
           experiment_path = os.path.expanduser(experiment_path)
           output_path = os.path.join(experiment_path, output)
           file_extension = os.path.splitext(output)[1].lower()
           if file_extension in (".p", ".pkl", ".pickle"):
               checkpoints_df.to_pickle(output_path)
           elif file_extension == ".csv":
               checkpoints_df.to_csv(output_path, index=False)
           else:
               raise ValueError("Unsupported filetype: {}".format(output))
           print("Output saved at:", output_path)
  
hunk.file_path: python/ray/tune/commands.py
hunk.type: add
file: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  
  import click
  import ray.tune.commands as commands
  
  
  @click.group()
  def cli():
      pass
  
  
  @cli.command()
  @click.argument("experiment_path", required=True, type=str)
  @click.option(
      '--sort', default=None, type=str, help='Select which column to sort on.')
  def list_trials(experiment_path, sort):
      """Lists trials in the directory subtree starting at the given path."""
      commands.list_trials(experiment_path, sort)
  
  
  @cli.command()
  @click.argument("project_path", required=True, type=str)
  @click.option(
      '--sort', default=None, type=str, help='Select which column to sort on.')
  def list_experiments(project_path, sort):
      """Lists experiments in the directory subtree."""
      commands.list_experiments(project_path, sort)
  
  
  @cli.command()
  @click.argument("path", required=True, type=str)
  @click.option(
      "--filename",
      default="note.txt",
      type=str,
      help='Specify filename for note.')
  def add_note(path, filename):
      """Adds user notes as a text file at the given path."""
      commands.add_note(path, filename)
  
  
  cli.add_command(list_trials, name="ls")
  cli.add_command(list_trials, name="list-trials")
  cli.add_command(list_experiments, name="lsx")
  cli.add_command(list_experiments, name="list-experiments")
  cli.add_command(add_note, name="add-note")
  
  
  def main():
      return cli()
  
  
  if __name__ == "__main__":
      main()
  