def _optional_get_env(repository_ctx, name, default=None):
  """Return the environment variable's value if present, default otherwise"""
  if name in repository_ctx.os.environ:
    return repository_ctx.os.environ[name]
  return default