def get_dataflow_docstring():
  """Get docstring for Dataflow module and give it an rST title."""
  init_file_path = os.path.normpath('./google/cloud/dataflow/__init__.py')
  try:
    with open(init_file_path, 'r') as init_file:
      init_file_contents = init_file.read()
  except __HOLE__:
    return None
  doc_match = re.search(r'"""(.*)"""', init_file_contents, flags=re.DOTALL)
  if not doc_match:
    return None
  docstring = doc_match.group(1).rstrip()
  title_match = re.match(r'(.*)\.\n\n', docstring)
  if title_match:
    # A module docstring has a first line that ends with a period and has a
    # blank line after it.  reStructuredText, the format used by setuptools
    # (and other Python API documentation tools), wants no trailing period
    # and a highlighting line of equal signs under the title line.
    # Convert by removing the period and adding a highlighting line.
    equalsigns_fill_format = '\n{:=^%d}\n' % title_match.end(1)
    title_underline = equalsigns_fill_format.format('=')
    docstring = re.sub(r'\.\n', title_underline, docstring, count=1)
  return docstring
dataset/ETHPy150Open GoogleCloudPlatform/DataflowPythonSDK/setup.py/get_dataflow_docstring