def _make_alias_docstring(new_name, func_or_class):
  """Make deprecation alias docstring."""
  if func_or_class.__doc__:
    lines = func_or_class.__doc__.split('\n')
    lines[0] += ' (deprecated)'
  else:
    lines = ['DEPRECATED CLASS']
  first_line = lines[0]
  notice_lines = [
      ('Warning: THIS CLASS IS DEPRECATED. It will be removed in a future '
       'version.'),
      'Please use %s instead.' % new_name
  ]
  remaining_lines = []
  remaining_lines_string = '\n'.join(lines[1:]).strip()
  if remaining_lines_string:
    remaining_lines = remaining_lines_string.split('\n')
  lines = ([first_line, ''] + notice_lines +
           (([''] + remaining_lines) if remaining_lines else []))
  return '\n'.join(lines)