def _SetUpMapperReducer(self, mr_file, mr_dir):
    if mr_file:
      if mr_file.startswith('gs://'):
        return mr_file
      else:
        mr_on_storage = mr_dir + '/mapper-reducer/' + os.path.basename(mr_file)
        copy_command = 'gsutil cp %s %s' % (mr_file, mr_on_storage)
        logging.debug('Mapper/Reducer copy command: %s', copy_command)
        if subprocess.call(copy_command, shell=True):
          # Non-zero return code indicates an error.
          raise MapReduceError('Mapper/Reducer copy error: %s' % mr_file)
        return mr_on_storage
    else:
      # In streaming, 'cat' works as identity mapper/reducer (nop).
      return 'cat'
Prepares mapper or reducer program.
dataset/ETHPy150Open GoogleCloudPlatform/solutions-google-compute-engine-cluster-for-hadoop/gce_cluster.py/GceCluster._SetUpMapperReducer