Custom label names for request properties (like SReg data)
10646
def property_label_text(property)
      case property.to_sym
      when :image_default then t(:image_url)
      when :web_default then t(:website_url)
      when :web_blog then t(:blog_url)
      else t(property.to_sym)
      end
    end
1239313
def _name_with_flags(self, include_restricted, title=None):
        """"""
        name = "Special: " if self.special else ""
        name += self.name
        if title:
            name += " - {}".format(title)
        if include_restricted and self.restricted:
            name += " (R)"
        name += " (BB)" if self.both_blocks else ""
        name += " (A)" if self.administrative else ""
        name += " (S)" if self.sticky else ""
        name += " (Deleted)" if self.deleted else ""
        return name
1351559
def string_tag(name, value):
    """"""
    return name.encode('utf-8') + \
        len(value).to_bytes(4, byteorder='big') + \
        value.encode('utf-8')
954578
def update_form_labels(self, request=None, obj=None, form=None):
        
        for form_label in self.custom_form_labels:
            if form_label.field in form.base_fields:
                label = form_label.get_form_label(
                    request=request, obj=obj, model=self.model, form=form
                )
                if label:
                    form.base_fields[form_label.field].label = mark_safe(label)
        return form
167212
function(req, res) {
        if (!searchIdx) return res();
        var results = searchIdx.search(req.term)
          .map(function(result) {
            return {
              label: files[result.ref].title,
              value: files[result.ref]
            };
          });

        res(results);
      }
1166112
def _get_filename(request, item):
        
        if request.keep_image_names:
            filename = OgcImageService.finalize_filename(item['niceName'].replace(' ', '_'))
        else:
            filename = OgcImageService.finalize_filename(
                '_'.join([str(GeopediaService._parse_layer(request.layer)), item['objectPath'].rsplit('/', 1)[-1]]),
                request.image_format
            )

        LOGGER.debug("filename=%s", filename)
        return filename
1153744
def _get_label_uuid(xapi, rectype, label):
    '''
    
    '''
    try:
        return getattr(xapi, rectype).get_by_name_label(label)[0]
    except Exception:
        return False
851291
def _get_sr(name=None, session=None):
    '''
    
    '''
    if session is None:
        session = _get_session()
    srs = session.xenapi.SR.get_by_name_label(name)
    if len(srs) == 1:
        return srs[0]
    return None
557868
def filter_label(label, replace_by_similar=True):
    
    bad_names = ['celsius', 'degree', 'ohm', 'venus', 'mars', 'astrosun',
                 'fullmoon', 'leftmoon', 'female', 'male', 'checked',
                 'diameter', 'sun', 'Bowtie', 'sqrt',
                 'cong', 'copyright', 'dag', 'parr', 'notin', 'dotsc',
                 'mathds', 'mathfrak']
    if any(label[1:].startswith(bad) for bad in bad_names):
        if label == '\\dag' and replace_by_similar:
            return '\\dagger'
        elif label == '\\diameter' and replace_by_similar:
            return '\\O'
        return label[1:]
    else:
        return label
808997
def get_filename_filled_with_checked_labels(self, labels=None):
        
        if labels is None:
            labels = self.slab_wg.action_check_slab_ui()
        string_labels = imma.get_nlabels(slab=self.slab_wg.slab, labels=labels, return_mode="str")
        filename = self.vtk_file.format(
            "-".join(string_labels))
        return filename
756446
function encode(source, label) {
  if (!Buffer.isBuffer(source)) {
    throw new TypeError('Argument `source` should be a Buffer.')
  }

  if (typeof label !== 'string') {
    throw new TypeError('Argument `label` should be a string in upper case.')
  }

  const prefix = before + ' ' + label + endline
  const suffix = after + ' ' + label + endline

  const body = source.toString('base64').replace(/(.{64})/g, '$1\r\n')

  return [prefix, body, suffix].join('\r\n')
}
82453
function similarPropertyNames(property) {
		if (typeof property !== 'string') {
			property = property.name();
		}

		var similarProps = (cssResolver.vendorPrefixes(property) || []).map(function(prefix) {
			return '-' + prefix + '-' + property;
		});
		similarProps.push(property);
		return similarProps;
	}
1165935
def editlabel(self, project_id, name, new_name=None, color=None):
        
        data = {'name': name, 'new_name': new_name, 'color': color}

        request = requests.put(
            '{0}/{1}/labels'.format(self.projects_url, project_id), data=data,
            verify=self.verify_ssl, auth=self.auth, headers=self.headers, timeout=self.timeout)

        if request.status_code == 200:
            return request.json()
        else:
            return False
1335063
def _encode_label(label):
    """"""
    if isinstance(label, tuple):
        return [_encode_label(v) for v in label]
    return label
361763
private static String getEntryNameForMap(String property, Boolean key, Integer index) {
        return String.format("%s.%d.%s", property, index, key ? "key" : "value");
    }
1030460
private final String getFilenameFromLabel(Context context, String pid, String dsid, Date asOfDateTime, String MIMETYPE) throws Exception {

        // can't get datastream label directly from datastream as this is an API-M call
        // instead get list of datastream defs, as these contain labels
        DOReader reader = m_doManager.getReader(false, context, pid);
        Datastream ds = reader.GetDatastream(dsid, asOfDateTime);

        return (ds == null) ? "" : ds.DSLabel;
    }
989994
function LabelAtlas (opts) {
    LabelAtlas.superclass.constructor.call(this, {
        file: opts.charMapFile,
        itemWidth: opts.itemWidth,
        itemHeight: opts.itemHeight,
        itemsToRender: opts.string.length,
        size: new geo.Size(opts.itemWidth * opts.string.length, opts.itemHeight)
    })

    events.addPropertyListener(this, 'string', 'change', this.updateAtlasValue.bind(this))

    this.mapStartChar = opts.startCharMap.charCodeAt(0)
    this.string = opts.string

    this.contentSize = new geo.Size(opts.itemWidth * this.string.length, opts.itemHeight)
}