code: def _save_subimports(self, code, top_level_dependencies):
          
          # check if any known dependency is an imported package
          for x in top_level_dependencies:
              if isinstance(x, types.ModuleType) and hasattr(x, '__package__') and x.__package__:
                  # check if the package has any currently loaded sub-imports
                  prefix = x.__name__ + '.'
                  for name, module in sys.modules.items():
                      # Older versions of pytest will add a "None" module to sys.modules.
                      if name is not None and name.startswith(prefix):
                          # check whether the function can address the sub-module
                          tokens = set(name[len(prefix):].split('.'))
                          if not tokens - set(code.co_names):
                              # ensure unpickler executes this import
                              self.save(module)
                              # then discards the reference to it
                              self.write(pickle.POP)
docs: Ensure de-pickler imports any package child-modules that
          are needed by the function