def random_string(*, prefix = None):
  """Return a moderately randomized string, possibly with a prefix.

  Helpful for generating random directories to write different models to

  Args:
    prefix: If not None, prefix this to the random string

  Returns:
    Random string, perhaps with a prefix
  """
  # For the use case, this is large enough (unique experiment IDs)
  postfix = str(random.randrange(1_000_000, 2_000_000))
  if prefix is None:
    return postfix
  else:
    return f'{prefix}-{postfix}'
Return a moderately randomized string, possibly with a prefix.

  Helpful for generating random directories to write different models to

  Args:
    prefix: If not None, prefix this to the random string

  Returns:
    Random string, perhaps with a prefix
  
language/serene/util.py