code: def clone(id, path):
      
      data_source = get_data_object(id, use_data_config=False)
  
      if not data_source:
          if 'output' in id:
              floyd_logger.info("Note: You cannot clone the output of a running job. You need to wait for it to finish.")
          sys.exit()
  
      if path:
          # Download a directory from Dataset or Files
          # Get the type of data resource from the id (foo/projects/bar/ or foo/datasets/bar/)
          if '/datasets/' in id:
              resource_type = 'data'
              resource_id = data_source.id
          else:
              resource_type = 'files'
              try:
                  experiment = ExperimentClient().get(normalize_job_name(id, use_config=False))
              except FloydException:
                  experiment = ExperimentClient().get(id)
              resource_id = experiment.id
  
          data_url = "{}/api/v1/download/artifacts/{}/{}?is_dir=true&path={}".format(floyd.floyd_host,
                                                                                     resource_type,
                                                                                     resource_id,
                                                                                     path)
      else:
          # Download the full Dataset
          data_url = "{}/api/v1/resources/{}?content=true&download=true".format(floyd.floyd_host,
                                                                                data_source.resource_id)
      DataClient().download_tar(url=data_url,
                                untar=True,
                                delete_after_untar=True)
docs: - Download all files in a dataset or from a Job output
  
      Eg: alice/projects/mnist/1/files, alice/projects/mnist/1/output or alice/dataset/mnist-data/1/
  
      Using /output will download the files that are saved at the end of the job.
  
      Note: This will download the files that are saved at
      the end of the job.
  
      - Download a directory from a dataset or from Job output
  
      Specify the path to a directory and download all its files and subdirectories.
  
      Eg: --path models/checkpoint1