Eq. 56 from Barack and Cutler 2004
772572
def _hcn_func(self):
        
        self.hc = 1./(np.pi*self.dist)*np.sqrt(2.*self._dEndfr())
        return
808069
def imf(m):
    ''' 
     

    '''

    m1 = 0.08; m2 = 0.50
    a1 = 0.30; a2 = 1.30; a3 = 2.3
    const2 = m1**-a1 -m1**-a2 
    const3 = m2**-a2 -m2**-a3 

    if m < 0.08:
        alpha = 0.3
        const = -const2 -const3
    elif m < 0.50:
        alpha = 1.3
        const = -const3
    else:
        alpha = 2.3
        const = 0.0
    # print m,alpha, const, m**-alpha + const 
    return m**-alpha + const
985972
def calmarnorm(sharpe, T, tau = 1.0):
    '''
    
    '''
    return calmar(sharpe,tau)/calmar(sharpe,T)
1177505
boolean tolEq(ECoordinate v, double tolerance) // ! == with tolerance
	{
		return Math.abs(m_value - v.m_value) <= tolerance || eq(v);
	}
502664
def p_stmt_ariarithh_eq(p):
    """"""
    p[0] = ast.EqNode(ast.VariableNode(p[1]), ast.ArithExprNode(p[4], p[3], p[5]))
343163
def _g(self, x, tau):
        
        return tau ** 2 * (tau ** 2 + 1) ** -2 * (
                (tau ** 2 + 1 + 2 * (x ** 2 - 1)) * self.F(x) + tau * np.pi + (tau ** 2 - 1) * np.log(tau) +
                np.sqrt(tau ** 2 + x ** 2) * (-np.pi + self.L(x, tau) * (tau ** 2 - 1) * tau ** -1))
936652
function _eq(evt, size, init) {
    const sz = evt.size;
    const mn = evt.min;
    const mx = evt.max;
    const ex = evt.each || init;

    // Check match against rules
    return (! sz && ! mn && ! mx) ||
        (sz && sz === size) ||
        (mn && size >= mn && (ex || current < mn) && (! mx || size <= mx)) ||
        (mx && size <= mx && (ex || current > mx) && (! mn || size >= mn));
}
976211
private static function iauCal2jd($iy, $im, $id, &$djm0, &$djm)
    {
        $j;
        $ly;
        $my;
        $iypmy;
        /* Earliest year allowed (4800BC) */
        $IYMIN = -4799;
        /* Month lengths in days */
        $mtab = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
        /* Preset status. */
        $j = 0;
        /* Validate year and month. */
        if ($iy < $IYMIN) {
            return -1;
        }
        if ($im < 1 || $im > 12) {
            return -2;
        }
        /* If February in a leap year, 1, otherwise 0. */
        $ly = (($im == 2) && !($iy % 4) && ($iy % 100 || !($iy % 400)));
        /* Validate day, taking into account leap years. */
        if (($id < 1) || ($id > ($mtab[$im - 1] + $ly))) {
            $j = -3;
        }
        /* Return result. */
        $my    = intval(($im - 14) / 12);
        $iypmy = intval($iy + $my);
        $djm0  = 2400000.5;
        $djm   = (double)(intval((1461 * ($iypmy + 4800)) / 4) +
          intval((367 * intval($im - 2 - 12 * $my)) / 12) -
          intval((3 * (intval(($iypmy + 4900) / 100))) / 4) +
          intval($id - 2432076));

        /* Return status. */

        return $j;
    }
82783
def a(self, **kwargs):
        '''
        
        '''
        T = kwargs.get('T', 300.)
        return (self.a_300K(**kwargs) +
                self.thermal_expansion(**kwargs) * (T - 300.))
1366149
def pick_q_v1(self):
    """"""
    inl = self.sequences.inlets.fastaccess
    new = self.sequences.states.fastaccess_new
    new.qjoints[0] = 0.
    for idx in range(inl.len_q):
        new.qjoints[0] += inl.q[idx][0]
465456
def step5(self):
        
        self.j = self.k
        if self.b[self.k] == "e":
            a = self.m()
            if a > 1 or (a == 1 and not self.cvc(self.k - 1)):
                self.k = self.k - 1
        if self.b[self.k] == "l" and self.doublec(self.k) and self.m() > 1:
            self.k = self.k - 1
1143195
def _eq(left, right):
    
    if isinstance(left, (tuple, list)) and isinstance(right, (tuple, list)):
        return len(left) == len(right) and all(_eq(*pair) for pair in zip(left, right))
    else:
        return left == right
566471
private int evaluateLHS(final Assignment assignment) {
    int lhs = 0;
    for (int i = 0; i < this.literals.length; i++)
      if (this.literals[i].evaluate(assignment))
        lhs += this.coefficients[i];
    return lhs;
  }
1310726
def Exponential(x, a, tau, y0):
    
    return np.exp(x / tau) * a + y0
657230
def quadraticEval(a, b, c, x):
    """"""
    return a*(x**2) + b*x + c
192036
def show(self, eq, value=None):
        """"""
        if eq in ['f', 'x']:
            key = 'unamex'
        elif eq in ['g', 'y']:
            key = 'unamey'

        if value:
            value = list(value)
        else:
            value = list(self.__dict__[eq])

        out = ''
        for name, val, idx in zip(self.system.varname.__dict__[key], value,
                                  range(len(value))):
            out += '{:20s} [{:>12.4f}] {:g}\n'.format(name, val, idx)
        return out
670058
def Efn(Ms,eccs):
    """"""
    Ms = np.atleast_1d(Ms)
    eccs = np.atleast_1d(eccs)
    unit = np.floor(Ms / (2*np.pi))
    Es = EFN((Ms % (2*np.pi)),eccs)
    Es += unit*(2*np.pi)
    return Es