Returns if an object is oriental or 
    occidental to the sun.
5517
def orientality(obj, sun):
    
    dist = angle.distance(sun.lon, obj.lon)
    return OCCIDENTAL if dist < 180 else ORIENTAL
714802
def compute_sun
      # === 太陽が光を発した時刻 t1(JD) の計算
      t_1_jd = calc_t1(:sun, @tdb)
      # === 時刻 t1(= TDB) におけるの位置・速度（ICRS 座標）の計算 (地球, 月, 太陽)
      Const::BODIES.each { |k, v| @icrs_1[k] = get_icrs(v, t_1_jd) }
      # === 時刻 t2 における地球重心から時刻 t1 における太陽への方向ベクトルの計算
      v_12 = calc_unit_vector(@icrs_2[:earth][0,3], @icrs_1[:sun][0,3])
      # === GCRS 座標系: 光行差の補正（方向ベクトルの Lorentz 変換）
      dd = conv_lorentz(v_12)
      pos_sun = calc_pos(dd, @r_e[:sun])
      # === 瞬時の真座標系: GCRS への bias & precession（歳差） & nutation（章動）の適用
      bpn = EphBpn.new(@tdb.strftime("%Y%m%d%H%M%S"))
      pos_sun_bpn = bpn.apply_bpn(pos_sun)
      # === 座標変換
      eq_pol_s  = MkCoord.rect2pol(pos_sun_bpn)
      ec_rect_s = MkCoord.rect_eq2ec(pos_sun_bpn, bpn.eps)
      ec_pol_s  = MkCoord.rect2pol(ec_rect_s)
      # === 視半径／（地平）視差計算
      radius = Math.asin(@asun / (eq_pol_s[2] * Const::AU / 1000))
      radius *= 180 / Math::PI * 3600
      parallax = Math.asin(@re / (eq_pol_s[2] * Const::AU / 1000))
      parallax *= 180 / Math::PI * 3600
      return [eq_pol_s, ec_pol_s, [radius, parallax]]
    rescue => e
      raise
    end
862009
def is_light(syll):
    ''''''
    return re.match(r'(^|[^ieaouäöy]+)[ieaouäöy]{1}$', syll, flags=FLAGS)
993993
function (skyType, sunHeight) {

    var fogColor;
    if (skyType == 'color' || skyType == 'none'){
      fogColor = new THREE.Color(this.data.skyColor);
    }
    else if (skyType == 'gradient'){
      fogColor = new THREE.Color(this.data.horizonColor);
    }
    else if (skyType == 'atmosphere')
    {
      var fogRatios = [        1,       0.5,      0.22,       0.1,      0.05,     0];
      var fogColors = ['#C0CDCF', '#81ADC5', '#525e62', '#2a2d2d', '#141616', '#000'];

      if (sunHeight <= 0) return '#000';

      sunHeight = Math.min(1, sunHeight);

      for (var i = 0; i < fogRatios.length; i++){
        if (sunHeight > fogRatios[i]){
          var c1 = new THREE.Color(fogColors[i - 1]);
          var c2 = new THREE.Color(fogColors[i]);
          var a = (sunHeight - fogRatios[i]) / (fogRatios[i - 1] - fogRatios[i]);
          c2.lerp(c1, a);
          fogColor = c2;
          break;
        }
      }
    }
    // dim down the color
    fogColor.multiplyScalar(0.9);
    // mix it a bit with ground color
    fogColor.lerp(new THREE.Color(this.data.groundColor), 0.3);

    return '#' + fogColor.getHexString();
  }
99446
function checkIfUniversalAndReturnUniversal(setA) {
	return set.isEqual(setA, set.UNIVERSAL) ? set.UNIVERSAL : setA;
}
860996
def aspects(self, obj):
        
        dist = angle.closestdistance(self.lon, obj.lon)
        return abs(dist) < self.orb()
274594
def get_irradiance_value(self, month, day, hour):
        """"""
        dt = DateTime(month, day, hour, leap_year=self.is_leap_year)
        count = int(dt.hoy * self.timestep)
        return self.direct_normal_irradiance[count], \
            self.diffuse_horizontal_irradiance[count]
702374
def is_imagej(self):
        """"""
        for description in (self.description, self.description1):
            if not description:
                return None
            if description[:7] == 'ImageJ=':
                return description
        return None
602869
def isDiurnal(self):
        
        sun = self.getObject(const.SUN)
        mc = self.getAngle(const.MC)
        
        # Get ecliptical positions and check if the
        # sun is above the horizon.
        lat = self.pos.lat
        sunRA, sunDecl = utils.eqCoords(sun.lon, sun.lat)
        mcRA, mcDecl = utils.eqCoords(mc.lon, 0)
        return utils.isAboveHorizon(sunRA, sunDecl, mcRA, lat)
347712
function SunLongitude (jdn) {
  var T, T2, dr, M, L0, DL, lambda, theta, omega
  T = (jdn - 2451545.0) / 36525 // Time in Julian centuries from 2000-01-01 12:00:00 GMT
  T2 = T * T
  dr = Math.PI / 180 // degree to radian
  M = 357.52910 + 35999.05030 * T - 0.0001559 * T2 - 0.00000048 * T * T2 // mean anomaly, degree
  L0 = 280.46645 + 36000.76983 * T + 0.0003032 * T2 // mean longitude, degree
  DL = (1.914600 - 0.004817 * T - 0.000014 * T2) * Math.sin(dr * M)
  DL = DL + (0.019993 - 0.000101 * T) * Math.sin(dr * 2 * M) + 0.000290 * Math.sin(dr * 3 * M)
  theta = L0 + DL // true longitude, degree
  // obtain apparent longitude by correcting for nutation and aberration
  omega = 125.04 - 1934.136 * T
  lambda = theta - 0.00569 - 0.00478 * Math.sin(omega * dr)
  // Convert to radians
  lambda = lambda * dr
  lambda = lambda - Math.PI * 2 * (Math.floor(lambda / (Math.PI * 2))) // Normalize to (0, 2*PI)
  return lambda
}
1328126
double getHighestElevationOfSun(PlainDate date) {

        Moment noon = date.get(this.transitAtNoon());
        double jde = JulianDay.getValue(noon, TimeScale.TT);
        double decInRad = Math.toRadians(this.getCalculator().getFeature(jde, DECLINATION));
        double latInRad = Math.toRadians(this.latitude);
        double sinElevation = // Extra term left out => Math.cos(Math.toRadians(trueNoon)) := 1.0 (per definition)
            Math.sin(latInRad) * Math.sin(decInRad) + Math.cos(latInRad) * Math.cos(decInRad); // Meeus (13.6)
        double result = Math.toDegrees(Math.asin(sinElevation));

        if (Double.isNaN(result)) {
            throw new UnsupportedOperationException(
                "Solar declination not supported by: " + this.getCalculator().name());
        }

        return result;

    }
100470
def get_alt_az(utc_time, lon, lat):
    
    lon = np.deg2rad(lon)
    lat = np.deg2rad(lat)

    ra_, dec = sun_ra_dec(utc_time)
    h__ = _local_hour_angle(utc_time, lon, ra_)
    return (np.arcsin(np.sin(lat) * np.sin(dec) +
                      np.cos(lat) * np.cos(dec) * np.cos(h__)),
            np.arctan2(-np.sin(h__), (np.cos(lat) * np.tan(dec) -
                                      np.sin(lat) * np.cos(h__))))
285196
def getScoreProperties(self):
        
        obj = self.obj
        score = {}
        
        # Peregrine
        isPeregrine = essential.isPeregrine(obj.id, obj.sign, obj.signlon)
        score['peregrine'] = -5 if isPeregrine else 0
        
        # Ruler-Ruler and Exalt-Exalt mutual receptions
        mr = self.eqMutualReceptions()
        score['mr_ruler'] = +5 if 'ruler' in mr else 0
        score['mr_exalt'] = +4 if 'exalt' in mr else 0
        
        # House scores
        score['house'] = self.houseScore()
        
        # Joys
        score['joy_sign'] = +3 if self.inSignJoy() else 0
        score['joy_house'] = +2 if self.inHouseJoy() else 0
        
        # Relations with sun
        score['cazimi'] = +5 if self.isCazimi() else 0
        score['combust'] = -6 if self.isCombust() else 0
        score['under_sun'] = -4 if self.isUnderSun() else 0
        score['no_under_sun'] = 0
        if obj.id != const.SUN and not self.sunRelation():
            score['no_under_sun'] = +5
        
        # Light
        score['light'] = 0
        if obj.id != const.SUN:
            score['light'] = +1 if self.isAugmentingLight() else -1
            
        # Orientality
        score['orientality'] = 0
        if obj.id in [const.SATURN, const.JUPITER, const.MARS]:
            score['orientality'] = +2 if self.isOriental() else -2
        elif obj.id in [const.VENUS, const.MERCURY, const.MOON]:
            score['orientality'] = -2 if self.isOriental() else +2
        
        # Moon nodes
        score['north_node'] = -3 if self.isConjNorthNode() else 0
        score['south_node'] = -5 if self.isConjSouthNode() else 0
        
        # Direction and speed
        score['direction'] = 0
        if obj.id not in [const.SUN, const.MOON]:
            score['direction'] = +4 if obj.isDirect() else -5
        score['speed'] = +2 if obj.isFast() else -2
        
        # Aspects to benefics
        aspBen = self.aspectBenefics()
        score['benefic_asp0'] = +5 if const.CONJUNCTION in aspBen else 0
        score['benefic_asp120'] = +4 if const.TRINE in aspBen else 0
        score['benefic_asp60'] = +3 if const.SEXTILE in aspBen else 0
        
        # Aspects to malefics
        aspMal = self.aspectMalefics()
        score['malefic_asp0'] = -5 if const.CONJUNCTION in aspMal else 0
        score['malefic_asp180'] = -4 if const.OPPOSITION in aspMal else 0
        score['malefic_asp90'] = -3 if const.SQUARE in aspMal else 0
        
        # Auxily and Surround
        score['auxilied'] = +5 if self.isAuxilied() else 0
        score['surround'] = -5 if self.isSurrounded() else 0
        
        # Voc and Feral
        score['feral'] = -3 if self.isFeral() else 0
        score['void'] = -2 if (self.isVoc() and score['feral'] == 0) else 0
        
        # Haiz
        haiz = self.haiz()
        score['haiz'] = 0
        if haiz == HAIZ:
            score['haiz'] = +3
        elif haiz == CHAIZ:
            score['haiz'] = -2
            
        # Moon via combusta
        score['viacombusta'] = 0
        if obj.id == const.MOON and viaCombusta(obj):
            score['viacombusta'] = -2
            
        return score
135721
public static boolean mightContainsProperties(Class<?> type) {
    return type != Object.class
        && type != String.class
        && type != Date.class
        && type != Calendar.class
        && !Primitives.isPrimitive(type)
        && !Iterables.isIterable(type)
        && !Types.isGroovyType(type);
  }
784311
def is_homogeneous(self):
        """"""
        hom_base = isinstance(self.base_value, (int, long, numpy.integer, float, bool)) \
                   or type(self.base_value) == self.dtype \
                   or (isinstance(self.dtype, type) and isinstance(self.base_value, self.dtype))
        hom_ops = all(obj.is_homogeneous for f, obj in self.operations if isinstance(obj, larray))
        return hom_base and hom_ops
1138095
function isTypoTypeof(left, right) {
    if (state.option.notypeof)
      return false;

    if (!left || !right)
      return false;

    var values = [
      "undefined", "object", "boolean", "number",
      "string", "function", "xml", "object", "unknown"
    ];

    if (right.type === "(identifier)" && right.value === "typeof" && left.type === "(string)")
      return !_.contains(values, left.value);

    return false;
  }
330879
def haiz(obj, chart):
    
    objGender = obj.gender()
    objFaction = obj.faction()
    
    if obj.id == const.MERCURY:
        # Gender and faction of mercury depends on orientality
        sun = chart.getObject(const.SUN)
        orientalityM = orientality(obj, sun)
        if orientalityM == ORIENTAL:
            objGender = const.MASCULINE
            objFaction = const.DIURNAL
        else:
            objGender = const.FEMININE
            objFaction = const.NOCTURNAL
            
    # Object gender match sign gender?
    signGender = props.sign.gender[obj.sign]
    genderConformity = (objGender == signGender)
    
    # Match faction
    factionConformity = False
    diurnalChart = chart.isDiurnal()
    
    if obj.id == const.SUN and not diurnalChart:
        # Sun is in conformity only when above horizon
        factionConformity = False
    else:
        # Get list of houses in the chart's diurnal faction
        if diurnalChart:
            diurnalFaction = props.house.aboveHorizon
            nocturnalFaction = props.house.belowHorizon
        else:
            diurnalFaction = props.house.belowHorizon
            nocturnalFaction = props.house.aboveHorizon
        
        # Get the object's house and match factions
        objHouse = chart.houses.getObjectHouse(obj)
        if (objFaction == const.DIURNAL and objHouse.id in diurnalFaction or
            objFaction == const.NOCTURNAL and objHouse.id in nocturnalFaction):
                factionConformity = True
        
    # Match things
    if (genderConformity and factionConformity):
        return HAIZ
    elif (not genderConformity and not factionConformity):
        return CHAIZ
    else:
        return None