docstr: :return: The path to the directory of a package. None in case it's not
           a package.
docstr_tok: [":","return",":","The","path","to","the","directory","of","a","package",".","None","in","case","it","'s","not","a","package","."]
code: def _get_init_directory(self):
      """
      :return: The path to the directory of a package. None in case it's not
               a package.
      """
      for suffix in all_suffixes():
          ending = "__init__" + suffix
          py__file__ = self.py__file__()
          if py__file__ is not None and py__file__.endswith(ending):
              # Remove the ending, including the separator.
              return self.py__file__()[: -len(ending) - 1]
      return None
  
imports: import re
  import os
  from parso import python_bytes_to_unicode
  from jedi.evaluate.cache import evaluator_method_cache
  from jedi._compatibility import iter_modules, all_suffixes
  from jedi.evaluate.filters import GlobalNameFilter, ContextNameMixin, AbstractNameDefinition, ParserTreeFilter, DictFilter, MergedFilter
  from jedi.evaluate import compiled
  from jedi.evaluate.base_context import TreeContext
  from jedi.evaluate.imports import SubModuleName, infer_import
label_desc: Use image node_id 7 for calling the ModuleContext obj's underlying member method code with example usage: obj._get_init_directory() and returns: None, self