parameters: (t1, t2)
docstring: A binary relation denoted by ~ that determines if t1 is consistent with t2.
      The relation is reflexive, semmetric but not transitive.
      returns True if t1 and t2 are consistent and False otherwise.
      Example:
          Dyn ~ TensorType((1,2,3))
          int ~ Dyn
          int ~ int
          TensorType((1,Dyn,3)) ~ TensorType((1,2,3))
docstring_summary: A binary relation denoted by ~ that determines if t1 is consistent with t2.
      The relation is reflexive, semmetric but not transitive.
      returns True if t1 and t2 are consistent and False otherwise.
      Example:
          Dyn ~ TensorType((1,2,3))
          int ~ Dyn
          int ~ int
          TensorType((1,Dyn,3)) ~ TensorType((1,2,3))
docstring_tokens: A binary relation denoted by ~ that determines if t1 is consistent with t2 . The relation is reflexive semmetric but not transitive . returns True if t1 and t2 are consistent and False otherwise . Example : Dyn ~ TensorType (( 1 2 3 )) int ~ Dyn int ~ int TensorType (( 1 Dyn 3 )) ~ TensorType (( 1 2 3 ))
function: def is_consistent(t1, t2):
      """
      A binary relation denoted by ~ that determines if t1 is consistent with t2.
      The relation is reflexive, semmetric but not transitive.
      returns True if t1 and t2 are consistent and False otherwise.
      Example:
          Dyn ~ TensorType((1,2,3))
          int ~ Dyn
          int ~ int
          TensorType((1,Dyn,3)) ~ TensorType((1,2,3))
      """
  
      if t1 == t2:
          return True
  
      if t1 == Dyn or t2 == Dyn or isinstance(t1, Var) or isinstance(t2, Var):
          return True
  
      if isinstance(t1, TensorType) and isinstance(t2, TensorType):
          return len(t1.__args__) == len(t2.__args__) and \
              all([is_consistent(elem1, elem2) for elem1, elem2 in zip(t1.__args__, t2.__args__)])
      else:
          return False
function_tokens: def is_consistent ( t1 , t2 ) : if t1 == t2 : return True if t1 == Dyn or t2 == Dyn or isinstance ( t1 , Var ) or isinstance ( t2 , Var ) : return True if isinstance ( t1 , TensorType ) and isinstance ( t2 , TensorType ) : return len ( t1 . __args__ ) == len ( t2 . __args__ ) and all ( [ is_consistent ( elem1 , elem2 ) for elem1 , elem2 in zip ( t1 . __args__ , t2 . __args__ ) ] ) else : return False