Add UFO glif anchors to a GSLayer.
967510
def to_glyphs_glyph_anchors(self, ufo_glyph, layer):
    """"""
    for ufo_anchor in ufo_glyph.anchors:
        anchor = self.glyphs_module.GSAnchor()
        anchor.name = ufo_anchor.name
        anchor.position = Point(ufo_anchor.x, ufo_anchor.y)
        layer.anchors.append(anchor)
569098
def add_geo_facet(self, *args, **kwargs):
        """"""
        self.facets.append(GeoDistanceFacet(*args, **kwargs))
1268797
def add_linked_station(self, datfile, station, location=None):
        """"""
        if datfile not in self.fixed_stations:
            self.fixed_stations[datfile] = {station: location}
        else:
            self.fixed_stations[datfile][station] = location

        if location and not self.base_location:
            self._utm_zone = location.zone
            self._utm_datum = location.datum
            self._utm_convergence = location.convergence
188707
private void configureDisplayView() {
        if (mDisplayView instanceof GLCameraEncoderView)
            ((GLCameraEncoderView) mDisplayView).setCameraEncoder(this);
        else if (mDisplayView instanceof GLCameraView)
            ((GLCameraView) mDisplayView).setCamera(mCamera);
    }
591767
def add_surface(self, name, surface):
        """"""
        assert surface is not None

        if hasattr(self.module, name):
            raise ThriftCompilerError(
                'Cannot define "%s". The name has already been used.' % name
            )

        setattr(self.module, name, surface)
1304912
public void addGSV( GSVSentence gsv ) {
        try {
            if (gsv.isValid())
                satelliteInfo = gsv.getSatelliteInfo();
        } catch (Exception e) {
            // ignore it, this should be handled in the isValid,
            // if an exception is thrown, we can't deal with it here.
        }
    }
422514
def extend_safe(target, source):
    
    for elt in source:
        if elt not in target:
            target.append(elt)
523237
def add_infra(subparsers):
    """"""
    infra_parser = subparsers.add_parser('infra', help=runner.prepare_infrastructure.__doc__)
    infra_parser.set_defaults(func=runner.prepare_infrastructure)
1190929
def _propagate_glyph_anchors(self, ufo, parent, processed):
    """"""

    if parent.name in processed:
        return
    processed.add(parent.name)

    base_components = []
    mark_components = []
    anchor_names = set()
    to_add = {}
    for component in parent.components:
        try:
            glyph = ufo[component.baseGlyph]
        except KeyError:
            self.logger.warning(
                "Anchors not propagated for inexistent component {} in glyph {}".format(
                    component.baseGlyph, parent.name
                )
            )
        else:
            _propagate_glyph_anchors(self, ufo, glyph, processed)
            if any(a.name.startswith("_") for a in glyph.anchors):
                mark_components.append(component)
            else:
                base_components.append(component)
                anchor_names |= {a.name for a in glyph.anchors}

    for anchor_name in anchor_names:
        # don't add if parent already contains this anchor OR any associated
        # ligature anchors (e.g. "top_1, top_2" for "top")
        if not any(a.name.startswith(anchor_name) for a in parent.anchors):
            _get_anchor_data(to_add, ufo, base_components, anchor_name)

    for component in mark_components:
        _adjust_anchors(to_add, ufo, component)

    # we sort propagated anchors to append in a deterministic order
    for name, (x, y) in sorted(to_add.items()):
        anchor_dict = {"name": name, "x": x, "y": y}
        parent.appendAnchor(glyph.anchorClass(anchorDict=anchor_dict))
391066
def addSRNLayers(self, inc, hidc, outc):
        
        self.addThreeLayers(inc, hidc, outc)
937822
def add_ch_grp_to_interface(
        self, nexus_host, if_type, port, ch_grp):
        """"""

        if if_type != "ethernet":
            LOG.error("Unexpected interface type %(iftype)s when "
                      "adding change group", {'iftype': if_type})
            return

        starttime = time.time()

        path_snip = snipp.PATH_ALL
        path_interface = "phys-[eth" + port + "]"

        body_snip = snipp.BODY_ADD_CH_GRP % (ch_grp, ch_grp, path_interface)

        self.send_edit_string(nexus_host, path_snip, body_snip)

        self.capture_and_print_timeshot(
            starttime, "add_ch_group",
            switch=nexus_host)
958757
def addThreeLayers(self, inc, hidc, outc):
        
        self.addLayer('input', inc)
        self.addContextLayer('context', hidc, 'hidden')
        self.addLayer('hidden', hidc)
        self.addLayer('output', outc)
        self.connect('input', 'hidden')
        self.connect('context', 'hidden')
        self.connect('hidden', 'output')
49712
def attach(self, gui):
        """"""
        super(CorrelogramView, self).attach(gui)
        self.actions.add(self.toggle_normalization, shortcut='n')
        self.actions.separator()
        self.actions.add(self.set_bin, alias='cb')
        self.actions.add(self.set_window, alias='cw')
386995
function VirtualEarthGeocoder(httpAdapter, options) {

  VirtualEarthGeocoder.super_.call(this, httpAdapter, options);

  if (!this.options.apiKey || this.options.apiKey == 'undefined') {
    throw new Error('You must specify an apiKey');
  }
}
752265
def generate_anchors(
    stride=16, sizes=(32, 64, 128, 256, 512), aspect_ratios=(0.5, 1, 2)
):
    
    return _generate_anchors(
        stride,
        np.array(sizes, dtype=np.float) / stride,
        np.array(aspect_ratios, dtype=np.float),
    )
749876
function CardboardUI(gl) {
  this.gl = gl;

  this.attribs = {
    position: 0
  };
  this.program = Util.linkProgram(gl, uiVS, uiFS, this.attribs);
  this.uniforms = Util.getProgramUniforms(gl, this.program);

  this.vertexBuffer = gl.createBuffer();
  this.gearOffset = 0;
  this.gearVertexCount = 0;
  this.arrowOffset = 0;
  this.arrowVertexCount = 0;

  this.projMat = new Float32Array(16);

  this.listener = null;

  this.onResize();
}
1016633
def add_to_file_links(self):
        # type: () -> None
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('Rock Ridge extension not yet initialized')

        if self.dr_entries.px_record is None:
            if self.ce_entries.px_record is None:
                raise pycdlibexception.PyCdlibInvalidInput('No Rock Ridge file links')
            self.ce_entries.px_record.posix_file_links += 1
        else:
            self.dr_entries.px_record.posix_file_links += 1