def get_timeouts(builder_cfg):
  """Some builders require longer than the default timeouts.

  Returns tuple of (expiration, hard_timeout). If those values are None then
  default timeouts should be used.
  """
  expiration = None
  hard_timeout = None
  if 'Valgrind' in builder_cfg.get('extra_config', ''):
    expiration = 24*60*60
    hard_timeout = 7*60*60
  return expiration, hard_timeout