Translate Visibility, Altimeter, Clouds, and Other
322878
def shared(wxdata: ReportData, units: Units) -> typing.Dict[str, str]:
    
    translations = {}
    translations['visibility'] = visibility(wxdata.visibility, units.visibility)  # type: ignore
    translations['altimeter'] = altimeter(wxdata.altimeter, units.altimeter)  # type: ignore
    translations['clouds'] = clouds(wxdata.clouds, units.altitude)  # type: ignore
    translations['other'] = other_list(wxdata.other)  # type: ignore
    return translations
1151567
def translate(patterns, *, flags=0):
    """"""

    flags = _flag_transform(flags)
    return _wcparse.translate(_wcparse.split(patterns, flags), flags)
501036
def _at(self, t):
        """"""
        pos, vel = terra(self.latitude.radians, self.longitude.radians,
                         self.elevation.au, t.gast)
        pos = einsum('ij...,j...->i...', t.MT, pos)
        vel = einsum('ij...,j...->i...', t.MT, vel)
        if self.x:
            R = rot_y(self.x * ASEC2RAD)
            pos = einsum('ij...,j...->i...', R, pos)
        if self.y:
            R = rot_x(self.y * ASEC2RAD)
            pos = einsum('ij...,j...->i...', R, pos)
        # TODO: also rotate velocity

        return pos, vel, pos, None
116959
public void translateBackgrounds(){
        this.setClipChildren(false);
        for(Map.Entry<SwipeDirection, View> entry : mBackgroundMap.entrySet()) {
            int signum = entry.getKey().isLeft() ? 1 : -1;
            entry.getValue().setTranslationX(signum*entry.getValue().getWidth());
        }
    }
871341
def visibility(vis: Number, unit: str = 'm') -> str:
    
    if not vis:
        return 'Visibility unknown'
    if vis.value is None or '/' in vis.repr:
        ret_vis = vis.spoken
    else:
        ret_vis = translate.visibility(vis, unit=unit)
        if unit == 'm':
            unit = 'km'
        ret_vis = ret_vis[:ret_vis.find(' (')].lower().replace(unit, '').strip()
        ret_vis = core.spoken_number(core.remove_leading_zeros(ret_vis))
    ret = 'Visibility ' + ret_vis
    if unit in SPOKEN_UNITS:
        if '/' in vis.repr and 'half' not in ret:
            ret += ' of a'
        ret += ' ' + SPOKEN_UNITS[unit]
        if not (('one half' in ret and ' and ' not in ret) or 'of a' in ret):
            ret += 's'
    else:
        ret += unit
    return ret
949978
def translate_detector(self, vector):
        """"""
        vector = np.array(vector, dtype=float)
        self.pmts.pos_x += vector[0]
        self.pmts.pos_y += vector[1]
        self.pmts.pos_z += vector[2]
        self.reset_caches()
465268
def sky2px(wcs,ra,dec,dra,ddec,cell, beam):
    """"""
    dra = beam if dra<beam else dra # assume every source is at least as large as the psf
    ddec = beam if ddec<beam else ddec
    offsetDec = int((ddec/2.)/cell)
    offsetRA = int((dra/2.)/cell)
    if offsetDec%2==1:
        offsetDec += 1
    if offsetRA%2==1:
        offsetRA += 1

    raPix,decPix = map(int, wcs.wcs2pix(ra,dec))
    return np.array([raPix-offsetRA,raPix+offsetRA,decPix-offsetDec,decPix+offsetDec])
643002
function translate(key, options, hasOwnOptions) {

			var lng = options.lng || 'auto';

			if (!translations[lng]) {
				translations[lng] = {};
			}

			if (!t) {
				translations[lng][key] = key;
			} else if (!translations[lng][key] || hasOwnOptions) {
				translations[lng][key] = t(key, options);
			}

		}
1109492
function absolute(rem){return{abs:{position:'absolute'},
top0:{top:0},
right0:{right:0},
bottom0:{bottom:0},
left0:{left:0},

top1:{top:1*rem},
right1:{right:1*rem},
bottom1:{bottom:1*rem},
left1:{left:1*rem},

top2:{top:2*rem},
right2:{right:2*rem},
bottom2:{bottom:2*rem},
left2:{left:2*rem},

top3:{top:3*rem},
right3:{right:3*rem},
bottom3:{bottom:3*rem},
left3:{left:3*rem},

top4:{top:4*rem},
right4:{right:4*rem},
bottom4:{bottom:4*rem},
left4:{left:4*rem},

z1:{zIndex:1,elevation:1},
z2:{zIndex:2,elevation:2},
z3:{zIndex:4,elevation:4},
z4:{zIndex:8,elevation:8}};

}
761019
function latitudeToPixel (latitude, zoom) {
  const latRad = toRadians(latitude)
  return (1 -
    Math.log(Math.tan(latRad) + (1 / Math.cos(latRad))) /
      Math.PI) / 2 * zScale(zoom)
}
1009132
def simple_atmo_opstring(haze, contrast, bias):
    """"""
    gamma_b = 1 - haze
    gamma_g = 1 - (haze / 3.0)
    ops = (
        "gamma g {gamma_g}, " "gamma b {gamma_b}, " "sigmoidal rgb {contrast} {bias}"
    ).format(gamma_g=gamma_g, gamma_b=gamma_b, contrast=contrast, bias=bias)
    return ops
774161
def atmos(
    ctx,
    atmo,
    contrast,
    bias,
    jobs,
    out_dtype,
    src_path,
    dst_path,
    creation_options,
    as_color,
):
    
    if as_color:
        click.echo(
            "rio color {} {} {}".format(
                src_path, dst_path, simple_atmo_opstring(atmo, contrast, bias)
            )
        )
        exit(0)

    with rasterio.open(src_path) as src:
        opts = src.profile.copy()
        windows = [(window, ij) for ij, window in src.block_windows()]

    opts.update(**creation_options)
    opts["transform"] = guard_transform(opts["transform"])

    out_dtype = out_dtype if out_dtype else opts["dtype"]
    opts["dtype"] = out_dtype

    args = {"atmo": atmo, "contrast": contrast, "bias": bias, "out_dtype": out_dtype}

    jobs = check_jobs(jobs)

    if jobs > 1:
        with riomucho.RioMucho(
            [src_path],
            dst_path,
            atmos_worker,
            windows=windows,
            options=opts,
            global_args=args,
            mode="manual_read",
        ) as mucho:
            mucho.run(jobs)
    else:
        with rasterio.open(dst_path, "w", **opts) as dest:
            with rasterio.open(src_path) as src:
                rasters = [src]
                for window, ij in windows:
                    arr = atmos_worker(rasters, window, ij, args)
                    dest.write(arr, window=window)
52921
function translate(key, options, hasOwnOptions) {

			var lng = options.lng || 'auto';

			if (!translations[lng]) {
				translations[lng] = {};
			}

			if (!t) {

				translations[lng][key] = 'defaultLoadingValue' in options ? options.defaultLoadingValue :
					'defaultValue' in options ? options.defaultValue :
					'defaultLoadingValue' in globalOptions ? globalOptions.defaultLoadingValue : key;

			} else if (!translations[lng][key] || hasOwnOptions) {

				translations[lng][key] = t(key, options);

			}

		}
857652
def sky_to_offset(skydir, lon, lat, coordsys='CEL', projection='AIT'):
    """"""

    w = create_wcs(skydir, coordsys, projection)
    skycrd = np.vstack((lon, lat)).T

    if len(skycrd) == 0:
        return skycrd

    return w.wcs_world2pix(skycrd, 0)
83082
def taf(trans: TafLineTrans) -> str:
    
    summary = []
    if trans.wind:
        summary.append('Winds ' + trans.wind)
    if trans.visibility:
        summary.append('Vis ' + trans.visibility[:trans.visibility.find(' (')].lower())
    if trans.altimeter:
        summary.append('Alt ' + trans.altimeter[:trans.altimeter.find(' (')])
    if trans.other:
        summary.append(trans.other)
    if trans.clouds:
        summary.append(trans.clouds.replace(' - Reported AGL', ''))
    if trans.wind_shear:
        summary.append(trans.wind_shear)
    if trans.turbulance:
        summary.append(trans.turbulance)
    if trans.icing:
        summary.append(trans.icing)
    return ', '.join(summary)
1359190
def _translate(self, x, y):
        """"""
        # we add our position relative to our parent and then call then next parent up
        return self.parent._translate((x + self.x), (y + self.y))
945757
def _convert_sky_coords(self):
        
        parsed_angles = [(x, y)
                         for x, y in zip(self.coord[:-1:2], self.coord[1::2])
                         if (isinstance(x, coordinates.Angle) and isinstance(y, coordinates.Angle))
                         ]
        frame = coordinates.frame_transform_graph.lookup_name(self.coordsys)

        lon, lat = zip(*parsed_angles)
        if hasattr(lon, '__len__') and hasattr(lat, '__len__') and len(lon) == 1 and len(lat) == 1:
            # force entries to be scalar if they are length-1
            lon, lat = u.Quantity(lon[0]), u.Quantity(lat[0])
        else:
            # otherwise, they are vector quantities
            lon, lat = u.Quantity(lon), u.Quantity(lat)
        sphcoords = coordinates.UnitSphericalRepresentation(lon, lat)
        coords = [SkyCoord(frame(sphcoords))]

        if self.region_type != 'polygon':
            coords += self.coord[len(coords * 2):]

        return coords