repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
twidi/django-extended-choices | extended_choices/helpers.py | create_choice_attribute | def create_choice_attribute(creator_type, value, choice_entry):
"""Create an instance of a subclass of ChoiceAttributeMixin for the given value.
Parameters
----------
creator_type : type
``ChoiceAttributeMixin`` or a subclass, from which we'll call the ``get_class_for_value``
class-meth... | python | def create_choice_attribute(creator_type, value, choice_entry):
"""Create an instance of a subclass of ChoiceAttributeMixin for the given value.
Parameters
----------
creator_type : type
``ChoiceAttributeMixin`` or a subclass, from which we'll call the ``get_class_for_value``
class-meth... | [
"def",
"create_choice_attribute",
"(",
"creator_type",
",",
"value",
",",
"choice_entry",
")",
":",
"klass",
"=",
"creator_type",
".",
"get_class_for_value",
"(",
"value",
")",
"return",
"klass",
"(",
"value",
",",
"choice_entry",
")"
] | Create an instance of a subclass of ChoiceAttributeMixin for the given value.
Parameters
----------
creator_type : type
``ChoiceAttributeMixin`` or a subclass, from which we'll call the ``get_class_for_value``
class-method.
value : ?
The value for which we want to create an inst... | [
"Create",
"an",
"instance",
"of",
"a",
"subclass",
"of",
"ChoiceAttributeMixin",
"for",
"the",
"given",
"value",
"."
] | train | https://github.com/twidi/django-extended-choices/blob/bb310c5da4d53685c69173541172e4b813a6afb2/extended_choices/helpers.py#L200-L222 |
twidi/django-extended-choices | extended_choices/helpers.py | ChoiceAttributeMixin.get_class_for_value | def get_class_for_value(cls, value):
"""Class method to construct a class based on this mixin and the type of the given value.
Parameters
----------
value: ?
The value from which to extract the type to create the new class.
Notes
-----
The create cl... | python | def get_class_for_value(cls, value):
"""Class method to construct a class based on this mixin and the type of the given value.
Parameters
----------
value: ?
The value from which to extract the type to create the new class.
Notes
-----
The create cl... | [
"def",
"get_class_for_value",
"(",
"cls",
",",
"value",
")",
":",
"type_",
"=",
"value",
".",
"__class__",
"# Check if the type is already a ``ChoiceAttribute``",
"if",
"issubclass",
"(",
"type_",
",",
"ChoiceAttributeMixin",
")",
":",
"# In this case we can return this t... | Class method to construct a class based on this mixin and the type of the given value.
Parameters
----------
value: ?
The value from which to extract the type to create the new class.
Notes
-----
The create classes are cached (in ``cls.__classes_by_type``) ... | [
"Class",
"method",
"to",
"construct",
"a",
"class",
"based",
"on",
"this",
"mixin",
"and",
"the",
"type",
"of",
"the",
"given",
"value",
"."
] | train | https://github.com/twidi/django-extended-choices/blob/bb310c5da4d53685c69173541172e4b813a6afb2/extended_choices/helpers.py#L136-L166 |
twidi/django-extended-choices | extended_choices/helpers.py | ChoiceEntry._get_choice_attribute | def _get_choice_attribute(self, value):
"""Get a choice attribute for the given value.
Parameters
----------
value: ?
The value for which we want a choice attribute.
Returns
-------
An instance of a class based on ``ChoiceAttributeMixin`` for the giv... | python | def _get_choice_attribute(self, value):
"""Get a choice attribute for the given value.
Parameters
----------
value: ?
The value for which we want a choice attribute.
Returns
-------
An instance of a class based on ``ChoiceAttributeMixin`` for the giv... | [
"def",
"_get_choice_attribute",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'Using `None` in a `Choices` object is not supported. You may '",
"'use an empty string.'",
")",
"return",
"create_choice_attribute",
"(",
"... | Get a choice attribute for the given value.
Parameters
----------
value: ?
The value for which we want a choice attribute.
Returns
-------
An instance of a class based on ``ChoiceAttributeMixin`` for the given value.
Raises
------
Va... | [
"Get",
"a",
"choice",
"attribute",
"for",
"the",
"given",
"value",
"."
] | train | https://github.com/twidi/django-extended-choices/blob/bb310c5da4d53685c69173541172e4b813a6afb2/extended_choices/helpers.py#L306-L329 |
grundic/yagocd | yagocd/session.py | Session.urljoin | def urljoin(*args):
"""
Joins given arguments into a url. Trailing but not leading slashes are
stripped for each argument.
"""
return "/".join(map(lambda x: str(x).rstrip('/'), args)).rstrip('/') | python | def urljoin(*args):
"""
Joins given arguments into a url. Trailing but not leading slashes are
stripped for each argument.
"""
return "/".join(map(lambda x: str(x).rstrip('/'), args)).rstrip('/') | [
"def",
"urljoin",
"(",
"*",
"args",
")",
":",
"return",
"\"/\"",
".",
"join",
"(",
"map",
"(",
"lambda",
"x",
":",
"str",
"(",
"x",
")",
".",
"rstrip",
"(",
"'/'",
")",
",",
"args",
")",
")",
".",
"rstrip",
"(",
"'/'",
")"
] | Joins given arguments into a url. Trailing but not leading slashes are
stripped for each argument. | [
"Joins",
"given",
"arguments",
"into",
"a",
"url",
".",
"Trailing",
"but",
"not",
"leading",
"slashes",
"are",
"stripped",
"for",
"each",
"argument",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/session.py#L52-L57 |
grundic/yagocd | yagocd/session.py | Session.server_version | def server_version(self):
"""
Special method for getting server version.
Because of different behaviour on different versions of
server, we have to pass different headers to the endpoints.
This method requests the version from server and caches it
in internal variable, s... | python | def server_version(self):
"""
Special method for getting server version.
Because of different behaviour on different versions of
server, we have to pass different headers to the endpoints.
This method requests the version from server and caches it
in internal variable, s... | [
"def",
"server_version",
"(",
"self",
")",
":",
"if",
"self",
".",
"__server_version",
"is",
"None",
":",
"from",
"yagocd",
".",
"resources",
".",
"info",
"import",
"InfoManager",
"self",
".",
"__server_version",
"=",
"InfoManager",
"(",
"self",
")",
".",
... | Special method for getting server version.
Because of different behaviour on different versions of
server, we have to pass different headers to the endpoints.
This method requests the version from server and caches it
in internal variable, so other resources could use it.
:retu... | [
"Special",
"method",
"for",
"getting",
"server",
"version",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/session.py#L69-L84 |
grundic/yagocd | yagocd/resources/job.py | JobInstance.pipeline_name | def pipeline_name(self):
"""
Get pipeline name of current job instance.
Because instantiating job instance could be performed in different ways and those return different results,
we have to check where from to get name of the pipeline.
:return: pipeline name.
"""
... | python | def pipeline_name(self):
"""
Get pipeline name of current job instance.
Because instantiating job instance could be performed in different ways and those return different results,
we have to check where from to get name of the pipeline.
:return: pipeline name.
"""
... | [
"def",
"pipeline_name",
"(",
"self",
")",
":",
"if",
"'pipeline_name'",
"in",
"self",
".",
"data",
"and",
"self",
".",
"data",
".",
"pipeline_name",
":",
"return",
"self",
".",
"data",
".",
"get",
"(",
"'pipeline_name'",
")",
"elif",
"self",
".",
"stage"... | Get pipeline name of current job instance.
Because instantiating job instance could be performed in different ways and those return different results,
we have to check where from to get name of the pipeline.
:return: pipeline name. | [
"Get",
"pipeline",
"name",
"of",
"current",
"job",
"instance",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/job.py#L134-L148 |
grundic/yagocd | yagocd/resources/job.py | JobInstance.pipeline_counter | def pipeline_counter(self):
"""
Get pipeline counter of current job instance.
Because instantiating job instance could be performed in different ways and those return different results,
we have to check where from to get counter of the pipeline.
:return: pipeline counter.
... | python | def pipeline_counter(self):
"""
Get pipeline counter of current job instance.
Because instantiating job instance could be performed in different ways and those return different results,
we have to check where from to get counter of the pipeline.
:return: pipeline counter.
... | [
"def",
"pipeline_counter",
"(",
"self",
")",
":",
"if",
"'pipeline_counter'",
"in",
"self",
".",
"data",
"and",
"self",
".",
"data",
".",
"pipeline_counter",
":",
"return",
"self",
".",
"data",
".",
"get",
"(",
"'pipeline_counter'",
")",
"elif",
"self",
".... | Get pipeline counter of current job instance.
Because instantiating job instance could be performed in different ways and those return different results,
we have to check where from to get counter of the pipeline.
:return: pipeline counter. | [
"Get",
"pipeline",
"counter",
"of",
"current",
"job",
"instance",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/job.py#L151-L165 |
grundic/yagocd | yagocd/resources/job.py | JobInstance.stage_name | def stage_name(self):
"""
Get stage name of current job instance.
Because instantiating job instance could be performed in different ways and those return different results,
we have to check where from to get name of the stage.
:return: stage name.
"""
if 'stage... | python | def stage_name(self):
"""
Get stage name of current job instance.
Because instantiating job instance could be performed in different ways and those return different results,
we have to check where from to get name of the stage.
:return: stage name.
"""
if 'stage... | [
"def",
"stage_name",
"(",
"self",
")",
":",
"if",
"'stage_name'",
"in",
"self",
".",
"data",
"and",
"self",
".",
"data",
".",
"stage_name",
":",
"return",
"self",
".",
"data",
".",
"get",
"(",
"'stage_name'",
")",
"else",
":",
"return",
"self",
".",
... | Get stage name of current job instance.
Because instantiating job instance could be performed in different ways and those return different results,
we have to check where from to get name of the stage.
:return: stage name. | [
"Get",
"stage",
"name",
"of",
"current",
"job",
"instance",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/job.py#L168-L180 |
grundic/yagocd | yagocd/resources/job.py | JobInstance.stage_counter | def stage_counter(self):
"""
Get stage counter of current job instance.
Because instantiating job instance could be performed in different ways and those return different results,
we have to check where from to get counter of the stage.
:return: stage counter.
"""
... | python | def stage_counter(self):
"""
Get stage counter of current job instance.
Because instantiating job instance could be performed in different ways and those return different results,
we have to check where from to get counter of the stage.
:return: stage counter.
"""
... | [
"def",
"stage_counter",
"(",
"self",
")",
":",
"if",
"'stage_counter'",
"in",
"self",
".",
"data",
"and",
"self",
".",
"data",
".",
"stage_counter",
":",
"return",
"self",
".",
"data",
".",
"get",
"(",
"'stage_counter'",
")",
"else",
":",
"return",
"self... | Get stage counter of current job instance.
Because instantiating job instance could be performed in different ways and those return different results,
we have to check where from to get counter of the stage.
:return: stage counter. | [
"Get",
"stage",
"counter",
"of",
"current",
"job",
"instance",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/job.py#L183-L195 |
grundic/yagocd | yagocd/resources/job.py | JobInstance.artifacts | def artifacts(self):
"""
Property for accessing artifact manager of the current job.
:return: instance of :class:`yagocd.resources.artifact.ArtifactManager`
:rtype: yagocd.resources.artifact.ArtifactManager
"""
return ArtifactManager(
session=self._session,
... | python | def artifacts(self):
"""
Property for accessing artifact manager of the current job.
:return: instance of :class:`yagocd.resources.artifact.ArtifactManager`
:rtype: yagocd.resources.artifact.ArtifactManager
"""
return ArtifactManager(
session=self._session,
... | [
"def",
"artifacts",
"(",
"self",
")",
":",
"return",
"ArtifactManager",
"(",
"session",
"=",
"self",
".",
"_session",
",",
"pipeline_name",
"=",
"self",
".",
"pipeline_name",
",",
"pipeline_counter",
"=",
"self",
".",
"pipeline_counter",
",",
"stage_name",
"="... | Property for accessing artifact manager of the current job.
:return: instance of :class:`yagocd.resources.artifact.ArtifactManager`
:rtype: yagocd.resources.artifact.ArtifactManager | [
"Property",
"for",
"accessing",
"artifact",
"manager",
"of",
"the",
"current",
"job",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/job.py#L218-L232 |
grundic/yagocd | yagocd/resources/job.py | JobInstance.properties | def properties(self):
"""
Property for accessing property (doh!) manager of the current job.
:return: instance of :class:`yagocd.resources.property.PropertyManager`
:rtype: yagocd.resources.property.PropertyManager
"""
return PropertyManager(
session=self._se... | python | def properties(self):
"""
Property for accessing property (doh!) manager of the current job.
:return: instance of :class:`yagocd.resources.property.PropertyManager`
:rtype: yagocd.resources.property.PropertyManager
"""
return PropertyManager(
session=self._se... | [
"def",
"properties",
"(",
"self",
")",
":",
"return",
"PropertyManager",
"(",
"session",
"=",
"self",
".",
"_session",
",",
"pipeline_name",
"=",
"self",
".",
"pipeline_name",
",",
"pipeline_counter",
"=",
"self",
".",
"pipeline_counter",
",",
"stage_name",
"=... | Property for accessing property (doh!) manager of the current job.
:return: instance of :class:`yagocd.resources.property.PropertyManager`
:rtype: yagocd.resources.property.PropertyManager | [
"Property",
"for",
"accessing",
"property",
"(",
"doh!",
")",
"manager",
"of",
"the",
"current",
"job",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/job.py#L235-L249 |
grundic/yagocd | yagocd/resources/stage.py | StageInstance.url | def url(self):
"""
Returns url for accessing stage instance.
"""
return "{server_url}/go/pipelines/{pipeline_name}/{pipeline_counter}/{stage_name}/{stage_counter}".format(
server_url=self._session.server_url,
pipeline_name=self.pipeline_name,
pipeline_... | python | def url(self):
"""
Returns url for accessing stage instance.
"""
return "{server_url}/go/pipelines/{pipeline_name}/{pipeline_counter}/{stage_name}/{stage_counter}".format(
server_url=self._session.server_url,
pipeline_name=self.pipeline_name,
pipeline_... | [
"def",
"url",
"(",
"self",
")",
":",
"return",
"\"{server_url}/go/pipelines/{pipeline_name}/{pipeline_counter}/{stage_name}/{stage_counter}\"",
".",
"format",
"(",
"server_url",
"=",
"self",
".",
"_session",
".",
"server_url",
",",
"pipeline_name",
"=",
"self",
".",
"pi... | Returns url for accessing stage instance. | [
"Returns",
"url",
"for",
"accessing",
"stage",
"instance",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/stage.py#L247-L257 |
grundic/yagocd | yagocd/resources/stage.py | StageInstance.pipeline_name | def pipeline_name(self):
"""
Get pipeline name of current stage instance.
Because instantiating stage instance could be performed in different ways and those return different results,
we have to check where from to get name of the pipeline.
:return: pipeline name.
"""
... | python | def pipeline_name(self):
"""
Get pipeline name of current stage instance.
Because instantiating stage instance could be performed in different ways and those return different results,
we have to check where from to get name of the pipeline.
:return: pipeline name.
"""
... | [
"def",
"pipeline_name",
"(",
"self",
")",
":",
"if",
"'pipeline_name'",
"in",
"self",
".",
"data",
":",
"return",
"self",
".",
"data",
".",
"get",
"(",
"'pipeline_name'",
")",
"elif",
"self",
".",
"pipeline",
"is",
"not",
"None",
":",
"return",
"self",
... | Get pipeline name of current stage instance.
Because instantiating stage instance could be performed in different ways and those return different results,
we have to check where from to get name of the pipeline.
:return: pipeline name. | [
"Get",
"pipeline",
"name",
"of",
"current",
"stage",
"instance",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/stage.py#L260-L272 |
grundic/yagocd | yagocd/resources/stage.py | StageInstance.pipeline_counter | def pipeline_counter(self):
"""
Get pipeline counter of current stage instance.
Because instantiating stage instance could be performed in different ways and those return different results,
we have to check where from to get counter of the pipeline.
:return: pipeline counter.
... | python | def pipeline_counter(self):
"""
Get pipeline counter of current stage instance.
Because instantiating stage instance could be performed in different ways and those return different results,
we have to check where from to get counter of the pipeline.
:return: pipeline counter.
... | [
"def",
"pipeline_counter",
"(",
"self",
")",
":",
"if",
"'pipeline_counter'",
"in",
"self",
".",
"data",
":",
"return",
"self",
".",
"data",
".",
"get",
"(",
"'pipeline_counter'",
")",
"elif",
"self",
".",
"pipeline",
"is",
"not",
"None",
":",
"return",
... | Get pipeline counter of current stage instance.
Because instantiating stage instance could be performed in different ways and those return different results,
we have to check where from to get counter of the pipeline.
:return: pipeline counter. | [
"Get",
"pipeline",
"counter",
"of",
"current",
"stage",
"instance",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/stage.py#L275-L287 |
grundic/yagocd | yagocd/resources/stage.py | StageInstance.cancel | def cancel(self):
"""
Cancel an active stage of a specified stage.
:return: a text confirmation.
"""
return self._manager.cancel(pipeline_name=self.pipeline_name, stage_name=self.stage_name) | python | def cancel(self):
"""
Cancel an active stage of a specified stage.
:return: a text confirmation.
"""
return self._manager.cancel(pipeline_name=self.pipeline_name, stage_name=self.stage_name) | [
"def",
"cancel",
"(",
"self",
")",
":",
"return",
"self",
".",
"_manager",
".",
"cancel",
"(",
"pipeline_name",
"=",
"self",
".",
"pipeline_name",
",",
"stage_name",
"=",
"self",
".",
"stage_name",
")"
] | Cancel an active stage of a specified stage.
:return: a text confirmation. | [
"Cancel",
"an",
"active",
"stage",
"of",
"a",
"specified",
"stage",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/stage.py#L317-L323 |
grundic/yagocd | yagocd/resources/stage.py | StageInstance.jobs | def jobs(self):
"""
Method for getting jobs from stage instance.
:return: arrays of jobs.
:rtype: list of yagocd.resources.job.JobInstance
"""
jobs = list()
for data in self.data.jobs:
jobs.append(JobInstance(session=self._session, data=data, stage=se... | python | def jobs(self):
"""
Method for getting jobs from stage instance.
:return: arrays of jobs.
:rtype: list of yagocd.resources.job.JobInstance
"""
jobs = list()
for data in self.data.jobs:
jobs.append(JobInstance(session=self._session, data=data, stage=se... | [
"def",
"jobs",
"(",
"self",
")",
":",
"jobs",
"=",
"list",
"(",
")",
"for",
"data",
"in",
"self",
".",
"data",
".",
"jobs",
":",
"jobs",
".",
"append",
"(",
"JobInstance",
"(",
"session",
"=",
"self",
".",
"_session",
",",
"data",
"=",
"data",
",... | Method for getting jobs from stage instance.
:return: arrays of jobs.
:rtype: list of yagocd.resources.job.JobInstance | [
"Method",
"for",
"getting",
"jobs",
"from",
"stage",
"instance",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/stage.py#L325-L336 |
grundic/yagocd | yagocd/resources/stage.py | StageInstance.job | def job(self, name):
"""
Method for searching specific job by it's name.
:param name: name of the job to search.
:return: found job or None.
:rtype: yagocd.resources.job.JobInstance
"""
for job in self.jobs():
if job.data.name == name:
... | python | def job(self, name):
"""
Method for searching specific job by it's name.
:param name: name of the job to search.
:return: found job or None.
:rtype: yagocd.resources.job.JobInstance
"""
for job in self.jobs():
if job.data.name == name:
... | [
"def",
"job",
"(",
"self",
",",
"name",
")",
":",
"for",
"job",
"in",
"self",
".",
"jobs",
"(",
")",
":",
"if",
"job",
".",
"data",
".",
"name",
"==",
"name",
":",
"return",
"job"
] | Method for searching specific job by it's name.
:param name: name of the job to search.
:return: found job or None.
:rtype: yagocd.resources.job.JobInstance | [
"Method",
"for",
"searching",
"specific",
"job",
"by",
"it",
"s",
"name",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/stage.py#L338-L348 |
grundic/yagocd | yagocd/client.py | Yagocd.agents | def agents(self):
"""
Property for accessing :class:`AgentManager` instance, which is used to manage agents.
:rtype: yagocd.resources.agent.AgentManager
"""
if self._agent_manager is None:
self._agent_manager = AgentManager(session=self._session)
return self.... | python | def agents(self):
"""
Property for accessing :class:`AgentManager` instance, which is used to manage agents.
:rtype: yagocd.resources.agent.AgentManager
"""
if self._agent_manager is None:
self._agent_manager = AgentManager(session=self._session)
return self.... | [
"def",
"agents",
"(",
"self",
")",
":",
"if",
"self",
".",
"_agent_manager",
"is",
"None",
":",
"self",
".",
"_agent_manager",
"=",
"AgentManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_agent_manager"
] | Property for accessing :class:`AgentManager` instance, which is used to manage agents.
:rtype: yagocd.resources.agent.AgentManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"AgentManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"agents",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L131-L139 |
grundic/yagocd | yagocd/client.py | Yagocd.artifacts | def artifacts(self):
"""
Property for accessing :class:`ArtifactManager` instance, which is used to manage artifacts.
:rtype: yagocd.resources.artifact.ArtifactManager
"""
if self._artifact_manager is None:
self._artifact_manager = ArtifactManager(session=self._sessi... | python | def artifacts(self):
"""
Property for accessing :class:`ArtifactManager` instance, which is used to manage artifacts.
:rtype: yagocd.resources.artifact.ArtifactManager
"""
if self._artifact_manager is None:
self._artifact_manager = ArtifactManager(session=self._sessi... | [
"def",
"artifacts",
"(",
"self",
")",
":",
"if",
"self",
".",
"_artifact_manager",
"is",
"None",
":",
"self",
".",
"_artifact_manager",
"=",
"ArtifactManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_artifact_manager"
] | Property for accessing :class:`ArtifactManager` instance, which is used to manage artifacts.
:rtype: yagocd.resources.artifact.ArtifactManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"ArtifactManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"artifacts",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L142-L150 |
grundic/yagocd | yagocd/client.py | Yagocd.configurations | def configurations(self):
"""
Property for accessing :class:`ConfigurationManager` instance, which is used to manage configurations.
:rtype: yagocd.resources.configuration.ConfigurationManager
"""
if self._configuration_manager is None:
self._configuration_manager = ... | python | def configurations(self):
"""
Property for accessing :class:`ConfigurationManager` instance, which is used to manage configurations.
:rtype: yagocd.resources.configuration.ConfigurationManager
"""
if self._configuration_manager is None:
self._configuration_manager = ... | [
"def",
"configurations",
"(",
"self",
")",
":",
"if",
"self",
".",
"_configuration_manager",
"is",
"None",
":",
"self",
".",
"_configuration_manager",
"=",
"ConfigurationManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_conf... | Property for accessing :class:`ConfigurationManager` instance, which is used to manage configurations.
:rtype: yagocd.resources.configuration.ConfigurationManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"ConfigurationManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"configurations",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L153-L161 |
grundic/yagocd | yagocd/client.py | Yagocd.encryption | def encryption(self):
"""
Property for accessing :class:`EncryptionManager` instance,
which is used to manage encryption.
:rtype: yagocd.resources.encryption.EncryptionManager
"""
if self._encryption_manager is None:
self._encryption_manager = EncryptionManag... | python | def encryption(self):
"""
Property for accessing :class:`EncryptionManager` instance,
which is used to manage encryption.
:rtype: yagocd.resources.encryption.EncryptionManager
"""
if self._encryption_manager is None:
self._encryption_manager = EncryptionManag... | [
"def",
"encryption",
"(",
"self",
")",
":",
"if",
"self",
".",
"_encryption_manager",
"is",
"None",
":",
"self",
".",
"_encryption_manager",
"=",
"EncryptionManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_encryption_manage... | Property for accessing :class:`EncryptionManager` instance,
which is used to manage encryption.
:rtype: yagocd.resources.encryption.EncryptionManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"EncryptionManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"encryption",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L164-L173 |
grundic/yagocd | yagocd/client.py | Yagocd.elastic_profiles | def elastic_profiles(self):
"""
Property for accessing :class:`ElasticAgentProfileManager` instance,
which is used to manage elastic agent profiles.
:rtype: yagocd.resources.elastic_profile.ElasticAgentProfileManager
"""
if self._elastic_agent_profile_manager is None:
... | python | def elastic_profiles(self):
"""
Property for accessing :class:`ElasticAgentProfileManager` instance,
which is used to manage elastic agent profiles.
:rtype: yagocd.resources.elastic_profile.ElasticAgentProfileManager
"""
if self._elastic_agent_profile_manager is None:
... | [
"def",
"elastic_profiles",
"(",
"self",
")",
":",
"if",
"self",
".",
"_elastic_agent_profile_manager",
"is",
"None",
":",
"self",
".",
"_elastic_agent_profile_manager",
"=",
"ElasticAgentProfileManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
... | Property for accessing :class:`ElasticAgentProfileManager` instance,
which is used to manage elastic agent profiles.
:rtype: yagocd.resources.elastic_profile.ElasticAgentProfileManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"ElasticAgentProfileManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"elastic",
"agent",
"profiles",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L176-L185 |
grundic/yagocd | yagocd/client.py | Yagocd.environments | def environments(self):
"""
Property for accessing :class:`EnvironmentManager` instance, which is used to manage environments.
:rtype: yagocd.resources.environment.EnvironmentManager
"""
if self._environment_manager is None:
self._environment_manager = EnvironmentMan... | python | def environments(self):
"""
Property for accessing :class:`EnvironmentManager` instance, which is used to manage environments.
:rtype: yagocd.resources.environment.EnvironmentManager
"""
if self._environment_manager is None:
self._environment_manager = EnvironmentMan... | [
"def",
"environments",
"(",
"self",
")",
":",
"if",
"self",
".",
"_environment_manager",
"is",
"None",
":",
"self",
".",
"_environment_manager",
"=",
"EnvironmentManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_environment_... | Property for accessing :class:`EnvironmentManager` instance, which is used to manage environments.
:rtype: yagocd.resources.environment.EnvironmentManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"EnvironmentManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"environments",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L188-L196 |
grundic/yagocd | yagocd/client.py | Yagocd.feeds | def feeds(self):
"""
Property for accessing :class:`FeedManager` instance, which is used to manage feeds.
:rtype: yagocd.resources.feed.FeedManager
"""
if self._feed_manager is None:
self._feed_manager = FeedManager(session=self._session)
return self._feed_ma... | python | def feeds(self):
"""
Property for accessing :class:`FeedManager` instance, which is used to manage feeds.
:rtype: yagocd.resources.feed.FeedManager
"""
if self._feed_manager is None:
self._feed_manager = FeedManager(session=self._session)
return self._feed_ma... | [
"def",
"feeds",
"(",
"self",
")",
":",
"if",
"self",
".",
"_feed_manager",
"is",
"None",
":",
"self",
".",
"_feed_manager",
"=",
"FeedManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_feed_manager"
] | Property for accessing :class:`FeedManager` instance, which is used to manage feeds.
:rtype: yagocd.resources.feed.FeedManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"FeedManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"feeds",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L199-L207 |
grundic/yagocd | yagocd/client.py | Yagocd.jobs | def jobs(self):
"""
Property for accessing :class:`JobManager` instance, which is used to manage feeds.
:rtype: yagocd.resources.job.JobManager
"""
if self._job_manager is None:
self._job_manager = JobManager(session=self._session)
return self._job_manager | python | def jobs(self):
"""
Property for accessing :class:`JobManager` instance, which is used to manage feeds.
:rtype: yagocd.resources.job.JobManager
"""
if self._job_manager is None:
self._job_manager = JobManager(session=self._session)
return self._job_manager | [
"def",
"jobs",
"(",
"self",
")",
":",
"if",
"self",
".",
"_job_manager",
"is",
"None",
":",
"self",
".",
"_job_manager",
"=",
"JobManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_job_manager"
] | Property for accessing :class:`JobManager` instance, which is used to manage feeds.
:rtype: yagocd.resources.job.JobManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"JobManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"feeds",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L210-L218 |
grundic/yagocd | yagocd/client.py | Yagocd.info | def info(self):
"""
Property for accessing :class:`InfoManager` instance, which is used to general server info.
:rtype: yagocd.resources.info.InfoManager
"""
if self._info_manager is None:
self._info_manager = InfoManager(session=self._session)
return self._i... | python | def info(self):
"""
Property for accessing :class:`InfoManager` instance, which is used to general server info.
:rtype: yagocd.resources.info.InfoManager
"""
if self._info_manager is None:
self._info_manager = InfoManager(session=self._session)
return self._i... | [
"def",
"info",
"(",
"self",
")",
":",
"if",
"self",
".",
"_info_manager",
"is",
"None",
":",
"self",
".",
"_info_manager",
"=",
"InfoManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_info_manager"
] | Property for accessing :class:`InfoManager` instance, which is used to general server info.
:rtype: yagocd.resources.info.InfoManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"InfoManager",
"instance",
"which",
"is",
"used",
"to",
"general",
"server",
"info",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L221-L229 |
grundic/yagocd | yagocd/client.py | Yagocd.notification_filters | def notification_filters(self):
"""
Property for accessing :class:`NotificationFilterManager` instance, which is used to manage notification
filters.
:rtype: yagocd.resources.notification_filter.NotificationFilterManager
"""
if self._notification_filter_manager is None:
... | python | def notification_filters(self):
"""
Property for accessing :class:`NotificationFilterManager` instance, which is used to manage notification
filters.
:rtype: yagocd.resources.notification_filter.NotificationFilterManager
"""
if self._notification_filter_manager is None:
... | [
"def",
"notification_filters",
"(",
"self",
")",
":",
"if",
"self",
".",
"_notification_filter_manager",
"is",
"None",
":",
"self",
".",
"_notification_filter_manager",
"=",
"NotificationFilterManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
... | Property for accessing :class:`NotificationFilterManager` instance, which is used to manage notification
filters.
:rtype: yagocd.resources.notification_filter.NotificationFilterManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"NotificationFilterManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"notification",
"filters",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L232-L241 |
grundic/yagocd | yagocd/client.py | Yagocd.materials | def materials(self):
"""
Property for accessing :class:`MaterialManager` instance, which is used to manage materials.
:rtype: yagocd.resources.material.MaterialManager
"""
if self._material_manager is None:
self._material_manager = MaterialManager(session=self._sessi... | python | def materials(self):
"""
Property for accessing :class:`MaterialManager` instance, which is used to manage materials.
:rtype: yagocd.resources.material.MaterialManager
"""
if self._material_manager is None:
self._material_manager = MaterialManager(session=self._sessi... | [
"def",
"materials",
"(",
"self",
")",
":",
"if",
"self",
".",
"_material_manager",
"is",
"None",
":",
"self",
".",
"_material_manager",
"=",
"MaterialManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_material_manager"
] | Property for accessing :class:`MaterialManager` instance, which is used to manage materials.
:rtype: yagocd.resources.material.MaterialManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"MaterialManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"materials",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L244-L252 |
grundic/yagocd | yagocd/client.py | Yagocd.packages | def packages(self):
"""
Property for accessing :class:`PackageManager` instance, which is used to manage packages.
:rtype: yagocd.resources.package.PackageManager
"""
if self._package_manager is None:
self._package_manager = PackageManager(session=self._session)
... | python | def packages(self):
"""
Property for accessing :class:`PackageManager` instance, which is used to manage packages.
:rtype: yagocd.resources.package.PackageManager
"""
if self._package_manager is None:
self._package_manager = PackageManager(session=self._session)
... | [
"def",
"packages",
"(",
"self",
")",
":",
"if",
"self",
".",
"_package_manager",
"is",
"None",
":",
"self",
".",
"_package_manager",
"=",
"PackageManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_package_manager"
] | Property for accessing :class:`PackageManager` instance, which is used to manage packages.
:rtype: yagocd.resources.package.PackageManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"PackageManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"packages",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L255-L263 |
grundic/yagocd | yagocd/client.py | Yagocd.package_repositories | def package_repositories(self):
"""
Property for accessing :class:`PackageRepositoryManager` instance, which is used to manage package repos.
:rtype: yagocd.resources.package_repository.PackageRepositoryManager
"""
if self._package_repository_manager is None:
self._p... | python | def package_repositories(self):
"""
Property for accessing :class:`PackageRepositoryManager` instance, which is used to manage package repos.
:rtype: yagocd.resources.package_repository.PackageRepositoryManager
"""
if self._package_repository_manager is None:
self._p... | [
"def",
"package_repositories",
"(",
"self",
")",
":",
"if",
"self",
".",
"_package_repository_manager",
"is",
"None",
":",
"self",
".",
"_package_repository_manager",
"=",
"PackageRepositoryManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"se... | Property for accessing :class:`PackageRepositoryManager` instance, which is used to manage package repos.
:rtype: yagocd.resources.package_repository.PackageRepositoryManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"PackageRepositoryManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"package",
"repos",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L266-L274 |
grundic/yagocd | yagocd/client.py | Yagocd.pipelines | def pipelines(self):
"""
Property for accessing :class:`PipelineManager` instance, which is used to manage pipelines.
:rtype: yagocd.resources.pipeline.PipelineManager
"""
if self._pipeline_manager is None:
self._pipeline_manager = PipelineManager(session=self._sessi... | python | def pipelines(self):
"""
Property for accessing :class:`PipelineManager` instance, which is used to manage pipelines.
:rtype: yagocd.resources.pipeline.PipelineManager
"""
if self._pipeline_manager is None:
self._pipeline_manager = PipelineManager(session=self._sessi... | [
"def",
"pipelines",
"(",
"self",
")",
":",
"if",
"self",
".",
"_pipeline_manager",
"is",
"None",
":",
"self",
".",
"_pipeline_manager",
"=",
"PipelineManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_pipeline_manager"
] | Property for accessing :class:`PipelineManager` instance, which is used to manage pipelines.
:rtype: yagocd.resources.pipeline.PipelineManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"PipelineManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"pipelines",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L277-L285 |
grundic/yagocd | yagocd/client.py | Yagocd.pipeline_configs | def pipeline_configs(self):
"""
Property for accessing :class:`PipelineConfigManager` instance, which is used to manage pipeline configurations.
:rtype: yagocd.resources.pipeline_config.PipelineConfigManager
"""
if self._pipeline_config_manager is None:
self._pipelin... | python | def pipeline_configs(self):
"""
Property for accessing :class:`PipelineConfigManager` instance, which is used to manage pipeline configurations.
:rtype: yagocd.resources.pipeline_config.PipelineConfigManager
"""
if self._pipeline_config_manager is None:
self._pipelin... | [
"def",
"pipeline_configs",
"(",
"self",
")",
":",
"if",
"self",
".",
"_pipeline_config_manager",
"is",
"None",
":",
"self",
".",
"_pipeline_config_manager",
"=",
"PipelineConfigManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
... | Property for accessing :class:`PipelineConfigManager` instance, which is used to manage pipeline configurations.
:rtype: yagocd.resources.pipeline_config.PipelineConfigManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"PipelineConfigManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"pipeline",
"configurations",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L288-L296 |
grundic/yagocd | yagocd/client.py | Yagocd.plugin_info | def plugin_info(self):
"""
Property for accessing :class:`PluginInfoManager` instance, which is used to manage pipeline configurations.
:rtype: yagocd.resources.plugin_info.PluginInfoManager
"""
if self._plugin_info_manager is None:
self._plugin_info_manager = Plugin... | python | def plugin_info(self):
"""
Property for accessing :class:`PluginInfoManager` instance, which is used to manage pipeline configurations.
:rtype: yagocd.resources.plugin_info.PluginInfoManager
"""
if self._plugin_info_manager is None:
self._plugin_info_manager = Plugin... | [
"def",
"plugin_info",
"(",
"self",
")",
":",
"if",
"self",
".",
"_plugin_info_manager",
"is",
"None",
":",
"self",
".",
"_plugin_info_manager",
"=",
"PluginInfoManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_plugin_info_ma... | Property for accessing :class:`PluginInfoManager` instance, which is used to manage pipeline configurations.
:rtype: yagocd.resources.plugin_info.PluginInfoManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"PluginInfoManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"pipeline",
"configurations",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L299-L307 |
grundic/yagocd | yagocd/client.py | Yagocd.properties | def properties(self):
"""
Property for accessing :class:`PropertyManager` instance, which is used to manage properties of the jobs.
:rtype: yagocd.resources.property.PropertyManager
"""
if self._property_manager is None:
self._property_manager = PropertyManager(sessi... | python | def properties(self):
"""
Property for accessing :class:`PropertyManager` instance, which is used to manage properties of the jobs.
:rtype: yagocd.resources.property.PropertyManager
"""
if self._property_manager is None:
self._property_manager = PropertyManager(sessi... | [
"def",
"properties",
"(",
"self",
")",
":",
"if",
"self",
".",
"_property_manager",
"is",
"None",
":",
"self",
".",
"_property_manager",
"=",
"PropertyManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_property_manager"
] | Property for accessing :class:`PropertyManager` instance, which is used to manage properties of the jobs.
:rtype: yagocd.resources.property.PropertyManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"PropertyManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"properties",
"of",
"the",
"jobs",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L310-L318 |
grundic/yagocd | yagocd/client.py | Yagocd.scms | def scms(self):
"""
Property for accessing :class:`SCMManager` instance, which is used to manage pluggable SCM materials.
:rtype: yagocd.resources.scm.SCMManager
"""
if self._scm_manager is None:
self._scm_manager = SCMManager(session=self._session)
return se... | python | def scms(self):
"""
Property for accessing :class:`SCMManager` instance, which is used to manage pluggable SCM materials.
:rtype: yagocd.resources.scm.SCMManager
"""
if self._scm_manager is None:
self._scm_manager = SCMManager(session=self._session)
return se... | [
"def",
"scms",
"(",
"self",
")",
":",
"if",
"self",
".",
"_scm_manager",
"is",
"None",
":",
"self",
".",
"_scm_manager",
"=",
"SCMManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_scm_manager"
] | Property for accessing :class:`SCMManager` instance, which is used to manage pluggable SCM materials.
:rtype: yagocd.resources.scm.SCMManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"SCMManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"pluggable",
"SCM",
"materials",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L321-L329 |
grundic/yagocd | yagocd/client.py | Yagocd.stages | def stages(self):
"""
Property for accessing :class:`StageManager` instance, which is used to manage stages.
:rtype: yagocd.resources.stage.StageManager
"""
if self._stage_manager is None:
self._stage_manager = StageManager(session=self._session)
return self.... | python | def stages(self):
"""
Property for accessing :class:`StageManager` instance, which is used to manage stages.
:rtype: yagocd.resources.stage.StageManager
"""
if self._stage_manager is None:
self._stage_manager = StageManager(session=self._session)
return self.... | [
"def",
"stages",
"(",
"self",
")",
":",
"if",
"self",
".",
"_stage_manager",
"is",
"None",
":",
"self",
".",
"_stage_manager",
"=",
"StageManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_stage_manager"
] | Property for accessing :class:`StageManager` instance, which is used to manage stages.
:rtype: yagocd.resources.stage.StageManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"StageManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"stages",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L332-L340 |
grundic/yagocd | yagocd/client.py | Yagocd.templates | def templates(self):
"""
Property for accessing :class:`TemplateManager` instance, which is used to manage templates.
:rtype: yagocd.resources.template.TemplateManager
"""
if self._template_manager is None:
self._template_manager = TemplateManager(session=self._sessi... | python | def templates(self):
"""
Property for accessing :class:`TemplateManager` instance, which is used to manage templates.
:rtype: yagocd.resources.template.TemplateManager
"""
if self._template_manager is None:
self._template_manager = TemplateManager(session=self._sessi... | [
"def",
"templates",
"(",
"self",
")",
":",
"if",
"self",
".",
"_template_manager",
"is",
"None",
":",
"self",
".",
"_template_manager",
"=",
"TemplateManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_template_manager"
] | Property for accessing :class:`TemplateManager` instance, which is used to manage templates.
:rtype: yagocd.resources.template.TemplateManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"TemplateManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"templates",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L343-L351 |
grundic/yagocd | yagocd/client.py | Yagocd.users | def users(self):
"""
Property for accessing :class:`UserManager` instance, which is used to manage users.
:rtype: yagocd.resources.user.UserManager
"""
if self._user_manager is None:
self._user_manager = UserManager(session=self._session)
return self._user_ma... | python | def users(self):
"""
Property for accessing :class:`UserManager` instance, which is used to manage users.
:rtype: yagocd.resources.user.UserManager
"""
if self._user_manager is None:
self._user_manager = UserManager(session=self._session)
return self._user_ma... | [
"def",
"users",
"(",
"self",
")",
":",
"if",
"self",
".",
"_user_manager",
"is",
"None",
":",
"self",
".",
"_user_manager",
"=",
"UserManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_user_manager"
] | Property for accessing :class:`UserManager` instance, which is used to manage users.
:rtype: yagocd.resources.user.UserManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"UserManager",
"instance",
"which",
"is",
"used",
"to",
"manage",
"users",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L354-L362 |
grundic/yagocd | yagocd/client.py | Yagocd.versions | def versions(self):
"""
Property for accessing :class:`VersionManager` instance, which is used to get server info.
:rtype: yagocd.resources.version.VersionManager
"""
if self._version_manager is None:
self._version_manager = VersionManager(session=self._session)
... | python | def versions(self):
"""
Property for accessing :class:`VersionManager` instance, which is used to get server info.
:rtype: yagocd.resources.version.VersionManager
"""
if self._version_manager is None:
self._version_manager = VersionManager(session=self._session)
... | [
"def",
"versions",
"(",
"self",
")",
":",
"if",
"self",
".",
"_version_manager",
"is",
"None",
":",
"self",
".",
"_version_manager",
"=",
"VersionManager",
"(",
"session",
"=",
"self",
".",
"_session",
")",
"return",
"self",
".",
"_version_manager"
] | Property for accessing :class:`VersionManager` instance, which is used to get server info.
:rtype: yagocd.resources.version.VersionManager | [
"Property",
"for",
"accessing",
":",
"class",
":",
"VersionManager",
"instance",
"which",
"is",
"used",
"to",
"get",
"server",
"info",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/client.py#L365-L373 |
grundic/yagocd | yagocd/resources/pipeline.py | PipelineEntity.url | def url(self):
"""
Returns url for accessing pipeline entity.
"""
return self.get_url(server_url=self._session.server_url, pipeline_name=self.data.name) | python | def url(self):
"""
Returns url for accessing pipeline entity.
"""
return self.get_url(server_url=self._session.server_url, pipeline_name=self.data.name) | [
"def",
"url",
"(",
"self",
")",
":",
"return",
"self",
".",
"get_url",
"(",
"server_url",
"=",
"self",
".",
"_session",
".",
"server_url",
",",
"pipeline_name",
"=",
"self",
".",
"data",
".",
"name",
")"
] | Returns url for accessing pipeline entity. | [
"Returns",
"url",
"for",
"accessing",
"pipeline",
"entity",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/pipeline.py#L459-L463 |
grundic/yagocd | yagocd/resources/pipeline.py | PipelineEntity.config | def config(self):
"""
Property for accessing pipeline configuration.
:rtype: yagocd.resources.pipeline_config.PipelineConfigManager
"""
return PipelineConfigManager(session=self._session, pipeline_name=self.data.name) | python | def config(self):
"""
Property for accessing pipeline configuration.
:rtype: yagocd.resources.pipeline_config.PipelineConfigManager
"""
return PipelineConfigManager(session=self._session, pipeline_name=self.data.name) | [
"def",
"config",
"(",
"self",
")",
":",
"return",
"PipelineConfigManager",
"(",
"session",
"=",
"self",
".",
"_session",
",",
"pipeline_name",
"=",
"self",
".",
"data",
".",
"name",
")"
] | Property for accessing pipeline configuration.
:rtype: yagocd.resources.pipeline_config.PipelineConfigManager | [
"Property",
"for",
"accessing",
"pipeline",
"configuration",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/pipeline.py#L466-L472 |
grundic/yagocd | yagocd/resources/pipeline.py | PipelineEntity.history | def history(self, offset=0):
"""
The pipeline history allows users to list pipeline instances.
:param offset: number of pipeline instances to be skipped.
:return: an array of pipeline instances :class:`yagocd.resources.pipeline.PipelineInstance`.
:rtype: list of yagocd.resources... | python | def history(self, offset=0):
"""
The pipeline history allows users to list pipeline instances.
:param offset: number of pipeline instances to be skipped.
:return: an array of pipeline instances :class:`yagocd.resources.pipeline.PipelineInstance`.
:rtype: list of yagocd.resources... | [
"def",
"history",
"(",
"self",
",",
"offset",
"=",
"0",
")",
":",
"return",
"self",
".",
"_pipeline",
".",
"history",
"(",
"name",
"=",
"self",
".",
"data",
".",
"name",
",",
"offset",
"=",
"offset",
")"
] | The pipeline history allows users to list pipeline instances.
:param offset: number of pipeline instances to be skipped.
:return: an array of pipeline instances :class:`yagocd.resources.pipeline.PipelineInstance`.
:rtype: list of yagocd.resources.pipeline.PipelineInstance | [
"The",
"pipeline",
"history",
"allows",
"users",
"to",
"list",
"pipeline",
"instances",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/pipeline.py#L474-L482 |
grundic/yagocd | yagocd/resources/pipeline.py | PipelineEntity.get | def get(self, counter):
"""
Gets pipeline instance object.
:param counter pipeline counter:
:return: A pipeline instance object :class:`yagocd.resources.pipeline.PipelineInstance`.
:rtype: yagocd.resources.pipeline.PipelineInstance
"""
return self._pipeline.get(n... | python | def get(self, counter):
"""
Gets pipeline instance object.
:param counter pipeline counter:
:return: A pipeline instance object :class:`yagocd.resources.pipeline.PipelineInstance`.
:rtype: yagocd.resources.pipeline.PipelineInstance
"""
return self._pipeline.get(n... | [
"def",
"get",
"(",
"self",
",",
"counter",
")",
":",
"return",
"self",
".",
"_pipeline",
".",
"get",
"(",
"name",
"=",
"self",
".",
"data",
".",
"name",
",",
"counter",
"=",
"counter",
")"
] | Gets pipeline instance object.
:param counter pipeline counter:
:return: A pipeline instance object :class:`yagocd.resources.pipeline.PipelineInstance`.
:rtype: yagocd.resources.pipeline.PipelineInstance | [
"Gets",
"pipeline",
"instance",
"object",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/pipeline.py#L502-L510 |
grundic/yagocd | yagocd/resources/pipeline.py | PipelineEntity.pause | def pause(self, cause):
"""
Pause the current pipeline.
:param cause: reason for pausing the pipeline.
"""
self._pipeline.pause(name=self.data.name, cause=cause) | python | def pause(self, cause):
"""
Pause the current pipeline.
:param cause: reason for pausing the pipeline.
"""
self._pipeline.pause(name=self.data.name, cause=cause) | [
"def",
"pause",
"(",
"self",
",",
"cause",
")",
":",
"self",
".",
"_pipeline",
".",
"pause",
"(",
"name",
"=",
"self",
".",
"data",
".",
"name",
",",
"cause",
"=",
"cause",
")"
] | Pause the current pipeline.
:param cause: reason for pausing the pipeline. | [
"Pause",
"the",
"current",
"pipeline",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/pipeline.py#L520-L526 |
grundic/yagocd | yagocd/resources/pipeline.py | PipelineEntity.schedule | def schedule(self, materials=None, variables=None, secure_variables=None):
"""
Scheduling allows user to trigger a specific pipeline.
:param materials: material revisions to use.
:param variables: environment variables to set.
:param secure_variables: secure environment variable... | python | def schedule(self, materials=None, variables=None, secure_variables=None):
"""
Scheduling allows user to trigger a specific pipeline.
:param materials: material revisions to use.
:param variables: environment variables to set.
:param secure_variables: secure environment variable... | [
"def",
"schedule",
"(",
"self",
",",
"materials",
"=",
"None",
",",
"variables",
"=",
"None",
",",
"secure_variables",
"=",
"None",
")",
":",
"return",
"self",
".",
"_pipeline",
".",
"schedule",
"(",
"name",
"=",
"self",
".",
"data",
".",
"name",
",",
... | Scheduling allows user to trigger a specific pipeline.
:param materials: material revisions to use.
:param variables: environment variables to set.
:param secure_variables: secure environment variables to set.
:return: a text confirmation. | [
"Scheduling",
"allows",
"user",
"to",
"trigger",
"a",
"specific",
"pipeline",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/pipeline.py#L543-L557 |
grundic/yagocd | yagocd/resources/pipeline.py | PipelineEntity.schedule_with_instance | def schedule_with_instance(
self,
materials=None,
variables=None,
secure_variables=None,
backoff=0.5,
max_tries=20
):
"""
Schedule pipeline and return instance.
Credits of implementation comes to `gaqzi`:
https://github.com/gaqzi/py-goc... | python | def schedule_with_instance(
self,
materials=None,
variables=None,
secure_variables=None,
backoff=0.5,
max_tries=20
):
"""
Schedule pipeline and return instance.
Credits of implementation comes to `gaqzi`:
https://github.com/gaqzi/py-goc... | [
"def",
"schedule_with_instance",
"(",
"self",
",",
"materials",
"=",
"None",
",",
"variables",
"=",
"None",
",",
"secure_variables",
"=",
"None",
",",
"backoff",
"=",
"0.5",
",",
"max_tries",
"=",
"20",
")",
":",
"return",
"self",
".",
"_pipeline",
".",
... | Schedule pipeline and return instance.
Credits of implementation comes to `gaqzi`:
https://github.com/gaqzi/py-gocd/blob/master/gocd/api/pipeline.py#L122
:warning: Replace this with whatever is the official way as soon as gocd#990 is fixed. \
https://github.com/gocd/gocd/issues/990
... | [
"Schedule",
"pipeline",
"and",
"return",
"instance",
".",
"Credits",
"of",
"implementation",
"comes",
"to",
"gaqzi",
":",
"https",
":",
"//",
"github",
".",
"com",
"/",
"gaqzi",
"/",
"py",
"-",
"gocd",
"/",
"blob",
"/",
"master",
"/",
"gocd",
"/",
"api... | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/pipeline.py#L559-L590 |
grundic/yagocd | yagocd/resources/pipeline.py | PipelineInstance.pipeline_url | def pipeline_url(self):
"""
Returns url for accessing pipeline entity.
"""
return PipelineEntity.get_url(server_url=self._session.server_url, pipeline_name=self.data.name) | python | def pipeline_url(self):
"""
Returns url for accessing pipeline entity.
"""
return PipelineEntity.get_url(server_url=self._session.server_url, pipeline_name=self.data.name) | [
"def",
"pipeline_url",
"(",
"self",
")",
":",
"return",
"PipelineEntity",
".",
"get_url",
"(",
"server_url",
"=",
"self",
".",
"_session",
".",
"server_url",
",",
"pipeline_name",
"=",
"self",
".",
"data",
".",
"name",
")"
] | Returns url for accessing pipeline entity. | [
"Returns",
"url",
"for",
"accessing",
"pipeline",
"entity",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/pipeline.py#L636-L640 |
grundic/yagocd | yagocd/resources/pipeline.py | PipelineInstance.stages | def stages(self):
"""
Method for getting stages from pipeline instance.
:return: arrays of stages
:rtype: list of yagocd.resources.stage.StageInstance
"""
stages = list()
for data in self.data.stages:
stages.append(StageInstance(session=self._session,... | python | def stages(self):
"""
Method for getting stages from pipeline instance.
:return: arrays of stages
:rtype: list of yagocd.resources.stage.StageInstance
"""
stages = list()
for data in self.data.stages:
stages.append(StageInstance(session=self._session,... | [
"def",
"stages",
"(",
"self",
")",
":",
"stages",
"=",
"list",
"(",
")",
"for",
"data",
"in",
"self",
".",
"data",
".",
"stages",
":",
"stages",
".",
"append",
"(",
"StageInstance",
"(",
"session",
"=",
"self",
".",
"_session",
",",
"data",
"=",
"d... | Method for getting stages from pipeline instance.
:return: arrays of stages
:rtype: list of yagocd.resources.stage.StageInstance | [
"Method",
"for",
"getting",
"stages",
"from",
"pipeline",
"instance",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/pipeline.py#L642-L653 |
grundic/yagocd | yagocd/resources/pipeline.py | PipelineInstance.stage | def stage(self, name):
"""
Method for searching specific stage by it's name.
:param name: name of the stage to search.
:return: found stage or None.
:rtype: yagocd.resources.stage.StageInstance
"""
for stage in self.stages():
if stage.data.name == nam... | python | def stage(self, name):
"""
Method for searching specific stage by it's name.
:param name: name of the stage to search.
:return: found stage or None.
:rtype: yagocd.resources.stage.StageInstance
"""
for stage in self.stages():
if stage.data.name == nam... | [
"def",
"stage",
"(",
"self",
",",
"name",
")",
":",
"for",
"stage",
"in",
"self",
".",
"stages",
"(",
")",
":",
"if",
"stage",
".",
"data",
".",
"name",
"==",
"name",
":",
"return",
"stage"
] | Method for searching specific stage by it's name.
:param name: name of the stage to search.
:return: found stage or None.
:rtype: yagocd.resources.stage.StageInstance | [
"Method",
"for",
"searching",
"specific",
"stage",
"by",
"it",
"s",
"name",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/pipeline.py#L655-L665 |
grundic/yagocd | yagocd/util.py | RequireParamMixin._require_param | def _require_param(self, name, values):
"""
Method for finding the value for the given parameter name.
The value for the parameter could be extracted from two places:
* `values` dictionary
* `self._<name>` attribute
The use case for this method is that some resource... | python | def _require_param(self, name, values):
"""
Method for finding the value for the given parameter name.
The value for the parameter could be extracted from two places:
* `values` dictionary
* `self._<name>` attribute
The use case for this method is that some resource... | [
"def",
"_require_param",
"(",
"self",
",",
"name",
",",
"values",
")",
":",
"values",
"=",
"[",
"values",
"[",
"name",
"]",
"]",
"instance_name",
"=",
"'_{}'",
".",
"format",
"(",
"name",
")",
"values",
".",
"append",
"(",
"getattr",
"(",
"self",
","... | Method for finding the value for the given parameter name.
The value for the parameter could be extracted from two places:
* `values` dictionary
* `self._<name>` attribute
The use case for this method is that some resources are nested and
managers could have dependencies on... | [
"Method",
"for",
"finding",
"the",
"value",
"for",
"the",
"given",
"parameter",
"name",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/util.py#L121-L155 |
grundic/yagocd | yagocd/resources/__init__.py | BaseManager._accept_header | def _accept_header(self):
"""
Method for determining correct `Accept` header.
Different resources and different GoCD version servers prefer
a diverse headers. In order to manage all of them, this method
tries to help: if `VERSION_TO_ACCEPT_HEADER` is not provided,
if wou... | python | def _accept_header(self):
"""
Method for determining correct `Accept` header.
Different resources and different GoCD version servers prefer
a diverse headers. In order to manage all of them, this method
tries to help: if `VERSION_TO_ACCEPT_HEADER` is not provided,
if wou... | [
"def",
"_accept_header",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"VERSION_TO_ACCEPT_HEADER",
":",
"return",
"self",
".",
"ACCEPT_HEADER",
"return",
"YagocdUtil",
".",
"choose_option",
"(",
"version_to_options",
"=",
"self",
".",
"VERSION_TO_ACCEPT_HEADER",
... | Method for determining correct `Accept` header.
Different resources and different GoCD version servers prefer
a diverse headers. In order to manage all of them, this method
tries to help: if `VERSION_TO_ACCEPT_HEADER` is not provided,
if would simply return default `ACCEPT_HEADER`.
... | [
"Method",
"for",
"determining",
"correct",
"Accept",
"header",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/__init__.py#L57-L81 |
grundic/yagocd | yagocd/resources/__init__.py | BaseNode.get_predecessors | def get_predecessors(self, transitive=False):
"""
Property for getting predecessors (parents) of current pipeline.
This property automatically populates from API call
:return: list of :class:`yagocd.resources.pipeline.PipelineEntity`.
:rtype: list of yagocd.resources.pipeline.Pi... | python | def get_predecessors(self, transitive=False):
"""
Property for getting predecessors (parents) of current pipeline.
This property automatically populates from API call
:return: list of :class:`yagocd.resources.pipeline.PipelineEntity`.
:rtype: list of yagocd.resources.pipeline.Pi... | [
"def",
"get_predecessors",
"(",
"self",
",",
"transitive",
"=",
"False",
")",
":",
"result",
"=",
"self",
".",
"_predecessors",
"if",
"transitive",
":",
"return",
"YagocdUtil",
".",
"graph_depth_walk",
"(",
"result",
",",
"lambda",
"v",
":",
"v",
".",
"pre... | Property for getting predecessors (parents) of current pipeline.
This property automatically populates from API call
:return: list of :class:`yagocd.resources.pipeline.PipelineEntity`.
:rtype: list of yagocd.resources.pipeline.PipelineEntity | [
"Property",
"for",
"getting",
"predecessors",
"(",
"parents",
")",
"of",
"current",
"pipeline",
".",
"This",
"property",
"automatically",
"populates",
"from",
"API",
"call"
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/__init__.py#L114-L125 |
grundic/yagocd | yagocd/resources/__init__.py | BaseNode.get_descendants | def get_descendants(self, transitive=False):
"""
Property for getting descendants (children) of current pipeline.
It's calculated by :meth:`yagocd.resources.pipeline.PipelineManager#tie_descendants` method during listing of
all pipelines.
:return: list of :class:`yagocd.resource... | python | def get_descendants(self, transitive=False):
"""
Property for getting descendants (children) of current pipeline.
It's calculated by :meth:`yagocd.resources.pipeline.PipelineManager#tie_descendants` method during listing of
all pipelines.
:return: list of :class:`yagocd.resource... | [
"def",
"get_descendants",
"(",
"self",
",",
"transitive",
"=",
"False",
")",
":",
"result",
"=",
"self",
".",
"_descendants",
"if",
"transitive",
":",
"return",
"YagocdUtil",
".",
"graph_depth_walk",
"(",
"result",
",",
"lambda",
"v",
":",
"v",
".",
"desce... | Property for getting descendants (children) of current pipeline.
It's calculated by :meth:`yagocd.resources.pipeline.PipelineManager#tie_descendants` method during listing of
all pipelines.
:return: list of :class:`yagocd.resources.pipeline.PipelineEntity`.
:rtype: list of yagocd.resour... | [
"Property",
"for",
"getting",
"descendants",
"(",
"children",
")",
"of",
"current",
"pipeline",
".",
"It",
"s",
"calculated",
"by",
":",
"meth",
":",
"yagocd",
".",
"resources",
".",
"pipeline",
".",
"PipelineManager#tie_descendants",
"method",
"during",
"listin... | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/__init__.py#L132-L144 |
grundic/yagocd | yagocd/resources/artifact.py | Artifact.walk | def walk(self, topdown=True):
"""
Artifact tree generator - analogue of `os.walk`.
:param topdown: if is True or not specified, directories are scanned
from top-down. If topdown is set to False, directories are scanned
from bottom-up.
:rtype: collections.Iterator[
... | python | def walk(self, topdown=True):
"""
Artifact tree generator - analogue of `os.walk`.
:param topdown: if is True or not specified, directories are scanned
from top-down. If topdown is set to False, directories are scanned
from bottom-up.
:rtype: collections.Iterator[
... | [
"def",
"walk",
"(",
"self",
",",
"topdown",
"=",
"True",
")",
":",
"return",
"self",
".",
"_manager",
".",
"walk",
"(",
"top",
"=",
"self",
".",
"_path",
",",
"topdown",
"=",
"topdown",
")"
] | Artifact tree generator - analogue of `os.walk`.
:param topdown: if is True or not specified, directories are scanned
from top-down. If topdown is set to False, directories are scanned
from bottom-up.
:rtype: collections.Iterator[
(str, list[yagocd.resources.artifact.Artifac... | [
"Artifact",
"tree",
"generator",
"-",
"analogue",
"of",
"os",
".",
"walk",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/artifact.py#L515-L526 |
grundic/yagocd | yagocd/resources/artifact.py | Artifact.fetch | def fetch(self):
"""
Method for getting artifact's content.
Could only be applicable for file type.
:return: content of the artifact.
"""
if self.data.type == self._manager.FOLDER_TYPE:
raise YagocdException("Can't fetch folder <{}>, only file!".format(self._... | python | def fetch(self):
"""
Method for getting artifact's content.
Could only be applicable for file type.
:return: content of the artifact.
"""
if self.data.type == self._manager.FOLDER_TYPE:
raise YagocdException("Can't fetch folder <{}>, only file!".format(self._... | [
"def",
"fetch",
"(",
"self",
")",
":",
"if",
"self",
".",
"data",
".",
"type",
"==",
"self",
".",
"_manager",
".",
"FOLDER_TYPE",
":",
"raise",
"YagocdException",
"(",
"\"Can't fetch folder <{}>, only file!\"",
".",
"format",
"(",
"self",
".",
"_path",
")",
... | Method for getting artifact's content.
Could only be applicable for file type.
:return: content of the artifact. | [
"Method",
"for",
"getting",
"artifact",
"s",
"content",
".",
"Could",
"only",
"be",
"applicable",
"for",
"file",
"type",
"."
] | train | https://github.com/grundic/yagocd/blob/4c75336ae6f107c8723d37b15e52169151822127/yagocd/resources/artifact.py#L528-L539 |
jupyterhub/ltiauthenticator | ltiauthenticator/__init__.py | LTILaunchValidator.validate_launch_request | def validate_launch_request(
self,
launch_url,
headers,
args
):
"""
Validate a given launch request
launch_url: Full URL that the launch request was POSTed to
headers: k/v pair of HTTP headers coming in with the POST
args: dict... | python | def validate_launch_request(
self,
launch_url,
headers,
args
):
"""
Validate a given launch request
launch_url: Full URL that the launch request was POSTed to
headers: k/v pair of HTTP headers coming in with the POST
args: dict... | [
"def",
"validate_launch_request",
"(",
"self",
",",
"launch_url",
",",
"headers",
",",
"args",
")",
":",
"# Validate args!",
"if",
"'oauth_consumer_key'",
"not",
"in",
"args",
":",
"raise",
"web",
".",
"HTTPError",
"(",
"401",
",",
"\"oauth_consumer_key missing\""... | Validate a given launch request
launch_url: Full URL that the launch request was POSTed to
headers: k/v pair of HTTP headers coming in with the POST
args: dictionary of body arguments passed to the launch_url
Must have the following keys to be valid:
oauth_consumer_k... | [
"Validate",
"a",
"given",
"launch",
"request"
] | train | https://github.com/jupyterhub/ltiauthenticator/blob/ae4d95959116c5a2c5d3cbefa6a3ee1be574cc4e/ltiauthenticator/__init__.py#L25-L97 |
lightning-viz/lightning-python | lightning/main.py | Lightning.enable_ipython | def enable_ipython(self, **kwargs):
"""
Enable plotting in the iPython notebook.
Once enabled, all lightning plots will be automatically produced
within the iPython notebook. They will also be available on
your lightning server within the current session.
"""
# ... | python | def enable_ipython(self, **kwargs):
"""
Enable plotting in the iPython notebook.
Once enabled, all lightning plots will be automatically produced
within the iPython notebook. They will also be available on
your lightning server within the current session.
"""
# ... | [
"def",
"enable_ipython",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# inspired by code powering similar functionality in mpld3",
"# https://github.com/jakevdp/mpld3/blob/master/mpld3/_display.py#L357",
"from",
"IPython",
".",
"core",
".",
"getipython",
"import",
"get_ipyt... | Enable plotting in the iPython notebook.
Once enabled, all lightning plots will be automatically produced
within the iPython notebook. They will also be available on
your lightning server within the current session. | [
"Enable",
"plotting",
"in",
"the",
"iPython",
"notebook",
"."
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/main.py#L52-L83 |
lightning-viz/lightning-python | lightning/main.py | Lightning.disable_ipython | def disable_ipython(self):
"""
Disable plotting in the iPython notebook.
After disabling, lightning plots will be produced in your lightning server,
but will not appear in the notebook.
"""
from IPython.core.getipython import get_ipython
self.ipython_enabled = F... | python | def disable_ipython(self):
"""
Disable plotting in the iPython notebook.
After disabling, lightning plots will be produced in your lightning server,
but will not appear in the notebook.
"""
from IPython.core.getipython import get_ipython
self.ipython_enabled = F... | [
"def",
"disable_ipython",
"(",
"self",
")",
":",
"from",
"IPython",
".",
"core",
".",
"getipython",
"import",
"get_ipython",
"self",
".",
"ipython_enabled",
"=",
"False",
"ip",
"=",
"get_ipython",
"(",
")",
"formatter",
"=",
"ip",
".",
"display_formatter",
"... | Disable plotting in the iPython notebook.
After disabling, lightning plots will be produced in your lightning server,
but will not appear in the notebook. | [
"Disable",
"plotting",
"in",
"the",
"iPython",
"notebook",
"."
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/main.py#L85-L98 |
lightning-viz/lightning-python | lightning/main.py | Lightning.create_session | def create_session(self, name=None):
"""
Create a lightning session.
Can create a session with the provided name, otherwise session name
will be "Session No." with the number automatically generated.
"""
self.session = Session.create(self, name=name)
return self.... | python | def create_session(self, name=None):
"""
Create a lightning session.
Can create a session with the provided name, otherwise session name
will be "Session No." with the number automatically generated.
"""
self.session = Session.create(self, name=name)
return self.... | [
"def",
"create_session",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"self",
".",
"session",
"=",
"Session",
".",
"create",
"(",
"self",
",",
"name",
"=",
"name",
")",
"return",
"self",
".",
"session"
] | Create a lightning session.
Can create a session with the provided name, otherwise session name
will be "Session No." with the number automatically generated. | [
"Create",
"a",
"lightning",
"session",
"."
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/main.py#L100-L108 |
lightning-viz/lightning-python | lightning/main.py | Lightning.use_session | def use_session(self, session_id):
"""
Use the specified lightning session.
Specify a lightning session by id number. Check the number of an existing
session in the attribute lightning.session.id.
"""
self.session = Session(lgn=self, id=session_id)
return self.se... | python | def use_session(self, session_id):
"""
Use the specified lightning session.
Specify a lightning session by id number. Check the number of an existing
session in the attribute lightning.session.id.
"""
self.session = Session(lgn=self, id=session_id)
return self.se... | [
"def",
"use_session",
"(",
"self",
",",
"session_id",
")",
":",
"self",
".",
"session",
"=",
"Session",
"(",
"lgn",
"=",
"self",
",",
"id",
"=",
"session_id",
")",
"return",
"self",
".",
"session"
] | Use the specified lightning session.
Specify a lightning session by id number. Check the number of an existing
session in the attribute lightning.session.id. | [
"Use",
"the",
"specified",
"lightning",
"session",
"."
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/main.py#L110-L118 |
lightning-viz/lightning-python | lightning/main.py | Lightning.set_basic_auth | def set_basic_auth(self, username, password):
"""
Set authenatication.
"""
from requests.auth import HTTPBasicAuth
self.auth = HTTPBasicAuth(username, password)
return self | python | def set_basic_auth(self, username, password):
"""
Set authenatication.
"""
from requests.auth import HTTPBasicAuth
self.auth = HTTPBasicAuth(username, password)
return self | [
"def",
"set_basic_auth",
"(",
"self",
",",
"username",
",",
"password",
")",
":",
"from",
"requests",
".",
"auth",
"import",
"HTTPBasicAuth",
"self",
".",
"auth",
"=",
"HTTPBasicAuth",
"(",
"username",
",",
"password",
")",
"return",
"self"
] | Set authenatication. | [
"Set",
"authenatication",
"."
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/main.py#L136-L142 |
lightning-viz/lightning-python | lightning/main.py | Lightning.set_host | def set_host(self, host):
"""
Set the host for a lightning server.
Host can be local (e.g. http://localhost:3000), a heroku
instance (e.g. http://lightning-test.herokuapp.com), or
a independently hosted lightning server.
"""
if host[-1] == '/':
host =... | python | def set_host(self, host):
"""
Set the host for a lightning server.
Host can be local (e.g. http://localhost:3000), a heroku
instance (e.g. http://lightning-test.herokuapp.com), or
a independently hosted lightning server.
"""
if host[-1] == '/':
host =... | [
"def",
"set_host",
"(",
"self",
",",
"host",
")",
":",
"if",
"host",
"[",
"-",
"1",
"]",
"==",
"'/'",
":",
"host",
"=",
"host",
"[",
":",
"-",
"1",
"]",
"self",
".",
"host",
"=",
"host",
"return",
"self"
] | Set the host for a lightning server.
Host can be local (e.g. http://localhost:3000), a heroku
instance (e.g. http://lightning-test.herokuapp.com), or
a independently hosted lightning server. | [
"Set",
"the",
"host",
"for",
"a",
"lightning",
"server",
"."
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/main.py#L144-L156 |
lightning-viz/lightning-python | lightning/main.py | Lightning.check_status | def check_status(self):
"""
Check the server for status
"""
try:
r = requests.get(self.host + '/status', auth=self.auth,
timeout=(10.0, 10.0))
if not r.status_code == requests.codes.ok:
print("Problem connecting to serv... | python | def check_status(self):
"""
Check the server for status
"""
try:
r = requests.get(self.host + '/status', auth=self.auth,
timeout=(10.0, 10.0))
if not r.status_code == requests.codes.ok:
print("Problem connecting to serv... | [
"def",
"check_status",
"(",
"self",
")",
":",
"try",
":",
"r",
"=",
"requests",
".",
"get",
"(",
"self",
".",
"host",
"+",
"'/status'",
",",
"auth",
"=",
"self",
".",
"auth",
",",
"timeout",
"=",
"(",
"10.0",
",",
"10.0",
")",
")",
"if",
"not",
... | Check the server for status | [
"Check",
"the",
"server",
"for",
"status"
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/main.py#L169-L188 |
lightning-viz/lightning-python | lightning/types/base.py | Base._clean_data | def _clean_data(cls, *args, **kwargs):
"""
Convert raw data into a dictionary with plot-type specific methods.
The result of the cleaning operation should be a dictionary.
If the dictionary contains a 'data' field it will be passed directly
(ensuring appropriate formatting). Oth... | python | def _clean_data(cls, *args, **kwargs):
"""
Convert raw data into a dictionary with plot-type specific methods.
The result of the cleaning operation should be a dictionary.
If the dictionary contains a 'data' field it will be passed directly
(ensuring appropriate formatting). Oth... | [
"def",
"_clean_data",
"(",
"cls",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"datadict",
"=",
"cls",
".",
"clean",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"if",
"'data'",
"in",
"datadict",
":",
"data",
"=",
"datadict",
"[",
"'da... | Convert raw data into a dictionary with plot-type specific methods.
The result of the cleaning operation should be a dictionary.
If the dictionary contains a 'data' field it will be passed directly
(ensuring appropriate formatting). Otherwise, it should be a
dictionary of data-type spec... | [
"Convert",
"raw",
"data",
"into",
"a",
"dictionary",
"with",
"plot",
"-",
"type",
"specific",
"methods",
"."
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/base.py#L80-L106 |
lightning-viz/lightning-python | lightning/types/base.py | Base._baseplot | def _baseplot(cls, session, type, *args, **kwargs):
"""
Base method for plotting data and images.
Applies a plot-type specific cleaning operation to generate
a dictionary with the data, then creates a visualization with the data.
Expects a session and a type, followed by all pl... | python | def _baseplot(cls, session, type, *args, **kwargs):
"""
Base method for plotting data and images.
Applies a plot-type specific cleaning operation to generate
a dictionary with the data, then creates a visualization with the data.
Expects a session and a type, followed by all pl... | [
"def",
"_baseplot",
"(",
"cls",
",",
"session",
",",
"type",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"type",
":",
"raise",
"Exception",
"(",
"\"Must provide a plot type\"",
")",
"options",
",",
"description",
"=",
"cls",
".",
... | Base method for plotting data and images.
Applies a plot-type specific cleaning operation to generate
a dictionary with the data, then creates a visualization with the data.
Expects a session and a type, followed by all plot-type specific
positional and keyword arguments, which will be... | [
"Base",
"method",
"for",
"plotting",
"data",
"and",
"images",
"."
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/base.py#L141-L179 |
lightning-viz/lightning-python | lightning/types/base.py | Base.update | def update(self, *args, **kwargs):
"""
Base method for updating data.
Applies a plot-type specific cleaning operation, then
updates the data in the visualization.
"""
data = self._clean_data(*args, **kwargs)
if 'images' in data:
images = data['images... | python | def update(self, *args, **kwargs):
"""
Base method for updating data.
Applies a plot-type specific cleaning operation, then
updates the data in the visualization.
"""
data = self._clean_data(*args, **kwargs)
if 'images' in data:
images = data['images... | [
"def",
"update",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"data",
"=",
"self",
".",
"_clean_data",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"if",
"'images'",
"in",
"data",
":",
"images",
"=",
"data",
"[",
"'images'... | Base method for updating data.
Applies a plot-type specific cleaning operation, then
updates the data in the visualization. | [
"Base",
"method",
"for",
"updating",
"data",
"."
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/base.py#L181-L195 |
lightning-viz/lightning-python | lightning/types/base.py | Base.append | def append(self, *args, **kwargs):
"""
Base method for appending data.
Applies a plot-type specific cleaning operation, then
appends data to the visualization.
"""
data = self._clean_data(*args, **kwargs)
if 'images' in data:
images = data['images']
... | python | def append(self, *args, **kwargs):
"""
Base method for appending data.
Applies a plot-type specific cleaning operation, then
appends data to the visualization.
"""
data = self._clean_data(*args, **kwargs)
if 'images' in data:
images = data['images']
... | [
"def",
"append",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"data",
"=",
"self",
".",
"_clean_data",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"if",
"'images'",
"in",
"data",
":",
"images",
"=",
"data",
"[",
"'images'... | Base method for appending data.
Applies a plot-type specific cleaning operation, then
appends data to the visualization. | [
"Base",
"method",
"for",
"appending",
"data",
"."
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/base.py#L197-L211 |
lightning-viz/lightning-python | lightning/types/base.py | Base._get_user_data | def _get_user_data(self):
"""
Base method for retrieving user data from a viz.
"""
url = self.session.host + '/sessions/' + str(self.session.id) + '/visualizations/' + str(self.id) + '/settings/'
r = requests.get(url)
if r.status_code == 200:
content = r.json... | python | def _get_user_data(self):
"""
Base method for retrieving user data from a viz.
"""
url = self.session.host + '/sessions/' + str(self.session.id) + '/visualizations/' + str(self.id) + '/settings/'
r = requests.get(url)
if r.status_code == 200:
content = r.json... | [
"def",
"_get_user_data",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"session",
".",
"host",
"+",
"'/sessions/'",
"+",
"str",
"(",
"self",
".",
"session",
".",
"id",
")",
"+",
"'/visualizations/'",
"+",
"str",
"(",
"self",
".",
"id",
")",
"+",
... | Base method for retrieving user data from a viz. | [
"Base",
"method",
"for",
"retrieving",
"user",
"data",
"from",
"a",
"viz",
"."
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/base.py#L213-L225 |
lightning-viz/lightning-python | lightning/types/utils.py | check_property | def check_property(prop, name, **kwargs):
"""
Check and parse a property with either a specific checking function
or a generic parser
"""
checkers = {
'color': check_color,
'alpha': check_alpha,
'size': check_size,
'thickness': check_thickness,
'index': check... | python | def check_property(prop, name, **kwargs):
"""
Check and parse a property with either a specific checking function
or a generic parser
"""
checkers = {
'color': check_color,
'alpha': check_alpha,
'size': check_size,
'thickness': check_thickness,
'index': check... | [
"def",
"check_property",
"(",
"prop",
",",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"checkers",
"=",
"{",
"'color'",
":",
"check_color",
",",
"'alpha'",
":",
"check_alpha",
",",
"'size'",
":",
"check_size",
",",
"'thickness'",
":",
"check_thickness",
","... | Check and parse a property with either a specific checking function
or a generic parser | [
"Check",
"and",
"parse",
"a",
"property",
"with",
"either",
"a",
"specific",
"checking",
"function",
"or",
"a",
"generic",
"parser"
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/utils.py#L16-L39 |
lightning-viz/lightning-python | lightning/types/utils.py | check_coordinates | def check_coordinates(co, xy=None):
"""
Check and parse coordinates as either a single coordinate list [[r,c],[r,c]] or a
list of coordinates for multiple regions [[[r0,c0],[r0,c0]], [[r1,c1],[r1,c1]]]
"""
if isinstance(co, ndarray):
co = co.tolist()
if not (isinstance(co[0][0], list) or... | python | def check_coordinates(co, xy=None):
"""
Check and parse coordinates as either a single coordinate list [[r,c],[r,c]] or a
list of coordinates for multiple regions [[[r0,c0],[r0,c0]], [[r1,c1],[r1,c1]]]
"""
if isinstance(co, ndarray):
co = co.tolist()
if not (isinstance(co[0][0], list) or... | [
"def",
"check_coordinates",
"(",
"co",
",",
"xy",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"co",
",",
"ndarray",
")",
":",
"co",
"=",
"co",
".",
"tolist",
"(",
")",
"if",
"not",
"(",
"isinstance",
"(",
"co",
"[",
"0",
"]",
"[",
"0",
"]",... | Check and parse coordinates as either a single coordinate list [[r,c],[r,c]] or a
list of coordinates for multiple regions [[[r0,c0],[r0,c0]], [[r1,c1],[r1,c1]]] | [
"Check",
"and",
"parse",
"coordinates",
"as",
"either",
"a",
"single",
"coordinate",
"list",
"[[",
"r",
"c",
"]",
"[",
"r",
"c",
"]]",
"or",
"a",
"list",
"of",
"coordinates",
"for",
"multiple",
"regions",
"[[[",
"r0",
"c0",
"]",
"[",
"r0",
"c0",
"]]"... | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/utils.py#L42-L53 |
lightning-viz/lightning-python | lightning/types/utils.py | check_color | def check_color(c):
"""
Check and parse color specs as either a single [r,g,b] or a list of
[[r,g,b],[r,g,b]...]
"""
c = asarray(c)
if c.ndim == 1:
c = c.flatten()
c = c[newaxis, :]
if c.shape[1] != 3:
raise Exception("Color must have three values per point")... | python | def check_color(c):
"""
Check and parse color specs as either a single [r,g,b] or a list of
[[r,g,b],[r,g,b]...]
"""
c = asarray(c)
if c.ndim == 1:
c = c.flatten()
c = c[newaxis, :]
if c.shape[1] != 3:
raise Exception("Color must have three values per point")... | [
"def",
"check_color",
"(",
"c",
")",
":",
"c",
"=",
"asarray",
"(",
"c",
")",
"if",
"c",
".",
"ndim",
"==",
"1",
":",
"c",
"=",
"c",
".",
"flatten",
"(",
")",
"c",
"=",
"c",
"[",
"newaxis",
",",
":",
"]",
"if",
"c",
".",
"shape",
"[",
"1"... | Check and parse color specs as either a single [r,g,b] or a list of
[[r,g,b],[r,g,b]...] | [
"Check",
"and",
"parse",
"color",
"specs",
"as",
"either",
"a",
"single",
"[",
"r",
"g",
"b",
"]",
"or",
"a",
"list",
"of",
"[[",
"r",
"g",
"b",
"]",
"[",
"r",
"g",
"b",
"]",
"...",
"]"
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/utils.py#L59-L74 |
lightning-viz/lightning-python | lightning/types/utils.py | check_colormap | def check_colormap(cmap):
"""
Check if cmap is one of the colorbrewer maps
"""
names = set(['BrBG', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral',
'Blues', 'BuGn', 'BuPu', 'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', 'PuBu',
'PuBuGn', 'PuRd', '... | python | def check_colormap(cmap):
"""
Check if cmap is one of the colorbrewer maps
"""
names = set(['BrBG', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral',
'Blues', 'BuGn', 'BuPu', 'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', 'PuBu',
'PuBuGn', 'PuRd', '... | [
"def",
"check_colormap",
"(",
"cmap",
")",
":",
"names",
"=",
"set",
"(",
"[",
"'BrBG'",
",",
"'PiYG'",
",",
"'PRGn'",
",",
"'PuOr'",
",",
"'RdBu'",
",",
"'RdGy'",
",",
"'RdYlBu'",
",",
"'RdYlGn'",
",",
"'Spectral'",
",",
"'Blues'",
",",
"'BuGn'",
",",... | Check if cmap is one of the colorbrewer maps | [
"Check",
"if",
"cmap",
"is",
"one",
"of",
"the",
"colorbrewer",
"maps"
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/utils.py#L77-L88 |
lightning-viz/lightning-python | lightning/types/utils.py | check_size | def check_size(s):
"""
Check and parse size specs as either a single [s] or a list of [s,s,s,...]
"""
s = check_1d(s, "size")
if any(map(lambda d: d <= 0, s)):
raise Exception('Size cannot be 0 or negative')
return s | python | def check_size(s):
"""
Check and parse size specs as either a single [s] or a list of [s,s,s,...]
"""
s = check_1d(s, "size")
if any(map(lambda d: d <= 0, s)):
raise Exception('Size cannot be 0 or negative')
return s | [
"def",
"check_size",
"(",
"s",
")",
":",
"s",
"=",
"check_1d",
"(",
"s",
",",
"\"size\"",
")",
"if",
"any",
"(",
"map",
"(",
"lambda",
"d",
":",
"d",
"<=",
"0",
",",
"s",
")",
")",
":",
"raise",
"Exception",
"(",
"'Size cannot be 0 or negative'",
"... | Check and parse size specs as either a single [s] or a list of [s,s,s,...] | [
"Check",
"and",
"parse",
"size",
"specs",
"as",
"either",
"a",
"single",
"[",
"s",
"]",
"or",
"a",
"list",
"of",
"[",
"s",
"s",
"s",
"...",
"]"
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/utils.py#L91-L100 |
lightning-viz/lightning-python | lightning/types/utils.py | check_thickness | def check_thickness(s):
"""
Check and parse thickness specs as either a single [s] or a list of [s,s,s,...]
"""
s = check_1d(s, "thickness")
if any(map(lambda d: d <= 0, s)):
raise Exception('Thickness cannot be 0 or negative')
return s | python | def check_thickness(s):
"""
Check and parse thickness specs as either a single [s] or a list of [s,s,s,...]
"""
s = check_1d(s, "thickness")
if any(map(lambda d: d <= 0, s)):
raise Exception('Thickness cannot be 0 or negative')
return s | [
"def",
"check_thickness",
"(",
"s",
")",
":",
"s",
"=",
"check_1d",
"(",
"s",
",",
"\"thickness\"",
")",
"if",
"any",
"(",
"map",
"(",
"lambda",
"d",
":",
"d",
"<=",
"0",
",",
"s",
")",
")",
":",
"raise",
"Exception",
"(",
"'Thickness cannot be 0 or ... | Check and parse thickness specs as either a single [s] or a list of [s,s,s,...] | [
"Check",
"and",
"parse",
"thickness",
"specs",
"as",
"either",
"a",
"single",
"[",
"s",
"]",
"or",
"a",
"list",
"of",
"[",
"s",
"s",
"s",
"...",
"]"
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/utils.py#L102-L111 |
lightning-viz/lightning-python | lightning/types/utils.py | check_index | def check_index(i):
"""
Checks and parses an index spec, must be a one-dimensional array [i0, i1, ...]
"""
i = asarray(i)
if (i.ndim > 1) or (size(i) < 1):
raise Exception("Index must be one-dimensional and non-singleton")
return i | python | def check_index(i):
"""
Checks and parses an index spec, must be a one-dimensional array [i0, i1, ...]
"""
i = asarray(i)
if (i.ndim > 1) or (size(i) < 1):
raise Exception("Index must be one-dimensional and non-singleton")
return i | [
"def",
"check_index",
"(",
"i",
")",
":",
"i",
"=",
"asarray",
"(",
"i",
")",
"if",
"(",
"i",
".",
"ndim",
">",
"1",
")",
"or",
"(",
"size",
"(",
"i",
")",
"<",
"1",
")",
":",
"raise",
"Exception",
"(",
"\"Index must be one-dimensional and non-single... | Checks and parses an index spec, must be a one-dimensional array [i0, i1, ...] | [
"Checks",
"and",
"parses",
"an",
"index",
"spec",
"must",
"be",
"a",
"one",
"-",
"dimensional",
"array",
"[",
"i0",
"i1",
"...",
"]"
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/utils.py#L113-L122 |
lightning-viz/lightning-python | lightning/types/utils.py | check_alpha | def check_alpha(a):
"""
Check and parse alpha specs as either a single [a] or a list of [a,a,a,...]
"""
a = check_1d(a, "alpha")
if any(map(lambda d: d <= 0, a)):
raise Exception('Alpha cannot be 0 or negative')
return a | python | def check_alpha(a):
"""
Check and parse alpha specs as either a single [a] or a list of [a,a,a,...]
"""
a = check_1d(a, "alpha")
if any(map(lambda d: d <= 0, a)):
raise Exception('Alpha cannot be 0 or negative')
return a | [
"def",
"check_alpha",
"(",
"a",
")",
":",
"a",
"=",
"check_1d",
"(",
"a",
",",
"\"alpha\"",
")",
"if",
"any",
"(",
"map",
"(",
"lambda",
"d",
":",
"d",
"<=",
"0",
",",
"a",
")",
")",
":",
"raise",
"Exception",
"(",
"'Alpha cannot be 0 or negative'",
... | Check and parse alpha specs as either a single [a] or a list of [a,a,a,...] | [
"Check",
"and",
"parse",
"alpha",
"specs",
"as",
"either",
"a",
"single",
"[",
"a",
"]",
"or",
"a",
"list",
"of",
"[",
"a",
"a",
"a",
"...",
"]"
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/utils.py#L125-L134 |
lightning-viz/lightning-python | lightning/types/utils.py | check_1d | def check_1d(x, name):
"""
Check and parse a one-dimensional spec as either a single [x] or a list of [x,x,x...]
"""
x = asarray(x)
if size(x) == 1:
x = asarray([x])
if x.ndim == 2:
raise Exception("Property: %s must be one-dimensional" % name)
x = x.flatten()
return x | python | def check_1d(x, name):
"""
Check and parse a one-dimensional spec as either a single [x] or a list of [x,x,x...]
"""
x = asarray(x)
if size(x) == 1:
x = asarray([x])
if x.ndim == 2:
raise Exception("Property: %s must be one-dimensional" % name)
x = x.flatten()
return x | [
"def",
"check_1d",
"(",
"x",
",",
"name",
")",
":",
"x",
"=",
"asarray",
"(",
"x",
")",
"if",
"size",
"(",
"x",
")",
"==",
"1",
":",
"x",
"=",
"asarray",
"(",
"[",
"x",
"]",
")",
"if",
"x",
".",
"ndim",
"==",
"2",
":",
"raise",
"Exception",... | Check and parse a one-dimensional spec as either a single [x] or a list of [x,x,x...] | [
"Check",
"and",
"parse",
"a",
"one",
"-",
"dimensional",
"spec",
"as",
"either",
"a",
"single",
"[",
"x",
"]",
"or",
"a",
"list",
"of",
"[",
"x",
"x",
"x",
"...",
"]"
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/utils.py#L137-L149 |
lightning-viz/lightning-python | lightning/types/utils.py | polygon_to_mask | def polygon_to_mask(coords, dims, z=None):
"""
Given a list of pairs of points which define a polygon, return a binary
mask covering the interior of the polygon with dimensions dim
"""
bounds = array(coords).astype('int')
path = Path(bounds)
grid = meshgrid(range(dims[1]), range(dims[0]))
... | python | def polygon_to_mask(coords, dims, z=None):
"""
Given a list of pairs of points which define a polygon, return a binary
mask covering the interior of the polygon with dimensions dim
"""
bounds = array(coords).astype('int')
path = Path(bounds)
grid = meshgrid(range(dims[1]), range(dims[0]))
... | [
"def",
"polygon_to_mask",
"(",
"coords",
",",
"dims",
",",
"z",
"=",
"None",
")",
":",
"bounds",
"=",
"array",
"(",
"coords",
")",
".",
"astype",
"(",
"'int'",
")",
"path",
"=",
"Path",
"(",
"bounds",
")",
"grid",
"=",
"meshgrid",
"(",
"range",
"("... | Given a list of pairs of points which define a polygon, return a binary
mask covering the interior of the polygon with dimensions dim | [
"Given",
"a",
"list",
"of",
"pairs",
"of",
"points",
"which",
"define",
"a",
"polygon",
"return",
"a",
"binary",
"mask",
"covering",
"the",
"interior",
"of",
"the",
"polygon",
"with",
"dimensions",
"dim"
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/utils.py#L295-L318 |
lightning-viz/lightning-python | lightning/types/utils.py | polygon_to_points | def polygon_to_points(coords, z=None):
"""
Given a list of pairs of points which define a polygon,
return a list of points interior to the polygon
"""
bounds = array(coords).astype('int')
bmax = bounds.max(0)
bmin = bounds.min(0)
path = Path(bounds)
grid = meshgrid(range(bmin[0],... | python | def polygon_to_points(coords, z=None):
"""
Given a list of pairs of points which define a polygon,
return a list of points interior to the polygon
"""
bounds = array(coords).astype('int')
bmax = bounds.max(0)
bmin = bounds.min(0)
path = Path(bounds)
grid = meshgrid(range(bmin[0],... | [
"def",
"polygon_to_points",
"(",
"coords",
",",
"z",
"=",
"None",
")",
":",
"bounds",
"=",
"array",
"(",
"coords",
")",
".",
"astype",
"(",
"'int'",
")",
"bmax",
"=",
"bounds",
".",
"max",
"(",
"0",
")",
"bmin",
"=",
"bounds",
".",
"min",
"(",
"0... | Given a list of pairs of points which define a polygon,
return a list of points interior to the polygon | [
"Given",
"a",
"list",
"of",
"pairs",
"of",
"points",
"which",
"define",
"a",
"polygon",
"return",
"a",
"list",
"of",
"points",
"interior",
"to",
"the",
"polygon"
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/types/utils.py#L321-L344 |
lightning-viz/lightning-python | lightning/visualization.py | VisualizationLocal.save_html | def save_html(self, filename=None, overwrite=False):
"""
Save self-contained html to a file.
Parameters
----------
filename : str
The filename to save to
"""
if filename is None:
raise ValueError('Please provide a filename, e.g. viz.save_... | python | def save_html(self, filename=None, overwrite=False):
"""
Save self-contained html to a file.
Parameters
----------
filename : str
The filename to save to
"""
if filename is None:
raise ValueError('Please provide a filename, e.g. viz.save_... | [
"def",
"save_html",
"(",
"self",
",",
"filename",
"=",
"None",
",",
"overwrite",
"=",
"False",
")",
":",
"if",
"filename",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'Please provide a filename, e.g. viz.save_html(filename=\"viz.html\").'",
")",
"import",
"os",
... | Save self-contained html to a file.
Parameters
----------
filename : str
The filename to save to | [
"Save",
"self",
"-",
"contained",
"html",
"to",
"a",
"file",
"."
] | train | https://github.com/lightning-viz/lightning-python/blob/68563e1da82d162d204069d7586f7c695b8bd4a6/lightning/visualization.py#L173-L197 |
shanx/django-maintenancemode | maintenancemode/views.py | temporary_unavailable | def temporary_unavailable(request, template_name='503.html'):
"""
Default 503 handler, which looks for the requested URL in the
redirects table, redirects if found, and displays 404 page if not
redirected.
Templates: ``503.html``
Context:
request_path
The path of the request... | python | def temporary_unavailable(request, template_name='503.html'):
"""
Default 503 handler, which looks for the requested URL in the
redirects table, redirects if found, and displays 404 page if not
redirected.
Templates: ``503.html``
Context:
request_path
The path of the request... | [
"def",
"temporary_unavailable",
"(",
"request",
",",
"template_name",
"=",
"'503.html'",
")",
":",
"context",
"=",
"{",
"'request_path'",
":",
"request",
".",
"path",
",",
"}",
"return",
"http",
".",
"HttpResponseTemporaryUnavailable",
"(",
"render_to_string",
"("... | Default 503 handler, which looks for the requested URL in the
redirects table, redirects if found, and displays 404 page if not
redirected.
Templates: ``503.html``
Context:
request_path
The path of the requested URL (e.g., '/app/pages/bad_page/') | [
"Default",
"503",
"handler",
"which",
"looks",
"for",
"the",
"requested",
"URL",
"in",
"the",
"redirects",
"table",
"redirects",
"if",
"found",
"and",
"displays",
"404",
"page",
"if",
"not",
"redirected",
"."
] | train | https://github.com/shanx/django-maintenancemode/blob/16e256172dc289122643ec6f4882abbe02dc2b3c/maintenancemode/views.py#L19-L35 |
jimporter/bfg9000 | bfg9000/versioning.py | simplify_specifiers | def simplify_specifiers(spec):
"""Try to simplify a SpecifierSet by combining redundant specifiers."""
def key(s):
return (s.version, 1 if s.operator in ['>=', '<'] else 2)
def in_bounds(v, lo, hi):
if lo and v not in lo:
return False
if hi and v not in hi:
... | python | def simplify_specifiers(spec):
"""Try to simplify a SpecifierSet by combining redundant specifiers."""
def key(s):
return (s.version, 1 if s.operator in ['>=', '<'] else 2)
def in_bounds(v, lo, hi):
if lo and v not in lo:
return False
if hi and v not in hi:
... | [
"def",
"simplify_specifiers",
"(",
"spec",
")",
":",
"def",
"key",
"(",
"s",
")",
":",
"return",
"(",
"s",
".",
"version",
",",
"1",
"if",
"s",
".",
"operator",
"in",
"[",
"'>='",
",",
"'<'",
"]",
"else",
"2",
")",
"def",
"in_bounds",
"(",
"v",
... | Try to simplify a SpecifierSet by combining redundant specifiers. | [
"Try",
"to",
"simplify",
"a",
"SpecifierSet",
"by",
"combining",
"redundant",
"specifiers",
"."
] | train | https://github.com/jimporter/bfg9000/blob/33615fc67573f0d416297ee9a98dd1ec8b1aa960/bfg9000/versioning.py#L37-L88 |
boriel/zxbasic | symbols/function.py | SymbolFUNCTION.reset | def reset(self, lineno=None, offset=None, type_=None):
""" This is called when we need to reinitialize the instance state
"""
self.lineno = self.lineno if lineno is None else lineno
self.type_ = self.type_ if type_ is None else type_
self.offset = self.offset if offset is None el... | python | def reset(self, lineno=None, offset=None, type_=None):
""" This is called when we need to reinitialize the instance state
"""
self.lineno = self.lineno if lineno is None else lineno
self.type_ = self.type_ if type_ is None else type_
self.offset = self.offset if offset is None el... | [
"def",
"reset",
"(",
"self",
",",
"lineno",
"=",
"None",
",",
"offset",
"=",
"None",
",",
"type_",
"=",
"None",
")",
":",
"self",
".",
"lineno",
"=",
"self",
".",
"lineno",
"if",
"lineno",
"is",
"None",
"else",
"lineno",
"self",
".",
"type_",
"=",
... | This is called when we need to reinitialize the instance state | [
"This",
"is",
"called",
"when",
"we",
"need",
"to",
"reinitialize",
"the",
"instance",
"state"
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/symbols/function.py#L28-L39 |
boriel/zxbasic | symbols/funcdecl.py | SymbolFUNCDECL.make_node | def make_node(cls, func_name, lineno, type_=None):
""" This will return a node with the symbol as a function.
"""
entry = global_.SYMBOL_TABLE.declare_func(func_name, lineno, type_=type_)
if entry is None:
return None
entry.declared = True
return cls(entry, l... | python | def make_node(cls, func_name, lineno, type_=None):
""" This will return a node with the symbol as a function.
"""
entry = global_.SYMBOL_TABLE.declare_func(func_name, lineno, type_=type_)
if entry is None:
return None
entry.declared = True
return cls(entry, l... | [
"def",
"make_node",
"(",
"cls",
",",
"func_name",
",",
"lineno",
",",
"type_",
"=",
"None",
")",
":",
"entry",
"=",
"global_",
".",
"SYMBOL_TABLE",
".",
"declare_func",
"(",
"func_name",
",",
"lineno",
",",
"type_",
"=",
"type_",
")",
"if",
"entry",
"i... | This will return a node with the symbol as a function. | [
"This",
"will",
"return",
"a",
"node",
"with",
"the",
"symbol",
"as",
"a",
"function",
"."
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/symbols/funcdecl.py#L73-L81 |
boriel/zxbasic | api/decorator.py | check_type | def check_type(*args, **kwargs):
''' Checks the function types
'''
args = tuple(x if isinstance(x, collections.Iterable) else (x,) for x in args)
kwargs = {x: kwargs[x] if isinstance(kwargs[x], collections.Iterable) else (kwargs[x],) for x in kwargs}
def decorate(func):
types = args
... | python | def check_type(*args, **kwargs):
''' Checks the function types
'''
args = tuple(x if isinstance(x, collections.Iterable) else (x,) for x in args)
kwargs = {x: kwargs[x] if isinstance(kwargs[x], collections.Iterable) else (kwargs[x],) for x in kwargs}
def decorate(func):
types = args
... | [
"def",
"check_type",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"args",
"=",
"tuple",
"(",
"x",
"if",
"isinstance",
"(",
"x",
",",
"collections",
".",
"Iterable",
")",
"else",
"(",
"x",
",",
")",
"for",
"x",
"in",
"args",
")",
"kwargs",... | Checks the function types | [
"Checks",
"the",
"function",
"types"
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/api/decorator.py#L21-L69 |
boriel/zxbasic | arch/zx48k/translator.py | TranslatorVisitor.add_string_label | def add_string_label(self, str_):
""" Maps ("folds") the given string, returning an unique label ID.
This allows several constant labels to be initialized to the same address
thus saving memory space.
:param str_: the string to map
:return: the unique label ID
"""
... | python | def add_string_label(self, str_):
""" Maps ("folds") the given string, returning an unique label ID.
This allows several constant labels to be initialized to the same address
thus saving memory space.
:param str_: the string to map
:return: the unique label ID
"""
... | [
"def",
"add_string_label",
"(",
"self",
",",
"str_",
")",
":",
"if",
"self",
".",
"STRING_LABELS",
".",
"get",
"(",
"str_",
",",
"None",
")",
"is",
"None",
":",
"self",
".",
"STRING_LABELS",
"[",
"str_",
"]",
"=",
"backend",
".",
"tmp_label",
"(",
")... | Maps ("folds") the given string, returning an unique label ID.
This allows several constant labels to be initialized to the same address
thus saving memory space.
:param str_: the string to map
:return: the unique label ID | [
"Maps",
"(",
"folds",
")",
"the",
"given",
"string",
"returning",
"an",
"unique",
"label",
"ID",
".",
"This",
"allows",
"several",
"constant",
"labels",
"to",
"be",
"initialized",
"to",
"the",
"same",
"address",
"thus",
"saving",
"memory",
"space",
".",
":... | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L89-L99 |
boriel/zxbasic | arch/zx48k/translator.py | TranslatorVisitor.TYPE | def TYPE(type_):
""" Converts a backend type (from api.constants)
to a SymbolTYPE object (taken from the SYMBOL_TABLE).
If type_ is already a SymbolTYPE object, nothing
is done.
"""
if isinstance(type_, symbols.TYPE):
return type_
assert TYPE.is_valid... | python | def TYPE(type_):
""" Converts a backend type (from api.constants)
to a SymbolTYPE object (taken from the SYMBOL_TABLE).
If type_ is already a SymbolTYPE object, nothing
is done.
"""
if isinstance(type_, symbols.TYPE):
return type_
assert TYPE.is_valid... | [
"def",
"TYPE",
"(",
"type_",
")",
":",
"if",
"isinstance",
"(",
"type_",
",",
"symbols",
".",
"TYPE",
")",
":",
"return",
"type_",
"assert",
"TYPE",
".",
"is_valid",
"(",
"type_",
")",
"return",
"gl",
".",
"SYMBOL_TABLE",
".",
"basic_types",
"[",
"type... | Converts a backend type (from api.constants)
to a SymbolTYPE object (taken from the SYMBOL_TABLE).
If type_ is already a SymbolTYPE object, nothing
is done. | [
"Converts",
"a",
"backend",
"type",
"(",
"from",
"api",
".",
"constants",
")",
"to",
"a",
"SymbolTYPE",
"object",
"(",
"taken",
"from",
"the",
"SYMBOL_TABLE",
")",
".",
"If",
"type_",
"is",
"already",
"a",
"SymbolTYPE",
"object",
"nothing",
"is",
"done",
... | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L106-L116 |
boriel/zxbasic | arch/zx48k/translator.py | TranslatorVisitor.emit | def emit(*args):
""" Convert the given args to a Quad (3 address code) instruction
"""
quad = Quad(*args)
__DEBUG__('EMIT ' + str(quad))
MEMORY.append(quad) | python | def emit(*args):
""" Convert the given args to a Quad (3 address code) instruction
"""
quad = Quad(*args)
__DEBUG__('EMIT ' + str(quad))
MEMORY.append(quad) | [
"def",
"emit",
"(",
"*",
"args",
")",
":",
"quad",
"=",
"Quad",
"(",
"*",
"args",
")",
"__DEBUG__",
"(",
"'EMIT '",
"+",
"str",
"(",
"quad",
")",
")",
"MEMORY",
".",
"append",
"(",
"quad",
")"
] | Convert the given args to a Quad (3 address code) instruction | [
"Convert",
"the",
"given",
"args",
"to",
"a",
"Quad",
"(",
"3",
"address",
"code",
")",
"instruction"
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L139-L144 |
boriel/zxbasic | arch/zx48k/translator.py | TranslatorVisitor.norm_attr | def norm_attr(self):
""" Normalize attr state
"""
if not self.HAS_ATTR:
return
self.HAS_ATTR = False
self.emit('call', 'COPY_ATTR', 0)
backend.REQUIRES.add('copy_attr.asm') | python | def norm_attr(self):
""" Normalize attr state
"""
if not self.HAS_ATTR:
return
self.HAS_ATTR = False
self.emit('call', 'COPY_ATTR', 0)
backend.REQUIRES.add('copy_attr.asm') | [
"def",
"norm_attr",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"HAS_ATTR",
":",
"return",
"self",
".",
"HAS_ATTR",
"=",
"False",
"self",
".",
"emit",
"(",
"'call'",
",",
"'COPY_ATTR'",
",",
"0",
")",
"backend",
".",
"REQUIRES",
".",
"add",
"(",... | Normalize attr state | [
"Normalize",
"attr",
"state"
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L217-L225 |
boriel/zxbasic | arch/zx48k/translator.py | TranslatorVisitor.traverse_const | def traverse_const(node):
""" Traverses a constant and returns an string
with the arithmetic expression
"""
if node.token == 'NUMBER':
return node.t
if node.token == 'UNARY':
mid = node.operator
if mid == 'MINUS':
result = ' -'... | python | def traverse_const(node):
""" Traverses a constant and returns an string
with the arithmetic expression
"""
if node.token == 'NUMBER':
return node.t
if node.token == 'UNARY':
mid = node.operator
if mid == 'MINUS':
result = ' -'... | [
"def",
"traverse_const",
"(",
"node",
")",
":",
"if",
"node",
".",
"token",
"==",
"'NUMBER'",
":",
"return",
"node",
".",
"t",
"if",
"node",
".",
"token",
"==",
"'UNARY'",
":",
"mid",
"=",
"node",
".",
"operator",
"if",
"mid",
"==",
"'MINUS'",
":",
... | Traverses a constant and returns an string
with the arithmetic expression | [
"Traverses",
"a",
"constant",
"and",
"returns",
"an",
"string",
"with",
"the",
"arithmetic",
"expression"
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L228-L294 |
boriel/zxbasic | arch/zx48k/translator.py | TranslatorVisitor.check_attr | def check_attr(node, n):
""" Check if ATTR has to be normalized
after this instruction has been translated
to intermediate code.
"""
if len(node.children) > n:
return node.children[n] | python | def check_attr(node, n):
""" Check if ATTR has to be normalized
after this instruction has been translated
to intermediate code.
"""
if len(node.children) > n:
return node.children[n] | [
"def",
"check_attr",
"(",
"node",
",",
"n",
")",
":",
"if",
"len",
"(",
"node",
".",
"children",
")",
">",
"n",
":",
"return",
"node",
".",
"children",
"[",
"n",
"]"
] | Check if ATTR has to be normalized
after this instruction has been translated
to intermediate code. | [
"Check",
"if",
"ATTR",
"has",
"to",
"be",
"normalized",
"after",
"this",
"instruction",
"has",
"been",
"translated",
"to",
"intermediate",
"code",
"."
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L297-L303 |
boriel/zxbasic | arch/zx48k/translator.py | Translator.emit_var_assign | def emit_var_assign(self, var, t):
""" Emits code for storing a value into a variable
:param var: variable (node) to be updated
:param t: the value to emmit (e.g. a _label, a const, a tN...)
"""
p = '*' if var.byref else '' # Indirection prefix
if self.O_LEVEL > 1 and no... | python | def emit_var_assign(self, var, t):
""" Emits code for storing a value into a variable
:param var: variable (node) to be updated
:param t: the value to emmit (e.g. a _label, a const, a tN...)
"""
p = '*' if var.byref else '' # Indirection prefix
if self.O_LEVEL > 1 and no... | [
"def",
"emit_var_assign",
"(",
"self",
",",
"var",
",",
"t",
")",
":",
"p",
"=",
"'*'",
"if",
"var",
".",
"byref",
"else",
"''",
"# Indirection prefix",
"if",
"self",
".",
"O_LEVEL",
">",
"1",
"and",
"not",
"var",
".",
"accessed",
":",
"return",
"if"... | Emits code for storing a value into a variable
:param var: variable (node) to be updated
:param t: the value to emmit (e.g. a _label, a const, a tN...) | [
"Emits",
"code",
"for",
"storing",
"a",
"value",
"into",
"a",
"variable",
":",
"param",
"var",
":",
"variable",
"(",
"node",
")",
"to",
"be",
"updated",
":",
"param",
"t",
":",
"the",
"value",
"to",
"emmit",
"(",
"e",
".",
"g",
".",
"a",
"_label",
... | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L1159-L1178 |
boriel/zxbasic | arch/zx48k/translator.py | Translator.loop_exit_label | def loop_exit_label(self, loop_type):
""" Returns the label for the given loop type which
exits the loop. loop_type must be one of 'FOR', 'WHILE', 'DO'
"""
for i in range(len(self.LOOPS) - 1, -1, -1):
if loop_type == self.LOOPS[i][0]:
return self.LOOPS[i][1]
... | python | def loop_exit_label(self, loop_type):
""" Returns the label for the given loop type which
exits the loop. loop_type must be one of 'FOR', 'WHILE', 'DO'
"""
for i in range(len(self.LOOPS) - 1, -1, -1):
if loop_type == self.LOOPS[i][0]:
return self.LOOPS[i][1]
... | [
"def",
"loop_exit_label",
"(",
"self",
",",
"loop_type",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"LOOPS",
")",
"-",
"1",
",",
"-",
"1",
",",
"-",
"1",
")",
":",
"if",
"loop_type",
"==",
"self",
".",
"LOOPS",
"[",
"i",... | Returns the label for the given loop type which
exits the loop. loop_type must be one of 'FOR', 'WHILE', 'DO' | [
"Returns",
"the",
"label",
"for",
"the",
"given",
"loop",
"type",
"which",
"exits",
"the",
"loop",
".",
"loop_type",
"must",
"be",
"one",
"of",
"FOR",
"WHILE",
"DO"
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L1195-L1203 |
boriel/zxbasic | arch/zx48k/translator.py | Translator.loop_cont_label | def loop_cont_label(self, loop_type):
""" Returns the label for the given loop type which
continues the loop. loop_type must be one of 'FOR', 'WHILE', 'DO'
"""
for i in range(len(self.LOOPS) - 1, -1, -1):
if loop_type == self.LOOPS[i][0]:
return self.LOOPS[i][... | python | def loop_cont_label(self, loop_type):
""" Returns the label for the given loop type which
continues the loop. loop_type must be one of 'FOR', 'WHILE', 'DO'
"""
for i in range(len(self.LOOPS) - 1, -1, -1):
if loop_type == self.LOOPS[i][0]:
return self.LOOPS[i][... | [
"def",
"loop_cont_label",
"(",
"self",
",",
"loop_type",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"LOOPS",
")",
"-",
"1",
",",
"-",
"1",
",",
"-",
"1",
")",
":",
"if",
"loop_type",
"==",
"self",
".",
"LOOPS",
"[",
"i",... | Returns the label for the given loop type which
continues the loop. loop_type must be one of 'FOR', 'WHILE', 'DO' | [
"Returns",
"the",
"label",
"for",
"the",
"given",
"loop",
"type",
"which",
"continues",
"the",
"loop",
".",
"loop_type",
"must",
"be",
"one",
"of",
"FOR",
"WHILE",
"DO"
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L1205-L1213 |
boriel/zxbasic | arch/zx48k/translator.py | Translator.default_value | def default_value(cls, type_, expr): # TODO: This function must be moved to api.xx
""" Returns a list of bytes (as hexadecimal 2 char string)
"""
assert isinstance(type_, symbols.TYPE)
assert type_.is_basic
assert check.is_static(expr)
if isinstance(expr, (symbols.CONST... | python | def default_value(cls, type_, expr): # TODO: This function must be moved to api.xx
""" Returns a list of bytes (as hexadecimal 2 char string)
"""
assert isinstance(type_, symbols.TYPE)
assert type_.is_basic
assert check.is_static(expr)
if isinstance(expr, (symbols.CONST... | [
"def",
"default_value",
"(",
"cls",
",",
"type_",
",",
"expr",
")",
":",
"# TODO: This function must be moved to api.xx",
"assert",
"isinstance",
"(",
"type_",
",",
"symbols",
".",
"TYPE",
")",
"assert",
"type_",
".",
"is_basic",
"assert",
"check",
".",
"is_stat... | Returns a list of bytes (as hexadecimal 2 char string) | [
"Returns",
"a",
"list",
"of",
"bytes",
"(",
"as",
"hexadecimal",
"2",
"char",
"string",
")"
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L1216-L1274 |
boriel/zxbasic | arch/zx48k/translator.py | Translator.array_default_value | def array_default_value(type_, values):
""" Returns a list of bytes (as hexadecimal 2 char string)
which represents the array initial value.
"""
if not isinstance(values, list):
return Translator.default_value(type_, values)
l = []
for row in values:
... | python | def array_default_value(type_, values):
""" Returns a list of bytes (as hexadecimal 2 char string)
which represents the array initial value.
"""
if not isinstance(values, list):
return Translator.default_value(type_, values)
l = []
for row in values:
... | [
"def",
"array_default_value",
"(",
"type_",
",",
"values",
")",
":",
"if",
"not",
"isinstance",
"(",
"values",
",",
"list",
")",
":",
"return",
"Translator",
".",
"default_value",
"(",
"type_",
",",
"values",
")",
"l",
"=",
"[",
"]",
"for",
"row",
"in"... | Returns a list of bytes (as hexadecimal 2 char string)
which represents the array initial value. | [
"Returns",
"a",
"list",
"of",
"bytes",
"(",
"as",
"hexadecimal",
"2",
"char",
"string",
")",
"which",
"represents",
"the",
"array",
"initial",
"value",
"."
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L1277-L1288 |
boriel/zxbasic | arch/zx48k/translator.py | Translator.has_control_chars | def has_control_chars(i):
""" Returns true if the passed token is an unknown string
or a constant string having control chars (inverse, etc
"""
if not hasattr(i, 'type_'):
return False
if i.type_ != Type.string:
return False
if i.token in ('VAR',... | python | def has_control_chars(i):
""" Returns true if the passed token is an unknown string
or a constant string having control chars (inverse, etc
"""
if not hasattr(i, 'type_'):
return False
if i.type_ != Type.string:
return False
if i.token in ('VAR',... | [
"def",
"has_control_chars",
"(",
"i",
")",
":",
"if",
"not",
"hasattr",
"(",
"i",
",",
"'type_'",
")",
":",
"return",
"False",
"if",
"i",
".",
"type_",
"!=",
"Type",
".",
"string",
":",
"return",
"False",
"if",
"i",
".",
"token",
"in",
"(",
"'VAR'"... | Returns true if the passed token is an unknown string
or a constant string having control chars (inverse, etc | [
"Returns",
"true",
"if",
"the",
"passed",
"token",
"is",
"an",
"unknown",
"string",
"or",
"a",
"constant",
"string",
"having",
"control",
"chars",
"(",
"inverse",
"etc"
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L1291-L1314 |
boriel/zxbasic | arch/zx48k/translator.py | BuiltinTranslator.visit_USR | def visit_USR(self, node):
""" Machine code call from basic
"""
self.emit('fparam' + self.TSUFFIX(gl.PTR_TYPE), node.children[0].t)
self.emit('call', 'USR', node.type_.size)
backend.REQUIRES.add('usr.asm') | python | def visit_USR(self, node):
""" Machine code call from basic
"""
self.emit('fparam' + self.TSUFFIX(gl.PTR_TYPE), node.children[0].t)
self.emit('call', 'USR', node.type_.size)
backend.REQUIRES.add('usr.asm') | [
"def",
"visit_USR",
"(",
"self",
",",
"node",
")",
":",
"self",
".",
"emit",
"(",
"'fparam'",
"+",
"self",
".",
"TSUFFIX",
"(",
"gl",
".",
"PTR_TYPE",
")",
",",
"node",
".",
"children",
"[",
"0",
"]",
".",
"t",
")",
"self",
".",
"emit",
"(",
"'... | Machine code call from basic | [
"Machine",
"code",
"call",
"from",
"basic"
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/arch/zx48k/translator.py#L1559-L1564 |
boriel/zxbasic | symbols/symbol_.py | Symbol.copy_attr | def copy_attr(self, other):
""" Copies all other attributes (not methods)
from the other object to this instance.
"""
if not isinstance(other, Symbol):
return # Nothing done if not a Symbol object
tmp = re.compile('__.*__')
for attr in (x for x in dir(other)... | python | def copy_attr(self, other):
""" Copies all other attributes (not methods)
from the other object to this instance.
"""
if not isinstance(other, Symbol):
return # Nothing done if not a Symbol object
tmp = re.compile('__.*__')
for attr in (x for x in dir(other)... | [
"def",
"copy_attr",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"Symbol",
")",
":",
"return",
"# Nothing done if not a Symbol object",
"tmp",
"=",
"re",
".",
"compile",
"(",
"'__.*__'",
")",
"for",
"attr",
"in",
"(",
... | Copies all other attributes (not methods)
from the other object to this instance. | [
"Copies",
"all",
"other",
"attributes",
"(",
"not",
"methods",
")",
"from",
"the",
"other",
"object",
"to",
"this",
"instance",
"."
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/symbols/symbol_.py#L47-L65 |
boriel/zxbasic | prepro/definestable.py | DefinesTable.define | def define(self, id_, lineno, value='', fname=None, args=None):
""" Defines the value of a macro.
Issues a warning if the macro is already defined.
"""
if fname is None:
if CURRENT_FILE:
fname = CURRENT_FILE[-1]
else: # If no files opened yet, use... | python | def define(self, id_, lineno, value='', fname=None, args=None):
""" Defines the value of a macro.
Issues a warning if the macro is already defined.
"""
if fname is None:
if CURRENT_FILE:
fname = CURRENT_FILE[-1]
else: # If no files opened yet, use... | [
"def",
"define",
"(",
"self",
",",
"id_",
",",
"lineno",
",",
"value",
"=",
"''",
",",
"fname",
"=",
"None",
",",
"args",
"=",
"None",
")",
":",
"if",
"fname",
"is",
"None",
":",
"if",
"CURRENT_FILE",
":",
"fname",
"=",
"CURRENT_FILE",
"[",
"-",
... | Defines the value of a macro.
Issues a warning if the macro is already defined. | [
"Defines",
"the",
"value",
"of",
"a",
"macro",
".",
"Issues",
"a",
"warning",
"if",
"the",
"macro",
"is",
"already",
"defined",
"."
] | train | https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/prepro/definestable.py#L31-L45 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.