Convert a 2D int array into a transaction list:
        [
            ['x0=1', 'x1=0', ...],
            ...
        ]
    :param x:
    :return:
341604
def categorical2transactions(x):
    # type: (np.ndarray) -> List
    
    assert len(x.shape) == 2

    transactions = []
    for entry in x:
        transactions.append(['x%d=%d' % (i, val) for i, val in enumerate(entry)])

    return transactions
80173
def get_values(self, idx):
        
        if isinstance(idx, list):
            idx = np.array(idx, dtype=int)

        return self._data[:, idx]
874865
def build_plane_arrays(x, y, qlist):
    
    if type(qlist) is not list:
        return_list = False
        qlist = [qlist]
    else:
        return_list = True
    xv = x[np.where(y==y[0])[0]]
    yv = y[np.where(x==x[0])[0]]
    qlistp = []
    for n in range(len(qlist)):
        qlistp.append(np.zeros((len(yv), len(xv))))
    for j in range(len(qlist)):
        for n in range(len(yv)):
            i = np.where(y==yv[n])[0]
            qlistp[j][n,:] = qlist[j][i]
    if not return_list:
        qlistp = qlistp[0]
    return xv, yv, qlistp
1023671
def floatSlist(value):
    
    slist = ['+', 0, 0, 0, 0]
    if value < 0:
        slist[0] = '-'
    value = abs(value)
    for i in range(1,5):
        slist[i] = math.floor(value)
        value = (value - slist[i]) * 60
    return _roundSlist(slist)
855342
def split_array_as_list(self, values):
        
        values = np.asarray(values)
        values = values[self.index.sorter]
        return np.split(values, self.index.slices[1:-1], axis=0)
1000875
public List<Double> x() {
        List<Double> result = new ArrayList<Double>(xy.size());
        for (Discrete.Pair pair : xy) {
            result.add(pair.x);
        }
        return result;
    }
378643
def ptake(n: int, xs: Iterable[T]) -> Iterable[T]:
    
    return tqdm(take(n, xs), total=n)
1256139
def DeserializeTX(buffer):
        
        mstream = MemoryStream(buffer)
        reader = BinaryReader(mstream)

        tx = Transaction.DeserializeFrom(reader)

        return tx
252686
def from_array(array):
        
        if array is None or not array:
            return None
        # end if
        assert_type_or_raise(array, dict, parameter_name="array")
        from pytgbot.api_types.receivable.payments import ShippingAddress
        

        data = {}
        data['name'] = u(array.get('name')) if array.get('name') is not None else None
        data['phone_number'] = u(array.get('phone_number')) if array.get('phone_number') is not None else None
        data['email'] = u(array.get('email')) if array.get('email') is not None else None
        data['shipping_address'] = ShippingAddress.from_array(array.get('shipping_address')) if array.get('shipping_address') is not None else None
        data['_raw'] = array
        return OrderInfo(**data)
521387
def xorsum(t):
    
    _b = t[0]
    for i in t[1:]:
        _b = _b ^ i
        _b &= 0xff
    return _b
1186712
def bi_square(xx, idx=None):
    

    ans = np.zeros(xx.shape)
    ans[idx] = (1-xx[idx]**2)**2
    return ans
1156074
def contract(self, x):
		
		for value in self.itervalues():
			value.contract(x)
		return self
1269279
def get_xy_array(x_segment, y_segment):
    
    xy_array = []
    for num, x in enumerate(x_segment):
        xy_array.append((x, y_segment[num]))
    return xy_array
1041586
def select_inputs(self, address: str, amount: int) -> dict:
        ''''''

        utxos = []
        utxo_sum = Decimal(0)
        for tx in sorted(self.listunspent(address=address), key=itemgetter('confirmations')):

            if tx["address"] not in (self.pa_parameters.P2TH_addr,
                                     self.pa_parameters.test_P2TH_addr):

                utxos.append(
                        MutableTxIn(txid=tx['txid'],
                                    txout=tx['vout'],
                                    sequence=Sequence.max(),
                                    script_sig=ScriptSig.empty())
                         )

                utxo_sum += Decimal(tx["amount"])
                if utxo_sum >= amount:
                    return {'utxos': utxos, 'total': utxo_sum}

        if utxo_sum < amount:
            raise InsufficientFunds("Insufficient funds.")

        raise Exception("undefined behavior :.(")
189443
def eth_getTransactionByBlockHashAndIndex(self, bhash, index=0):
        
        result = yield from self.rpc_call('eth_getTransactionByBlockHashAndIndex',
                                          [bhash, hex(index)])
        # TODO: Update result response
        return result
514442
def take(self, idxs):
        
        import utool as ut
        if False:
            key_to_list = ut.odict([
                (key, ut.take(val, idxs))
                for key, val in six.iteritems(self._key_to_list)
            ])
        else:
            import numpy as np
            key_to_list = ut.odict([
                (key, ut.take(val, idxs))
                if not isinstance(val, np.ndarray)
                else val.take(idxs, axis=0)
                for key, val in six.iteritems(self._key_to_list)
            ])
        newself = self.__class__(key_to_list, self._meta.copy())
        return newself
620691
def from_xdr_object(cls, tx_xdr_object):
        
        source = encode_check('account', tx_xdr_object.sourceAccount.ed25519)
        sequence = tx_xdr_object.seqNum - 1
        time_bounds_in_xdr = tx_xdr_object.timeBounds  # TODO test
        if time_bounds_in_xdr:
            time_bounds = {
                'maxTime': time_bounds_in_xdr[0].maxTime,
                'minTime': time_bounds_in_xdr[0].minTime
            }
        else:
            time_bounds = None

        memo = xdr_to_memo(tx_xdr_object.memo)

        operations = list(map(
            Operation.from_xdr_object, tx_xdr_object.operations
        ))
        return cls(
            source=source,
            sequence=sequence,
            time_bounds=time_bounds,
            memo=memo,
            fee=tx_xdr_object.fee,
            operations=operations)