创建标签

        :param name: 标签名（30个字符以内）
        :return: 返回的 JSON 数据包
19691
def create(self, name):
        
        name = to_text(name)
        return self._post(
            'tags/create',
            data={'tag': {'name': name}},
            result_processor=lambda x: x['tag']
        )
950945
def get_type_data(name):
    
    name = name.upper()
    try:
        return {
            'authority': 'okapia.net',
            'namespace': 'TextFormats',
            'identifier': name,
            'domain': 'DisplayText Formats',
            'display_name': FORMAT_TYPES[name] + ' Format Type',
            'display_label': FORMAT_TYPES[name],
            'description': ('The display text format type for the ' +
                            FORMAT_TYPES[name] + ' format.')
        }
    except KeyError:
        raise NotFound('Format Type:' + name)
94682
def name(self, name):
        
        if name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")
        if name is not None and len(name) > 128:
            raise ValueError("Invalid value for `name`, length must be less than or equal to `128`")
        if name is not None and len(name) < 1:
            raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`")
        if name is not None and not re.search('^[^\/]+$', name):
            raise ValueError("Invalid value for `name`, must be a follow pattern or equal to `/^[^\/]+$/`")

        self._name = name
183797
def _parse_connection_name(self, name):
        
        if name is None:
            name = self.get_default_connection()

        if name.endswith(('::read', '::write')):
            return name.split('::', 1)

        return name, None
1011261
def get(self, name: str, default: Any = None) -> np.ndarray:
		
		if name in self:
			return self[name]
		else:
			return default
358779
def _repr_name(self):
        
        names = {"name", "attrname"}
        if all(name not in self._astroid_fields for name in names):
            return getattr(self, "name", getattr(self, "attrname", ""))
        return ""
1272818
def name(self, name=None):
        ''''''
        if name:
            self._name = name
            return self
        return self._name
776339
def to_json(self):
        

        result = super(Environment, self).to_json()
        result.update({
            'name': self.name
        })

        return result
769205
def _read_name_file(self, filename):
        
        file_path = os.path.join(self._DATA_DIR, filename)
        with open(file_path) as f:
            names = json.load(f)

        return names
1237724
def jsonobjkeys(self, name, path=Path.rootPath()):
        
        return self.execute_command('JSON.OBJKEYS', name, str_path(path))
184615
public JsonArray getJsonArray(String name) throws JsonException {
        JsonElement el = get(name);
        if (!el.isJsonArray()) {
            throw Util.typeMismatch(name, el, "JsonArray");
        }
        return el.asJsonArray();
    }
275760
public String getString(String name) throws JSONException {
		Object object = get(name);
		String result = JSON.toString(object);
		if (result == null) {
			throw JSON.typeMismatch(name, object, "String");
		}
		return result;
	}
838168
def request_name(self, name):
        

        while name in self._blacklist:
            name += "_"
        self._blacklist.add(name)
        return name
237520
def json_data(self, name):
        

        # Check the write permission of the context
        # XXX: This should be done on field level by the field manager adapter
        if not self.can_write():
            raise Unauthorized("You are not allowed to modify this content")

        # fetch the field by name
        field = api.get_field(self.context, name)

        # bail out if we have no field
        if not field:
            return None

        fieldmanager = IFieldManager(field)
        return fieldmanager.json_data(self.context)
281926
def getbyname(self, name):
        
        if name not in self._schbyname:
            raise KeyError('name {0} not registered'.format(name))

        return self._schbyname[name]
211194
def _create_json(self):
        
        data_json = {
            "name": self.name,
            "description": self.description,
            "autoJoin": self.autoJoin,
            "realm": self.realm,
        }
        return data_json
528032
def _meta_name(self, name):
        
        name = name.upper().replace('-', '_')
        if name not in self.UNPREFIXED_HEADERS:
            name = 'HTTP_' + name
        return name