def guarded_mul(left, right):
 if (not isinstance(left, numbers.Integral)):
  pass
 elif (not isinstance(right, numbers.Integral)):
  pass
 elif ((left in (0, 1)) or (right in (0, 1))):
  pass
 elif ((left.bit_length() + right.bit_length()) > 664386):
  raise ValueError(u'Value is too large to be handled in limited time and memory.')
 return operator.mul(left, right)

def guarded_mul ( left , right ) : if ( not isinstance ( left , numbers . Integral ) ) : pass elif ( not isinstance ( right , numbers . Integral ) ) : pass elif ( ( left in ( 0 , 1 ) ) or ( right in ( 0 , 1 ) ) ) : pass elif ( ( left . bit_length ( ) + right . bit_length ( ) ) > 664386 ) : raise ValueError ( u'Value is too large to be handled in limited time and memory.' ) return operator . mul ( left , right )
decorate a function to raise an error for values > limit .