@contextlib.contextmanager
def make_contiguous(context, builder, sig, args):
 newtys = []
 newargs = []
 copies = []
 for (ty, val) in zip(sig.args, args):
  if ((not isinstance(ty, types.Array)) or (ty.layout in 'CF')):
   (newty, newval) = (ty, val)
  else:
   newty = ty.copy(layout='C')
   copysig = signature(newty, ty)
   newval = array_copy(context, builder, copysig, (val,))
   copies.append((newty, newval))
  newtys.append(newty)
  newargs.append(newval)
 (yield (signature(sig.return_type, *newtys), tuple(newargs)))
 for (ty, val) in copies:
  context.nrt.decref(builder, ty, val)

@ contextlib . contextmanager def make_contiguous ( context , builder , sig , args ) : newtys = [ ] newargs = [ ] copies = [ ] for ( ty , val ) in zip ( sig . args , args ) : if ( ( not isinstance ( ty , types . Array ) ) or ( ty . layout in 'CF' ) ) : ( newty , newval ) = ( ty , val ) else : newty = ty . copy ( layout = 'C' ) copysig = signature ( newty , ty ) newval = array_copy ( context , builder , copysig , ( val , ) ) copies . append ( ( newty , newval ) ) newtys . append ( newty ) newargs . append ( newval ) ( yield ( signature ( sig . return_type , * newtys ) , tuple ( newargs ) ) ) for ( ty , val ) in copies : context . nrt . decref ( builder , ty , val )
ensure that all array arguments are contiguous .