def parse_and_validate_push_spatial(parser, push_spatial):
 try:
  push_spatial = eval(push_spatial)
 except (SyntaxError, NameError) as _:
  err = ('Tried to parse the following push_spatial value\n%s\nas a Python expression, but it failed. push_spatial should be a valid Python expression.' % push_spatial)
  parser.error(err)
 if (push_spatial == None):
  push_spatial = (0, 0)
 elif (isinstance(push_spatial, tuple) and (len(push_spatial) == 2)):
  pass
 else:
  err = ('push_spatial should be None or a valid tuple of indices of length 2, but it is: %s' % push_spatial)
  parser.error(err)
 return push_spatial

def parse_and_validate_push_spatial ( parser , push_spatial ) : try : push_spatial = eval ( push_spatial ) except ( SyntaxError , NameError ) as _ : err = ( 'Tried to parse the following push_spatial value\n%s\nas a Python expression, but it failed. push_spatial should be a valid Python expression.' % push_spatial ) parser . error ( err ) if ( push_spatial == None ) : push_spatial = ( 0 , 0 ) elif ( isinstance ( push_spatial , tuple ) and ( len ( push_spatial ) == 2 ) ) : pass else : err = ( 'push_spatial should be None or a valid tuple of indices of length 2, but it is: %s' % push_spatial ) parser . error ( err ) return push_spatial
returns tuple of length 2 .