def is_sqrt(expr):
 return (expr.is_Pow and expr.exp.is_Rational and (abs(expr.exp) is S.Half))

def is_sqrt ( expr ) : return ( expr . is_Pow and expr . exp . is_Rational and ( abs ( expr . exp ) is S . Half ) )
return true if expr is a sqrt .