def symmath_check_simple(expect, ans, adict={}, symtab=None, extra_options=None):
 options = {'__MATRIX__': False, '__ABC__': False, '__LOWER__': False}
 if extra_options:
  options.update(extra_options)
 for op in options:
  if (op in expect):
   expect = expect.replace(op, '')
   options[op] = True
 expect = expect.replace('__OR__', '__or__')
 if options['__LOWER__']:
  expect = expect.lower()
  ans = ans.lower()
 try:
  ret = check(expect, ans, matrix=options['__MATRIX__'], abcsym=options['__ABC__'], symtab=symtab)
 except Exception as err:
  return {'ok': False, 'msg': ('Error %s<br/>Failed in evaluating check(%s,%s)' % (err, expect, ans))}
 return ret

def symmath_check_simple ( expect , ans , adict = { } , symtab = None , extra_options = None ) : options = { '__MATRIX__' : False , '__ABC__' : False , '__LOWER__' : False } if extra_options : options . update ( extra_options ) for op in options : if ( op in expect ) : expect = expect . replace ( op , '' ) options [ op ] = True expect = expect . replace ( '__OR__' , '__or__' ) if options [ '__LOWER__' ] : expect = expect . lower ( ) ans = ans . lower ( ) try : ret = check ( expect , ans , matrix = options [ '__MATRIX__' ] , abcsym = options [ '__ABC__' ] , symtab = symtab ) except Exception as err : return { 'ok' : False , 'msg' : ( 'Error %s<br/>Failed in evaluating check(%s,%s)' % ( err , expect , ans ) ) } return ret
check a symbolic mathematical expression using sympy .