_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 75 19.8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q262200 | calculate_concordance_probability_by_annotation | validation | def calculate_concordance_probability_by_annotation(graph, annotation, key, cutoff=None, permutations=None,
percentage=None,
use_ambiguous=False):
"""Returns the results of concordance analysis on each subgraph, ... | python | {
"resource": ""
} |
q262201 | _get_drug_target_interactions | validation | def _get_drug_target_interactions(manager: Optional['bio2bel_drugbank.manager'] = None) -> Mapping[str, List[str]]:
"""Get a mapping from drugs to their list of gene."""
if manager is None:
import bio2bel_drugbank
manager = bio2bel_drugbank.Manager()
if not manager.is_populated():
m... | python | {
"resource": ""
} |
q262202 | multi_run_epicom | validation | def multi_run_epicom(graphs: Iterable[BELGraph], path: Union[None, str, TextIO]) -> None:
"""Run EpiCom analysis on many graphs."""
if isinstance(path, str):
with open(path, 'w') as file:
_multi_run_helper_file_wrapper(graphs, file)
else:
_multi_run_helper_file_wrapper(graphs, p... | python | {
"resource": ""
} |
q262203 | main | validation | def main():
"""Convert the Alzheimer's and Parkinson's disease NeuroMMSig excel sheets to BEL."""
logging.basicConfig(level=logging.INFO)
log.setLevel(logging.INFO)
bms_base = get_bms_base()
neurommsig_base = get_neurommsig_base()
neurommsig_excel_dir = os.path.join(neurommsig_base, 'resources'... | python | {
"resource": ""
} |
q262204 | remove_inconsistent_edges | validation | def remove_inconsistent_edges(graph: BELGraph) -> None:
"""Remove all edges between node pairs with inconsistent edges.
This is the all-or-nothing approach. It would be better to do more careful investigation of the evidences during
curation.
"""
for u, v in get_inconsistent_edges(graph):
e... | python | {
"resource": ""
} |
q262205 | get_walks_exhaustive | validation | def get_walks_exhaustive(graph, node, length):
"""Gets all walks under a given length starting at a given node
:param networkx.Graph graph: A graph
:param node: Starting node
:param int length: The length of walks to get
:return: A list of paths
:rtype: list[tuple]
"""
if 0 == length:
... | python | {
"resource": ""
} |
q262206 | match_simple_metapath | validation | def match_simple_metapath(graph, node, simple_metapath):
"""Matches a simple metapath starting at the given node
:param pybel.BELGraph graph: A BEL graph
:param tuple node: A BEL node
:param list[str] simple_metapath: A list of BEL Functions
:return: An iterable over paths from the node matching th... | python | {
"resource": ""
} |
q262207 | build_database | validation | def build_database(manager: pybel.Manager, annotation_url: Optional[str] = None) -> None:
"""Build a database of scores for NeuroMMSig annotated graphs.
1. Get all networks that use the Subgraph annotation
2. run on each
"""
annotation_url = annotation_url or NEUROMMSIG_DEFAULT_URL
annotation ... | python | {
"resource": ""
} |
q262208 | calculate_average_scores_on_graph | validation | def calculate_average_scores_on_graph(
graph: BELGraph,
key: Optional[str] = None,
tag: Optional[str] = None,
default_score: Optional[float] = None,
runs: Optional[int] = None,
use_tqdm: bool = False,
):
"""Calculate the scores over all biological processes in the sub... | python | {
"resource": ""
} |
q262209 | calculate_average_scores_on_subgraphs | validation | def calculate_average_scores_on_subgraphs(
subgraphs: Mapping[H, BELGraph],
key: Optional[str] = None,
tag: Optional[str] = None,
default_score: Optional[float] = None,
runs: Optional[int] = None,
use_tqdm: bool = False,
tqdm_kwargs: Optional[Mapping[str, Any]] = ... | python | {
"resource": ""
} |
q262210 | workflow | validation | def workflow(
graph: BELGraph,
node: BaseEntity,
key: Optional[str] = None,
tag: Optional[str] = None,
default_score: Optional[float] = None,
runs: Optional[int] = None,
minimum_nodes: int = 1,
) -> List['Runner']:
"""Generate candidate mechanisms and run the ... | python | {
"resource": ""
} |
q262211 | workflow_aggregate | validation | def workflow_aggregate(graph: BELGraph,
node: BaseEntity,
key: Optional[str] = None,
tag: Optional[str] = None,
default_score: Optional[float] = None,
runs: Optional[int] = None,
agg... | python | {
"resource": ""
} |
q262212 | workflow_all | validation | def workflow_all(graph: BELGraph,
key: Optional[str] = None,
tag: Optional[str] = None,
default_score: Optional[float] = None,
runs: Optional[int] = None,
) -> Mapping[BaseEntity, List[Runner]]:
"""Run the heat diffusion workflow a... | python | {
"resource": ""
} |
q262213 | workflow_all_aggregate | validation | def workflow_all_aggregate(graph: BELGraph,
key: Optional[str] = None,
tag: Optional[str] = None,
default_score: Optional[float] = None,
runs: Optional[int] = None,
aggregator: Optional... | python | {
"resource": ""
} |
q262214 | calculate_average_score_by_annotation | validation | def calculate_average_score_by_annotation(
graph: BELGraph,
annotation: str,
key: Optional[str] = None,
runs: Optional[int] = None,
use_tqdm: bool = False,
) -> Mapping[str, float]:
"""For each sub-graph induced over the edges matching the annotation, calculate the average sc... | python | {
"resource": ""
} |
q262215 | Runner.iter_leaves | validation | def iter_leaves(self) -> Iterable[BaseEntity]:
"""Return an iterable over all nodes that are leaves.
A node is a leaf if either:
- it doesn't have any predecessors, OR
- all of its predecessors have a score in their data dictionaries
"""
for node in self.graph:
... | python | {
"resource": ""
} |
q262216 | Runner.unscored_nodes_iter | validation | def unscored_nodes_iter(self) -> BaseEntity:
"""Iterate over all nodes without a score."""
for node, data in self.graph.nodes(data=True):
if self.tag not in data:
yield node | python | {
"resource": ""
} |
q262217 | Runner.remove_random_edge_until_has_leaves | validation | def remove_random_edge_until_has_leaves(self) -> None:
"""Remove random edges until there is at least one leaf node."""
while True:
leaves = set(self.iter_leaves())
if leaves:
return
self.remove_random_edge() | python | {
"resource": ""
} |
q262218 | Runner.score_leaves | validation | def score_leaves(self) -> Set[BaseEntity]:
"""Calculate the score for all leaves.
:return: The set of leaf nodes that were scored
"""
leaves = set(self.iter_leaves())
if not leaves:
log.warning('no leaves.')
return set()
for leaf in leaves:
... | python | {
"resource": ""
} |
q262219 | Runner.run_with_graph_transformation | validation | def run_with_graph_transformation(self) -> Iterable[BELGraph]:
"""Calculate scores for all leaves until there are none, removes edges until there are, and repeats until
all nodes have been scored. Also, yields the current graph at every step so you can make a cool animation
of how the graph chan... | python | {
"resource": ""
} |
q262220 | Runner.done_chomping | validation | def done_chomping(self) -> bool:
"""Determines if the algorithm is complete by checking if the target node of this analysis has been scored
yet. Because the algorithm removes edges when it gets stuck until it is un-stuck, it is always guaranteed to
finish.
:return: Is the algorithm done... | python | {
"resource": ""
} |
q262221 | Runner.get_final_score | validation | def get_final_score(self) -> float:
"""Return the final score for the target node.
:return: The final score for the target node
"""
if not self.done_chomping():
raise ValueError('algorithm has not yet completed')
return self.graph.nodes[self.target_node][self.tag] | python | {
"resource": ""
} |
q262222 | Runner.calculate_score | validation | def calculate_score(self, node: BaseEntity) -> float:
"""Calculate the new score of the given node."""
score = (
self.graph.nodes[node][self.tag]
if self.tag in self.graph.nodes[node] else
self.default_score
)
for predecessor, _, d in self.graph.in_ed... | python | {
"resource": ""
} |
q262223 | microcanonical_statistics_dtype | validation | def microcanonical_statistics_dtype(spanning_cluster=True):
"""
Return the numpy structured array data type for sample states
Helper function
Parameters
----------
spanning_cluster : bool, optional
Whether to detect a spanning cluster or not.
Defaults to ``True``.
Returns
... | python | {
"resource": ""
} |
q262224 | canonical_statistics_dtype | validation | def canonical_statistics_dtype(spanning_cluster=True):
"""
The NumPy Structured Array type for canonical statistics
Helper function
Parameters
----------
spanning_cluster : bool, optional
Whether to detect a spanning cluster or not.
Defaults to ``True``.
Returns
------... | python | {
"resource": ""
} |
q262225 | bond_canonical_statistics | validation | def bond_canonical_statistics(
microcanonical_statistics,
convolution_factors,
**kwargs
):
"""
canonical cluster statistics for a single run and a single probability
Parameters
----------
microcanonical_statistics : ndarray
Return value of `bond_microcanonical_statistics`
... | python | {
"resource": ""
} |
q262226 | canonical_averages_dtype | validation | def canonical_averages_dtype(spanning_cluster=True):
"""
The NumPy Structured Array type for canonical averages over several
runs
Helper function
Parameters
----------
spanning_cluster : bool, optional
Whether to detect a spanning cluster or not.
Defaults to ``True``.
... | python | {
"resource": ""
} |
q262227 | bond_initialize_canonical_averages | validation | def bond_initialize_canonical_averages(
canonical_statistics, **kwargs
):
"""
Initialize the canonical averages from a single-run cluster statistics
Parameters
----------
canonical_statistics : 1-D structured ndarray
Typically contains the canonical statistics for a range of values
... | python | {
"resource": ""
} |
q262228 | bond_reduce | validation | def bond_reduce(row_a, row_b):
"""
Reduce the canonical averages over several runs
This is a "true" reducer.
It is associative and commutative.
This is a wrapper around `simoa.stats.online_variance`.
Parameters
----------
row_a, row_b : structured ndarrays
Output of this funct... | python | {
"resource": ""
} |
q262229 | finalized_canonical_averages_dtype | validation | def finalized_canonical_averages_dtype(spanning_cluster=True):
"""
The NumPy Structured Array type for finalized canonical averages over
several runs
Helper function
Parameters
----------
spanning_cluster : bool, optional
Whether to detect a spanning cluster or not.
Default... | python | {
"resource": ""
} |
q262230 | finalize_canonical_averages | validation | def finalize_canonical_averages(
number_of_nodes, ps, canonical_averages, alpha,
):
"""
Finalize canonical averages
"""
spanning_cluster = (
(
'percolation_probability_mean' in
canonical_averages.dtype.names
) and
'percolation_probability_m2' in canon... | python | {
"resource": ""
} |
q262231 | compare | validation | def compare(graph: BELGraph, annotation: str = 'Subgraph') -> Mapping[str, Mapping[str, float]]:
"""Compare generated mechanisms to actual ones.
1. Generates candidate mechanisms for each biological process
2. Gets sub-graphs for all NeuroMMSig signatures
3. Make tanimoto similarity comparison for all ... | python | {
"resource": ""
} |
q262232 | summarize_node_filter | validation | def summarize_node_filter(graph: BELGraph, node_filters: NodePredicates) -> None:
"""Print a summary of the number of nodes passing a given set of filters.
:param graph: A BEL graph
:param node_filters: A node filter or list/tuple of node filters
"""
passed = count_passed_node_filter(graph, node_fi... | python | {
"resource": ""
} |
q262233 | node_inclusion_filter_builder | validation | def node_inclusion_filter_builder(nodes: Iterable[BaseEntity]) -> NodePredicate:
"""Build a filter that only passes on nodes in the given list.
:param nodes: An iterable of BEL nodes
"""
node_set = set(nodes)
def inclusion_filter(_: BELGraph, node: BaseEntity) -> bool:
"""Pass only for a n... | python | {
"resource": ""
} |
q262234 | node_exclusion_filter_builder | validation | def node_exclusion_filter_builder(nodes: Iterable[BaseEntity]) -> NodePredicate:
"""Build a filter that fails on nodes in the given list."""
node_set = set(nodes)
def exclusion_filter(_: BELGraph, node: BaseEntity) -> bool:
"""Pass only for a node that isn't in the enclosed node list
:retu... | python | {
"resource": ""
} |
q262235 | function_namespace_inclusion_builder | validation | def function_namespace_inclusion_builder(func: str, namespace: Strings) -> NodePredicate:
"""Build a filter function for matching the given BEL function with the given namespace or namespaces.
:param func: A BEL function
:param namespace: The namespace to search by
"""
if isinstance(namespace, str)... | python | {
"resource": ""
} |
q262236 | data_contains_key_builder | validation | def data_contains_key_builder(key: str) -> NodePredicate: # noqa: D202
"""Build a filter that passes only on nodes that have the given key in their data dictionary.
:param key: A key for the node's data dictionary
"""
def data_contains_key(_: BELGraph, node: BaseEntity) -> bool:
"""Pass only ... | python | {
"resource": ""
} |
q262237 | variants_of | validation | def variants_of(
graph: BELGraph,
node: Protein,
modifications: Optional[Set[str]] = None,
) -> Set[Protein]:
"""Returns all variants of the given node."""
if modifications:
return _get_filtered_variants_of(graph, node, modifications)
return {
v
for u, v, key... | python | {
"resource": ""
} |
q262238 | get_variants_to_controllers | validation | def get_variants_to_controllers(
graph: BELGraph,
node: Protein,
modifications: Optional[Set[str]] = None,
) -> Mapping[Protein, Set[Protein]]:
"""Get a mapping from variants of the given node to all of its upstream controllers."""
rv = defaultdict(set)
variants = variants_of(graph, ... | python | {
"resource": ""
} |
q262239 | group_dict_set | validation | def group_dict_set(iterator: Iterable[Tuple[A, B]]) -> Mapping[A, Set[B]]:
"""Make a dict that accumulates the values for each key in an iterator of doubles."""
d = defaultdict(set)
for key, value in iterator:
d[key].add(value)
return dict(d) | python | {
"resource": ""
} |
q262240 | count_unique_relations | validation | def count_unique_relations(graph: BELGraph) -> Counter:
"""Return a histogram of the different types of relations present in a graph.
Note: this operation only counts each type of edge once for each pair of nodes
"""
return Counter(itt.chain.from_iterable(get_edge_relations(graph).values())) | python | {
"resource": ""
} |
q262241 | count_annotation_values | validation | def count_annotation_values(graph: BELGraph, annotation: str) -> Counter:
"""Count in how many edges each annotation appears in a graph
:param graph: A BEL graph
:param annotation: The annotation to count
:return: A Counter from {annotation value: frequency}
"""
return Counter(iter_annotation_v... | python | {
"resource": ""
} |
q262242 | count_annotation_values_filtered | validation | def count_annotation_values_filtered(graph: BELGraph,
annotation: str,
source_predicate: Optional[NodePredicate] = None,
target_predicate: Optional[NodePredicate] = None,
)... | python | {
"resource": ""
} |
q262243 | pair_is_consistent | validation | def pair_is_consistent(graph: BELGraph, u: BaseEntity, v: BaseEntity) -> Optional[str]:
"""Return if the edges between the given nodes are consistent, meaning they all have the same relation.
:return: If the edges aren't consistent, return false, otherwise return the relation type
"""
relations = {data... | python | {
"resource": ""
} |
q262244 | infer_missing_two_way_edges | validation | def infer_missing_two_way_edges(graph):
"""Add edges to the graph when a two way edge exists, and the opposite direction doesn't exist.
Use: two way edges from BEL definition and/or axiomatic inverses of membership relations
:param pybel.BELGraph graph: A BEL graph
"""
for u, v, k, d in graph.edge... | python | {
"resource": ""
} |
q262245 | infer_missing_backwards_edge | validation | def infer_missing_backwards_edge(graph, u, v, k):
"""Add the same edge, but in the opposite direction if not already present.
:type graph: pybel.BELGraph
:type u: tuple
:type v: tuple
:type k: int
"""
if u in graph[v]:
for attr_dict in graph[v][u].values():
if attr_dict ... | python | {
"resource": ""
} |
q262246 | enrich_internal_unqualified_edges | validation | def enrich_internal_unqualified_edges(graph, subgraph):
"""Add the missing unqualified edges between entities in the subgraph that are contained within the full graph.
:param pybel.BELGraph graph: The full BEL graph
:param pybel.BELGraph subgraph: The query BEL subgraph
"""
for u, v in itt.combinat... | python | {
"resource": ""
} |
q262247 | boilerplate | validation | def boilerplate(name, contact, description, pmids, version, copyright, authors, licenses, disclaimer, output):
"""Build a template BEL document with the given PubMed identifiers."""
from .document_utils import write_boilerplate
write_boilerplate(
name=name,
version=version,
descript... | python | {
"resource": ""
} |
q262248 | get_pmids | validation | def get_pmids(graph: BELGraph, output: TextIO):
"""Output PubMed identifiers from a graph to a stream."""
for pmid in get_pubmed_identifiers(graph):
click.echo(pmid, file=output) | python | {
"resource": ""
} |
q262249 | Table.getrowcount | validation | def getrowcount(self, window_name, object_name):
"""
Get count of rows in table object.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either fu... | python | {
"resource": ""
} |
q262250 | Table.multiselect | validation | def multiselect(self, window_name, object_name, row_text_list, partial_match=False):
"""
Select multiple row
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to... | python | {
"resource": ""
} |
q262251 | Table.selectrowpartialmatch | validation | def selectrowpartialmatch(self, window_name, object_name, row_text):
"""
Select row partial match
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to type in, e... | python | {
"resource": ""
} |
q262252 | Table.selectrowindex | validation | def selectrowindex(self, window_name, object_name, row_index):
"""
Select row index
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to type in, either full nam... | python | {
"resource": ""
} |
q262253 | Table.selectlastrow | validation | def selectlastrow(self, window_name, object_name):
"""
Select last row
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to type in, either full name,
LD... | python | {
"resource": ""
} |
q262254 | Table.getcellvalue | validation | def getcellvalue(self, window_name, object_name, row_index, column=0):
"""
Get cell value
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to type in, either fu... | python | {
"resource": ""
} |
q262255 | Table.gettablerowindex | validation | def gettablerowindex(self, window_name, object_name, row_text):
"""
Get table row index matching given text
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to ... | python | {
"resource": ""
} |
q262256 | Table.verifypartialtablecell | validation | def verifypartialtablecell(self, window_name, object_name, row_index,
column_index, row_text):
"""
Verify partial table cell value
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_na... | python | {
"resource": ""
} |
q262257 | Core.getapplist | validation | def getapplist(self):
"""
Get all accessibility application name that are currently running
@return: list of appliction name of string type on success.
@rtype: list
"""
app_list = []
# Update apps list, before parsing the list
self._update_apps()
... | python | {
"resource": ""
} |
q262258 | Core.startprocessmonitor | validation | def startprocessmonitor(self, process_name, interval=2):
"""
Start memory and CPU monitoring, with the time interval between
each process scan
@param process_name: Process name, ex: firefox-bin.
@type process_name: string
@param interval: Time interval between each proce... | python | {
"resource": ""
} |
q262259 | Core.stopprocessmonitor | validation | def stopprocessmonitor(self, process_name):
"""
Stop memory and CPU monitoring
@param process_name: Process name, ex: firefox-bin.
@type process_name: string
@return: 1 on success
@rtype: integer
"""
if process_name in self._process_stats:
# ... | python | {
"resource": ""
} |
q262260 | Core.getcpustat | validation | def getcpustat(self, process_name):
"""
get CPU stat for the give process name
@param process_name: Process name, ex: firefox-bin.
@type process_name: string
@return: cpu stat list on success, else empty list
If same process name, running multiple instance,
... | python | {
"resource": ""
} |
q262261 | Core.getmemorystat | validation | def getmemorystat(self, process_name):
"""
get memory stat
@param process_name: Process name, ex: firefox-bin.
@type process_name: string
@return: memory stat list on success, else empty list
If same process name, running multiple instance,
get t... | python | {
"resource": ""
} |
q262262 | Core.getobjectlist | validation | def getobjectlist(self, window_name):
"""
Get list of items in given GUI.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@return: list of items in LDTP naming convention.
@rtype: l... | python | {
"resource": ""
} |
q262263 | Core.getobjectinfo | validation | def getobjectinfo(self, window_name, object_name):
"""
Get object properties.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
... | python | {
"resource": ""
} |
q262264 | Core.getobjectproperty | validation | def getobjectproperty(self, window_name, object_name, prop):
"""
Get object property value.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, eithe... | python | {
"resource": ""
} |
q262265 | Core.getchild | validation | def getchild(self, window_name, child_name='', role='', parent=''):
"""
Gets the list of object available in the window, which matches
component name or role name or both.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
... | python | {
"resource": ""
} |
q262266 | Core.launchapp | validation | def launchapp(self, cmd, args=[], delay=0, env=1, lang="C"):
"""
Launch application.
@param cmd: Command line string to execute.
@type cmd: string
@param args: Arguments to the application
@type args: list
@param delay: Delay after the application is launched
... | python | {
"resource": ""
} |
q262267 | Core.activatewindow | validation | def activatewindow(self, window_name):
"""
Activate window.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@return: 1 on success.
@rtype: integer
"""
window_handle ... | python | {
"resource": ""
} |
q262268 | Core.click | validation | def click(self, window_name, object_name):
"""
Click item.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
LDTP's name ... | python | {
"resource": ""
} |
q262269 | Core.getallstates | validation | def getallstates(self, window_name, object_name):
"""
Get all states of given object
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full ... | python | {
"resource": ""
} |
q262270 | Core.getobjectsize | validation | def getobjectsize(self, window_name, object_name=None):
"""
Get object size
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
... | python | {
"resource": ""
} |
q262271 | Core.grabfocus | validation | def grabfocus(self, window_name, object_name=None):
"""
Grab focus.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
LDT... | python | {
"resource": ""
} |
q262272 | Core.waittillguiexist | validation | def waittillguiexist(self, window_name, object_name='',
guiTimeOut=30, state=''):
"""
Wait till a window or component exists.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string... | python | {
"resource": ""
} |
q262273 | Core.waittillguinotexist | validation | def waittillguinotexist(self, window_name, object_name='', guiTimeOut=30):
"""
Wait till a window does not exist.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object n... | python | {
"resource": ""
} |
q262274 | Core.stateenabled | validation | def stateenabled(self, window_name, object_name):
"""
Check whether an object state is enabled or not
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look ... | python | {
"resource": ""
} |
q262275 | Core.check | validation | def check(self, window_name, object_name):
"""
Check item.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
LDTP's name ... | python | {
"resource": ""
} |
q262276 | Core.verifycheck | validation | def verifycheck(self, window_name, object_name):
"""
Verify check item.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
... | python | {
"resource": ""
} |
q262277 | Core.getaccesskey | validation | def getaccesskey(self, window_name, object_name):
"""
Get access key of given object
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full ... | python | {
"resource": ""
} |
q262278 | Clipboard.clearContents | validation | def clearContents(cls):
"""Clear contents of general pasteboard.
Future enhancement can include specifying which clipboard to clear
Returns: True on success; caller should expect to catch exceptions,
probably from AppKit (ValueError)
"""
log_msg = 'Request to cl... | python | {
"resource": ""
} |
q262279 | Clipboard.isEmpty | validation | def isEmpty(cls, datatype=None):
"""Method to test if the general pasteboard is empty or not with respect
to the type of object you want.
Parameters: datatype (defaults to strings)
Returns: Boolean True (empty) / False (has contents); Raises
exception (passes any raised... | python | {
"resource": ""
} |
q262280 | Utils._ldtpize_accessible | validation | def _ldtpize_accessible(self, acc):
"""
Get LDTP format accessibile name
@param acc: Accessible handle
@type acc: object
@return: object type, stripped object name (associated / direct),
associated label
@rtype: tuple
"""
actual_r... | python | {
"resource": ""
} |
q262281 | Utils._glob_match | validation | def _glob_match(self, pattern, string):
"""
Match given string, by escaping regex characters
"""
# regex flags Multi-line, Unicode, Locale
return bool(re.match(fnmatch.translate(pattern), string,
re.M | re.U | re.L)) | python | {
"resource": ""
} |
q262282 | Menu.doesmenuitemexist | validation | def doesmenuitemexist(self, window_name, object_name):
"""
Check a menu item exist.
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full n... | python | {
"resource": ""
} |
q262283 | Menu.menuitemenabled | validation | def menuitemenabled(self, window_name, object_name):
"""
Verify a menu item is enabled
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either ful... | python | {
"resource": ""
} |
q262284 | Menu.verifymenucheck | validation | def verifymenucheck(self, window_name, object_name):
"""
Verify a menu item is checked
@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either ful... | python | {
"resource": ""
} |
q262285 | BaseAXUIElement._getRunningApps | validation | def _getRunningApps(cls):
"""Get a list of the running applications."""
def runLoopAndExit():
AppHelper.stopEventLoop()
AppHelper.callLater(1, runLoopAndExit)
AppHelper.runConsoleEventLoop()
# Get a list of running applications
ws = AppKit.NSWorkspace.shared... | python | {
"resource": ""
} |
q262286 | BaseAXUIElement.getFrontmostApp | validation | def getFrontmostApp(cls):
"""Get the current frontmost application.
Raise a ValueError exception if no GUI applications are found.
"""
# Refresh the runningApplications list
apps = cls._getRunningApps()
for app in apps:
pid = app.processIdentifier()
... | python | {
"resource": ""
} |
q262287 | BaseAXUIElement.getAnyAppWithWindow | validation | def getAnyAppWithWindow(cls):
"""Get a random app that has windows.
Raise a ValueError exception if no GUI applications are found.
"""
# Refresh the runningApplications list
apps = cls._getRunningApps()
for app in apps:
pid = app.processIdentifier()
... | python | {
"resource": ""
} |
q262288 | BaseAXUIElement.launchAppByBundleId | validation | def launchAppByBundleId(bundleID):
"""Launch the application with the specified bundle ID"""
# NSWorkspaceLaunchAllowingClassicStartup does nothing on any
# modern system that doesn't have the classic environment installed.
# Encountered a bug when passing 0 for no options on 10.6 PyObjC... | python | {
"resource": ""
} |
q262289 | BaseAXUIElement.launchAppByBundlePath | validation | def launchAppByBundlePath(bundlePath, arguments=None):
"""Launch app with a given bundle path.
Return True if succeed.
"""
if arguments is None:
arguments = []
bundleUrl = NSURL.fileURLWithPath_(bundlePath)
workspace = AppKit.NSWorkspace.sharedWorkspace()
... | python | {
"resource": ""
} |
q262290 | BaseAXUIElement.terminateAppByBundleId | validation | def terminateAppByBundleId(bundleID):
"""Terminate app with a given bundle ID.
Requires 10.6.
Return True if succeed.
"""
ra = AppKit.NSRunningApplication
if getattr(ra, "runningApplicationsWithBundleIdentifier_"):
appList = ra.runningApplicationsWithBundleId... | python | {
"resource": ""
} |
q262291 | BaseAXUIElement._queueEvent | validation | def _queueEvent(self, event, args):
"""Private method to queue events to run.
Each event in queue is a tuple (event call, args to event call).
"""
if not hasattr(self, 'eventList'):
self.eventList = deque([(event, args)])
return
self.eventList.append((eve... | python | {
"resource": ""
} |
q262292 | BaseAXUIElement._addKeyToQueue | validation | def _addKeyToQueue(self, keychr, modFlags=0, globally=False):
"""Add keypress to queue.
Parameters: key character or constant referring to a non-alpha-numeric
key (e.g. RETURN or TAB)
modifiers
global or app specific
Returns: None or r... | python | {
"resource": ""
} |
q262293 | BaseAXUIElement._sendKey | validation | def _sendKey(self, keychr, modFlags=0, globally=False):
"""Send one character with no modifiers.
Parameters: key character or constant referring to a non-alpha-numeric
key (e.g. RETURN or TAB)
modifier flags,
global or app specific
Ret... | python | {
"resource": ""
} |
q262294 | BaseAXUIElement._isSingleCharacter | validation | def _isSingleCharacter(keychr):
"""Check whether given keyboard character is a single character.
Parameters: key character which will be checked.
Returns: True when given key character is a single character.
"""
if not keychr:
return False
# Regular character... | python | {
"resource": ""
} |
q262295 | BaseAXUIElement._sendKeyWithModifiers | validation | def _sendKeyWithModifiers(self, keychr, modifiers, globally=False):
"""Send one character with the given modifiers pressed.
Parameters: key character, list of modifiers, global or app specific
Returns: None or raise ValueError exception
"""
if not self._isSingleCharacter(keychr)... | python | {
"resource": ""
} |
q262296 | BaseAXUIElement._queueMouseButton | validation | def _queueMouseButton(self, coord, mouseButton, modFlags, clickCount=1,
dest_coord=None):
"""Private method to handle generic mouse button clicking.
Parameters: coord (x, y) to click, mouseButton (e.g.,
kCGMouseButtonLeft), modFlags set (int)
Option... | python | {
"resource": ""
} |
q262297 | BaseAXUIElement._leftMouseDragged | validation | def _leftMouseDragged(self, stopCoord, strCoord, speed):
"""Private method to handle generic mouse left button dragging and
dropping.
Parameters: stopCoord(x,y) drop point
Optional: strCoord (x, y) drag point, default (0,0) get current
mouse position
... | python | {
"resource": ""
} |
q262298 | BaseAXUIElement._waitFor | validation | def _waitFor(self, timeout, notification, **kwargs):
"""Wait for a particular UI event to occur; this can be built
upon in NativeUIElement for specific convenience methods.
"""
callback = self._matchOther
retelem = None
callbackArgs = None
callbackKwargs = None
... | python | {
"resource": ""
} |
q262299 | BaseAXUIElement._getActions | validation | def _getActions(self):
"""Retrieve a list of actions supported by the object."""
actions = _a11y.AXUIElement._getActions(self)
# strip leading AX from actions - help distinguish them from attributes
return [action[2:] for action in actions] | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.