Utility method, appends latitude/longitude pairs to city table labels, if that data
exists for the city.
344856
private function setLatitudeLongitude(DataTable $tableCity)
    {
        foreach ($tableCity->getRows() as $row) {
            $label = $row->getColumn('label');
            if (isset($this->latLongForCities[$label])) {
                // get lat/long for city
                list($lat, $long) = $this->latLongForCities[$label];
                $lat = round($lat, LocationProvider::GEOGRAPHIC_COORD_PRECISION);
                $long = round($long, LocationProvider::GEOGRAPHIC_COORD_PRECISION);

                // set latitude + longitude metadata
                $row->setMetadata('lat', $lat);
                $row->setMetadata('long', $long);
            }
        }
    }
304108
def fill_addressfields(self, row, obj):
        
        addresses = {}
        for add_type in ['Physical', 'Postal', 'Billing', 'CountryState']:
            addresses[add_type] = {}
            for key in ['Address', 'City', 'State', 'District', 'Zip', 'Country']:
                addresses[add_type][key.lower()] = str(row.get("%s_%s" % (add_type, key), ''))

        if addresses['CountryState']['country'] == '' \
            and addresses['CountryState']['state'] == '':
            addresses['CountryState']['country'] = addresses['Physical']['country']
            addresses['CountryState']['state'] = addresses['Physical']['state']

        if hasattr(obj, 'setPhysicalAddress'):
            obj.setPhysicalAddress(addresses['Physical'])
        if hasattr(obj, 'setPostalAddress'):
            obj.setPostalAddress(addresses['Postal'])
        if hasattr(obj, 'setCountryState'):
            obj.setCountryState(addresses['CountryState'])
        if hasattr(obj, 'setBillingAddress'):
            obj.setBillingAddress(addresses['Billing'])
395855
function (latlngs, result, projectedBounds) {
		var flat = latlngs[0] instanceof L.LatLng,
		    len = latlngs.length,
		    i, ring;

		if (flat) {
			ring = [];
			for (i = 0; i < len; i++) {
				ring[i] = this._map.latLngToLayerPoint(latlngs[i]);
				projectedBounds.extend(ring[i]);
			}
			result.push(ring);
		} else {
			for (i = 0; i < len; i++) {
				this._projectLatlngs(latlngs[i], result, projectedBounds);
			}
		}
	}
862635
def _on_new_location(self, form):
        """"""
        self._desired_longitude = float(form.data["long"])
        self._desired_latitude = float(form.data["lat"])
        self._desired_zoom = 13
        self._screen.force_update()
121706
def geoadd(self, key, longitude, latitude, member, *args, **kwargs):
        
        return self.execute(
            b'GEOADD', key, longitude, latitude, member, *args, **kwargs
        )
1366138
def swap_pairs(line, starttag=position_tag):
    

    endtag = starttag.replace('<', '</')

    index = line.find(starttag)
    if index < 0:
        msg = 'Expected line starting with <gml:posList>, got %s' % line
        raise Exception(msg)

    # Reuse indentation and tag
    k = index + len(starttag)
    new_line = line[:k]
    remaining_line = line[k:]

    # Swap coordinates for the rest of the line
    got_lat = False
    got_lon = False
    for field in remaining_line.split():

        # Clean end-tag from last field if present
        index = field.find(endtag)
        if index > -1:
            # We got e.g. 136.28396002600005</gml:posList>
            x = float(field[:index])
        else:
            x = float(field)

        # Assign latitude or longitude
        if got_lat:
            lon = x
            got_lon = True
        else:
            lat = x
            got_lat = True

        # Swap and write back every time a pair has been found
        # Ensure there are enough decimals for the required precision
        if got_lat and got_lon:
            new_line += ' %.9f %.9f' % (lon, lat)
            got_lat = got_lon = False

    # Close position list and return
    new_line += endtag + '\n'
    return new_line
290085
def append_data(self, attribute, values):
        """"""
        found = False
        if type(values) != list:
            values = [values]
        for col in self.Table:
            if attribute in col:
                dict_values = [u"{0}".format(value) for value in values]
                col[attribute] += dict_values
                found = True
        if not found:
            raise KeyError(attribute)
852804
def add_to_results(self, data, label, results):
        
        raise NotImplementedError(
            '{} must specify how to add data to the running results tally '
            'by overriding the `add_to_results` method.'.format(
                self.__class__.__name__
            )
        )
1094642
public GridBagLayoutBuilder appendLabel(JLabel label, int colSpan) {
        return append(label, colSpan, 1, false, false);
    }
284022
public static String getTabularData(String[] labels, String[][] data, int padding) {
    int[] size = new int[labels.length];
    
    for (int i = 0; i < labels.length; i++) {
      size[i] = labels[i].length() + padding;
    }
    
    for (String[] row : data) {
      for (int i = 0; i < labels.length; i++) {
        if (row[i].length() >= size[i]) {
          size[i] = row[i].length() + padding;
        }
      }
    }
    
    StringBuffer tabularData = new StringBuffer();
    
    for (int i = 0; i < labels.length; i++) {
      tabularData.append(labels[i]);
      tabularData.append(fill(' ', size[i] - labels[i].length()));
    }
    
    tabularData.append("\n");
    
    for (int i = 0; i < labels.length; i++) {
      tabularData.append(fill('=', size[i] - 1)).append(" ");
    }
    
    tabularData.append("\n");
    
    
    for (String[] row : data) {
      for (int i = 0; i < labels.length; i++) {
        tabularData.append(row[i]);
        tabularData.append(fill(' ', size[i] - row[i].length()));
      }
      
      tabularData.append("\n");
    }
    
    return tabularData.toString();
  }
138977
def append_data(dset, data):
    """"""
    N = data.shape[0] if hasattr(data, 'shape') else 1
    if N == 0:
        return
    oldlen = dset.shape[0]
    newlen = oldlen + N
    dset.resize(newlen, axis=0)
    dset[oldlen:] = data
515399
private void findMatches(ModifiableDBIDs posn, Relation<?> lrelation, Object label) {
    posn.clear();
    for(DBIDIter ri = lrelation.iterDBIDs(); ri.valid(); ri.advance()) {
      if(match(label, lrelation.get(ri))) {
        posn.add(ri);
      }
    }
  }
388878
public Axis addLabel(String[] label, double[] location) {
        if (label.length != location.length) {
            throw new IllegalArgumentException("Label size and location size don't match.");
        }

        if (labels == null) {
            labels = new HashMap<>();
        }

        for (int i = 0; i < label.length; i++) {
            labels.put(label[i], location[i]);
        }

        setSlice();
        initGridLines();
        initGridLabels();
        return this;
    }
26462
def set_data(self, source_data):
        
        self.street = source_data['street']
        self.zipcode = source_data['zipcode']
        self.city = source_data['city']
        self.state = source_data['state']
        self.latitude = source_data['latitude']
        self.longitude = source_data['longitude']
796698
public Element append(ICalDataType dataType, String value) {
		String dataTypeStr = toLocalName(dataType);
		return append(dataTypeStr, value);
	}
853555
private void processEntity(Entity entity, double latitude, double longitude) {
        // Only add entities that fall within the bounding box (if set)
        BoundingBox bb = this.configuration.getBboxConfiguration();
        if (bb != null && !bb.contains(latitude, longitude)) {
            return;
        }

        // Only add entities that have data
        if (entity.getTags().isEmpty()) {
            return;
        }

        // Only add named entities (if set)
        if (this.configuration.isNames()) {
            String name = getTagValue(entity.getTags(), "name");
            if (name == null || name.isEmpty()) {
                return;
            }
        }

        // Process entity
        Map<String, String> tagMap = new TreeMap<>();
        Set<PoiCategory> categories = new HashSet<>();
        for (Tag tag : entity.getTags()) {
            String key = tag.getKey().toLowerCase(Locale.ENGLISH);
            if (this.tagMappingResolver.getMappingTags().contains(key)) {
                // Check if there is a POI category for this tag and add POI to DB
                String tagStr = key + "=" + tag.getValue();
                try {
                    // Get categories from tag
                    List<PoiCategory> pcs = this.tagMappingResolver.getCategoriesFromTag(tagStr);

                    // Get categories from key, if tag wasn't matched
                    // Note: key categories should be parents of their value categories
                    if (pcs == null) {
                        pcs = this.tagMappingResolver.getCategoriesFromTag(key);
                    }

                    if (pcs != null) {
                        for (PoiCategory pc : pcs) {
                            // Add entity if its category matches
                            if (this.categoryFilter.isAcceptedCategory(pc)) {
                                // Collect the POI tags in a sorted manner (once)
                                if (tagMap.isEmpty()) {
                                    for (Tag t : entity.getTags()) {
                                        tagMap.put(t.getKey().toLowerCase(Locale.ENGLISH), t.getValue());
                                    }
                                }
                                categories.add(pc);
                            }
                        }
                    }
                } catch (UnknownPoiCategoryException e) {
                    LOGGER.warning("The '" + tagStr + "' tag refers to a POI that does not exist: " + e.getMessage());
                }
            }
        }

        // Store POI
        if (!tagMap.isEmpty()) {
            writePOI(this.poiAdded++, latitude, longitude, tagMap, categories);
        }
    }
1090635
def append(self, v):
        ''''''
        if isinstance(v, MPSetting):
            setting = v
        else:
            (name,type,default) = v
            label = name
            tab = None
            if len(v) > 3:
                label = v[3]
            if len(v) > 4:
                tab = v[4]
            setting = MPSetting(name, type, default, label=label, tab=tab)

        # when a tab name is set, cascade it to future settings
        if setting.tab is None:
            setting.tab = self._default_tab
        else:
            self._default_tab = setting.tab
        self._vars[setting.name] = setting
        self._keys.append(setting.name)
        self._last_change = time.time()