def normalize_index(context, builder, idxty, idx):
 if (isinstance(idxty, types.Array) and (idxty.ndim == 0)):
  assert isinstance(idxty.dtype, types.Integer)
  idxary = make_array(idxty)(context, builder, idx)
  idxval = load_item(context, builder, idxty, idxary.data)
  return (idxty.dtype, idxval)
 else:
  return (idxty, idx)

def normalize_index ( context , builder , idxty , idx ) : if ( isinstance ( idxty , types . Array ) and ( idxty . ndim == 0 ) ) : assert isinstance ( idxty . dtype , types . Integer ) idxary = make_array ( idxty ) ( context , builder , idx ) idxval = load_item ( context , builder , idxty , idxary . data ) return ( idxty . dtype , idxval ) else : return ( idxty , idx )
normalize the index type and value .