def _get_transform_env_log()

in pathology/transformation_pipeline/local/start_local.py [0:0]


def _get_transform_env_log(env: Mapping[str, str]) -> str:
  """Returns String representation of transform pipleine ENVS set by runner."""
  env = dict(env)
  # Add entry for DICOM store if configured to run against actual store.
  if 'LOCALHOST_DICOM_STORE' in env:
    if env['LOCALHOST_DICOM_STORE'].lower().startswith('http'):
      env['DICOMWEB_URL'] = env['LOCALHOST_DICOM_STORE']
    del env['LOCALHOST_DICOM_STORE']
  # strip envs which only have meaning for localhost_main.
  for key in _LOCALHOST_SPECIFIC_ENVS:
    if key in env:
      del env[key]
  return '\n'.join(
      [f'  {key}: {_quote(env[key])}' for key in sorted(list(env))]
  )