Adds a security labels to a attribute

        Args:
            attribute_id:
            label:

        Returns: A response json
332215
def add_attribute_label(self, attribute_id, label):
        
        if not self.can_update():
            self._tcex.handle_error(910, [self.type])

        return self.tc_requests.add_attribute_label(
            self.api_type, self.api_sub_type, self.unique_id, attribute_id, label, owner=self.owner
        )
642709
def download(label_id)
      download_url = File.join(LABEL_URL, "#{label_id}.pdf")
      response = connection.get download_url
      StringIO.new(response.body)
    end
39494
def _get_container_id(self, labels):
        
        namespace = CadvisorPrometheusScraperMixin._get_container_label(labels, "namespace")
        pod_name = CadvisorPrometheusScraperMixin._get_container_label(labels, "pod_name")
        container_name = CadvisorPrometheusScraperMixin._get_container_label(labels, "container_name")
        return self.pod_list_utils.get_cid_by_name_tuple((namespace, pod_name, container_name))
384262
def list_keys(self, label=None):
        
        _filter = utils.NestedDict({})
        if label:
            _filter['sshKeys']['label'] = utils.query_filter(label)

        return self.client['Account'].getSshKeys(filter=_filter.to_dict())
169602
def _sync_labels(self, labels_json):
        """""""
        for label_json in labels_json:
            label_id = label_json['id']
            self.labels[label_id] = Label(label_json, self)
122671
def update_label(signature, post_data):
    '''
    
    '''
    current_tag_infos = MPost2Label.get_by_uid(signature).objects()
    if 'tags' in post_data:
        pass
    else:
        return False

    tags_arr = [x.strip() for x in post_data['tags'].split(',')]
    for tag_name in tags_arr:
        if tag_name == '':
            pass
        else:
            MPost2Label.add_record(signature, tag_name, 1)

    for cur_info in current_tag_infos:
        if cur_info.tag_name in tags_arr:
            pass
        else:
            MPost2Label.remove_relation(signature, cur_info.tag_id)
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
53591
def get_related_ids(self, content_id, min_strength=None):
        '''
        '''
        related_labels = self.get_related(content_id,
                                          min_strength=min_strength)
        related_idents = set()
        for label in related_labels:
            related_idents.add(label.other(content_id))

        return list(related_idents)
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
911401
def batch_fetch_labels(ids):
    
    m = {}
    for id in ids:
        label = anyont_fetch_label(id)
        if label is not None:
            m[id] = label
    return m
601023
def info(self, id, attributes=None):
        
        if attributes:
            return self.call('customer.info', [id, attributes])
        else:
            return self.call('customer.info', [id])
38926
def label_for(attribute)
      if object.class.respond_to?(:human_attribute_name)
        object.class.human_attribute_name(attribute)
      else
        attribute.to_s.humanize
      end
    end
647097
def add_label(self, name, color):
        """"""
        color_upper = color.upper()
        if not self._color_re.match(color_upper):
            raise ValueError('Invalid color: {}'.format(color))

        labels_tag = self.root[0]
        last_id = int(labels_tag[-1].get('id'))
        new_id = str(last_id + 1)

        new_label = etree.Element('label', id=new_id, color=color_upper)
        new_label.text = name

        labels_tag.append(new_label)
936223
protected function addLabelAttributes(array $attributes, $id)
    {
        $attributes = $this->addAttribute($attributes, 'for', $id);
        if (empty($id)) {
            $attributes = $this->addAttribute($attributes, 'class', $this->multiLabelClass);
        }
        return $attributes;
    }
1212164
def labels(self, labels):
        
        allowed_values = ["raw data", "documentation", "visualization", "clean data", "script", "report"]
        if not set(labels).issubset(set(allowed_values)):
            raise ValueError(
                "Invalid values for `labels` [{0}], must be a subset of [{1}]"
                .format(", ".join(map(str, set(labels)-set(allowed_values))),
                        ", ".join(map(str, allowed_values)))
            )

        self._labels = labels
1056104
def label_with_id(label_id, options = {})
        if options && options[:index] then
          elements = find_elements(:id, label_id.to_s)
          elements[options[:index].to_i - 1].text
          # label(:id => label_id.to_s, :index => options[:index]).text
        else
          find_element(:id, label_id.to_s).text
        end
      end
526933
def identification_field_factory(label, error_required):
    
    return forms.CharField(label=label,
                           widget=forms.TextInput(attrs=attrs_dict),
                           max_length=75,
                           error_messages={'required': error_required})