def _check_resources(name, expr, resources):
 if (expr is None):
  return
 bound = expr._resources()
 if ((not bound) and (resources is None)):
  raise ValueError(('no resources provided to compute %s' % name))
 if (bound and resources):
  raise ValueError(('explicit and implicit resources provided to compute %s' % name))

def _check_resources ( name , expr , resources ) : if ( expr is None ) : return bound = expr . _resources ( ) if ( ( not bound ) and ( resources is None ) ) : raise ValueError ( ( 'no resources provided to compute %s' % name ) ) if ( bound and resources ) : raise ValueError ( ( 'explicit and implicit resources provided to compute %s' % name ) )
validate that the expression and resources passed match up .