code: def make_stmt_from_sort_key(key, verb):
      def make_agent(name):
          if name == 'None' or name is None:
              return None
          return Agent(name)
      StmtClass = get_statement_by_name(verb)
      inps = list(key[1])
      if verb == 'Complex':
          stmt = StmtClass([make_agent(name) for name in inps])
      elif verb == 'Conversion':
          stmt = StmtClass(make_agent(inps[0]),
                           [make_agent(name) for name in inps[1]],
                           [make_agent(name) for name in inps[2]])
      elif verb == 'ActiveForm' or verb == 'HasActivity':
          stmt = StmtClass(make_agent(inps[0]), inps[1], inps[2])
      else:
          stmt = StmtClass(*[make_agent(name) for name in inps])
      return stmt