code: def as_dict(self):
          
          return {
              'name': str(self),
              'modules': [m.as_dict() for m in self.modules],
              'packages': [p.as_dict() for p in self.packages]
          }
docs: Return the dependencies as a dictionary.
  
          Returns:
              dict: dictionary of dependencies.