:param pxs:
        :return:
169419
def close_to_close(self, pxs):
        
        if not isinstance(pxs, pd.Series):
            raise ValueError('pxs expected to be Series')

        blotter = TradeBlotter()
        signal = self.signal.dropna()
        diff = signal.diff()
        diff.iloc[0] = 0
        changes = signal[diff != 0]
        lsig = 0
        qtyfct = self._qty_fct(pxs.index)
        for ts, sig in changes.iteritems():
            blotter.ts = ts
            if sig != lsig:
                px = pxs.get(ts, None)
                if px is None:
                    raise Exception('insufficient price data: no data found at %s' % ts)
                if lsig != 0:  # close open trd
                    blotter.close(px=px)

                if sig != 0:
                    size = abs(qtyfct(ts))
                    qty = sig > 0 and size or -size
                    blotter.open(qty, px)
            lsig = sig
        return blotter.trades
1133538
def logit_px(self)->LogitTensorImage:
        ""
        if self._logit_px is None: self._logit_px = logit_(self.px)
        return self._logit_px
189383
def pydeps2reqs(deps):
    
    reqs = defaultdict(set)
    for k, v in list(deps.items()):
        # not a built-in
        p = v['path']
        if p and not p.startswith(sys.real_prefix):
            if p.startswith(sys.prefix) and 'site-packages' in p:
                if not p.endswith('.pyd'):
                    if '/win32/' in p.replace('\\', '/'):
                        reqs['win32'] |= set(v['imported_by'])
                    else:
                        name = k.split('.', 1)[0]
                        if name not in skiplist:
                            reqs[name] |= set(v['imported_by'])

    if '_dummy' in reqs:
        del reqs['_dummy']
    return '\n'.join(dep2req(name, reqs[name]) for name in sorted(reqs))
1047015
def server_pxe():
    '''
    
    '''
    if __execute_cmd('config -g cfgServerInfo -o \
            cfgServerFirstBootDevice PXE'):
        if __execute_cmd('config -g cfgServerInfo -o cfgServerBootOnce 1'):
            return server_reboot
        else:
            log.warning('failed to set boot order')
            return False

    log.warning('failed to configure PXE boot')
    return False
1090069
def _get_sfs_idxs(sizes:Sizes) -> List[int]:
    ""
    feature_szs = [size[-1] for size in sizes]
    sfs_idxs = list(np.where(np.array(feature_szs[:-1]) != np.array(feature_szs[1:]))[0])
    if feature_szs[0] != feature_szs[1]: sfs_idxs = [0] + sfs_idxs
    return sfs_idxs
1359057
def __get_idxs(self, words):
        """"""
        if self.bow:
            return list(itertools.chain.from_iterable(
                [self.positions[z] for z in words]))
        else:
            return self.positions[words]
208587
def isxmap(xmethod, opt):
    

    if xmethod == 'admm':
        isx = {'XPrRsdl': 'PrimalRsdl', 'XDlRsdl': 'DualRsdl',
               'XRho': 'Rho'}
    else:
        isx = {'X_F_Btrack': 'F_Btrack', 'X_Q_Btrack': 'Q_Btrack',
               'X_ItBt': 'IterBTrack', 'X_L': 'L', 'X_Rsdl': 'Rsdl'}
    if not opt['AccurateDFid']:
        isx.update(evlmap(True))
    return isx
586627
public Coordinate pixelsToMeters(double px, double py, int zoomLevel) {
        double res = resolution(zoomLevel);
        double mx = px * res - originShift;
        double my = -py * res + originShift;

        return new Coordinate(mx, my);
    }
628446
def prox_components(X, step, prox=None, axis=0):
    
    K = X.shape[axis]

    if not hasattr(prox_list, '__iter__'):
        prox = [prox] * K
    assert len(prox_list) == K

    if axis == 0:
        Pk = [prox_list[k](X[k], step) for k in range(K)]
    if axis == 1:
        Pk = [prox_list[k](X[:,k], step) for k in range(K)]
    return np.stack(Pk, axis=axis)
639514
def id2rel(self, xs):
        
        if isinstance(xs, list):
            return [self._id2rel[x] for x in xs]
        return self._id2rel[xs]
239577
def scipy_psd(x, f_sample=1.0, nr_segments=4):
    
    f_axis, psd_of_x = scipy.signal.welch(x, f_sample, nperseg=len(x)/nr_segments)
    return f_axis, psd_of_x
37348
function pxToEmOrRem(breakpoints, ratio = 16, unit) {
  const newBreakpoints = {};

  for (let key in breakpoints) {
    const point = breakpoints[key];

    if (String(point).includes('px')) {
      newBreakpoints[key] = +(parseInt(point) / ratio) + unit;
      continue;
    }

    newBreakpoints[key] = point;
  }

  return newBreakpoints;
}
789624
def read_single_xso(src, type_):
    

    result = None

    def cb(instance):
        nonlocal result
        result = instance

    read_xso(src, {type_: cb})

    return result
298509
def get_x():
    '''
    
    '''
    cmd = 'setxkbmap -query | grep layout'
    out = __salt__['cmd.run'](cmd, python_shell=True).split(':')
    return out[1].strip()
936907
def xiphias_get_users(self, peer_jids: Union[str, List[str]]):
        
        return self._send_xmpp_element(xiphias.UsersRequest(peer_jids))
520886
def _points(self, x_pos):
        
        for serie in self.all_series:
            serie.points = [(x_pos[i], v) for i, v in enumerate(serie.values)]
            if serie.points and self.interpolate:
                serie.interpolated = self._interpolate(x_pos, serie.values)
            else:
                serie.interpolated = []
303423
def get_mkt_val(self, pxs=None):
        """"""
        pxs = pxs if pxs is not None else self.pxs.close
        return pxs * self.multiplier