docs: def _get_target(self, target):
          """
          Get the Package or Module related to given target.
  
          Args:
              target (str): target to find.
  
          Returns:
              Package/Module: package containing target or corresponding module.
          """
          depth = target.count('.') + 1
          parts = target.split('.', 1)
          for m in self.modules:
              if parts[0] == m.name:
                  if depth < 3:
                      return m
          for p in self.packages:
              if parts[0] == p.name:
                  if depth == 1:
                      return p
                  # pylama:ignore=W0212
                  target = p._get_target(parts[1])
                  if target:
                      return target
                  # FIXME: can lead to internal dep instead of external
                  # see example with django.contrib.auth.forms
                  # importing forms from django
                  # Idea: when parsing files with ast, record what objects
                  # are defined in the module. Then check here if the given
                  # part is one of these objects.
                  if depth < 3:
                      return p
          return None