manages the convention from an iterative index to the specific polynomial n, m, (real/imaginary part)

        :param index: int, index of list
        :return: n, m bool
775417
def index2poly(self, index):
        

        n = self._index2n(index)

        num_prev = n * (n + 1) / 2
        num = index + 1
        delta = int(num - num_prev - 1)
        if n % 2 == 0:
            if delta == 0:
                m = delta
                complex_bool = False
            elif delta % 2 == 0:
                complex_bool = True
                m = delta
            else:
                complex_bool = False
                m = delta + 1
        else:
            if delta % 2 == 0:
                complex_bool = False
                m = delta + 1
            else:
                complex_bool = True
                m = delta
        return n, m, complex_bool
538444
def tuple_index(self, n):
        ''''''
        return n.args and n.args[-1].type == 'index' and general_type(n.args[-1].sequence.pseudo_type) == 'Tuple' and\
               n.args[-1].index.type == 'int' and\
               (n.args[-1].index.value == -1 or n.args[-1].index.value == len(n.args[-1].sequence.pseudo_type) - 2)
641472
def index_iterator(self):
        
        idx = 0  # index
        while idx < self.number_intervals:
            new_idx = yield idx
            idx += 1
            if new_idx:
                idx = new_idx - 1
1247038
def global_to_local(self, index):
        
        if (type(index) is int) or (type(index) is slice):
            if len(self.__mask) > 1:
                raise IndexError('check length of parameter index')
            # 1D array
            if type(index) is int:
                return self.int_global_to_local(index)

            elif type(index) is slice:
                return self.slice_global_to_local(index)

            else:
                raise IndexError('check data type of index to be integer or slice')

        elif type(index) is tuple:
            #if len(index) is not len(self.__mask):
            #    raise IndexError('check length of parameter index')

            local_index = []

            for k, item in enumerate(index):
                if k < len(self.__mask):

                    if type(item) is slice:
                        temp_index = self.slice_global_to_local(item, k)

                    elif type(item) in [int, np.int64, np.int32]:
                        temp_index = self.int_global_to_local(item, k)

                    if temp_index is None:
                        return temp_index

                else:
                    temp_index = item

                local_index.append(temp_index)

            return tuple(local_index)
        else:
            raise IndexError('check index for correct length and type')
870928
def local_to_global(self, index):
        

        if (type(index) is int) or (type(index) is slice):
            if len(self.__mask) > 1:
                raise IndexError('check length of parameter index')
            # 1D array
            if type(index) is int:
                return self.int_local_to_global(index)

            elif type(index) is slice:
                return self.slice_local_to_global(index)

            else:
                raise IndexError('check data type of index to be integer or slice')

        elif type(index) is tuple:

            local_index = []

            for k, item in enumerate(index):
                if k < len(self.__mask):

                    if type(item) is slice:
                        temp_index = self.slice_local_to_global(item, k)

                    elif type(item) in [int, np.int64, np.int32]:
                        temp_index = self.int_local_to_global(item, k)

                    if temp_index is None:
                        return temp_index

                else:
                    temp_index = item

                local_index.append(temp_index)

            return tuple(local_index)
        else:
            raise IndexError('check index for correct length and type')
222060
function(list, index) {
            if ((index.type !== "Dimension") ||
                 !index.unit.isEmpty())
                    return atKey(list, index);

            list = isArray(list.value)
                ? list.value : [list];
            return list[index.value - 1];
        }
182050
def index(elem):
    '''
    
    '''
    parent = elem.getparent()
    for x in range(0, len(parent.getchildren())):
        if parent.getchildren()[x] == elem:
            return x
    return -1
1152930
def p_array_indices(self, p):
        ''''''
        if len(p) == 2:
            p[0] = p[1],
        else:
            p[0] = (p[1],) + p[3]
191848
def to_int(x, index=False):
    
    _x = x.index if index else x
    cols = list(map(int, _x))
    error = _x[cols != _x]
    if not error.empty:
        raise ValueError('invalid values `{}`'.format(list(error)))
    if index:
        x.index = cols
        return x
    else:
        return _x
1137508
public void removePoint(int index) {
        int numKnots = x.length;
        if (numKnots <= 2)
            return;
        float[] nx = new float[numKnots - 1];
        float[] ny = new float[numKnots - 1];
        int j = 0;
        for (int i = 0; i < numKnots - 1; i++) {
            if (i == index)
                j++;
            nx[i] = x[j];
            ny[i] = y[j];
            j++;
        }
        x = nx;
        y = ny;
    }
72257
def get_bitstring_from_index(index, qubit_num):
    
    if index > (2**qubit_num - 1):
        raise IndexError("Index {} too large for {} qubits.".format(index, qubit_num))
    return bin(index)[2:].rjust(qubit_num, '0')
45876
def take_complement(list_, index_list):
    
    mask = not_list(index_to_boolmask(index_list, len(list_)))
    return compress(list_, mask)
131526
def feature(self, index):
        
        if index < 0 or index >= self.num_features_:
            raise ValueError('Index %d out of range' %(index))
        return self.features_[index]
815356
def get_restricted_index(index, length, length_index_allowed=True):
    '''
    
    '''
    if index and index >= length:
        index = length if length_index_allowed else length-1
    return get_non_negative_index(index, length)
966125
def calc_indices(self, shape):
        """"""
        if len(shape) == 2:
            ny, nx = shape
        elif len(shape) == 3:
            ny, nx, nchan = shape

        inds = []
        for iy in range(ny):
            inds.extend([(ix, iy) for ix in range(nx)])
        self.conf.indices = np.array(inds)
199198
def index_to_loc(self, index):
        
        sz = int(self.shape[0] * self.shape[1])
        idxs = np.array([i for i in range(sz)], dtype=int).reshape(self.shape)
        args = np.argwhere(idxs == index)
        if len(args) < 1:
            raise RuntimeError('Index ({}) is out of range.')
        return args[0]
643215
def nDims(self):
        
        result = self._index.ndim
        assert result == 1, "Expected index to be 1D, got: {}D".format(result)
        return result