code: def _get_extra_packages(self, repo):
          
          if self._update:
              extras = {k: [d.name for d in v] for k, v in self._package.extras.items()}
          else:
              extras = self._locker.lock_data.get("extras", {})
  
          extra_packages = []
          for extra_name, packages in extras.items():
              if extra_name not in self._extras:
                  continue
  
              extra_packages += [Dependency(p, "*") for p in packages]
  
          def _extra_packages(packages):
              pkgs = []
              for package in packages:
                  for pkg in repo.packages:
                      if pkg.name == package.name:
                          pkgs.append(package)
                          pkgs += _extra_packages(pkg.requires)
  
                          break
  
              return pkgs
  
          return _extra_packages(extra_packages)
docs: Returns all packages required by extras.
  
          Maybe we just let the solver handle it?