def Register(parsed_flags):
  if not parsed_flags.collectd:
    return

  logging.info('Registering collectd collector')

  output_directory = parsed_flags.collectd_output or vm_util.GetTempDir()
  if not os.path.isdir(output_directory):
    raise IOError('collectd output directory does not exist: {0}'.format(
        output_directory))
  collector = _CollectdCollector(output_directory)
  events.before_phase.connect(collector.Before, events.RUN_PHASE, weak=False)
  events.after_phase.connect(collector.After, events.RUN_PHASE, weak=False)
Propagate the provides attribute to the synthetic java_library() target for publishing.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/traces/collectd.py/Register--crossover with--dataset/ETHPy150Open pantsbuild/pants/src/python/pants/backend/codegen/tasks/antlr_gen.py/AntlrGen._copy_target_attributes