Default callback for get_label/set_label
977283
def resp_set_label(self, resp, label=None):
        
        if label:
            self.label=label
        elif resp:
            self.label=resp.label.decode().replace("\x00", "")
356532
def label( self ):
        
        if ( self._editor and hasattr(self._editor, 'label') ):
            return self._editor.label()
        return ''
364564
def set_labels(self, *labels):
        
        assert all(isinstance(element, (github.Label.Label, str, unicode)) for element in labels), labels
        post_parameters = [label.name if isinstance(label, github.Label.Label) else label for label in labels]
        headers, data = self._requester.requestJsonAndCheck(
            "PUT",
            self.issue_url + "/labels",
            input=post_parameters
        )
125625
def label(self):
        """""""

        if self.valuetype_class.is_label():
            return self

        for c in self.table.columns:
            if c.parent == self.name and  c.valuetype_class.is_label():
                return c

        return None
227066
function getOptionLabel(option, labelKey) {
  if (option.paginationOption || option.customOption) {
    return option[getStringLabelKey(labelKey)];
  }

  let optionLabel;

  if (typeof option === 'string') {
    optionLabel = option;
  }

  if (typeof labelKey === 'function') {
    // This overwrites string options, but we assume the consumer wants to do
    // something custom if `labelKey` is a function.
    optionLabel = labelKey(option);
  } else if (typeof labelKey === 'string' && isPlainObject(option)) {
    optionLabel = option[labelKey];
  }

  invariant(
    typeof optionLabel === 'string',
    'One or more options does not have a valid label string. Check the ' +
    '`labelKey` prop to ensure that it matches the correct option key and ' +
    'provides a string for filtering and display.'
  );

  return optionLabel;
}
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
1209038
def _label_desc(self, label, desc, label_color=''):
        '''  '''
        return self.BRIGHT +  label_color + label + self.RESET + desc
491208
def setLabel(self, value, label):
        
        if label:
            self._labels[value] = label
        else:
            self._labels.pop(value, None)
759069
function(hasCustomMarkup, labelAttrs, defaultLabelAttrs, builtinDefaultLabelAttrs) {

        if (labelAttrs === null) return null;
        if (labelAttrs === undefined) {

            if (defaultLabelAttrs === null) return null;
            if (defaultLabelAttrs === undefined) {

                if (hasCustomMarkup) return undefined;
                return builtinDefaultLabelAttrs;
            }

            if (hasCustomMarkup) return defaultLabelAttrs;
            return joint.util.merge({}, builtinDefaultLabelAttrs, defaultLabelAttrs);
        }

        if (hasCustomMarkup) return joint.util.merge({}, defaultLabelAttrs, labelAttrs);
        return joint.util.merge({}, builtinDefaultLabelAttrs, defaultLabelAttrs, labelAttrs);
    }
1289732
def setLabel(self, text=None, units=None, unitPrefix=None, **args):
        
        show_label = False
        if text is not None:
            self.labelText = text
            show_label = True
        if units is not None:
            self.labelUnits = units
            show_label = True
        if show_label:
            self.showLabel()
        if unitPrefix is not None:
            self.labelUnitPrefix = unitPrefix
        if len(args) > 0:
            self.labelStyle = args
        self.label.setHtml(self.labelString())
        self._adjustSize()
        self.picture = None
        self.update()
248316
def _as_label(self, index_or_label):
        """"""
        if isinstance(index_or_label, str):
            return index_or_label
        if isinstance(index_or_label, numbers.Integral):
            return self.labels[index_or_label]
        else:
            raise ValueError(str(index_or_label) + ' is not a label or index')
347323
function addlabel(name, opts) {
    opts = opts || {};

    var type  = opts.type;
    var token = opts.token;
    var islet = opts.islet;

    // Define label in the current function in the current scope.
    if (type === "exception") {
      if (_.has(funct["(context)"], name)) {
        if (funct[name] !== true && !state.option.node) {
          warning("W002", state.tokens.next, name);
        }
      }
    }

    if (_.has(funct, name) && !funct["(global)"]) {
      if (funct[name] === true) {
        if (state.option.latedef) {
          if ((state.option.latedef === true && _.contains([funct[name], type], "unction")) ||
              !_.contains([funct[name], type], "unction")) {
            warning("W003", state.tokens.next, name);
          }
        }
      } else {
        if ((!state.option.shadow || _.contains([ "inner", "outer" ], state.option.shadow)) &&
            type !== "exception" || funct["(blockscope)"].getlabel(name)) {
          warning("W004", state.tokens.next, name);
        }
      }
    }

    if (funct["(context)"] && _.has(funct["(context)"], name) && type !== "function") {
      if (state.option.shadow === "outer") {
        warning("W123", state.tokens.next, name);
      }
    }

    // if the identifier is from a let, adds it only to the current blockscope
    if (islet) {
      funct["(blockscope)"].current.add(name, type, state.tokens.curr);
    } else {
      funct["(blockscope)"].shadow(name);
      funct[name] = type;

      if (token) {
        funct["(tokens)"][name] = token;
      }

      setprop(funct, name, { unused: opts.unused || false });

      if (funct["(global)"]) {
        global[name] = funct;
        if (_.has(implied, name)) {
          if (state.option.latedef) {
            if ((state.option.latedef === true && _.contains([funct[name], type], "unction")) ||
                !_.contains([funct[name], type], "unction")) {
              warning("W003", state.tokens.next, name);
            }
          }

          delete implied[name];
        }
      } else {
        scope[name] = funct;
      }
    }
  }
1229008
def update_label(self, name, color, new_name=''):
        
        label = self.label(name)
        resp = False
        if label:
            upd = label.update
            resp = upd(new_name, color) if new_name else upd(name, color)
        return resp
1208581
def label_for_lm(self, **kwargs):
        ""
        self.__class__ = LMTextList
        kwargs['label_cls'] = LMLabelList
        return self.label_const(0, **kwargs)
1044466
def set_label(self, label):
        
        data = {"ruleId": self.id, "label": label}
        return self._restCall("rule/setRuleLabel", json.dumps(data))
1107148
def _set_label(label, mark, dim, **kwargs):
    
    if mark is None:
        mark = _context['last_mark']
    if mark is None:
        return {}
    fig = kwargs.get('figure', current_figure())
    scales = mark.scales
    scale_metadata = mark.scales_metadata.get(dim, {})
    scale = scales.get(dim, None)
    if scale is None:
        return
    dimension = scale_metadata.get('dimension', scales[dim])
    axis = _fetch_axis(fig, dimension, scales[dim])

    if axis is not None:
        _apply_properties(axis, {'label': label})
1369001
def _label(self, line):
        '''

        '''
        label = self._setup('LABEL', line)
        self.labels += [ label ]