class_docstr: World representation for the WikitableQuestions domain.
  
  Parameters
  ----------
  table_graph : ``TableQuestionKnowledgeGraph``
      Context associated with this world.
class_docstr_tok: ["World","representation","for","the","WikitableQuestions","domain",".","Parameters","--","--","--","--","--","table_graph",":","``","TableQuestionKnowledgeGraph","``","Context","associated","with","this","world","."]
code: def get_valid_actions(self):
      valid_actions = super(WikiTablesWorld, self).get_valid_actions()
  
      # We need to add a few things here that don't get added by our world-general logic, and
      # remove some things that are technically possible in our type system, but not present in
      # the original SEMPRE grammar.
  
      # These are possible because of `reverse`.
      valid_actions["c"].append("c -> [<r,c>, r]")
      valid_actions["d"].append("d -> [<c,d>, c]")
      valid_actions["n"].append("n -> [<r,n>, r]")
      valid_actions["n"].append("n -> [<c,n>, c]")
      valid_actions["p"].append("p -> [<c,p>, c]")
      valid_actions["<p,n>"] = ["<p,n> -> ['lambda x', n]"]
  
      # These get added when we do our ANY_TYPE substitution with basic types, but we don't
      # actually need them.
      del valid_actions["<c,c>"]
      del valid_actions["<d,p>"]
      del valid_actions["<p,d>"]
      del valid_actions["<p,p>"]
      del valid_actions["<p,r>"]
  
      # The argmax type generates an action that takes a date as an argument, which it turns out
      # we don't need for parts.
      self._remove_action_from_type(
          valid_actions, "p", lambda x: "<d,p>" in x
      )
  
      # Our code that generates lambda productions similarly creates more than we need.
      for type_ in [
          "<c,p>",
          "<c,r>",
          "<d,c>",
          "<d,r>",
          "<n,c>",
          "<n,p>",
          "<n,r>",
          "<p,c>",
          "<r,c>",
          "<r,r>",
      ]:
          self._remove_action_from_type(
              valid_actions, type_, lambda x: "lambda" in x
          )
  
      # And we don't need `reverse` productions everywhere they are added, either.
      for type_ in ["<c,r>", "<p,c>", "<r,d>"]:
          self._remove_action_from_type(
              valid_actions, type_, lambda x: "<<#1,#2>,<#2,#1>>" in x
          )
  
      return valid_actions
  
file_path: magnitude/pymagnitude/third_party/allennlp/semparse/worlds/wikitables_world.py
imports: from __future__ import absolute_import
  import re
  from nltk.sem.logic import Type
  from allennlp.semparse.worlds.world import ParsingError, World
  from allennlp.semparse.type_declarations import wikitables_type_declaration
  from allennlp.semparse.contexts import TableQuestionKnowledgeGraph
label_desc: Use image node_id 5 for calling the WikiTablesWorld obj's underlying member method code with example usage: obj.get_valid_actions() and returns: valid_actions