Add a security label to a resource.

        Args:
            label (str): The security label (must exit in ThreatConnect).
            resource (obj): An instance of tcex resource class.
501969
def stage_tc_create_security_label(self, label, resource):
        
        sl_resource = resource.security_labels(label)
        sl_resource.http_method = 'POST'
        sl_response = sl_resource.request()
        if sl_response.get('status') != 'Success':
            self.log.warning(
                '[tcex] Failed adding security label "{}" ({}).'.format(
                    label, sl_response.get('response').text
                )
            )
456116
public static Label buildLabel(final Locale locale, final String label) {
        return addLabel(Label.newBuilder(), locale.getLanguage(), label).build();
    }
1227363
def AddLabel(self, label):
    
    if not isinstance(label, py2to3.STRING_TYPES):
      raise TypeError('label is not a string type. Is {0:s}'.format(
          type(label)))
    if not self._VALID_LABEL_REGEX.match(label):
      raise ValueError((
          'Unsupported label: "{0:s}". A label must only consist of '
          'alphanumeric characters or underscores.').format(label))

    if label not in self.labels:
      self.labels.append(label)
899237
def label(method, text = nil, options = {}, &block)
      text = instance_exec(&text) if text.is_a?(Proc)
      super
    end
801115
def add_label(self, doc, label, update_index=True):
        
        label = copy.copy(label)
        assert(label in self.labels.values())
        doc.add_label(label)
        if update_index:
            self.upd_doc(doc)
            self.commit()
1356423
def proxy_label_for(label: str) -> str:
        
        label_java = _VertexLabel(label).unwrap()
        proxy_label_java = k.jvm_view().SequenceBuilder.proxyLabelFor(label_java)
        return proxy_label_java.getQualifiedName()
374751
private Label createLabel(String label) {
        Pane pane = new Pane();
        root.addChild(pane);
        Label lbl = new Label();
        lbl.setName(label);
        pane.addChild(lbl);
        adjustPanes();
        return lbl;
    }
1226408
def attribute_label(self, attribute_id, label, action='GET', params=None):
        
        if params is None:
            params = {}
        if not self.can_update():
            self._tcex.handle_error(910, [self.type])

        if action == 'GET':
            return self.tc_requests.get_attribute_label(
                self.api_type,
                self.api_sub_type,
                self.unique_id,
                attribute_id,
                label,
                owner=self.owner,
                params=params,
            )
        if action == 'DELETE':
            return self.tc_requests.delete_attribute_label(
                self.api_type,
                self.api_sub_type,
                self.unique_id,
                attribute_id,
                label,
                owner=self.owner,
            )

        self._tcex.handle_error(925, ['action', 'attribute_label', 'action', 'action', action])
        return None
380100
def declare_label(self, label, lineno, value=None, local=False, namespace=None):
        
        ex_label, namespace = Memory.id_name(label, namespace)

        is_address = value is None
        if value is None:
            value = self.org

        if ex_label in self.local_labels[-1].keys():
            self.local_labels[-1][ex_label].define(value, lineno)
            self.local_labels[-1][ex_label].is_address = is_address
        else:
            self.local_labels[-1][ex_label] = Label(ex_label, lineno, value, local, namespace, is_address)

        self.set_memory_slot()

        return self.local_labels[-1][ex_label]
98259
public final synchronized void setLabel(String label) {
        if(label == null) {
            throw new IllegalArgumentException("null label to a button is not allowed");
        }
        if(label.isEmpty()) {
            label = " ";
        }
        this.label = label;
        invalidate();
    }
1358675
def remove_from_labels(self, label):
        
        assert isinstance(label, (github.Label.Label, str, unicode)), label
        if isinstance(label, github.Label.Label):
            label = label._identity
        else:
            label = urllib.quote(label)
        headers, data = self._requester.requestJsonAndCheck(
            "DELETE",
            self.issue_url + "/labels/" + label
        )
37714
def handle_label(self, label, **options):
        
        if not hasattr(commands, 'sync_%s' % label):
            raise CommandError('"%s" is not a valid command.' % label)

        getattr(commands, 'sync_%s' % label)(**sanitize_command_options(options))
795552
def lock(self, resource, label='', expire=60, patience=60):
        
        queue = Queue(client=self.client, resource=resource)
        with queue.draw(label=label, expire=expire) as number:
            queue.wait(number=number, patience=patience)
            yield
        queue.close()
848824
def add_dos(self, label, dos):
        

        densities = dos.get_smeared_densities(self.sigma) if self.sigma \
            else dos.densities
        self._doses[label] = {'frequencies': dos.frequencies, 'densities': densities}
330767
def add_labels(self, *args):
        
        url = self._build_url('labels', base_url=self._api)
        json = self._json(self._post(url, data=args), 200)
        return [Label(l, self) for l in json] if json else []
271649
def build_label(self, ident, cls):
        
        ident_w_label = ident + ':' + cls.__label__
        self._ast['match'].append('({0})'.format(ident_w_label))
        self._ast['return'] = ident
        self._ast['result_class'] = cls
        return ident
1246712
def p_def_label(p):
    
    p[0] = None
    __DEBUG__("Declaring '%s%s' in %i" % (NAMESPACE, p[1], p.lineno(1)))
    MEMORY.declare_label(p[1], p.lineno(1), p[3])