partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
import_string
Stolen approximately from django. Import a dotted module path and return the attribute/class designated by the last name in the path. Raise ImportError if the import fails.
pydantic/utils.py
def import_string(dotted_path: str) -> Any: """ Stolen approximately from django. Import a dotted module path and return the attribute/class designated by the last name in the path. Raise ImportError if the import fails. """ try: module_path, class_name = dotted_path.strip(' ').rsplit('.', 1...
def import_string(dotted_path: str) -> Any: """ Stolen approximately from django. Import a dotted module path and return the attribute/class designated by the last name in the path. Raise ImportError if the import fails. """ try: module_path, class_name = dotted_path.strip(' ').rsplit('.', 1...
[ "Stolen", "approximately", "from", "django", ".", "Import", "a", "dotted", "module", "path", "and", "return", "the", "attribute", "/", "class", "designated", "by", "the", "last", "name", "in", "the", "path", ".", "Raise", "ImportError", "if", "the", "import"...
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/utils.py#L120-L134
[ "def", "import_string", "(", "dotted_path", ":", "str", ")", "->", "Any", ":", "try", ":", "module_path", ",", "class_name", "=", "dotted_path", ".", "strip", "(", "' '", ")", ".", "rsplit", "(", "'.'", ",", "1", ")", "except", "ValueError", "as", "e",...
bff8a1789dfde2c38928cced6640887b53615aa3
train
truncate
Truncate a value and add a unicode ellipsis (three dots) to the end if it was too long
pydantic/utils.py
def truncate(v: str, *, max_len: int = 80) -> str: """ Truncate a value and add a unicode ellipsis (three dots) to the end if it was too long """ if isinstance(v, str) and len(v) > (max_len - 2): # -3 so quote + string + … + quote has correct length return repr(v[: (max_len - 3)] + '…') ...
def truncate(v: str, *, max_len: int = 80) -> str: """ Truncate a value and add a unicode ellipsis (three dots) to the end if it was too long """ if isinstance(v, str) and len(v) > (max_len - 2): # -3 so quote + string + … + quote has correct length return repr(v[: (max_len - 3)] + '…') ...
[ "Truncate", "a", "value", "and", "add", "a", "unicode", "ellipsis", "(", "three", "dots", ")", "to", "the", "end", "if", "it", "was", "too", "long" ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/utils.py#L137-L147
[ "def", "truncate", "(", "v", ":", "str", ",", "*", ",", "max_len", ":", "int", "=", "80", ")", "->", "str", ":", "if", "isinstance", "(", "v", ",", "str", ")", "and", "len", "(", "v", ")", ">", "(", "max_len", "-", "2", ")", ":", "# -3 so quo...
bff8a1789dfde2c38928cced6640887b53615aa3
train
validate_field_name
Ensure that the field's name does not shadow an existing attribute of the model.
pydantic/utils.py
def validate_field_name(bases: List[Type['BaseModel']], field_name: str) -> None: """ Ensure that the field's name does not shadow an existing attribute of the model. """ for base in bases: if getattr(base, field_name, None): raise NameError( f'Field name "{field_name...
def validate_field_name(bases: List[Type['BaseModel']], field_name: str) -> None: """ Ensure that the field's name does not shadow an existing attribute of the model. """ for base in bases: if getattr(base, field_name, None): raise NameError( f'Field name "{field_name...
[ "Ensure", "that", "the", "field", "s", "name", "does", "not", "shadow", "an", "existing", "attribute", "of", "the", "model", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/utils.py#L188-L197
[ "def", "validate_field_name", "(", "bases", ":", "List", "[", "Type", "[", "'BaseModel'", "]", "]", ",", "field_name", ":", "str", ")", "->", "None", ":", "for", "base", "in", "bases", ":", "if", "getattr", "(", "base", ",", "field_name", ",", "None", ...
bff8a1789dfde2c38928cced6640887b53615aa3
train
url_regex_generator
Url regex generator taken from Marshmallow library, for details please follow library source code: https://github.com/marshmallow-code/marshmallow/blob/298870ef6c089fb4d91efae9ca4168453ffe00d2/marshmallow/validate.py#L37
pydantic/utils.py
def url_regex_generator(*, relative: bool, require_tld: bool) -> Pattern[str]: """ Url regex generator taken from Marshmallow library, for details please follow library source code: https://github.com/marshmallow-code/marshmallow/blob/298870ef6c089fb4d91efae9ca4168453ffe00d2/marshmallow/validate.py#...
def url_regex_generator(*, relative: bool, require_tld: bool) -> Pattern[str]: """ Url regex generator taken from Marshmallow library, for details please follow library source code: https://github.com/marshmallow-code/marshmallow/blob/298870ef6c089fb4d91efae9ca4168453ffe00d2/marshmallow/validate.py#...
[ "Url", "regex", "generator", "taken", "from", "Marshmallow", "library", "for", "details", "please", "follow", "library", "source", "code", ":", "https", ":", "//", "github", ".", "com", "/", "marshmallow", "-", "code", "/", "marshmallow", "/", "blob", "/", ...
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/utils.py#L201-L228
[ "def", "url_regex_generator", "(", "*", ",", "relative", ":", "bool", ",", "require_tld", ":", "bool", ")", "->", "Pattern", "[", "str", "]", ":", "return", "re", ".", "compile", "(", "r''", ".", "join", "(", "(", "r'^'", ",", "r'('", "if", "relative...
bff8a1789dfde2c38928cced6640887b53615aa3
train
resolve_annotations
Partially taken from typing.get_type_hints. Resolve string or ForwardRef annotations into type objects if possible.
pydantic/utils.py
def resolve_annotations(raw_annotations: Dict[str, AnyType], module_name: Optional[str]) -> Dict[str, AnyType]: """ Partially taken from typing.get_type_hints. Resolve string or ForwardRef annotations into type objects if possible. """ if module_name: base_globals: Optional[Dict[str, Any]] ...
def resolve_annotations(raw_annotations: Dict[str, AnyType], module_name: Optional[str]) -> Dict[str, AnyType]: """ Partially taken from typing.get_type_hints. Resolve string or ForwardRef annotations into type objects if possible. """ if module_name: base_globals: Optional[Dict[str, Any]] ...
[ "Partially", "taken", "from", "typing", ".", "get_type_hints", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/utils.py#L247-L267
[ "def", "resolve_annotations", "(", "raw_annotations", ":", "Dict", "[", "str", ",", "AnyType", "]", ",", "module_name", ":", "Optional", "[", "str", "]", ")", "->", "Dict", "[", "str", ",", "AnyType", "]", ":", "if", "module_name", ":", "base_globals", "...
bff8a1789dfde2c38928cced6640887b53615aa3
train
update_field_forward_refs
Try to update ForwardRefs on fields based on this Field, globalns and localns.
pydantic/utils.py
def update_field_forward_refs(field: 'Field', globalns: Any, localns: Any) -> None: """ Try to update ForwardRefs on fields based on this Field, globalns and localns. """ if type(field.type_) == ForwardRef: field.type_ = field.type_._evaluate(globalns, localns or None) # type: ignore fi...
def update_field_forward_refs(field: 'Field', globalns: Any, localns: Any) -> None: """ Try to update ForwardRefs on fields based on this Field, globalns and localns. """ if type(field.type_) == ForwardRef: field.type_ = field.type_._evaluate(globalns, localns or None) # type: ignore fi...
[ "Try", "to", "update", "ForwardRefs", "on", "fields", "based", "on", "this", "Field", "globalns", "and", "localns", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/utils.py#L282-L291
[ "def", "update_field_forward_refs", "(", "field", ":", "'Field'", ",", "globalns", ":", "Any", ",", "localns", ":", "Any", ")", "->", "None", ":", "if", "type", "(", "field", ".", "type_", ")", "==", "ForwardRef", ":", "field", ".", "type_", "=", "fiel...
bff8a1789dfde2c38928cced6640887b53615aa3
train
ip_v4_network_validator
Assume IPv4Network initialised with a default ``strict`` argument See more: https://docs.python.org/library/ipaddress.html#ipaddress.IPv4Network
pydantic/validators.py
def ip_v4_network_validator(v: Any) -> IPv4Network: """ Assume IPv4Network initialised with a default ``strict`` argument See more: https://docs.python.org/library/ipaddress.html#ipaddress.IPv4Network """ if isinstance(v, IPv4Network): return v with change_exception(errors.IPv4Netw...
def ip_v4_network_validator(v: Any) -> IPv4Network: """ Assume IPv4Network initialised with a default ``strict`` argument See more: https://docs.python.org/library/ipaddress.html#ipaddress.IPv4Network """ if isinstance(v, IPv4Network): return v with change_exception(errors.IPv4Netw...
[ "Assume", "IPv4Network", "initialised", "with", "a", "default", "strict", "argument" ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/validators.py#L238-L249
[ "def", "ip_v4_network_validator", "(", "v", ":", "Any", ")", "->", "IPv4Network", ":", "if", "isinstance", "(", "v", ",", "IPv4Network", ")", ":", "return", "v", "with", "change_exception", "(", "errors", ".", "IPv4NetworkError", ",", "ValueError", ")", ":",...
bff8a1789dfde2c38928cced6640887b53615aa3
train
ip_v6_network_validator
Assume IPv6Network initialised with a default ``strict`` argument See more: https://docs.python.org/library/ipaddress.html#ipaddress.IPv6Network
pydantic/validators.py
def ip_v6_network_validator(v: Any) -> IPv6Network: """ Assume IPv6Network initialised with a default ``strict`` argument See more: https://docs.python.org/library/ipaddress.html#ipaddress.IPv6Network """ if isinstance(v, IPv6Network): return v with change_exception(errors.IPv6Netw...
def ip_v6_network_validator(v: Any) -> IPv6Network: """ Assume IPv6Network initialised with a default ``strict`` argument See more: https://docs.python.org/library/ipaddress.html#ipaddress.IPv6Network """ if isinstance(v, IPv6Network): return v with change_exception(errors.IPv6Netw...
[ "Assume", "IPv6Network", "initialised", "with", "a", "default", "strict", "argument" ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/validators.py#L252-L263
[ "def", "ip_v6_network_validator", "(", "v", ":", "Any", ")", "->", "IPv6Network", ":", "if", "isinstance", "(", "v", ",", "IPv6Network", ")", ":", "return", "v", "with", "change_exception", "(", "errors", ".", "IPv6NetworkError", ",", "ValueError", ")", ":",...
bff8a1789dfde2c38928cced6640887b53615aa3
train
callable_validator
Perform a simple check if the value is callable. Note: complete matching of argument type hints and return types is not performed
pydantic/validators.py
def callable_validator(v: Any) -> AnyCallable: """ Perform a simple check if the value is callable. Note: complete matching of argument type hints and return types is not performed """ if callable(v): return v raise errors.CallableError(value=v)
def callable_validator(v: Any) -> AnyCallable: """ Perform a simple check if the value is callable. Note: complete matching of argument type hints and return types is not performed """ if callable(v): return v raise errors.CallableError(value=v)
[ "Perform", "a", "simple", "check", "if", "the", "value", "is", "callable", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/validators.py#L297-L306
[ "def", "callable_validator", "(", "v", ":", "Any", ")", "->", "AnyCallable", ":", "if", "callable", "(", "v", ")", ":", "return", "v", "raise", "errors", ".", "CallableError", "(", "value", "=", "v", ")" ]
bff8a1789dfde2c38928cced6640887b53615aa3
train
BaseSettings._build_environ
Build environment variables suitable for passing to the Model.
pydantic/env_settings.py
def _build_environ(self) -> Dict[str, Optional[str]]: """ Build environment variables suitable for passing to the Model. """ d: Dict[str, Optional[str]] = {} if self.__config__.case_insensitive: env_vars = {k.lower(): v for k, v in os.environ.items()} else: ...
def _build_environ(self) -> Dict[str, Optional[str]]: """ Build environment variables suitable for passing to the Model. """ d: Dict[str, Optional[str]] = {} if self.__config__.case_insensitive: env_vars = {k.lower(): v for k, v in os.environ.items()} else: ...
[ "Build", "environment", "variables", "suitable", "for", "passing", "to", "the", "Model", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/env_settings.py#L29-L56
[ "def", "_build_environ", "(", "self", ")", "->", "Dict", "[", "str", ",", "Optional", "[", "str", "]", "]", ":", "d", ":", "Dict", "[", "str", ",", "Optional", "[", "str", "]", "]", "=", "{", "}", "if", "self", ".", "__config__", ".", "case_insen...
bff8a1789dfde2c38928cced6640887b53615aa3
train
validator
Decorate methods on the class indicating that they should be used to validate fields :param fields: which field(s) the method should be called on :param pre: whether or not this validator should be called before the standard validators (else after) :param whole: for complex objects (sets, lists etc.) whethe...
pydantic/class_validators.py
def validator( *fields: str, pre: bool = False, whole: bool = False, always: bool = False, check_fields: bool = True ) -> Callable[[AnyCallable], classmethod]: """ Decorate methods on the class indicating that they should be used to validate fields :param fields: which field(s) the method should be call...
def validator( *fields: str, pre: bool = False, whole: bool = False, always: bool = False, check_fields: bool = True ) -> Callable[[AnyCallable], classmethod]: """ Decorate methods on the class indicating that they should be used to validate fields :param fields: which field(s) the method should be call...
[ "Decorate", "methods", "on", "the", "class", "indicating", "that", "they", "should", "be", "used", "to", "validate", "fields", ":", "param", "fields", ":", "which", "field", "(", "s", ")", "the", "method", "should", "be", "called", "on", ":", "param", "p...
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/class_validators.py#L32-L63
[ "def", "validator", "(", "*", "fields", ":", "str", ",", "pre", ":", "bool", "=", "False", ",", "whole", ":", "bool", "=", "False", ",", "always", ":", "bool", "=", "False", ",", "check_fields", ":", "bool", "=", "True", ")", "->", "Callable", "[",...
bff8a1789dfde2c38928cced6640887b53615aa3
train
make_generic_validator
Make a generic function which calls a validator with the right arguments. Unfortunately other approaches (eg. return a partial of a function that builds the arguments) is slow, hence this laborious way of doing things. It's done like this so validators don't all need **kwargs in their signature, eg. any c...
pydantic/class_validators.py
def make_generic_validator(validator: AnyCallable) -> 'ValidatorCallable': """ Make a generic function which calls a validator with the right arguments. Unfortunately other approaches (eg. return a partial of a function that builds the arguments) is slow, hence this laborious way of doing things. ...
def make_generic_validator(validator: AnyCallable) -> 'ValidatorCallable': """ Make a generic function which calls a validator with the right arguments. Unfortunately other approaches (eg. return a partial of a function that builds the arguments) is slow, hence this laborious way of doing things. ...
[ "Make", "a", "generic", "function", "which", "calls", "a", "validator", "with", "the", "right", "arguments", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/class_validators.py#L122-L145
[ "def", "make_generic_validator", "(", "validator", ":", "AnyCallable", ")", "->", "'ValidatorCallable'", ":", "sig", "=", "signature", "(", "validator", ")", "args", "=", "list", "(", "sig", ".", "parameters", ".", "keys", "(", ")", ")", "first_arg", "=", ...
bff8a1789dfde2c38928cced6640887b53615aa3
train
Field._validate_sequence_like
Validate sequence-like containers: lists, tuples, sets and generators
pydantic/fields.py
def _validate_sequence_like( self, v: Any, values: Dict[str, Any], loc: 'LocType', cls: Optional['ModelOrDc'] ) -> 'ValidateReturn': """ Validate sequence-like containers: lists, tuples, sets and generators """ if not sequence_like(v): e: errors_.PydanticTypeErro...
def _validate_sequence_like( self, v: Any, values: Dict[str, Any], loc: 'LocType', cls: Optional['ModelOrDc'] ) -> 'ValidateReturn': """ Validate sequence-like containers: lists, tuples, sets and generators """ if not sequence_like(v): e: errors_.PydanticTypeErro...
[ "Validate", "sequence", "-", "like", "containers", ":", "lists", "tuples", "sets", "and", "generators" ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/fields.py#L303-L344
[ "def", "_validate_sequence_like", "(", "self", ",", "v", ":", "Any", ",", "values", ":", "Dict", "[", "str", ",", "Any", "]", ",", "loc", ":", "'LocType'", ",", "cls", ":", "Optional", "[", "'ModelOrDc'", "]", ")", "->", "'ValidateReturn'", ":", "if", ...
bff8a1789dfde2c38928cced6640887b53615aa3
train
Field.is_complex
Whether the field is "complex" eg. env variables should be parsed as JSON.
pydantic/fields.py
def is_complex(self) -> bool: """ Whether the field is "complex" eg. env variables should be parsed as JSON. """ from .main import BaseModel # noqa: F811 return ( self.shape != Shape.SINGLETON or lenient_issubclass(self.type_, (BaseModel, list, set, dict...
def is_complex(self) -> bool: """ Whether the field is "complex" eg. env variables should be parsed as JSON. """ from .main import BaseModel # noqa: F811 return ( self.shape != Shape.SINGLETON or lenient_issubclass(self.type_, (BaseModel, list, set, dict...
[ "Whether", "the", "field", "is", "complex", "eg", ".", "env", "variables", "should", "be", "parsed", "as", "JSON", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/fields.py#L434-L444
[ "def", "is_complex", "(", "self", ")", "->", "bool", ":", "from", ".", "main", "import", "BaseModel", "# noqa: F811", "return", "(", "self", ".", "shape", "!=", "Shape", ".", "SINGLETON", "or", "lenient_issubclass", "(", "self", ".", "type_", ",", "(", "...
bff8a1789dfde2c38928cced6640887b53615aa3
train
schema
Process a list of models and generate a single JSON Schema with all of them defined in the ``definitions`` top-level JSON key, including their sub-models. :param models: a list of models to include in the generated JSON Schema :param by_alias: generate the schemas using the aliases defined, if any :par...
pydantic/schema.py
def schema( models: Sequence[Type['main.BaseModel']], *, by_alias: bool = True, title: Optional[str] = None, description: Optional[str] = None, ref_prefix: Optional[str] = None, ) -> Dict[str, Any]: """ Process a list of models and generate a single JSON Schema with all of them defined i...
def schema( models: Sequence[Type['main.BaseModel']], *, by_alias: bool = True, title: Optional[str] = None, description: Optional[str] = None, ref_prefix: Optional[str] = None, ) -> Dict[str, Any]: """ Process a list of models and generate a single JSON Schema with all of them defined i...
[ "Process", "a", "list", "of", "models", "and", "generate", "a", "single", "JSON", "Schema", "with", "all", "of", "them", "defined", "in", "the", "definitions", "top", "-", "level", "JSON", "key", "including", "their", "sub", "-", "models", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L144-L186
[ "def", "schema", "(", "models", ":", "Sequence", "[", "Type", "[", "'main.BaseModel'", "]", "]", ",", "*", ",", "by_alias", ":", "bool", "=", "True", ",", "title", ":", "Optional", "[", "str", "]", "=", "None", ",", "description", ":", "Optional", "[...
bff8a1789dfde2c38928cced6640887b53615aa3
train
model_schema
Generate a JSON Schema for one model. With all the sub-models defined in the ``definitions`` top-level JSON key. :param model: a Pydantic model (a class that inherits from BaseModel) :param by_alias: generate the schemas using the aliases defined, if any :param ref_prefix: the JSON Pointer prefix for s...
pydantic/schema.py
def model_schema( model: Type['main.BaseModel'], by_alias: bool = True, ref_prefix: Optional[str] = None ) -> Dict[str, Any]: """ Generate a JSON Schema for one model. With all the sub-models defined in the ``definitions`` top-level JSON key. :param model: a Pydantic model (a class that inherits fr...
def model_schema( model: Type['main.BaseModel'], by_alias: bool = True, ref_prefix: Optional[str] = None ) -> Dict[str, Any]: """ Generate a JSON Schema for one model. With all the sub-models defined in the ``definitions`` top-level JSON key. :param model: a Pydantic model (a class that inherits fr...
[ "Generate", "a", "JSON", "Schema", "for", "one", "model", ".", "With", "all", "the", "sub", "-", "models", "defined", "in", "the", "definitions", "top", "-", "level", "JSON", "key", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L189-L213
[ "def", "model_schema", "(", "model", ":", "Type", "[", "'main.BaseModel'", "]", ",", "by_alias", ":", "bool", "=", "True", ",", "ref_prefix", ":", "Optional", "[", "str", "]", "=", "None", ")", "->", "Dict", "[", "str", ",", "Any", "]", ":", "ref_pre...
bff8a1789dfde2c38928cced6640887b53615aa3
train
field_schema
Process a Pydantic field and return a tuple with a JSON Schema for it as the first item. Also return a dictionary of definitions with models as keys and their schemas as values. If the passed field is a model and has sub-models, and those sub-models don't have overrides (as ``title``, ``default``, etc), they ...
pydantic/schema.py
def field_schema( field: Field, *, by_alias: bool = True, model_name_map: Dict[Type['main.BaseModel'], str], ref_prefix: Optional[str] = None, ) -> Tuple[Dict[str, Any], Dict[str, Any]]: """ Process a Pydantic field and return a tuple with a JSON Schema for it as the first item. Also ret...
def field_schema( field: Field, *, by_alias: bool = True, model_name_map: Dict[Type['main.BaseModel'], str], ref_prefix: Optional[str] = None, ) -> Tuple[Dict[str, Any], Dict[str, Any]]: """ Process a Pydantic field and return a tuple with a JSON Schema for it as the first item. Also ret...
[ "Process", "a", "Pydantic", "field", "and", "return", "a", "tuple", "with", "a", "JSON", "Schema", "for", "it", "as", "the", "first", "item", ".", "Also", "return", "a", "dictionary", "of", "definitions", "with", "models", "as", "keys", "and", "their", "...
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L216-L268
[ "def", "field_schema", "(", "field", ":", "Field", ",", "*", ",", "by_alias", ":", "bool", "=", "True", ",", "model_name_map", ":", "Dict", "[", "Type", "[", "'main.BaseModel'", "]", ",", "str", "]", ",", "ref_prefix", ":", "Optional", "[", "str", "]",...
bff8a1789dfde2c38928cced6640887b53615aa3
train
get_field_schema_validations
Get the JSON Schema validation keywords for a ``field`` with an annotation of a Pydantic ``Schema`` with validation arguments.
pydantic/schema.py
def get_field_schema_validations(field: Field) -> Dict[str, Any]: """ Get the JSON Schema validation keywords for a ``field`` with an annotation of a Pydantic ``Schema`` with validation arguments. """ f_schema: Dict[str, Any] = {} if lenient_issubclass(field.type_, (str, bytes)): for att...
def get_field_schema_validations(field: Field) -> Dict[str, Any]: """ Get the JSON Schema validation keywords for a ``field`` with an annotation of a Pydantic ``Schema`` with validation arguments. """ f_schema: Dict[str, Any] = {} if lenient_issubclass(field.type_, (str, bytes)): for att...
[ "Get", "the", "JSON", "Schema", "validation", "keywords", "for", "a", "field", "with", "an", "annotation", "of", "a", "Pydantic", "Schema", "with", "validation", "arguments", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L287-L306
[ "def", "get_field_schema_validations", "(", "field", ":", "Field", ")", "->", "Dict", "[", "str", ",", "Any", "]", ":", "f_schema", ":", "Dict", "[", "str", ",", "Any", "]", "=", "{", "}", "if", "lenient_issubclass", "(", "field", ".", "type_", ",", ...
bff8a1789dfde2c38928cced6640887b53615aa3
train
get_model_name_map
Process a set of models and generate unique names for them to be used as keys in the JSON Schema definitions. By default the names are the same as the class name. But if two models in different Python modules have the same name (e.g. "users.Model" and "items.Model"), the generated names will be based on the...
pydantic/schema.py
def get_model_name_map(unique_models: Set[Type['main.BaseModel']]) -> Dict[Type['main.BaseModel'], str]: """ Process a set of models and generate unique names for them to be used as keys in the JSON Schema definitions. By default the names are the same as the class name. But if two models in different Pytho...
def get_model_name_map(unique_models: Set[Type['main.BaseModel']]) -> Dict[Type['main.BaseModel'], str]: """ Process a set of models and generate unique names for them to be used as keys in the JSON Schema definitions. By default the names are the same as the class name. But if two models in different Pytho...
[ "Process", "a", "set", "of", "models", "and", "generate", "unique", "names", "for", "them", "to", "be", "used", "as", "keys", "in", "the", "JSON", "Schema", "definitions", ".", "By", "default", "the", "names", "are", "the", "same", "as", "the", "class", ...
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L309-L333
[ "def", "get_model_name_map", "(", "unique_models", ":", "Set", "[", "Type", "[", "'main.BaseModel'", "]", "]", ")", "->", "Dict", "[", "Type", "[", "'main.BaseModel'", "]", ",", "str", "]", ":", "name_model_map", "=", "{", "}", "conflicting_names", ":", "S...
bff8a1789dfde2c38928cced6640887b53615aa3
train
get_flat_models_from_model
Take a single ``model`` and generate a set with itself and all the sub-models in the tree. I.e. if you pass model ``Foo`` (subclass of Pydantic ``BaseModel``) as ``model``, and it has a field of type ``Bar`` (also subclass of ``BaseModel``) and that model ``Bar`` has a field of type ``Baz`` (also subclass of ``...
pydantic/schema.py
def get_flat_models_from_model(model: Type['main.BaseModel']) -> Set[Type['main.BaseModel']]: """ Take a single ``model`` and generate a set with itself and all the sub-models in the tree. I.e. if you pass model ``Foo`` (subclass of Pydantic ``BaseModel``) as ``model``, and it has a field of type ``Bar`` (a...
def get_flat_models_from_model(model: Type['main.BaseModel']) -> Set[Type['main.BaseModel']]: """ Take a single ``model`` and generate a set with itself and all the sub-models in the tree. I.e. if you pass model ``Foo`` (subclass of Pydantic ``BaseModel``) as ``model``, and it has a field of type ``Bar`` (a...
[ "Take", "a", "single", "model", "and", "generate", "a", "set", "with", "itself", "and", "all", "the", "sub", "-", "models", "in", "the", "tree", ".", "I", ".", "e", ".", "if", "you", "pass", "model", "Foo", "(", "subclass", "of", "Pydantic", "BaseMod...
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L336-L350
[ "def", "get_flat_models_from_model", "(", "model", ":", "Type", "[", "'main.BaseModel'", "]", ")", "->", "Set", "[", "Type", "[", "'main.BaseModel'", "]", "]", ":", "flat_models", ":", "Set", "[", "Type", "[", "'main.BaseModel'", "]", "]", "=", "set", "(",...
bff8a1789dfde2c38928cced6640887b53615aa3
train
get_flat_models_from_field
Take a single Pydantic ``Field`` (from a model) that could have been declared as a sublcass of BaseModel (so, it could be a submodel), and generate a set with its model and all the sub-models in the tree. I.e. if you pass a field that was declared to be of type ``Foo`` (subclass of BaseModel) as ``field``, and ...
pydantic/schema.py
def get_flat_models_from_field(field: Field) -> Set[Type['main.BaseModel']]: """ Take a single Pydantic ``Field`` (from a model) that could have been declared as a sublcass of BaseModel (so, it could be a submodel), and generate a set with its model and all the sub-models in the tree. I.e. if you pass a...
def get_flat_models_from_field(field: Field) -> Set[Type['main.BaseModel']]: """ Take a single Pydantic ``Field`` (from a model) that could have been declared as a sublcass of BaseModel (so, it could be a submodel), and generate a set with its model and all the sub-models in the tree. I.e. if you pass a...
[ "Take", "a", "single", "Pydantic", "Field", "(", "from", "a", "model", ")", "that", "could", "have", "been", "declared", "as", "a", "sublcass", "of", "BaseModel", "(", "so", "it", "could", "be", "a", "submodel", ")", "and", "generate", "a", "set", "wit...
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L353-L372
[ "def", "get_flat_models_from_field", "(", "field", ":", "Field", ")", "->", "Set", "[", "Type", "[", "'main.BaseModel'", "]", "]", ":", "flat_models", ":", "Set", "[", "Type", "[", "'main.BaseModel'", "]", "]", "=", "set", "(", ")", "if", "field", ".", ...
bff8a1789dfde2c38928cced6640887b53615aa3
train
get_flat_models_from_fields
Take a list of Pydantic ``Field``s (from a model) that could have been declared as sublcasses of ``BaseModel`` (so, any of them could be a submodel), and generate a set with their models and all the sub-models in the tree. I.e. if you pass a the fields of a model ``Foo`` (subclass of ``BaseModel``) as ``fields...
pydantic/schema.py
def get_flat_models_from_fields(fields: Sequence[Field]) -> Set[Type['main.BaseModel']]: """ Take a list of Pydantic ``Field``s (from a model) that could have been declared as sublcasses of ``BaseModel`` (so, any of them could be a submodel), and generate a set with their models and all the sub-models in t...
def get_flat_models_from_fields(fields: Sequence[Field]) -> Set[Type['main.BaseModel']]: """ Take a list of Pydantic ``Field``s (from a model) that could have been declared as sublcasses of ``BaseModel`` (so, any of them could be a submodel), and generate a set with their models and all the sub-models in t...
[ "Take", "a", "list", "of", "Pydantic", "Field", "s", "(", "from", "a", "model", ")", "that", "could", "have", "been", "declared", "as", "sublcasses", "of", "BaseModel", "(", "so", "any", "of", "them", "could", "be", "a", "submodel", ")", "and", "genera...
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L375-L389
[ "def", "get_flat_models_from_fields", "(", "fields", ":", "Sequence", "[", "Field", "]", ")", "->", "Set", "[", "Type", "[", "'main.BaseModel'", "]", "]", ":", "flat_models", ":", "Set", "[", "Type", "[", "'main.BaseModel'", "]", "]", "=", "set", "(", ")...
bff8a1789dfde2c38928cced6640887b53615aa3
train
get_flat_models_from_models
Take a list of ``models`` and generate a set with them and all their sub-models in their trees. I.e. if you pass a list of two models, ``Foo`` and ``Bar``, both subclasses of Pydantic ``BaseModel`` as models, and ``Bar`` has a field of type ``Baz`` (also subclass of ``BaseModel``), the return value will be ``se...
pydantic/schema.py
def get_flat_models_from_models(models: Sequence[Type['main.BaseModel']]) -> Set[Type['main.BaseModel']]: """ Take a list of ``models`` and generate a set with them and all their sub-models in their trees. I.e. if you pass a list of two models, ``Foo`` and ``Bar``, both subclasses of Pydantic ``BaseModel`` ...
def get_flat_models_from_models(models: Sequence[Type['main.BaseModel']]) -> Set[Type['main.BaseModel']]: """ Take a list of ``models`` and generate a set with them and all their sub-models in their trees. I.e. if you pass a list of two models, ``Foo`` and ``Bar``, both subclasses of Pydantic ``BaseModel`` ...
[ "Take", "a", "list", "of", "models", "and", "generate", "a", "set", "with", "them", "and", "all", "their", "sub", "-", "models", "in", "their", "trees", ".", "I", ".", "e", ".", "if", "you", "pass", "a", "list", "of", "two", "models", "Foo", "and",...
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L392-L401
[ "def", "get_flat_models_from_models", "(", "models", ":", "Sequence", "[", "Type", "[", "'main.BaseModel'", "]", "]", ")", "->", "Set", "[", "Type", "[", "'main.BaseModel'", "]", "]", ":", "flat_models", ":", "Set", "[", "Type", "[", "'main.BaseModel'", "]",...
bff8a1789dfde2c38928cced6640887b53615aa3
train
field_type_schema
Used by ``field_schema()``, you probably should be using that function. Take a single ``field`` and generate the schema for its type only, not including additional information as title, etc. Also return additional schema definitions, from sub-models.
pydantic/schema.py
def field_type_schema( field: Field, *, by_alias: bool, model_name_map: Dict[Type['main.BaseModel'], str], schema_overrides: bool = False, ref_prefix: Optional[str] = None, ) -> Tuple[Dict[str, Any], Dict[str, Any]]: """ Used by ``field_schema()``, you probably should be using that funct...
def field_type_schema( field: Field, *, by_alias: bool, model_name_map: Dict[Type['main.BaseModel'], str], schema_overrides: bool = False, ref_prefix: Optional[str] = None, ) -> Tuple[Dict[str, Any], Dict[str, Any]]: """ Used by ``field_schema()``, you probably should be using that funct...
[ "Used", "by", "field_schema", "()", "you", "probably", "should", "be", "using", "that", "function", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L408-L474
[ "def", "field_type_schema", "(", "field", ":", "Field", ",", "*", ",", "by_alias", ":", "bool", ",", "model_name_map", ":", "Dict", "[", "Type", "[", "'main.BaseModel'", "]", ",", "str", "]", ",", "schema_overrides", ":", "bool", "=", "False", ",", "ref_...
bff8a1789dfde2c38928cced6640887b53615aa3
train
model_process_schema
Used by ``model_schema()``, you probably should be using that function. Take a single ``model`` and generate its schema. Also return additional schema definitions, from sub-models. The sub-models of the returned schema will be referenced, but their definitions will not be included in the schema. All the de...
pydantic/schema.py
def model_process_schema( model: Type['main.BaseModel'], *, by_alias: bool = True, model_name_map: Dict[Type['main.BaseModel'], str], ref_prefix: Optional[str] = None, ) -> Tuple[Dict[str, Any], Dict[str, Any]]: """ Used by ``model_schema()``, you probably should be using that function. ...
def model_process_schema( model: Type['main.BaseModel'], *, by_alias: bool = True, model_name_map: Dict[Type['main.BaseModel'], str], ref_prefix: Optional[str] = None, ) -> Tuple[Dict[str, Any], Dict[str, Any]]: """ Used by ``model_schema()``, you probably should be using that function. ...
[ "Used", "by", "model_schema", "()", "you", "probably", "should", "be", "using", "that", "function", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L477-L499
[ "def", "model_process_schema", "(", "model", ":", "Type", "[", "'main.BaseModel'", "]", ",", "*", ",", "by_alias", ":", "bool", "=", "True", ",", "model_name_map", ":", "Dict", "[", "Type", "[", "'main.BaseModel'", "]", ",", "str", "]", ",", "ref_prefix", ...
bff8a1789dfde2c38928cced6640887b53615aa3
train
model_type_schema
You probably should be using ``model_schema()``, this function is indirectly used by that function. Take a single ``model`` and generate the schema for its type only, not including additional information as title, etc. Also return additional schema definitions, from sub-models.
pydantic/schema.py
def model_type_schema( model: Type['main.BaseModel'], *, by_alias: bool, model_name_map: Dict[Type['main.BaseModel'], str], ref_prefix: Optional[str] = None, ) -> Tuple[Dict[str, Any], Dict[str, Any]]: """ You probably should be using ``model_schema()``, this function is indirectly used by t...
def model_type_schema( model: Type['main.BaseModel'], *, by_alias: bool, model_name_map: Dict[Type['main.BaseModel'], str], ref_prefix: Optional[str] = None, ) -> Tuple[Dict[str, Any], Dict[str, Any]]: """ You probably should be using ``model_schema()``, this function is indirectly used by t...
[ "You", "probably", "should", "be", "using", "model_schema", "()", "this", "function", "is", "indirectly", "used", "by", "that", "function", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L502-L539
[ "def", "model_type_schema", "(", "model", ":", "Type", "[", "'main.BaseModel'", "]", ",", "*", ",", "by_alias", ":", "bool", ",", "model_name_map", ":", "Dict", "[", "Type", "[", "'main.BaseModel'", "]", ",", "str", "]", ",", "ref_prefix", ":", "Optional",...
bff8a1789dfde2c38928cced6640887b53615aa3
train
field_singleton_sub_fields_schema
This function is indirectly used by ``field_schema()``, you probably should be using that function. Take a list of Pydantic ``Field`` from the declaration of a type with parameters, and generate their schema. I.e., fields used as "type parameters", like ``str`` and ``int`` in ``Tuple[str, int]``.
pydantic/schema.py
def field_singleton_sub_fields_schema( sub_fields: Sequence[Field], *, by_alias: bool, model_name_map: Dict[Type['main.BaseModel'], str], schema_overrides: bool = False, ref_prefix: Optional[str] = None, ) -> Tuple[Dict[str, Any], Dict[str, Any]]: """ This function is indirectly used by ...
def field_singleton_sub_fields_schema( sub_fields: Sequence[Field], *, by_alias: bool, model_name_map: Dict[Type['main.BaseModel'], str], schema_overrides: bool = False, ref_prefix: Optional[str] = None, ) -> Tuple[Dict[str, Any], Dict[str, Any]]: """ This function is indirectly used by ...
[ "This", "function", "is", "indirectly", "used", "by", "field_schema", "()", "you", "probably", "should", "be", "using", "that", "function", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L542-L579
[ "def", "field_singleton_sub_fields_schema", "(", "sub_fields", ":", "Sequence", "[", "Field", "]", ",", "*", ",", "by_alias", ":", "bool", ",", "model_name_map", ":", "Dict", "[", "Type", "[", "'main.BaseModel'", "]", ",", "str", "]", ",", "schema_overrides", ...
bff8a1789dfde2c38928cced6640887b53615aa3
train
field_singleton_schema
This function is indirectly used by ``field_schema()``, you should probably be using that function. Take a single Pydantic ``Field``, and return its schema and any additional definitions from sub-models.
pydantic/schema.py
def field_singleton_schema( # noqa: C901 (ignore complexity) field: Field, *, by_alias: bool, model_name_map: Dict[Type['main.BaseModel'], str], schema_overrides: bool = False, ref_prefix: Optional[str] = None, ) -> Tuple[Dict[str, Any], Dict[str, Any]]: """ This function is indirectly ...
def field_singleton_schema( # noqa: C901 (ignore complexity) field: Field, *, by_alias: bool, model_name_map: Dict[Type['main.BaseModel'], str], schema_overrides: bool = False, ref_prefix: Optional[str] = None, ) -> Tuple[Dict[str, Any], Dict[str, Any]]: """ This function is indirectly ...
[ "This", "function", "is", "indirectly", "used", "by", "field_schema", "()", "you", "should", "probably", "be", "using", "that", "function", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L632-L696
[ "def", "field_singleton_schema", "(", "# noqa: C901 (ignore complexity)", "field", ":", "Field", ",", "*", ",", "by_alias", ":", "bool", ",", "model_name_map", ":", "Dict", "[", "Type", "[", "'main.BaseModel'", "]", ",", "str", "]", ",", "schema_overrides", ":",...
bff8a1789dfde2c38928cced6640887b53615aa3
train
get_annotation_from_schema
Get an annotation with validation implemented for numbers and strings based on the schema. :param annotation: an annotation from a field specification, as ``str``, ``ConstrainedStr`` :param schema: an instance of Schema, possibly with declarations for validations and JSON Schema :return: the same ``annotat...
pydantic/schema.py
def get_annotation_from_schema(annotation: Any, schema: Schema) -> Type[Any]: """ Get an annotation with validation implemented for numbers and strings based on the schema. :param annotation: an annotation from a field specification, as ``str``, ``ConstrainedStr`` :param schema: an instance of Schema, ...
def get_annotation_from_schema(annotation: Any, schema: Schema) -> Type[Any]: """ Get an annotation with validation implemented for numbers and strings based on the schema. :param annotation: an annotation from a field specification, as ``str``, ``ConstrainedStr`` :param schema: an instance of Schema, ...
[ "Get", "an", "annotation", "with", "validation", "implemented", "for", "numbers", "and", "strings", "based", "on", "the", "schema", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/schema.py#L714-L745
[ "def", "get_annotation_from_schema", "(", "annotation", ":", "Any", ",", "schema", ":", "Schema", ")", "->", "Type", "[", "Any", "]", ":", "if", "isinstance", "(", "annotation", ",", "type", ")", ":", "attrs", ":", "Optional", "[", "Tuple", "[", "str", ...
bff8a1789dfde2c38928cced6640887b53615aa3
train
create_model
Dynamically create a model. :param model_name: name of the created model :param __config__: config class to use for the new model :param __base__: base class for the new model to inherit from :param __validators__: a dict of method names and @validator class methods :param **field_definitions: field...
pydantic/main.py
def create_model( # noqa: C901 (ignore complexity) model_name: str, *, __config__: Type[BaseConfig] = None, __base__: Type[BaseModel] = None, __module__: Optional[str] = None, __validators__: Dict[str, classmethod] = None, **field_definitions: Any, ) -> BaseModel: """ Dynamically cr...
def create_model( # noqa: C901 (ignore complexity) model_name: str, *, __config__: Type[BaseConfig] = None, __base__: Type[BaseModel] = None, __module__: Optional[str] = None, __validators__: Dict[str, classmethod] = None, **field_definitions: Any, ) -> BaseModel: """ Dynamically cr...
[ "Dynamically", "create", "a", "model", ".", ":", "param", "model_name", ":", "name", "of", "the", "created", "model", ":", "param", "__config__", ":", "config", "class", "to", "use", "for", "the", "new", "model", ":", "param", "__base__", ":", "base", "c...
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/main.py#L521-L574
[ "def", "create_model", "(", "# noqa: C901 (ignore complexity)", "model_name", ":", "str", ",", "*", ",", "__config__", ":", "Type", "[", "BaseConfig", "]", "=", "None", ",", "__base__", ":", "Type", "[", "BaseModel", "]", "=", "None", ",", "__module__", ":",...
bff8a1789dfde2c38928cced6640887b53615aa3
train
validate_model
validate data against a model.
pydantic/main.py
def validate_model( # noqa: C901 (ignore complexity) model: Union[BaseModel, Type[BaseModel]], input_data: 'DictStrAny', raise_exc: bool = True, cls: 'ModelOrDc' = None ) -> Union['DictStrAny', Tuple['DictStrAny', Optional[ValidationError]]]: """ validate data against a model. """ values = {} e...
def validate_model( # noqa: C901 (ignore complexity) model: Union[BaseModel, Type[BaseModel]], input_data: 'DictStrAny', raise_exc: bool = True, cls: 'ModelOrDc' = None ) -> Union['DictStrAny', Tuple['DictStrAny', Optional[ValidationError]]]: """ validate data against a model. """ values = {} e...
[ "validate", "data", "against", "a", "model", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/main.py#L577-L636
[ "def", "validate_model", "(", "# noqa: C901 (ignore complexity)", "model", ":", "Union", "[", "BaseModel", ",", "Type", "[", "BaseModel", "]", "]", ",", "input_data", ":", "'DictStrAny'", ",", "raise_exc", ":", "bool", "=", "True", ",", "cls", ":", "'ModelOrDc...
bff8a1789dfde2c38928cced6640887b53615aa3
train
BaseModel.dict
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
pydantic/main.py
def dict( self, *, include: 'SetStr' = None, exclude: 'SetStr' = None, by_alias: bool = False, skip_defaults: bool = False ) -> 'DictStrAny': """ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. """ get_key = self._g...
def dict( self, *, include: 'SetStr' = None, exclude: 'SetStr' = None, by_alias: bool = False, skip_defaults: bool = False ) -> 'DictStrAny': """ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. """ get_key = self._g...
[ "Generate", "a", "dictionary", "representation", "of", "the", "model", "optionally", "specifying", "which", "fields", "to", "include", "or", "exclude", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/main.py#L273-L288
[ "def", "dict", "(", "self", ",", "*", ",", "include", ":", "'SetStr'", "=", "None", ",", "exclude", ":", "'SetStr'", "=", "None", ",", "by_alias", ":", "bool", "=", "False", ",", "skip_defaults", ":", "bool", "=", "False", ")", "->", "'DictStrAny'", ...
bff8a1789dfde2c38928cced6640887b53615aa3
train
BaseModel.json
Generate a JSON representation of the model, `include` and `exclude` arguments as per `dict()`. `encoder` is an optional function to supply as `default` to json.dumps(), other arguments as per `json.dumps()`.
pydantic/main.py
def json( self, *, include: 'SetStr' = None, exclude: 'SetStr' = None, by_alias: bool = False, skip_defaults: bool = False, encoder: Optional[Callable[[Any], Any]] = None, **dumps_kwargs: Any, ) -> str: """ Generate a JSON representatio...
def json( self, *, include: 'SetStr' = None, exclude: 'SetStr' = None, by_alias: bool = False, skip_defaults: bool = False, encoder: Optional[Callable[[Any], Any]] = None, **dumps_kwargs: Any, ) -> str: """ Generate a JSON representatio...
[ "Generate", "a", "JSON", "representation", "of", "the", "model", "include", "and", "exclude", "arguments", "as", "per", "dict", "()", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/main.py#L296-L316
[ "def", "json", "(", "self", ",", "*", ",", "include", ":", "'SetStr'", "=", "None", ",", "exclude", ":", "'SetStr'", "=", "None", ",", "by_alias", ":", "bool", "=", "False", ",", "skip_defaults", ":", "bool", "=", "False", ",", "encoder", ":", "Optio...
bff8a1789dfde2c38928cced6640887b53615aa3
train
BaseModel.construct
Creates a new model and set __values__ without any validation, thus values should already be trusted. Chances are you don't want to use this method directly.
pydantic/main.py
def construct(cls: Type['Model'], values: 'DictAny', fields_set: 'SetStr') -> 'Model': """ Creates a new model and set __values__ without any validation, thus values should already be trusted. Chances are you don't want to use this method directly. """ m = cls.__new__(cls) ...
def construct(cls: Type['Model'], values: 'DictAny', fields_set: 'SetStr') -> 'Model': """ Creates a new model and set __values__ without any validation, thus values should already be trusted. Chances are you don't want to use this method directly. """ m = cls.__new__(cls) ...
[ "Creates", "a", "new", "model", "and", "set", "__values__", "without", "any", "validation", "thus", "values", "should", "already", "be", "trusted", ".", "Chances", "are", "you", "don", "t", "want", "to", "use", "this", "method", "directly", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/main.py#L360-L368
[ "def", "construct", "(", "cls", ":", "Type", "[", "'Model'", "]", ",", "values", ":", "'DictAny'", ",", "fields_set", ":", "'SetStr'", ")", "->", "'Model'", ":", "m", "=", "cls", ".", "__new__", "(", "cls", ")", "object", ".", "__setattr__", "(", "m"...
bff8a1789dfde2c38928cced6640887b53615aa3
train
BaseModel.copy
Duplicate a model, optionally choose which fields to include, exclude and change. :param include: fields to include in new model :param exclude: fields to exclude from new model, as with values this takes precedence over include :param update: values to change/add in the new model. Note: the da...
pydantic/main.py
def copy( self: 'Model', *, include: 'SetStr' = None, exclude: 'SetStr' = None, update: 'DictStrAny' = None, deep: bool = False, ) -> 'Model': """ Duplicate a model, optionally choose which fields to include, exclude and change. :param include...
def copy( self: 'Model', *, include: 'SetStr' = None, exclude: 'SetStr' = None, update: 'DictStrAny' = None, deep: bool = False, ) -> 'Model': """ Duplicate a model, optionally choose which fields to include, exclude and change. :param include...
[ "Duplicate", "a", "model", "optionally", "choose", "which", "fields", "to", "include", "exclude", "and", "change", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/main.py#L370-L401
[ "def", "copy", "(", "self", ":", "'Model'", ",", "*", ",", "include", ":", "'SetStr'", "=", "None", ",", "exclude", ":", "'SetStr'", "=", "None", ",", "update", ":", "'DictStrAny'", "=", "None", ",", "deep", ":", "bool", "=", "False", ",", ")", "->...
bff8a1789dfde2c38928cced6640887b53615aa3
train
BaseModel.update_forward_refs
Try to update ForwardRefs on fields based on this Model, globalns and localns.
pydantic/main.py
def update_forward_refs(cls, **localns: Any) -> None: """ Try to update ForwardRefs on fields based on this Model, globalns and localns. """ globalns = sys.modules[cls.__module__].__dict__ globalns.setdefault(cls.__name__, cls) for f in cls.__fields__.values(): ...
def update_forward_refs(cls, **localns: Any) -> None: """ Try to update ForwardRefs on fields based on this Model, globalns and localns. """ globalns = sys.modules[cls.__module__].__dict__ globalns.setdefault(cls.__name__, cls) for f in cls.__fields__.values(): ...
[ "Try", "to", "update", "ForwardRefs", "on", "fields", "based", "on", "this", "Model", "globalns", "and", "localns", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/main.py#L456-L463
[ "def", "update_forward_refs", "(", "cls", ",", "*", "*", "localns", ":", "Any", ")", "->", "None", ":", "globalns", "=", "sys", ".", "modules", "[", "cls", ".", "__module__", "]", ".", "__dict__", "globalns", ".", "setdefault", "(", "cls", ".", "__name...
bff8a1789dfde2c38928cced6640887b53615aa3
train
timedelta_isoformat
ISO 8601 encoding for timedeltas.
pydantic/json.py
def timedelta_isoformat(td: datetime.timedelta) -> str: """ ISO 8601 encoding for timedeltas. """ minutes, seconds = divmod(td.seconds, 60) hours, minutes = divmod(minutes, 60) return f'P{td.days}DT{hours:d}H{minutes:d}M{seconds:d}.{td.microseconds:06d}S'
def timedelta_isoformat(td: datetime.timedelta) -> str: """ ISO 8601 encoding for timedeltas. """ minutes, seconds = divmod(td.seconds, 60) hours, minutes = divmod(minutes, 60) return f'P{td.days}DT{hours:d}H{minutes:d}M{seconds:d}.{td.microseconds:06d}S'
[ "ISO", "8601", "encoding", "for", "timedeltas", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/json.py#L67-L73
[ "def", "timedelta_isoformat", "(", "td", ":", "datetime", ".", "timedelta", ")", "->", "str", ":", "minutes", ",", "seconds", "=", "divmod", "(", "td", ".", "seconds", ",", "60", ")", "hours", ",", "minutes", "=", "divmod", "(", "minutes", ",", "60", ...
bff8a1789dfde2c38928cced6640887b53615aa3
train
parse_date
Parse a date/int/float/string and return a datetime.date. Raise ValueError if the input is well formatted but not a valid date. Raise ValueError if the input isn't well formatted.
pydantic/datetime_parse.py
def parse_date(value: Union[date, StrIntFloat]) -> date: """ Parse a date/int/float/string and return a datetime.date. Raise ValueError if the input is well formatted but not a valid date. Raise ValueError if the input isn't well formatted. """ if isinstance(value, date): if isinstance(...
def parse_date(value: Union[date, StrIntFloat]) -> date: """ Parse a date/int/float/string and return a datetime.date. Raise ValueError if the input is well formatted but not a valid date. Raise ValueError if the input isn't well formatted. """ if isinstance(value, date): if isinstance(...
[ "Parse", "a", "date", "/", "int", "/", "float", "/", "string", "and", "return", "a", "datetime", ".", "date", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/datetime_parse.py#L86-L110
[ "def", "parse_date", "(", "value", ":", "Union", "[", "date", ",", "StrIntFloat", "]", ")", "->", "date", ":", "if", "isinstance", "(", "value", ",", "date", ")", ":", "if", "isinstance", "(", "value", ",", "datetime", ")", ":", "return", "value", "....
bff8a1789dfde2c38928cced6640887b53615aa3
train
parse_time
Parse a time/string and return a datetime.time. This function doesn't support time zone offsets. Raise ValueError if the input is well formatted but not a valid time. Raise ValueError if the input isn't well formatted, in particular if it contains an offset.
pydantic/datetime_parse.py
def parse_time(value: Union[time, str]) -> time: """ Parse a time/string and return a datetime.time. This function doesn't support time zone offsets. Raise ValueError if the input is well formatted but not a valid time. Raise ValueError if the input isn't well formatted, in particular if it contai...
def parse_time(value: Union[time, str]) -> time: """ Parse a time/string and return a datetime.time. This function doesn't support time zone offsets. Raise ValueError if the input is well formatted but not a valid time. Raise ValueError if the input isn't well formatted, in particular if it contai...
[ "Parse", "a", "time", "/", "string", "and", "return", "a", "datetime", ".", "time", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/datetime_parse.py#L113-L136
[ "def", "parse_time", "(", "value", ":", "Union", "[", "time", ",", "str", "]", ")", "->", "time", ":", "if", "isinstance", "(", "value", ",", "time", ")", ":", "return", "value", "match", "=", "time_re", ".", "match", "(", "value", ")", "if", "not"...
bff8a1789dfde2c38928cced6640887b53615aa3
train
parse_datetime
Parse a datetime/int/float/string and return a datetime.datetime. This function supports time zone offsets. When the input contains one, the output uses a timezone with a fixed offset from UTC. Raise ValueError if the input is well formatted but not a valid datetime. Raise ValueError if the input isn'...
pydantic/datetime_parse.py
def parse_datetime(value: Union[datetime, StrIntFloat]) -> datetime: """ Parse a datetime/int/float/string and return a datetime.datetime. This function supports time zone offsets. When the input contains one, the output uses a timezone with a fixed offset from UTC. Raise ValueError if the input i...
def parse_datetime(value: Union[datetime, StrIntFloat]) -> datetime: """ Parse a datetime/int/float/string and return a datetime.datetime. This function supports time zone offsets. When the input contains one, the output uses a timezone with a fixed offset from UTC. Raise ValueError if the input i...
[ "Parse", "a", "datetime", "/", "int", "/", "float", "/", "string", "and", "return", "a", "datetime", ".", "datetime", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/datetime_parse.py#L139-L180
[ "def", "parse_datetime", "(", "value", ":", "Union", "[", "datetime", ",", "StrIntFloat", "]", ")", "->", "datetime", ":", "if", "isinstance", "(", "value", ",", "datetime", ")", ":", "return", "value", "number", "=", "get_numeric", "(", "value", ")", "i...
bff8a1789dfde2c38928cced6640887b53615aa3
train
parse_duration
Parse a duration int/float/string and return a datetime.timedelta. The preferred format for durations in Django is '%d %H:%M:%S.%f'. Also supports ISO 8601 representation.
pydantic/datetime_parse.py
def parse_duration(value: StrIntFloat) -> timedelta: """ Parse a duration int/float/string and return a datetime.timedelta. The preferred format for durations in Django is '%d %H:%M:%S.%f'. Also supports ISO 8601 representation. """ if isinstance(value, timedelta): return value if...
def parse_duration(value: StrIntFloat) -> timedelta: """ Parse a duration int/float/string and return a datetime.timedelta. The preferred format for durations in Django is '%d %H:%M:%S.%f'. Also supports ISO 8601 representation. """ if isinstance(value, timedelta): return value if...
[ "Parse", "a", "duration", "int", "/", "float", "/", "string", "and", "return", "a", "datetime", ".", "timedelta", "." ]
samuelcolvin/pydantic
python
https://github.com/samuelcolvin/pydantic/blob/bff8a1789dfde2c38928cced6640887b53615aa3/pydantic/datetime_parse.py#L183-L212
[ "def", "parse_duration", "(", "value", ":", "StrIntFloat", ")", "->", "timedelta", ":", "if", "isinstance", "(", "value", ",", "timedelta", ")", ":", "return", "value", "if", "isinstance", "(", "value", ",", "(", "int", ",", "float", ")", ")", ":", "# ...
bff8a1789dfde2c38928cced6640887b53615aa3
train
translate_resource_args
Decorator that converts Issue and Project resources to their keys when used as arguments.
jira/client.py
def translate_resource_args(func): """Decorator that converts Issue and Project resources to their keys when used as arguments.""" @wraps(func) def wrapper(*args, **kwargs): """ :type args: *Any :type kwargs: **Any :return: Any """ arg_list = [] for ar...
def translate_resource_args(func): """Decorator that converts Issue and Project resources to their keys when used as arguments.""" @wraps(func) def wrapper(*args, **kwargs): """ :type args: *Any :type kwargs: **Any :return: Any """ arg_list = [] for ar...
[ "Decorator", "that", "converts", "Issue", "and", "Project", "resources", "to", "their", "keys", "when", "used", "as", "arguments", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L121-L139
[ "def", "translate_resource_args", "(", "func", ")", ":", "@", "wraps", "(", "func", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "\"\"\"\n :type args: *Any\n :type kwargs: **Any\n :return: Any\n \"\"\"", "arg_li...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA._check_update_
Check if the current version of the library is outdated.
jira/client.py
def _check_update_(self): """Check if the current version of the library is outdated.""" try: data = requests.get("https://pypi.python.org/pypi/jira/json", timeout=2.001).json() released_version = data['info']['version'] if parse_version(released_version) > parse_ver...
def _check_update_(self): """Check if the current version of the library is outdated.""" try: data = requests.get("https://pypi.python.org/pypi/jira/json", timeout=2.001).json() released_version = data['info']['version'] if parse_version(released_version) > parse_ver...
[ "Check", "if", "the", "current", "version", "of", "the", "library", "is", "outdated", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L552-L565
[ "def", "_check_update_", "(", "self", ")", ":", "try", ":", "data", "=", "requests", ".", "get", "(", "\"https://pypi.python.org/pypi/jira/json\"", ",", "timeout", "=", "2.001", ")", ".", "json", "(", ")", "released_version", "=", "data", "[", "'info'", "]",...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA._fetch_pages
Fetch pages. :param item_type: Type of single item. ResultList of such items will be returned. :type item_type: type :param items_key: Path to the items in JSON returned from server. Set it to None, if response is an array, and not a JSON object. :type items_key: Optiona...
jira/client.py
def _fetch_pages(self, item_type, items_key, request_path, startAt=0, maxResults=50, params=None, base=JIRA_BASE_URL, ): """Fetch pages. ...
def _fetch_pages(self, item_type, items_key, request_path, startAt=0, maxResults=50, params=None, base=JIRA_BASE_URL, ): """Fetch pages. ...
[ "Fetch", "pages", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L599-L703
[ "def", "_fetch_pages", "(", "self", ",", "item_type", ",", "items_key", ",", "request_path", ",", "startAt", "=", "0", ",", "maxResults", "=", "50", ",", "params", "=", "None", ",", "base", "=", "JIRA_BASE_URL", ",", ")", ":", "async_class", "=", "None",...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA._get_items_from_page
:type item_type: type :type items_key: str :type resource: Dict[str, Any] :rtype: Union[List[Dashboard], List[Issue]]
jira/client.py
def _get_items_from_page(self, item_type, items_key, resource, ): """ :type item_type: type :type items_key: str :type resource: Dict[str, Any] :rtype: Union[List[D...
def _get_items_from_page(self, item_type, items_key, resource, ): """ :type item_type: type :type items_key: str :type resource: Dict[str, Any] :rtype: Union[List[D...
[ ":", "type", "item_type", ":", "type", ":", "type", "items_key", ":", "str", ":", "type", "resource", ":", "Dict", "[", "str", "Any", "]", ":", "rtype", ":", "Union", "[", "List", "[", "Dashboard", "]", "List", "[", "Issue", "]]" ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L705-L721
[ "def", "_get_items_from_page", "(", "self", ",", "item_type", ",", "items_key", ",", "resource", ",", ")", ":", "try", ":", "return", "[", "item_type", "(", "self", ".", "_options", ",", "self", ".", "_session", ",", "raw_issue_json", ")", "for", "raw_issu...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.find
Find Resource object for any addressable resource on the server. This method is a universal resource locator for any REST-ful resource in JIRA. The argument ``resource_format`` is a string of the form ``resource``, ``resource/{0}``, ``resource/{0}/sub``, ``resource/{0}/sub/{1}``, etc. The forma...
jira/client.py
def find(self, resource_format, ids=None): """Find Resource object for any addressable resource on the server. This method is a universal resource locator for any REST-ful resource in JIRA. The argument ``resource_format`` is a string of the form ``resource``, ``resource/{0}``, ``resour...
def find(self, resource_format, ids=None): """Find Resource object for any addressable resource on the server. This method is a universal resource locator for any REST-ful resource in JIRA. The argument ``resource_format`` is a string of the form ``resource``, ``resource/{0}``, ``resour...
[ "Find", "Resource", "object", "for", "any", "addressable", "resource", "on", "the", "server", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L731-L754
[ "def", "find", "(", "self", ",", "resource_format", ",", "ids", "=", "None", ")", ":", "resource", "=", "Resource", "(", "resource_format", ",", "self", ".", "_options", ",", "self", ".", "_session", ")", "resource", ".", "find", "(", "ids", ")", "retu...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.async_do
Execute all asynchronous jobs and wait for them to finish. By default it will run on 10 threads. :param size: number of threads to run on.
jira/client.py
def async_do(self, size=10): """Execute all asynchronous jobs and wait for them to finish. By default it will run on 10 threads. :param size: number of threads to run on. """ if hasattr(self._session, '_async_jobs'): logging.info("Executing asynchronous %s jobs found in queu...
def async_do(self, size=10): """Execute all asynchronous jobs and wait for them to finish. By default it will run on 10 threads. :param size: number of threads to run on. """ if hasattr(self._session, '_async_jobs'): logging.info("Executing asynchronous %s jobs found in queu...
[ "Execute", "all", "asynchronous", "jobs", "and", "wait", "for", "them", "to", "finish", ".", "By", "default", "it", "will", "run", "on", "10", "threads", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L756-L764
[ "def", "async_do", "(", "self", ",", "size", "=", "10", ")", ":", "if", "hasattr", "(", "self", ".", "_session", ",", "'_async_jobs'", ")", ":", "logging", ".", "info", "(", "\"Executing asynchronous %s jobs found in queue by using %s threads...\"", "%", "(", "l...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.application_properties
Return the mutable server application properties. :param key: the single property to return a value for :type key: Optional[str] :rtype: Union[Dict[str, str], List[Dict[str, str]]]
jira/client.py
def application_properties(self, key=None): """Return the mutable server application properties. :param key: the single property to return a value for :type key: Optional[str] :rtype: Union[Dict[str, str], List[Dict[str, str]]] """ params = {} if key is not None...
def application_properties(self, key=None): """Return the mutable server application properties. :param key: the single property to return a value for :type key: Optional[str] :rtype: Union[Dict[str, str], List[Dict[str, str]]] """ params = {} if key is not None...
[ "Return", "the", "mutable", "server", "application", "properties", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L769-L780
[ "def", "application_properties", "(", "self", ",", "key", "=", "None", ")", ":", "params", "=", "{", "}", "if", "key", "is", "not", "None", ":", "params", "[", "'key'", "]", "=", "key", "return", "self", ".", "_get_json", "(", "'application-properties'",...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.set_application_property
Set the application property. :param key: key of the property to set :type key: str :param value: value to assign to the property :type value: str
jira/client.py
def set_application_property(self, key, value): """Set the application property. :param key: key of the property to set :type key: str :param value: value to assign to the property :type value: str """ url = self._options['server'] + \ '/rest/api/late...
def set_application_property(self, key, value): """Set the application property. :param key: key of the property to set :type key: str :param value: value to assign to the property :type value: str """ url = self._options['server'] + \ '/rest/api/late...
[ "Set", "the", "application", "property", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L782-L796
[ "def", "set_application_property", "(", "self", ",", "key", ",", "value", ")", ":", "url", "=", "self", ".", "_options", "[", "'server'", "]", "+", "'/rest/api/latest/application-properties/'", "+", "key", "payload", "=", "{", "'id'", ":", "key", ",", "'valu...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.applicationlinks
List of application links. :return: json
jira/client.py
def applicationlinks(self, cached=True): """List of application links. :return: json """ # if cached, return the last result if cached and hasattr(self, '_applicationlinks'): return self._applicationlinks # url = self._options['server'] + '/rest/applinks/lat...
def applicationlinks(self, cached=True): """List of application links. :return: json """ # if cached, return the last result if cached and hasattr(self, '_applicationlinks'): return self._applicationlinks # url = self._options['server'] + '/rest/applinks/lat...
[ "List", "of", "application", "links", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L798-L818
[ "def", "applicationlinks", "(", "self", ",", "cached", "=", "True", ")", ":", "# if cached, return the last result", "if", "cached", "and", "hasattr", "(", "self", ",", "'_applicationlinks'", ")", ":", "return", "self", ".", "_applicationlinks", "# url = self._optio...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.add_attachment
Attach an attachment to an issue and returns a Resource for it. The client will *not* attempt to open or validate the attachment; it expects a file-like object to be ready for its use. The user is still responsible for tidying up (e.g., closing the file, killing the socket, etc.) :param issue:...
jira/client.py
def add_attachment(self, issue, attachment, filename=None): """Attach an attachment to an issue and returns a Resource for it. The client will *not* attempt to open or validate the attachment; it expects a file-like object to be ready for its use. The user is still responsible for tidying up (e...
def add_attachment(self, issue, attachment, filename=None): """Attach an attachment to an issue and returns a Resource for it. The client will *not* attempt to open or validate the attachment; it expects a file-like object to be ready for its use. The user is still responsible for tidying up (e...
[ "Attach", "an", "attachment", "to", "an", "issue", "and", "returns", "a", "Resource", "for", "it", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L839-L895
[ "def", "add_attachment", "(", "self", ",", "issue", ",", "attachment", ",", "filename", "=", "None", ")", ":", "if", "isinstance", "(", "attachment", ",", "string_types", ")", ":", "attachment", "=", "open", "(", "attachment", ",", "\"rb\"", ")", "if", "...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.delete_attachment
Delete attachment by id. :param id: ID of the attachment to delete :type id: str
jira/client.py
def delete_attachment(self, id): """Delete attachment by id. :param id: ID of the attachment to delete :type id: str """ url = self._get_url('attachment/' + str(id)) return self._session.delete(url)
def delete_attachment(self, id): """Delete attachment by id. :param id: ID of the attachment to delete :type id: str """ url = self._get_url('attachment/' + str(id)) return self._session.delete(url)
[ "Delete", "attachment", "by", "id", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L897-L904
[ "def", "delete_attachment", "(", "self", ",", "id", ")", ":", "url", "=", "self", ".", "_get_url", "(", "'attachment/'", "+", "str", "(", "id", ")", ")", "return", "self", ".", "_session", ".", "delete", "(", "url", ")" ]
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.create_component
Create a component inside a project and return a Resource for it. :param name: name of the component :type name: str :param project: key of the project to create the component in :type project: str :param description: a description of the component :type description: str...
jira/client.py
def create_component(self, name, project, description=None, leadUserName=None, assigneeType=None, isAssigneeTypeValid=False, ): """Create...
def create_component(self, name, project, description=None, leadUserName=None, assigneeType=None, isAssigneeTypeValid=False, ): """Create...
[ "Create", "a", "component", "inside", "a", "project", "and", "return", "a", "Resource", "for", "it", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L917-L957
[ "def", "create_component", "(", "self", ",", "name", ",", "project", ",", "description", "=", "None", ",", "leadUserName", "=", "None", ",", "assigneeType", "=", "None", ",", "isAssigneeTypeValid", "=", "False", ",", ")", ":", "data", "=", "{", "'name'", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.delete_component
Delete component by id. :param id: ID of the component to use :type id: str :rtype: Response
jira/client.py
def delete_component(self, id): """Delete component by id. :param id: ID of the component to use :type id: str :rtype: Response """ url = self._get_url('component/' + str(id)) return self._session.delete(url)
def delete_component(self, id): """Delete component by id. :param id: ID of the component to use :type id: str :rtype: Response """ url = self._get_url('component/' + str(id)) return self._session.delete(url)
[ "Delete", "component", "by", "id", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L967-L975
[ "def", "delete_component", "(", "self", ",", "id", ")", ":", "url", "=", "self", ".", "_get_url", "(", "'component/'", "+", "str", "(", "id", ")", ")", "return", "self", ".", "_session", ".", "delete", "(", "url", ")" ]
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.dashboards
Return a ResultList of Dashboard resources and a ``total`` count. :param filter: either "favourite" or "my", the type of dashboards to return :type filter: Optional[str] :param startAt: index of the first dashboard to return (Default: 0) :type startAt: int :param maxResults: max...
jira/client.py
def dashboards(self, filter=None, startAt=0, maxResults=20): """Return a ResultList of Dashboard resources and a ``total`` count. :param filter: either "favourite" or "my", the type of dashboards to return :type filter: Optional[str] :param startAt: index of the first dashboard to retur...
def dashboards(self, filter=None, startAt=0, maxResults=20): """Return a ResultList of Dashboard resources and a ``total`` count. :param filter: either "favourite" or "my", the type of dashboards to return :type filter: Optional[str] :param startAt: index of the first dashboard to retur...
[ "Return", "a", "ResultList", "of", "Dashboard", "resources", "and", "a", "total", "count", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L990-L1006
[ "def", "dashboards", "(", "self", ",", "filter", "=", "None", ",", "startAt", "=", "0", ",", "maxResults", "=", "20", ")", ":", "params", "=", "{", "}", "if", "filter", "is", "not", "None", ":", "params", "[", "'filter'", "]", "=", "filter", "retur...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.favourite_filters
Get a list of filter Resources which are the favourites of the currently authenticated user. :rtype: List[Filter]
jira/client.py
def favourite_filters(self): """Get a list of filter Resources which are the favourites of the currently authenticated user. :rtype: List[Filter] """ r_json = self._get_json('filter/favourite') filters = [Filter(self._options, self._session, raw_filter_json) f...
def favourite_filters(self): """Get a list of filter Resources which are the favourites of the currently authenticated user. :rtype: List[Filter] """ r_json = self._get_json('filter/favourite') filters = [Filter(self._options, self._session, raw_filter_json) f...
[ "Get", "a", "list", "of", "filter", "Resources", "which", "are", "the", "favourites", "of", "the", "currently", "authenticated", "user", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1038-L1046
[ "def", "favourite_filters", "(", "self", ")", ":", "r_json", "=", "self", ".", "_get_json", "(", "'filter/favourite'", ")", "filters", "=", "[", "Filter", "(", "self", ".", "_options", ",", "self", ".", "_session", ",", "raw_filter_json", ")", "for", "raw_...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.create_filter
Create a new filter and return a filter Resource for it. :param name: name of the new filter :type name: str :param description: useful human readable description of the new filter :type description: str :param jql: query string that defines the filter :type jql: str ...
jira/client.py
def create_filter(self, name=None, description=None, jql=None, favourite=None): """Create a new filter and return a filter Resource for it. :param name: name of the new filter :type name: str :param description: useful human readable description of the new filter ...
def create_filter(self, name=None, description=None, jql=None, favourite=None): """Create a new filter and return a filter Resource for it. :param name: name of the new filter :type name: str :param description: useful human readable description of the new filter ...
[ "Create", "a", "new", "filter", "and", "return", "a", "filter", "Resource", "for", "it", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1048-L1077
[ "def", "create_filter", "(", "self", ",", "name", "=", "None", ",", "description", "=", "None", ",", "jql", "=", "None", ",", "favourite", "=", "None", ")", ":", "data", "=", "{", "}", "if", "name", "is", "not", "None", ":", "data", "[", "'name'", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.update_filter
Update a filter and return a filter Resource for it. :param name: name of the new filter :type name: Optional[str] :param description: useful human readable description of the new filter :type description: Optional[str] :param jql: query string that defines the filter :t...
jira/client.py
def update_filter(self, filter_id, name=None, description=None, jql=None, favourite=None): """Update a filter and return a filter Resource for it. :param name: name of the new filter :type name: Optional[str] :param description: useful human r...
def update_filter(self, filter_id, name=None, description=None, jql=None, favourite=None): """Update a filter and return a filter Resource for it. :param name: name of the new filter :type name: Optional[str] :param description: useful human r...
[ "Update", "a", "filter", "and", "return", "a", "filter", "Resource", "for", "it", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1079-L1106
[ "def", "update_filter", "(", "self", ",", "filter_id", ",", "name", "=", "None", ",", "description", "=", "None", ",", "jql", "=", "None", ",", "favourite", "=", "None", ")", ":", "filter", "=", "self", ".", "filter", "(", "filter_id", ")", "data", "...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.group
Get a group Resource from the server. :param id: ID of the group to get :param id: str :param expand: Extra information to fetch inside each resource :type expand: Optional[Any] :rtype: User
jira/client.py
def group(self, id, expand=None): """Get a group Resource from the server. :param id: ID of the group to get :param id: str :param expand: Extra information to fetch inside each resource :type expand: Optional[Any] :rtype: User """ group = Group(self._op...
def group(self, id, expand=None): """Get a group Resource from the server. :param id: ID of the group to get :param id: str :param expand: Extra information to fetch inside each resource :type expand: Optional[Any] :rtype: User """ group = Group(self._op...
[ "Get", "a", "group", "Resource", "from", "the", "server", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1110-L1125
[ "def", "group", "(", "self", ",", "id", ",", "expand", "=", "None", ")", ":", "group", "=", "Group", "(", "self", ".", "_options", ",", "self", ".", "_session", ")", "params", "=", "{", "}", "if", "expand", "is", "not", "None", ":", "params", "["...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.groups
Return a list of groups matching the specified criteria. :param query: filter groups by name with this string :type query: Optional[str] :param exclude: filter out groups by name with this string :type exclude: Optional[Any] :param maxResults: maximum results to return. (Default...
jira/client.py
def groups(self, query=None, exclude=None, maxResults=9999): """Return a list of groups matching the specified criteria. :param query: filter groups by name with this string :type query: Optional[str] :param exclude: filter out groups by name with this string :type exclude: Opti...
def groups(self, query=None, exclude=None, maxResults=9999): """Return a list of groups matching the specified criteria. :param query: filter groups by name with this string :type query: Optional[str] :param exclude: filter out groups by name with this string :type exclude: Opti...
[ "Return", "a", "list", "of", "groups", "matching", "the", "specified", "criteria", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1128-L1150
[ "def", "groups", "(", "self", ",", "query", "=", "None", ",", "exclude", "=", "None", ",", "maxResults", "=", "9999", ")", ":", "params", "=", "{", "}", "groups", "=", "[", "]", "if", "query", "is", "not", "None", ":", "params", "[", "'query'", "...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.group_members
Return a hash or users with their information. Requires JIRA 6.0 or will raise NotImplemented. :param group: Name of the group. :type group: str
jira/client.py
def group_members(self, group): """Return a hash or users with their information. Requires JIRA 6.0 or will raise NotImplemented. :param group: Name of the group. :type group: str """ if self._version < (6, 0, 0): raise NotImplementedError( "Group mem...
def group_members(self, group): """Return a hash or users with their information. Requires JIRA 6.0 or will raise NotImplemented. :param group: Name of the group. :type group: str """ if self._version < (6, 0, 0): raise NotImplementedError( "Group mem...
[ "Return", "a", "hash", "or", "users", "with", "their", "information", ".", "Requires", "JIRA", "6", ".", "0", "or", "will", "raise", "NotImplemented", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1152-L1182
[ "def", "group_members", "(", "self", ",", "group", ")", ":", "if", "self", ".", "_version", "<", "(", "6", ",", "0", ",", "0", ")", ":", "raise", "NotImplementedError", "(", "\"Group members is not implemented in JIRA before version 6.0, upgrade the instance, if possi...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.add_group
Create a new group in JIRA. :param groupname: The name of the group you wish to create. :type groupname: str :return: Boolean - True if successful. :rtype: bool
jira/client.py
def add_group(self, groupname): """Create a new group in JIRA. :param groupname: The name of the group you wish to create. :type groupname: str :return: Boolean - True if successful. :rtype: bool """ url = self._options['server'] + '/rest/api/latest/group' ...
def add_group(self, groupname): """Create a new group in JIRA. :param groupname: The name of the group you wish to create. :type groupname: str :return: Boolean - True if successful. :rtype: bool """ url = self._options['server'] + '/rest/api/latest/group' ...
[ "Create", "a", "new", "group", "in", "JIRA", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1184-L1205
[ "def", "add_group", "(", "self", ",", "groupname", ")", ":", "url", "=", "self", ".", "_options", "[", "'server'", "]", "+", "'/rest/api/latest/group'", "# implementation based on", "# https://docs.atlassian.com/jira/REST/ondemand/#d2e5173", "x", "=", "OrderedDict", "("...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.remove_group
Delete a group from the JIRA instance. :param groupname: The group to be deleted from the JIRA instance. :type groupname: str :return: Boolean. Returns True on success. :rtype: bool
jira/client.py
def remove_group(self, groupname): """Delete a group from the JIRA instance. :param groupname: The group to be deleted from the JIRA instance. :type groupname: str :return: Boolean. Returns True on success. :rtype: bool """ # implementation based on # htt...
def remove_group(self, groupname): """Delete a group from the JIRA instance. :param groupname: The group to be deleted from the JIRA instance. :type groupname: str :return: Boolean. Returns True on success. :rtype: bool """ # implementation based on # htt...
[ "Delete", "a", "group", "from", "the", "JIRA", "instance", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1207-L1220
[ "def", "remove_group", "(", "self", ",", "groupname", ")", ":", "# implementation based on", "# https://docs.atlassian.com/jira/REST/ondemand/#d2e5173", "url", "=", "self", ".", "_options", "[", "'server'", "]", "+", "'/rest/api/latest/group'", "x", "=", "{", "'groupnam...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.issue
Get an issue Resource from the server. :param id: ID or key of the issue to get :type id: Union[Issue, str] :param fields: comma-separated string of issue fields to include in the results :type fields: Optional[str] :param expand: extra information to fetch inside each resource ...
jira/client.py
def issue(self, id, fields=None, expand=None): """Get an issue Resource from the server. :param id: ID or key of the issue to get :type id: Union[Issue, str] :param fields: comma-separated string of issue fields to include in the results :type fields: Optional[str] :para...
def issue(self, id, fields=None, expand=None): """Get an issue Resource from the server. :param id: ID or key of the issue to get :type id: Union[Issue, str] :param fields: comma-separated string of issue fields to include in the results :type fields: Optional[str] :para...
[ "Get", "an", "issue", "Resource", "from", "the", "server", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1224-L1247
[ "def", "issue", "(", "self", ",", "id", ",", "fields", "=", "None", ",", "expand", "=", "None", ")", ":", "# this allows us to pass Issue objects to issue()", "if", "isinstance", "(", "id", ",", "Issue", ")", ":", "return", "id", "issue", "=", "Issue", "("...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.create_issue
Create a new issue and return an issue Resource for it. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field -- if the fields argument is used, all other keyword arguments will be ignored. ...
jira/client.py
def create_issue(self, fields=None, prefetch=True, **fieldargs): """Create a new issue and return an issue Resource for it. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field -- if the fields...
def create_issue(self, fields=None, prefetch=True, **fieldargs): """Create a new issue and return an issue Resource for it. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field -- if the fields...
[ "Create", "a", "new", "issue", "and", "return", "an", "issue", "Resource", "for", "it", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1249-L1293
[ "def", "create_issue", "(", "self", ",", "fields", "=", "None", ",", "prefetch", "=", "True", ",", "*", "*", "fieldargs", ")", ":", "data", "=", "_field_worker", "(", "fields", ",", "*", "*", "fieldargs", ")", "p", "=", "data", "[", "'fields'", "]", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.create_issues
Bulk create new issues and return an issue Resource for each successfully created issue. See `create_issue` documentation for field information. :param field_list: a list of dicts each containing field names and the values to use. Each dict is an individual issue to create and is subject t...
jira/client.py
def create_issues(self, field_list, prefetch=True): """Bulk create new issues and return an issue Resource for each successfully created issue. See `create_issue` documentation for field information. :param field_list: a list of dicts each containing field names and the values to use. Each dic...
def create_issues(self, field_list, prefetch=True): """Bulk create new issues and return an issue Resource for each successfully created issue. See `create_issue` documentation for field information. :param field_list: a list of dicts each containing field names and the values to use. Each dic...
[ "Bulk", "create", "new", "issues", "and", "return", "an", "issue", "Resource", "for", "each", "successfully", "created", "issue", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1295-L1351
[ "def", "create_issues", "(", "self", ",", "field_list", ",", "prefetch", "=", "True", ")", ":", "data", "=", "{", "'issueUpdates'", ":", "[", "]", "}", "for", "field_dict", "in", "field_list", ":", "issue_data", "=", "_field_worker", "(", "field_dict", ")"...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.supports_service_desk
Returns whether or not the JIRA instance supports service desk. :rtype: bool
jira/client.py
def supports_service_desk(self): """Returns whether or not the JIRA instance supports service desk. :rtype: bool """ url = self._options['server'] + '/rest/servicedeskapi/info' headers = {'X-ExperimentalApi': 'opt-in'} try: r = self._session.get(url, headers=...
def supports_service_desk(self): """Returns whether or not the JIRA instance supports service desk. :rtype: bool """ url = self._options['server'] + '/rest/servicedeskapi/info' headers = {'X-ExperimentalApi': 'opt-in'} try: r = self._session.get(url, headers=...
[ "Returns", "whether", "or", "not", "the", "JIRA", "instance", "supports", "service", "desk", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1353-L1364
[ "def", "supports_service_desk", "(", "self", ")", ":", "url", "=", "self", ".", "_options", "[", "'server'", "]", "+", "'/rest/servicedeskapi/info'", "headers", "=", "{", "'X-ExperimentalApi'", ":", "'opt-in'", "}", "try", ":", "r", "=", "self", ".", "_sessi...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.create_customer
Create a new customer and return an issue Resource for it. :param email: Customer Email :type email: str :param displayName: Customer display name :type displayName: str :rtype: Customer
jira/client.py
def create_customer(self, email, displayName): """Create a new customer and return an issue Resource for it. :param email: Customer Email :type email: str :param displayName: Customer display name :type displayName: str :rtype: Customer """ url = self._o...
def create_customer(self, email, displayName): """Create a new customer and return an issue Resource for it. :param email: Customer Email :type email: str :param displayName: Customer display name :type displayName: str :rtype: Customer """ url = self._o...
[ "Create", "a", "new", "customer", "and", "return", "an", "issue", "Resource", "for", "it", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1366-L1387
[ "def", "create_customer", "(", "self", ",", "email", ",", "displayName", ")", ":", "url", "=", "self", ".", "_options", "[", "'server'", "]", "+", "'/rest/servicedeskapi/customer'", "headers", "=", "{", "'X-ExperimentalApi'", ":", "'opt-in'", "}", "r", "=", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.service_desks
Get a list of ServiceDesk Resources from the server visible to the current authenticated user. :rtype: List[ServiceDesk]
jira/client.py
def service_desks(self): """Get a list of ServiceDesk Resources from the server visible to the current authenticated user. :rtype: List[ServiceDesk] """ url = self._options['server'] + '/rest/servicedeskapi/servicedesk' headers = {'X-ExperimentalApi': 'opt-in'} r_json =...
def service_desks(self): """Get a list of ServiceDesk Resources from the server visible to the current authenticated user. :rtype: List[ServiceDesk] """ url = self._options['server'] + '/rest/servicedeskapi/servicedesk' headers = {'X-ExperimentalApi': 'opt-in'} r_json =...
[ "Get", "a", "list", "of", "ServiceDesk", "Resources", "from", "the", "server", "visible", "to", "the", "current", "authenticated", "user", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1389-L1400
[ "def", "service_desks", "(", "self", ")", ":", "url", "=", "self", ".", "_options", "[", "'server'", "]", "+", "'/rest/servicedeskapi/servicedesk'", "headers", "=", "{", "'X-ExperimentalApi'", ":", "'opt-in'", "}", "r_json", "=", "json_loads", "(", "self", "."...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.create_customer_request
Create a new customer request and return an issue Resource for it. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field -- if the fields argument is used, all other keyword arguments will be ig...
jira/client.py
def create_customer_request(self, fields=None, prefetch=True, **fieldargs): """Create a new customer request and return an issue Resource for it. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that ...
def create_customer_request(self, fields=None, prefetch=True, **fieldargs): """Create a new customer request and return an issue Resource for it. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that ...
[ "Create", "a", "new", "customer", "request", "and", "return", "an", "issue", "Resource", "for", "it", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1412-L1463
[ "def", "create_customer_request", "(", "self", ",", "fields", "=", "None", ",", "prefetch", "=", "True", ",", "*", "*", "fieldargs", ")", ":", "data", "=", "fields", "p", "=", "data", "[", "'serviceDeskId'", "]", "service_desk", "=", "None", "if", "isins...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.createmeta
Get the metadata required to create issues, optionally filtered by projects and issue types. :param projectKeys: keys of the projects to filter the results with. Can be a single value or a comma-delimited string. May be combined with projectIds. :type projectKeys: Union[None, Tu...
jira/client.py
def createmeta(self, projectKeys=None, projectIds=[], issuetypeIds=None, issuetypeNames=None, expand=None, ): """Get the metadata required to create issues, optionally filtered by projects and issue...
def createmeta(self, projectKeys=None, projectIds=[], issuetypeIds=None, issuetypeNames=None, expand=None, ): """Get the metadata required to create issues, optionally filtered by projects and issue...
[ "Get", "the", "metadata", "required", "to", "create", "issues", "optionally", "filtered", "by", "projects", "and", "issue", "types", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1465-L1508
[ "def", "createmeta", "(", "self", ",", "projectKeys", "=", "None", ",", "projectIds", "=", "[", "]", ",", "issuetypeIds", "=", "None", ",", "issuetypeNames", "=", "None", ",", "expand", "=", "None", ",", ")", ":", "params", "=", "{", "}", "if", "proj...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.assign_issue
Assign an issue to a user. None will set it to unassigned. -1 will set it to Automatic. :param issue: the issue ID or key to assign :type issue: int or str :param assignee: the user to assign the issue to :type assignee: str :rtype: bool
jira/client.py
def assign_issue(self, issue, assignee): """Assign an issue to a user. None will set it to unassigned. -1 will set it to Automatic. :param issue: the issue ID or key to assign :type issue: int or str :param assignee: the user to assign the issue to :type assignee: str :...
def assign_issue(self, issue, assignee): """Assign an issue to a user. None will set it to unassigned. -1 will set it to Automatic. :param issue: the issue ID or key to assign :type issue: int or str :param assignee: the user to assign the issue to :type assignee: str :...
[ "Assign", "an", "issue", "to", "a", "user", ".", "None", "will", "set", "it", "to", "unassigned", ".", "-", "1", "will", "set", "it", "to", "Automatic", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1512-L1528
[ "def", "assign_issue", "(", "self", ",", "issue", ",", "assignee", ")", ":", "url", "=", "self", ".", "_options", "[", "'server'", "]", "+", "'/rest/api/latest/issue/'", "+", "str", "(", "issue", ")", "+", "'/assignee'", "payload", "=", "{", "'name'", ":...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.comments
Get a list of comment Resources. :param issue: the issue to get comments from :type issue: str :rtype: List[Comment]
jira/client.py
def comments(self, issue): """Get a list of comment Resources. :param issue: the issue to get comments from :type issue: str :rtype: List[Comment] """ r_json = self._get_json('issue/' + str(issue) + '/comment') comments = [Comment(self._options, self._session, r...
def comments(self, issue): """Get a list of comment Resources. :param issue: the issue to get comments from :type issue: str :rtype: List[Comment] """ r_json = self._get_json('issue/' + str(issue) + '/comment') comments = [Comment(self._options, self._session, r...
[ "Get", "a", "list", "of", "comment", "Resources", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1531-L1542
[ "def", "comments", "(", "self", ",", "issue", ")", ":", "r_json", "=", "self", ".", "_get_json", "(", "'issue/'", "+", "str", "(", "issue", ")", "+", "'/comment'", ")", "comments", "=", "[", "Comment", "(", "self", ".", "_options", ",", "self", ".", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.add_comment
Add a comment from the current authenticated user on the specified issue and return a Resource for it. The issue identifier and comment body are required. :param issue: ID or key of the issue to add the comment to :type issue: str :param body: Text of the comment to add :type b...
jira/client.py
def add_comment(self, issue, body, visibility=None, is_internal=False): """Add a comment from the current authenticated user on the specified issue and return a Resource for it. The issue identifier and comment body are required. :param issue: ID or key of the issue to add the comment to ...
def add_comment(self, issue, body, visibility=None, is_internal=False): """Add a comment from the current authenticated user on the specified issue and return a Resource for it. The issue identifier and comment body are required. :param issue: ID or key of the issue to add the comment to ...
[ "Add", "a", "comment", "from", "the", "current", "authenticated", "user", "on", "the", "specified", "issue", "and", "return", "a", "Resource", "for", "it", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1554-L1594
[ "def", "add_comment", "(", "self", ",", "issue", ",", "body", ",", "visibility", "=", "None", ",", "is_internal", "=", "False", ")", ":", "data", "=", "{", "'body'", ":", "body", ",", "}", "if", "is_internal", ":", "data", ".", "update", "(", "{", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.remote_links
Get a list of remote link Resources from an issue. :param issue: the issue to get remote links from
jira/client.py
def remote_links(self, issue): """Get a list of remote link Resources from an issue. :param issue: the issue to get remote links from """ r_json = self._get_json('issue/' + str(issue) + '/remotelink') remote_links = [RemoteLink( self._options, self._session, raw_remo...
def remote_links(self, issue): """Get a list of remote link Resources from an issue. :param issue: the issue to get remote links from """ r_json = self._get_json('issue/' + str(issue) + '/remotelink') remote_links = [RemoteLink( self._options, self._session, raw_remo...
[ "Get", "a", "list", "of", "remote", "link", "Resources", "from", "an", "issue", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1608-L1616
[ "def", "remote_links", "(", "self", ",", "issue", ")", ":", "r_json", "=", "self", ".", "_get_json", "(", "'issue/'", "+", "str", "(", "issue", ")", "+", "'/remotelink'", ")", "remote_links", "=", "[", "RemoteLink", "(", "self", ".", "_options", ",", "...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.add_remote_link
Add a remote link from an issue to an external application and returns a remote link Resource for it. ``object`` should be a dict containing at least ``url`` to the linked external URL and ``title`` to display for the link inside JIRA. For definitions of the allowable fields for ``object`` and...
jira/client.py
def add_remote_link(self, issue, destination, globalId=None, application=None, relationship=None): """Add a remote link from an issue to an external application and returns a remote link Resource for it. ``object`` should be a dict containing at least ``url`` to the linked external URL and ``ti...
def add_remote_link(self, issue, destination, globalId=None, application=None, relationship=None): """Add a remote link from an issue to an external application and returns a remote link Resource for it. ``object`` should be a dict containing at least ``url`` to the linked external URL and ``ti...
[ "Add", "a", "remote", "link", "from", "an", "issue", "to", "an", "external", "application", "and", "returns", "a", "remote", "link", "Resource", "for", "it", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1629-L1702
[ "def", "add_remote_link", "(", "self", ",", "issue", ",", "destination", ",", "globalId", "=", "None", ",", "application", "=", "None", ",", "relationship", "=", "None", ")", ":", "try", ":", "applicationlinks", "=", "self", ".", "applicationlinks", "(", "...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.add_simple_link
Add a simple remote link from an issue to web resource. This avoids the admin access problems from add_remote_link by just using a simple object and presuming all fields are correct and not requiring more complex ``application`` data. ``object`` should be a dict containing at l...
jira/client.py
def add_simple_link(self, issue, object): """Add a simple remote link from an issue to web resource. This avoids the admin access problems from add_remote_link by just using a simple object and presuming all fields are correct and not requiring more complex ``application`` data....
def add_simple_link(self, issue, object): """Add a simple remote link from an issue to web resource. This avoids the admin access problems from add_remote_link by just using a simple object and presuming all fields are correct and not requiring more complex ``application`` data....
[ "Add", "a", "simple", "remote", "link", "from", "an", "issue", "to", "web", "resource", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1704-L1726
[ "def", "add_simple_link", "(", "self", ",", "issue", ",", "object", ")", ":", "data", "=", "{", "\"object\"", ":", "object", "}", "url", "=", "self", ".", "_get_url", "(", "'issue/'", "+", "str", "(", "issue", ")", "+", "'/remotelink'", ")", "r", "="...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.transitions
Get a list of the transitions available on the specified issue to the current user. :param issue: ID or key of the issue to get the transitions from :param id: if present, get only the transition matching this ID :param expand: extra information to fetch inside each transition
jira/client.py
def transitions(self, issue, id=None, expand=None): """Get a list of the transitions available on the specified issue to the current user. :param issue: ID or key of the issue to get the transitions from :param id: if present, get only the transition matching this ID :param expand: extr...
def transitions(self, issue, id=None, expand=None): """Get a list of the transitions available on the specified issue to the current user. :param issue: ID or key of the issue to get the transitions from :param id: if present, get only the transition matching this ID :param expand: extr...
[ "Get", "a", "list", "of", "the", "transitions", "available", "on", "the", "specified", "issue", "to", "the", "current", "user", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1730-L1742
[ "def", "transitions", "(", "self", ",", "issue", ",", "id", "=", "None", ",", "expand", "=", "None", ")", ":", "params", "=", "{", "}", "if", "id", "is", "not", "None", ":", "params", "[", "'transitionId'", "]", "=", "id", "if", "expand", "is", "...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.find_transitionid_by_name
Get a transitionid available on the specified issue to the current user. Look at https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1074 for json reference :param issue: ID or key of the issue to get the transitions from :param trans_name: iname of transition we are looking for
jira/client.py
def find_transitionid_by_name(self, issue, transition_name): """Get a transitionid available on the specified issue to the current user. Look at https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1074 for json reference :param issue: ID or key of the issue to get the transitions from...
def find_transitionid_by_name(self, issue, transition_name): """Get a transitionid available on the specified issue to the current user. Look at https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1074 for json reference :param issue: ID or key of the issue to get the transitions from...
[ "Get", "a", "transitionid", "available", "on", "the", "specified", "issue", "to", "the", "current", "user", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1744-L1759
[ "def", "find_transitionid_by_name", "(", "self", ",", "issue", ",", "transition_name", ")", ":", "transitions_json", "=", "self", ".", "transitions", "(", "issue", ")", "id", "=", "None", "for", "transition", "in", "transitions_json", ":", "if", "transition", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.transition_issue
Perform a transition on an issue. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field -- if the fields argument is used, all other keyword arguments will be ignored. Field values will be set o...
jira/client.py
def transition_issue(self, issue, transition, fields=None, comment=None, worklog=None, **fieldargs): """Perform a transition on an issue. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field --...
def transition_issue(self, issue, transition, fields=None, comment=None, worklog=None, **fieldargs): """Perform a transition on an issue. Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field --...
[ "Perform", "a", "transition", "on", "an", "issue", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1762-L1809
[ "def", "transition_issue", "(", "self", ",", "issue", ",", "transition", ",", "fields", "=", "None", ",", "comment", "=", "None", ",", "worklog", "=", "None", ",", "*", "*", "fieldargs", ")", ":", "transitionId", "=", "None", "try", ":", "transitionId", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.add_vote
Register a vote for the current authenticated user on an issue. :param issue: ID or key of the issue to vote on :rtype: Response
jira/client.py
def add_vote(self, issue): """Register a vote for the current authenticated user on an issue. :param issue: ID or key of the issue to vote on :rtype: Response """ url = self._get_url('issue/' + str(issue) + '/votes') return self._session.post(url)
def add_vote(self, issue): """Register a vote for the current authenticated user on an issue. :param issue: ID or key of the issue to vote on :rtype: Response """ url = self._get_url('issue/' + str(issue) + '/votes') return self._session.post(url)
[ "Register", "a", "vote", "for", "the", "current", "authenticated", "user", "on", "an", "issue", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1821-L1828
[ "def", "add_vote", "(", "self", ",", "issue", ")", ":", "url", "=", "self", ".", "_get_url", "(", "'issue/'", "+", "str", "(", "issue", ")", "+", "'/votes'", ")", "return", "self", ".", "_session", ".", "post", "(", "url", ")" ]
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.remove_vote
Remove the current authenticated user's vote from an issue. :param issue: ID or key of the issue to remove vote on
jira/client.py
def remove_vote(self, issue): """Remove the current authenticated user's vote from an issue. :param issue: ID or key of the issue to remove vote on """ url = self._get_url('issue/' + str(issue) + '/votes') self._session.delete(url)
def remove_vote(self, issue): """Remove the current authenticated user's vote from an issue. :param issue: ID or key of the issue to remove vote on """ url = self._get_url('issue/' + str(issue) + '/votes') self._session.delete(url)
[ "Remove", "the", "current", "authenticated", "user", "s", "vote", "from", "an", "issue", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1831-L1837
[ "def", "remove_vote", "(", "self", ",", "issue", ")", ":", "url", "=", "self", ".", "_get_url", "(", "'issue/'", "+", "str", "(", "issue", ")", "+", "'/votes'", ")", "self", ".", "_session", ".", "delete", "(", "url", ")" ]
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.add_watcher
Add a user to an issue's watchers list. :param issue: ID or key of the issue affected :param watcher: username of the user to add to the watchers list
jira/client.py
def add_watcher(self, issue, watcher): """Add a user to an issue's watchers list. :param issue: ID or key of the issue affected :param watcher: username of the user to add to the watchers list """ url = self._get_url('issue/' + str(issue) + '/watchers') self._session.pos...
def add_watcher(self, issue, watcher): """Add a user to an issue's watchers list. :param issue: ID or key of the issue affected :param watcher: username of the user to add to the watchers list """ url = self._get_url('issue/' + str(issue) + '/watchers') self._session.pos...
[ "Add", "a", "user", "to", "an", "issue", "s", "watchers", "list", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1849-L1857
[ "def", "add_watcher", "(", "self", ",", "issue", ",", "watcher", ")", ":", "url", "=", "self", ".", "_get_url", "(", "'issue/'", "+", "str", "(", "issue", ")", "+", "'/watchers'", ")", "self", ".", "_session", ".", "post", "(", "url", ",", "data", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.remove_watcher
Remove a user from an issue's watch list. :param issue: ID or key of the issue affected :param watcher: username of the user to remove from the watchers list :rtype: Response
jira/client.py
def remove_watcher(self, issue, watcher): """Remove a user from an issue's watch list. :param issue: ID or key of the issue affected :param watcher: username of the user to remove from the watchers list :rtype: Response """ url = self._get_url('issue/' + str(issue) + '/w...
def remove_watcher(self, issue, watcher): """Remove a user from an issue's watch list. :param issue: ID or key of the issue affected :param watcher: username of the user to remove from the watchers list :rtype: Response """ url = self._get_url('issue/' + str(issue) + '/w...
[ "Remove", "a", "user", "from", "an", "issue", "s", "watch", "list", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1860-L1870
[ "def", "remove_watcher", "(", "self", ",", "issue", ",", "watcher", ")", ":", "url", "=", "self", ".", "_get_url", "(", "'issue/'", "+", "str", "(", "issue", ")", "+", "'/watchers'", ")", "params", "=", "{", "'username'", ":", "watcher", "}", "result",...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.worklogs
Get a list of worklog Resources from the server for an issue. :param issue: ID or key of the issue to get worklogs from :rtype: List[Worklog]
jira/client.py
def worklogs(self, issue): """Get a list of worklog Resources from the server for an issue. :param issue: ID or key of the issue to get worklogs from :rtype: List[Worklog] """ r_json = self._get_json('issue/' + str(issue) + '/worklog') worklogs = [Worklog(self._options, ...
def worklogs(self, issue): """Get a list of worklog Resources from the server for an issue. :param issue: ID or key of the issue to get worklogs from :rtype: List[Worklog] """ r_json = self._get_json('issue/' + str(issue) + '/worklog') worklogs = [Worklog(self._options, ...
[ "Get", "a", "list", "of", "worklog", "Resources", "from", "the", "server", "for", "an", "issue", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1873-L1882
[ "def", "worklogs", "(", "self", ",", "issue", ")", ":", "r_json", "=", "self", ".", "_get_json", "(", "'issue/'", "+", "str", "(", "issue", ")", "+", "'/worklog'", ")", "worklogs", "=", "[", "Worklog", "(", "self", ".", "_options", ",", "self", ".", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.add_worklog
Add a new worklog entry on an issue and return a Resource for it. :param issue: the issue to add the worklog to :param timeSpent: a worklog entry with this amount of time spent, e.g. "2d" :param adjustEstimate: (optional) allows the user to provide specific instructions to update the remaining ...
jira/client.py
def add_worklog(self, issue, timeSpent=None, timeSpentSeconds=None, adjustEstimate=None, newEstimate=None, reduceBy=None, comment=None, started=None, ...
def add_worklog(self, issue, timeSpent=None, timeSpentSeconds=None, adjustEstimate=None, newEstimate=None, reduceBy=None, comment=None, started=None, ...
[ "Add", "a", "new", "worklog", "entry", "on", "an", "issue", "and", "return", "a", "Resource", "for", "it", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1895-L1955
[ "def", "add_worklog", "(", "self", ",", "issue", ",", "timeSpent", "=", "None", ",", "timeSpentSeconds", "=", "None", ",", "adjustEstimate", "=", "None", ",", "newEstimate", "=", "None", ",", "reduceBy", "=", "None", ",", "comment", "=", "None", ",", "st...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.create_issue_link
Create a link between two issues. :param type: the type of link to create :param inwardIssue: the issue to link from :param outwardIssue: the issue to link to :param comment: a comment to add to the issues with the link. Should be a dict containing ``body`` and ``visibility...
jira/client.py
def create_issue_link(self, type, inwardIssue, outwardIssue, comment=None): """Create a link between two issues. :param type: the type of link to create :param inwardIssue: the issue to link from :param outwardIssue: the issue to link to :param comment: a comment to add to the ...
def create_issue_link(self, type, inwardIssue, outwardIssue, comment=None): """Create a link between two issues. :param type: the type of link to create :param inwardIssue: the issue to link from :param outwardIssue: the issue to link to :param comment: a comment to add to the ...
[ "Create", "a", "link", "between", "two", "issues", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L1960-L2002
[ "def", "create_issue_link", "(", "self", ",", "type", ",", "inwardIssue", ",", "outwardIssue", ",", "comment", "=", "None", ")", ":", "# let's see if we have the right issue link 'type' and fix it if needed", "if", "not", "hasattr", "(", "self", ",", "'_cached_issuetype...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.delete_issue_link
Delete a link between two issues. :param id: ID of the issue link to delete
jira/client.py
def delete_issue_link(self, id): """Delete a link between two issues. :param id: ID of the issue link to delete """ url = self._get_url('issueLink') + "/" + id return self._session.delete(url)
def delete_issue_link(self, id): """Delete a link between two issues. :param id: ID of the issue link to delete """ url = self._get_url('issueLink') + "/" + id return self._session.delete(url)
[ "Delete", "a", "link", "between", "two", "issues", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2004-L2010
[ "def", "delete_issue_link", "(", "self", ",", "id", ")", ":", "url", "=", "self", ".", "_get_url", "(", "'issueLink'", ")", "+", "\"/\"", "+", "id", "return", "self", ".", "_session", ".", "delete", "(", "url", ")" ]
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.issue_link_types
Get a list of issue link type Resources from the server. :rtype: List[IssueLinkType]
jira/client.py
def issue_link_types(self): """Get a list of issue link type Resources from the server. :rtype: List[IssueLinkType] """ r_json = self._get_json('issueLinkType') link_types = [IssueLinkType(self._options, self._session, raw_link_json) for raw_link_json in r_...
def issue_link_types(self): """Get a list of issue link type Resources from the server. :rtype: List[IssueLinkType] """ r_json = self._get_json('issueLinkType') link_types = [IssueLinkType(self._options, self._session, raw_link_json) for raw_link_json in r_...
[ "Get", "a", "list", "of", "issue", "link", "type", "Resources", "from", "the", "server", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2021-L2029
[ "def", "issue_link_types", "(", "self", ")", ":", "r_json", "=", "self", ".", "_get_json", "(", "'issueLinkType'", ")", "link_types", "=", "[", "IssueLinkType", "(", "self", ".", "_options", ",", "self", ".", "_session", ",", "raw_link_json", ")", "for", "...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.issue_types
Get a list of issue type Resources from the server. :rtype: List[IssueType]
jira/client.py
def issue_types(self): """Get a list of issue type Resources from the server. :rtype: List[IssueType] """ r_json = self._get_json('issuetype') issue_types = [IssueType( self._options, self._session, raw_type_json) for raw_type_json in r_json] return issue_ty...
def issue_types(self): """Get a list of issue type Resources from the server. :rtype: List[IssueType] """ r_json = self._get_json('issuetype') issue_types = [IssueType( self._options, self._session, raw_type_json) for raw_type_json in r_json] return issue_ty...
[ "Get", "a", "list", "of", "issue", "type", "Resources", "from", "the", "server", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2043-L2052
[ "def", "issue_types", "(", "self", ")", ":", "r_json", "=", "self", ".", "_get_json", "(", "'issuetype'", ")", "issue_types", "=", "[", "IssueType", "(", "self", ".", "_options", ",", "self", ".", "_session", ",", "raw_type_json", ")", "for", "raw_type_jso...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.issue_type_by_name
:param name: Name of the issue type :type name: str :rtype: IssueType
jira/client.py
def issue_type_by_name(self, name): """ :param name: Name of the issue type :type name: str :rtype: IssueType """ issue_types = self.issue_types() try: issue_type = [it for it in issue_types if it.name == name][0] except IndexError: ...
def issue_type_by_name(self, name): """ :param name: Name of the issue type :type name: str :rtype: IssueType """ issue_types = self.issue_types() try: issue_type = [it for it in issue_types if it.name == name][0] except IndexError: ...
[ ":", "param", "name", ":", "Name", "of", "the", "issue", "type", ":", "type", "name", ":", "str", ":", "rtype", ":", "IssueType" ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2062-L2073
[ "def", "issue_type_by_name", "(", "self", ",", "name", ")", ":", "issue_types", "=", "self", ".", "issue_types", "(", ")", "try", ":", "issue_type", "=", "[", "it", "for", "it", "in", "issue_types", "if", "it", ".", "name", "==", "name", "]", "[", "0...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.request_types
Returns request types supported by a service desk instance. :param service_desk: The service desk instance. :type service_desk: ServiceDesk :rtype: List[RequestType]
jira/client.py
def request_types(self, service_desk): """ Returns request types supported by a service desk instance. :param service_desk: The service desk instance. :type service_desk: ServiceDesk :rtype: List[RequestType] """ if hasattr(service_desk, 'id'): service_desk = ...
def request_types(self, service_desk): """ Returns request types supported by a service desk instance. :param service_desk: The service desk instance. :type service_desk: ServiceDesk :rtype: List[RequestType] """ if hasattr(service_desk, 'id'): service_desk = ...
[ "Returns", "request", "types", "supported", "by", "a", "service", "desk", "instance", ".", ":", "param", "service_desk", ":", "The", "service", "desk", "instance", ".", ":", "type", "service_desk", ":", "ServiceDesk", ":", "rtype", ":", "List", "[", "Request...
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2075-L2091
[ "def", "request_types", "(", "self", ",", "service_desk", ")", ":", "if", "hasattr", "(", "service_desk", ",", "'id'", ")", ":", "service_desk", "=", "service_desk", ".", "id", "url", "=", "(", "self", ".", "_options", "[", "'server'", "]", "+", "'/rest/...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.my_permissions
Get a dict of all available permissions on the server. :param projectKey: limit returned permissions to the specified project :type projectKey: Optional[str] :param projectId: limit returned permissions to the specified project :type projectId: Optional[str] :param issueKey: lim...
jira/client.py
def my_permissions(self, projectKey=None, projectId=None, issueKey=None, issueId=None, ): """Get a dict of all available permissions on the server. :param projectKey: limit returned permis...
def my_permissions(self, projectKey=None, projectId=None, issueKey=None, issueId=None, ): """Get a dict of all available permissions on the server. :param projectKey: limit returned permis...
[ "Get", "a", "dict", "of", "all", "available", "permissions", "on", "the", "server", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2104-L2131
[ "def", "my_permissions", "(", "self", ",", "projectKey", "=", "None", ",", "projectId", "=", "None", ",", "issueKey", "=", "None", ",", "issueId", "=", "None", ",", ")", ":", "params", "=", "{", "}", "if", "projectKey", "is", "not", "None", ":", "par...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.priorities
Get a list of priority Resources from the server. :rtype: List[Priority]
jira/client.py
def priorities(self): """Get a list of priority Resources from the server. :rtype: List[Priority] """ r_json = self._get_json('priority') priorities = [Priority( self._options, self._session, raw_priority_json) for raw_priority_json in r_json] return priorit...
def priorities(self): """Get a list of priority Resources from the server. :rtype: List[Priority] """ r_json = self._get_json('priority') priorities = [Priority( self._options, self._session, raw_priority_json) for raw_priority_json in r_json] return priorit...
[ "Get", "a", "list", "of", "priority", "Resources", "from", "the", "server", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2135-L2144
[ "def", "priorities", "(", "self", ")", ":", "r_json", "=", "self", ".", "_get_json", "(", "'priority'", ")", "priorities", "=", "[", "Priority", "(", "self", ".", "_options", ",", "self", ".", "_session", ",", "raw_priority_json", ")", "for", "raw_priority...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.projects
Get a list of project Resources from the server visible to the current authenticated user. :rtype: List[Project]
jira/client.py
def projects(self): """Get a list of project Resources from the server visible to the current authenticated user. :rtype: List[Project] """ r_json = self._get_json('project') projects = [Project( self._options, self._session, raw_project_json) for raw_project_json i...
def projects(self): """Get a list of project Resources from the server visible to the current authenticated user. :rtype: List[Project] """ r_json = self._get_json('project') projects = [Project( self._options, self._session, raw_project_json) for raw_project_json i...
[ "Get", "a", "list", "of", "project", "Resources", "from", "the", "server", "visible", "to", "the", "current", "authenticated", "user", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2158-L2167
[ "def", "projects", "(", "self", ")", ":", "r_json", "=", "self", ".", "_get_json", "(", "'project'", ")", "projects", "=", "[", "Project", "(", "self", ".", "_options", ",", "self", ".", "_session", ",", "raw_project_json", ")", "for", "raw_project_json", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.create_temp_project_avatar
Register an image file as a project avatar. The avatar created is temporary and must be confirmed before it can be used. Avatar images are specified by a filename, size, and file object. By default, the client will attempt to autodetect the picture's content type: this mechanis...
jira/client.py
def create_temp_project_avatar(self, project, filename, size, avatar_img, contentType=None, auto_confirm=False): """Register an image file as a project avatar. The avatar created is temporary and must be confirmed before it can be used. Avatar images are specified by a filename, si...
def create_temp_project_avatar(self, project, filename, size, avatar_img, contentType=None, auto_confirm=False): """Register an image file as a project avatar. The avatar created is temporary and must be confirmed before it can be used. Avatar images are specified by a filename, si...
[ "Register", "an", "image", "file", "as", "a", "project", "avatar", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2187-L2237
[ "def", "create_temp_project_avatar", "(", "self", ",", "project", ",", "filename", ",", "size", ",", "avatar_img", ",", "contentType", "=", "None", ",", "auto_confirm", "=", "False", ")", ":", "size_from_file", "=", "os", ".", "path", ".", "getsize", "(", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.confirm_project_avatar
Confirm the temporary avatar image previously uploaded with the specified cropping. After a successful registry with :py:meth:`create_temp_project_avatar`, use this method to confirm the avatar for use. The final avatar can be a subarea of the uploaded image, which is customized with the ``crop...
jira/client.py
def confirm_project_avatar(self, project, cropping_properties): """Confirm the temporary avatar image previously uploaded with the specified cropping. After a successful registry with :py:meth:`create_temp_project_avatar`, use this method to confirm the avatar for use. The final avatar can be a...
def confirm_project_avatar(self, project, cropping_properties): """Confirm the temporary avatar image previously uploaded with the specified cropping. After a successful registry with :py:meth:`create_temp_project_avatar`, use this method to confirm the avatar for use. The final avatar can be a...
[ "Confirm", "the", "temporary", "avatar", "image", "previously", "uploaded", "with", "the", "specified", "cropping", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2240-L2256
[ "def", "confirm_project_avatar", "(", "self", ",", "project", ",", "cropping_properties", ")", ":", "data", "=", "cropping_properties", "url", "=", "self", ".", "_get_url", "(", "'project/'", "+", "project", "+", "'/avatar'", ")", "r", "=", "self", ".", "_se...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.set_project_avatar
Set a project's avatar. :param project: ID or key of the project to set the avatar on :param avatar: ID of the avatar to set
jira/client.py
def set_project_avatar(self, project, avatar): """Set a project's avatar. :param project: ID or key of the project to set the avatar on :param avatar: ID of the avatar to set """ self._set_avatar( None, self._get_url('project/' + project + '/avatar'), avatar)
def set_project_avatar(self, project, avatar): """Set a project's avatar. :param project: ID or key of the project to set the avatar on :param avatar: ID of the avatar to set """ self._set_avatar( None, self._get_url('project/' + project + '/avatar'), avatar)
[ "Set", "a", "project", "s", "avatar", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2259-L2266
[ "def", "set_project_avatar", "(", "self", ",", "project", ",", "avatar", ")", ":", "self", ".", "_set_avatar", "(", "None", ",", "self", ".", "_get_url", "(", "'project/'", "+", "project", "+", "'/avatar'", ")", ",", "avatar", ")" ]
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.delete_project_avatar
Delete a project's avatar. :param project: ID or key of the project to delete the avatar from :param avatar: ID of the avatar to delete
jira/client.py
def delete_project_avatar(self, project, avatar): """Delete a project's avatar. :param project: ID or key of the project to delete the avatar from :param avatar: ID of the avatar to delete """ url = self._get_url('project/' + project + '/avatar/' + avatar) return self._s...
def delete_project_avatar(self, project, avatar): """Delete a project's avatar. :param project: ID or key of the project to delete the avatar from :param avatar: ID of the avatar to delete """ url = self._get_url('project/' + project + '/avatar/' + avatar) return self._s...
[ "Delete", "a", "project", "s", "avatar", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2269-L2276
[ "def", "delete_project_avatar", "(", "self", ",", "project", ",", "avatar", ")", ":", "url", "=", "self", ".", "_get_url", "(", "'project/'", "+", "project", "+", "'/avatar/'", "+", "avatar", ")", "return", "self", ".", "_session", ".", "delete", "(", "u...
397db5d78441ed6a680a9b7db4c62030ade1fd8a
train
JIRA.project_components
Get a list of component Resources present on a project. :param project: ID or key of the project to get components from :type project: str :rtype: List[Component]
jira/client.py
def project_components(self, project): """Get a list of component Resources present on a project. :param project: ID or key of the project to get components from :type project: str :rtype: List[Component] """ r_json = self._get_json('project/' + project + '/components') ...
def project_components(self, project): """Get a list of component Resources present on a project. :param project: ID or key of the project to get components from :type project: str :rtype: List[Component] """ r_json = self._get_json('project/' + project + '/components') ...
[ "Get", "a", "list", "of", "component", "Resources", "present", "on", "a", "project", "." ]
pycontribs/jira
python
https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2279-L2289
[ "def", "project_components", "(", "self", ",", "project", ")", ":", "r_json", "=", "self", ".", "_get_json", "(", "'project/'", "+", "project", "+", "'/components'", ")", "components", "=", "[", "Component", "(", "self", ".", "_options", ",", "self", ".", ...
397db5d78441ed6a680a9b7db4c62030ade1fd8a