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_documentation_string
stringlengths
1
47.2k
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...
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...
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...
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``) ...
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...
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...
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('/')
Joins given arguments into a url. Trailing but not leading slashes are stripped for each argument.
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...
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...
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. """ ...
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.
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. ...
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.
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...
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.
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. """ ...
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.
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, ...
Property for accessing artifact manager of the current job. :return: instance of :class:`yagocd.resources.artifact.ArtifactManager` :rtype: yagocd.resources.artifact.ArtifactManager
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...
Property for accessing property (doh!) manager of the current job. :return: instance of :class:`yagocd.resources.property.PropertyManager` :rtype: yagocd.resources.property.PropertyManager
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_...
Returns url for accessing stage instance.
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. """ ...
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.
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. ...
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.
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)
Cancel an active stage of a specified stage. :return: a text confirmation.
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...
Method for getting jobs from stage instance. :return: arrays of jobs. :rtype: list of yagocd.resources.job.JobInstance
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: ...
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
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....
Property for accessing :class:`AgentManager` instance, which is used to manage agents. :rtype: yagocd.resources.agent.AgentManager
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...
Property for accessing :class:`ArtifactManager` instance, which is used to manage artifacts. :rtype: yagocd.resources.artifact.ArtifactManager
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 = ...
Property for accessing :class:`ConfigurationManager` instance, which is used to manage configurations. :rtype: yagocd.resources.configuration.ConfigurationManager
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...
Property for accessing :class:`EncryptionManager` instance, which is used to manage encryption. :rtype: yagocd.resources.encryption.EncryptionManager
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: ...
Property for accessing :class:`ElasticAgentProfileManager` instance, which is used to manage elastic agent profiles. :rtype: yagocd.resources.elastic_profile.ElasticAgentProfileManager
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...
Property for accessing :class:`EnvironmentManager` instance, which is used to manage environments. :rtype: yagocd.resources.environment.EnvironmentManager
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...
Property for accessing :class:`FeedManager` instance, which is used to manage feeds. :rtype: yagocd.resources.feed.FeedManager
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
Property for accessing :class:`JobManager` instance, which is used to manage feeds. :rtype: yagocd.resources.job.JobManager
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...
Property for accessing :class:`InfoManager` instance, which is used to general server info. :rtype: yagocd.resources.info.InfoManager
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: ...
Property for accessing :class:`NotificationFilterManager` instance, which is used to manage notification filters. :rtype: yagocd.resources.notification_filter.NotificationFilterManager
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...
Property for accessing :class:`MaterialManager` instance, which is used to manage materials. :rtype: yagocd.resources.material.MaterialManager
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) ...
Property for accessing :class:`PackageManager` instance, which is used to manage packages. :rtype: yagocd.resources.package.PackageManager
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...
Property for accessing :class:`PackageRepositoryManager` instance, which is used to manage package repos. :rtype: yagocd.resources.package_repository.PackageRepositoryManager
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...
Property for accessing :class:`PipelineManager` instance, which is used to manage pipelines. :rtype: yagocd.resources.pipeline.PipelineManager
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...
Property for accessing :class:`PipelineConfigManager` instance, which is used to manage pipeline configurations. :rtype: yagocd.resources.pipeline_config.PipelineConfigManager
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...
Property for accessing :class:`PluginInfoManager` instance, which is used to manage pipeline configurations. :rtype: yagocd.resources.plugin_info.PluginInfoManager
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...
Property for accessing :class:`PropertyManager` instance, which is used to manage properties of the jobs. :rtype: yagocd.resources.property.PropertyManager
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...
Property for accessing :class:`SCMManager` instance, which is used to manage pluggable SCM materials. :rtype: yagocd.resources.scm.SCMManager
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....
Property for accessing :class:`StageManager` instance, which is used to manage stages. :rtype: yagocd.resources.stage.StageManager
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...
Property for accessing :class:`TemplateManager` instance, which is used to manage templates. :rtype: yagocd.resources.template.TemplateManager
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...
Property for accessing :class:`UserManager` instance, which is used to manage users. :rtype: yagocd.resources.user.UserManager
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) ...
Property for accessing :class:`VersionManager` instance, which is used to get server info. :rtype: yagocd.resources.version.VersionManager
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)
Returns url for accessing pipeline entity.
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)
Property for accessing pipeline configuration. :rtype: yagocd.resources.pipeline_config.PipelineConfigManager
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...
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
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...
Gets pipeline instance object. :param counter pipeline counter: :return: A pipeline instance object :class:`yagocd.resources.pipeline.PipelineInstance`. :rtype: yagocd.resources.pipeline.PipelineInstance
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)
Pause the current pipeline. :param cause: reason for pausing the pipeline.
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...
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.
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...
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 ...
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)
Returns url for accessing pipeline entity.
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,...
Method for getting stages from pipeline instance. :return: arrays of stages :rtype: list of yagocd.resources.stage.StageInstance
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...
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
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...
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...
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...
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`. ...
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...
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
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...
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...
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[ ...
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...
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._...
Method for getting artifact's content. Could only be applicable for file type. :return: content of the artifact.
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...
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...
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. """ # ...
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.
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...
Disable plotting in the iPython notebook. After disabling, lightning plots will be produced in your lightning server, but will not appear in the notebook.
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....
Create a lightning session. Can create a session with the provided name, otherwise session name will be "Session No." with the number automatically generated.
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...
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.
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
Set authenatication.
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 =...
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.
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...
Check the server for status
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...
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...
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...
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...
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...
Base method for updating data. Applies a plot-type specific cleaning operation, then updates the data in the visualization.
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'] ...
Base method for appending data. Applies a plot-type specific cleaning operation, then appends data to the visualization.
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...
Base method for retrieving user data from a viz.
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...
Check and parse a property with either a specific checking function or a generic parser
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...
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]]]
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")...
Check and parse color specs as either a single [r,g,b] or a list of [[r,g,b],[r,g,b]...]
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', '...
Check if cmap is one of the colorbrewer maps
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
Check and parse size specs as either a single [s] or a list of [s,s,s,...]
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
Check and parse thickness specs as either a single [s] or a list of [s,s,s,...]
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
Checks and parses an index spec, must be a one-dimensional array [i0, i1, ...]
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
Check and parse alpha specs as either a single [a] or a list of [a,a,a,...]
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
Check and parse a one-dimensional spec as either a single [x] or a list of [x,x,x...]
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])) ...
Given a list of pairs of points which define a polygon, return a binary mask covering the interior of the polygon with dimensions dim
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],...
Given a list of pairs of points which define a polygon, return a list of points interior to the polygon
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_...
Save self-contained html to a file. Parameters ---------- filename : str The filename to save to
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...
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/')
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: ...
Try to simplify a SpecifierSet by combining redundant specifiers.
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...
This is called when we need to reinitialize the instance state
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...
This will return a node with the symbol as a function.
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 ...
Checks the function types
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 """ ...
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
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...
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.
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)
Convert the given args to a Quad (3 address code) instruction
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')
Normalize attr state
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 = ' -'...
Traverses a constant and returns an string with the arithmetic expression
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]
Check if ATTR has to be normalized after this instruction has been translated to intermediate code.
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...
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...)
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] ...
Returns the label for the given loop type which exits the loop. loop_type must be one of 'FOR', 'WHILE', 'DO'
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][...
Returns the label for the given loop type which continues the loop. loop_type must be one of 'FOR', 'WHILE', 'DO'
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...
Returns a list of bytes (as hexadecimal 2 char string)
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: ...
Returns a list of bytes (as hexadecimal 2 char string) which represents the array initial value.
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',...
Returns true if the passed token is an unknown string or a constant string having control chars (inverse, etc
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')
Machine code call from basic
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)...
Copies all other attributes (not methods) from the other object to this instance.
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...
Defines the value of a macro. Issues a warning if the macro is already defined.
https://github.com/boriel/zxbasic/blob/23b28db10e41117805bdb3c0f78543590853b132/prepro/definestable.py#L31-L45