def resolve_output_type(context, inputs, formal_output):
 selected_input = inputs[select_array_wrapper(inputs)]
 args = (selected_input, formal_output)
 sig = context.resolve_function_type('__array_wrap__', args, {})
 if (sig is None):
  if (selected_input.array_priority == types.Array.array_priority):
   return formal_output
  raise errors.TypingError(('__array_wrap__ failed for %s' % (args,)))
 return sig.return_type

def resolve_output_type ( context , inputs , formal_output ) : selected_input = inputs [ select_array_wrapper ( inputs ) ] args = ( selected_input , formal_output ) sig = context . resolve_function_type ( '__array_wrap__' , args , { } ) if ( sig is None ) : if ( selected_input . array_priority == types . Array . array_priority ) : return formal_output raise errors . TypingError ( ( '__array_wrap__ failed for %s' % ( args , ) ) ) return sig . return_type
given the array-compatible input types to an operation .