def find_dynamicsymbols(expression, exclude=None):
 t_set = {dynamicsymbols._t}
 if exclude:
  if iterable(exclude):
   exclude_set = set(exclude)
  else:
   raise TypeError('exclude kwarg must be iterable')
 else:
  exclude_set = set()
 return (set([i for i in expression.atoms(AppliedUndef, Derivative) if (i.free_symbols == t_set)]) - exclude_set)

def find_dynamicsymbols ( expression , exclude = None ) : t_set = { dynamicsymbols . _t } if exclude : if iterable ( exclude ) : exclude_set = set ( exclude ) else : raise TypeError ( 'exclude kwarg must be iterable' ) else : exclude_set = set ( ) return ( set ( [ i for i in expression . atoms ( AppliedUndef , Derivative ) if ( i . free_symbols == t_set ) ] ) - exclude_set )
find all dynamicsymbols in expression .