code: def _module_to_paths(module):
      """Get all API __init__.py file paths for the given module.
  
      Args:
        module: Module to get file paths for.
  
      Returns:
        List of paths for the given module. For e.g. module foo.bar
        requires 'foo/__init__.py' and 'foo/bar/__init__.py'.
      """
      submodules = []
      module_segments = module.split(".")
      for i in range(len(module_segments)):
          submodules.append(".".join(module_segments[: i + 1]))
      paths = []
      for submodule in submodules:
          if not submodule:
              paths.append("__init__.py")
              continue
          paths.append("%s/__init__.py" % (submodule.replace(".", "/")))
      return paths
  
file_path: tensorflow/tensorflow/python/tools/api/generator/output_init_files_test.py
imports: import argparse
  import importlib
  import sys
  from tensorflow.python.platform import resource_loader
  from tensorflow.python.platform import test
  from tensorflow.python.util import tf_decorator
label_desc: Use image node_id 5 for calling a global function with example usage: _module_to_paths(module) and returns: paths