def can_do_meijer(a1, a2, b1, b2, numeric=True):
 from sympy import unpolarify, expand
 r = hyperexpand(meijerg(a1, a2, b1, b2, z))
 if r.has(meijerg):
  return False
 r = unpolarify(expand(r, force=True, power_base=True, power_exp=False, mul=False, log=False, multinomial=False, basic=False))
 if (not numeric):
  return True
 repl = {}
 for (n, a) in enumerate((meijerg(a1, a2, b1, b2, z).free_symbols - {z})):
  repl[a] = randcplx(n)
 return tn(meijerg(a1, a2, b1, b2, z).subs(repl), r.subs(repl), z)

def can_do_meijer ( a1 , a2 , b1 , b2 , numeric = True ) : from sympy import unpolarify , expand r = hyperexpand ( meijerg ( a1 , a2 , b1 , b2 , z ) ) if r . has ( meijerg ) : return False r = unpolarify ( expand ( r , force = True , power_base = True , power_exp = False , mul = False , log = False , multinomial = False , basic = False ) ) if ( not numeric ) : return True repl = { } for ( n , a ) in enumerate ( ( meijerg ( a1 , a2 , b1 , b2 , z ) . free_symbols - { z } ) ) : repl [ a ] = randcplx ( n ) return tn ( meijerg ( a1 , a2 , b1 , b2 , z ) . subs ( repl ) , r . subs ( repl ) , z )
this helper function tries to hyperexpand() the meijer g-function corresponding to the parameters a1 .