def check_indices(indices):
 if ((not isinstance(indices, tuple)) or (len(indices) != 2)):
  raise ValueError('indices must be a tuple of length 2')
 if (len(indices[0]) != len(indices[1])):
  raise ValueError('Index arrays indices[0] and indices[1] must have the same length')
 return indices

def check_indices ( indices ) : if ( ( not isinstance ( indices , tuple ) ) or ( len ( indices ) != 2 ) ) : raise ValueError ( 'indices must be a tuple of length 2' ) if ( len ( indices [ 0 ] ) != len ( indices [ 1 ] ) ) : raise ValueError ( 'Index arrays indices[0] and indices[1] must have the same length' ) return indices
check indices parameter .