def get_requirements(self, reqts, extras=None, env=None):
if self._legacy:<EOL><INDENT>result = reqts<EOL><DEDENT>else:<EOL><INDENT>result = []<EOL>extras = get_extras(extras or [], self.extras)<EOL>for d in reqts:<EOL><INDENT>if '<STR_LIT>' not in d and '<STR_LIT>' not in d:<EOL><INDENT>include = True<EOL><DEDENT>else:<EOL><INDENT>if '<STR_LIT>' not in d:<EOL><INDENT>include = True<EOL><DEDENT>else:<EOL><INDENT>include = d.get('<STR_LIT>') in extras<EOL><DEDENT>if include:<EOL><INDENT>marker = d.get('<STR_LIT>')<EOL>if marker:<EOL><INDENT>include = interpret(marker, env)<EOL><DEDENT><DEDENT><DEDENT>if include:<EOL><INDENT>result.extend(d['<STR_LIT>'])<EOL><DEDENT><DEDENT>for key in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT:test>'):<EOL><INDENT>e = '<STR_LIT>' % key<EOL>if e in extras:<EOL><INDENT>extras.remove(e)<EOL>reqts = self._data.get('<STR_LIT>' % key, [])<EOL>result.extend(self.get_requirements(reqts, extras=extras,<EOL>env=env))<EOL><DEDENT><DEDENT><DEDENT>return result<EOL>
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.