code: def get_requirements(self, reqts, extras=None, env=None):
          
          if self._legacy:
              result = reqts
          else:
              result = []
              extras = get_extras(extras or [], self.extras)
              for d in reqts:
                  if 'extra' not in d and 'environment' not in d:
                      # unconditional
                      include = True
                  else:
                      if 'extra' not in d:
                          # Not extra-dependent - only environment-dependent
                          include = True
                      else:
                          include = d.get('extra') in extras
                      if include:
                          # Not excluded because of extras, check environment
                          marker = d.get('environment')
                          if marker:
                              include = interpret(marker, env)
                  if include:
                      result.extend(d['requires'])
              for key in ('build', 'dev', 'test'):
                  e = ':%s:' % key
                  if e in extras:
                      extras.remove(e)
                      # A recursive call, but it should terminate since 'test'
                      # has been removed from the extras
                      reqts = self._data.get('%s_requires' % key, [])
                      result.extend(self.get_requirements(reqts, extras=extras,
                                                          env=env))
          return result
docs: Base method to get dependencies, given a set of extras
          to satisfy and an optional environment context.
          :param reqts: A list of sometimes-wanted dependencies,
                        perhaps dependent on extras and environment.
          :param extras: A list of optional components being requested.
          :param env: An optional environment for marker evaluation.