id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
231,500
neo4j/neo4j-python-driver
neo4j/types/spatial.py
dehydrate_point
def dehydrate_point(value): """ Dehydrator for Point data. :param value: :type value: Point :return: """ dim = len(value) if dim == 2: return Structure(b"X", value.srid, *value) elif dim == 3: return Structure(b"Y", value.srid, *value) else: raise ValueError(...
python
def dehydrate_point(value): """ Dehydrator for Point data. :param value: :type value: Point :return: """ dim = len(value) if dim == 2: return Structure(b"X", value.srid, *value) elif dim == 3: return Structure(b"Y", value.srid, *value) else: raise ValueError(...
[ "def", "dehydrate_point", "(", "value", ")", ":", "dim", "=", "len", "(", "value", ")", "if", "dim", "==", "2", ":", "return", "Structure", "(", "b\"X\"", ",", "value", ".", "srid", ",", "*", "value", ")", "elif", "dim", "==", "3", ":", "return", ...
Dehydrator for Point data. :param value: :type value: Point :return:
[ "Dehydrator", "for", "Point", "data", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/spatial.py#L122-L135
231,501
neo4j/neo4j-python-driver
neo4j/types/__init__.py
PackStreamDehydrator.dehydrate
def dehydrate(self, values): """ Convert native values into PackStream values. """ def dehydrate_(obj): try: f = self.dehydration_functions[type(obj)] except KeyError: pass else: return f(obj) if obj...
python
def dehydrate(self, values): """ Convert native values into PackStream values. """ def dehydrate_(obj): try: f = self.dehydration_functions[type(obj)] except KeyError: pass else: return f(obj) if obj...
[ "def", "dehydrate", "(", "self", ",", "values", ")", ":", "def", "dehydrate_", "(", "obj", ")", ":", "try", ":", "f", "=", "self", ".", "dehydration_functions", "[", "type", "(", "obj", ")", "]", "except", "KeyError", ":", "pass", "else", ":", "retur...
Convert native values into PackStream values.
[ "Convert", "native", "values", "into", "PackStream", "values", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/__init__.py#L97-L134
231,502
neo4j/neo4j-python-driver
neo4j/types/__init__.py
Record.get
def get(self, key, default=None): """ Obtain a value from the record by key, returning a default value if the key does not exist. :param key: :param default: :return: """ try: index = self.__keys.index(str(key)) except ValueError: ...
python
def get(self, key, default=None): """ Obtain a value from the record by key, returning a default value if the key does not exist. :param key: :param default: :return: """ try: index = self.__keys.index(str(key)) except ValueError: ...
[ "def", "get", "(", "self", ",", "key", ",", "default", "=", "None", ")", ":", "try", ":", "index", "=", "self", ".", "__keys", ".", "index", "(", "str", "(", "key", ")", ")", "except", "ValueError", ":", "return", "default", "if", "0", "<=", "ind...
Obtain a value from the record by key, returning a default value if the key does not exist. :param key: :param default: :return:
[ "Obtain", "a", "value", "from", "the", "record", "by", "key", "returning", "a", "default", "value", "if", "the", "key", "does", "not", "exist", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/__init__.py#L202-L217
231,503
neo4j/neo4j-python-driver
neo4j/types/__init__.py
Record.index
def index(self, key): """ Return the index of the given item. :param key: :return: """ if isinstance(key, int): if 0 <= key < len(self.__keys): return key raise IndexError(key) elif isinstance(key, str): try: ...
python
def index(self, key): """ Return the index of the given item. :param key: :return: """ if isinstance(key, int): if 0 <= key < len(self.__keys): return key raise IndexError(key) elif isinstance(key, str): try: ...
[ "def", "index", "(", "self", ",", "key", ")", ":", "if", "isinstance", "(", "key", ",", "int", ")", ":", "if", "0", "<=", "key", "<", "len", "(", "self", ".", "__keys", ")", ":", "return", "key", "raise", "IndexError", "(", "key", ")", "elif", ...
Return the index of the given item. :param key: :return:
[ "Return", "the", "index", "of", "the", "given", "item", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/__init__.py#L219-L235
231,504
neo4j/neo4j-python-driver
neo4j/types/__init__.py
Record.value
def value(self, key=0, default=None): """ Obtain a single value from the record by index or key. If no index or key is specified, the first value is returned. If the specified item does not exist, the default value is returned. :param key: :param default: :return: ...
python
def value(self, key=0, default=None): """ Obtain a single value from the record by index or key. If no index or key is specified, the first value is returned. If the specified item does not exist, the default value is returned. :param key: :param default: :return: ...
[ "def", "value", "(", "self", ",", "key", "=", "0", ",", "default", "=", "None", ")", ":", "try", ":", "index", "=", "self", ".", "index", "(", "key", ")", "except", "(", "IndexError", ",", "KeyError", ")", ":", "return", "default", "else", ":", "...
Obtain a single value from the record by index or key. If no index or key is specified, the first value is returned. If the specified item does not exist, the default value is returned. :param key: :param default: :return:
[ "Obtain", "a", "single", "value", "from", "the", "record", "by", "index", "or", "key", ".", "If", "no", "index", "or", "key", "is", "specified", "the", "first", "value", "is", "returned", ".", "If", "the", "specified", "item", "does", "not", "exist", "...
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/__init__.py#L237-L251
231,505
neo4j/neo4j-python-driver
neo4j/types/__init__.py
Record.values
def values(self, *keys): """ Return the values of the record, optionally filtering to include only certain values by index or key. :param keys: indexes or keys of the items to include; if none are provided, all values will be included :return: list of values ...
python
def values(self, *keys): """ Return the values of the record, optionally filtering to include only certain values by index or key. :param keys: indexes or keys of the items to include; if none are provided, all values will be included :return: list of values ...
[ "def", "values", "(", "self", ",", "*", "keys", ")", ":", "if", "keys", ":", "d", "=", "[", "]", "for", "key", "in", "keys", ":", "try", ":", "i", "=", "self", ".", "index", "(", "key", ")", "except", "KeyError", ":", "d", ".", "append", "(",...
Return the values of the record, optionally filtering to include only certain values by index or key. :param keys: indexes or keys of the items to include; if none are provided, all values will be included :return: list of values
[ "Return", "the", "values", "of", "the", "record", "optionally", "filtering", "to", "include", "only", "certain", "values", "by", "index", "or", "key", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/__init__.py#L260-L278
231,506
neo4j/neo4j-python-driver
neo4j/types/__init__.py
Record.items
def items(self, *keys): """ Return the fields of the record as a list of key and value tuples :return: """ if keys: d = [] for key in keys: try: i = self.index(key) except KeyError: d.append(...
python
def items(self, *keys): """ Return the fields of the record as a list of key and value tuples :return: """ if keys: d = [] for key in keys: try: i = self.index(key) except KeyError: d.append(...
[ "def", "items", "(", "self", ",", "*", "keys", ")", ":", "if", "keys", ":", "d", "=", "[", "]", "for", "key", "in", "keys", ":", "try", ":", "i", "=", "self", ".", "index", "(", "key", ")", "except", "KeyError", ":", "d", ".", "append", "(", ...
Return the fields of the record as a list of key and value tuples :return:
[ "Return", "the", "fields", "of", "the", "record", "as", "a", "list", "of", "key", "and", "value", "tuples" ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/__init__.py#L280-L295
231,507
neo4j/neo4j-python-driver
neo4j/blocking.py
_make_plan
def _make_plan(plan_dict): """ Construct a Plan or ProfiledPlan from a dictionary of metadata values. :param plan_dict: :return: """ operator_type = plan_dict["operatorType"] identifiers = plan_dict.get("identifiers", []) arguments = plan_dict.get("args", []) children = [_make_plan(chil...
python
def _make_plan(plan_dict): """ Construct a Plan or ProfiledPlan from a dictionary of metadata values. :param plan_dict: :return: """ operator_type = plan_dict["operatorType"] identifiers = plan_dict.get("identifiers", []) arguments = plan_dict.get("args", []) children = [_make_plan(chil...
[ "def", "_make_plan", "(", "plan_dict", ")", ":", "operator_type", "=", "plan_dict", "[", "\"operatorType\"", "]", "identifiers", "=", "plan_dict", ".", "get", "(", "\"identifiers\"", ",", "[", "]", ")", "arguments", "=", "plan_dict", ".", "get", "(", "\"args...
Construct a Plan or ProfiledPlan from a dictionary of metadata values. :param plan_dict: :return:
[ "Construct", "a", "Plan", "or", "ProfiledPlan", "from", "a", "dictionary", "of", "metadata", "values", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L962-L977
231,508
neo4j/neo4j-python-driver
neo4j/blocking.py
unit_of_work
def unit_of_work(metadata=None, timeout=None): """ This function is a decorator for transaction functions that allows extra control over how the transaction is carried out. For example, a timeout (in seconds) may be applied:: @unit_of_work(timeout=25.0) def count_people(tx): re...
python
def unit_of_work(metadata=None, timeout=None): """ This function is a decorator for transaction functions that allows extra control over how the transaction is carried out. For example, a timeout (in seconds) may be applied:: @unit_of_work(timeout=25.0) def count_people(tx): re...
[ "def", "unit_of_work", "(", "metadata", "=", "None", ",", "timeout", "=", "None", ")", ":", "def", "wrapper", "(", "f", ")", ":", "def", "wrapped", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "f", "(", "*", "args", ",", "*", ...
This function is a decorator for transaction functions that allows extra control over how the transaction is carried out. For example, a timeout (in seconds) may be applied:: @unit_of_work(timeout=25.0) def count_people(tx): return tx.run("MATCH (a:Person) RETURN count(a)").single(...
[ "This", "function", "is", "a", "decorator", "for", "transaction", "functions", "that", "allows", "extra", "control", "over", "how", "the", "transaction", "is", "carried", "out", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L1007-L1028
231,509
neo4j/neo4j-python-driver
neo4j/blocking.py
Session.close
def close(self): """ Close the session. This will release any borrowed resources, such as connections, and will roll back any outstanding transactions. """ from neobolt.exceptions import ConnectionExpired, CypherError, ServiceUnavailable try: if self.has_transaction()...
python
def close(self): """ Close the session. This will release any borrowed resources, such as connections, and will roll back any outstanding transactions. """ from neobolt.exceptions import ConnectionExpired, CypherError, ServiceUnavailable try: if self.has_transaction()...
[ "def", "close", "(", "self", ")", ":", "from", "neobolt", ".", "exceptions", "import", "ConnectionExpired", ",", "CypherError", ",", "ServiceUnavailable", "try", ":", "if", "self", ".", "has_transaction", "(", ")", ":", "try", ":", "self", ".", "rollback_tra...
Close the session. This will release any borrowed resources, such as connections, and will roll back any outstanding transactions.
[ "Close", "the", "session", ".", "This", "will", "release", "any", "borrowed", "resources", "such", "as", "connections", "and", "will", "roll", "back", "any", "outstanding", "transactions", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L144-L157
231,510
neo4j/neo4j-python-driver
neo4j/blocking.py
Session.run
def run(self, statement, parameters=None, **kwparameters): """ Run a Cypher statement within an auto-commit transaction. The statement is sent and the result header received immediately but the :class:`.StatementResult` content is fetched lazily as consumed by the client application. ...
python
def run(self, statement, parameters=None, **kwparameters): """ Run a Cypher statement within an auto-commit transaction. The statement is sent and the result header received immediately but the :class:`.StatementResult` content is fetched lazily as consumed by the client application. ...
[ "def", "run", "(", "self", ",", "statement", ",", "parameters", "=", "None", ",", "*", "*", "kwparameters", ")", ":", "from", "neobolt", ".", "exceptions", "import", "ConnectionExpired", "self", ".", "_assert_open", "(", ")", "if", "not", "statement", ":",...
Run a Cypher statement within an auto-commit transaction. The statement is sent and the result header received immediately but the :class:`.StatementResult` content is fetched lazily as consumed by the client application. If a statement is executed before a previous :class:`.St...
[ "Run", "a", "Cypher", "statement", "within", "an", "auto", "-", "commit", "transaction", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L166-L261
231,511
neo4j/neo4j-python-driver
neo4j/blocking.py
Session.send
def send(self): """ Send all outstanding requests. """ from neobolt.exceptions import ConnectionExpired if self._connection: try: self._connection.send() except ConnectionExpired as error: raise SessionExpired(*error.args)
python
def send(self): """ Send all outstanding requests. """ from neobolt.exceptions import ConnectionExpired if self._connection: try: self._connection.send() except ConnectionExpired as error: raise SessionExpired(*error.args)
[ "def", "send", "(", "self", ")", ":", "from", "neobolt", ".", "exceptions", "import", "ConnectionExpired", "if", "self", ".", "_connection", ":", "try", ":", "self", ".", "_connection", ".", "send", "(", ")", "except", "ConnectionExpired", "as", "error", "...
Send all outstanding requests.
[ "Send", "all", "outstanding", "requests", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L263-L271
231,512
neo4j/neo4j-python-driver
neo4j/blocking.py
Session.fetch
def fetch(self): """ Attempt to fetch at least one more record. :returns: number of records fetched """ from neobolt.exceptions import ConnectionExpired if self._connection: try: detail_count, _ = self._connection.fetch() except Connection...
python
def fetch(self): """ Attempt to fetch at least one more record. :returns: number of records fetched """ from neobolt.exceptions import ConnectionExpired if self._connection: try: detail_count, _ = self._connection.fetch() except Connection...
[ "def", "fetch", "(", "self", ")", ":", "from", "neobolt", ".", "exceptions", "import", "ConnectionExpired", "if", "self", ".", "_connection", ":", "try", ":", "detail_count", ",", "_", "=", "self", ".", "_connection", ".", "fetch", "(", ")", "except", "C...
Attempt to fetch at least one more record. :returns: number of records fetched
[ "Attempt", "to", "fetch", "at", "least", "one", "more", "record", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L273-L286
231,513
neo4j/neo4j-python-driver
neo4j/blocking.py
Session.detach
def detach(self, result, sync=True): """ Detach a result from this session by fetching and buffering any remaining records. :param result: :param sync: :returns: number of records fetched """ count = 0 if sync and result.attached(): self.send...
python
def detach(self, result, sync=True): """ Detach a result from this session by fetching and buffering any remaining records. :param result: :param sync: :returns: number of records fetched """ count = 0 if sync and result.attached(): self.send...
[ "def", "detach", "(", "self", ",", "result", ",", "sync", "=", "True", ")", ":", "count", "=", "0", "if", "sync", "and", "result", ".", "attached", "(", ")", ":", "self", ".", "send", "(", ")", "fetch", "=", "self", ".", "fetch", "while", "result...
Detach a result from this session by fetching and buffering any remaining records. :param result: :param sync: :returns: number of records fetched
[ "Detach", "a", "result", "from", "this", "session", "by", "fetching", "and", "buffering", "any", "remaining", "records", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L303-L325
231,514
neo4j/neo4j-python-driver
neo4j/blocking.py
Transaction.run
def run(self, statement, parameters=None, **kwparameters): """ Run a Cypher statement within the context of this transaction. The statement is sent to the server lazily, when its result is consumed. To force the statement to be sent to the server, use the :meth:`.Transaction.sync` metho...
python
def run(self, statement, parameters=None, **kwparameters): """ Run a Cypher statement within the context of this transaction. The statement is sent to the server lazily, when its result is consumed. To force the statement to be sent to the server, use the :meth:`.Transaction.sync` metho...
[ "def", "run", "(", "self", ",", "statement", ",", "parameters", "=", "None", ",", "*", "*", "kwparameters", ")", ":", "self", ".", "_assert_open", "(", ")", "return", "self", ".", "session", ".", "run", "(", "statement", ",", "parameters", ",", "*", ...
Run a Cypher statement within the context of this transaction. The statement is sent to the server lazily, when its result is consumed. To force the statement to be sent to the server, use the :meth:`.Transaction.sync` method. Cypher is typically expressed as a statement template plus ...
[ "Run", "a", "Cypher", "statement", "within", "the", "context", "of", "this", "transaction", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L497-L527
231,515
neo4j/neo4j-python-driver
neo4j/blocking.py
StatementResult.detach
def detach(self, sync=True): """ Detach this result from its parent session by fetching the remainder of this result from the network into the buffer. :returns: number of records fetched """ if self.attached(): return self._session.detach(self, sync=sync) els...
python
def detach(self, sync=True): """ Detach this result from its parent session by fetching the remainder of this result from the network into the buffer. :returns: number of records fetched """ if self.attached(): return self._session.detach(self, sync=sync) els...
[ "def", "detach", "(", "self", ",", "sync", "=", "True", ")", ":", "if", "self", ".", "attached", "(", ")", ":", "return", "self", ".", "_session", ".", "detach", "(", "self", ",", "sync", "=", "sync", ")", "else", ":", "return", "0" ]
Detach this result from its parent session by fetching the remainder of this result from the network into the buffer. :returns: number of records fetched
[ "Detach", "this", "result", "from", "its", "parent", "session", "by", "fetching", "the", "remainder", "of", "this", "result", "from", "the", "network", "into", "the", "buffer", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L653-L662
231,516
neo4j/neo4j-python-driver
neo4j/blocking.py
StatementResult.keys
def keys(self): """ The keys for the records in this result. :returns: tuple of key names """ try: return self._metadata["fields"] except KeyError: if self.attached(): self._session.send() while self.attached() and "fields" not...
python
def keys(self): """ The keys for the records in this result. :returns: tuple of key names """ try: return self._metadata["fields"] except KeyError: if self.attached(): self._session.send() while self.attached() and "fields" not...
[ "def", "keys", "(", "self", ")", ":", "try", ":", "return", "self", ".", "_metadata", "[", "\"fields\"", "]", "except", "KeyError", ":", "if", "self", ".", "attached", "(", ")", ":", "self", ".", "_session", ".", "send", "(", ")", "while", "self", ...
The keys for the records in this result. :returns: tuple of key names
[ "The", "keys", "for", "the", "records", "in", "this", "result", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L664-L676
231,517
neo4j/neo4j-python-driver
neo4j/blocking.py
StatementResult.records
def records(self): """ Generator for records obtained from this result. :yields: iterable of :class:`.Record` objects """ records = self._records next_record = records.popleft while records: yield next_record() attached = self.attached if atta...
python
def records(self): """ Generator for records obtained from this result. :yields: iterable of :class:`.Record` objects """ records = self._records next_record = records.popleft while records: yield next_record() attached = self.attached if atta...
[ "def", "records", "(", "self", ")", ":", "records", "=", "self", ".", "_records", "next_record", "=", "records", ".", "popleft", "while", "records", ":", "yield", "next_record", "(", ")", "attached", "=", "self", ".", "attached", "if", "attached", "(", "...
Generator for records obtained from this result. :yields: iterable of :class:`.Record` objects
[ "Generator", "for", "records", "obtained", "from", "this", "result", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L678-L693
231,518
neo4j/neo4j-python-driver
neo4j/blocking.py
StatementResult.summary
def summary(self): """ Obtain the summary of this result, buffering any remaining records. :returns: The :class:`.ResultSummary` for this result """ self.detach() if self._summary is None: self._summary = BoltStatementResultSummary(**self._metadata) return se...
python
def summary(self): """ Obtain the summary of this result, buffering any remaining records. :returns: The :class:`.ResultSummary` for this result """ self.detach() if self._summary is None: self._summary = BoltStatementResultSummary(**self._metadata) return se...
[ "def", "summary", "(", "self", ")", ":", "self", ".", "detach", "(", ")", "if", "self", ".", "_summary", "is", "None", ":", "self", ".", "_summary", "=", "BoltStatementResultSummary", "(", "*", "*", "self", ".", "_metadata", ")", "return", "self", ".",...
Obtain the summary of this result, buffering any remaining records. :returns: The :class:`.ResultSummary` for this result
[ "Obtain", "the", "summary", "of", "this", "result", "buffering", "any", "remaining", "records", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L695-L703
231,519
neo4j/neo4j-python-driver
neo4j/blocking.py
StatementResult.single
def single(self): """ Obtain the next and only remaining record from this result. A warning is generated if more than one record is available but the first of these is still returned. :returns: the next :class:`.Record` or :const:`None` if none remain :warns: if more than one r...
python
def single(self): """ Obtain the next and only remaining record from this result. A warning is generated if more than one record is available but the first of these is still returned. :returns: the next :class:`.Record` or :const:`None` if none remain :warns: if more than one r...
[ "def", "single", "(", "self", ")", ":", "records", "=", "list", "(", "self", ")", "size", "=", "len", "(", "records", ")", "if", "size", "==", "0", ":", "return", "None", "if", "size", "!=", "1", ":", "warn", "(", "\"Expected a result with a single rec...
Obtain the next and only remaining record from this result. A warning is generated if more than one record is available but the first of these is still returned. :returns: the next :class:`.Record` or :const:`None` if none remain :warns: if more than one record is available
[ "Obtain", "the", "next", "and", "only", "remaining", "record", "from", "this", "result", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L715-L730
231,520
neo4j/neo4j-python-driver
neo4j/blocking.py
StatementResult.peek
def peek(self): """ Obtain the next record from this result without consuming it. This leaves the record in the buffer for further processing. :returns: the next :class:`.Record` or :const:`None` if none remain """ records = self._records if records: return r...
python
def peek(self): """ Obtain the next record from this result without consuming it. This leaves the record in the buffer for further processing. :returns: the next :class:`.Record` or :const:`None` if none remain """ records = self._records if records: return r...
[ "def", "peek", "(", "self", ")", ":", "records", "=", "self", ".", "_records", "if", "records", ":", "return", "records", "[", "0", "]", "if", "not", "self", ".", "attached", "(", ")", ":", "return", "None", "if", "self", ".", "attached", "(", ")",...
Obtain the next record from this result without consuming it. This leaves the record in the buffer for further processing. :returns: the next :class:`.Record` or :const:`None` if none remain
[ "Obtain", "the", "next", "record", "from", "this", "result", "without", "consuming", "it", ".", "This", "leaves", "the", "record", "in", "the", "buffer", "for", "further", "processing", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L732-L749
231,521
neo4j/neo4j-python-driver
neo4j/blocking.py
BoltStatementResult.value
def value(self, item=0, default=None): """ Return the remainder of the result as a list of values. :param item: field to return for each remaining record :param default: default value, used if the index of key is unavailable :returns: list of individual values """ return...
python
def value(self, item=0, default=None): """ Return the remainder of the result as a list of values. :param item: field to return for each remaining record :param default: default value, used if the index of key is unavailable :returns: list of individual values """ return...
[ "def", "value", "(", "self", ",", "item", "=", "0", ",", "default", "=", "None", ")", ":", "return", "[", "record", ".", "value", "(", "item", ",", "default", ")", "for", "record", "in", "self", ".", "records", "(", ")", "]" ]
Return the remainder of the result as a list of values. :param item: field to return for each remaining record :param default: default value, used if the index of key is unavailable :returns: list of individual values
[ "Return", "the", "remainder", "of", "the", "result", "as", "a", "list", "of", "values", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/blocking.py#L769-L776
231,522
neo4j/neo4j-python-driver
neo4j/pipelining.py
Pipeline.pull
def pull(self): """Returns a generator containing the results of the next query in the pipeline""" # n.b. pull is now somewhat misleadingly named because it doesn't do anything # the connection isn't touched until you try and iterate the generator we return lock_acquired = self._pull_loc...
python
def pull(self): """Returns a generator containing the results of the next query in the pipeline""" # n.b. pull is now somewhat misleadingly named because it doesn't do anything # the connection isn't touched until you try and iterate the generator we return lock_acquired = self._pull_loc...
[ "def", "pull", "(", "self", ")", ":", "# n.b. pull is now somewhat misleadingly named because it doesn't do anything", "# the connection isn't touched until you try and iterate the generator we return", "lock_acquired", "=", "self", ".", "_pull_lock", ".", "acquire", "(", "blocking",...
Returns a generator containing the results of the next query in the pipeline
[ "Returns", "a", "generator", "containing", "the", "results", "of", "the", "next", "query", "in", "the", "pipeline" ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/pipelining.py#L61-L68
231,523
neo4j/neo4j-python-driver
neo4j/meta.py
deprecated
def deprecated(message): """ Decorator for deprecating functions and methods. :: @deprecated("'foo' has been deprecated in favour of 'bar'") def foo(x): pass """ def f__(f): def f_(*args, **kwargs): from warnings import warn warn(message, ca...
python
def deprecated(message): """ Decorator for deprecating functions and methods. :: @deprecated("'foo' has been deprecated in favour of 'bar'") def foo(x): pass """ def f__(f): def f_(*args, **kwargs): from warnings import warn warn(message, ca...
[ "def", "deprecated", "(", "message", ")", ":", "def", "f__", "(", "f", ")", ":", "def", "f_", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "message", ",", "category", "=", "DeprecationWarning...
Decorator for deprecating functions and methods. :: @deprecated("'foo' has been deprecated in favour of 'bar'") def foo(x): pass
[ "Decorator", "for", "deprecating", "functions", "and", "methods", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/meta.py#L27-L46
231,524
neo4j/neo4j-python-driver
neo4j/meta.py
experimental
def experimental(message): """ Decorator for tagging experimental functions and methods. :: @experimental("'foo' is an experimental function and may be " "removed in a future release") def foo(x): pass """ def f__(f): def f_(*args, **kwargs): ...
python
def experimental(message): """ Decorator for tagging experimental functions and methods. :: @experimental("'foo' is an experimental function and may be " "removed in a future release") def foo(x): pass """ def f__(f): def f_(*args, **kwargs): ...
[ "def", "experimental", "(", "message", ")", ":", "def", "f__", "(", "f", ")", ":", "def", "f_", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "message", ",", "category", "=", "ExperimentalWarn...
Decorator for tagging experimental functions and methods. :: @experimental("'foo' is an experimental function and may be " "removed in a future release") def foo(x): pass
[ "Decorator", "for", "tagging", "experimental", "functions", "and", "methods", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/meta.py#L54-L74
231,525
neo4j/neo4j-python-driver
neo4j/types/temporal.py
hydrate_time
def hydrate_time(nanoseconds, tz=None): """ Hydrator for `Time` and `LocalTime` values. :param nanoseconds: :param tz: :return: Time """ seconds, nanoseconds = map(int, divmod(nanoseconds, 1000000000)) minutes, seconds = map(int, divmod(seconds, 60)) hours, minutes = map(int, divmod(min...
python
def hydrate_time(nanoseconds, tz=None): """ Hydrator for `Time` and `LocalTime` values. :param nanoseconds: :param tz: :return: Time """ seconds, nanoseconds = map(int, divmod(nanoseconds, 1000000000)) minutes, seconds = map(int, divmod(seconds, 60)) hours, minutes = map(int, divmod(min...
[ "def", "hydrate_time", "(", "nanoseconds", ",", "tz", "=", "None", ")", ":", "seconds", ",", "nanoseconds", "=", "map", "(", "int", ",", "divmod", "(", "nanoseconds", ",", "1000000000", ")", ")", "minutes", ",", "seconds", "=", "map", "(", "int", ",", ...
Hydrator for `Time` and `LocalTime` values. :param nanoseconds: :param tz: :return: Time
[ "Hydrator", "for", "Time", "and", "LocalTime", "values", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/temporal.py#L61-L77
231,526
neo4j/neo4j-python-driver
neo4j/types/temporal.py
dehydrate_time
def dehydrate_time(value): """ Dehydrator for `time` values. :param value: :type value: Time :return: """ if isinstance(value, Time): nanoseconds = int(value.ticks * 1000000000) elif isinstance(value, time): nanoseconds = (3600000000000 * value.hour + 60000000000 * value.min...
python
def dehydrate_time(value): """ Dehydrator for `time` values. :param value: :type value: Time :return: """ if isinstance(value, Time): nanoseconds = int(value.ticks * 1000000000) elif isinstance(value, time): nanoseconds = (3600000000000 * value.hour + 60000000000 * value.min...
[ "def", "dehydrate_time", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "Time", ")", ":", "nanoseconds", "=", "int", "(", "value", ".", "ticks", "*", "1000000000", ")", "elif", "isinstance", "(", "value", ",", "time", ")", ":", "nanosec...
Dehydrator for `time` values. :param value: :type value: Time :return:
[ "Dehydrator", "for", "time", "values", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/temporal.py#L80-L97
231,527
neo4j/neo4j-python-driver
neo4j/types/temporal.py
hydrate_datetime
def hydrate_datetime(seconds, nanoseconds, tz=None): """ Hydrator for `DateTime` and `LocalDateTime` values. :param seconds: :param nanoseconds: :param tz: :return: datetime """ minutes, seconds = map(int, divmod(seconds, 60)) hours, minutes = map(int, divmod(minutes, 60)) days, hou...
python
def hydrate_datetime(seconds, nanoseconds, tz=None): """ Hydrator for `DateTime` and `LocalDateTime` values. :param seconds: :param nanoseconds: :param tz: :return: datetime """ minutes, seconds = map(int, divmod(seconds, 60)) hours, minutes = map(int, divmod(minutes, 60)) days, hou...
[ "def", "hydrate_datetime", "(", "seconds", ",", "nanoseconds", ",", "tz", "=", "None", ")", ":", "minutes", ",", "seconds", "=", "map", "(", "int", ",", "divmod", "(", "seconds", ",", "60", ")", ")", "hours", ",", "minutes", "=", "map", "(", "int", ...
Hydrator for `DateTime` and `LocalDateTime` values. :param seconds: :param nanoseconds: :param tz: :return: datetime
[ "Hydrator", "for", "DateTime", "and", "LocalDateTime", "values", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/temporal.py#L100-L120
231,528
neo4j/neo4j-python-driver
neo4j/types/temporal.py
dehydrate_datetime
def dehydrate_datetime(value): """ Dehydrator for `datetime` values. :param value: :type value: datetime :return: """ def seconds_and_nanoseconds(dt): if isinstance(dt, datetime): dt = DateTime.from_native(dt) zone_epoch = DateTime(1970, 1, 1, tzinfo=dt.tzinfo) ...
python
def dehydrate_datetime(value): """ Dehydrator for `datetime` values. :param value: :type value: datetime :return: """ def seconds_and_nanoseconds(dt): if isinstance(dt, datetime): dt = DateTime.from_native(dt) zone_epoch = DateTime(1970, 1, 1, tzinfo=dt.tzinfo) ...
[ "def", "dehydrate_datetime", "(", "value", ")", ":", "def", "seconds_and_nanoseconds", "(", "dt", ")", ":", "if", "isinstance", "(", "dt", ",", "datetime", ")", ":", "dt", "=", "DateTime", ".", "from_native", "(", "dt", ")", "zone_epoch", "=", "DateTime", ...
Dehydrator for `datetime` values. :param value: :type value: datetime :return:
[ "Dehydrator", "for", "datetime", "values", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/temporal.py#L123-L151
231,529
neo4j/neo4j-python-driver
neo4j/types/temporal.py
hydrate_duration
def hydrate_duration(months, days, seconds, nanoseconds): """ Hydrator for `Duration` values. :param months: :param days: :param seconds: :param nanoseconds: :return: `duration` namedtuple """ return Duration(months=months, days=days, seconds=seconds, nanoseconds=nanoseconds)
python
def hydrate_duration(months, days, seconds, nanoseconds): """ Hydrator for `Duration` values. :param months: :param days: :param seconds: :param nanoseconds: :return: `duration` namedtuple """ return Duration(months=months, days=days, seconds=seconds, nanoseconds=nanoseconds)
[ "def", "hydrate_duration", "(", "months", ",", "days", ",", "seconds", ",", "nanoseconds", ")", ":", "return", "Duration", "(", "months", "=", "months", ",", "days", "=", "days", ",", "seconds", "=", "seconds", ",", "nanoseconds", "=", "nanoseconds", ")" ]
Hydrator for `Duration` values. :param months: :param days: :param seconds: :param nanoseconds: :return: `duration` namedtuple
[ "Hydrator", "for", "Duration", "values", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/temporal.py#L154-L163
231,530
neo4j/neo4j-python-driver
neo4j/types/temporal.py
dehydrate_duration
def dehydrate_duration(value): """ Dehydrator for `duration` values. :param value: :type value: Duration :return: """ return Structure(b"E", value.months, value.days, value.seconds, int(1000000000 * value.subseconds))
python
def dehydrate_duration(value): """ Dehydrator for `duration` values. :param value: :type value: Duration :return: """ return Structure(b"E", value.months, value.days, value.seconds, int(1000000000 * value.subseconds))
[ "def", "dehydrate_duration", "(", "value", ")", ":", "return", "Structure", "(", "b\"E\"", ",", "value", ".", "months", ",", "value", ".", "days", ",", "value", ".", "seconds", ",", "int", "(", "1000000000", "*", "value", ".", "subseconds", ")", ")" ]
Dehydrator for `duration` values. :param value: :type value: Duration :return:
[ "Dehydrator", "for", "duration", "values", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/temporal.py#L166-L173
231,531
neo4j/neo4j-python-driver
neo4j/types/temporal.py
dehydrate_timedelta
def dehydrate_timedelta(value): """ Dehydrator for `timedelta` values. :param value: :type value: timedelta :return: """ months = 0 days = value.days seconds = value.seconds nanoseconds = 1000 * value.microseconds return Structure(b"E", months, days, seconds, nanoseconds)
python
def dehydrate_timedelta(value): """ Dehydrator for `timedelta` values. :param value: :type value: timedelta :return: """ months = 0 days = value.days seconds = value.seconds nanoseconds = 1000 * value.microseconds return Structure(b"E", months, days, seconds, nanoseconds)
[ "def", "dehydrate_timedelta", "(", "value", ")", ":", "months", "=", "0", "days", "=", "value", ".", "days", "seconds", "=", "value", ".", "seconds", "nanoseconds", "=", "1000", "*", "value", ".", "microseconds", "return", "Structure", "(", "b\"E\"", ",", ...
Dehydrator for `timedelta` values. :param value: :type value: timedelta :return:
[ "Dehydrator", "for", "timedelta", "values", "." ]
0c641e826765e86ff5454dae57c99521db8ca45c
https://github.com/neo4j/neo4j-python-driver/blob/0c641e826765e86ff5454dae57c99521db8ca45c/neo4j/types/temporal.py#L176-L187
231,532
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_touch.py
_TouchKeywords.zoom
def zoom(self, locator, percent="200%", steps=1): """ Zooms in on an element a certain amount. """ driver = self._current_application() element = self._element_find(locator, True, True) driver.zoom(element=element, percent=percent, steps=steps)
python
def zoom(self, locator, percent="200%", steps=1): """ Zooms in on an element a certain amount. """ driver = self._current_application() element = self._element_find(locator, True, True) driver.zoom(element=element, percent=percent, steps=steps)
[ "def", "zoom", "(", "self", ",", "locator", ",", "percent", "=", "\"200%\"", ",", "steps", "=", "1", ")", ":", "driver", "=", "self", ".", "_current_application", "(", ")", "element", "=", "self", ".", "_element_find", "(", "locator", ",", "True", ",",...
Zooms in on an element a certain amount.
[ "Zooms", "in", "on", "an", "element", "a", "certain", "amount", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_touch.py#L15-L21
231,533
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_touch.py
_TouchKeywords.scroll
def scroll(self, start_locator, end_locator): """ Scrolls from one element to another Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements. """ el1 = self._element_find(start_locator, True, True) ...
python
def scroll(self, start_locator, end_locator): """ Scrolls from one element to another Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements. """ el1 = self._element_find(start_locator, True, True) ...
[ "def", "scroll", "(", "self", ",", "start_locator", ",", "end_locator", ")", ":", "el1", "=", "self", ".", "_element_find", "(", "start_locator", ",", "True", ",", "True", ")", "el2", "=", "self", ".", "_element_find", "(", "end_locator", ",", "True", ",...
Scrolls from one element to another Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements.
[ "Scrolls", "from", "one", "element", "to", "another", "Key", "attributes", "for", "arbitrary", "elements", "are", "id", "and", "name", ".", "See", "introduction", "for", "details", "about", "locating", "elements", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_touch.py#L85-L94
231,534
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_touch.py
_TouchKeywords.scroll_up
def scroll_up(self, locator): """Scrolls up to element""" driver = self._current_application() element = self._element_find(locator, True, True) driver.execute_script("mobile: scroll", {"direction": 'up', 'element': element.id})
python
def scroll_up(self, locator): """Scrolls up to element""" driver = self._current_application() element = self._element_find(locator, True, True) driver.execute_script("mobile: scroll", {"direction": 'up', 'element': element.id})
[ "def", "scroll_up", "(", "self", ",", "locator", ")", ":", "driver", "=", "self", ".", "_current_application", "(", ")", "element", "=", "self", ".", "_element_find", "(", "locator", ",", "True", ",", "True", ")", "driver", ".", "execute_script", "(", "\...
Scrolls up to element
[ "Scrolls", "up", "to", "element" ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_touch.py#L102-L106
231,535
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_touch.py
_TouchKeywords.long_press
def long_press(self, locator, duration=1000): """ Long press the element with optional duration """ driver = self._current_application() element = self._element_find(locator, True, True) action = TouchAction(driver) action.press(element).wait(duration).release().perform()
python
def long_press(self, locator, duration=1000): """ Long press the element with optional duration """ driver = self._current_application() element = self._element_find(locator, True, True) action = TouchAction(driver) action.press(element).wait(duration).release().perform()
[ "def", "long_press", "(", "self", ",", "locator", ",", "duration", "=", "1000", ")", ":", "driver", "=", "self", ".", "_current_application", "(", ")", "element", "=", "self", ".", "_element_find", "(", "locator", ",", "True", ",", "True", ")", "action",...
Long press the element with optional duration
[ "Long", "press", "the", "element", "with", "optional", "duration" ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_touch.py#L108-L113
231,536
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_touch.py
_TouchKeywords.click_a_point
def click_a_point(self, x=0, y=0, duration=100): """ Click on a point""" self._info("Clicking on a point (%s,%s)." % (x,y)) driver = self._current_application() action = TouchAction(driver) try: action.press(x=float(x), y=float(y)).wait(float(duration)).release(...
python
def click_a_point(self, x=0, y=0, duration=100): """ Click on a point""" self._info("Clicking on a point (%s,%s)." % (x,y)) driver = self._current_application() action = TouchAction(driver) try: action.press(x=float(x), y=float(y)).wait(float(duration)).release(...
[ "def", "click_a_point", "(", "self", ",", "x", "=", "0", ",", "y", "=", "0", ",", "duration", "=", "100", ")", ":", "self", ".", "_info", "(", "\"Clicking on a point (%s,%s).\"", "%", "(", "x", ",", "y", ")", ")", "driver", "=", "self", ".", "_curr...
Click on a point
[ "Click", "on", "a", "point" ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_touch.py#L128-L136
231,537
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_touch.py
_TouchKeywords.click_element_at_coordinates
def click_element_at_coordinates(self, coordinate_X, coordinate_Y): """ click element at a certain coordinate """ self._info("Pressing at (%s, %s)." % (coordinate_X, coordinate_Y)) driver = self._current_application() action = TouchAction(driver) action.press(x=coordinate_X,...
python
def click_element_at_coordinates(self, coordinate_X, coordinate_Y): """ click element at a certain coordinate """ self._info("Pressing at (%s, %s)." % (coordinate_X, coordinate_Y)) driver = self._current_application() action = TouchAction(driver) action.press(x=coordinate_X,...
[ "def", "click_element_at_coordinates", "(", "self", ",", "coordinate_X", ",", "coordinate_Y", ")", ":", "self", ".", "_info", "(", "\"Pressing at (%s, %s).\"", "%", "(", "coordinate_X", ",", "coordinate_Y", ")", ")", "driver", "=", "self", ".", "_current_applicati...
click element at a certain coordinate
[ "click", "element", "at", "a", "certain", "coordinate" ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_touch.py#L138-L143
231,538
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_waiting.py
_WaitingKeywords.wait_until_element_is_visible
def wait_until_element_is_visible(self, locator, timeout=None, error=None): """Waits until element specified with `locator` is visible. Fails if `timeout` expires before the element is visible. See `introduction` for more information about `timeout` and its default value. `erro...
python
def wait_until_element_is_visible(self, locator, timeout=None, error=None): """Waits until element specified with `locator` is visible. Fails if `timeout` expires before the element is visible. See `introduction` for more information about `timeout` and its default value. `erro...
[ "def", "wait_until_element_is_visible", "(", "self", ",", "locator", ",", "timeout", "=", "None", ",", "error", "=", "None", ")", ":", "def", "check_visibility", "(", ")", ":", "visible", "=", "self", ".", "_is_visible", "(", "locator", ")", "if", "visible...
Waits until element specified with `locator` is visible. Fails if `timeout` expires before the element is visible. See `introduction` for more information about `timeout` and its default value. `error` can be used to override the default error message. See also `Wait Until Pag...
[ "Waits", "until", "element", "specified", "with", "locator", "is", "visible", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_waiting.py#L7-L28
231,539
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_waiting.py
_WaitingKeywords.wait_until_page_contains
def wait_until_page_contains(self, text, timeout=None, error=None): """Waits until `text` appears on current page. Fails if `timeout` expires before the text appears. See `introduction` for more information about `timeout` and its default value. `error` can be used to override ...
python
def wait_until_page_contains(self, text, timeout=None, error=None): """Waits until `text` appears on current page. Fails if `timeout` expires before the text appears. See `introduction` for more information about `timeout` and its default value. `error` can be used to override ...
[ "def", "wait_until_page_contains", "(", "self", ",", "text", ",", "timeout", "=", "None", ",", "error", "=", "None", ")", ":", "if", "not", "error", ":", "error", "=", "\"Text '%s' did not appear in <TIMEOUT>\"", "%", "text", "self", ".", "_wait_until", "(", ...
Waits until `text` appears on current page. Fails if `timeout` expires before the text appears. See `introduction` for more information about `timeout` and its default value. `error` can be used to override the default error message. See also `Wait Until Page Does Not Contain`...
[ "Waits", "until", "text", "appears", "on", "current", "page", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_waiting.py#L30-L46
231,540
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_waiting.py
_WaitingKeywords.wait_until_page_does_not_contain
def wait_until_page_does_not_contain(self, text, timeout=None, error=None): """Waits until `text` disappears from current page. Fails if `timeout` expires before the `text` disappears. See `introduction` for more information about `timeout` and its default value. `error` can be...
python
def wait_until_page_does_not_contain(self, text, timeout=None, error=None): """Waits until `text` disappears from current page. Fails if `timeout` expires before the `text` disappears. See `introduction` for more information about `timeout` and its default value. `error` can be...
[ "def", "wait_until_page_does_not_contain", "(", "self", ",", "text", ",", "timeout", "=", "None", ",", "error", "=", "None", ")", ":", "def", "check_present", "(", ")", ":", "present", "=", "self", ".", "_is_text_present", "(", "text", ")", "if", "not", ...
Waits until `text` disappears from current page. Fails if `timeout` expires before the `text` disappears. See `introduction` for more information about `timeout` and its default value. `error` can be used to override the default error message. See also `Wait Until Page Contain...
[ "Waits", "until", "text", "disappears", "from", "current", "page", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_waiting.py#L48-L70
231,541
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_waiting.py
_WaitingKeywords.wait_until_page_contains_element
def wait_until_page_contains_element(self, locator, timeout=None, error=None): """Waits until element specified with `locator` appears on current page. Fails if `timeout` expires before the element appears. See `introduction` for more information about `timeout` and its default value. ...
python
def wait_until_page_contains_element(self, locator, timeout=None, error=None): """Waits until element specified with `locator` appears on current page. Fails if `timeout` expires before the element appears. See `introduction` for more information about `timeout` and its default value. ...
[ "def", "wait_until_page_contains_element", "(", "self", ",", "locator", ",", "timeout", "=", "None", ",", "error", "=", "None", ")", ":", "if", "not", "error", ":", "error", "=", "\"Element '%s' did not appear in <TIMEOUT>\"", "%", "locator", "self", ".", "_wait...
Waits until element specified with `locator` appears on current page. Fails if `timeout` expires before the element appears. See `introduction` for more information about `timeout` and its default value. `error` can be used to override the default error message. See also `Wait...
[ "Waits", "until", "element", "specified", "with", "locator", "appears", "on", "current", "page", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_waiting.py#L72-L88
231,542
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_waiting.py
_WaitingKeywords.wait_until_page_does_not_contain_element
def wait_until_page_does_not_contain_element(self, locator, timeout=None, error=None): """Waits until element specified with `locator` disappears from current page. Fails if `timeout` expires before the element disappears. See `introduction` for more information about `timeout` and its ...
python
def wait_until_page_does_not_contain_element(self, locator, timeout=None, error=None): """Waits until element specified with `locator` disappears from current page. Fails if `timeout` expires before the element disappears. See `introduction` for more information about `timeout` and its ...
[ "def", "wait_until_page_does_not_contain_element", "(", "self", ",", "locator", ",", "timeout", "=", "None", ",", "error", "=", "None", ")", ":", "def", "check_present", "(", ")", ":", "present", "=", "self", ".", "_is_element_present", "(", "locator", ")", ...
Waits until element specified with `locator` disappears from current page. Fails if `timeout` expires before the element disappears. See `introduction` for more information about `timeout` and its default value. `error` can be used to override the default error message. See al...
[ "Waits", "until", "element", "specified", "with", "locator", "disappears", "from", "current", "page", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_waiting.py#L90-L112
231,543
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_android_utils.py
_AndroidUtilsKeywords.set_network_connection_status
def set_network_connection_status(self, connectionStatus): """Sets the network connection Status. Android only. Possible values: | =Value= | =Alias= | =Data= | =Wifi= | =Airplane Mode= | | 0 | (None) | 0 | 0 | 0 | ...
python
def set_network_connection_status(self, connectionStatus): """Sets the network connection Status. Android only. Possible values: | =Value= | =Alias= | =Data= | =Wifi= | =Airplane Mode= | | 0 | (None) | 0 | 0 | 0 | ...
[ "def", "set_network_connection_status", "(", "self", ",", "connectionStatus", ")", ":", "driver", "=", "self", ".", "_current_application", "(", ")", "return", "driver", ".", "set_network_connection", "(", "int", "(", "connectionStatus", ")", ")" ]
Sets the network connection Status. Android only. Possible values: | =Value= | =Alias= | =Data= | =Wifi= | =Airplane Mode= | | 0 | (None) | 0 | 0 | 0 | | 1 | (Airplane Mode) | 0 | 0 | 1 ...
[ "Sets", "the", "network", "connection", "Status", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_android_utils.py#L21-L35
231,544
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_android_utils.py
_AndroidUtilsKeywords.pull_file
def pull_file(self, path, decode=False): """Retrieves the file at `path` and return it's content. Android only. - _path_ - the path to the file on the device - _decode_ - True/False decode the data (base64) before returning it (default=False) """ driver = self._curre...
python
def pull_file(self, path, decode=False): """Retrieves the file at `path` and return it's content. Android only. - _path_ - the path to the file on the device - _decode_ - True/False decode the data (base64) before returning it (default=False) """ driver = self._curre...
[ "def", "pull_file", "(", "self", ",", "path", ",", "decode", "=", "False", ")", ":", "driver", "=", "self", ".", "_current_application", "(", ")", "theFile", "=", "driver", ".", "pull_file", "(", "path", ")", "if", "decode", ":", "theFile", "=", "base6...
Retrieves the file at `path` and return it's content. Android only. - _path_ - the path to the file on the device - _decode_ - True/False decode the data (base64) before returning it (default=False)
[ "Retrieves", "the", "file", "at", "path", "and", "return", "it", "s", "content", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_android_utils.py#L37-L49
231,545
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_android_utils.py
_AndroidUtilsKeywords.pull_folder
def pull_folder(self, path, decode=False): """Retrieves a folder at `path`. Returns the folder's contents zipped. Android only. - _path_ - the path to the folder on the device - _decode_ - True/False decode the data (base64) before returning it (default=False) """ dri...
python
def pull_folder(self, path, decode=False): """Retrieves a folder at `path`. Returns the folder's contents zipped. Android only. - _path_ - the path to the folder on the device - _decode_ - True/False decode the data (base64) before returning it (default=False) """ dri...
[ "def", "pull_folder", "(", "self", ",", "path", ",", "decode", "=", "False", ")", ":", "driver", "=", "self", ".", "_current_application", "(", ")", "theFolder", "=", "driver", ".", "pull_folder", "(", "path", ")", "if", "decode", ":", "theFolder", "=", ...
Retrieves a folder at `path`. Returns the folder's contents zipped. Android only. - _path_ - the path to the folder on the device - _decode_ - True/False decode the data (base64) before returning it (default=False)
[ "Retrieves", "a", "folder", "at", "path", ".", "Returns", "the", "folder", "s", "contents", "zipped", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_android_utils.py#L51-L63
231,546
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_android_utils.py
_AndroidUtilsKeywords.push_file
def push_file(self, path, data, encode=False): """Puts the data in the file specified as `path`. Android only. - _path_ - the path on the device - _data_ - data to be written to the file - _encode_ - True/False encode the data as base64 before writing it to the file (default...
python
def push_file(self, path, data, encode=False): """Puts the data in the file specified as `path`. Android only. - _path_ - the path on the device - _data_ - data to be written to the file - _encode_ - True/False encode the data as base64 before writing it to the file (default...
[ "def", "push_file", "(", "self", ",", "path", ",", "data", ",", "encode", "=", "False", ")", ":", "driver", "=", "self", ".", "_current_application", "(", ")", "data", "=", "to_bytes", "(", "data", ")", "if", "encode", ":", "data", "=", "base64", "."...
Puts the data in the file specified as `path`. Android only. - _path_ - the path on the device - _data_ - data to be written to the file - _encode_ - True/False encode the data as base64 before writing it to the file (default=False)
[ "Puts", "the", "data", "in", "the", "file", "specified", "as", "path", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_android_utils.py#L65-L78
231,547
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_android_utils.py
_AndroidUtilsKeywords.start_activity
def start_activity(self, appPackage, appActivity, **opts): """Opens an arbitrary activity during a test. If the activity belongs to another application, that application is started and the activity is opened. Android only. - _appPackage_ - The package containing the activity to start. ...
python
def start_activity(self, appPackage, appActivity, **opts): """Opens an arbitrary activity during a test. If the activity belongs to another application, that application is started and the activity is opened. Android only. - _appPackage_ - The package containing the activity to start. ...
[ "def", "start_activity", "(", "self", ",", "appPackage", ",", "appActivity", ",", "*", "*", "opts", ")", ":", "# Almost the same code as in appium's start activity,", "# just to keep the same keyword names as in open application", "arguments", "=", "{", "'app_wait_package'", ...
Opens an arbitrary activity during a test. If the activity belongs to another application, that application is started and the activity is opened. Android only. - _appPackage_ - The package containing the activity to start. - _appActivity_ - The activity to start. - _appWaitPac...
[ "Opens", "an", "arbitrary", "activity", "during", "a", "test", ".", "If", "the", "activity", "belongs", "to", "another", "application", "that", "application", "is", "started", "and", "the", "activity", "is", "opened", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_android_utils.py#L89-L128
231,548
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_android_utils.py
_AndroidUtilsKeywords.install_app
def install_app(self, app_path, app_package): """ Install App via Appium Android only. - app_path - path to app - app_package - package of install app to verify """ driver = self._current_application() driver.install_app(app_path) return driver.i...
python
def install_app(self, app_path, app_package): """ Install App via Appium Android only. - app_path - path to app - app_package - package of install app to verify """ driver = self._current_application() driver.install_app(app_path) return driver.i...
[ "def", "install_app", "(", "self", ",", "app_path", ",", "app_package", ")", ":", "driver", "=", "self", ".", "_current_application", "(", ")", "driver", ".", "install_app", "(", "app_path", ")", "return", "driver", ".", "is_app_installed", "(", "app_package",...
Install App via Appium Android only. - app_path - path to app - app_package - package of install app to verify
[ "Install", "App", "via", "Appium", "Android", "only", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_android_utils.py#L148-L158
231,549
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.click_element
def click_element(self, locator): """Click element identified by `locator`. Key attributes for arbitrary elements are `index` and `name`. See `introduction` for details about locating elements. """ self._info("Clicking element '%s'." % locator) self._element_find(...
python
def click_element(self, locator): """Click element identified by `locator`. Key attributes for arbitrary elements are `index` and `name`. See `introduction` for details about locating elements. """ self._info("Clicking element '%s'." % locator) self._element_find(...
[ "def", "click_element", "(", "self", ",", "locator", ")", ":", "self", ".", "_info", "(", "\"Clicking element '%s'.\"", "%", "locator", ")", "self", ".", "_element_find", "(", "locator", ",", "True", ",", "True", ")", ".", "click", "(", ")" ]
Click element identified by `locator`. Key attributes for arbitrary elements are `index` and `name`. See `introduction` for details about locating elements.
[ "Click", "element", "identified", "by", "locator", ".", "Key", "attributes", "for", "arbitrary", "elements", "are", "index", "and", "name", ".", "See", "introduction", "for", "details", "about", "locating", "elements", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L35-L42
231,550
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.click_text
def click_text(self, text, exact_match=False): """Click text identified by ``text``. By default tries to click first text involves given ``text``, if you would like to click exactly matching text, then set ``exact_match`` to `True`. If there are multiple use of ``text`` and you ...
python
def click_text(self, text, exact_match=False): """Click text identified by ``text``. By default tries to click first text involves given ``text``, if you would like to click exactly matching text, then set ``exact_match`` to `True`. If there are multiple use of ``text`` and you ...
[ "def", "click_text", "(", "self", ",", "text", ",", "exact_match", "=", "False", ")", ":", "self", ".", "_element_find_by_text", "(", "text", ",", "exact_match", ")", ".", "click", "(", ")" ]
Click text identified by ``text``. By default tries to click first text involves given ``text``, if you would like to click exactly matching text, then set ``exact_match`` to `True`. If there are multiple use of ``text`` and you do not want first one, use `locator` with `Get Web...
[ "Click", "text", "identified", "by", "text", ".", "By", "default", "tries", "to", "click", "first", "text", "involves", "given", "text", "if", "you", "would", "like", "to", "click", "exactly", "matching", "text", "then", "set", "exact_match", "to", "True", ...
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L52-L62
231,551
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.input_text
def input_text(self, locator, text): """Types the given `text` into text field identified by `locator`. See `introduction` for details about locating elements. """ self._info("Typing text '%s' into text field '%s'" % (text, locator)) self._element_input_text_by_locator(loc...
python
def input_text(self, locator, text): """Types the given `text` into text field identified by `locator`. See `introduction` for details about locating elements. """ self._info("Typing text '%s' into text field '%s'" % (text, locator)) self._element_input_text_by_locator(loc...
[ "def", "input_text", "(", "self", ",", "locator", ",", "text", ")", ":", "self", ".", "_info", "(", "\"Typing text '%s' into text field '%s'\"", "%", "(", "text", ",", "locator", ")", ")", "self", ".", "_element_input_text_by_locator", "(", "locator", ",", "te...
Types the given `text` into text field identified by `locator`. See `introduction` for details about locating elements.
[ "Types", "the", "given", "text", "into", "text", "field", "identified", "by", "locator", ".", "See", "introduction", "for", "details", "about", "locating", "elements", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L64-L70
231,552
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.input_password
def input_password(self, locator, text): """Types the given password into text field identified by `locator`. Difference between this keyword and `Input Text` is that this keyword does not log the given password. See `introduction` for details about locating elements. """ ...
python
def input_password(self, locator, text): """Types the given password into text field identified by `locator`. Difference between this keyword and `Input Text` is that this keyword does not log the given password. See `introduction` for details about locating elements. """ ...
[ "def", "input_password", "(", "self", ",", "locator", ",", "text", ")", ":", "self", ".", "_info", "(", "\"Typing password into text field '%s'\"", "%", "locator", ")", "self", ".", "_element_input_text_by_locator", "(", "locator", ",", "text", ")" ]
Types the given password into text field identified by `locator`. Difference between this keyword and `Input Text` is that this keyword does not log the given password. See `introduction` for details about locating elements.
[ "Types", "the", "given", "password", "into", "text", "field", "identified", "by", "locator", ".", "Difference", "between", "this", "keyword", "and", "Input", "Text", "is", "that", "this", "keyword", "does", "not", "log", "the", "given", "password", ".", "See...
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L72-L80
231,553
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.input_value
def input_value(self, locator, text): """Sets the given value into text field identified by `locator`. This is an IOS only keyword, input value makes use of set_value See `introduction` for details about locating elements. """ self._info("Setting text '%s' into text field '%s'" % (...
python
def input_value(self, locator, text): """Sets the given value into text field identified by `locator`. This is an IOS only keyword, input value makes use of set_value See `introduction` for details about locating elements. """ self._info("Setting text '%s' into text field '%s'" % (...
[ "def", "input_value", "(", "self", ",", "locator", ",", "text", ")", ":", "self", ".", "_info", "(", "\"Setting text '%s' into text field '%s'\"", "%", "(", "text", ",", "locator", ")", ")", "self", ".", "_element_input_value_by_locator", "(", "locator", ",", ...
Sets the given value into text field identified by `locator`. This is an IOS only keyword, input value makes use of set_value See `introduction` for details about locating elements.
[ "Sets", "the", "given", "value", "into", "text", "field", "identified", "by", "locator", ".", "This", "is", "an", "IOS", "only", "keyword", "input", "value", "makes", "use", "of", "set_value", "See", "introduction", "for", "details", "about", "locating", "el...
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L82-L88
231,554
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.page_should_contain_text
def page_should_contain_text(self, text, loglevel='INFO'): """Verifies that current page contains `text`. If this keyword fails, it automatically logs the page source using the log level specified with the optional `loglevel` argument. Giving `NONE` as level disables logging. ...
python
def page_should_contain_text(self, text, loglevel='INFO'): """Verifies that current page contains `text`. If this keyword fails, it automatically logs the page source using the log level specified with the optional `loglevel` argument. Giving `NONE` as level disables logging. ...
[ "def", "page_should_contain_text", "(", "self", ",", "text", ",", "loglevel", "=", "'INFO'", ")", ":", "if", "not", "self", ".", "_is_text_present", "(", "text", ")", ":", "self", ".", "log_source", "(", "loglevel", ")", "raise", "AssertionError", "(", "\"...
Verifies that current page contains `text`. If this keyword fails, it automatically logs the page source using the log level specified with the optional `loglevel` argument. Giving `NONE` as level disables logging.
[ "Verifies", "that", "current", "page", "contains", "text", ".", "If", "this", "keyword", "fails", "it", "automatically", "logs", "the", "page", "source", "using", "the", "log", "level", "specified", "with", "the", "optional", "loglevel", "argument", ".", "Givi...
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L97-L108
231,555
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.page_should_not_contain_text
def page_should_not_contain_text(self, text, loglevel='INFO'): """Verifies that current page not contains `text`. If this keyword fails, it automatically logs the page source using the log level specified with the optional `loglevel` argument. Giving `NONE` as level disables loggin...
python
def page_should_not_contain_text(self, text, loglevel='INFO'): """Verifies that current page not contains `text`. If this keyword fails, it automatically logs the page source using the log level specified with the optional `loglevel` argument. Giving `NONE` as level disables loggin...
[ "def", "page_should_not_contain_text", "(", "self", ",", "text", ",", "loglevel", "=", "'INFO'", ")", ":", "if", "self", ".", "_is_text_present", "(", "text", ")", ":", "self", ".", "log_source", "(", "loglevel", ")", "raise", "AssertionError", "(", "\"Page ...
Verifies that current page not contains `text`. If this keyword fails, it automatically logs the page source using the log level specified with the optional `loglevel` argument. Giving `NONE` as level disables logging.
[ "Verifies", "that", "current", "page", "not", "contains", "text", ".", "If", "this", "keyword", "fails", "it", "automatically", "logs", "the", "page", "source", "using", "the", "log", "level", "specified", "with", "the", "optional", "loglevel", "argument", "."...
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L110-L120
231,556
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.page_should_contain_element
def page_should_contain_element(self, locator, loglevel='INFO'): """Verifies that current page contains `locator` element. If this keyword fails, it automatically logs the page source using the log level specified with the optional `loglevel` argument. Giving `NONE` as level disabl...
python
def page_should_contain_element(self, locator, loglevel='INFO'): """Verifies that current page contains `locator` element. If this keyword fails, it automatically logs the page source using the log level specified with the optional `loglevel` argument. Giving `NONE` as level disabl...
[ "def", "page_should_contain_element", "(", "self", ",", "locator", ",", "loglevel", "=", "'INFO'", ")", ":", "if", "not", "self", ".", "_is_element_present", "(", "locator", ")", ":", "self", ".", "log_source", "(", "loglevel", ")", "raise", "AssertionError", ...
Verifies that current page contains `locator` element. If this keyword fails, it automatically logs the page source using the log level specified with the optional `loglevel` argument. Giving `NONE` as level disables logging.
[ "Verifies", "that", "current", "page", "contains", "locator", "element", ".", "If", "this", "keyword", "fails", "it", "automatically", "logs", "the", "page", "source", "using", "the", "log", "level", "specified", "with", "the", "optional", "loglevel", "argument"...
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L122-L133
231,557
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.page_should_not_contain_element
def page_should_not_contain_element(self, locator, loglevel='INFO'): """Verifies that current page not contains `locator` element. If this keyword fails, it automatically logs the page source using the log level specified with the optional `loglevel` argument. Giving `NONE` as leve...
python
def page_should_not_contain_element(self, locator, loglevel='INFO'): """Verifies that current page not contains `locator` element. If this keyword fails, it automatically logs the page source using the log level specified with the optional `loglevel` argument. Giving `NONE` as leve...
[ "def", "page_should_not_contain_element", "(", "self", ",", "locator", ",", "loglevel", "=", "'INFO'", ")", ":", "if", "self", ".", "_is_element_present", "(", "locator", ")", ":", "self", ".", "log_source", "(", "loglevel", ")", "raise", "AssertionError", "("...
Verifies that current page not contains `locator` element. If this keyword fails, it automatically logs the page source using the log level specified with the optional `loglevel` argument. Giving `NONE` as level disables logging.
[ "Verifies", "that", "current", "page", "not", "contains", "locator", "element", ".", "If", "this", "keyword", "fails", "it", "automatically", "logs", "the", "page", "source", "using", "the", "log", "level", "specified", "with", "the", "optional", "loglevel", "...
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L135-L145
231,558
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.element_should_be_disabled
def element_should_be_disabled(self, locator, loglevel='INFO'): """Verifies that element identified with locator is disabled. Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements. """ if self._element_find(locato...
python
def element_should_be_disabled(self, locator, loglevel='INFO'): """Verifies that element identified with locator is disabled. Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements. """ if self._element_find(locato...
[ "def", "element_should_be_disabled", "(", "self", ",", "locator", ",", "loglevel", "=", "'INFO'", ")", ":", "if", "self", ".", "_element_find", "(", "locator", ",", "True", ",", "True", ")", ".", "is_enabled", "(", ")", ":", "self", ".", "log_source", "(...
Verifies that element identified with locator is disabled. Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements.
[ "Verifies", "that", "element", "identified", "with", "locator", "is", "disabled", ".", "Key", "attributes", "for", "arbitrary", "elements", "are", "id", "and", "name", ".", "See", "introduction", "for", "details", "about", "locating", "elements", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L147-L157
231,559
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.element_should_be_visible
def element_should_be_visible(self, locator, loglevel='INFO'): """Verifies that element identified with locator is visible. Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements. New in AppiumLibrary 1.4....
python
def element_should_be_visible(self, locator, loglevel='INFO'): """Verifies that element identified with locator is visible. Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements. New in AppiumLibrary 1.4....
[ "def", "element_should_be_visible", "(", "self", ",", "locator", ",", "loglevel", "=", "'INFO'", ")", ":", "if", "not", "self", ".", "_element_find", "(", "locator", ",", "True", ",", "True", ")", ".", "is_displayed", "(", ")", ":", "self", ".", "log_sou...
Verifies that element identified with locator is visible. Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements. New in AppiumLibrary 1.4.5
[ "Verifies", "that", "element", "identified", "with", "locator", "is", "visible", ".", "Key", "attributes", "for", "arbitrary", "elements", "are", "id", "and", "name", ".", "See", "introduction", "for", "details", "about", "locating", "elements", ".", "New", "i...
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L171-L182
231,560
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.element_text_should_be
def element_text_should_be(self, locator, expected, message=''): """Verifies element identified by ``locator`` exactly contains text ``expected``. In contrast to `Element Should Contain Text`, this keyword does not try a substring match but an exact match on the element identified by ``loca...
python
def element_text_should_be(self, locator, expected, message=''): """Verifies element identified by ``locator`` exactly contains text ``expected``. In contrast to `Element Should Contain Text`, this keyword does not try a substring match but an exact match on the element identified by ``loca...
[ "def", "element_text_should_be", "(", "self", ",", "locator", ",", "expected", ",", "message", "=", "''", ")", ":", "self", ".", "_info", "(", "\"Verifying element '%s' contains exactly text '%s'.\"", "%", "(", "locator", ",", "expected", ")", ")", "element", "=...
Verifies element identified by ``locator`` exactly contains text ``expected``. In contrast to `Element Should Contain Text`, this keyword does not try a substring match but an exact match on the element identified by ``locator``. ``message`` can be used to override the default error messa...
[ "Verifies", "element", "identified", "by", "locator", "exactly", "contains", "text", "expected", ".", "In", "contrast", "to", "Element", "Should", "Contain", "Text", "this", "keyword", "does", "not", "try", "a", "substring", "match", "but", "an", "exact", "mat...
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L312-L330
231,561
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.get_element_location
def get_element_location(self, locator): """Get element location Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements. """ element = self._element_find(locator, True, True) element_location = element.loc...
python
def get_element_location(self, locator): """Get element location Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements. """ element = self._element_find(locator, True, True) element_location = element.loc...
[ "def", "get_element_location", "(", "self", ",", "locator", ")", ":", "element", "=", "self", ".", "_element_find", "(", "locator", ",", "True", ",", "True", ")", "element_location", "=", "element", ".", "location", "self", ".", "_info", "(", "\"Element '%s'...
Get element location Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements.
[ "Get", "element", "location", "Key", "attributes", "for", "arbitrary", "elements", "are", "id", "and", "name", ".", "See", "introduction", "for", "details", "about", "locating", "elements", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L380-L389
231,562
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.get_element_size
def get_element_size(self, locator): """Get element size Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements. """ element = self._element_find(locator, True, True) element_size = element.size s...
python
def get_element_size(self, locator): """Get element size Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements. """ element = self._element_find(locator, True, True) element_size = element.size s...
[ "def", "get_element_size", "(", "self", ",", "locator", ")", ":", "element", "=", "self", ".", "_element_find", "(", "locator", ",", "True", ",", "True", ")", "element_size", "=", "element", ".", "size", "self", ".", "_info", "(", "\"Element '%s' size: %s \"...
Get element size Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements.
[ "Get", "element", "size", "Key", "attributes", "for", "arbitrary", "elements", "are", "id", "and", "name", ".", "See", "introduction", "for", "details", "about", "locating", "elements", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L391-L400
231,563
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_element.py
_ElementKeywords.text_should_be_visible
def text_should_be_visible(self, text, exact_match=False, loglevel='INFO'): """Verifies that element identified with text is visible. New in AppiumLibrary 1.4.5 """ if not self._element_find_by_text(text, exact_match).is_displayed(): self.log_source(loglevel) ...
python
def text_should_be_visible(self, text, exact_match=False, loglevel='INFO'): """Verifies that element identified with text is visible. New in AppiumLibrary 1.4.5 """ if not self._element_find_by_text(text, exact_match).is_displayed(): self.log_source(loglevel) ...
[ "def", "text_should_be_visible", "(", "self", ",", "text", ",", "exact_match", "=", "False", ",", "loglevel", "=", "'INFO'", ")", ":", "if", "not", "self", ".", "_element_find_by_text", "(", "text", ",", "exact_match", ")", ".", "is_displayed", "(", ")", "...
Verifies that element identified with text is visible. New in AppiumLibrary 1.4.5
[ "Verifies", "that", "element", "identified", "with", "text", "is", "visible", ".", "New", "in", "AppiumLibrary", "1", ".", "4", ".", "5" ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_element.py#L433-L441
231,564
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_applicationmanagement.py
_ApplicationManagementKeywords.close_application
def close_application(self): """Closes the current application and also close webdriver session.""" self._debug('Closing application with session id %s' % self._current_application().session_id) self._cache.close()
python
def close_application(self): """Closes the current application and also close webdriver session.""" self._debug('Closing application with session id %s' % self._current_application().session_id) self._cache.close()
[ "def", "close_application", "(", "self", ")", ":", "self", ".", "_debug", "(", "'Closing application with session id %s'", "%", "self", ".", "_current_application", "(", ")", ".", "session_id", ")", "self", ".", "_cache", ".", "close", "(", ")" ]
Closes the current application and also close webdriver session.
[ "Closes", "the", "current", "application", "and", "also", "close", "webdriver", "session", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_applicationmanagement.py#L20-L23
231,565
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_applicationmanagement.py
_ApplicationManagementKeywords.get_appium_sessionId
def get_appium_sessionId(self): """Returns the current session ID as a reference""" self._info("Appium Session ID: " + self._current_application().session_id) return self._current_application().session_id
python
def get_appium_sessionId(self): """Returns the current session ID as a reference""" self._info("Appium Session ID: " + self._current_application().session_id) return self._current_application().session_id
[ "def", "get_appium_sessionId", "(", "self", ")", ":", "self", ".", "_info", "(", "\"Appium Session ID: \"", "+", "self", ".", "_current_application", "(", ")", ".", "session_id", ")", "return", "self", ".", "_current_application", "(", ")", ".", "session_id" ]
Returns the current session ID as a reference
[ "Returns", "the", "current", "session", "ID", "as", "a", "reference" ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_applicationmanagement.py#L163-L166
231,566
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_applicationmanagement.py
_ApplicationManagementKeywords.lock
def lock(self, seconds=5): """ Lock the device for a certain period of time. iOS only. """ self._current_application().lock(robot.utils.timestr_to_secs(seconds))
python
def lock(self, seconds=5): """ Lock the device for a certain period of time. iOS only. """ self._current_application().lock(robot.utils.timestr_to_secs(seconds))
[ "def", "lock", "(", "self", ",", "seconds", "=", "5", ")", ":", "self", ".", "_current_application", "(", ")", ".", "lock", "(", "robot", ".", "utils", ".", "timestr_to_secs", "(", "seconds", ")", ")" ]
Lock the device for a certain period of time. iOS only.
[ "Lock", "the", "device", "for", "a", "certain", "period", "of", "time", ".", "iOS", "only", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_applicationmanagement.py#L221-L225
231,567
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_applicationmanagement.py
_ApplicationManagementKeywords.get_capability
def get_capability(self, capability_name): """ Return the desired capability value by desired capability name """ try: capability = self._current_application().capabilities[capability_name] except Exception as e: raise e return capability
python
def get_capability(self, capability_name): """ Return the desired capability value by desired capability name """ try: capability = self._current_application().capabilities[capability_name] except Exception as e: raise e return capability
[ "def", "get_capability", "(", "self", ",", "capability_name", ")", ":", "try", ":", "capability", "=", "self", ".", "_current_application", "(", ")", ".", "capabilities", "[", "capability_name", "]", "except", "Exception", "as", "e", ":", "raise", "e", "retu...
Return the desired capability value by desired capability name
[ "Return", "the", "desired", "capability", "value", "by", "desired", "capability", "name" ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_applicationmanagement.py#L317-L325
231,568
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/locators/elementfinder.py
ElementFinder._find_by_android
def _find_by_android(self, browser, criteria, tag, constraints): """Find element matches by UI Automator.""" return self._filter_elements( browser.find_elements_by_android_uiautomator(criteria), tag, constraints)
python
def _find_by_android(self, browser, criteria, tag, constraints): """Find element matches by UI Automator.""" return self._filter_elements( browser.find_elements_by_android_uiautomator(criteria), tag, constraints)
[ "def", "_find_by_android", "(", "self", ",", "browser", ",", "criteria", ",", "tag", ",", "constraints", ")", ":", "return", "self", ".", "_filter_elements", "(", "browser", ".", "find_elements_by_android_uiautomator", "(", "criteria", ")", ",", "tag", ",", "c...
Find element matches by UI Automator.
[ "Find", "element", "matches", "by", "UI", "Automator", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/locators/elementfinder.py#L98-L102
231,569
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/locators/elementfinder.py
ElementFinder._find_by_ios
def _find_by_ios(self, browser, criteria, tag, constraints): """Find element matches by UI Automation.""" return self._filter_elements( browser.find_elements_by_ios_uiautomation(criteria), tag, constraints)
python
def _find_by_ios(self, browser, criteria, tag, constraints): """Find element matches by UI Automation.""" return self._filter_elements( browser.find_elements_by_ios_uiautomation(criteria), tag, constraints)
[ "def", "_find_by_ios", "(", "self", ",", "browser", ",", "criteria", ",", "tag", ",", "constraints", ")", ":", "return", "self", ".", "_filter_elements", "(", "browser", ".", "find_elements_by_ios_uiautomation", "(", "criteria", ")", ",", "tag", ",", "constrai...
Find element matches by UI Automation.
[ "Find", "element", "matches", "by", "UI", "Automation", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/locators/elementfinder.py#L104-L108
231,570
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/locators/elementfinder.py
ElementFinder._find_by_nsp
def _find_by_nsp(self, browser, criteria, tag, constraints): """Find element matches by iOSNsPredicateString.""" return self._filter_elements( browser.find_elements_by_ios_predicate(criteria), tag, constraints)
python
def _find_by_nsp(self, browser, criteria, tag, constraints): """Find element matches by iOSNsPredicateString.""" return self._filter_elements( browser.find_elements_by_ios_predicate(criteria), tag, constraints)
[ "def", "_find_by_nsp", "(", "self", ",", "browser", ",", "criteria", ",", "tag", ",", "constraints", ")", ":", "return", "self", ".", "_filter_elements", "(", "browser", ".", "find_elements_by_ios_predicate", "(", "criteria", ")", ",", "tag", ",", "constraints...
Find element matches by iOSNsPredicateString.
[ "Find", "element", "matches", "by", "iOSNsPredicateString", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/locators/elementfinder.py#L110-L114
231,571
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/locators/elementfinder.py
ElementFinder._find_by_chain
def _find_by_chain(self, browser, criteria, tag, constraints): """Find element matches by iOSChainString.""" return self._filter_elements( browser.find_elements_by_ios_class_chain(criteria), tag, constraints)
python
def _find_by_chain(self, browser, criteria, tag, constraints): """Find element matches by iOSChainString.""" return self._filter_elements( browser.find_elements_by_ios_class_chain(criteria), tag, constraints)
[ "def", "_find_by_chain", "(", "self", ",", "browser", ",", "criteria", ",", "tag", ",", "constraints", ")", ":", "return", "self", ".", "_filter_elements", "(", "browser", ".", "find_elements_by_ios_class_chain", "(", "criteria", ")", ",", "tag", ",", "constra...
Find element matches by iOSChainString.
[ "Find", "element", "matches", "by", "iOSChainString", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/locators/elementfinder.py#L116-L120
231,572
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_keyevent.py
_KeyeventKeywords.press_keycode
def press_keycode(self, keycode, metastate=None): """Sends a press of keycode to the device. Android only. Possible keycodes & meta states can be found in http://developer.android.com/reference/android/view/KeyEvent.html Meta state describe the pressed state of key modifiers s...
python
def press_keycode(self, keycode, metastate=None): """Sends a press of keycode to the device. Android only. Possible keycodes & meta states can be found in http://developer.android.com/reference/android/view/KeyEvent.html Meta state describe the pressed state of key modifiers s...
[ "def", "press_keycode", "(", "self", ",", "keycode", ",", "metastate", "=", "None", ")", ":", "driver", "=", "self", ".", "_current_application", "(", ")", "driver", ".", "press_keycode", "(", "keycode", ",", "metastate", ")" ]
Sends a press of keycode to the device. Android only. Possible keycodes & meta states can be found in http://developer.android.com/reference/android/view/KeyEvent.html Meta state describe the pressed state of key modifiers such as Shift, Ctrl & Alt keys. The Meta State is an i...
[ "Sends", "a", "press", "of", "keycode", "to", "the", "device", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_keyevent.py#L9-L33
231,573
serhatbolsu/robotframework-appiumlibrary
AppiumLibrary/keywords/_keyevent.py
_KeyeventKeywords.long_press_keycode
def long_press_keycode(self, keycode, metastate=None): """Sends a long press of keycode to the device. Android only. See `press keycode` for more details. """ driver = self._current_application() driver.long_press_keycode(int(keycode), metastate)
python
def long_press_keycode(self, keycode, metastate=None): """Sends a long press of keycode to the device. Android only. See `press keycode` for more details. """ driver = self._current_application() driver.long_press_keycode(int(keycode), metastate)
[ "def", "long_press_keycode", "(", "self", ",", "keycode", ",", "metastate", "=", "None", ")", ":", "driver", "=", "self", ".", "_current_application", "(", ")", "driver", ".", "long_press_keycode", "(", "int", "(", "keycode", ")", ",", "metastate", ")" ]
Sends a long press of keycode to the device. Android only. See `press keycode` for more details.
[ "Sends", "a", "long", "press", "of", "keycode", "to", "the", "device", "." ]
91c808cf0602af6be8135ac529fa488fded04a85
https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/91c808cf0602af6be8135ac529fa488fded04a85/AppiumLibrary/keywords/_keyevent.py#L35-L43
231,574
amanusk/s-tui
s_tui/sources/rapl_read.py
rapl_read
def rapl_read(): """ Read power stats and return dictionary""" basenames = glob.glob('/sys/class/powercap/intel-rapl:*/') basenames = sorted(set({x for x in basenames})) pjoin = os.path.join ret = list() for path in basenames: name = None try: name = cat(pjoin(path, ...
python
def rapl_read(): """ Read power stats and return dictionary""" basenames = glob.glob('/sys/class/powercap/intel-rapl:*/') basenames = sorted(set({x for x in basenames})) pjoin = os.path.join ret = list() for path in basenames: name = None try: name = cat(pjoin(path, ...
[ "def", "rapl_read", "(", ")", ":", "basenames", "=", "glob", ".", "glob", "(", "'/sys/class/powercap/intel-rapl:*/'", ")", "basenames", "=", "sorted", "(", "set", "(", "{", "x", "for", "x", "in", "basenames", "}", ")", ")", "pjoin", "=", "os", ".", "pa...
Read power stats and return dictionary
[ "Read", "power", "stats", "and", "return", "dictionary" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/sources/rapl_read.py#L35-L58
231,575
amanusk/s-tui
s_tui/sturwid/complex_bar_graph.py
ScalableBarGraph.calculate_bar_widths
def calculate_bar_widths(self, size, bardata): """ Return a list of bar widths, one for each bar in data. If self.bar_width is None this implementation will stretch the bars across the available space specified by maxcol. """ (maxcol, _) = size if self.bar_width...
python
def calculate_bar_widths(self, size, bardata): """ Return a list of bar widths, one for each bar in data. If self.bar_width is None this implementation will stretch the bars across the available space specified by maxcol. """ (maxcol, _) = size if self.bar_width...
[ "def", "calculate_bar_widths", "(", "self", ",", "size", ",", "bardata", ")", ":", "(", "maxcol", ",", "_", ")", "=", "size", "if", "self", ".", "bar_width", "is", "not", "None", ":", "return", "[", "self", ".", "bar_width", "]", "*", "min", "(", "...
Return a list of bar widths, one for each bar in data. If self.bar_width is None this implementation will stretch the bars across the available space specified by maxcol.
[ "Return", "a", "list", "of", "bar", "widths", "one", "for", "each", "bar", "in", "data", "." ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/sturwid/complex_bar_graph.py#L43-L67
231,576
amanusk/s-tui
s_tui/sturwid/complex_bar_graph.py
LabeledBarGraphVector.set_visible_graphs
def set_visible_graphs(self, visible_graph_list=None): """Show a column of the graph selected for display""" if visible_graph_list is None: visible_graph_list = self.visible_graph_list vline = urwid.AttrWrap(urwid.SolidFill(u'|'), 'line') graph_vector_column_list = [] ...
python
def set_visible_graphs(self, visible_graph_list=None): """Show a column of the graph selected for display""" if visible_graph_list is None: visible_graph_list = self.visible_graph_list vline = urwid.AttrWrap(urwid.SolidFill(u'|'), 'line') graph_vector_column_list = [] ...
[ "def", "set_visible_graphs", "(", "self", ",", "visible_graph_list", "=", "None", ")", ":", "if", "visible_graph_list", "is", "None", ":", "visible_graph_list", "=", "self", ".", "visible_graph_list", "vline", "=", "urwid", ".", "AttrWrap", "(", "urwid", ".", ...
Show a column of the graph selected for display
[ "Show", "a", "column", "of", "the", "graph", "selected", "for", "display" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/sturwid/complex_bar_graph.py#L135-L174
231,577
amanusk/s-tui
s_tui/helper_functions.py
get_processor_name
def get_processor_name(): """ Returns the processor name in the system """ if platform.system() == "Linux": with open("/proc/cpuinfo", "rb") as cpuinfo: all_info = cpuinfo.readlines() for line in all_info: if b'model name' in line: return re.su...
python
def get_processor_name(): """ Returns the processor name in the system """ if platform.system() == "Linux": with open("/proc/cpuinfo", "rb") as cpuinfo: all_info = cpuinfo.readlines() for line in all_info: if b'model name' in line: return re.su...
[ "def", "get_processor_name", "(", ")", ":", "if", "platform", ".", "system", "(", ")", "==", "\"Linux\"", ":", "with", "open", "(", "\"/proc/cpuinfo\"", ",", "\"rb\"", ")", "as", "cpuinfo", ":", "all_info", "=", "cpuinfo", ".", "readlines", "(", ")", "fo...
Returns the processor name in the system
[ "Returns", "the", "processor", "name", "in", "the", "system" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/helper_functions.py#L47-L56
231,578
amanusk/s-tui
s_tui/helper_functions.py
kill_child_processes
def kill_child_processes(parent_proc): """ Kills a process and all its children """ logging.debug("Killing stress process") try: for proc in parent_proc.children(recursive=True): logging.debug('Killing %s', proc) proc.kill() parent_proc.kill() except AttributeErro...
python
def kill_child_processes(parent_proc): """ Kills a process and all its children """ logging.debug("Killing stress process") try: for proc in parent_proc.children(recursive=True): logging.debug('Killing %s', proc) proc.kill() parent_proc.kill() except AttributeErro...
[ "def", "kill_child_processes", "(", "parent_proc", ")", ":", "logging", ".", "debug", "(", "\"Killing stress process\"", ")", "try", ":", "for", "proc", "in", "parent_proc", ".", "children", "(", "recursive", "=", "True", ")", ":", "logging", ".", "debug", "...
Kills a process and all its children
[ "Kills", "a", "process", "and", "all", "its", "children" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/helper_functions.py#L59-L69
231,579
amanusk/s-tui
s_tui/helper_functions.py
output_to_csv
def output_to_csv(sources, csv_writeable_file): """Print statistics to csv file""" file_exists = os.path.isfile(csv_writeable_file) with open(csv_writeable_file, 'a') as csvfile: csv_dict = OrderedDict() csv_dict.update({'Time': time.strftime("%Y-%m-%d_%H:%M:%S")}) summaries = [val ...
python
def output_to_csv(sources, csv_writeable_file): """Print statistics to csv file""" file_exists = os.path.isfile(csv_writeable_file) with open(csv_writeable_file, 'a') as csvfile: csv_dict = OrderedDict() csv_dict.update({'Time': time.strftime("%Y-%m-%d_%H:%M:%S")}) summaries = [val ...
[ "def", "output_to_csv", "(", "sources", ",", "csv_writeable_file", ")", ":", "file_exists", "=", "os", ".", "path", ".", "isfile", "(", "csv_writeable_file", ")", "with", "open", "(", "csv_writeable_file", ",", "'a'", ")", "as", "csvfile", ":", "csv_dict", "...
Print statistics to csv file
[ "Print", "statistics", "to", "csv", "file" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/helper_functions.py#L72-L88
231,580
amanusk/s-tui
s_tui/helper_functions.py
output_to_terminal
def output_to_terminal(sources): """Print statistics to the terminal""" results = OrderedDict() for source in sources: if source.get_is_available(): source.update() results.update(source.get_summary()) for key, value in results.items(): sys.stdout.write(str(key) +...
python
def output_to_terminal(sources): """Print statistics to the terminal""" results = OrderedDict() for source in sources: if source.get_is_available(): source.update() results.update(source.get_summary()) for key, value in results.items(): sys.stdout.write(str(key) +...
[ "def", "output_to_terminal", "(", "sources", ")", ":", "results", "=", "OrderedDict", "(", ")", "for", "source", "in", "sources", ":", "if", "source", ".", "get_is_available", "(", ")", ":", "source", ".", "update", "(", ")", "results", ".", "update", "(...
Print statistics to the terminal
[ "Print", "statistics", "to", "the", "terminal" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/helper_functions.py#L91-L101
231,581
amanusk/s-tui
s_tui/helper_functions.py
output_to_json
def output_to_json(sources): """Print statistics to the terminal in Json format""" results = OrderedDict() for source in sources: if source.get_is_available(): source.update() source_name = source.get_source_name() results[source_name] = source.get_sensors_summary...
python
def output_to_json(sources): """Print statistics to the terminal in Json format""" results = OrderedDict() for source in sources: if source.get_is_available(): source.update() source_name = source.get_source_name() results[source_name] = source.get_sensors_summary...
[ "def", "output_to_json", "(", "sources", ")", ":", "results", "=", "OrderedDict", "(", ")", "for", "source", "in", "sources", ":", "if", "source", ".", "get_is_available", "(", ")", ":", "source", ".", "update", "(", ")", "source_name", "=", "source", "....
Print statistics to the terminal in Json format
[ "Print", "statistics", "to", "the", "terminal", "in", "Json", "format" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/helper_functions.py#L104-L113
231,582
amanusk/s-tui
s_tui/helper_functions.py
make_user_config_dir
def make_user_config_dir(): """ Create the user s-tui config directory if it doesn't exist """ config_path = get_user_config_dir() if not user_config_dir_exists(): try: os.mkdir(config_path) os.mkdir(os.path.join(config_path, 'hooks.d')) except OSError: ...
python
def make_user_config_dir(): """ Create the user s-tui config directory if it doesn't exist """ config_path = get_user_config_dir() if not user_config_dir_exists(): try: os.mkdir(config_path) os.mkdir(os.path.join(config_path, 'hooks.d')) except OSError: ...
[ "def", "make_user_config_dir", "(", ")", ":", "config_path", "=", "get_user_config_dir", "(", ")", "if", "not", "user_config_dir_exists", "(", ")", ":", "try", ":", "os", ".", "mkdir", "(", "config_path", ")", "os", ".", "mkdir", "(", "os", ".", "path", ...
Create the user s-tui config directory if it doesn't exist
[ "Create", "the", "user", "s", "-", "tui", "config", "directory", "if", "it", "doesn", "t", "exist" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/helper_functions.py#L157-L170
231,583
amanusk/s-tui
s_tui/sources/script_hook_loader.py
ScriptHookLoader.load_script
def load_script(self, source_name, timeoutMilliseconds=0): """ Return ScriptHook for source_name Source and with a ready timeout of timeoutMilliseconds """ script_path = os.path.join(self.scripts_dir_path, self._source_to_script_name(source_nam...
python
def load_script(self, source_name, timeoutMilliseconds=0): """ Return ScriptHook for source_name Source and with a ready timeout of timeoutMilliseconds """ script_path = os.path.join(self.scripts_dir_path, self._source_to_script_name(source_nam...
[ "def", "load_script", "(", "self", ",", "source_name", ",", "timeoutMilliseconds", "=", "0", ")", ":", "script_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "scripts_dir_path", ",", "self", ".", "_source_to_script_name", "(", "source_name", "...
Return ScriptHook for source_name Source and with a ready timeout of timeoutMilliseconds
[ "Return", "ScriptHook", "for", "source_name", "Source", "and", "with", "a", "ready", "timeout", "of", "timeoutMilliseconds" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/sources/script_hook_loader.py#L31-L42
231,584
amanusk/s-tui
s_tui/sources/source.py
Source.get_sensors_summary
def get_sensors_summary(self): """ This returns a dict of sensor of the source and their values """ sub_title_list = self.get_sensor_list() graph_vector_summary = OrderedDict() for graph_idx, graph_data in enumerate(self.last_measurement): val_str = str(round(graph_data, 1))...
python
def get_sensors_summary(self): """ This returns a dict of sensor of the source and their values """ sub_title_list = self.get_sensor_list() graph_vector_summary = OrderedDict() for graph_idx, graph_data in enumerate(self.last_measurement): val_str = str(round(graph_data, 1))...
[ "def", "get_sensors_summary", "(", "self", ")", ":", "sub_title_list", "=", "self", ".", "get_sensor_list", "(", ")", "graph_vector_summary", "=", "OrderedDict", "(", ")", "for", "graph_idx", ",", "graph_data", "in", "enumerate", "(", "self", ".", "last_measurem...
This returns a dict of sensor of the source and their values
[ "This", "returns", "a", "dict", "of", "sensor", "of", "the", "source", "and", "their", "values" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/sources/source.py#L53-L62
231,585
amanusk/s-tui
s_tui/sources/source.py
Source.get_summary
def get_summary(self): """ Returns a dict of source name and sensors with their values """ graph_vector_summary = OrderedDict() graph_vector_summary[self.get_source_name()] = ( '[' + self.measurement_unit + ']') graph_vector_summary.update(self.get_sensors_summary()) ...
python
def get_summary(self): """ Returns a dict of source name and sensors with their values """ graph_vector_summary = OrderedDict() graph_vector_summary[self.get_source_name()] = ( '[' + self.measurement_unit + ']') graph_vector_summary.update(self.get_sensors_summary()) ...
[ "def", "get_summary", "(", "self", ")", ":", "graph_vector_summary", "=", "OrderedDict", "(", ")", "graph_vector_summary", "[", "self", ".", "get_source_name", "(", ")", "]", "=", "(", "'['", "+", "self", ".", "measurement_unit", "+", "']'", ")", "graph_vect...
Returns a dict of source name and sensors with their values
[ "Returns", "a", "dict", "of", "source", "name", "and", "sensors", "with", "their", "values" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/sources/source.py#L64-L70
231,586
amanusk/s-tui
s_tui/sources/source.py
Source.eval_hooks
def eval_hooks(self): """ Evaluate the current state of this Source and invoke any attached hooks if they've been triggered """ logging.debug("Evaluating hooks") if self.get_edge_triggered(): logging.debug("Hook triggered") for hook in [h for h in ...
python
def eval_hooks(self): """ Evaluate the current state of this Source and invoke any attached hooks if they've been triggered """ logging.debug("Evaluating hooks") if self.get_edge_triggered(): logging.debug("Hook triggered") for hook in [h for h in ...
[ "def", "eval_hooks", "(", "self", ")", ":", "logging", ".", "debug", "(", "\"Evaluating hooks\"", ")", "if", "self", ".", "get_edge_triggered", "(", ")", ":", "logging", ".", "debug", "(", "\"Hook triggered\"", ")", "for", "hook", "in", "[", "h", "for", ...
Evaluate the current state of this Source and invoke any attached hooks if they've been triggered
[ "Evaluate", "the", "current", "state", "of", "this", "Source", "and", "invoke", "any", "attached", "hooks", "if", "they", "ve", "been", "triggered" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/sources/source.py#L109-L119
231,587
amanusk/s-tui
s_tui/sources/hook.py
Hook.invoke
def invoke(self): """ Run callback, optionally passing a variable number of arguments `callback_args` """ # Don't sleep a hook if it has never run if self.timeout_milliseconds > 0: self.ready_time = ( datetime.now() + timedelta...
python
def invoke(self): """ Run callback, optionally passing a variable number of arguments `callback_args` """ # Don't sleep a hook if it has never run if self.timeout_milliseconds > 0: self.ready_time = ( datetime.now() + timedelta...
[ "def", "invoke", "(", "self", ")", ":", "# Don't sleep a hook if it has never run", "if", "self", ".", "timeout_milliseconds", ">", "0", ":", "self", ".", "ready_time", "=", "(", "datetime", ".", "now", "(", ")", "+", "timedelta", "(", "milliseconds", "=", "...
Run callback, optionally passing a variable number of arguments `callback_args`
[ "Run", "callback", "optionally", "passing", "a", "variable", "number", "of", "arguments", "callback_args" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/sources/hook.py#L42-L54
231,588
amanusk/s-tui
s_tui/sturwid/ui_elements.py
radio_button
def radio_button(g, l, fn): """ Inheriting radio button of urwid """ w = urwid.RadioButton(g, l, False, on_state_change=fn) w = urwid.AttrWrap(w, 'button normal', 'button select') return w
python
def radio_button(g, l, fn): """ Inheriting radio button of urwid """ w = urwid.RadioButton(g, l, False, on_state_change=fn) w = urwid.AttrWrap(w, 'button normal', 'button select') return w
[ "def", "radio_button", "(", "g", ",", "l", ",", "fn", ")", ":", "w", "=", "urwid", ".", "RadioButton", "(", "g", ",", "l", ",", "False", ",", "on_state_change", "=", "fn", ")", "w", "=", "urwid", ".", "AttrWrap", "(", "w", ",", "'button normal'", ...
Inheriting radio button of urwid
[ "Inheriting", "radio", "button", "of", "urwid" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/sturwid/ui_elements.py#L95-L99
231,589
amanusk/s-tui
s_tui/s_tui.py
StressController.start_stress
def start_stress(self, stress_cmd): """ Starts a new stress process with a given cmd """ with open(os.devnull, 'w') as dev_null: try: stress_proc = subprocess.Popen(stress_cmd, stdout=dev_null, stderr=dev_null) se...
python
def start_stress(self, stress_cmd): """ Starts a new stress process with a given cmd """ with open(os.devnull, 'w') as dev_null: try: stress_proc = subprocess.Popen(stress_cmd, stdout=dev_null, stderr=dev_null) se...
[ "def", "start_stress", "(", "self", ",", "stress_cmd", ")", ":", "with", "open", "(", "os", ".", "devnull", ",", "'w'", ")", "as", "dev_null", ":", "try", ":", "stress_proc", "=", "subprocess", ".", "Popen", "(", "stress_cmd", ",", "stdout", "=", "dev_...
Starts a new stress process with a given cmd
[ "Starts", "a", "new", "stress", "process", "with", "a", "given", "cmd" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/s_tui.py#L164-L172
231,590
amanusk/s-tui
s_tui/s_tui.py
GraphView.update_displayed_information
def update_displayed_information(self): """ Update all the graphs that are being displayed """ for source in self.controller.sources: source_name = source.get_source_name() if (any(self.graphs_menu.active_sensors[source_name]) or any(self.summary_menu.active_...
python
def update_displayed_information(self): """ Update all the graphs that are being displayed """ for source in self.controller.sources: source_name = source.get_source_name() if (any(self.graphs_menu.active_sensors[source_name]) or any(self.summary_menu.active_...
[ "def", "update_displayed_information", "(", "self", ")", ":", "for", "source", "in", "self", ".", "controller", ".", "sources", ":", "source_name", "=", "source", ".", "get_source_name", "(", ")", "if", "(", "any", "(", "self", ".", "graphs_menu", ".", "ac...
Update all the graphs that are being displayed
[ "Update", "all", "the", "graphs", "that", "are", "being", "displayed" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/s_tui.py#L235-L254
231,591
amanusk/s-tui
s_tui/s_tui.py
GraphView.on_reset_button
def on_reset_button(self, _): """Reset graph data and display empty graph""" for graph in self.visible_graphs.values(): graph.reset() for graph in self.graphs.values(): try: graph.source.reset() except NotImplementedError: pass ...
python
def on_reset_button(self, _): """Reset graph data and display empty graph""" for graph in self.visible_graphs.values(): graph.reset() for graph in self.graphs.values(): try: graph.source.reset() except NotImplementedError: pass ...
[ "def", "on_reset_button", "(", "self", ",", "_", ")", ":", "for", "graph", "in", "self", ".", "visible_graphs", ".", "values", "(", ")", ":", "graph", ".", "reset", "(", ")", "for", "graph", "in", "self", ".", "graphs", ".", "values", "(", ")", ":"...
Reset graph data and display empty graph
[ "Reset", "graph", "data", "and", "display", "empty", "graph" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/s_tui.py#L256-L268
231,592
amanusk/s-tui
s_tui/s_tui.py
GraphView.on_stress_menu_open
def on_stress_menu_open(self, widget): """Open stress options""" self.original_widget = urwid.Overlay(self.stress_menu.main_window, self.original_widget, ('relative', self.left_margin), ...
python
def on_stress_menu_open(self, widget): """Open stress options""" self.original_widget = urwid.Overlay(self.stress_menu.main_window, self.original_widget, ('relative', self.left_margin), ...
[ "def", "on_stress_menu_open", "(", "self", ",", "widget", ")", ":", "self", ".", "original_widget", "=", "urwid", ".", "Overlay", "(", "self", ".", "stress_menu", ".", "main_window", ",", "self", ".", "original_widget", ",", "(", "'relative'", ",", "self", ...
Open stress options
[ "Open", "stress", "options" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/s_tui.py#L309-L316
231,593
amanusk/s-tui
s_tui/s_tui.py
GraphView.on_help_menu_open
def on_help_menu_open(self, widget): """Open Help menu""" self.original_widget = urwid.Overlay(self.help_menu.main_window, self.original_widget, ('relative', self.left_margin), ...
python
def on_help_menu_open(self, widget): """Open Help menu""" self.original_widget = urwid.Overlay(self.help_menu.main_window, self.original_widget, ('relative', self.left_margin), ...
[ "def", "on_help_menu_open", "(", "self", ",", "widget", ")", ":", "self", ".", "original_widget", "=", "urwid", ".", "Overlay", "(", "self", ".", "help_menu", ".", "main_window", ",", "self", ".", "original_widget", ",", "(", "'relative'", ",", "self", "."...
Open Help menu
[ "Open", "Help", "menu" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/s_tui.py#L318-L325
231,594
amanusk/s-tui
s_tui/s_tui.py
GraphView.on_about_menu_open
def on_about_menu_open(self, widget): """Open About menu""" self.original_widget = urwid.Overlay(self.about_menu.main_window, self.original_widget, ('relative', self.left_margin), ...
python
def on_about_menu_open(self, widget): """Open About menu""" self.original_widget = urwid.Overlay(self.about_menu.main_window, self.original_widget, ('relative', self.left_margin), ...
[ "def", "on_about_menu_open", "(", "self", ",", "widget", ")", ":", "self", ".", "original_widget", "=", "urwid", ".", "Overlay", "(", "self", ".", "about_menu", ".", "main_window", ",", "self", ".", "original_widget", ",", "(", "'relative'", ",", "self", "...
Open About menu
[ "Open", "About", "menu" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/s_tui.py#L327-L334
231,595
amanusk/s-tui
s_tui/s_tui.py
GraphView.on_mode_button
def on_mode_button(self, my_button, state): """Notify the controller of a new mode setting.""" if state: # The new mode is the label of the button self.controller.set_mode(my_button.get_label())
python
def on_mode_button(self, my_button, state): """Notify the controller of a new mode setting.""" if state: # The new mode is the label of the button self.controller.set_mode(my_button.get_label())
[ "def", "on_mode_button", "(", "self", ",", "my_button", ",", "state", ")", ":", "if", "state", ":", "# The new mode is the label of the button", "self", ".", "controller", ".", "set_mode", "(", "my_button", ".", "get_label", "(", ")", ")" ]
Notify the controller of a new mode setting.
[ "Notify", "the", "controller", "of", "a", "new", "mode", "setting", "." ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/s_tui.py#L356-L360
231,596
amanusk/s-tui
s_tui/s_tui.py
GraphView.on_unicode_checkbox
def on_unicode_checkbox(self, w=None, state=False): """Enable smooth edges if utf-8 is supported""" logging.debug("unicode State is %s", state) # Update the controller to the state of the checkbox self.controller.smooth_graph_mode = state if state: self.hline = urwid...
python
def on_unicode_checkbox(self, w=None, state=False): """Enable smooth edges if utf-8 is supported""" logging.debug("unicode State is %s", state) # Update the controller to the state of the checkbox self.controller.smooth_graph_mode = state if state: self.hline = urwid...
[ "def", "on_unicode_checkbox", "(", "self", ",", "w", "=", "None", ",", "state", "=", "False", ")", ":", "logging", ".", "debug", "(", "\"unicode State is %s\"", ",", "state", ")", "# Update the controller to the state of the checkbox", "self", ".", "controller", "...
Enable smooth edges if utf-8 is supported
[ "Enable", "smooth", "edges", "if", "utf", "-", "8", "is", "supported" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/s_tui.py#L362-L377
231,597
amanusk/s-tui
s_tui/s_tui.py
GraphView._generate_graph_controls
def _generate_graph_controls(self): """ Display sidebar controls. i.e. buttons, and controls""" # setup mode radio buttons stress_modes = self.controller.stress_conroller.get_modes() group = [] for mode in stress_modes: self.mode_buttons.append(radio_button(group, mod...
python
def _generate_graph_controls(self): """ Display sidebar controls. i.e. buttons, and controls""" # setup mode radio buttons stress_modes = self.controller.stress_conroller.get_modes() group = [] for mode in stress_modes: self.mode_buttons.append(radio_button(group, mod...
[ "def", "_generate_graph_controls", "(", "self", ")", ":", "# setup mode radio buttons", "stress_modes", "=", "self", ".", "controller", ".", "stress_conroller", ".", "get_modes", "(", ")", "group", "=", "[", "]", "for", "mode", "in", "stress_modes", ":", "self",...
Display sidebar controls. i.e. buttons, and controls
[ "Display", "sidebar", "controls", ".", "i", ".", "e", ".", "buttons", "and", "controls" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/s_tui.py#L387-L452
231,598
amanusk/s-tui
s_tui/s_tui.py
GraphView._generate_cpu_stats
def _generate_cpu_stats(): """Read and display processor name """ cpu_name = urwid.Text("CPU Name N/A", align="center") try: cpu_name = urwid.Text(get_processor_name().strip(), align="center") except OSError: logging.info("CPU name not available") return [...
python
def _generate_cpu_stats(): """Read and display processor name """ cpu_name = urwid.Text("CPU Name N/A", align="center") try: cpu_name = urwid.Text(get_processor_name().strip(), align="center") except OSError: logging.info("CPU name not available") return [...
[ "def", "_generate_cpu_stats", "(", ")", ":", "cpu_name", "=", "urwid", ".", "Text", "(", "\"CPU Name N/A\"", ",", "align", "=", "\"center\"", ")", "try", ":", "cpu_name", "=", "urwid", ".", "Text", "(", "get_processor_name", "(", ")", ".", "strip", "(", ...
Read and display processor name
[ "Read", "and", "display", "processor", "name" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/s_tui.py#L455-L463
231,599
amanusk/s-tui
s_tui/s_tui.py
GraphView.show_graphs
def show_graphs(self): """Show a pile of the graph selected for dislpay""" elements = itertools.chain.from_iterable( ([graph] for graph in self.visible_graphs.values())) self.graph_place_holder.original_widget = urwid.Pile(elements)
python
def show_graphs(self): """Show a pile of the graph selected for dislpay""" elements = itertools.chain.from_iterable( ([graph] for graph in self.visible_graphs.values())) self.graph_place_holder.original_widget = urwid.Pile(elements)
[ "def", "show_graphs", "(", "self", ")", ":", "elements", "=", "itertools", ".", "chain", ".", "from_iterable", "(", "(", "[", "graph", "]", "for", "graph", "in", "self", ".", "visible_graphs", ".", "values", "(", ")", ")", ")", "self", ".", "graph_plac...
Show a pile of the graph selected for dislpay
[ "Show", "a", "pile", "of", "the", "graph", "selected", "for", "dislpay" ]
5e89d15081e716024db28ec03b1e3a7710330951
https://github.com/amanusk/s-tui/blob/5e89d15081e716024db28ec03b1e3a7710330951/s_tui/s_tui.py#L475-L480