def denoms(eq, symbols=None):
 pot = preorder_traversal(eq)
 dens = set()
 for p in pot:
  den = denom(p)
  if (den is S.One):
   continue
  for d in Mul.make_args(den):
   dens.add(d)
 if (not symbols):
  return dens
 rv = []
 for d in dens:
  free = d.free_symbols
  if any(((s in free) for s in symbols)):
   rv.append(d)
 return set(rv)

def denoms ( eq , symbols = None ) : pot = preorder_traversal ( eq ) dens = set ( ) for p in pot : den = denom ( p ) if ( den is S . One ) : continue for d in Mul . make_args ( den ) : dens . add ( d ) if ( not symbols ) : return dens rv = [ ] for d in dens : free = d . free_symbols if any ( ( ( s in free ) for s in symbols ) ) : rv . append ( d ) return set ( rv )
return set of all denominators that appear in eq that contain any symbol in iterable symbols; if symbols is none then all denominators will be returned .