@cacheit
def _has_simple_delta(expr, index):
 if expr.has(KroneckerDelta):
  if _is_simple_delta(expr, index):
   return True
  if (expr.is_Add or expr.is_Mul):
   for arg in expr.args:
    if _has_simple_delta(arg, index):
     return True
 return False

@ cacheit def _has_simple_delta ( expr , index ) : if expr . has ( KroneckerDelta ) : if _is_simple_delta ( expr , index ) : return True if ( expr . is_Add or expr . is_Mul ) : for arg in expr . args : if _has_simple_delta ( arg , index ) : return True return False
returns true if expr is an expression that contains a kroneckerdelta that is simple in the index index .