repo
stringlengths
7
55
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
19
28.4k
docstring
stringlengths
1
46.9k
docstring_tokens
listlengths
1
1.97k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
sci-bots/svg-model
svg_model/__init__.py
remove_layer
def remove_layer(svg_source, layer_name): ''' Remove layer(s) from SVG document. Arguments --------- svg_source : str or file-like A file path, URI, or file-like object. layer_name : str or list Layer name or list of layer names to remove from SVG document. Returns ----...
python
def remove_layer(svg_source, layer_name): ''' Remove layer(s) from SVG document. Arguments --------- svg_source : str or file-like A file path, URI, or file-like object. layer_name : str or list Layer name or list of layer names to remove from SVG document. Returns ----...
[ "def", "remove_layer", "(", "svg_source", ",", "layer_name", ")", ":", "# Parse input file.", "xml_root", "=", "lxml", ".", "etree", ".", "parse", "(", "svg_source", ")", "svg_root", "=", "xml_root", ".", "xpath", "(", "'/svg:svg'", ",", "namespaces", "=", "...
Remove layer(s) from SVG document. Arguments --------- svg_source : str or file-like A file path, URI, or file-like object. layer_name : str or list Layer name or list of layer names to remove from SVG document. Returns ------- StringIO.StringIO File-like object con...
[ "Remove", "layer", "(", "s", ")", "from", "SVG", "document", "." ]
2d119650f995e62b29ce0b3151a23f3b957cb072
https://github.com/sci-bots/svg-model/blob/2d119650f995e62b29ce0b3151a23f3b957cb072/svg_model/__init__.py#L408-L445
train
BlueBrain/hpcbench
hpcbench/toolbox/loader.py
load_eggs
def load_eggs(entry_point_name): """Loader that loads any eggs in `sys.path`.""" def _load_eggs(): distributions, errors = working_set.find_plugins(Environment()) for dist in distributions: # pylint: disable=unsupported-membership-test if dist not in working_set: ...
python
def load_eggs(entry_point_name): """Loader that loads any eggs in `sys.path`.""" def _load_eggs(): distributions, errors = working_set.find_plugins(Environment()) for dist in distributions: # pylint: disable=unsupported-membership-test if dist not in working_set: ...
[ "def", "load_eggs", "(", "entry_point_name", ")", ":", "def", "_load_eggs", "(", ")", ":", "distributions", ",", "errors", "=", "working_set", ".", "find_plugins", "(", "Environment", "(", ")", ")", "for", "dist", "in", "distributions", ":", "# pylint: disable...
Loader that loads any eggs in `sys.path`.
[ "Loader", "that", "loads", "any", "eggs", "in", "sys", ".", "path", "." ]
192d0ec142b897157ec25f131d1ef28f84752592
https://github.com/BlueBrain/hpcbench/blob/192d0ec142b897157ec25f131d1ef28f84752592/hpcbench/toolbox/loader.py#L18-L51
train
Capitains/Nautilus
capitains_nautilus/cts/collections.py
SparqlXmlCitation.refsDecl
def refsDecl(self): """ ResfDecl expression of the citation scheme :rtype: str :Example: /tei:TEI/tei:text/tei:body/tei:div//tei:l[@n='$1'] """ for refsDecl in self.graph.objects(self.asNode(), RDF_NAMESPACES.TEI.replacementPattern): return str(refsDecl)
python
def refsDecl(self): """ ResfDecl expression of the citation scheme :rtype: str :Example: /tei:TEI/tei:text/tei:body/tei:div//tei:l[@n='$1'] """ for refsDecl in self.graph.objects(self.asNode(), RDF_NAMESPACES.TEI.replacementPattern): return str(refsDecl)
[ "def", "refsDecl", "(", "self", ")", ":", "for", "refsDecl", "in", "self", ".", "graph", ".", "objects", "(", "self", ".", "asNode", "(", ")", ",", "RDF_NAMESPACES", ".", "TEI", ".", "replacementPattern", ")", ":", "return", "str", "(", "refsDecl", ")"...
ResfDecl expression of the citation scheme :rtype: str :Example: /tei:TEI/tei:text/tei:body/tei:div//tei:l[@n='$1']
[ "ResfDecl", "expression", "of", "the", "citation", "scheme" ]
6be453fe0cc0e2c1b89ff06e5af1409165fc1411
https://github.com/Capitains/Nautilus/blob/6be453fe0cc0e2c1b89ff06e5af1409165fc1411/capitains_nautilus/cts/collections.py#L108-L115
train
KelSolaar/Manager
manager/components_manager.py
Profile.file
def file(self, value): """ Setter for **self.__file** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format("file", value) self._...
python
def file(self, value): """ Setter for **self.__file** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format("file", value) self._...
[ "def", "file", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "unicode", ",", "\"'{0}' attribute: '{1}' type is not 'unicode'!\"", ".", "format", "(", "\"file\"", ",", "value", ")", ...
Setter for **self.__file** attribute. :param value: Attribute value. :type value: unicode
[ "Setter", "for", "**", "self", ".", "__file", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L154-L164
train
KelSolaar/Manager
manager/components_manager.py
Profile.directory
def directory(self, value): """ Setter for **self.__directory** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "d...
python
def directory(self, value): """ Setter for **self.__directory** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "d...
[ "def", "directory", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "unicode", ",", "\"'{0}' attribute: '{1}' type is not 'unicode'!\"", ".", "format", "(", "\"directory\"", ",", "value",...
Setter for **self.__directory** attribute. :param value: Attribute value. :type value: unicode
[ "Setter", "for", "**", "self", ".", "__directory", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L189-L201
train
KelSolaar/Manager
manager/components_manager.py
Profile.attribute
def attribute(self, value): """ Setter for **self.__attribute** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "a...
python
def attribute(self, value): """ Setter for **self.__attribute** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "a...
[ "def", "attribute", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "unicode", ",", "\"'{0}' attribute: '{1}' type is not 'unicode'!\"", ".", "format", "(", "\"attribute\"", ",", "value",...
Setter for **self.__attribute** attribute. :param value: Attribute value. :type value: unicode
[ "Setter", "for", "**", "self", ".", "__attribute", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L226-L237
train
KelSolaar/Manager
manager/components_manager.py
Profile.require
def require(self, value): """ Setter for **self.__require** attribute. :param value: Attribute value. :type value: tuple or list """ if value is not None: assert type(value) in (tuple, list), "'{0}' attribute: '{1}' type is not 'tuple' or 'list'!".format( ...
python
def require(self, value): """ Setter for **self.__require** attribute. :param value: Attribute value. :type value: tuple or list """ if value is not None: assert type(value) in (tuple, list), "'{0}' attribute: '{1}' type is not 'tuple' or 'list'!".format( ...
[ "def", "require", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "in", "(", "tuple", ",", "list", ")", ",", "\"'{0}' attribute: '{1}' type is not 'tuple' or 'list'!\"", ".", "format", "(", ...
Setter for **self.__require** attribute. :param value: Attribute value. :type value: tuple or list
[ "Setter", "for", "**", "self", ".", "__require", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L262-L273
train
KelSolaar/Manager
manager/components_manager.py
Profile.module
def module(self, value): """ Setter for **self.__module** attribute. :param value: Attribute value. :type value: ModuleType """ if value is not None: assert type(value) is type(sys), "'{0}' attribute: '{1}' type is not 'module'!".format("module", value) ...
python
def module(self, value): """ Setter for **self.__module** attribute. :param value: Attribute value. :type value: ModuleType """ if value is not None: assert type(value) is type(sys), "'{0}' attribute: '{1}' type is not 'module'!".format("module", value) ...
[ "def", "module", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "type", "(", "sys", ")", ",", "\"'{0}' attribute: '{1}' type is not 'module'!\"", ".", "format", "(", "\"module\"", ",...
Setter for **self.__module** attribute. :param value: Attribute value. :type value: ModuleType
[ "Setter", "for", "**", "self", ".", "__module", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L298-L308
train
KelSolaar/Manager
manager/components_manager.py
Profile.category
def category(self, value): """ Setter for **self.__category** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "cat...
python
def category(self, value): """ Setter for **self.__category** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "cat...
[ "def", "category", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "unicode", ",", "\"'{0}' attribute: '{1}' type is not 'unicode'!\"", ".", "format", "(", "\"category\"", ",", "value", ...
Setter for **self.__category** attribute. :param value: Attribute value. :type value: unicode
[ "Setter", "for", "**", "self", ".", "__category", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L365-L376
train
KelSolaar/Manager
manager/components_manager.py
Profile.title
def title(self, value): """ Setter for **self.__title** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "title", v...
python
def title(self, value): """ Setter for **self.__title** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "title", v...
[ "def", "title", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "unicode", ",", "\"'{0}' attribute: '{1}' type is not 'unicode'!\"", ".", "format", "(", "\"title\"", ",", "value", ")", ...
Setter for **self.__title** attribute. :param value: Attribute value. :type value: unicode
[ "Setter", "for", "**", "self", ".", "__title", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L401-L412
train
KelSolaar/Manager
manager/components_manager.py
Profile.package
def package(self, value): """ Setter for **self.__package** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "packa...
python
def package(self, value): """ Setter for **self.__package** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "packa...
[ "def", "package", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "unicode", ",", "\"'{0}' attribute: '{1}' type is not 'unicode'!\"", ".", "format", "(", "\"package\"", ",", "value", "...
Setter for **self.__package** attribute. :param value: Attribute value. :type value: unicode
[ "Setter", "for", "**", "self", ".", "__package", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L437-L448
train
KelSolaar/Manager
manager/components_manager.py
Profile.version
def version(self, value): """ Setter for **self.__version** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "versi...
python
def version(self, value): """ Setter for **self.__version** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "versi...
[ "def", "version", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "unicode", ",", "\"'{0}' attribute: '{1}' type is not 'unicode'!\"", ".", "format", "(", "\"version\"", ",", "value", "...
Setter for **self.__version** attribute. :param value: Attribute value. :type value: unicode
[ "Setter", "for", "**", "self", ".", "__version", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L473-L484
train
KelSolaar/Manager
manager/components_manager.py
Profile.author
def author(self, value): """ Setter for **self.__author** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "author"...
python
def author(self, value): """ Setter for **self.__author** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "author"...
[ "def", "author", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "unicode", ",", "\"'{0}' attribute: '{1}' type is not 'unicode'!\"", ".", "format", "(", "\"author\"", ",", "value", ")"...
Setter for **self.__author** attribute. :param value: Attribute value. :type value: unicode
[ "Setter", "for", "**", "self", ".", "__author", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L509-L520
train
KelSolaar/Manager
manager/components_manager.py
Profile.email
def email(self, value): """ Setter for **self.__email** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "email", v...
python
def email(self, value): """ Setter for **self.__email** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "email", v...
[ "def", "email", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "unicode", ",", "\"'{0}' attribute: '{1}' type is not 'unicode'!\"", ".", "format", "(", "\"email\"", ",", "value", ")", ...
Setter for **self.__email** attribute. :param value: Attribute value. :type value: unicode
[ "Setter", "for", "**", "self", ".", "__email", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L545-L556
train
KelSolaar/Manager
manager/components_manager.py
Profile.url
def url(self, value): """ Setter for **self.__url** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "url", value) ...
python
def url(self, value): """ Setter for **self.__url** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "url", value) ...
[ "def", "url", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "unicode", ",", "\"'{0}' attribute: '{1}' type is not 'unicode'!\"", ".", "format", "(", "\"url\"", ",", "value", ")", "s...
Setter for **self.__url** attribute. :param value: Attribute value. :type value: unicode
[ "Setter", "for", "**", "self", ".", "__url", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L581-L592
train
KelSolaar/Manager
manager/components_manager.py
Profile.description
def description(self, value): """ Setter for **self.__description** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( ...
python
def description(self, value): """ Setter for **self.__description** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( ...
[ "def", "description", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "unicode", ",", "\"'{0}' attribute: '{1}' type is not 'unicode'!\"", ".", "format", "(", "\"description\"", ",", "val...
Setter for **self.__description** attribute. :param value: Attribute value. :type value: unicode
[ "Setter", "for", "**", "self", ".", "__description", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L617-L628
train
KelSolaar/Manager
manager/components_manager.py
Profile.initializeProfile
def initializeProfile(self): """ Initializes the Component Profile. :return: Method success. :rtype: bool """ LOGGER.debug("> Building '{0}' profile.".format(self.__file)) sections_file_parser = SectionsFileParser(self.__file) sections_file_parser.parse...
python
def initializeProfile(self): """ Initializes the Component Profile. :return: Method success. :rtype: bool """ LOGGER.debug("> Building '{0}' profile.".format(self.__file)) sections_file_parser = SectionsFileParser(self.__file) sections_file_parser.parse...
[ "def", "initializeProfile", "(", "self", ")", ":", "LOGGER", ".", "debug", "(", "\"> Building '{0}' profile.\"", ".", "format", "(", "self", ".", "__file", ")", ")", "sections_file_parser", "=", "SectionsFileParser", "(", "self", ".", "__file", ")", "sections_fi...
Initializes the Component Profile. :return: Method success. :rtype: bool
[ "Initializes", "the", "Component", "Profile", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L641-L695
train
KelSolaar/Manager
manager/components_manager.py
Manager.paths
def paths(self, value): """ Setter for **self.__paths** attribute. :param value: Attribute value. :type value: tuple or list """ if value is not None: assert type(value) in (tuple, list), "'{0}' attribute: '{1}' type is not 'tuple' or 'list'!".format( ...
python
def paths(self, value): """ Setter for **self.__paths** attribute. :param value: Attribute value. :type value: tuple or list """ if value is not None: assert type(value) in (tuple, list), "'{0}' attribute: '{1}' type is not 'tuple' or 'list'!".format( ...
[ "def", "paths", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "in", "(", "tuple", ",", "list", ")", ",", "\"'{0}' attribute: '{1}' type is not 'tuple' or 'list'!\"", ".", "format", "(", "...
Setter for **self.__paths** attribute. :param value: Attribute value. :type value: tuple or list
[ "Setter", "for", "**", "self", ".", "__paths", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L759-L774
train
KelSolaar/Manager
manager/components_manager.py
Manager.extension
def extension(self, value): """ Setter for **self.__extension** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "e...
python
def extension(self, value): """ Setter for **self.__extension** attribute. :param value: Attribute value. :type value: unicode """ if value is not None: assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format( "e...
[ "def", "extension", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "unicode", ",", "\"'{0}' attribute: '{1}' type is not 'unicode'!\"", ".", "format", "(", "\"extension\"", ",", "value",...
Setter for **self.__extension** attribute. :param value: Attribute value. :type value: unicode
[ "Setter", "for", "**", "self", ".", "__extension", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L799-L810
train
KelSolaar/Manager
manager/components_manager.py
Manager.categories
def categories(self, value): """ Setter for **self.__categories** attribute. :param value: Attribute value. :type value: dict """ if value is not None: assert type(value) is dict, "'{0}' attribute: '{1}' type is not 'dict'!".format("categories", value) ...
python
def categories(self, value): """ Setter for **self.__categories** attribute. :param value: Attribute value. :type value: dict """ if value is not None: assert type(value) is dict, "'{0}' attribute: '{1}' type is not 'dict'!".format("categories", value) ...
[ "def", "categories", "(", "self", ",", "value", ")", ":", "if", "value", "is", "not", "None", ":", "assert", "type", "(", "value", ")", "is", "dict", ",", "\"'{0}' attribute: '{1}' type is not 'dict'!\"", ".", "format", "(", "\"categories\"", ",", "value", "...
Setter for **self.__categories** attribute. :param value: Attribute value. :type value: dict
[ "Setter", "for", "**", "self", ".", "__categories", "**", "attribute", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L835-L848
train
KelSolaar/Manager
manager/components_manager.py
Manager.register_component
def register_component(self, path): """ Registers a Component using given path. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.components {u'core.tests_component_a': <manager.co...
python
def register_component(self, path): """ Registers a Component using given path. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.components {u'core.tests_component_a': <manager.co...
[ "def", "register_component", "(", "self", ",", "path", ")", ":", "component", "=", "foundations", ".", "strings", ".", "get_splitext_basename", "(", "path", ")", "LOGGER", ".", "debug", "(", "\"> Current Component: '{0}'.\"", ".", "format", "(", "component", ")"...
Registers a Component using given path. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.components {u'core.tests_component_a': <manager.components_manager.Profile object at 0x11c9eb0>} ...
[ "Registers", "a", "Component", "using", "given", "path", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L977-L1011
train
KelSolaar/Manager
manager/components_manager.py
Manager.register_components
def register_components(self): """ Registers the Components. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager.components.keys() [u'core.test...
python
def register_components(self): """ Registers the Components. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager.components.keys() [u'core.test...
[ "def", "register_components", "(", "self", ")", ":", "unregistered_components", "=", "[", "]", "for", "path", "in", "self", ".", "paths", ":", "for", "file", "in", "foundations", ".", "walkers", ".", "files_walker", "(", "path", ",", "(", "\"\\.{0}$\"", "....
Registers the Components. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager.components.keys() [u'core.tests_component_a', u'core.tests_component_b'] ...
[ "Registers", "the", "Components", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L1042-L1069
train
KelSolaar/Manager
manager/components_manager.py
Manager.instantiate_component
def instantiate_component(self, component, callback=None): """ Instantiates given Component. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.instantiate_component("core.tests_component_a") ...
python
def instantiate_component(self, component, callback=None): """ Instantiates given Component. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.instantiate_component("core.tests_component_a") ...
[ "def", "instantiate_component", "(", "self", ",", "component", ",", "callback", "=", "None", ")", ":", "profile", "=", "self", ".", "__components", "[", "component", "]", "callback", "and", "callback", "(", "profile", ")", "LOGGER", ".", "debug", "(", "\">...
Instantiates given Component. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.instantiate_component("core.tests_component_a") True >>> manager.get_interface("core.tests_component_a")...
[ "Instantiates", "given", "Component", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L1098-L1145
train
KelSolaar/Manager
manager/components_manager.py
Manager.instantiate_components
def instantiate_components(self, callback=None): """ Instantiates the Components. Usage:: >>> manager = Manager((tests_manager,)) >>> manager.register_components() True >>> manager.instantiate_components() True >>> manager...
python
def instantiate_components(self, callback=None): """ Instantiates the Components. Usage:: >>> manager = Manager((tests_manager,)) >>> manager.register_components() True >>> manager.instantiate_components() True >>> manager...
[ "def", "instantiate_components", "(", "self", ",", "callback", "=", "None", ")", ":", "uninstantiated_components", "=", "[", "component", "for", "component", "in", "self", ".", "list_components", "(", ")", "if", "not", "self", ".", "instantiate_component", "(", ...
Instantiates the Components. Usage:: >>> manager = Manager((tests_manager,)) >>> manager.register_components() True >>> manager.instantiate_components() True >>> manager.get_interface("core.tests_component_a") <tests_component...
[ "Instantiates", "the", "Components", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L1147-L1173
train
KelSolaar/Manager
manager/components_manager.py
Manager.reload_component
def reload_component(self, component): """ Reload given Component module. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.instantiate_component("core.tests_component_a") True ...
python
def reload_component(self, component): """ Reload given Component module. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.instantiate_component("core.tests_component_a") True ...
[ "def", "reload_component", "(", "self", ",", "component", ")", ":", "dependents", "=", "list", "(", "reversed", "(", "self", ".", "list_dependents", "(", "component", ")", ")", ")", "dependents", ".", "append", "(", "component", ")", "for", "dependent", "i...
Reload given Component module. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.instantiate_component("core.tests_component_a") True >>> manager.get_interface("core.tests_component_a"...
[ "Reload", "given", "Component", "module", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L1175-L1215
train
KelSolaar/Manager
manager/components_manager.py
Manager.list_components
def list_components(self, dependency_order=True): """ Lists the Components by dependency resolving. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager.lis...
python
def list_components(self, dependency_order=True): """ Lists the Components by dependency resolving. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager.lis...
[ "def", "list_components", "(", "self", ",", "dependency_order", "=", "True", ")", ":", "if", "dependency_order", ":", "return", "list", "(", "itertools", ".", "chain", ".", "from_iterable", "(", "[", "sorted", "(", "list", "(", "batch", ")", ")", "for", ...
Lists the Components by dependency resolving. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager.list_components() [u'core.tests_component_a', u'core.tests_co...
[ "Lists", "the", "Components", "by", "dependency", "resolving", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L1217-L1238
train
KelSolaar/Manager
manager/components_manager.py
Manager.list_dependents
def list_dependents(self, component, dependents=None): """ Lists given Component dependents Components. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager...
python
def list_dependents(self, component, dependents=None): """ Lists given Component dependents Components. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager...
[ "def", "list_dependents", "(", "self", ",", "component", ",", "dependents", "=", "None", ")", ":", "dependents", "=", "set", "(", ")", "if", "dependents", "is", "None", "else", "dependents", "for", "name", ",", "profile", "in", "self", ":", "if", "not", ...
Lists given Component dependents Components. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager.list_dependents("core.tests_component_a") [u'core.tests_compon...
[ "Lists", "given", "Component", "dependents", "Components", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L1240-L1268
train
KelSolaar/Manager
manager/components_manager.py
Manager.filter_components
def filter_components(self, pattern, category=None): """ Filters the Components using given regex pattern. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> mana...
python
def filter_components(self, pattern, category=None): """ Filters the Components using given regex pattern. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> mana...
[ "def", "filter_components", "(", "self", ",", "pattern", ",", "category", "=", "None", ")", ":", "filtered_components", "=", "[", "]", "for", "component", ",", "profile", "in", "self", ":", "if", "category", ":", "if", "profile", ".", "category", "!=", "...
Filters the Components using given regex pattern. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager.filter_components("\w+A$") [u'core.tests_component_a'] ...
[ "Filters", "the", "Components", "using", "given", "regex", "pattern", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L1270-L1298
train
KelSolaar/Manager
manager/components_manager.py
Manager.get_profile
def get_profile(self, component): """ Gets given Component profile. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.get_profile("core.tests_component_a") <manager.components_mana...
python
def get_profile(self, component): """ Gets given Component profile. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.get_profile("core.tests_component_a") <manager.components_mana...
[ "def", "get_profile", "(", "self", ",", "component", ")", ":", "components", "=", "self", ".", "filter_components", "(", "r\"^{0}$\"", ".", "format", "(", "component", ")", ")", "if", "components", "!=", "[", "]", ":", "return", "self", ".", "__components"...
Gets given Component profile. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.get_profile("core.tests_component_a") <manager.components_manager.Profile object at 0x10258ef10> :param com...
[ "Gets", "given", "Component", "profile", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L1300-L1320
train
KelSolaar/Manager
manager/components_manager.py
Manager.get_interface
def get_interface(self, component): """ Gets given Component interface. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.get_interface("core.tests_component_a") <tests_component_a...
python
def get_interface(self, component): """ Gets given Component interface. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.get_interface("core.tests_component_a") <tests_component_a...
[ "def", "get_interface", "(", "self", ",", "component", ")", ":", "profile", "=", "self", ".", "get_profile", "(", "component", ")", "if", "profile", ":", "return", "profile", ".", "interface" ]
Gets given Component interface. Usage:: >>> manager = Manager() >>> manager.register_component("tests_component_a.rc") True >>> manager.get_interface("core.tests_component_a") <tests_component_a.TestsComponentA object at 0x17b0d70> :param co...
[ "Gets", "given", "Component", "interface", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L1322-L1342
train
KelSolaar/Manager
manager/components_manager.py
Manager.get_component_attribute_name
def get_component_attribute_name(component): """ Gets given Component attribute name. Usage:: >>> Manager.get_component_attribute_name("factory.components_manager_ui") u'factoryComponentsManagerUi' :param component: Component to get the attribute name. ...
python
def get_component_attribute_name(component): """ Gets given Component attribute name. Usage:: >>> Manager.get_component_attribute_name("factory.components_manager_ui") u'factoryComponentsManagerUi' :param component: Component to get the attribute name. ...
[ "def", "get_component_attribute_name", "(", "component", ")", ":", "search", "=", "re", ".", "search", "(", "r\"(?P<category>\\w+)\\.(?P<name>\\w+)\"", ",", "component", ")", "if", "search", ":", "name", "=", "\"{0}{1}{2}\"", ".", "format", "(", "search", ".", "...
Gets given Component attribute name. Usage:: >>> Manager.get_component_attribute_name("factory.components_manager_ui") u'factoryComponentsManagerUi' :param component: Component to get the attribute name. :type component: unicode :return: Component attribute nam...
[ "Gets", "given", "Component", "attribute", "name", "." ]
39c8153fc021fc8a76e345a6e336ec2644f089d1
https://github.com/KelSolaar/Manager/blob/39c8153fc021fc8a76e345a6e336ec2644f089d1/manager/components_manager.py#L1345-L1367
train
eng-tools/sfsimodels
sfsimodels/output.py
output_to_table
def output_to_table(obj, olist='inputs', oformat='latex', table_ends=False, prefix=""): """ Compile the properties to a table. :param olist: list, Names of the parameters to be in the output table :param oformat: str, The type of table to be output :param table_ends: bool, Add ends to the table ...
python
def output_to_table(obj, olist='inputs', oformat='latex', table_ends=False, prefix=""): """ Compile the properties to a table. :param olist: list, Names of the parameters to be in the output table :param oformat: str, The type of table to be output :param table_ends: bool, Add ends to the table ...
[ "def", "output_to_table", "(", "obj", ",", "olist", "=", "'inputs'", ",", "oformat", "=", "'latex'", ",", "table_ends", "=", "False", ",", "prefix", "=", "\"\"", ")", ":", "para", "=", "\"\"", "property_list", "=", "[", "]", "if", "olist", "==", "'inpu...
Compile the properties to a table. :param olist: list, Names of the parameters to be in the output table :param oformat: str, The type of table to be output :param table_ends: bool, Add ends to the table :param prefix: str, A string to be added to the start of each parameter name :return: para, str...
[ "Compile", "the", "properties", "to", "a", "table", "." ]
65a690ca440d61307f5a9b8478e4704f203a5925
https://github.com/eng-tools/sfsimodels/blob/65a690ca440d61307f5a9b8478e4704f203a5925/sfsimodels/output.py#L4-L33
train
eng-tools/sfsimodels
sfsimodels/output.py
format_value
def format_value(value, sf=3): """ convert a parameter value into a formatted string with certain significant figures :param value: the value to be formatted :param sf: number of significant figures :return: str """ if isinstance(value, str): return value elif isinstance(value,...
python
def format_value(value, sf=3): """ convert a parameter value into a formatted string with certain significant figures :param value: the value to be formatted :param sf: number of significant figures :return: str """ if isinstance(value, str): return value elif isinstance(value,...
[ "def", "format_value", "(", "value", ",", "sf", "=", "3", ")", ":", "if", "isinstance", "(", "value", ",", "str", ")", ":", "return", "value", "elif", "isinstance", "(", "value", ",", "list", ")", "or", "isinstance", "(", "value", ",", "np", ".", "...
convert a parameter value into a formatted string with certain significant figures :param value: the value to be formatted :param sf: number of significant figures :return: str
[ "convert", "a", "parameter", "value", "into", "a", "formatted", "string", "with", "certain", "significant", "figures" ]
65a690ca440d61307f5a9b8478e4704f203a5925
https://github.com/eng-tools/sfsimodels/blob/65a690ca440d61307f5a9b8478e4704f203a5925/sfsimodels/output.py#L47-L70
train
eng-tools/sfsimodels
sfsimodels/output.py
add_table_ends
def add_table_ends(para, oformat='latex', caption="caption-text", label="table"): """ Adds the latex table ends :param para: :param oformat: :param caption: :param label: :return: """ fpara = "" if oformat == 'latex': fpara += "\\begin{table}[H]\n" fpara += "\\ce...
python
def add_table_ends(para, oformat='latex', caption="caption-text", label="table"): """ Adds the latex table ends :param para: :param oformat: :param caption: :param label: :return: """ fpara = "" if oformat == 'latex': fpara += "\\begin{table}[H]\n" fpara += "\\ce...
[ "def", "add_table_ends", "(", "para", ",", "oformat", "=", "'latex'", ",", "caption", "=", "\"caption-text\"", ",", "label", "=", "\"table\"", ")", ":", "fpara", "=", "\"\"", "if", "oformat", "==", "'latex'", ":", "fpara", "+=", "\"\\\\begin{table}[H]\\n\"", ...
Adds the latex table ends :param para: :param oformat: :param caption: :param label: :return:
[ "Adds", "the", "latex", "table", "ends" ]
65a690ca440d61307f5a9b8478e4704f203a5925
https://github.com/eng-tools/sfsimodels/blob/65a690ca440d61307f5a9b8478e4704f203a5925/sfsimodels/output.py#L73-L96
train
sci-bots/svg-model
svg_model/draw.py
draw_shapes_svg_layer
def draw_shapes_svg_layer(df_shapes, shape_i_columns, layer_name, layer_number=1, use_svg_path=True): ''' Draw shapes as a layer in a SVG file. Args: df_shapes (pandas.DataFrame): Table of shape vertices (one row per vertex). shape_i_columns (str or li...
python
def draw_shapes_svg_layer(df_shapes, shape_i_columns, layer_name, layer_number=1, use_svg_path=True): ''' Draw shapes as a layer in a SVG file. Args: df_shapes (pandas.DataFrame): Table of shape vertices (one row per vertex). shape_i_columns (str or li...
[ "def", "draw_shapes_svg_layer", "(", "df_shapes", ",", "shape_i_columns", ",", "layer_name", ",", "layer_number", "=", "1", ",", "use_svg_path", "=", "True", ")", ":", "# Note that `svgwrite.Drawing` requires a filepath to be specified during", "# construction, *but* nothing is...
Draw shapes as a layer in a SVG file. Args: df_shapes (pandas.DataFrame): Table of shape vertices (one row per vertex). shape_i_columns (str or list) : Either a single column name as a string or a list of column names in ``df_shapes``. Rows in ``df_shapes`` wit...
[ "Draw", "shapes", "as", "a", "layer", "in", "a", "SVG", "file", "." ]
2d119650f995e62b29ce0b3151a23f3b957cb072
https://github.com/sci-bots/svg-model/blob/2d119650f995e62b29ce0b3151a23f3b957cb072/svg_model/draw.py#L13-L92
train
sci-bots/svg-model
svg_model/draw.py
draw_lines_svg_layer
def draw_lines_svg_layer(df_endpoints, layer_name, layer_number=1): ''' Draw lines defined by endpoint coordinates as a layer in a SVG file. Args: df_endpoints (pandas.DataFrame) : Each row corresponds to the endpoints of a single line, encoded through the columns: ``x_source``, ...
python
def draw_lines_svg_layer(df_endpoints, layer_name, layer_number=1): ''' Draw lines defined by endpoint coordinates as a layer in a SVG file. Args: df_endpoints (pandas.DataFrame) : Each row corresponds to the endpoints of a single line, encoded through the columns: ``x_source``, ...
[ "def", "draw_lines_svg_layer", "(", "df_endpoints", ",", "layer_name", ",", "layer_number", "=", "1", ")", ":", "# Note that `svgwrite.Drawing` requires a filepath to be specified during", "# construction, *but* nothing is actually written to the path unless one of", "# the `save*` metho...
Draw lines defined by endpoint coordinates as a layer in a SVG file. Args: df_endpoints (pandas.DataFrame) : Each row corresponds to the endpoints of a single line, encoded through the columns: ``x_source``, ``y_source``, ``x_target``, and ``y_target``. layer_name (str) : N...
[ "Draw", "lines", "defined", "by", "endpoint", "coordinates", "as", "a", "layer", "in", "a", "SVG", "file", "." ]
2d119650f995e62b29ce0b3151a23f3b957cb072
https://github.com/sci-bots/svg-model/blob/2d119650f995e62b29ce0b3151a23f3b957cb072/svg_model/draw.py#L95-L146
train
Capitains/Nautilus
capitains_nautilus/apis/dts.py
DTSApi.dts_error
def dts_error(self, error_name, message=None): """ Create a DTS Error reply :param error_name: Name of the error :param message: Message of the Error :return: DTS Error Response with information (JSON) """ self.nautilus_extension.logger.info("DTS error thrown {} for {} (...
python
def dts_error(self, error_name, message=None): """ Create a DTS Error reply :param error_name: Name of the error :param message: Message of the Error :return: DTS Error Response with information (JSON) """ self.nautilus_extension.logger.info("DTS error thrown {} for {} (...
[ "def", "dts_error", "(", "self", ",", "error_name", ",", "message", "=", "None", ")", ":", "self", ".", "nautilus_extension", ".", "logger", ".", "info", "(", "\"DTS error thrown {} for {} ({})\"", ".", "format", "(", "error_name", ",", "request", ".", "path",...
Create a DTS Error reply :param error_name: Name of the error :param message: Message of the Error :return: DTS Error Response with information (JSON)
[ "Create", "a", "DTS", "Error", "reply" ]
6be453fe0cc0e2c1b89ff06e5af1409165fc1411
https://github.com/Capitains/Nautilus/blob/6be453fe0cc0e2c1b89ff06e5af1409165fc1411/capitains_nautilus/apis/dts.py#L24-L39
train
Capitains/Nautilus
capitains_nautilus/apis/dts.py
DTSApi.r_dts_collection
def r_dts_collection(self, objectId=None): """ DTS Collection Metadata reply for given objectId :param objectId: Collection Identifier :return: JSON Format of DTS Collection """ try: j = self.resolver.getMetadata(objectId=objectId).export(Mimetypes.JSON.DTS.Std) ...
python
def r_dts_collection(self, objectId=None): """ DTS Collection Metadata reply for given objectId :param objectId: Collection Identifier :return: JSON Format of DTS Collection """ try: j = self.resolver.getMetadata(objectId=objectId).export(Mimetypes.JSON.DTS.Std) ...
[ "def", "r_dts_collection", "(", "self", ",", "objectId", "=", "None", ")", ":", "try", ":", "j", "=", "self", ".", "resolver", ".", "getMetadata", "(", "objectId", "=", "objectId", ")", ".", "export", "(", "Mimetypes", ".", "JSON", ".", "DTS", ".", "...
DTS Collection Metadata reply for given objectId :param objectId: Collection Identifier :return: JSON Format of DTS Collection
[ "DTS", "Collection", "Metadata", "reply", "for", "given", "objectId" ]
6be453fe0cc0e2c1b89ff06e5af1409165fc1411
https://github.com/Capitains/Nautilus/blob/6be453fe0cc0e2c1b89ff06e5af1409165fc1411/capitains_nautilus/apis/dts.py#L41-L53
train
PolyJIT/benchbuild
benchbuild/utils/db.py
create_run
def create_run(cmd, project, exp, grp): """ Create a new 'run' in the database. This creates a new transaction in the database and creates a new run in this transaction. Afterwards we return both the transaction as well as the run itself. The user is responsible for committing it when the time ...
python
def create_run(cmd, project, exp, grp): """ Create a new 'run' in the database. This creates a new transaction in the database and creates a new run in this transaction. Afterwards we return both the transaction as well as the run itself. The user is responsible for committing it when the time ...
[ "def", "create_run", "(", "cmd", ",", "project", ",", "exp", ",", "grp", ")", ":", "from", "benchbuild", ".", "utils", "import", "schema", "as", "s", "session", "=", "s", ".", "Session", "(", ")", "run", "=", "s", ".", "Run", "(", "command", "=", ...
Create a new 'run' in the database. This creates a new transaction in the database and creates a new run in this transaction. Afterwards we return both the transaction as well as the run itself. The user is responsible for committing it when the time comes. Args: cmd: The command that has ...
[ "Create", "a", "new", "run", "in", "the", "database", "." ]
9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58
https://github.com/PolyJIT/benchbuild/blob/9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58/benchbuild/utils/db.py#L23-L55
train
PolyJIT/benchbuild
benchbuild/utils/db.py
create_run_group
def create_run_group(prj): """ Create a new 'run_group' in the database. This creates a new transaction in the database and creates a new run_group within this transaction. Afterwards we return both the transaction as well as the run_group itself. The user is responsible for committing it when the ...
python
def create_run_group(prj): """ Create a new 'run_group' in the database. This creates a new transaction in the database and creates a new run_group within this transaction. Afterwards we return both the transaction as well as the run_group itself. The user is responsible for committing it when the ...
[ "def", "create_run_group", "(", "prj", ")", ":", "from", "benchbuild", ".", "utils", "import", "schema", "as", "s", "session", "=", "s", ".", "Session", "(", ")", "experiment", "=", "prj", ".", "experiment", "group", "=", "s", ".", "RunGroup", "(", "id...
Create a new 'run_group' in the database. This creates a new transaction in the database and creates a new run_group within this transaction. Afterwards we return both the transaction as well as the run_group itself. The user is responsible for committing it when the time comes. Args: prj ...
[ "Create", "a", "new", "run_group", "in", "the", "database", "." ]
9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58
https://github.com/PolyJIT/benchbuild/blob/9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58/benchbuild/utils/db.py#L58-L82
train
PolyJIT/benchbuild
benchbuild/utils/db.py
persist_project
def persist_project(project): """ Persist this project in the benchbuild database. Args: project: The project we want to persist. """ from benchbuild.utils.schema import Project, Session session = Session() projects = session.query(Project) \ .filter(Project.name == project....
python
def persist_project(project): """ Persist this project in the benchbuild database. Args: project: The project we want to persist. """ from benchbuild.utils.schema import Project, Session session = Session() projects = session.query(Project) \ .filter(Project.name == project....
[ "def", "persist_project", "(", "project", ")", ":", "from", "benchbuild", ".", "utils", ".", "schema", "import", "Project", ",", "Session", "session", "=", "Session", "(", ")", "projects", "=", "session", ".", "query", "(", "Project", ")", ".", "filter", ...
Persist this project in the benchbuild database. Args: project: The project we want to persist.
[ "Persist", "this", "project", "in", "the", "benchbuild", "database", "." ]
9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58
https://github.com/PolyJIT/benchbuild/blob/9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58/benchbuild/utils/db.py#L85-L130
train
PolyJIT/benchbuild
benchbuild/utils/db.py
persist_experiment
def persist_experiment(experiment): """ Persist this experiment in the benchbuild database. Args: experiment: The experiment we want to persist. """ from benchbuild.utils.schema import Experiment, Session session = Session() cfg_exp = experiment.id LOG.debug("Using experiment ...
python
def persist_experiment(experiment): """ Persist this experiment in the benchbuild database. Args: experiment: The experiment we want to persist. """ from benchbuild.utils.schema import Experiment, Session session = Session() cfg_exp = experiment.id LOG.debug("Using experiment ...
[ "def", "persist_experiment", "(", "experiment", ")", ":", "from", "benchbuild", ".", "utils", ".", "schema", "import", "Experiment", ",", "Session", "session", "=", "Session", "(", ")", "cfg_exp", "=", "experiment", ".", "id", "LOG", ".", "debug", "(", "\"...
Persist this experiment in the benchbuild database. Args: experiment: The experiment we want to persist.
[ "Persist", "this", "experiment", "in", "the", "benchbuild", "database", "." ]
9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58
https://github.com/PolyJIT/benchbuild/blob/9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58/benchbuild/utils/db.py#L133-L167
train
PolyJIT/benchbuild
benchbuild/utils/db.py
persist_time
def persist_time(run, session, timings): """ Persist the run results in the database. Args: run: The run we attach this timing results to. session: The db transaction we belong to. timings: The timing measurements we want to store. """ from benchbuild.utils import schema as ...
python
def persist_time(run, session, timings): """ Persist the run results in the database. Args: run: The run we attach this timing results to. session: The db transaction we belong to. timings: The timing measurements we want to store. """ from benchbuild.utils import schema as ...
[ "def", "persist_time", "(", "run", ",", "session", ",", "timings", ")", ":", "from", "benchbuild", ".", "utils", "import", "schema", "as", "s", "for", "timing", "in", "timings", ":", "session", ".", "add", "(", "s", ".", "Metric", "(", "name", "=", "...
Persist the run results in the database. Args: run: The run we attach this timing results to. session: The db transaction we belong to. timings: The timing measurements we want to store.
[ "Persist", "the", "run", "results", "in", "the", "database", "." ]
9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58
https://github.com/PolyJIT/benchbuild/blob/9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58/benchbuild/utils/db.py#L171-L188
train
PolyJIT/benchbuild
benchbuild/utils/db.py
persist_perf
def persist_perf(run, session, svg_path): """ Persist the flamegraph in the database. The flamegraph exists as a SVG image on disk until we persist it in the database. Args: run: The run we attach these perf measurements to. session: The db transaction we belong to. svg_pat...
python
def persist_perf(run, session, svg_path): """ Persist the flamegraph in the database. The flamegraph exists as a SVG image on disk until we persist it in the database. Args: run: The run we attach these perf measurements to. session: The db transaction we belong to. svg_pat...
[ "def", "persist_perf", "(", "run", ",", "session", ",", "svg_path", ")", ":", "from", "benchbuild", ".", "utils", "import", "schema", "as", "s", "with", "open", "(", "svg_path", ",", "'r'", ")", "as", "svg_file", ":", "svg_data", "=", "svg_file", ".", ...
Persist the flamegraph in the database. The flamegraph exists as a SVG image on disk until we persist it in the database. Args: run: The run we attach these perf measurements to. session: The db transaction we belong to. svg_path: The path to the SVG file we want to store.
[ "Persist", "the", "flamegraph", "in", "the", "database", "." ]
9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58
https://github.com/PolyJIT/benchbuild/blob/9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58/benchbuild/utils/db.py#L191-L208
train
PolyJIT/benchbuild
benchbuild/utils/db.py
persist_compilestats
def persist_compilestats(run, session, stats): """ Persist the run results in the database. Args: run: The run we attach the compilestats to. session: The db transaction we belong to. stats: The stats we want to store in the database. """ for stat in stats: stat.run_...
python
def persist_compilestats(run, session, stats): """ Persist the run results in the database. Args: run: The run we attach the compilestats to. session: The db transaction we belong to. stats: The stats we want to store in the database. """ for stat in stats: stat.run_...
[ "def", "persist_compilestats", "(", "run", ",", "session", ",", "stats", ")", ":", "for", "stat", "in", "stats", ":", "stat", ".", "run_id", "=", "run", ".", "id", "session", ".", "add", "(", "stat", ")" ]
Persist the run results in the database. Args: run: The run we attach the compilestats to. session: The db transaction we belong to. stats: The stats we want to store in the database.
[ "Persist", "the", "run", "results", "in", "the", "database", "." ]
9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58
https://github.com/PolyJIT/benchbuild/blob/9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58/benchbuild/utils/db.py#L211-L222
train
PolyJIT/benchbuild
benchbuild/utils/db.py
persist_config
def persist_config(run, session, cfg): """ Persist the configuration in as key-value pairs. Args: run: The run we attach the config to. session: The db transaction we belong to. cfg: The configuration we want to persist. """ from benchbuild.utils import schema as s for ...
python
def persist_config(run, session, cfg): """ Persist the configuration in as key-value pairs. Args: run: The run we attach the config to. session: The db transaction we belong to. cfg: The configuration we want to persist. """ from benchbuild.utils import schema as s for ...
[ "def", "persist_config", "(", "run", ",", "session", ",", "cfg", ")", ":", "from", "benchbuild", ".", "utils", "import", "schema", "as", "s", "for", "cfg_elem", "in", "cfg", ":", "session", ".", "add", "(", "s", ".", "Config", "(", "name", "=", "cfg_...
Persist the configuration in as key-value pairs. Args: run: The run we attach the config to. session: The db transaction we belong to. cfg: The configuration we want to persist.
[ "Persist", "the", "configuration", "in", "as", "key", "-", "value", "pairs", "." ]
9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58
https://github.com/PolyJIT/benchbuild/blob/9ad2ec54d96e97b642b1f06eddcbad9ba7aeaf58/benchbuild/utils/db.py#L225-L238
train
BlueBrain/hpcbench
hpcbench/benchmark/ior.py
IORMetricsExtractor.parse_results_header
def parse_results_header(cls, header): """Extract columns from the line under "Summary of all tests:" :param header: content of the results header line :return: list of string providing columns """ header = IORMetricsExtractor.RE_MULTIPLE_SPACES.sub(' ', header) header =...
python
def parse_results_header(cls, header): """Extract columns from the line under "Summary of all tests:" :param header: content of the results header line :return: list of string providing columns """ header = IORMetricsExtractor.RE_MULTIPLE_SPACES.sub(' ', header) header =...
[ "def", "parse_results_header", "(", "cls", ",", "header", ")", ":", "header", "=", "IORMetricsExtractor", ".", "RE_MULTIPLE_SPACES", ".", "sub", "(", "' '", ",", "header", ")", "header", "=", "header", ".", "split", "(", "' '", ")", "return", "header" ]
Extract columns from the line under "Summary of all tests:" :param header: content of the results header line :return: list of string providing columns
[ "Extract", "columns", "from", "the", "line", "under", "Summary", "of", "all", "tests", ":" ]
192d0ec142b897157ec25f131d1ef28f84752592
https://github.com/BlueBrain/hpcbench/blob/192d0ec142b897157ec25f131d1ef28f84752592/hpcbench/benchmark/ior.py#L115-L123
train
BlueBrain/hpcbench
hpcbench/benchmark/ior.py
IORMetricsExtractor.parse_result_line
def parse_result_line(cls, columns, line, metrics): """Extract metrics from a result line :param columns: list of columns specified under line "Summary of all tests:" :param line: string of results below the columns line :param metrics: output dict where metrics are written ...
python
def parse_result_line(cls, columns, line, metrics): """Extract metrics from a result line :param columns: list of columns specified under line "Summary of all tests:" :param line: string of results below the columns line :param metrics: output dict where metrics are written ...
[ "def", "parse_result_line", "(", "cls", ",", "columns", ",", "line", ",", "metrics", ")", ":", "line", "=", "IORMetricsExtractor", ".", "RE_MULTIPLE_SPACES", ".", "sub", "(", "' '", ",", "line", ")", "line", "=", "line", ".", "split", "(", "' '", ")", ...
Extract metrics from a result line :param columns: list of columns specified under line "Summary of all tests:" :param line: string of results below the columns line :param metrics: output dict where metrics are written
[ "Extract", "metrics", "from", "a", "result", "line", ":", "param", "columns", ":", "list", "of", "columns", "specified", "under", "line", "Summary", "of", "all", "tests", ":", ":", "param", "line", ":", "string", "of", "results", "below", "the", "columns",...
192d0ec142b897157ec25f131d1ef28f84752592
https://github.com/BlueBrain/hpcbench/blob/192d0ec142b897157ec25f131d1ef28f84752592/hpcbench/benchmark/ior.py#L126-L146
train
BlueBrain/hpcbench
hpcbench/benchmark/ior.py
IOR.apis
def apis(self): """List of API to test""" value = self.attributes['apis'] if isinstance(value, six.string_types): value = shlex.split(value) return value
python
def apis(self): """List of API to test""" value = self.attributes['apis'] if isinstance(value, six.string_types): value = shlex.split(value) return value
[ "def", "apis", "(", "self", ")", ":", "value", "=", "self", ".", "attributes", "[", "'apis'", "]", "if", "isinstance", "(", "value", ",", "six", ".", "string_types", ")", ":", "value", "=", "shlex", ".", "split", "(", "value", ")", "return", "value" ...
List of API to test
[ "List", "of", "API", "to", "test" ]
192d0ec142b897157ec25f131d1ef28f84752592
https://github.com/BlueBrain/hpcbench/blob/192d0ec142b897157ec25f131d1ef28f84752592/hpcbench/benchmark/ior.py#L220-L225
train
BlueBrain/hpcbench
hpcbench/benchmark/ior.py
IOR.pre_execute
def pre_execute(self, execution, context): """Make sure the named directory is created if possible""" path = self._fspath if path: path = path.format( benchmark=context.benchmark, api=execution['category'], **execution.get('metas', {}) ...
python
def pre_execute(self, execution, context): """Make sure the named directory is created if possible""" path = self._fspath if path: path = path.format( benchmark=context.benchmark, api=execution['category'], **execution.get('metas', {}) ...
[ "def", "pre_execute", "(", "self", ",", "execution", ",", "context", ")", ":", "path", "=", "self", ".", "_fspath", "if", "path", ":", "path", "=", "path", ".", "format", "(", "benchmark", "=", "context", ".", "benchmark", ",", "api", "=", "execution",...
Make sure the named directory is created if possible
[ "Make", "sure", "the", "named", "directory", "is", "created", "if", "possible" ]
192d0ec142b897157ec25f131d1ef28f84752592
https://github.com/BlueBrain/hpcbench/blob/192d0ec142b897157ec25f131d1ef28f84752592/hpcbench/benchmark/ior.py#L227-L241
train
BlueBrain/hpcbench
hpcbench/benchmark/ior.py
IOR.sizes
def sizes(self): """Provides block_size and transfer_size through a list of dict, for instance: [{'transfer': '1M 4M', 'block': '8M'}] """ if self.attributes.get('sizes'): for settings in self.attributes.get('sizes'): for pair in itertools.product( ...
python
def sizes(self): """Provides block_size and transfer_size through a list of dict, for instance: [{'transfer': '1M 4M', 'block': '8M'}] """ if self.attributes.get('sizes'): for settings in self.attributes.get('sizes'): for pair in itertools.product( ...
[ "def", "sizes", "(", "self", ")", ":", "if", "self", ".", "attributes", ".", "get", "(", "'sizes'", ")", ":", "for", "settings", "in", "self", ".", "attributes", ".", "get", "(", "'sizes'", ")", ":", "for", "pair", "in", "itertools", ".", "product", ...
Provides block_size and transfer_size through a list of dict, for instance: [{'transfer': '1M 4M', 'block': '8M'}]
[ "Provides", "block_size", "and", "transfer_size", "through", "a", "list", "of", "dict", "for", "instance", ":", "[", "{", "transfer", ":", "1M", "4M", "block", ":", "8M", "}", "]" ]
192d0ec142b897157ec25f131d1ef28f84752592
https://github.com/BlueBrain/hpcbench/blob/192d0ec142b897157ec25f131d1ef28f84752592/hpcbench/benchmark/ior.py#L244-L256
train
BlueBrain/hpcbench
hpcbench/benchmark/ior.py
IOR.options
def options(self): """Additional options appended to the ior command type: either string or a list of string """ options = self.attributes['options'] if isinstance(options, six.string_types): options = shlex.split(options) options = [str(e) for e in options] ...
python
def options(self): """Additional options appended to the ior command type: either string or a list of string """ options = self.attributes['options'] if isinstance(options, six.string_types): options = shlex.split(options) options = [str(e) for e in options] ...
[ "def", "options", "(", "self", ")", ":", "options", "=", "self", ".", "attributes", "[", "'options'", "]", "if", "isinstance", "(", "options", ",", "six", ".", "string_types", ")", ":", "options", "=", "shlex", ".", "split", "(", "options", ")", "optio...
Additional options appended to the ior command type: either string or a list of string
[ "Additional", "options", "appended", "to", "the", "ior", "command", "type", ":", "either", "string", "or", "a", "list", "of", "string" ]
192d0ec142b897157ec25f131d1ef28f84752592
https://github.com/BlueBrain/hpcbench/blob/192d0ec142b897157ec25f131d1ef28f84752592/hpcbench/benchmark/ior.py#L302-L310
train
BlueBrain/hpcbench
hpcbench/benchmark/ior.py
IOR.file_mode
def file_mode(self): """onefile, fpp, or both""" fms = self.attributes['file_mode'] eax = set() if isinstance(fms, six.string_types): fms = shlex.split(fms) for fm in fms: if fm == 'both': eax.add('fpp') eax.add('onefile') ...
python
def file_mode(self): """onefile, fpp, or both""" fms = self.attributes['file_mode'] eax = set() if isinstance(fms, six.string_types): fms = shlex.split(fms) for fm in fms: if fm == 'both': eax.add('fpp') eax.add('onefile') ...
[ "def", "file_mode", "(", "self", ")", ":", "fms", "=", "self", ".", "attributes", "[", "'file_mode'", "]", "eax", "=", "set", "(", ")", "if", "isinstance", "(", "fms", ",", "six", ".", "string_types", ")", ":", "fms", "=", "shlex", ".", "split", "(...
onefile, fpp, or both
[ "onefile", "fpp", "or", "both" ]
192d0ec142b897157ec25f131d1ef28f84752592
https://github.com/BlueBrain/hpcbench/blob/192d0ec142b897157ec25f131d1ef28f84752592/hpcbench/benchmark/ior.py#L313-L327
train
BlueBrain/hpcbench
hpcbench/benchmark/ior.py
IOR.block_size
def block_size(self): """Contiguous bytes to write per task (e.g.: 8, 4k, 2m, 1g) """ bs = self.attributes['block_size'] if isinstance(bs, six.string_types): bs = shlex.split(bs) bs = [str(e) for e in bs] return bs
python
def block_size(self): """Contiguous bytes to write per task (e.g.: 8, 4k, 2m, 1g) """ bs = self.attributes['block_size'] if isinstance(bs, six.string_types): bs = shlex.split(bs) bs = [str(e) for e in bs] return bs
[ "def", "block_size", "(", "self", ")", ":", "bs", "=", "self", ".", "attributes", "[", "'block_size'", "]", "if", "isinstance", "(", "bs", ",", "six", ".", "string_types", ")", ":", "bs", "=", "shlex", ".", "split", "(", "bs", ")", "bs", "=", "[", ...
Contiguous bytes to write per task (e.g.: 8, 4k, 2m, 1g)
[ "Contiguous", "bytes", "to", "write", "per", "task", "(", "e", ".", "g", ".", ":", "8", "4k", "2m", "1g", ")" ]
192d0ec142b897157ec25f131d1ef28f84752592
https://github.com/BlueBrain/hpcbench/blob/192d0ec142b897157ec25f131d1ef28f84752592/hpcbench/benchmark/ior.py#L330-L337
train
BlueBrain/hpcbench
hpcbench/benchmark/ior.py
IOR.transfer_size
def transfer_size(self): """Size of transfer in bytes (e.g.: 8, 4k, 2m, 1g)""" ts = self.attributes['transfer_size'] if isinstance(ts, six.string_types): ts = shlex.split(ts) ts = [str(e) for e in ts] return ts
python
def transfer_size(self): """Size of transfer in bytes (e.g.: 8, 4k, 2m, 1g)""" ts = self.attributes['transfer_size'] if isinstance(ts, six.string_types): ts = shlex.split(ts) ts = [str(e) for e in ts] return ts
[ "def", "transfer_size", "(", "self", ")", ":", "ts", "=", "self", ".", "attributes", "[", "'transfer_size'", "]", "if", "isinstance", "(", "ts", ",", "six", ".", "string_types", ")", ":", "ts", "=", "shlex", ".", "split", "(", "ts", ")", "ts", "=", ...
Size of transfer in bytes (e.g.: 8, 4k, 2m, 1g)
[ "Size", "of", "transfer", "in", "bytes", "(", "e", ".", "g", ".", ":", "8", "4k", "2m", "1g", ")" ]
192d0ec142b897157ec25f131d1ef28f84752592
https://github.com/BlueBrain/hpcbench/blob/192d0ec142b897157ec25f131d1ef28f84752592/hpcbench/benchmark/ior.py#L340-L346
train
OzymandiasTheGreat/python-libinput
libinput/constant.py
EventType.is_device
def is_device(self): """Macro to check if this event is a :class:`~libinput.event.DeviceNotifyEvent`. """ if self in {type(self).DEVICE_ADDED, type(self).DEVICE_REMOVED}: return True else: return False
python
def is_device(self): """Macro to check if this event is a :class:`~libinput.event.DeviceNotifyEvent`. """ if self in {type(self).DEVICE_ADDED, type(self).DEVICE_REMOVED}: return True else: return False
[ "def", "is_device", "(", "self", ")", ":", "if", "self", "in", "{", "type", "(", "self", ")", ".", "DEVICE_ADDED", ",", "type", "(", "self", ")", ".", "DEVICE_REMOVED", "}", ":", "return", "True", "else", ":", "return", "False" ]
Macro to check if this event is a :class:`~libinput.event.DeviceNotifyEvent`.
[ "Macro", "to", "check", "if", "this", "event", "is", "a", ":", "class", ":", "~libinput", ".", "event", ".", "DeviceNotifyEvent", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/constant.py#L70-L78
train
OzymandiasTheGreat/python-libinput
libinput/constant.py
EventType.is_pointer
def is_pointer(self): """Macro to check if this event is a :class:`~libinput.event.PointerEvent`. """ if self in {type(self).POINTER_MOTION, type(self).POINTER_BUTTON, type(self).POINTER_MOTION_ABSOLUTE, type(self).POINTER_AXIS}: return True else: return False
python
def is_pointer(self): """Macro to check if this event is a :class:`~libinput.event.PointerEvent`. """ if self in {type(self).POINTER_MOTION, type(self).POINTER_BUTTON, type(self).POINTER_MOTION_ABSOLUTE, type(self).POINTER_AXIS}: return True else: return False
[ "def", "is_pointer", "(", "self", ")", ":", "if", "self", "in", "{", "type", "(", "self", ")", ".", "POINTER_MOTION", ",", "type", "(", "self", ")", ".", "POINTER_BUTTON", ",", "type", "(", "self", ")", ".", "POINTER_MOTION_ABSOLUTE", ",", "type", "(",...
Macro to check if this event is a :class:`~libinput.event.PointerEvent`.
[ "Macro", "to", "check", "if", "this", "event", "is", "a", ":", "class", ":", "~libinput", ".", "event", ".", "PointerEvent", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/constant.py#L90-L99
train
OzymandiasTheGreat/python-libinput
libinput/constant.py
EventType.is_touch
def is_touch(self): """Macro to check if this event is a :class:`~libinput.event.TouchEvent`. """ if self in {type(self).TOUCH_DOWN, type(self).TOUCH_UP, type(self).TOUCH_MOTION, type(self).TOUCH_CANCEL, type(self).TOUCH_FRAME}: return True else: return False
python
def is_touch(self): """Macro to check if this event is a :class:`~libinput.event.TouchEvent`. """ if self in {type(self).TOUCH_DOWN, type(self).TOUCH_UP, type(self).TOUCH_MOTION, type(self).TOUCH_CANCEL, type(self).TOUCH_FRAME}: return True else: return False
[ "def", "is_touch", "(", "self", ")", ":", "if", "self", "in", "{", "type", "(", "self", ")", ".", "TOUCH_DOWN", ",", "type", "(", "self", ")", ".", "TOUCH_UP", ",", "type", "(", "self", ")", ".", "TOUCH_MOTION", ",", "type", "(", "self", ")", "."...
Macro to check if this event is a :class:`~libinput.event.TouchEvent`.
[ "Macro", "to", "check", "if", "this", "event", "is", "a", ":", "class", ":", "~libinput", ".", "event", ".", "TouchEvent", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/constant.py#L101-L111
train
OzymandiasTheGreat/python-libinput
libinput/constant.py
EventType.is_tablet_tool
def is_tablet_tool(self): """Macro to check if this event is a :class:`~libinput.event.TabletToolEvent`. """ if self in {type(self).TABLET_TOOL_AXIS, type(self).TABLET_TOOL_BUTTON, type(self).TABLET_TOOL_PROXIMITY, type(self).TABLET_TOOL_TIP}: return True else: return False
python
def is_tablet_tool(self): """Macro to check if this event is a :class:`~libinput.event.TabletToolEvent`. """ if self in {type(self).TABLET_TOOL_AXIS, type(self).TABLET_TOOL_BUTTON, type(self).TABLET_TOOL_PROXIMITY, type(self).TABLET_TOOL_TIP}: return True else: return False
[ "def", "is_tablet_tool", "(", "self", ")", ":", "if", "self", "in", "{", "type", "(", "self", ")", ".", "TABLET_TOOL_AXIS", ",", "type", "(", "self", ")", ".", "TABLET_TOOL_BUTTON", ",", "type", "(", "self", ")", ".", "TABLET_TOOL_PROXIMITY", ",", "type"...
Macro to check if this event is a :class:`~libinput.event.TabletToolEvent`.
[ "Macro", "to", "check", "if", "this", "event", "is", "a", ":", "class", ":", "~libinput", ".", "event", ".", "TabletToolEvent", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/constant.py#L113-L122
train
OzymandiasTheGreat/python-libinput
libinput/constant.py
EventType.is_tablet_pad
def is_tablet_pad(self): """Macro to check if this event is a :class:`~libinput.event.TabletPadEvent`. """ if self in {type(self).TABLET_PAD_BUTTON, type(self).TABLET_PAD_RING, type(self).TABLET_PAD_STRIP}: return True else: return False
python
def is_tablet_pad(self): """Macro to check if this event is a :class:`~libinput.event.TabletPadEvent`. """ if self in {type(self).TABLET_PAD_BUTTON, type(self).TABLET_PAD_RING, type(self).TABLET_PAD_STRIP}: return True else: return False
[ "def", "is_tablet_pad", "(", "self", ")", ":", "if", "self", "in", "{", "type", "(", "self", ")", ".", "TABLET_PAD_BUTTON", ",", "type", "(", "self", ")", ".", "TABLET_PAD_RING", ",", "type", "(", "self", ")", ".", "TABLET_PAD_STRIP", "}", ":", "return...
Macro to check if this event is a :class:`~libinput.event.TabletPadEvent`.
[ "Macro", "to", "check", "if", "this", "event", "is", "a", ":", "class", ":", "~libinput", ".", "event", ".", "TabletPadEvent", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/constant.py#L124-L133
train
OzymandiasTheGreat/python-libinput
libinput/constant.py
EventType.is_gesture
def is_gesture(self): """Macro to check if this event is a :class:`~libinput.event.GestureEvent`. """ if self in {type(self).GESTURE_SWIPE_BEGIN, type(self).GESTURE_SWIPE_END, type(self).GESTURE_SWIPE_UPDATE, type(self).GESTURE_PINCH_BEGIN, type(self).GESTURE_PINCH_UPDATE, type(self).GESTURE_PINCH_END}: ...
python
def is_gesture(self): """Macro to check if this event is a :class:`~libinput.event.GestureEvent`. """ if self in {type(self).GESTURE_SWIPE_BEGIN, type(self).GESTURE_SWIPE_END, type(self).GESTURE_SWIPE_UPDATE, type(self).GESTURE_PINCH_BEGIN, type(self).GESTURE_PINCH_UPDATE, type(self).GESTURE_PINCH_END}: ...
[ "def", "is_gesture", "(", "self", ")", ":", "if", "self", "in", "{", "type", "(", "self", ")", ".", "GESTURE_SWIPE_BEGIN", ",", "type", "(", "self", ")", ".", "GESTURE_SWIPE_END", ",", "type", "(", "self", ")", ".", "GESTURE_SWIPE_UPDATE", ",", "type", ...
Macro to check if this event is a :class:`~libinput.event.GestureEvent`.
[ "Macro", "to", "check", "if", "this", "event", "is", "a", ":", "class", ":", "~libinput", ".", "event", ".", "GestureEvent", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/constant.py#L135-L145
train
OzymandiasTheGreat/python-libinput
libinput/event.py
Event.device
def device(self): """The device associated with this event. For device added/removed events this is the device added or removed. For all other device events, this is the device that generated the event. Returns: ~libinput.define.Device: Device object. """ hdevice = self._libinput.libinput_event_get_...
python
def device(self): """The device associated with this event. For device added/removed events this is the device added or removed. For all other device events, this is the device that generated the event. Returns: ~libinput.define.Device: Device object. """ hdevice = self._libinput.libinput_event_get_...
[ "def", "device", "(", "self", ")", ":", "hdevice", "=", "self", ".", "_libinput", ".", "libinput_event_get_device", "(", "self", ".", "_hevent", ")", "return", "Device", "(", "hdevice", ",", "self", ".", "_libinput", ")" ]
The device associated with this event. For device added/removed events this is the device added or removed. For all other device events, this is the device that generated the event. Returns: ~libinput.define.Device: Device object.
[ "The", "device", "associated", "with", "this", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L53-L65
train
OzymandiasTheGreat/python-libinput
libinput/event.py
PointerEvent.delta
def delta(self): """The delta between the last event and the current event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_MOTION`, this property raises :exc:`AttributeError`. If a device employs pointer acceleration, the delta returned by this method is the accelerate...
python
def delta(self): """The delta between the last event and the current event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_MOTION`, this property raises :exc:`AttributeError`. If a device employs pointer acceleration, the delta returned by this method is the accelerate...
[ "def", "delta", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "POINTER_MOTION", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "delta_x", "=", "self", ".", "_libinput", ...
The delta between the last event and the current event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_MOTION`, this property raises :exc:`AttributeError`. If a device employs pointer acceleration, the delta returned by this method is the accelerated delta. Relative m...
[ "The", "delta", "between", "the", "last", "event", "and", "the", "current", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L156-L180
train
OzymandiasTheGreat/python-libinput
libinput/event.py
PointerEvent.delta_unaccelerated
def delta_unaccelerated(self): """The relative delta of the unaccelerated motion vector of the current event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_MOTION`, this property raises :exc:`AttributeError`. Relative unaccelerated motion deltas are raw device coordin...
python
def delta_unaccelerated(self): """The relative delta of the unaccelerated motion vector of the current event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_MOTION`, this property raises :exc:`AttributeError`. Relative unaccelerated motion deltas are raw device coordin...
[ "def", "delta_unaccelerated", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "POINTER_MOTION", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "delta_x", "=", "self", ".", ...
The relative delta of the unaccelerated motion vector of the current event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_MOTION`, this property raises :exc:`AttributeError`. Relative unaccelerated motion deltas are raw device coordinates. Note that these coordinates ...
[ "The", "relative", "delta", "of", "the", "unaccelerated", "motion", "vector", "of", "the", "current", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L183-L213
train
OzymandiasTheGreat/python-libinput
libinput/event.py
PointerEvent.absolute_coords
def absolute_coords(self): """The current absolute coordinates of the pointer event, in mm from the top left corner of the device. To get the corresponding output screen coordinate, use :meth:`transform_absolute_coords`. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_M...
python
def absolute_coords(self): """The current absolute coordinates of the pointer event, in mm from the top left corner of the device. To get the corresponding output screen coordinate, use :meth:`transform_absolute_coords`. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_M...
[ "def", "absolute_coords", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "POINTER_MOTION_ABSOLUTE", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "abs_x", "=", "self", ".",...
The current absolute coordinates of the pointer event, in mm from the top left corner of the device. To get the corresponding output screen coordinate, use :meth:`transform_absolute_coords`. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_MOTION_ABSOLUTE`, this property...
[ "The", "current", "absolute", "coordinates", "of", "the", "pointer", "event", "in", "mm", "from", "the", "top", "left", "corner", "of", "the", "device", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L216-L239
train
OzymandiasTheGreat/python-libinput
libinput/event.py
PointerEvent.transform_absolute_coords
def transform_absolute_coords(self, width, height): """Return the current absolute coordinates of the pointer event, transformed to screen coordinates. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_MOTION_ABSOLUTE`, this method raises :exc:`AttributeError`. Args: w...
python
def transform_absolute_coords(self, width, height): """Return the current absolute coordinates of the pointer event, transformed to screen coordinates. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_MOTION_ABSOLUTE`, this method raises :exc:`AttributeError`. Args: w...
[ "def", "transform_absolute_coords", "(", "self", ",", "width", ",", "height", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "POINTER_MOTION_ABSOLUTE", ":", "raise", "AttributeError", "(", "_wrong_meth", ".", "format", "(", "self", ".", "type", ...
Return the current absolute coordinates of the pointer event, transformed to screen coordinates. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_MOTION_ABSOLUTE`, this method raises :exc:`AttributeError`. Args: width (int): The current output screen width. height (i...
[ "Return", "the", "current", "absolute", "coordinates", "of", "the", "pointer", "event", "transformed", "to", "screen", "coordinates", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L241-L267
train
OzymandiasTheGreat/python-libinput
libinput/event.py
PointerEvent.button
def button(self): """The button that triggered this event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_BUTTON`, this property raises :exc:`AttributeError`. Returns: int: The button triggering this event. Raises: AttributeError """ if self.type != EventTyp...
python
def button(self): """The button that triggered this event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_BUTTON`, this property raises :exc:`AttributeError`. Returns: int: The button triggering this event. Raises: AttributeError """ if self.type != EventTyp...
[ "def", "button", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "POINTER_BUTTON", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput", ".", ...
The button that triggered this event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_BUTTON`, this property raises :exc:`AttributeError`. Returns: int: The button triggering this event. Raises: AttributeError
[ "The", "button", "that", "triggered", "this", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L270-L285
train
OzymandiasTheGreat/python-libinput
libinput/event.py
PointerEvent.button_state
def button_state(self): """The button state that triggered this event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_BUTTON`, this property raises :exc:`AttributeError`. Returns: ~libinput.constant.ButtonState: The button state triggering this event. Raises: ...
python
def button_state(self): """The button state that triggered this event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_BUTTON`, this property raises :exc:`AttributeError`. Returns: ~libinput.constant.ButtonState: The button state triggering this event. Raises: ...
[ "def", "button_state", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "POINTER_BUTTON", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput", ...
The button state that triggered this event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_BUTTON`, this property raises :exc:`AttributeError`. Returns: ~libinput.constant.ButtonState: The button state triggering this event. Raises: AttributeError
[ "The", "button", "state", "that", "triggered", "this", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L288-L305
train
OzymandiasTheGreat/python-libinput
libinput/event.py
PointerEvent.seat_button_count
def seat_button_count(self): """The total number of buttons pressed on all devices on the associated seat after the event was triggered. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_BUTTON`, this property raises :exc:`AssertionError`. Returns: int: The seat wide p...
python
def seat_button_count(self): """The total number of buttons pressed on all devices on the associated seat after the event was triggered. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_BUTTON`, this property raises :exc:`AssertionError`. Returns: int: The seat wide p...
[ "def", "seat_button_count", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "POINTER_BUTTON", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput...
The total number of buttons pressed on all devices on the associated seat after the event was triggered. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_BUTTON`, this property raises :exc:`AssertionError`. Returns: int: The seat wide pressed button count for the key of...
[ "The", "total", "number", "of", "buttons", "pressed", "on", "all", "devices", "on", "the", "associated", "seat", "after", "the", "event", "was", "triggered", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L308-L325
train
OzymandiasTheGreat/python-libinput
libinput/event.py
PointerEvent.has_axis
def has_axis(self, axis): """Check if the event has a valid value for the given axis. If this method returns True for an axis and :meth:`get_axis_value` returns a value of 0, the event is a scroll stop event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_AXIS`, this met...
python
def has_axis(self, axis): """Check if the event has a valid value for the given axis. If this method returns True for an axis and :meth:`get_axis_value` returns a value of 0, the event is a scroll stop event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_AXIS`, this met...
[ "def", "has_axis", "(", "self", ",", "axis", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "POINTER_AXIS", ":", "raise", "AttributeError", "(", "_wrong_meth", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_li...
Check if the event has a valid value for the given axis. If this method returns True for an axis and :meth:`get_axis_value` returns a value of 0, the event is a scroll stop event. For pointer events that are not of type :attr:`~libinput.constant.EventType.POINTER_AXIS`, this method raises :exc:`AttributeErr...
[ "Check", "if", "the", "event", "has", "a", "valid", "value", "for", "the", "given", "axis", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L327-L348
train
OzymandiasTheGreat/python-libinput
libinput/event.py
PointerEvent.get_axis_value
def get_axis_value(self, axis): """Return the axis value of the given axis. The interpretation of the value depends on the axis. For the two scrolling axes :attr:`~libinput.constant.PointerAxis.SCROLL_VERTICAL` and :attr:`~libinput.constant.PointerAxis.SCROLL_HORIZONTAL`, the value of the event is in relativ...
python
def get_axis_value(self, axis): """Return the axis value of the given axis. The interpretation of the value depends on the axis. For the two scrolling axes :attr:`~libinput.constant.PointerAxis.SCROLL_VERTICAL` and :attr:`~libinput.constant.PointerAxis.SCROLL_HORIZONTAL`, the value of the event is in relativ...
[ "def", "get_axis_value", "(", "self", ",", "axis", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "POINTER_AXIS", ":", "raise", "AttributeError", "(", "_wrong_meth", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", ...
Return the axis value of the given axis. The interpretation of the value depends on the axis. For the two scrolling axes :attr:`~libinput.constant.PointerAxis.SCROLL_VERTICAL` and :attr:`~libinput.constant.PointerAxis.SCROLL_HORIZONTAL`, the value of the event is in relative scroll units, with the positive dir...
[ "Return", "the", "axis", "value", "of", "the", "given", "axis", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L350-L378
train
OzymandiasTheGreat/python-libinput
libinput/event.py
PointerEvent.axis_source
def axis_source(self): """The source for a given axis event. Axis events (scroll events) can be caused by a hardware item such as a scroll wheel or emulated from other input sources, such as two-finger or edge scrolling on a touchpad. If the source is :attr:`~libinput.constant.PointerAxisSource.FINGER`, l...
python
def axis_source(self): """The source for a given axis event. Axis events (scroll events) can be caused by a hardware item such as a scroll wheel or emulated from other input sources, such as two-finger or edge scrolling on a touchpad. If the source is :attr:`~libinput.constant.PointerAxisSource.FINGER`, l...
[ "def", "axis_source", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "POINTER_AXIS", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput", "."...
The source for a given axis event. Axis events (scroll events) can be caused by a hardware item such as a scroll wheel or emulated from other input sources, such as two-finger or edge scrolling on a touchpad. If the source is :attr:`~libinput.constant.PointerAxisSource.FINGER`, libinput guarantees that a sc...
[ "The", "source", "for", "a", "given", "axis", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L381-L429
train
OzymandiasTheGreat/python-libinput
libinput/event.py
PointerEvent.get_axis_value_discrete
def get_axis_value_discrete(self, axis): """Return the axis value in discrete steps for a given axis event. How a value translates into a discrete step depends on the source. If the source is :attr:`~libinput.constant.PointerAxisSource.WHEEL`, the discrete value correspond to the number of physical mouse wheel...
python
def get_axis_value_discrete(self, axis): """Return the axis value in discrete steps for a given axis event. How a value translates into a discrete step depends on the source. If the source is :attr:`~libinput.constant.PointerAxisSource.WHEEL`, the discrete value correspond to the number of physical mouse wheel...
[ "def", "get_axis_value_discrete", "(", "self", ",", "axis", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "POINTER_AXIS", ":", "raise", "AttributeError", "(", "_wrong_meth", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self"...
Return the axis value in discrete steps for a given axis event. How a value translates into a discrete step depends on the source. If the source is :attr:`~libinput.constant.PointerAxisSource.WHEEL`, the discrete value correspond to the number of physical mouse wheel clicks. If the source is :attr:`~libinpu...
[ "Return", "the", "axis", "value", "in", "discrete", "steps", "for", "a", "given", "axis", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L431-L454
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TouchEvent.slot
def slot(self): """The slot of this touch event. See the kernel's multitouch protocol B documentation for more information. If the touch event has no assigned slot, for example if it is from a single touch device, this property returns -1. For events not of type :attr:`~libinput.constant.EventType.TOUCH_...
python
def slot(self): """The slot of this touch event. See the kernel's multitouch protocol B documentation for more information. If the touch event has no assigned slot, for example if it is from a single touch device, this property returns -1. For events not of type :attr:`~libinput.constant.EventType.TOUCH_...
[ "def", "slot", "(", "self", ")", ":", "if", "self", ".", "type", "==", "EventType", ".", "TOUCH_FRAME", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput", ".", "lib...
The slot of this touch event. See the kernel's multitouch protocol B documentation for more information. If the touch event has no assigned slot, for example if it is from a single touch device, this property returns -1. For events not of type :attr:`~libinput.constant.EventType.TOUCH_DOWN`, :attr:`~libi...
[ "The", "slot", "of", "this", "touch", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L574-L597
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TouchEvent.seat_slot
def seat_slot(self): """The seat slot of the touch event. A seat slot is a non-negative seat wide unique identifier of an active touch point. Events from single touch devices will be represented as one individual touch point per device. For events not of type :attr:`~libinput.constant.EventType.TOUCH_DOW...
python
def seat_slot(self): """The seat slot of the touch event. A seat slot is a non-negative seat wide unique identifier of an active touch point. Events from single touch devices will be represented as one individual touch point per device. For events not of type :attr:`~libinput.constant.EventType.TOUCH_DOW...
[ "def", "seat_slot", "(", "self", ")", ":", "if", "self", ".", "type", "==", "EventType", ".", "TOUCH_FRAME", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput", ".", ...
The seat slot of the touch event. A seat slot is a non-negative seat wide unique identifier of an active touch point. Events from single touch devices will be represented as one individual touch point per device. For events not of type :attr:`~libinput.constant.EventType.TOUCH_DOWN`, :attr:`~libinput.con...
[ "The", "seat", "slot", "of", "the", "touch", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L600-L623
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TouchEvent.coords
def coords(self): """The current absolute coordinates of the touch event, in mm from the top left corner of the device. To get the corresponding output screen coordinates, use :meth:`transform_coords`. For events not of type :attr:`~libinput.constant.EventType.TOUCH_DOWN`, :attr:`~libinput.constant.EventT...
python
def coords(self): """The current absolute coordinates of the touch event, in mm from the top left corner of the device. To get the corresponding output screen coordinates, use :meth:`transform_coords`. For events not of type :attr:`~libinput.constant.EventType.TOUCH_DOWN`, :attr:`~libinput.constant.EventT...
[ "def", "coords", "(", "self", ")", ":", "if", "self", ".", "type", "not", "in", "{", "EventType", ".", "TOUCH_DOWN", ",", "EventType", ".", "TOUCH_MOTION", "}", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ...
The current absolute coordinates of the touch event, in mm from the top left corner of the device. To get the corresponding output screen coordinates, use :meth:`transform_coords`. For events not of type :attr:`~libinput.constant.EventType.TOUCH_DOWN`, :attr:`~libinput.constant.EventType.TOUCH_MOTION`, this...
[ "The", "current", "absolute", "coordinates", "of", "the", "touch", "event", "in", "mm", "from", "the", "top", "left", "corner", "of", "the", "device", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L626-L647
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TouchEvent.transform_coords
def transform_coords(self, width, height): """Return the current absolute coordinates of the touch event, transformed to screen coordinates. For events not of type :attr:`~libinput.constant.EventType.TOUCH_DOWN`, :attr:`~libinput.constant.EventType.TOUCH_MOTION`, this method raises :exc:`AttributeError`. ...
python
def transform_coords(self, width, height): """Return the current absolute coordinates of the touch event, transformed to screen coordinates. For events not of type :attr:`~libinput.constant.EventType.TOUCH_DOWN`, :attr:`~libinput.constant.EventType.TOUCH_MOTION`, this method raises :exc:`AttributeError`. ...
[ "def", "transform_coords", "(", "self", ",", "width", ",", "height", ")", ":", "if", "self", ".", "type", "not", "in", "{", "EventType", ".", "TOUCH_DOWN", ",", "EventType", ".", "TOUCH_MOTION", "}", ":", "raise", "AttributeError", "(", "_wrong_meth", ".",...
Return the current absolute coordinates of the touch event, transformed to screen coordinates. For events not of type :attr:`~libinput.constant.EventType.TOUCH_DOWN`, :attr:`~libinput.constant.EventType.TOUCH_MOTION`, this method raises :exc:`AttributeError`. Args: width (int): The current output screen ...
[ "Return", "the", "current", "absolute", "coordinates", "of", "the", "touch", "event", "transformed", "to", "screen", "coordinates", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L649-L671
train
OzymandiasTheGreat/python-libinput
libinput/event.py
GestureEvent.cancelled
def cancelled(self): """Return if the gesture ended normally, or if it was cancelled. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_SWIPE_END` or :attr:`~libinput.constant.EventType.GESTURE_PINCH_END`, this property raises :exc:`AttributeError`. Returns: bool: :obj...
python
def cancelled(self): """Return if the gesture ended normally, or if it was cancelled. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_SWIPE_END` or :attr:`~libinput.constant.EventType.GESTURE_PINCH_END`, this property raises :exc:`AttributeError`. Returns: bool: :obj...
[ "def", "cancelled", "(", "self", ")", ":", "if", "self", ".", "type", "not", "in", "{", "EventType", ".", "GESTURE_SWIPE_END", ",", "EventType", ".", "GESTURE_PINCH_END", "}", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ...
Return if the gesture ended normally, or if it was cancelled. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_SWIPE_END` or :attr:`~libinput.constant.EventType.GESTURE_PINCH_END`, this property raises :exc:`AttributeError`. Returns: bool: :obj:`True` indicating that th...
[ "Return", "if", "the", "gesture", "ended", "normally", "or", "if", "it", "was", "cancelled", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L752-L769
train
OzymandiasTheGreat/python-libinput
libinput/event.py
GestureEvent.delta
def delta(self): """The delta between the last event and the current event. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_SWIPE_UPDATE` or :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE`, this property raises :exc:`AttributeError`. If a device employs pointe...
python
def delta(self): """The delta between the last event and the current event. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_SWIPE_UPDATE` or :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE`, this property raises :exc:`AttributeError`. If a device employs pointe...
[ "def", "delta", "(", "self", ")", ":", "if", "self", ".", "type", "not", "in", "{", "EventType", ".", "GESTURE_SWIPE_UPDATE", ",", "EventType", ".", "GESTURE_PINCH_UPDATE", "}", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ...
The delta between the last event and the current event. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_SWIPE_UPDATE` or :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE`, this property raises :exc:`AttributeError`. If a device employs pointer acceleration, the de...
[ "The", "delta", "between", "the", "last", "event", "and", "the", "current", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L772-L796
train
OzymandiasTheGreat/python-libinput
libinput/event.py
GestureEvent.delta_unaccelerated
def delta_unaccelerated(self): """The relative delta of the unaccelerated motion vector of the current event. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_SWIPE_UPDATE` or :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE`, this property raises :exc:`AttributeE...
python
def delta_unaccelerated(self): """The relative delta of the unaccelerated motion vector of the current event. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_SWIPE_UPDATE` or :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE`, this property raises :exc:`AttributeE...
[ "def", "delta_unaccelerated", "(", "self", ")", ":", "if", "self", ".", "type", "not", "in", "{", "EventType", ".", "GESTURE_SWIPE_UPDATE", ",", "EventType", ".", "GESTURE_PINCH_UPDATE", "}", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "...
The relative delta of the unaccelerated motion vector of the current event. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_SWIPE_UPDATE` or :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE`, this property raises :exc:`AttributeError`. Relative unaccelerated mot...
[ "The", "relative", "delta", "of", "the", "unaccelerated", "motion", "vector", "of", "the", "current", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L799-L829
train
OzymandiasTheGreat/python-libinput
libinput/event.py
GestureEvent.scale
def scale(self): """The absolute scale of a pinch gesture, the scale is the division of the current distance between the fingers and the distance at the start of the gesture. The scale begins at 1.0, and if e.g. the fingers moved together by 50% then the scale will become 0.5, if they move twice as far apart...
python
def scale(self): """The absolute scale of a pinch gesture, the scale is the division of the current distance between the fingers and the distance at the start of the gesture. The scale begins at 1.0, and if e.g. the fingers moved together by 50% then the scale will become 0.5, if they move twice as far apart...
[ "def", "scale", "(", "self", ")", ":", "if", "self", ".", "type", "not", "in", "{", "EventType", ".", "GESTURE_PINCH_BEGIN", ",", "EventType", ".", "GESTURE_PINCH_UPDATE", ",", "EventType", ".", "GESTURE_PINCH_END", "}", ":", "raise", "AttributeError", "(", ...
The absolute scale of a pinch gesture, the scale is the division of the current distance between the fingers and the distance at the start of the gesture. The scale begins at 1.0, and if e.g. the fingers moved together by 50% then the scale will become 0.5, if they move twice as far apart as initially the sc...
[ "The", "absolute", "scale", "of", "a", "pinch", "gesture", "the", "scale", "is", "the", "division", "of", "the", "current", "distance", "between", "the", "fingers", "and", "the", "distance", "at", "the", "start", "of", "the", "gesture", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L832-L862
train
OzymandiasTheGreat/python-libinput
libinput/event.py
GestureEvent.angle_delta
def angle_delta(self): """The angle delta in degrees between the last and the current :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE` event. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE`, this property raises :exc:`AttributeError`. The angle de...
python
def angle_delta(self): """The angle delta in degrees between the last and the current :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE` event. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE`, this property raises :exc:`AttributeError`. The angle de...
[ "def", "angle_delta", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "GESTURE_PINCH_UPDATE", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput...
The angle delta in degrees between the last and the current :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE` event. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE`, this property raises :exc:`AttributeError`. The angle delta is defined as the change...
[ "The", "angle", "delta", "in", "degrees", "between", "the", "last", "and", "the", "current", ":", "attr", ":", "~libinput", ".", "constant", ".", "EventType", ".", "GESTURE_PINCH_UPDATE", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L865-L893
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.coords
def coords(self): """The (X, Y) coordinates of the tablet tool, in mm from the top left corner of the tablet in its current logical orientation and whether they have changed in this event. Use :meth:`transform_coords` for transforming the axes values into a different coordinate space. Note: On some dev...
python
def coords(self): """The (X, Y) coordinates of the tablet tool, in mm from the top left corner of the tablet in its current logical orientation and whether they have changed in this event. Use :meth:`transform_coords` for transforming the axes values into a different coordinate space. Note: On some dev...
[ "def", "coords", "(", "self", ")", ":", "x_changed", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_x_has_changed", "(", "self", ".", "_handle", ")", "y_changed", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_y_has_changed", "(", ...
The (X, Y) coordinates of the tablet tool, in mm from the top left corner of the tablet in its current logical orientation and whether they have changed in this event. Use :meth:`transform_coords` for transforming the axes values into a different coordinate space. Note: On some devices, returned value ma...
[ "The", "(", "X", "Y", ")", "coordinates", "of", "the", "tablet", "tool", "in", "mm", "from", "the", "top", "left", "corner", "of", "the", "tablet", "in", "its", "current", "logical", "orientation", "and", "whether", "they", "have", "changed", "in", "this...
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1040-L1063
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.delta
def delta(self): """The delta between the last event and the current event. If the tool employs pointer acceleration, the delta contained in this property is the accelerated delta. This value is in screen coordinate space, the delta is to be interpreted like the value of :attr:`.PointerEvent.delta`. See `...
python
def delta(self): """The delta between the last event and the current event. If the tool employs pointer acceleration, the delta contained in this property is the accelerated delta. This value is in screen coordinate space, the delta is to be interpreted like the value of :attr:`.PointerEvent.delta`. See `...
[ "def", "delta", "(", "self", ")", ":", "delta_x", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_get_dx", "(", "self", ".", "_handle", ")", "delta_y", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_get_dy", "(", "self", ".", "...
The delta between the last event and the current event. If the tool employs pointer acceleration, the delta contained in this property is the accelerated delta. This value is in screen coordinate space, the delta is to be interpreted like the value of :attr:`.PointerEvent.delta`. See `Relative motion for ta...
[ "The", "delta", "between", "the", "last", "event", "and", "the", "current", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1066-L1082
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.pressure
def pressure(self): """The current pressure being applied on the tool in use, normalized to the range [0, 1] and whether it has changed in this event. If this axis does not exist on the current tool, this property is (0, :obj:`False`). Returns: (float, bool): The current value of the the axis and whether...
python
def pressure(self): """The current pressure being applied on the tool in use, normalized to the range [0, 1] and whether it has changed in this event. If this axis does not exist on the current tool, this property is (0, :obj:`False`). Returns: (float, bool): The current value of the the axis and whether...
[ "def", "pressure", "(", "self", ")", ":", "pressure", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_get_pressure", "(", "self", ".", "_handle", ")", "changed", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_pressure_has_changed", "...
The current pressure being applied on the tool in use, normalized to the range [0, 1] and whether it has changed in this event. If this axis does not exist on the current tool, this property is (0, :obj:`False`). Returns: (float, bool): The current value of the the axis and whether it has changed.
[ "The", "current", "pressure", "being", "applied", "on", "the", "tool", "in", "use", "normalized", "to", "the", "range", "[", "0", "1", "]", "and", "whether", "it", "has", "changed", "in", "this", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1085-L1101
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.distance
def distance(self): """The current distance from the tablet's sensor, normalized to the range [0, 1] and whether it has changed in this event. If this axis does not exist on the current tool, this property is (0, :obj:`False`). Returns: (float, bool): The current value of the the axis. """ distance ...
python
def distance(self): """The current distance from the tablet's sensor, normalized to the range [0, 1] and whether it has changed in this event. If this axis does not exist on the current tool, this property is (0, :obj:`False`). Returns: (float, bool): The current value of the the axis. """ distance ...
[ "def", "distance", "(", "self", ")", ":", "distance", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_get_distance", "(", "self", ".", "_handle", ")", "changed", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_distance_has_changed", "...
The current distance from the tablet's sensor, normalized to the range [0, 1] and whether it has changed in this event. If this axis does not exist on the current tool, this property is (0, :obj:`False`). Returns: (float, bool): The current value of the the axis.
[ "The", "current", "distance", "from", "the", "tablet", "s", "sensor", "normalized", "to", "the", "range", "[", "0", "1", "]", "and", "whether", "it", "has", "changed", "in", "this", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1104-L1119
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.tilt_axes
def tilt_axes(self): """The current tilt along the (X, Y) axes of the tablet's current logical orientation, in degrees off the tablet's Z axis and whether they have changed in this event. That is, if the tool is perfectly orthogonal to the tablet, the tilt angle is 0. When the top tilts towards the logical t...
python
def tilt_axes(self): """The current tilt along the (X, Y) axes of the tablet's current logical orientation, in degrees off the tablet's Z axis and whether they have changed in this event. That is, if the tool is perfectly orthogonal to the tablet, the tilt angle is 0. When the top tilts towards the logical t...
[ "def", "tilt_axes", "(", "self", ")", ":", "tilt_x", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_get_tilt_x", "(", "self", ".", "_handle", ")", "tilt_y", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_get_tilt_y", "(", "self", ...
The current tilt along the (X, Y) axes of the tablet's current logical orientation, in degrees off the tablet's Z axis and whether they have changed in this event. That is, if the tool is perfectly orthogonal to the tablet, the tilt angle is 0. When the top tilts towards the logical top/left of the tablet, t...
[ "The", "current", "tilt", "along", "the", "(", "X", "Y", ")", "axes", "of", "the", "tablet", "s", "current", "logical", "orientation", "in", "degrees", "off", "the", "tablet", "s", "Z", "axis", "and", "whether", "they", "have", "changed", "in", "this", ...
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1122-L1149
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.rotation
def rotation(self): """The current Z rotation of the tool in degrees, clockwise from the tool's logical neutral position and whether it has changed in this event. For tools of type :attr:`~libinput.constant.TabletToolType.MOUSE` and :attr:`~libinput.constant.TabletToolType.LENS` the logical neutral positio...
python
def rotation(self): """The current Z rotation of the tool in degrees, clockwise from the tool's logical neutral position and whether it has changed in this event. For tools of type :attr:`~libinput.constant.TabletToolType.MOUSE` and :attr:`~libinput.constant.TabletToolType.LENS` the logical neutral positio...
[ "def", "rotation", "(", "self", ")", ":", "rotation", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_get_rotation", "(", "self", ".", "_handle", ")", "changed", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_rotation_has_changed", "...
The current Z rotation of the tool in degrees, clockwise from the tool's logical neutral position and whether it has changed in this event. For tools of type :attr:`~libinput.constant.TabletToolType.MOUSE` and :attr:`~libinput.constant.TabletToolType.LENS` the logical neutral position is pointing to the curr...
[ "The", "current", "Z", "rotation", "of", "the", "tool", "in", "degrees", "clockwise", "from", "the", "tool", "s", "logical", "neutral", "position", "and", "whether", "it", "has", "changed", "in", "this", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1152-L1176
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.slider_position
def slider_position(self): """The current position of the slider on the tool, normalized to the range [-1, 1] and whether it has changed in this event. The logical zero is the neutral position of the slider, or the logical center of the axis. This axis is available on e.g. the Wacom Airbrush. If this ax...
python
def slider_position(self): """The current position of the slider on the tool, normalized to the range [-1, 1] and whether it has changed in this event. The logical zero is the neutral position of the slider, or the logical center of the axis. This axis is available on e.g. the Wacom Airbrush. If this ax...
[ "def", "slider_position", "(", "self", ")", ":", "position", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_get_slider_position", "(", "self", ".", "_handle", ")", "changed", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_slider_has_c...
The current position of the slider on the tool, normalized to the range [-1, 1] and whether it has changed in this event. The logical zero is the neutral position of the slider, or the logical center of the axis. This axis is available on e.g. the Wacom Airbrush. If this axis does not exist on the current...
[ "The", "current", "position", "of", "the", "slider", "on", "the", "tool", "normalized", "to", "the", "range", "[", "-", "1", "1", "]", "and", "whether", "it", "has", "changed", "in", "this", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1179-L1199
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.wheel_delta
def wheel_delta(self): """The delta for the wheel in degrees and whether it has changed in this event. Returns: (float, bool): The delta of the wheel, in degrees, compared to the last event and whether it has changed. """ delta = self._libinput.libinput_event_tablet_tool_get_wheel_delta( self._hand...
python
def wheel_delta(self): """The delta for the wheel in degrees and whether it has changed in this event. Returns: (float, bool): The delta of the wheel, in degrees, compared to the last event and whether it has changed. """ delta = self._libinput.libinput_event_tablet_tool_get_wheel_delta( self._hand...
[ "def", "wheel_delta", "(", "self", ")", ":", "delta", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_get_wheel_delta", "(", "self", ".", "_handle", ")", "changed", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_wheel_has_changed", "...
The delta for the wheel in degrees and whether it has changed in this event. Returns: (float, bool): The delta of the wheel, in degrees, compared to the last event and whether it has changed.
[ "The", "delta", "for", "the", "wheel", "in", "degrees", "and", "whether", "it", "has", "changed", "in", "this", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1202-L1215
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.wheel_delta_discrete
def wheel_delta_discrete(self): """The delta for the wheel in discrete steps (e.g. wheel clicks) and whether it has changed in this event. Returns: (int, bool): The delta of the wheel, in discrete steps, compared to the last event and whether it has changed. """ delta = self._libinput. \ libinput_...
python
def wheel_delta_discrete(self): """The delta for the wheel in discrete steps (e.g. wheel clicks) and whether it has changed in this event. Returns: (int, bool): The delta of the wheel, in discrete steps, compared to the last event and whether it has changed. """ delta = self._libinput. \ libinput_...
[ "def", "wheel_delta_discrete", "(", "self", ")", ":", "delta", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_get_wheel_delta_discrete", "(", "self", ".", "_handle", ")", "changed", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_wheel...
The delta for the wheel in discrete steps (e.g. wheel clicks) and whether it has changed in this event. Returns: (int, bool): The delta of the wheel, in discrete steps, compared to the last event and whether it has changed.
[ "The", "delta", "for", "the", "wheel", "in", "discrete", "steps", "(", "e", ".", "g", ".", "wheel", "clicks", ")", "and", "whether", "it", "has", "changed", "in", "this", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1218-L1231
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.transform_coords
def transform_coords(self, width, height): """Return the current absolute (x, y) coordinates of the tablet tool event, transformed to screen coordinates and whether they have changed in this event. Note: On some devices, returned value may be negative or larger than the width of the device. See `Out-of-b...
python
def transform_coords(self, width, height): """Return the current absolute (x, y) coordinates of the tablet tool event, transformed to screen coordinates and whether they have changed in this event. Note: On some devices, returned value may be negative or larger than the width of the device. See `Out-of-b...
[ "def", "transform_coords", "(", "self", ",", "width", ",", "height", ")", ":", "x", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_get_x_transformed", "(", "self", ".", "_handle", ",", "width", ")", "y", "=", "self", ".", "_libinput", ".", ...
Return the current absolute (x, y) coordinates of the tablet tool event, transformed to screen coordinates and whether they have changed in this event. Note: On some devices, returned value may be negative or larger than the width of the device. See `Out-of-bounds motion events`_ for more details. Arg...
[ "Return", "the", "current", "absolute", "(", "x", "y", ")", "coordinates", "of", "the", "tablet", "tool", "event", "transformed", "to", "screen", "coordinates", "and", "whether", "they", "have", "changed", "in", "this", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1233-L1258
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.tool
def tool(self): """The tool that was in use during this event. If the caller keeps a reference to a tool, the tool object will compare equal to the previously obtained tool object. Note: Physical tool tracking requires hardware support. If unavailable, libinput creates one tool per type per tablet. See ...
python
def tool(self): """The tool that was in use during this event. If the caller keeps a reference to a tool, the tool object will compare equal to the previously obtained tool object. Note: Physical tool tracking requires hardware support. If unavailable, libinput creates one tool per type per tablet. See ...
[ "def", "tool", "(", "self", ")", ":", "htablettool", "=", "self", ".", "_libinput", ".", "libinput_event_tablet_tool_get_tool", "(", "self", ".", "_handle", ")", "return", "TabletTool", "(", "htablettool", ",", "self", ".", "_libinput", ")" ]
The tool that was in use during this event. If the caller keeps a reference to a tool, the tool object will compare equal to the previously obtained tool object. Note: Physical tool tracking requires hardware support. If unavailable, libinput creates one tool per type per tablet. See `Tracking unique t...
[ "The", "tool", "that", "was", "in", "use", "during", "this", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1261-L1277
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.button
def button(self): """The button that triggered this event. For events that are not of type :attr:`~libinput.constant.EventType.TABLET_TOOL_BUTTON`, this property raises :exc:`AttributeError`. Returns: int: The button triggering this event. """ if self.type != EventType.TABLET_TOOL_BUTTON: raise A...
python
def button(self): """The button that triggered this event. For events that are not of type :attr:`~libinput.constant.EventType.TABLET_TOOL_BUTTON`, this property raises :exc:`AttributeError`. Returns: int: The button triggering this event. """ if self.type != EventType.TABLET_TOOL_BUTTON: raise A...
[ "def", "button", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "TABLET_TOOL_BUTTON", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput", "....
The button that triggered this event. For events that are not of type :attr:`~libinput.constant.EventType.TABLET_TOOL_BUTTON`, this property raises :exc:`AttributeError`. Returns: int: The button triggering this event.
[ "The", "button", "that", "triggered", "this", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1315-L1329
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.button_state
def button_state(self): """The button state of the event. For events that are not of type :attr:`~libinput.constant.EventType.TABLET_TOOL_BUTTON`, this property raises :exc:`AttributeError`. Returns: ~libinput.constant.ButtonState: The button state triggering this event. """ if self.type != Event...
python
def button_state(self): """The button state of the event. For events that are not of type :attr:`~libinput.constant.EventType.TABLET_TOOL_BUTTON`, this property raises :exc:`AttributeError`. Returns: ~libinput.constant.ButtonState: The button state triggering this event. """ if self.type != Event...
[ "def", "button_state", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "TABLET_TOOL_BUTTON", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput"...
The button state of the event. For events that are not of type :attr:`~libinput.constant.EventType.TABLET_TOOL_BUTTON`, this property raises :exc:`AttributeError`. Returns: ~libinput.constant.ButtonState: The button state triggering this event.
[ "The", "button", "state", "of", "the", "event", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1332-L1347
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletToolEvent.seat_button_count
def seat_button_count(self): """The total number of buttons pressed on all devices on the associated seat after the the event was triggered. For events that are not of type :attr:`~libinput.constant.EventType.TABLET_TOOL_BUTTON`, this property raises :exc:`AttributeError`. Returns: int: The seat wide p...
python
def seat_button_count(self): """The total number of buttons pressed on all devices on the associated seat after the the event was triggered. For events that are not of type :attr:`~libinput.constant.EventType.TABLET_TOOL_BUTTON`, this property raises :exc:`AttributeError`. Returns: int: The seat wide p...
[ "def", "seat_button_count", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "TABLET_TOOL_BUTTON", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libi...
The total number of buttons pressed on all devices on the associated seat after the the event was triggered. For events that are not of type :attr:`~libinput.constant.EventType.TABLET_TOOL_BUTTON`, this property raises :exc:`AttributeError`. Returns: int: The seat wide pressed button count for the key of...
[ "The", "total", "number", "of", "buttons", "pressed", "on", "all", "devices", "on", "the", "associated", "seat", "after", "the", "the", "event", "was", "triggered", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1350-L1365
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletPadEvent.ring_position
def ring_position(self): """The current position of the ring, in degrees counterclockwise from the northern-most point of the ring in the tablet's current logical orientation. If the source is :attr:`~libinput.constant.TabletPadRingAxisSource.FINGER`, libinput sends a terminating event with a ring value of...
python
def ring_position(self): """The current position of the ring, in degrees counterclockwise from the northern-most point of the ring in the tablet's current logical orientation. If the source is :attr:`~libinput.constant.TabletPadRingAxisSource.FINGER`, libinput sends a terminating event with a ring value of...
[ "def", "ring_position", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "TABLET_PAD_RING", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput", ...
The current position of the ring, in degrees counterclockwise from the northern-most point of the ring in the tablet's current logical orientation. If the source is :attr:`~libinput.constant.TabletPadRingAxisSource.FINGER`, libinput sends a terminating event with a ring value of -1 when the finger is lifte...
[ "The", "current", "position", "of", "the", "ring", "in", "degrees", "counterclockwise", "from", "the", "northern", "-", "most", "point", "of", "the", "ring", "in", "the", "tablet", "s", "current", "logical", "orientation", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1445-L1470
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletPadEvent.ring_number
def ring_number(self): """The number of the ring that has changed state, with 0 being the first ring. On tablets with only one ring, this method always returns 0. For events not of type :attr:`~libinput.constant.EventType.TABLET_PAD_RING`, this property raises :exc:`AssertionError`. Returns: int: Th...
python
def ring_number(self): """The number of the ring that has changed state, with 0 being the first ring. On tablets with only one ring, this method always returns 0. For events not of type :attr:`~libinput.constant.EventType.TABLET_PAD_RING`, this property raises :exc:`AssertionError`. Returns: int: Th...
[ "def", "ring_number", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "TABLET_PAD_RING", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput", ...
The number of the ring that has changed state, with 0 being the first ring. On tablets with only one ring, this method always returns 0. For events not of type :attr:`~libinput.constant.EventType.TABLET_PAD_RING`, this property raises :exc:`AssertionError`. Returns: int: The index of the ring that cha...
[ "The", "number", "of", "the", "ring", "that", "has", "changed", "state", "with", "0", "being", "the", "first", "ring", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1473-L1492
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletPadEvent.ring_source
def ring_source(self): """The source of the interaction with the ring. If the source is :attr:`~libinput.constant.TabletPadRingAxisSource.FINGER`, libinput sends a ring position value of -1 to terminate the current interaction. For events not of type :attr:`~libinput.constant.EventType.TABLET_PAD_RING`,...
python
def ring_source(self): """The source of the interaction with the ring. If the source is :attr:`~libinput.constant.TabletPadRingAxisSource.FINGER`, libinput sends a ring position value of -1 to terminate the current interaction. For events not of type :attr:`~libinput.constant.EventType.TABLET_PAD_RING`,...
[ "def", "ring_source", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "TABLET_PAD_RING", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput", ...
The source of the interaction with the ring. If the source is :attr:`~libinput.constant.TabletPadRingAxisSource.FINGER`, libinput sends a ring position value of -1 to terminate the current interaction. For events not of type :attr:`~libinput.constant.EventType.TABLET_PAD_RING`, this property raises :exc...
[ "The", "source", "of", "the", "interaction", "with", "the", "ring", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1495-L1517
train
OzymandiasTheGreat/python-libinput
libinput/event.py
TabletPadEvent.strip_position
def strip_position(self): """The current position of the strip, normalized to the range [0, 1], with 0 being the top/left-most point in the tablet's current logical orientation. If the source is :attr:`~libinput.constant.TabletPadStripAxisSource.FINGER`, libinput sends a terminating event with a value of -...
python
def strip_position(self): """The current position of the strip, normalized to the range [0, 1], with 0 being the top/left-most point in the tablet's current logical orientation. If the source is :attr:`~libinput.constant.TabletPadStripAxisSource.FINGER`, libinput sends a terminating event with a value of -...
[ "def", "strip_position", "(", "self", ")", ":", "if", "self", ".", "type", "!=", "EventType", ".", "TABLET_PAD_STRIP", ":", "raise", "AttributeError", "(", "_wrong_prop", ".", "format", "(", "self", ".", "type", ")", ")", "return", "self", ".", "_libinput"...
The current position of the strip, normalized to the range [0, 1], with 0 being the top/left-most point in the tablet's current logical orientation. If the source is :attr:`~libinput.constant.TabletPadStripAxisSource.FINGER`, libinput sends a terminating event with a value of -1 when the finger is lifted f...
[ "The", "current", "position", "of", "the", "strip", "normalized", "to", "the", "range", "[", "0", "1", "]", "with", "0", "being", "the", "top", "/", "left", "-", "most", "point", "in", "the", "tablet", "s", "current", "logical", "orientation", "." ]
1f477ee9f1d56b284b20e0317ea8967c64ef1218
https://github.com/OzymandiasTheGreat/python-libinput/blob/1f477ee9f1d56b284b20e0317ea8967c64ef1218/libinput/event.py#L1520-L1545
train