partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | Jaspar._run_program | Get enriched JASPAR motifs in a FASTA file.
Parameters
----------
bin : str
Command used to run the tool.
fastafile : str
Name of the FASTA input file.
params : dict, optional
Optional parameters. For some of the tools required param... | gimmemotifs/tools.py | def _run_program(self, bin, fastafile, params=None):
"""
Get enriched JASPAR motifs in a FASTA file.
Parameters
----------
bin : str
Command used to run the tool.
fastafile : str
Name of the FASTA input file.
params : dict, optio... | def _run_program(self, bin, fastafile, params=None):
"""
Get enriched JASPAR motifs in a FASTA file.
Parameters
----------
bin : str
Command used to run the tool.
fastafile : str
Name of the FASTA input file.
params : dict, optio... | [
"Get",
"enriched",
"JASPAR",
"motifs",
"in",
"a",
"FASTA",
"file",
"."
] | vanheeringen-lab/gimmemotifs | python | https://github.com/vanheeringen-lab/gimmemotifs/blob/1dc0572179e5d0c8f96958060133c1f8d92c6675/gimmemotifs/tools.py#L1919-L1951 | [
"def",
"_run_program",
"(",
"self",
",",
"bin",
",",
"fastafile",
",",
"params",
"=",
"None",
")",
":",
"fname",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"config",
".",
"get_motif_dir",
"(",
")",
",",
"\"JASPAR2010_vertebrate.pwm\"",
")",
... | 1dc0572179e5d0c8f96958060133c1f8d92c6675 |
train | Meme._run_program | Run MEME and predict motifs from a FASTA file.
Parameters
----------
bin : str
Command used to run the tool.
fastafile : str
Name of the FASTA input file.
params : dict, optional
Optional parameters. For some of the tools required pa... | gimmemotifs/tools.py | def _run_program(self, bin, fastafile, params=None):
"""
Run MEME and predict motifs from a FASTA file.
Parameters
----------
bin : str
Command used to run the tool.
fastafile : str
Name of the FASTA input file.
params : dict, op... | def _run_program(self, bin, fastafile, params=None):
"""
Run MEME and predict motifs from a FASTA file.
Parameters
----------
bin : str
Command used to run the tool.
fastafile : str
Name of the FASTA input file.
params : dict, op... | [
"Run",
"MEME",
"and",
"predict",
"motifs",
"from",
"a",
"FASTA",
"file",
"."
] | vanheeringen-lab/gimmemotifs | python | https://github.com/vanheeringen-lab/gimmemotifs/blob/1dc0572179e5d0c8f96958060133c1f8d92c6675/gimmemotifs/tools.py#L1981-L2033 | [
"def",
"_run_program",
"(",
"self",
",",
"bin",
",",
"fastafile",
",",
"params",
"=",
"None",
")",
":",
"default_params",
"=",
"{",
"\"width\"",
":",
"10",
",",
"\"single\"",
":",
"False",
",",
"\"number\"",
":",
"10",
"}",
"if",
"params",
"is",
"not",... | 1dc0572179e5d0c8f96958060133c1f8d92c6675 |
train | Meme.parse | Convert MEME output to motifs
Parameters
----------
fo : file-like
File object containing MEME output.
Returns
-------
motifs : list
List of Motif instances. | gimmemotifs/tools.py | def parse(self, fo):
"""
Convert MEME output to motifs
Parameters
----------
fo : file-like
File object containing MEME output.
Returns
-------
motifs : list
List of Motif instances.
"""
motifs = []
... | def parse(self, fo):
"""
Convert MEME output to motifs
Parameters
----------
fo : file-like
File object containing MEME output.
Returns
-------
motifs : list
List of Motif instances.
"""
motifs = []
... | [
"Convert",
"MEME",
"output",
"to",
"motifs",
"Parameters",
"----------",
"fo",
":",
"file",
"-",
"like",
"File",
"object",
"containing",
"MEME",
"output",
"."
] | vanheeringen-lab/gimmemotifs | python | https://github.com/vanheeringen-lab/gimmemotifs/blob/1dc0572179e5d0c8f96958060133c1f8d92c6675/gimmemotifs/tools.py#L2035-L2084 | [
"def",
"parse",
"(",
"self",
",",
"fo",
")",
":",
"motifs",
"=",
"[",
"]",
"nucs",
"=",
"{",
"\"A\"",
":",
"0",
",",
"\"C\"",
":",
"1",
",",
"\"G\"",
":",
"2",
",",
"\"T\"",
":",
"3",
"}",
"p",
"=",
"re",
".",
"compile",
"(",
"'MOTIF.+MEME-(\... | 1dc0572179e5d0c8f96958060133c1f8d92c6675 |
train | scan_to_table | Scan regions in input table with motifs.
Parameters
----------
input_table : str
Filename of input table. Can be either a text-separated tab file or a
feather file.
genome : str
Genome name. Can be either the name of a FASTA-formatted file or a
genomepy genome name... | gimmemotifs/maelstrom.py | def scan_to_table(input_table, genome, scoring, pwmfile=None, ncpus=None):
"""Scan regions in input table with motifs.
Parameters
----------
input_table : str
Filename of input table. Can be either a text-separated tab file or a
feather file.
genome : str
Genome name. C... | def scan_to_table(input_table, genome, scoring, pwmfile=None, ncpus=None):
"""Scan regions in input table with motifs.
Parameters
----------
input_table : str
Filename of input table. Can be either a text-separated tab file or a
feather file.
genome : str
Genome name. C... | [
"Scan",
"regions",
"in",
"input",
"table",
"with",
"motifs",
"."
] | vanheeringen-lab/gimmemotifs | python | https://github.com/vanheeringen-lab/gimmemotifs/blob/1dc0572179e5d0c8f96958060133c1f8d92c6675/gimmemotifs/maelstrom.py#L52-L123 | [
"def",
"scan_to_table",
"(",
"input_table",
",",
"genome",
",",
"scoring",
",",
"pwmfile",
"=",
"None",
",",
"ncpus",
"=",
"None",
")",
":",
"config",
"=",
"MotifConfig",
"(",
")",
"if",
"pwmfile",
"is",
"None",
":",
"pwmfile",
"=",
"config",
".",
"get... | 1dc0572179e5d0c8f96958060133c1f8d92c6675 |
train | run_maelstrom | Run maelstrom on an input table.
Parameters
----------
infile : str
Filename of input table. Can be either a text-separated tab file or a
feather file.
genome : str
Genome name. Can be either the name of a FASTA-formatted file or a
genomepy genome name.
... | gimmemotifs/maelstrom.py | def run_maelstrom(infile, genome, outdir, pwmfile=None, plot=True, cluster=False,
score_table=None, count_table=None, methods=None, ncpus=None):
"""Run maelstrom on an input table.
Parameters
----------
infile : str
Filename of input table. Can be either a text-separated tab file o... | def run_maelstrom(infile, genome, outdir, pwmfile=None, plot=True, cluster=False,
score_table=None, count_table=None, methods=None, ncpus=None):
"""Run maelstrom on an input table.
Parameters
----------
infile : str
Filename of input table. Can be either a text-separated tab file o... | [
"Run",
"maelstrom",
"on",
"an",
"input",
"table",
".",
"Parameters",
"----------",
"infile",
":",
"str",
"Filename",
"of",
"input",
"table",
".",
"Can",
"be",
"either",
"a",
"text",
"-",
"separated",
"tab",
"file",
"or",
"a",
"feather",
"file",
".",
"gen... | vanheeringen-lab/gimmemotifs | python | https://github.com/vanheeringen-lab/gimmemotifs/blob/1dc0572179e5d0c8f96958060133c1f8d92c6675/gimmemotifs/maelstrom.py#L250-L428 | [
"def",
"run_maelstrom",
"(",
"infile",
",",
"genome",
",",
"outdir",
",",
"pwmfile",
"=",
"None",
",",
"plot",
"=",
"True",
",",
"cluster",
"=",
"False",
",",
"score_table",
"=",
"None",
",",
"count_table",
"=",
"None",
",",
"methods",
"=",
"None",
","... | 1dc0572179e5d0c8f96958060133c1f8d92c6675 |
train | MaelstromResult.plot_heatmap | Plot clustered heatmap of predicted motif activity.
Parameters
----------
kind : str, optional
Which data type to use for plotting. Default is 'final', which will plot the
result of the rang aggregation. Other options are 'freq' for the motif frequencies,
... | gimmemotifs/maelstrom.py | def plot_heatmap(self, kind="final", min_freq=0.01, threshold=2, name=True, max_len=50, aspect=1, **kwargs):
"""Plot clustered heatmap of predicted motif activity.
Parameters
----------
kind : str, optional
Which data type to use for plotting. Default is 'final', whi... | def plot_heatmap(self, kind="final", min_freq=0.01, threshold=2, name=True, max_len=50, aspect=1, **kwargs):
"""Plot clustered heatmap of predicted motif activity.
Parameters
----------
kind : str, optional
Which data type to use for plotting. Default is 'final', whi... | [
"Plot",
"clustered",
"heatmap",
"of",
"predicted",
"motif",
"activity",
".",
"Parameters",
"----------",
"kind",
":",
"str",
"optional",
"Which",
"data",
"type",
"to",
"use",
"for",
"plotting",
".",
"Default",
"is",
"final",
"which",
"will",
"plot",
"the",
"... | vanheeringen-lab/gimmemotifs | python | https://github.com/vanheeringen-lab/gimmemotifs/blob/1dc0572179e5d0c8f96958060133c1f8d92c6675/gimmemotifs/maelstrom.py#L495-L558 | [
"def",
"plot_heatmap",
"(",
"self",
",",
"kind",
"=",
"\"final\"",
",",
"min_freq",
"=",
"0.01",
",",
"threshold",
"=",
"2",
",",
"name",
"=",
"True",
",",
"max_len",
"=",
"50",
",",
"aspect",
"=",
"1",
",",
"*",
"*",
"kwargs",
")",
":",
"filt",
... | 1dc0572179e5d0c8f96958060133c1f8d92c6675 |
train | MaelstromResult.plot_scores | Create motif scores boxplot of different clusters.
Motifs can be specified as either motif or factor names.
The motif scores will be scaled and plotted as z-scores.
Parameters
----------
motifs : iterable or str
List of motif or factor names.
... | gimmemotifs/maelstrom.py | def plot_scores(self, motifs, name=True, max_len=50):
"""Create motif scores boxplot of different clusters.
Motifs can be specified as either motif or factor names.
The motif scores will be scaled and plotted as z-scores.
Parameters
----------
motifs : iterable o... | def plot_scores(self, motifs, name=True, max_len=50):
"""Create motif scores boxplot of different clusters.
Motifs can be specified as either motif or factor names.
The motif scores will be scaled and plotted as z-scores.
Parameters
----------
motifs : iterable o... | [
"Create",
"motif",
"scores",
"boxplot",
"of",
"different",
"clusters",
".",
"Motifs",
"can",
"be",
"specified",
"as",
"either",
"motif",
"or",
"factor",
"names",
".",
"The",
"motif",
"scores",
"will",
"be",
"scaled",
"and",
"plotted",
"as",
"z",
"-",
"scor... | vanheeringen-lab/gimmemotifs | python | https://github.com/vanheeringen-lab/gimmemotifs/blob/1dc0572179e5d0c8f96958060133c1f8d92c6675/gimmemotifs/maelstrom.py#L561-L608 | [
"def",
"plot_scores",
"(",
"self",
",",
"motifs",
",",
"name",
"=",
"True",
",",
"max_len",
"=",
"50",
")",
":",
"if",
"self",
".",
"input",
".",
"shape",
"[",
"1",
"]",
"!=",
"1",
":",
"raise",
"ValueError",
"(",
"\"Can't make a categorical plot with re... | 1dc0572179e5d0c8f96958060133c1f8d92c6675 |
train | get_version | Return version of package on pypi.python.org using json. Adapted from https://stackoverflow.com/a/34366589 | scripts/find_swiglpk_version.py | def get_version(package, url_pattern=URL_PATTERN):
"""Return version of package on pypi.python.org using json. Adapted from https://stackoverflow.com/a/34366589"""
req = requests.get(url_pattern.format(package=package))
version = parse('0')
if req.status_code == requests.codes.ok:
# j = json.loa... | def get_version(package, url_pattern=URL_PATTERN):
"""Return version of package on pypi.python.org using json. Adapted from https://stackoverflow.com/a/34366589"""
req = requests.get(url_pattern.format(package=package))
version = parse('0')
if req.status_code == requests.codes.ok:
# j = json.loa... | [
"Return",
"version",
"of",
"package",
"on",
"pypi",
".",
"python",
".",
"org",
"using",
"json",
".",
"Adapted",
"from",
"https",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"a",
"/",
"34366589"
] | biosustain/swiglpk | python | https://github.com/biosustain/swiglpk/blob/a83bc5d0bb4bf7795756ba11a33fb5cb2c501bef/scripts/find_swiglpk_version.py#L13-L25 | [
"def",
"get_version",
"(",
"package",
",",
"url_pattern",
"=",
"URL_PATTERN",
")",
":",
"req",
"=",
"requests",
".",
"get",
"(",
"url_pattern",
".",
"format",
"(",
"package",
"=",
"package",
")",
")",
"version",
"=",
"parse",
"(",
"'0'",
")",
"if",
"re... | a83bc5d0bb4bf7795756ba11a33fb5cb2c501bef |
train | get_args | Converts arguments extracted from a parser to a dict,
and will dismiss arguments which default to NOT_SET.
:param parser: an ``argparse.ArgumentParser`` instance.
:type parser: argparse.ArgumentParser
:return: Dictionary with the configs found in the parsed CLI arguments.
:rtype: dict | prettyconf/loaders.py | def get_args(parser):
"""
Converts arguments extracted from a parser to a dict,
and will dismiss arguments which default to NOT_SET.
:param parser: an ``argparse.ArgumentParser`` instance.
:type parser: argparse.ArgumentParser
:return: Dictionary with the configs found in the parsed CLI argumen... | def get_args(parser):
"""
Converts arguments extracted from a parser to a dict,
and will dismiss arguments which default to NOT_SET.
:param parser: an ``argparse.ArgumentParser`` instance.
:type parser: argparse.ArgumentParser
:return: Dictionary with the configs found in the parsed CLI argumen... | [
"Converts",
"arguments",
"extracted",
"from",
"a",
"parser",
"to",
"a",
"dict",
"and",
"will",
"dismiss",
"arguments",
"which",
"default",
"to",
"NOT_SET",
"."
] | osantana/prettyconf | python | https://github.com/osantana/prettyconf/blob/ddbbc8a592ebd7d80d9c3f87c8671523e3692a0d/prettyconf/loaders.py#L22-L33 | [
"def",
"get_args",
"(",
"parser",
")",
":",
"args",
"=",
"vars",
"(",
"parser",
".",
"parse_args",
"(",
")",
")",
".",
"items",
"(",
")",
"return",
"{",
"key",
":",
"val",
"for",
"key",
",",
"val",
"in",
"args",
"if",
"not",
"isinstance",
"(",
"v... | ddbbc8a592ebd7d80d9c3f87c8671523e3692a0d |
train | parse_value | Parse input string and return int, float or str depending on format.
@param val: Input string.
@param parsebool: If True parse yes / no, on / off as boolean.
@return: Value of type int, float or str. | pysysinfo/util.py | def parse_value(val, parsebool=False):
"""Parse input string and return int, float or str depending on format.
@param val: Input string.
@param parsebool: If True parse yes / no, on / off as boolean.
@return: Value of type int, float or str.
"""
try:
return i... | def parse_value(val, parsebool=False):
"""Parse input string and return int, float or str depending on format.
@param val: Input string.
@param parsebool: If True parse yes / no, on / off as boolean.
@return: Value of type int, float or str.
"""
try:
return i... | [
"Parse",
"input",
"string",
"and",
"return",
"int",
"float",
"or",
"str",
"depending",
"on",
"format",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/util.py#L27-L48 | [
"def",
"parse_value",
"(",
"val",
",",
"parsebool",
"=",
"False",
")",
":",
"try",
":",
"return",
"int",
"(",
"val",
")",
"except",
"ValueError",
":",
"pass",
"try",
":",
"return",
"float",
"(",
"val",
")",
"except",
":",
"pass",
"if",
"parsebool",
"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | socket_read | Buffered read from socket. Reads all data available from socket.
@fp: File pointer for socket.
@return: String of characters read from buffer. | pysysinfo/util.py | def socket_read(fp):
"""Buffered read from socket. Reads all data available from socket.
@fp: File pointer for socket.
@return: String of characters read from buffer.
"""
response = ''
oldlen = 0
newlen = 0
while True:
response += fp.read(buffSize)
newlen = ... | def socket_read(fp):
"""Buffered read from socket. Reads all data available from socket.
@fp: File pointer for socket.
@return: String of characters read from buffer.
"""
response = ''
oldlen = 0
newlen = 0
while True:
response += fp.read(buffSize)
newlen = ... | [
"Buffered",
"read",
"from",
"socket",
".",
"Reads",
"all",
"data",
"available",
"from",
"socket",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/util.py#L64-L81 | [
"def",
"socket_read",
"(",
"fp",
")",
":",
"response",
"=",
"''",
"oldlen",
"=",
"0",
"newlen",
"=",
"0",
"while",
"True",
":",
"response",
"+=",
"fp",
".",
"read",
"(",
"buffSize",
")",
"newlen",
"=",
"len",
"(",
"response",
")",
"if",
"newlen",
"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | exec_command | Convenience function that executes command and returns result.
@param args: Tuple of command and arguments.
@param env: Dictionary of environment variables.
(Environment is not modified if None.)
@return: Command output. | pysysinfo/util.py | def exec_command(args, env=None):
"""Convenience function that executes command and returns result.
@param args: Tuple of command and arguments.
@param env: Dictionary of environment variables.
(Environment is not modified if None.)
@return: Command output.
"""
t... | def exec_command(args, env=None):
"""Convenience function that executes command and returns result.
@param args: Tuple of command and arguments.
@param env: Dictionary of environment variables.
(Environment is not modified if None.)
@return: Command output.
"""
t... | [
"Convenience",
"function",
"that",
"executes",
"command",
"and",
"returns",
"result",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/util.py#L84-L106 | [
"def",
"exec_command",
"(",
"args",
",",
"env",
"=",
"None",
")",
":",
"try",
":",
"cmd",
"=",
"subprocess",
".",
"Popen",
"(",
"args",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"stderr",
"=",
"subprocess",
".",
"PIPE",
",",
"bufsize",
"=",... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | NestedDict.set_nested | D.set_nested((k1, k2,k3, ...), v) -> D[k1][k2][k3] ... = v | pysysinfo/util.py | def set_nested(self, klist, value):
"""D.set_nested((k1, k2,k3, ...), v) -> D[k1][k2][k3] ... = v"""
keys = list(klist)
if len(keys) > 0:
curr_dict = self
last_key = keys.pop()
for key in keys:
if not curr_dict.has_key(key) or not isinstance(cu... | def set_nested(self, klist, value):
"""D.set_nested((k1, k2,k3, ...), v) -> D[k1][k2][k3] ... = v"""
keys = list(klist)
if len(keys) > 0:
curr_dict = self
last_key = keys.pop()
for key in keys:
if not curr_dict.has_key(key) or not isinstance(cu... | [
"D",
".",
"set_nested",
"((",
"k1",
"k2",
"k3",
"...",
")",
"v",
")",
"-",
">",
"D",
"[",
"k1",
"]",
"[",
"k2",
"]",
"[",
"k3",
"]",
"...",
"=",
"v"
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/util.py#L156-L167 | [
"def",
"set_nested",
"(",
"self",
",",
"klist",
",",
"value",
")",
":",
"keys",
"=",
"list",
"(",
"klist",
")",
"if",
"len",
"(",
"keys",
")",
">",
"0",
":",
"curr_dict",
"=",
"self",
"last_key",
"=",
"keys",
".",
"pop",
"(",
")",
"for",
"key",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | TableFilter.registerFilter | Register filter on a column of table.
@param column: The column name.
@param patterns: A single pattern or a list of patterns used for
matching column values.
@param is_regex: The patterns will be treated as regex if True, the
... | pysysinfo/util.py | def registerFilter(self, column, patterns, is_regex=False,
ignore_case=False):
"""Register filter on a column of table.
@param column: The column name.
@param patterns: A single pattern or a list of patterns used for
matching ... | def registerFilter(self, column, patterns, is_regex=False,
ignore_case=False):
"""Register filter on a column of table.
@param column: The column name.
@param patterns: A single pattern or a list of patterns used for
matching ... | [
"Register",
"filter",
"on",
"a",
"column",
"of",
"table",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/util.py#L233-L264 | [
"def",
"registerFilter",
"(",
"self",
",",
"column",
",",
"patterns",
",",
"is_regex",
"=",
"False",
",",
"ignore_case",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"patterns",
",",
"basestring",
")",
":",
"patt_list",
"=",
"(",
"patterns",
",",
")"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | TableFilter.unregisterFilter | Unregister filter on a column of the table.
@param column: The column header. | pysysinfo/util.py | def unregisterFilter(self, column):
"""Unregister filter on a column of the table.
@param column: The column header.
"""
if self._filters.has_key(column):
del self._filters[column] | def unregisterFilter(self, column):
"""Unregister filter on a column of the table.
@param column: The column header.
"""
if self._filters.has_key(column):
del self._filters[column] | [
"Unregister",
"filter",
"on",
"a",
"column",
"of",
"the",
"table",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/util.py#L266-L273 | [
"def",
"unregisterFilter",
"(",
"self",
",",
"column",
")",
":",
"if",
"self",
".",
"_filters",
".",
"has_key",
"(",
"column",
")",
":",
"del",
"self",
".",
"_filters",
"[",
"column",
"]"
] | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | TableFilter.registerFilters | Register multiple filters at once.
@param **kwargs: Multiple filters are registered using keyword
variables. Each keyword must correspond to a field name
with an optional suffix:
field: Field equal to value or in list... | pysysinfo/util.py | def registerFilters(self, **kwargs):
"""Register multiple filters at once.
@param **kwargs: Multiple filters are registered using keyword
variables. Each keyword must correspond to a field name
with an optional suffix:
... | def registerFilters(self, **kwargs):
"""Register multiple filters at once.
@param **kwargs: Multiple filters are registered using keyword
variables. Each keyword must correspond to a field name
with an optional suffix:
... | [
"Register",
"multiple",
"filters",
"at",
"once",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/util.py#L275-L304 | [
"def",
"registerFilters",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"(",
"key",
",",
"patterns",
")",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"if",
"key",
".",
"endswith",
"(",
"'_regex'",
")",
":",
"col",
"=",
"key",
"[",
":",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | TableFilter.applyFilters | Apply filter on ps command result.
@param headers: List of column headers.
@param table: Nested list of rows and columns.
@return: Nested list of rows and columns filtered using
registered filters. | pysysinfo/util.py | def applyFilters(self, headers, table):
"""Apply filter on ps command result.
@param headers: List of column headers.
@param table: Nested list of rows and columns.
@return: Nested list of rows and columns filtered using
registered filters.
... | def applyFilters(self, headers, table):
"""Apply filter on ps command result.
@param headers: List of column headers.
@param table: Nested list of rows and columns.
@return: Nested list of rows and columns filtered using
registered filters.
... | [
"Apply",
"filter",
"on",
"ps",
"command",
"result",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/util.py#L306-L343 | [
"def",
"applyFilters",
"(",
"self",
",",
"headers",
",",
"table",
")",
":",
"result",
"=",
"[",
"]",
"column_idxs",
"=",
"{",
"}",
"for",
"column",
"in",
"self",
".",
"_filters",
".",
"keys",
"(",
")",
":",
"try",
":",
"column_idxs",
"[",
"column",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | Telnet.open | Connect to a host.
With a host argument, it connects the instance using TCP; port number
and timeout are optional, socket_file must be None. The port number
defaults to the standard telnet port (23).
With a socket_file argument, it connects the instance using
named soc... | pysysinfo/util.py | def open(self, host=None, port=0, socket_file=None,
timeout=socket.getdefaulttimeout()):
"""Connect to a host.
With a host argument, it connects the instance using TCP; port number
and timeout are optional, socket_file must be None. The port number
defaults to the standar... | def open(self, host=None, port=0, socket_file=None,
timeout=socket.getdefaulttimeout()):
"""Connect to a host.
With a host argument, it connects the instance using TCP; port number
and timeout are optional, socket_file must be None. The port number
defaults to the standar... | [
"Connect",
"to",
"a",
"host",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/util.py#L366-L395 | [
"def",
"open",
"(",
"self",
",",
"host",
"=",
"None",
",",
"port",
"=",
"0",
",",
"socket_file",
"=",
"None",
",",
"timeout",
"=",
"socket",
".",
"getdefaulttimeout",
"(",
")",
")",
":",
"self",
".",
"socket_file",
"=",
"socket_file",
"if",
"host",
"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | analyze | General analysis function that groups data by subject/list number and performs analysis.
Parameters
----------
egg : Egg data object
The data to be analyzed
subjgroup : list of strings or ints
String/int variables indicating how to group over subjects. Must be
the length of th... | quail/analysis/analysis.py | def analyze(egg, subjgroup=None, listgroup=None, subjname='Subject',
listname='List', analysis=None, position=0, permute=False,
n_perms=1000, parallel=False, match='exact',
distance='euclidean', features=None, ts=None):
"""
General analysis function that groups data by subjec... | def analyze(egg, subjgroup=None, listgroup=None, subjname='Subject',
listname='List', analysis=None, position=0, permute=False,
n_perms=1000, parallel=False, match='exact',
distance='euclidean', features=None, ts=None):
"""
General analysis function that groups data by subjec... | [
"General",
"analysis",
"function",
"that",
"groups",
"data",
"by",
"subject",
"/",
"list",
"number",
"and",
"performs",
"analysis",
"."
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/analysis/analysis.py#L31-L155 | [
"def",
"analyze",
"(",
"egg",
",",
"subjgroup",
"=",
"None",
",",
"listgroup",
"=",
"None",
",",
"subjname",
"=",
"'Subject'",
",",
"listname",
"=",
"'List'",
",",
"analysis",
"=",
"None",
",",
"position",
"=",
"0",
",",
"permute",
"=",
"False",
",",
... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | _analyze_chunk | Private function that groups data by subject/list number and performs
analysis for a chunk of data.
Parameters
----------
data : Egg data object
The data to be analyzed
subjgroup : list of strings or ints
String/int variables indicating how to group over subjects. Must be
... | quail/analysis/analysis.py | def _analyze_chunk(data, subjgroup=None, subjname='Subject', listgroup=None,
listname='List', analysis=None, analysis_type=None,
pass_features=False, features=None, parallel=False,
**kwargs):
"""
Private function that groups data by subject/list number an... | def _analyze_chunk(data, subjgroup=None, subjname='Subject', listgroup=None,
listname='List', analysis=None, analysis_type=None,
pass_features=False, features=None, parallel=False,
**kwargs):
"""
Private function that groups data by subject/list number an... | [
"Private",
"function",
"that",
"groups",
"data",
"by",
"subject",
"/",
"list",
"number",
"and",
"performs",
"analysis",
"for",
"a",
"chunk",
"of",
"data",
"."
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/analysis/analysis.py#L157-L236 | [
"def",
"_analyze_chunk",
"(",
"data",
",",
"subjgroup",
"=",
"None",
",",
"subjname",
"=",
"'Subject'",
",",
"listgroup",
"=",
"None",
",",
"listname",
"=",
"'List'",
",",
"analysis",
"=",
"None",
",",
"analysis_type",
"=",
"None",
",",
"pass_features",
"=... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | MuninTomcatPlugin.retrieveVals | Retrieve values for graphs. | pymunin/plugins/tomcatstats.py | def retrieveVals(self):
"""Retrieve values for graphs."""
if self.hasGraph('tomcat_memory'):
stats = self._tomcatInfo.getMemoryStats()
self.setGraphVal('tomcat_memory', 'used',
stats['total'] - stats['free'])
self.setGraphVal('tomcat_memo... | def retrieveVals(self):
"""Retrieve values for graphs."""
if self.hasGraph('tomcat_memory'):
stats = self._tomcatInfo.getMemoryStats()
self.setGraphVal('tomcat_memory', 'used',
stats['total'] - stats['free'])
self.setGraphVal('tomcat_memo... | [
"Retrieve",
"values",
"for",
"graphs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/tomcatstats.py#L196-L225 | [
"def",
"retrieveVals",
"(",
"self",
")",
":",
"if",
"self",
".",
"hasGraph",
"(",
"'tomcat_memory'",
")",
":",
"stats",
"=",
"self",
".",
"_tomcatInfo",
".",
"getMemoryStats",
"(",
")",
"self",
".",
"setGraphVal",
"(",
"'tomcat_memory'",
",",
"'used'",
","... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | function | Calculate the autocorrelation function for a 1D time series.
Parameters
----------
data : numpy.ndarray (N,)
The time series.
Returns
-------
rho : numpy.ndarray (N,)
An autocorrelation function. | acor/acor.py | def function(data, maxt=None):
"""
Calculate the autocorrelation function for a 1D time series.
Parameters
----------
data : numpy.ndarray (N,)
The time series.
Returns
-------
rho : numpy.ndarray (N,)
An autocorrelation function.
"""
data = np.atleast_1d(data)... | def function(data, maxt=None):
"""
Calculate the autocorrelation function for a 1D time series.
Parameters
----------
data : numpy.ndarray (N,)
The time series.
Returns
-------
rho : numpy.ndarray (N,)
An autocorrelation function.
"""
data = np.atleast_1d(data)... | [
"Calculate",
"the",
"autocorrelation",
"function",
"for",
"a",
"1D",
"time",
"series",
"."
] | dfm/acor | python | https://github.com/dfm/acor/blob/b55eb8efa7df6c73b6f3f0c9b64fa1c801e8f821/acor/acor.py#L36-L59 | [
"def",
"function",
"(",
"data",
",",
"maxt",
"=",
"None",
")",
":",
"data",
"=",
"np",
".",
"atleast_1d",
"(",
"data",
")",
"assert",
"len",
"(",
"np",
".",
"shape",
"(",
"data",
")",
")",
"==",
"1",
",",
"\"The autocorrelation function can only by compu... | b55eb8efa7df6c73b6f3f0c9b64fa1c801e8f821 |
train | MuninNginxPlugin.retrieveVals | Retrieve values for graphs. | pymunin/plugins/nginxstats.py | def retrieveVals(self):
"""Retrieve values for graphs."""
nginxInfo = NginxInfo(self._host, self._port,
self._user, self._password,
self._statuspath, self._ssl)
stats = nginxInfo.getServerStats()
if stats:
if... | def retrieveVals(self):
"""Retrieve values for graphs."""
nginxInfo = NginxInfo(self._host, self._port,
self._user, self._password,
self._statuspath, self._ssl)
stats = nginxInfo.getServerStats()
if stats:
if... | [
"Retrieve",
"values",
"for",
"graphs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/nginxstats.py#L151-L186 | [
"def",
"retrieveVals",
"(",
"self",
")",
":",
"nginxInfo",
"=",
"NginxInfo",
"(",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_user",
",",
"self",
".",
"_password",
",",
"self",
".",
"_statuspath",
",",
"self",
".",
"_ssl",
")... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninNginxPlugin.autoconf | Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise. | pymunin/plugins/nginxstats.py | def autoconf(self):
"""Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise.
"""
nginxInfo = NginxInfo(self._host, self._port,
self._user, self._password,
... | def autoconf(self):
"""Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise.
"""
nginxInfo = NginxInfo(self._host, self._port,
self._user, self._password,
... | [
"Implements",
"Munin",
"Plugin",
"Auto",
"-",
"Configuration",
"Option",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/nginxstats.py#L188-L197 | [
"def",
"autoconf",
"(",
"self",
")",
":",
"nginxInfo",
"=",
"NginxInfo",
"(",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_user",
",",
"self",
".",
"_password",
",",
"self",
".",
"_statuspath",
",",
"self",
".",
"_ssl",
")",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | PHPfpmInfo.getStats | Query and parse Web Server Status Page. | pysysinfo/phpfpm.py | def getStats(self):
"""Query and parse Web Server Status Page.
"""
url = "%s://%s:%d/%s" % (self._proto, self._host, self._port,
self._monpath)
response = util.get_url(url, self._user, self._password)
stats = {}
for line in respo... | def getStats(self):
"""Query and parse Web Server Status Page.
"""
url = "%s://%s:%d/%s" % (self._proto, self._host, self._port,
self._monpath)
response = util.get_url(url, self._user, self._password)
stats = {}
for line in respo... | [
"Query",
"and",
"parse",
"Web",
"Server",
"Status",
"Page",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/phpfpm.py#L65-L77 | [
"def",
"getStats",
"(",
"self",
")",
":",
"url",
"=",
"\"%s://%s:%d/%s\"",
"%",
"(",
"self",
".",
"_proto",
",",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_monpath",
")",
"response",
"=",
"util",
".",
"get_url",
"(",
"url",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninPHPapcPlugin.retrieveVals | Retrieve values for graphs. | pymunin/plugins/phpapcstats.py | def retrieveVals(self):
"""Retrieve values for graphs."""
apcinfo = APCinfo(self._host, self._port, self._user, self._password,
self._monpath, self._ssl, self._extras)
stats = apcinfo.getAllStats()
if self.hasGraph('php_apc_memory') and stats:
... | def retrieveVals(self):
"""Retrieve values for graphs."""
apcinfo = APCinfo(self._host, self._port, self._user, self._password,
self._monpath, self._ssl, self._extras)
stats = apcinfo.getAllStats()
if self.hasGraph('php_apc_memory') and stats:
... | [
"Retrieve",
"values",
"for",
"graphs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/phpapcstats.py#L196-L246 | [
"def",
"retrieveVals",
"(",
"self",
")",
":",
"apcinfo",
"=",
"APCinfo",
"(",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_user",
",",
"self",
".",
"_password",
",",
"self",
".",
"_monpath",
",",
"self",
".",
"_ssl",
",",
"s... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninPHPapcPlugin.autoconf | Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise. | pymunin/plugins/phpapcstats.py | def autoconf(self):
"""Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise.
"""
apcinfo = APCinfo(self._host, self._port, self._user, self._password,
self._monpath, self.... | def autoconf(self):
"""Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise.
"""
apcinfo = APCinfo(self._host, self._port, self._user, self._password,
self._monpath, self.... | [
"Implements",
"Munin",
"Plugin",
"Auto",
"-",
"Configuration",
"Option",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/phpapcstats.py#L248-L256 | [
"def",
"autoconf",
"(",
"self",
")",
":",
"apcinfo",
"=",
"APCinfo",
"(",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_user",
",",
"self",
".",
"_password",
",",
"self",
".",
"_monpath",
",",
"self",
".",
"_ssl",
")",
"retur... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | VarnishInfo.getStats | Runs varnishstats command to get stats from Varnish Cache.
@return: Dictionary of stats. | pysysinfo/varnish.py | def getStats(self):
"""Runs varnishstats command to get stats from Varnish Cache.
@return: Dictionary of stats.
"""
info_dict = {}
args = [varnishstatCmd, '-1']
if self._instance is not None:
args.extend(['-n', self._instance])
output = util.... | def getStats(self):
"""Runs varnishstats command to get stats from Varnish Cache.
@return: Dictionary of stats.
"""
info_dict = {}
args = [varnishstatCmd, '-1']
if self._instance is not None:
args.extend(['-n', self._instance])
output = util.... | [
"Runs",
"varnishstats",
"command",
"to",
"get",
"stats",
"from",
"Varnish",
"Cache",
".",
"@return",
":",
"Dictionary",
"of",
"stats",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/varnish.py#L39-L59 | [
"def",
"getStats",
"(",
"self",
")",
":",
"info_dict",
"=",
"{",
"}",
"args",
"=",
"[",
"varnishstatCmd",
",",
"'-1'",
"]",
"if",
"self",
".",
"_instance",
"is",
"not",
"None",
":",
"args",
".",
"extend",
"(",
"[",
"'-n'",
",",
"self",
".",
"_insta... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | VarnishInfo.getDesc | Returns description for stat entry.
@param entry: Entry name.
@return: Description for entry. | pysysinfo/varnish.py | def getDesc(self, entry):
"""Returns description for stat entry.
@param entry: Entry name.
@return: Description for entry.
"""
if len(self._descDict) == 0:
self.getStats()
return self._descDict.get(entry) | def getDesc(self, entry):
"""Returns description for stat entry.
@param entry: Entry name.
@return: Description for entry.
"""
if len(self._descDict) == 0:
self.getStats()
return self._descDict.get(entry) | [
"Returns",
"description",
"for",
"stat",
"entry",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/varnish.py#L71-L80 | [
"def",
"getDesc",
"(",
"self",
",",
"entry",
")",
":",
"if",
"len",
"(",
"self",
".",
"_descDict",
")",
"==",
"0",
":",
"self",
".",
"getStats",
"(",
")",
"return",
"self",
".",
"_descDict",
".",
"get",
"(",
"entry",
")"
] | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninPHPOPCPlugin.retrieveVals | Retrieve values for graphs. | pymunin/plugins/phpopcstats.py | def retrieveVals(self):
"""Retrieve values for graphs."""
opcinfo = OPCinfo(self._host, self._port, self._user, self._password,
self._monpath, self._ssl)
stats = opcinfo.getAllStats()
if self.hasGraph('php_opc_memory') and stats:
mem = stat... | def retrieveVals(self):
"""Retrieve values for graphs."""
opcinfo = OPCinfo(self._host, self._port, self._user, self._password,
self._monpath, self._ssl)
stats = opcinfo.getAllStats()
if self.hasGraph('php_opc_memory') and stats:
mem = stat... | [
"Retrieve",
"values",
"for",
"graphs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/phpopcstats.py#L148-L177 | [
"def",
"retrieveVals",
"(",
"self",
")",
":",
"opcinfo",
"=",
"OPCinfo",
"(",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_user",
",",
"self",
".",
"_password",
",",
"self",
".",
"_monpath",
",",
"self",
".",
"_ssl",
")",
"s... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninPHPOPCPlugin.autoconf | Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise. | pymunin/plugins/phpopcstats.py | def autoconf(self):
"""Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise.
"""
opcinfo = OPCinfo(self._host, self._port, self._user, self._password,
self._monpath, self.... | def autoconf(self):
"""Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise.
"""
opcinfo = OPCinfo(self._host, self._port, self._user, self._password,
self._monpath, self.... | [
"Implements",
"Munin",
"Plugin",
"Auto",
"-",
"Configuration",
"Option",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/phpopcstats.py#L179-L187 | [
"def",
"autoconf",
"(",
"self",
")",
":",
"opcinfo",
"=",
"OPCinfo",
"(",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_user",
",",
"self",
".",
"_password",
",",
"self",
".",
"_monpath",
",",
"self",
".",
"_ssl",
")",
"retur... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | fingerprint_helper | Computes clustering along a set of feature dimensions
Parameters
----------
egg : quail.Egg
Data to analyze
dist_funcs : dict
Dictionary of distance functions for feature clustering analyses
Returns
----------
probabilities : Numpy array
Each number represents cluste... | quail/analysis/clustering.py | def fingerprint_helper(egg, permute=False, n_perms=1000,
match='exact', distance='euclidean', features=None):
"""
Computes clustering along a set of feature dimensions
Parameters
----------
egg : quail.Egg
Data to analyze
dist_funcs : dict
Dictionary of d... | def fingerprint_helper(egg, permute=False, n_perms=1000,
match='exact', distance='euclidean', features=None):
"""
Computes clustering along a set of feature dimensions
Parameters
----------
egg : quail.Egg
Data to analyze
dist_funcs : dict
Dictionary of d... | [
"Computes",
"clustering",
"along",
"a",
"set",
"of",
"feature",
"dimensions"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/analysis/clustering.py#L9-L37 | [
"def",
"fingerprint_helper",
"(",
"egg",
",",
"permute",
"=",
"False",
",",
"n_perms",
"=",
"1000",
",",
"match",
"=",
"'exact'",
",",
"distance",
"=",
"'euclidean'",
",",
"features",
"=",
"None",
")",
":",
"if",
"features",
"is",
"None",
":",
"features"... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | compute_feature_weights | Compute clustering scores along a set of feature dimensions
Parameters
----------
pres_list : list
list of presented words
rec_list : list
list of recalled words
feature_list : list
list of feature dicts for presented words
distances : dict
dict of distance ma... | quail/analysis/clustering.py | def compute_feature_weights(pres_list, rec_list, feature_list, distances):
"""
Compute clustering scores along a set of feature dimensions
Parameters
----------
pres_list : list
list of presented words
rec_list : list
list of recalled words
feature_list : list
list... | def compute_feature_weights(pres_list, rec_list, feature_list, distances):
"""
Compute clustering scores along a set of feature dimensions
Parameters
----------
pres_list : list
list of presented words
rec_list : list
list of recalled words
feature_list : list
list... | [
"Compute",
"clustering",
"scores",
"along",
"a",
"set",
"of",
"feature",
"dimensions"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/analysis/clustering.py#L137-L218 | [
"def",
"compute_feature_weights",
"(",
"pres_list",
",",
"rec_list",
",",
"feature_list",
",",
"distances",
")",
":",
"# initialize the weights object for just this list",
"weights",
"=",
"{",
"}",
"for",
"feature",
"in",
"feature_list",
"[",
"0",
"]",
":",
"weights... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | lagcrp_helper | Computes probabilities for each transition distance (probability that a word
recalled will be a given distance--in presentation order--from the previous
recalled word).
Parameters
----------
egg : quail.Egg
Data to analyze
match : str (exact, best or smooth)
Matching approach t... | quail/analysis/lagcrp.py | def lagcrp_helper(egg, match='exact', distance='euclidean',
ts=None, features=None):
"""
Computes probabilities for each transition distance (probability that a word
recalled will be a given distance--in presentation order--from the previous
recalled word).
Parameters
--------... | def lagcrp_helper(egg, match='exact', distance='euclidean',
ts=None, features=None):
"""
Computes probabilities for each transition distance (probability that a word
recalled will be a given distance--in presentation order--from the previous
recalled word).
Parameters
--------... | [
"Computes",
"probabilities",
"for",
"each",
"transition",
"distance",
"(",
"probability",
"that",
"a",
"word",
"recalled",
"will",
"be",
"a",
"given",
"distance",
"--",
"in",
"presentation",
"order",
"--",
"from",
"the",
"previous",
"recalled",
"word",
")",
".... | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/analysis/lagcrp.py#L7-L129 | [
"def",
"lagcrp_helper",
"(",
"egg",
",",
"match",
"=",
"'exact'",
",",
"distance",
"=",
"'euclidean'",
",",
"ts",
"=",
"None",
",",
"features",
"=",
"None",
")",
":",
"def",
"lagcrp",
"(",
"rec",
",",
"lstlen",
")",
":",
"\"\"\"Computes lag-crp for a given... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | MuninDiskIOplugin.retrieveVals | Retrieve values for graphs. | pymunin/plugins/diskiostats.py | def retrieveVals(self):
"""Retrieve values for graphs."""
if self._diskList:
self._fetchDevAll('disk', self._diskList,
self._info.getDiskStats)
if self._mdList:
self._fetchDevAll('md', self._mdList,
self._info.... | def retrieveVals(self):
"""Retrieve values for graphs."""
if self._diskList:
self._fetchDevAll('disk', self._diskList,
self._info.getDiskStats)
if self._mdList:
self._fetchDevAll('md', self._mdList,
self._info.... | [
"Retrieve",
"values",
"for",
"graphs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/diskiostats.py#L125-L140 | [
"def",
"retrieveVals",
"(",
"self",
")",
":",
"if",
"self",
".",
"_diskList",
":",
"self",
".",
"_fetchDevAll",
"(",
"'disk'",
",",
"self",
".",
"_diskList",
",",
"self",
".",
"_info",
".",
"getDiskStats",
")",
"if",
"self",
".",
"_mdList",
":",
"self"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninDiskIOplugin._configDevRequests | Generate configuration for I/O Request stats.
@param namestr: Field name component indicating device type.
@param titlestr: Title component indicating device type.
@param devlist: List of devices. | pymunin/plugins/diskiostats.py | def _configDevRequests(self, namestr, titlestr, devlist):
"""Generate configuration for I/O Request stats.
@param namestr: Field name component indicating device type.
@param titlestr: Title component indicating device type.
@param devlist: List of devices.
""... | def _configDevRequests(self, namestr, titlestr, devlist):
"""Generate configuration for I/O Request stats.
@param namestr: Field name component indicating device type.
@param titlestr: Title component indicating device type.
@param devlist: List of devices.
""... | [
"Generate",
"configuration",
"for",
"I",
"/",
"O",
"Request",
"stats",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/diskiostats.py#L142-L170 | [
"def",
"_configDevRequests",
"(",
"self",
",",
"namestr",
",",
"titlestr",
",",
"devlist",
")",
":",
"name",
"=",
"'diskio_%s_requests'",
"%",
"namestr",
"if",
"self",
".",
"graphEnabled",
"(",
"name",
")",
":",
"graph",
"=",
"MuninGraph",
"(",
"'Disk I/O - ... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninDiskIOplugin._configDevActive | Generate configuration for I/O Queue Length.
@param namestr: Field name component indicating device type.
@param titlestr: Title component indicating device type.
@param devlist: List of devices. | pymunin/plugins/diskiostats.py | def _configDevActive(self, namestr, titlestr, devlist):
"""Generate configuration for I/O Queue Length.
@param namestr: Field name component indicating device type.
@param titlestr: Title component indicating device type.
@param devlist: List of devices.
"""
... | def _configDevActive(self, namestr, titlestr, devlist):
"""Generate configuration for I/O Queue Length.
@param namestr: Field name component indicating device type.
@param titlestr: Title component indicating device type.
@param devlist: List of devices.
"""
... | [
"Generate",
"configuration",
"for",
"I",
"/",
"O",
"Queue",
"Length",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/diskiostats.py#L202-L224 | [
"def",
"_configDevActive",
"(",
"self",
",",
"namestr",
",",
"titlestr",
",",
"devlist",
")",
":",
"name",
"=",
"'diskio_%s_active'",
"%",
"namestr",
"if",
"self",
".",
"graphEnabled",
"(",
"name",
")",
":",
"graph",
"=",
"MuninGraph",
"(",
"'Disk I/O - %s -... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninDiskIOplugin._fetchDevAll | Initialize I/O stats for devices.
@param namestr: Field name component indicating device type.
@param devlist: List of devices.
@param statsfunc: Function for retrieving stats for device. | pymunin/plugins/diskiostats.py | def _fetchDevAll(self, namestr, devlist, statsfunc):
"""Initialize I/O stats for devices.
@param namestr: Field name component indicating device type.
@param devlist: List of devices.
@param statsfunc: Function for retrieving stats for device.
"""
fo... | def _fetchDevAll(self, namestr, devlist, statsfunc):
"""Initialize I/O stats for devices.
@param namestr: Field name component indicating device type.
@param devlist: List of devices.
@param statsfunc: Function for retrieving stats for device.
"""
fo... | [
"Initialize",
"I",
"/",
"O",
"stats",
"for",
"devices",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/diskiostats.py#L226-L246 | [
"def",
"_fetchDevAll",
"(",
"self",
",",
"namestr",
",",
"devlist",
",",
"statsfunc",
")",
":",
"for",
"dev",
"in",
"devlist",
":",
"stats",
"=",
"statsfunc",
"(",
"dev",
")",
"name",
"=",
"'diskio_%s_requests'",
"%",
"namestr",
"if",
"self",
".",
"hasGr... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | RedisPlugin.retrieveVals | Retrieve values for graphs. | pymunin/plugins/redisstats.py | def retrieveVals(self):
"""Retrieve values for graphs."""
for graph_name in self.getGraphList():
for field_name in self.getGraphFieldList(graph_name):
self.setGraphVal(graph_name, field_name, self._stats.get(field_name)) | def retrieveVals(self):
"""Retrieve values for graphs."""
for graph_name in self.getGraphList():
for field_name in self.getGraphFieldList(graph_name):
self.setGraphVal(graph_name, field_name, self._stats.get(field_name)) | [
"Retrieve",
"values",
"for",
"graphs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/redisstats.py#L296-L300 | [
"def",
"retrieveVals",
"(",
"self",
")",
":",
"for",
"graph_name",
"in",
"self",
".",
"getGraphList",
"(",
")",
":",
"for",
"field_name",
"in",
"self",
".",
"getGraphFieldList",
"(",
"graph_name",
")",
":",
"self",
".",
"setGraphVal",
"(",
"graph_name",
",... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninSysStatsPlugin.retrieveVals | Retrieve values for graphs. | pymunin/plugins/sysstats.py | def retrieveVals(self):
"""Retrieve values for graphs."""
if self.hasGraph('sys_loadavg'):
self._loadstats = self._sysinfo.getLoadAvg()
if self._loadstats:
self.setGraphVal('sys_loadavg', 'load15min', self._loadstats[2])
self.setGraphVal('sys_loada... | def retrieveVals(self):
"""Retrieve values for graphs."""
if self.hasGraph('sys_loadavg'):
self._loadstats = self._sysinfo.getLoadAvg()
if self._loadstats:
self.setGraphVal('sys_loadavg', 'load15min', self._loadstats[2])
self.setGraphVal('sys_loada... | [
"Retrieve",
"values",
"for",
"graphs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/sysstats.py#L211-L274 | [
"def",
"retrieveVals",
"(",
"self",
")",
":",
"if",
"self",
".",
"hasGraph",
"(",
"'sys_loadavg'",
")",
":",
"self",
".",
"_loadstats",
"=",
"self",
".",
"_sysinfo",
".",
"getLoadAvg",
"(",
")",
"if",
"self",
".",
"_loadstats",
":",
"self",
".",
"setGr... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | get | Searches os.environ. If a key is found try evaluating its type else;
return the string.
returns: k->value (type as defined by ast.literal_eval) | dotenv/__init__.py | def get(key, default=None):
"""
Searches os.environ. If a key is found try evaluating its type else;
return the string.
returns: k->value (type as defined by ast.literal_eval)
"""
try:
# Attempt to evaluate into python literal
return ast.literal_eval(os.environ.get(k... | def get(key, default=None):
"""
Searches os.environ. If a key is found try evaluating its type else;
return the string.
returns: k->value (type as defined by ast.literal_eval)
"""
try:
# Attempt to evaluate into python literal
return ast.literal_eval(os.environ.get(k... | [
"Searches",
"os",
".",
"environ",
".",
"If",
"a",
"key",
"is",
"found",
"try",
"evaluating",
"its",
"type",
"else",
";",
"return",
"the",
"string",
"."
] | mattseymour/python-env | python | https://github.com/mattseymour/python-env/blob/5ac09b1685fbba75c174c79cb40287aa49d0f208/dotenv/__init__.py#L17-L28 | [
"def",
"get",
"(",
"key",
",",
"default",
"=",
"None",
")",
":",
"try",
":",
"# Attempt to evaluate into python literal",
"return",
"ast",
".",
"literal_eval",
"(",
"os",
".",
"environ",
".",
"get",
"(",
"key",
".",
"upper",
"(",
")",
",",
"default",
")"... | 5ac09b1685fbba75c174c79cb40287aa49d0f208 |
train | save | Saves a list of keyword arguments as environment variables to a file.
If no filepath given will default to the default `.env` file. | dotenv/__init__.py | def save(filepath=None, **kwargs):
"""
Saves a list of keyword arguments as environment variables to a file.
If no filepath given will default to the default `.env` file.
"""
if filepath is None:
filepath = os.path.join('.env')
with open(filepath, 'wb') as file_handle:
f... | def save(filepath=None, **kwargs):
"""
Saves a list of keyword arguments as environment variables to a file.
If no filepath given will default to the default `.env` file.
"""
if filepath is None:
filepath = os.path.join('.env')
with open(filepath, 'wb') as file_handle:
f... | [
"Saves",
"a",
"list",
"of",
"keyword",
"arguments",
"as",
"environment",
"variables",
"to",
"a",
"file",
".",
"If",
"no",
"filepath",
"given",
"will",
"default",
"to",
"the",
"default",
".",
"env",
"file",
"."
] | mattseymour/python-env | python | https://github.com/mattseymour/python-env/blob/5ac09b1685fbba75c174c79cb40287aa49d0f208/dotenv/__init__.py#L31-L43 | [
"def",
"save",
"(",
"filepath",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"filepath",
"is",
"None",
":",
"filepath",
"=",
"os",
".",
"path",
".",
"join",
"(",
"'.env'",
")",
"with",
"open",
"(",
"filepath",
",",
"'wb'",
")",
"as",
"fi... | 5ac09b1685fbba75c174c79cb40287aa49d0f208 |
train | load | Reads a .env file into os.environ.
For a set filepath, open the file and read contents into os.environ.
If filepath is not set then look in current dir for a .env file. | dotenv/__init__.py | def load(filepath=None):
"""
Reads a .env file into os.environ.
For a set filepath, open the file and read contents into os.environ.
If filepath is not set then look in current dir for a .env file.
"""
if filepath and os.path.exists(filepath):
pass
else:
if not o... | def load(filepath=None):
"""
Reads a .env file into os.environ.
For a set filepath, open the file and read contents into os.environ.
If filepath is not set then look in current dir for a .env file.
"""
if filepath and os.path.exists(filepath):
pass
else:
if not o... | [
"Reads",
"a",
".",
"env",
"file",
"into",
"os",
".",
"environ",
"."
] | mattseymour/python-env | python | https://github.com/mattseymour/python-env/blob/5ac09b1685fbba75c174c79cb40287aa49d0f208/dotenv/__init__.py#L46-L64 | [
"def",
"load",
"(",
"filepath",
"=",
"None",
")",
":",
"if",
"filepath",
"and",
"os",
".",
"path",
".",
"exists",
"(",
"filepath",
")",
":",
"pass",
"else",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"'.env'",
")",
":",
"return",
"F... | 5ac09b1685fbba75c174c79cb40287aa49d0f208 |
train | _get_line_ | Gets each line from the file and parse the data.
Attempt to translate the value into a python type is possible
(falls back to string). | dotenv/__init__.py | def _get_line_(filepath):
"""
Gets each line from the file and parse the data.
Attempt to translate the value into a python type is possible
(falls back to string).
"""
for line in open(filepath):
line = line.strip()
# allows for comments in the file
if line.startswith('#... | def _get_line_(filepath):
"""
Gets each line from the file and parse the data.
Attempt to translate the value into a python type is possible
(falls back to string).
"""
for line in open(filepath):
line = line.strip()
# allows for comments in the file
if line.startswith('#... | [
"Gets",
"each",
"line",
"from",
"the",
"file",
"and",
"parse",
"the",
"data",
".",
"Attempt",
"to",
"translate",
"the",
"value",
"into",
"a",
"python",
"type",
"is",
"possible",
"(",
"falls",
"back",
"to",
"string",
")",
"."
] | mattseymour/python-env | python | https://github.com/mattseymour/python-env/blob/5ac09b1685fbba75c174c79cb40287aa49d0f208/dotenv/__init__.py#L67-L94 | [
"def",
"_get_line_",
"(",
"filepath",
")",
":",
"for",
"line",
"in",
"open",
"(",
"filepath",
")",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"# allows for comments in the file",
"if",
"line",
".",
"startswith",
"(",
"'#'",
")",
"or",
"'='",
"not"... | 5ac09b1685fbba75c174c79cb40287aa49d0f208 |
train | ApacheInfo.initStats | Query and parse Apache Web Server Status Page. | pysysinfo/apache.py | def initStats(self):
"""Query and parse Apache Web Server Status Page."""
url = "%s://%s:%d/%s?auto" % (self._proto, self._host, self._port,
self._statuspath)
response = util.get_url(url, self._user, self._password)
self._statusDict = {}
f... | def initStats(self):
"""Query and parse Apache Web Server Status Page."""
url = "%s://%s:%d/%s?auto" % (self._proto, self._host, self._port,
self._statuspath)
response = util.get_url(url, self._user, self._password)
self._statusDict = {}
f... | [
"Query",
"and",
"parse",
"Apache",
"Web",
"Server",
"Status",
"Page",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/apache.py#L68-L79 | [
"def",
"initStats",
"(",
"self",
")",
":",
"url",
"=",
"\"%s://%s:%d/%s?auto\"",
"%",
"(",
"self",
".",
"_proto",
",",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_statuspath",
")",
"response",
"=",
"util",
".",
"get_url",
"(",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | Egg.get_pres_features | Returns a df of features for presented items | quail/egg.py | def get_pres_features(self, features=None):
"""
Returns a df of features for presented items
"""
if features is None:
features = self.dist_funcs.keys()
elif not isinstance(features, list):
features = [features]
return self.pres.applymap(lambda x: {... | def get_pres_features(self, features=None):
"""
Returns a df of features for presented items
"""
if features is None:
features = self.dist_funcs.keys()
elif not isinstance(features, list):
features = [features]
return self.pres.applymap(lambda x: {... | [
"Returns",
"a",
"df",
"of",
"features",
"for",
"presented",
"items"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/egg.py#L220-L228 | [
"def",
"get_pres_features",
"(",
"self",
",",
"features",
"=",
"None",
")",
":",
"if",
"features",
"is",
"None",
":",
"features",
"=",
"self",
".",
"dist_funcs",
".",
"keys",
"(",
")",
"elif",
"not",
"isinstance",
"(",
"features",
",",
"list",
")",
":"... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | Egg.get_rec_features | Returns a df of features for recalled items | quail/egg.py | def get_rec_features(self, features=None):
"""
Returns a df of features for recalled items
"""
if features is None:
features = self.dist_funcs.keys()
elif not isinstance(features, list):
features = [features]
return self.rec.applymap(lambda x: {k:v... | def get_rec_features(self, features=None):
"""
Returns a df of features for recalled items
"""
if features is None:
features = self.dist_funcs.keys()
elif not isinstance(features, list):
features = [features]
return self.rec.applymap(lambda x: {k:v... | [
"Returns",
"a",
"df",
"of",
"features",
"for",
"recalled",
"items"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/egg.py#L236-L244 | [
"def",
"get_rec_features",
"(",
"self",
",",
"features",
"=",
"None",
")",
":",
"if",
"features",
"is",
"None",
":",
"features",
"=",
"self",
".",
"dist_funcs",
".",
"keys",
"(",
")",
"elif",
"not",
"isinstance",
"(",
"features",
",",
"list",
")",
":",... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | Egg.info | Print info about the data egg | quail/egg.py | def info(self):
"""
Print info about the data egg
"""
print('Number of subjects: ' + str(self.n_subjects))
print('Number of lists per subject: ' + str(self.n_lists))
print('Number of words per list: ' + str(self.list_length))
print('Date created: ' + str(self.date... | def info(self):
"""
Print info about the data egg
"""
print('Number of subjects: ' + str(self.n_subjects))
print('Number of lists per subject: ' + str(self.n_lists))
print('Number of words per list: ' + str(self.list_length))
print('Date created: ' + str(self.date... | [
"Print",
"info",
"about",
"the",
"data",
"egg"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/egg.py#L247-L255 | [
"def",
"info",
"(",
"self",
")",
":",
"print",
"(",
"'Number of subjects: '",
"+",
"str",
"(",
"self",
".",
"n_subjects",
")",
")",
"print",
"(",
"'Number of lists per subject: '",
"+",
"str",
"(",
"self",
".",
"n_lists",
")",
")",
"print",
"(",
"'Number o... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | Egg.save | Save method for the Egg object
The data will be saved as a 'egg' file, which is a dictionary containing
the elements of a Egg saved in the hd5 format using
`deepdish`.
Parameters
----------
fname : str
A name for the file. If the file extension (.egg) is n... | quail/egg.py | def save(self, fname, compression='blosc'):
"""
Save method for the Egg object
The data will be saved as a 'egg' file, which is a dictionary containing
the elements of a Egg saved in the hd5 format using
`deepdish`.
Parameters
----------
fname : str
... | def save(self, fname, compression='blosc'):
"""
Save method for the Egg object
The data will be saved as a 'egg' file, which is a dictionary containing
the elements of a Egg saved in the hd5 format using
`deepdish`.
Parameters
----------
fname : str
... | [
"Save",
"method",
"for",
"the",
"Egg",
"object"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/egg.py#L257-L298 | [
"def",
"save",
"(",
"self",
",",
"fname",
",",
"compression",
"=",
"'blosc'",
")",
":",
"# put egg vars into a dict",
"egg",
"=",
"{",
"'pres'",
":",
"df2list",
"(",
"self",
".",
"pres",
")",
",",
"'rec'",
":",
"df2list",
"(",
"self",
".",
"rec",
")",
... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | FriedEgg.save | Save method for the FriedEgg object
The data will be saved as a 'fegg' file, which is a dictionary containing
the elements of a FriedEgg saved in the hd5 format using
`deepdish`.
Parameters
----------
fname : str
A name for the file. If the file extension ... | quail/egg.py | def save(self, fname, compression='blosc'):
"""
Save method for the FriedEgg object
The data will be saved as a 'fegg' file, which is a dictionary containing
the elements of a FriedEgg saved in the hd5 format using
`deepdish`.
Parameters
----------
fnam... | def save(self, fname, compression='blosc'):
"""
Save method for the FriedEgg object
The data will be saved as a 'fegg' file, which is a dictionary containing
the elements of a FriedEgg saved in the hd5 format using
`deepdish`.
Parameters
----------
fnam... | [
"Save",
"method",
"for",
"the",
"FriedEgg",
"object"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/egg.py#L381-L418 | [
"def",
"save",
"(",
"self",
",",
"fname",
",",
"compression",
"=",
"'blosc'",
")",
":",
"egg",
"=",
"{",
"'data'",
":",
"self",
".",
"data",
",",
"'analysis'",
":",
"self",
".",
"analysis",
",",
"'list_length'",
":",
"self",
".",
"list_length",
",",
... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | pnr_helper | Computes probability of a word being recalled nth (in the appropriate recall
list), given its presentation position. Note: zero indexed
Parameters
----------
egg : quail.Egg
Data to analyze
position : int
Position of item to be analyzed
match : str (exact, best or smooth)
... | quail/analysis/pnr.py | def pnr_helper(egg, position, match='exact',
distance='euclidean', features=None):
"""
Computes probability of a word being recalled nth (in the appropriate recall
list), given its presentation position. Note: zero indexed
Parameters
----------
egg : quail.Egg
Data to a... | def pnr_helper(egg, position, match='exact',
distance='euclidean', features=None):
"""
Computes probability of a word being recalled nth (in the appropriate recall
list), given its presentation position. Note: zero indexed
Parameters
----------
egg : quail.Egg
Data to a... | [
"Computes",
"probability",
"of",
"a",
"word",
"being",
"recalled",
"nth",
"(",
"in",
"the",
"appropriate",
"recall",
"list",
")",
"given",
"its",
"presentation",
"position",
".",
"Note",
":",
"zero",
"indexed"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/analysis/pnr.py#L4-L52 | [
"def",
"pnr_helper",
"(",
"egg",
",",
"position",
",",
"match",
"=",
"'exact'",
",",
"distance",
"=",
"'euclidean'",
",",
"features",
"=",
"None",
")",
":",
"def",
"pnr",
"(",
"lst",
",",
"position",
")",
":",
"return",
"[",
"1",
"if",
"pos",
"==",
... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | MuninApachePlugin.retrieveVals | Retrieve values for graphs. | pymunin/plugins/apachestats.py | def retrieveVals(self):
"""Retrieve values for graphs."""
apacheInfo = ApacheInfo(self._host, self._port,
self._user, self._password,
self._statuspath, self._ssl)
stats = apacheInfo.getServerStats()
if self.hasGraph('apache... | def retrieveVals(self):
"""Retrieve values for graphs."""
apacheInfo = ApacheInfo(self._host, self._port,
self._user, self._password,
self._statuspath, self._ssl)
stats = apacheInfo.getServerStats()
if self.hasGraph('apache... | [
"Retrieve",
"values",
"for",
"graphs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/apachestats.py#L124-L138 | [
"def",
"retrieveVals",
"(",
"self",
")",
":",
"apacheInfo",
"=",
"ApacheInfo",
"(",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_user",
",",
"self",
".",
"_password",
",",
"self",
".",
"_statuspath",
",",
"self",
".",
"_ssl",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninApachePlugin.autoconf | Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise. | pymunin/plugins/apachestats.py | def autoconf(self):
"""Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise.
"""
apacheInfo = ApacheInfo(self._host, self._port,
self._user, self._password,
... | def autoconf(self):
"""Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise.
"""
apacheInfo = ApacheInfo(self._host, self._port,
self._user, self._password,
... | [
"Implements",
"Munin",
"Plugin",
"Auto",
"-",
"Configuration",
"Option",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/apachestats.py#L140-L149 | [
"def",
"autoconf",
"(",
"self",
")",
":",
"apacheInfo",
"=",
"ApacheInfo",
"(",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_user",
",",
"self",
".",
"_password",
",",
"self",
".",
"_statuspath",
",",
"self",
".",
"_ssl",
")",... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninNTPhostOffsetsPlugin.retrieveVals | Retrieve values for graphs. | pymunin/plugins/ntphostoffsets.py | def retrieveVals(self):
"""Retrieve values for graphs."""
ntpinfo = NTPinfo()
ntpstats = ntpinfo.getHostOffsets(self._remoteHosts)
if ntpstats:
for host in self._remoteHosts:
hostkey = re.sub('\.', '_', host)
hoststats = ntpstats.get(host)
... | def retrieveVals(self):
"""Retrieve values for graphs."""
ntpinfo = NTPinfo()
ntpstats = ntpinfo.getHostOffsets(self._remoteHosts)
if ntpstats:
for host in self._remoteHosts:
hostkey = re.sub('\.', '_', host)
hoststats = ntpstats.get(host)
... | [
"Retrieve",
"values",
"for",
"graphs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/ntphostoffsets.py#L119-L136 | [
"def",
"retrieveVals",
"(",
"self",
")",
":",
"ntpinfo",
"=",
"NTPinfo",
"(",
")",
"ntpstats",
"=",
"ntpinfo",
".",
"getHostOffsets",
"(",
"self",
".",
"_remoteHosts",
")",
"if",
"ntpstats",
":",
"for",
"host",
"in",
"self",
".",
"_remoteHosts",
":",
"ho... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninNTPhostOffsetsPlugin.autoconf | Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise. | pymunin/plugins/ntphostoffsets.py | def autoconf(self):
"""Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise.
"""
ntpinfo = NTPinfo()
ntpstats = ntpinfo.getHostOffsets(self._remoteHosts)
return len(ntpstats) > 0 | def autoconf(self):
"""Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise.
"""
ntpinfo = NTPinfo()
ntpstats = ntpinfo.getHostOffsets(self._remoteHosts)
return len(ntpstats) > 0 | [
"Implements",
"Munin",
"Plugin",
"Auto",
"-",
"Configuration",
"Option",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/ntphostoffsets.py#L138-L146 | [
"def",
"autoconf",
"(",
"self",
")",
":",
"ntpinfo",
"=",
"NTPinfo",
"(",
")",
"ntpstats",
"=",
"ntpinfo",
".",
"getHostOffsets",
"(",
"self",
".",
"_remoteHosts",
")",
"return",
"len",
"(",
"ntpstats",
")",
">",
"0"
] | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninLighttpdPlugin.retrieveVals | Retrieve values for graphs. | pymunin/plugins/lighttpdstats.py | def retrieveVals(self):
"""Retrieve values for graphs."""
lighttpdInfo = LighttpdInfo(self._host, self._port,
self._user, self._password,
self._statuspath, self._ssl)
stats = lighttpdInfo.getServerStats()
if self.hasGraph('... | def retrieveVals(self):
"""Retrieve values for graphs."""
lighttpdInfo = LighttpdInfo(self._host, self._port,
self._user, self._password,
self._statuspath, self._ssl)
stats = lighttpdInfo.getServerStats()
if self.hasGraph('... | [
"Retrieve",
"values",
"for",
"graphs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/lighttpdstats.py#L124-L138 | [
"def",
"retrieveVals",
"(",
"self",
")",
":",
"lighttpdInfo",
"=",
"LighttpdInfo",
"(",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_user",
",",
"self",
".",
"_password",
",",
"self",
".",
"_statuspath",
",",
"self",
".",
"_ssl"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninLighttpdPlugin.autoconf | Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise. | pymunin/plugins/lighttpdstats.py | def autoconf(self):
"""Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise.
"""
lighttpdInfo = LighttpdInfo(self._host, self._port,
self._user, self._password,
... | def autoconf(self):
"""Implements Munin Plugin Auto-Configuration Option.
@return: True if plugin can be auto-configured, False otherwise.
"""
lighttpdInfo = LighttpdInfo(self._host, self._port,
self._user, self._password,
... | [
"Implements",
"Munin",
"Plugin",
"Auto",
"-",
"Configuration",
"Option",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/lighttpdstats.py#L140-L149 | [
"def",
"autoconf",
"(",
"self",
")",
":",
"lighttpdInfo",
"=",
"LighttpdInfo",
"(",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_user",
",",
"self",
".",
"_password",
",",
"self",
".",
"_statuspath",
",",
"self",
".",
"_ssl",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninDiskUsagePlugin.retrieveVals | Retrieve values for graphs. | pymunin/plugins/diskusagestats.py | def retrieveVals(self):
"""Retrieve values for graphs."""
name = 'diskspace'
if self.hasGraph(name):
for fspath in self._fslist:
if self._statsSpace.has_key(fspath):
self.setGraphVal(name, fspath,
self._statsSp... | def retrieveVals(self):
"""Retrieve values for graphs."""
name = 'diskspace'
if self.hasGraph(name):
for fspath in self._fslist:
if self._statsSpace.has_key(fspath):
self.setGraphVal(name, fspath,
self._statsSp... | [
"Retrieve",
"values",
"for",
"graphs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/diskusagestats.py#L121-L134 | [
"def",
"retrieveVals",
"(",
"self",
")",
":",
"name",
"=",
"'diskspace'",
"if",
"self",
".",
"hasGraph",
"(",
"name",
")",
":",
"for",
"fspath",
"in",
"self",
".",
"_fslist",
":",
"if",
"self",
".",
"_statsSpace",
".",
"has_key",
"(",
"fspath",
")",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | UmfpackContext.symbolic | Perform symbolic object (symbolic LU decomposition) computation for a given
sparsity pattern. | scikits/umfpack/umfpack.py | def symbolic(self, mtx):
"""
Perform symbolic object (symbolic LU decomposition) computation for a given
sparsity pattern.
"""
self.free_symbolic()
indx = self._getIndx(mtx)
if not assumeSortedIndices:
# row/column indices cannot be assumed to be sor... | def symbolic(self, mtx):
"""
Perform symbolic object (symbolic LU decomposition) computation for a given
sparsity pattern.
"""
self.free_symbolic()
indx = self._getIndx(mtx)
if not assumeSortedIndices:
# row/column indices cannot be assumed to be sor... | [
"Perform",
"symbolic",
"object",
"(",
"symbolic",
"LU",
"decomposition",
")",
"computation",
"for",
"a",
"given",
"sparsity",
"pattern",
"."
] | scikit-umfpack/scikit-umfpack | python | https://github.com/scikit-umfpack/scikit-umfpack/blob/a2102ef92f4dd060138e72bb5d7c444f8ec49cbc/scikits/umfpack/umfpack.py#L492-L525 | [
"def",
"symbolic",
"(",
"self",
",",
"mtx",
")",
":",
"self",
".",
"free_symbolic",
"(",
")",
"indx",
"=",
"self",
".",
"_getIndx",
"(",
"mtx",
")",
"if",
"not",
"assumeSortedIndices",
":",
"# row/column indices cannot be assumed to be sorted",
"mtx",
".",
"so... | a2102ef92f4dd060138e72bb5d7c444f8ec49cbc |
train | UmfpackContext.numeric | Perform numeric object (LU decomposition) computation using the
symbolic decomposition. The symbolic decomposition is (re)computed
if necessary. | scikits/umfpack/umfpack.py | def numeric(self, mtx):
"""
Perform numeric object (LU decomposition) computation using the
symbolic decomposition. The symbolic decomposition is (re)computed
if necessary.
"""
self.free_numeric()
if self._symbolic is None:
self.symbolic(mtx)
... | def numeric(self, mtx):
"""
Perform numeric object (LU decomposition) computation using the
symbolic decomposition. The symbolic decomposition is (re)computed
if necessary.
"""
self.free_numeric()
if self._symbolic is None:
self.symbolic(mtx)
... | [
"Perform",
"numeric",
"object",
"(",
"LU",
"decomposition",
")",
"computation",
"using",
"the",
"symbolic",
"decomposition",
".",
"The",
"symbolic",
"decomposition",
"is",
"(",
"re",
")",
"computed",
"if",
"necessary",
"."
] | scikit-umfpack/scikit-umfpack | python | https://github.com/scikit-umfpack/scikit-umfpack/blob/a2102ef92f4dd060138e72bb5d7c444f8ec49cbc/scikits/umfpack/umfpack.py#L532-L577 | [
"def",
"numeric",
"(",
"self",
",",
"mtx",
")",
":",
"self",
".",
"free_numeric",
"(",
")",
"if",
"self",
".",
"_symbolic",
"is",
"None",
":",
"self",
".",
"symbolic",
"(",
"mtx",
")",
"indx",
"=",
"self",
".",
"_getIndx",
"(",
"mtx",
")",
"failCou... | a2102ef92f4dd060138e72bb5d7c444f8ec49cbc |
train | UmfpackContext.free_symbolic | Free symbolic data | scikits/umfpack/umfpack.py | def free_symbolic(self):
"""Free symbolic data"""
if self._symbolic is not None:
self.funs.free_symbolic(self._symbolic)
self._symbolic = None
self.mtx = None | def free_symbolic(self):
"""Free symbolic data"""
if self._symbolic is not None:
self.funs.free_symbolic(self._symbolic)
self._symbolic = None
self.mtx = None | [
"Free",
"symbolic",
"data"
] | scikit-umfpack/scikit-umfpack | python | https://github.com/scikit-umfpack/scikit-umfpack/blob/a2102ef92f4dd060138e72bb5d7c444f8ec49cbc/scikits/umfpack/umfpack.py#L615-L620 | [
"def",
"free_symbolic",
"(",
"self",
")",
":",
"if",
"self",
".",
"_symbolic",
"is",
"not",
"None",
":",
"self",
".",
"funs",
".",
"free_symbolic",
"(",
"self",
".",
"_symbolic",
")",
"self",
".",
"_symbolic",
"=",
"None",
"self",
".",
"mtx",
"=",
"N... | a2102ef92f4dd060138e72bb5d7c444f8ec49cbc |
train | UmfpackContext.free_numeric | Free numeric data | scikits/umfpack/umfpack.py | def free_numeric(self):
"""Free numeric data"""
if self._numeric is not None:
self.funs.free_numeric(self._numeric)
self._numeric = None
self.free_symbolic() | def free_numeric(self):
"""Free numeric data"""
if self._numeric is not None:
self.funs.free_numeric(self._numeric)
self._numeric = None
self.free_symbolic() | [
"Free",
"numeric",
"data"
] | scikit-umfpack/scikit-umfpack | python | https://github.com/scikit-umfpack/scikit-umfpack/blob/a2102ef92f4dd060138e72bb5d7c444f8ec49cbc/scikits/umfpack/umfpack.py#L625-L630 | [
"def",
"free_numeric",
"(",
"self",
")",
":",
"if",
"self",
".",
"_numeric",
"is",
"not",
"None",
":",
"self",
".",
"funs",
".",
"free_numeric",
"(",
"self",
".",
"_numeric",
")",
"self",
".",
"_numeric",
"=",
"None",
"self",
".",
"free_symbolic",
"(",... | a2102ef92f4dd060138e72bb5d7c444f8ec49cbc |
train | UmfpackContext.solve | Solution of system of linear equation using the Numeric object.
Parameters
----------
sys : constant
one of UMFPACK system description constants, like
UMFPACK_A, UMFPACK_At, see umfSys list and UMFPACK docs
mtx : scipy.sparse.csc_matrix or scipy.sparse.csr_matrix... | scikits/umfpack/umfpack.py | def solve(self, sys, mtx, rhs, autoTranspose=False):
"""
Solution of system of linear equation using the Numeric object.
Parameters
----------
sys : constant
one of UMFPACK system description constants, like
UMFPACK_A, UMFPACK_At, see umfSys list and UMFP... | def solve(self, sys, mtx, rhs, autoTranspose=False):
"""
Solution of system of linear equation using the Numeric object.
Parameters
----------
sys : constant
one of UMFPACK system description constants, like
UMFPACK_A, UMFPACK_At, see umfSys list and UMFP... | [
"Solution",
"of",
"system",
"of",
"linear",
"equation",
"using",
"the",
"Numeric",
"object",
"."
] | scikit-umfpack/scikit-umfpack | python | https://github.com/scikit-umfpack/scikit-umfpack/blob/a2102ef92f4dd060138e72bb5d7c444f8ec49cbc/scikits/umfpack/umfpack.py#L645-L723 | [
"def",
"solve",
"(",
"self",
",",
"sys",
",",
"mtx",
",",
"rhs",
",",
"autoTranspose",
"=",
"False",
")",
":",
"if",
"sys",
"not",
"in",
"umfSys",
":",
"raise",
"ValueError",
"(",
"'sys must be in'",
"%",
"umfSys",
")",
"if",
"autoTranspose",
"and",
"s... | a2102ef92f4dd060138e72bb5d7c444f8ec49cbc |
train | UmfpackContext.linsolve | One-shot solution of system of linear equation. Reuses Numeric object
if possible.
Parameters
----------
sys : constant
one of UMFPACK system description constants, like
UMFPACK_A, UMFPACK_At, see umfSys list and UMFPACK docs
mtx : scipy.sparse.csc_matrix... | scikits/umfpack/umfpack.py | def linsolve(self, sys, mtx, rhs, autoTranspose=False):
"""
One-shot solution of system of linear equation. Reuses Numeric object
if possible.
Parameters
----------
sys : constant
one of UMFPACK system description constants, like
UMFPACK_A, UMFPAC... | def linsolve(self, sys, mtx, rhs, autoTranspose=False):
"""
One-shot solution of system of linear equation. Reuses Numeric object
if possible.
Parameters
----------
sys : constant
one of UMFPACK system description constants, like
UMFPACK_A, UMFPAC... | [
"One",
"-",
"shot",
"solution",
"of",
"system",
"of",
"linear",
"equation",
".",
"Reuses",
"Numeric",
"object",
"if",
"possible",
"."
] | scikit-umfpack/scikit-umfpack | python | https://github.com/scikit-umfpack/scikit-umfpack/blob/a2102ef92f4dd060138e72bb5d7c444f8ec49cbc/scikits/umfpack/umfpack.py#L728-L764 | [
"def",
"linsolve",
"(",
"self",
",",
"sys",
",",
"mtx",
",",
"rhs",
",",
"autoTranspose",
"=",
"False",
")",
":",
"if",
"sys",
"not",
"in",
"umfSys",
":",
"raise",
"ValueError",
"(",
"'sys must be in'",
"%",
"umfSys",
")",
"if",
"self",
".",
"_numeric"... | a2102ef92f4dd060138e72bb5d7c444f8ec49cbc |
train | UmfpackContext.lu | Perform LU decomposition.
For a given matrix A, the decomposition satisfies::
LU = PRAQ when do_recip is true
LU = P(R^-1)AQ when do_recip is false
Parameters
----------
mtx : scipy.sparse.csc_matrix or scipy.sparse.csr_matrix
Input... | scikits/umfpack/umfpack.py | def lu(self, mtx):
"""
Perform LU decomposition.
For a given matrix A, the decomposition satisfies::
LU = PRAQ when do_recip is true
LU = P(R^-1)AQ when do_recip is false
Parameters
----------
mtx : scipy.sparse.csc_matrix or sc... | def lu(self, mtx):
"""
Perform LU decomposition.
For a given matrix A, the decomposition satisfies::
LU = PRAQ when do_recip is true
LU = P(R^-1)AQ when do_recip is false
Parameters
----------
mtx : scipy.sparse.csc_matrix or sc... | [
"Perform",
"LU",
"decomposition",
"."
] | scikit-umfpack/scikit-umfpack | python | https://github.com/scikit-umfpack/scikit-umfpack/blob/a2102ef92f4dd060138e72bb5d7c444f8ec49cbc/scikits/umfpack/umfpack.py#L801-L903 | [
"def",
"lu",
"(",
"self",
",",
"mtx",
")",
":",
"# this should probably be changed",
"mtx",
"=",
"mtx",
".",
"tocsc",
"(",
")",
"self",
".",
"numeric",
"(",
"mtx",
")",
"# first find out how much space to reserve",
"(",
"status",
",",
"lnz",
",",
"unz",
",",... | a2102ef92f4dd060138e72bb5d7c444f8ec49cbc |
train | order_stick | Reorders a list according to strategy | quail/fingerprint.py | def order_stick(presenter, egg, dist_dict, strategy, fingerprint):
"""
Reorders a list according to strategy
"""
def compute_feature_stick(features, weights, alpha):
'''create a 'stick' of feature weights'''
feature_stick = []
for f, w in zip(features, weights):
fea... | def order_stick(presenter, egg, dist_dict, strategy, fingerprint):
"""
Reorders a list according to strategy
"""
def compute_feature_stick(features, weights, alpha):
'''create a 'stick' of feature weights'''
feature_stick = []
for f, w in zip(features, weights):
fea... | [
"Reorders",
"a",
"list",
"according",
"to",
"strategy"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/fingerprint.py#L346-L464 | [
"def",
"order_stick",
"(",
"presenter",
",",
"egg",
",",
"dist_dict",
",",
"strategy",
",",
"fingerprint",
")",
":",
"def",
"compute_feature_stick",
"(",
"features",
",",
"weights",
",",
"alpha",
")",
":",
"'''create a 'stick' of feature weights'''",
"feature_stick"... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | stick_perm | Computes weights for one reordering using stick-breaking method | quail/fingerprint.py | def stick_perm(presenter, egg, dist_dict, strategy):
"""Computes weights for one reordering using stick-breaking method"""
# seed RNG
np.random.seed()
# unpack egg
egg_pres, egg_rec, egg_features, egg_dist_funcs = parse_egg(egg)
# reorder
regg = order_stick(presenter, egg, dist_dict, stra... | def stick_perm(presenter, egg, dist_dict, strategy):
"""Computes weights for one reordering using stick-breaking method"""
# seed RNG
np.random.seed()
# unpack egg
egg_pres, egg_rec, egg_features, egg_dist_funcs = parse_egg(egg)
# reorder
regg = order_stick(presenter, egg, dist_dict, stra... | [
"Computes",
"weights",
"for",
"one",
"reordering",
"using",
"stick",
"-",
"breaking",
"method"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/fingerprint.py#L577-L603 | [
"def",
"stick_perm",
"(",
"presenter",
",",
"egg",
",",
"dist_dict",
",",
"strategy",
")",
":",
"# seed RNG",
"np",
".",
"random",
".",
"seed",
"(",
")",
"# unpack egg",
"egg_pres",
",",
"egg_rec",
",",
"egg_features",
",",
"egg_dist_funcs",
"=",
"parse_egg"... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | compute_distances_dict | Creates a nested dict of distances | quail/fingerprint.py | def compute_distances_dict(egg):
""" Creates a nested dict of distances """
pres, rec, features, dist_funcs = parse_egg(egg)
pres_list = list(pres)
features_list = list(features)
# initialize dist dict
distances = {}
# for each word in the list
for idx1, item1 in enumerate(pres_list):
... | def compute_distances_dict(egg):
""" Creates a nested dict of distances """
pres, rec, features, dist_funcs = parse_egg(egg)
pres_list = list(pres)
features_list = list(features)
# initialize dist dict
distances = {}
# for each word in the list
for idx1, item1 in enumerate(pres_list):
... | [
"Creates",
"a",
"nested",
"dict",
"of",
"distances"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/fingerprint.py#L637-L660 | [
"def",
"compute_distances_dict",
"(",
"egg",
")",
":",
"pres",
",",
"rec",
",",
"features",
",",
"dist_funcs",
"=",
"parse_egg",
"(",
"egg",
")",
"pres_list",
"=",
"list",
"(",
"pres",
")",
"features_list",
"=",
"list",
"(",
"features",
")",
"# initialize ... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | compute_feature_weights_dict | Compute clustering scores along a set of feature dimensions
Parameters
----------
pres_list : list
list of presented words
rec_list : list
list of recalled words
feature_list : list
list of feature dicts for presented words
distances : dict
dict of distance matri... | quail/fingerprint.py | def compute_feature_weights_dict(pres_list, rec_list, feature_list, dist_dict):
"""
Compute clustering scores along a set of feature dimensions
Parameters
----------
pres_list : list
list of presented words
rec_list : list
list of recalled words
feature_list : list
l... | def compute_feature_weights_dict(pres_list, rec_list, feature_list, dist_dict):
"""
Compute clustering scores along a set of feature dimensions
Parameters
----------
pres_list : list
list of presented words
rec_list : list
list of recalled words
feature_list : list
l... | [
"Compute",
"clustering",
"scores",
"along",
"a",
"set",
"of",
"feature",
"dimensions"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/fingerprint.py#L662-L739 | [
"def",
"compute_feature_weights_dict",
"(",
"pres_list",
",",
"rec_list",
",",
"feature_list",
",",
"dist_dict",
")",
":",
"# initialize the weights object for just this list",
"weights",
"=",
"{",
"}",
"for",
"feature",
"in",
"feature_list",
"[",
"0",
"]",
":",
"we... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | Fingerprint.update | In-place method that updates fingerprint with new data
Parameters
----------
egg : quail.Egg
Data to update fingerprint
Returns
----------
None | quail/fingerprint.py | def update(self, egg, permute=False, nperms=1000,
parallel=False):
"""
In-place method that updates fingerprint with new data
Parameters
----------
egg : quail.Egg
Data to update fingerprint
Returns
----------
None
"""... | def update(self, egg, permute=False, nperms=1000,
parallel=False):
"""
In-place method that updates fingerprint with new data
Parameters
----------
egg : quail.Egg
Data to update fingerprint
Returns
----------
None
"""... | [
"In",
"-",
"place",
"method",
"that",
"updates",
"fingerprint",
"with",
"new",
"data"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/fingerprint.py#L83-L121 | [
"def",
"update",
"(",
"self",
",",
"egg",
",",
"permute",
"=",
"False",
",",
"nperms",
"=",
"1000",
",",
"parallel",
"=",
"False",
")",
":",
"# increment n",
"self",
".",
"n",
"+=",
"1",
"next_weights",
"=",
"np",
".",
"nanmean",
"(",
"_analyze_chunk",... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | OptimalPresenter.order | Reorders a list of stimuli to match a fingerprint
Parameters
----------
egg : quail.Egg
Data to compute fingerprint
method : str
Method to re-sort list. Can be 'stick' or 'permute' (default: permute)
nperms : int
Number of permutations to us... | quail/fingerprint.py | def order(self, egg, method='permute', nperms=2500, strategy=None,
distfun='correlation', fingerprint=None):
"""
Reorders a list of stimuli to match a fingerprint
Parameters
----------
egg : quail.Egg
Data to compute fingerprint
method : str
... | def order(self, egg, method='permute', nperms=2500, strategy=None,
distfun='correlation', fingerprint=None):
"""
Reorders a list of stimuli to match a fingerprint
Parameters
----------
egg : quail.Egg
Data to compute fingerprint
method : str
... | [
"Reorders",
"a",
"list",
"of",
"stimuli",
"to",
"match",
"a",
"fingerprint"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/fingerprint.py#L203-L344 | [
"def",
"order",
"(",
"self",
",",
"egg",
",",
"method",
"=",
"'permute'",
",",
"nperms",
"=",
"2500",
",",
"strategy",
"=",
"None",
",",
"distfun",
"=",
"'correlation'",
",",
"fingerprint",
"=",
"None",
")",
":",
"def",
"order_perm",
"(",
"self",
",",
... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | OPCinfo.initStats | Query and parse Web Server Status Page.
@param extras: Include extra metrics, which can be computationally more
expensive. | pysysinfo/phpopc.py | def initStats(self, extras=None):
"""Query and parse Web Server Status Page.
@param extras: Include extra metrics, which can be computationally more
expensive.
"""
url = "%s://%s:%d/%s" % (self._proto, self._host, self._port, self._monpath)
... | def initStats(self, extras=None):
"""Query and parse Web Server Status Page.
@param extras: Include extra metrics, which can be computationally more
expensive.
"""
url = "%s://%s:%d/%s" % (self._proto, self._host, self._port, self._monpath)
... | [
"Query",
"and",
"parse",
"Web",
"Server",
"Status",
"Page",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/phpopc.py#L72-L83 | [
"def",
"initStats",
"(",
"self",
",",
"extras",
"=",
"None",
")",
":",
"url",
"=",
"\"%s://%s:%d/%s\"",
"%",
"(",
"self",
".",
"_proto",
",",
"self",
".",
"_host",
",",
"self",
".",
"_port",
",",
"self",
".",
"_monpath",
")",
"response",
"=",
"util",... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo._getDevMajorMinor | Return major and minor device number for block device path devpath.
@param devpath: Full path for block device.
@return: Tuple (major, minor). | pysysinfo/diskio.py | def _getDevMajorMinor(self, devpath):
"""Return major and minor device number for block device path devpath.
@param devpath: Full path for block device.
@return: Tuple (major, minor).
"""
fstat = os.stat(devpath)
if stat.S_ISBLK(fstat.st_mode):
... | def _getDevMajorMinor(self, devpath):
"""Return major and minor device number for block device path devpath.
@param devpath: Full path for block device.
@return: Tuple (major, minor).
"""
fstat = os.stat(devpath)
if stat.S_ISBLK(fstat.st_mode):
... | [
"Return",
"major",
"and",
"minor",
"device",
"number",
"for",
"block",
"device",
"path",
"devpath",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L53-L63 | [
"def",
"_getDevMajorMinor",
"(",
"self",
",",
"devpath",
")",
":",
"fstat",
"=",
"os",
".",
"stat",
"(",
"devpath",
")",
"if",
"stat",
".",
"S_ISBLK",
"(",
"fstat",
".",
"st_mode",
")",
":",
"return",
"(",
"os",
".",
"major",
"(",
"fstat",
".",
"st... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo._getUniqueDev | Return unique device for any block device path.
@param devpath: Full path for block device.
@return: Unique device string without the /dev prefix. | pysysinfo/diskio.py | def _getUniqueDev(self, devpath):
"""Return unique device for any block device path.
@param devpath: Full path for block device.
@return: Unique device string without the /dev prefix.
"""
realpath = os.path.realpath(devpath)
mobj = re.match('\/dev... | def _getUniqueDev(self, devpath):
"""Return unique device for any block device path.
@param devpath: Full path for block device.
@return: Unique device string without the /dev prefix.
"""
realpath = os.path.realpath(devpath)
mobj = re.match('\/dev... | [
"Return",
"unique",
"device",
"for",
"any",
"block",
"device",
"path",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L65-L84 | [
"def",
"_getUniqueDev",
"(",
"self",
",",
"devpath",
")",
":",
"realpath",
"=",
"os",
".",
"path",
".",
"realpath",
"(",
"devpath",
")",
"mobj",
"=",
"re",
".",
"match",
"(",
"'\\/dev\\/(.*)$'",
",",
"realpath",
")",
"if",
"mobj",
":",
"dev",
"=",
"m... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo._initBlockMajorMap | Parses /proc/devices to initialize device class - major number map
for block devices. | pysysinfo/diskio.py | def _initBlockMajorMap(self):
"""Parses /proc/devices to initialize device class - major number map
for block devices.
"""
self._mapMajorDevclass = {}
try:
fp = open(devicesFile, 'r')
data = fp.read()
fp.close()
except:
... | def _initBlockMajorMap(self):
"""Parses /proc/devices to initialize device class - major number map
for block devices.
"""
self._mapMajorDevclass = {}
try:
fp = open(devicesFile, 'r')
data = fp.read()
fp.close()
except:
... | [
"Parses",
"/",
"proc",
"/",
"devices",
"to",
"initialize",
"device",
"class",
"-",
"major",
"number",
"map",
"for",
"block",
"devices",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L86-L111 | [
"def",
"_initBlockMajorMap",
"(",
"self",
")",
":",
"self",
".",
"_mapMajorDevclass",
"=",
"{",
"}",
"try",
":",
"fp",
"=",
"open",
"(",
"devicesFile",
",",
"'r'",
")",
"data",
"=",
"fp",
".",
"read",
"(",
")",
"fp",
".",
"close",
"(",
")",
"except... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo._initDMinfo | Check files in /dev/mapper to initialize data structures for
mappings between device-mapper devices, minor device numbers, VGs
and LVs. | pysysinfo/diskio.py | def _initDMinfo(self):
"""Check files in /dev/mapper to initialize data structures for
mappings between device-mapper devices, minor device numbers, VGs
and LVs.
"""
self._mapLVtuple2dm = {}
self._mapLVname2dm = {}
self._vgTree = {}
if self._dmM... | def _initDMinfo(self):
"""Check files in /dev/mapper to initialize data structures for
mappings between device-mapper devices, minor device numbers, VGs
and LVs.
"""
self._mapLVtuple2dm = {}
self._mapLVname2dm = {}
self._vgTree = {}
if self._dmM... | [
"Check",
"files",
"in",
"/",
"dev",
"/",
"mapper",
"to",
"initialize",
"data",
"structures",
"for",
"mappings",
"between",
"device",
"-",
"mapper",
"devices",
"minor",
"device",
"numbers",
"VGs",
"and",
"LVs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L113-L137 | [
"def",
"_initDMinfo",
"(",
"self",
")",
":",
"self",
".",
"_mapLVtuple2dm",
"=",
"{",
"}",
"self",
".",
"_mapLVname2dm",
"=",
"{",
"}",
"self",
".",
"_vgTree",
"=",
"{",
"}",
"if",
"self",
".",
"_dmMajorNum",
"is",
"None",
":",
"self",
".",
"_initBlo... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo._initFilesystemInfo | Initialize filesystem to device mappings. | pysysinfo/diskio.py | def _initFilesystemInfo(self):
"""Initialize filesystem to device mappings."""
self._mapFSpathDev = {}
fsinfo = FilesystemInfo()
for fs in fsinfo.getFSlist():
devpath = fsinfo.getFSdev(fs)
dev = self._getUniqueDev(devpath)
if dev is not None:
... | def _initFilesystemInfo(self):
"""Initialize filesystem to device mappings."""
self._mapFSpathDev = {}
fsinfo = FilesystemInfo()
for fs in fsinfo.getFSlist():
devpath = fsinfo.getFSdev(fs)
dev = self._getUniqueDev(devpath)
if dev is not None:
... | [
"Initialize",
"filesystem",
"to",
"device",
"mappings",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L139-L147 | [
"def",
"_initFilesystemInfo",
"(",
"self",
")",
":",
"self",
".",
"_mapFSpathDev",
"=",
"{",
"}",
"fsinfo",
"=",
"FilesystemInfo",
"(",
")",
"for",
"fs",
"in",
"fsinfo",
".",
"getFSlist",
"(",
")",
":",
"devpath",
"=",
"fsinfo",
".",
"getFSdev",
"(",
"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo._initSwapInfo | Initialize swap partition to device mappings. | pysysinfo/diskio.py | def _initSwapInfo(self):
"""Initialize swap partition to device mappings."""
self._swapList = []
sysinfo = SystemInfo()
for (swap,attrs) in sysinfo.getSwapStats().iteritems():
if attrs['type'] == 'partition':
dev = self._getUniqueDev(swap)
if d... | def _initSwapInfo(self):
"""Initialize swap partition to device mappings."""
self._swapList = []
sysinfo = SystemInfo()
for (swap,attrs) in sysinfo.getSwapStats().iteritems():
if attrs['type'] == 'partition':
dev = self._getUniqueDev(swap)
if d... | [
"Initialize",
"swap",
"partition",
"to",
"device",
"mappings",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L149-L157 | [
"def",
"_initSwapInfo",
"(",
"self",
")",
":",
"self",
".",
"_swapList",
"=",
"[",
"]",
"sysinfo",
"=",
"SystemInfo",
"(",
")",
"for",
"(",
"swap",
",",
"attrs",
")",
"in",
"sysinfo",
".",
"getSwapStats",
"(",
")",
".",
"iteritems",
"(",
")",
":",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo._initDiskStats | Parse and initialize block device I/O stats in /proc/diskstats. | pysysinfo/diskio.py | def _initDiskStats(self):
"""Parse and initialize block device I/O stats in /proc/diskstats."""
self._diskStats = {}
self._mapMajorMinor2dev = {}
try:
fp = open(diskStatsFile, 'r')
data = fp.read()
fp.close()
except:
raise IOError('... | def _initDiskStats(self):
"""Parse and initialize block device I/O stats in /proc/diskstats."""
self._diskStats = {}
self._mapMajorMinor2dev = {}
try:
fp = open(diskStatsFile, 'r')
data = fp.read()
fp.close()
except:
raise IOError('... | [
"Parse",
"and",
"initialize",
"block",
"device",
"I",
"/",
"O",
"stats",
"in",
"/",
"proc",
"/",
"diskstats",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L159-L192 | [
"def",
"_initDiskStats",
"(",
"self",
")",
":",
"self",
".",
"_diskStats",
"=",
"{",
"}",
"self",
".",
"_mapMajorMinor2dev",
"=",
"{",
"}",
"try",
":",
"fp",
"=",
"open",
"(",
"diskStatsFile",
",",
"'r'",
")",
"data",
"=",
"fp",
".",
"read",
"(",
"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo._initDevClasses | Sort block devices into lists depending on device class and
initialize device type map and partition map. | pysysinfo/diskio.py | def _initDevClasses(self):
"""Sort block devices into lists depending on device class and
initialize device type map and partition map."""
self._devClassTree = {}
self._partitionTree = {}
self._mapDevType = {}
basedevs = []
otherdevs = []
if self._mapMajo... | def _initDevClasses(self):
"""Sort block devices into lists depending on device class and
initialize device type map and partition map."""
self._devClassTree = {}
self._partitionTree = {}
self._mapDevType = {}
basedevs = []
otherdevs = []
if self._mapMajo... | [
"Sort",
"block",
"devices",
"into",
"lists",
"depending",
"on",
"device",
"class",
"and",
"initialize",
"device",
"type",
"map",
"and",
"partition",
"map",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L194-L228 | [
"def",
"_initDevClasses",
"(",
"self",
")",
":",
"self",
".",
"_devClassTree",
"=",
"{",
"}",
"self",
".",
"_partitionTree",
"=",
"{",
"}",
"self",
".",
"_mapDevType",
"=",
"{",
"}",
"basedevs",
"=",
"[",
"]",
"otherdevs",
"=",
"[",
"]",
"if",
"self"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo.getDevType | Returns type of device dev.
@return: Device type as string. | pysysinfo/diskio.py | def getDevType(self, dev):
"""Returns type of device dev.
@return: Device type as string.
"""
if self._devClassTree is None:
self._initDevClasses()
return self._mapDevType.get(dev) | def getDevType(self, dev):
"""Returns type of device dev.
@return: Device type as string.
"""
if self._devClassTree is None:
self._initDevClasses()
return self._mapDevType.get(dev) | [
"Returns",
"type",
"of",
"device",
"dev",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L230-L238 | [
"def",
"getDevType",
"(",
"self",
",",
"dev",
")",
":",
"if",
"self",
".",
"_devClassTree",
"is",
"None",
":",
"self",
".",
"_initDevClasses",
"(",
")",
"return",
"self",
".",
"_mapDevType",
".",
"get",
"(",
"dev",
")"
] | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo.getPartitionList | Returns list of partitions.
@return: List of (disk,partition) pairs. | pysysinfo/diskio.py | def getPartitionList(self):
"""Returns list of partitions.
@return: List of (disk,partition) pairs.
"""
if self._partList is None:
self._partList = []
for (disk,parts) in self.getPartitionDict().iteritems():
for part in parts:
... | def getPartitionList(self):
"""Returns list of partitions.
@return: List of (disk,partition) pairs.
"""
if self._partList is None:
self._partList = []
for (disk,parts) in self.getPartitionDict().iteritems():
for part in parts:
... | [
"Returns",
"list",
"of",
"partitions",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L288-L299 | [
"def",
"getPartitionList",
"(",
"self",
")",
":",
"if",
"self",
".",
"_partList",
"is",
"None",
":",
"self",
".",
"_partList",
"=",
"[",
"]",
"for",
"(",
"disk",
",",
"parts",
")",
"in",
"self",
".",
"getPartitionDict",
"(",
")",
".",
"iteritems",
"(... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo.getDevStats | Returns I/O stats for block device.
@param dev: Device name
@param devtype: Device type. (Ignored if None.)
@return: Dict of stats. | pysysinfo/diskio.py | def getDevStats(self, dev, devtype = None):
"""Returns I/O stats for block device.
@param dev: Device name
@param devtype: Device type. (Ignored if None.)
@return: Dict of stats.
"""
if devtype is not None:
if self._devClassTree is... | def getDevStats(self, dev, devtype = None):
"""Returns I/O stats for block device.
@param dev: Device name
@param devtype: Device type. (Ignored if None.)
@return: Dict of stats.
"""
if devtype is not None:
if self._devClassTree is... | [
"Returns",
"I",
"/",
"O",
"stats",
"for",
"block",
"device",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L367-L380 | [
"def",
"getDevStats",
"(",
"self",
",",
"dev",
",",
"devtype",
"=",
"None",
")",
":",
"if",
"devtype",
"is",
"not",
"None",
":",
"if",
"self",
".",
"_devClassTree",
"is",
"None",
":",
"self",
".",
"_initDevClasses",
"(",
")",
"if",
"devtype",
"<>",
"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo.getSwapStats | Returns I/O stats for swap partition.
@param dev: Device name for swap partition.
@return: Dict of stats. | pysysinfo/diskio.py | def getSwapStats(self, dev):
"""Returns I/O stats for swap partition.
@param dev: Device name for swap partition.
@return: Dict of stats.
"""
if self._swapList is None:
self._initSwapInfo()
if dev in self._swapList:
return self.ge... | def getSwapStats(self, dev):
"""Returns I/O stats for swap partition.
@param dev: Device name for swap partition.
@return: Dict of stats.
"""
if self._swapList is None:
self._initSwapInfo()
if dev in self._swapList:
return self.ge... | [
"Returns",
"I",
"/",
"O",
"stats",
"for",
"swap",
"partition",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L418-L430 | [
"def",
"getSwapStats",
"(",
"self",
",",
"dev",
")",
":",
"if",
"self",
".",
"_swapList",
"is",
"None",
":",
"self",
".",
"_initSwapInfo",
"(",
")",
"if",
"dev",
"in",
"self",
".",
"_swapList",
":",
"return",
"self",
".",
"getDevStats",
"(",
"dev",
"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo.getLVstats | Returns I/O stats for LV.
@param args: Two calling conventions are implemented:
- Passing two parameters vg and lv.
- Passing only one parameter in 'vg-lv' format.
@return: Dict of stats. | pysysinfo/diskio.py | def getLVstats(self, *args):
"""Returns I/O stats for LV.
@param args: Two calling conventions are implemented:
- Passing two parameters vg and lv.
- Passing only one parameter in 'vg-lv' format.
@return: Dict of stats.
""... | def getLVstats(self, *args):
"""Returns I/O stats for LV.
@param args: Two calling conventions are implemented:
- Passing two parameters vg and lv.
- Passing only one parameter in 'vg-lv' format.
@return: Dict of stats.
""... | [
"Returns",
"I",
"/",
"O",
"stats",
"for",
"LV",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L432-L453 | [
"def",
"getLVstats",
"(",
"self",
",",
"*",
"args",
")",
":",
"if",
"not",
"len",
"(",
"args",
")",
"in",
"(",
"1",
",",
"2",
")",
":",
"raise",
"TypeError",
"(",
"\"The getLVstats must be called with either \"",
"\"one or two arguments.\"",
")",
"if",
"self... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | DiskIOinfo.getFilesystemStats | Returns I/O stats for filesystem.
@param fs: Filesystem path.
@return: Dict of stats. | pysysinfo/diskio.py | def getFilesystemStats(self, fs):
"""Returns I/O stats for filesystem.
@param fs: Filesystem path.
@return: Dict of stats.
"""
if self._mapFSpathDev is None:
self._initFilesystemInfo()
return self._diskStats.get(self._mapFSpathDev.get(fs)) | def getFilesystemStats(self, fs):
"""Returns I/O stats for filesystem.
@param fs: Filesystem path.
@return: Dict of stats.
"""
if self._mapFSpathDev is None:
self._initFilesystemInfo()
return self._diskStats.get(self._mapFSpathDev.get(fs)) | [
"Returns",
"I",
"/",
"O",
"stats",
"for",
"filesystem",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/diskio.py#L455-L464 | [
"def",
"getFilesystemStats",
"(",
"self",
",",
"fs",
")",
":",
"if",
"self",
".",
"_mapFSpathDev",
"is",
"None",
":",
"self",
".",
"_initFilesystemInfo",
"(",
")",
"return",
"self",
".",
"_diskStats",
".",
"get",
"(",
"self",
".",
"_mapFSpathDev",
".",
"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | MuninNTPhostOffsetPlugin.retrieveVals | Retrieve values for graphs. | pymunin/plugins/ntphostoffset_.py | def retrieveVals(self):
"""Retrieve values for graphs."""
ntpinfo = NTPinfo()
stats = ntpinfo.getHostOffset(self._remoteHost)
if stats:
graph_name = 'ntp_host_stratum_%s' % self._remoteHost
if self.hasGraph(graph_name):
self.setGraphVal(graph_name,... | def retrieveVals(self):
"""Retrieve values for graphs."""
ntpinfo = NTPinfo()
stats = ntpinfo.getHostOffset(self._remoteHost)
if stats:
graph_name = 'ntp_host_stratum_%s' % self._remoteHost
if self.hasGraph(graph_name):
self.setGraphVal(graph_name,... | [
"Retrieve",
"values",
"for",
"graphs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pymunin/plugins/ntphostoffset_.py#L105-L116 | [
"def",
"retrieveVals",
"(",
"self",
")",
":",
"ntpinfo",
"=",
"NTPinfo",
"(",
")",
"stats",
"=",
"ntpinfo",
".",
"getHostOffset",
"(",
"self",
".",
"_remoteHost",
")",
"if",
"stats",
":",
"graph_name",
"=",
"'ntp_host_stratum_%s'",
"%",
"self",
".",
"_remo... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | CloudFilesInfo.getContainerStats | Returns Rackspace Cloud Files usage stats for containers.
@param limit: Number of containers to return.
@param marker: Return only results whose name is greater than marker.
@return: Dictionary of container stats indexed by container name. | pysysinfo/rackspace.py | def getContainerStats(self, limit=None, marker=None):
"""Returns Rackspace Cloud Files usage stats for containers.
@param limit: Number of containers to return.
@param marker: Return only results whose name is greater than marker.
@return: Dictionary of container stats in... | def getContainerStats(self, limit=None, marker=None):
"""Returns Rackspace Cloud Files usage stats for containers.
@param limit: Number of containers to return.
@param marker: Return only results whose name is greater than marker.
@return: Dictionary of container stats in... | [
"Returns",
"Rackspace",
"Cloud",
"Files",
"usage",
"stats",
"for",
"containers",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/rackspace.py#L58-L69 | [
"def",
"getContainerStats",
"(",
"self",
",",
"limit",
"=",
"None",
",",
"marker",
"=",
"None",
")",
":",
"stats",
"=",
"{",
"}",
"for",
"row",
"in",
"self",
".",
"_conn",
".",
"list_containers_info",
"(",
"limit",
",",
"marker",
")",
":",
"stats",
"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | decode_speech | Decode speech for a file or folder and return results
This function wraps the Google Speech API and ffmpeg to decode speech for
free recall experiments. Note: in order for this to work, you must have a
Google Speech account, a google speech credentials file referenced in your
_bash_profile, and ffmpeg... | quail/decode_speech.py | def decode_speech(path, keypath=None, save=False, speech_context=None,
sample_rate=44100, max_alternatives=1, language_code='en-US',
enable_word_time_offsets=True, return_raw=False):
"""
Decode speech for a file or folder and return results
This function wraps the Google... | def decode_speech(path, keypath=None, save=False, speech_context=None,
sample_rate=44100, max_alternatives=1, language_code='en-US',
enable_word_time_offsets=True, return_raw=False):
"""
Decode speech for a file or folder and return results
This function wraps the Google... | [
"Decode",
"speech",
"for",
"a",
"file",
"or",
"folder",
"and",
"return",
"results"
] | ContextLab/quail | python | https://github.com/ContextLab/quail/blob/71dd53c792dd915dc84879d8237e3582dd68b7a4/quail/decode_speech.py#L24-L265 | [
"def",
"decode_speech",
"(",
"path",
",",
"keypath",
"=",
"None",
",",
"save",
"=",
"False",
",",
"speech_context",
"=",
"None",
",",
"sample_rate",
"=",
"44100",
",",
"max_alternatives",
"=",
"1",
",",
"language_code",
"=",
"'en-US'",
",",
"enable_word_time... | 71dd53c792dd915dc84879d8237e3582dd68b7a4 |
train | parse_value | Parse input string and return int, float or str depending on format.
@param val: Input string.
@return: Value of type int, float or str. | pysysinfo/squid.py | def parse_value(val):
"""Parse input string and return int, float or str depending on format.
@param val: Input string.
@return: Value of type int, float or str.
"""
mobj = re.match('(-{0,1}\d+)\s*(\sseconds|/\s*\w+)$', val)
if mobj:
return int(mobj.group(1))
m... | def parse_value(val):
"""Parse input string and return int, float or str depending on format.
@param val: Input string.
@return: Value of type int, float or str.
"""
mobj = re.match('(-{0,1}\d+)\s*(\sseconds|/\s*\w+)$', val)
if mobj:
return int(mobj.group(1))
m... | [
"Parse",
"input",
"string",
"and",
"return",
"int",
"float",
"or",
"str",
"depending",
"on",
"format",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/squid.py#L31-L51 | [
"def",
"parse_value",
"(",
"val",
")",
":",
"mobj",
"=",
"re",
".",
"match",
"(",
"'(-{0,1}\\d+)\\s*(\\sseconds|/\\s*\\w+)$'",
",",
"val",
")",
"if",
"mobj",
":",
"return",
"int",
"(",
"mobj",
".",
"group",
"(",
"1",
")",
")",
"mobj",
"=",
"re",
".",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | SquidInfo._connect | Connect to Squid Proxy Manager interface. | pysysinfo/squid.py | def _connect(self):
"""Connect to Squid Proxy Manager interface."""
if sys.version_info[:2] < (2,6):
self._conn = httplib.HTTPConnection(self._host, self._port)
else:
self._conn = httplib.HTTPConnection(self._host, self._port,
... | def _connect(self):
"""Connect to Squid Proxy Manager interface."""
if sys.version_info[:2] < (2,6):
self._conn = httplib.HTTPConnection(self._host, self._port)
else:
self._conn = httplib.HTTPConnection(self._host, self._port,
... | [
"Connect",
"to",
"Squid",
"Proxy",
"Manager",
"interface",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/squid.py#L90-L96 | [
"def",
"_connect",
"(",
"self",
")",
":",
"if",
"sys",
".",
"version_info",
"[",
":",
"2",
"]",
"<",
"(",
"2",
",",
"6",
")",
":",
"self",
".",
"_conn",
"=",
"httplib",
".",
"HTTPConnection",
"(",
"self",
".",
"_host",
",",
"self",
".",
"_port",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | SquidInfo._retrieve | Query Squid Proxy Server Manager Interface for stats.
@param map: Statistics map name.
@return: Dictionary of query results. | pysysinfo/squid.py | def _retrieve(self, map):
"""Query Squid Proxy Server Manager Interface for stats.
@param map: Statistics map name.
@return: Dictionary of query results.
"""
self._conn.request('GET', "cache_object://%s/%s" % (self._host, map),
Non... | def _retrieve(self, map):
"""Query Squid Proxy Server Manager Interface for stats.
@param map: Statistics map name.
@return: Dictionary of query results.
"""
self._conn.request('GET', "cache_object://%s/%s" % (self._host, map),
Non... | [
"Query",
"Squid",
"Proxy",
"Server",
"Manager",
"Interface",
"for",
"stats",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/squid.py#L98-L115 | [
"def",
"_retrieve",
"(",
"self",
",",
"map",
")",
":",
"self",
".",
"_conn",
".",
"request",
"(",
"'GET'",
",",
"\"cache_object://%s/%s\"",
"%",
"(",
"self",
".",
"_host",
",",
"map",
")",
",",
"None",
",",
"self",
".",
"_httpHeaders",
")",
"rp",
"="... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | SquidInfo._parseCounters | Parse simple stats list of key, value pairs.
@param data: Multiline data with one key-value pair in each line.
@return: Dictionary of stats. | pysysinfo/squid.py | def _parseCounters(self, data):
"""Parse simple stats list of key, value pairs.
@param data: Multiline data with one key-value pair in each line.
@return: Dictionary of stats.
"""
info_dict = util.NestedDict()
for line in data.splitlines():
... | def _parseCounters(self, data):
"""Parse simple stats list of key, value pairs.
@param data: Multiline data with one key-value pair in each line.
@return: Dictionary of stats.
"""
info_dict = util.NestedDict()
for line in data.splitlines():
... | [
"Parse",
"simple",
"stats",
"list",
"of",
"key",
"value",
"pairs",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/squid.py#L117-L131 | [
"def",
"_parseCounters",
"(",
"self",
",",
"data",
")",
":",
"info_dict",
"=",
"util",
".",
"NestedDict",
"(",
")",
"for",
"line",
"in",
"data",
".",
"splitlines",
"(",
")",
":",
"mobj",
"=",
"re",
".",
"match",
"(",
"'^\\s*([\\w\\.]+)\\s*=\\s*(\\S.*)$'",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | SquidInfo._parseSections | Parse data and separate sections. Returns dictionary that maps
section name to section data.
@param data: Multiline data.
@return: Dictionary that maps section names to section data. | pysysinfo/squid.py | def _parseSections(self, data):
"""Parse data and separate sections. Returns dictionary that maps
section name to section data.
@param data: Multiline data.
@return: Dictionary that maps section names to section data.
"""
section_dict = {}
l... | def _parseSections(self, data):
"""Parse data and separate sections. Returns dictionary that maps
section name to section data.
@param data: Multiline data.
@return: Dictionary that maps section names to section data.
"""
section_dict = {}
l... | [
"Parse",
"data",
"and",
"separate",
"sections",
".",
"Returns",
"dictionary",
"that",
"maps",
"section",
"name",
"to",
"section",
"data",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/squid.py#L133-L168 | [
"def",
"_parseSections",
"(",
"self",
",",
"data",
")",
":",
"section_dict",
"=",
"{",
"}",
"lines",
"=",
"data",
".",
"splitlines",
"(",
")",
"idx",
"=",
"0",
"numlines",
"=",
"len",
"(",
"lines",
")",
"section",
"=",
"None",
"while",
"idx",
"<",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | SquidInfo.getMenu | Get manager interface section list from Squid Proxy Server
@return: List of tuples (section, description, type) | pysysinfo/squid.py | def getMenu(self):
"""Get manager interface section list from Squid Proxy Server
@return: List of tuples (section, description, type)
"""
data = self._retrieve('')
info_list = []
for line in data.splitlines():
mobj = re.match('^\s*(\S.*\S... | def getMenu(self):
"""Get manager interface section list from Squid Proxy Server
@return: List of tuples (section, description, type)
"""
data = self._retrieve('')
info_list = []
for line in data.splitlines():
mobj = re.match('^\s*(\S.*\S... | [
"Get",
"manager",
"interface",
"section",
"list",
"from",
"Squid",
"Proxy",
"Server"
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/squid.py#L170-L182 | [
"def",
"getMenu",
"(",
"self",
")",
":",
"data",
"=",
"self",
".",
"_retrieve",
"(",
"''",
")",
"info_list",
"=",
"[",
"]",
"for",
"line",
"in",
"data",
".",
"splitlines",
"(",
")",
":",
"mobj",
"=",
"re",
".",
"match",
"(",
"'^\\s*(\\S.*\\S)\\s*\\t\... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | WanpipeInfo.getIfaceStats | Return dictionary of Traffic Stats for each Wanpipe Interface.
@return: Nested dictionary of statistics for each interface. | pysysinfo/wanpipe.py | def getIfaceStats(self):
"""Return dictionary of Traffic Stats for each Wanpipe Interface.
@return: Nested dictionary of statistics for each interface.
"""
ifInfo = netiface.NetIfaceInfo()
ifStats = ifInfo.getIfStats()
info_dict = {}
for ifname i... | def getIfaceStats(self):
"""Return dictionary of Traffic Stats for each Wanpipe Interface.
@return: Nested dictionary of statistics for each interface.
"""
ifInfo = netiface.NetIfaceInfo()
ifStats = ifInfo.getIfStats()
info_dict = {}
for ifname i... | [
"Return",
"dictionary",
"of",
"Traffic",
"Stats",
"for",
"each",
"Wanpipe",
"Interface",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/wanpipe.py#L27-L39 | [
"def",
"getIfaceStats",
"(",
"self",
")",
":",
"ifInfo",
"=",
"netiface",
".",
"NetIfaceInfo",
"(",
")",
"ifStats",
"=",
"ifInfo",
".",
"getIfStats",
"(",
")",
"info_dict",
"=",
"{",
"}",
"for",
"ifname",
"in",
"ifStats",
":",
"if",
"re",
".",
"match",... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | WanpipeInfo.getPRIstats | Return RDSI Operational Stats for interface.
@param iface: Interface name. (Ex. w1g1)
@return: Nested dictionary of statistics for interface. | pysysinfo/wanpipe.py | def getPRIstats(self, iface):
"""Return RDSI Operational Stats for interface.
@param iface: Interface name. (Ex. w1g1)
@return: Nested dictionary of statistics for interface.
"""
info_dict = {}
output = util.exec_command([wanpipemonCmd, '-i', iface, '-c', ... | def getPRIstats(self, iface):
"""Return RDSI Operational Stats for interface.
@param iface: Interface name. (Ex. w1g1)
@return: Nested dictionary of statistics for interface.
"""
info_dict = {}
output = util.exec_command([wanpipemonCmd, '-i', iface, '-c', ... | [
"Return",
"RDSI",
"Operational",
"Stats",
"for",
"interface",
".",
"@param",
"iface",
":",
"Interface",
"name",
".",
"(",
"Ex",
".",
"w1g1",
")",
"@return",
":",
"Nested",
"dictionary",
"of",
"statistics",
"for",
"interface",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/wanpipe.py#L41-L62 | [
"def",
"getPRIstats",
"(",
"self",
",",
"iface",
")",
":",
"info_dict",
"=",
"{",
"}",
"output",
"=",
"util",
".",
"exec_command",
"(",
"[",
"wanpipemonCmd",
",",
"'-i'",
",",
"iface",
",",
"'-c'",
",",
"'Ta'",
"]",
")",
"for",
"line",
"in",
"output"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | FSinfo._connect | Connect to FreeSWITCH ESL Interface. | pysysinfo/freeswitch.py | def _connect(self):
"""Connect to FreeSWITCH ESL Interface."""
try:
self._eslconn = ESL.ESLconnection(self._eslhost,
str(self._eslport),
self._eslpass)
except:
pass
if no... | def _connect(self):
"""Connect to FreeSWITCH ESL Interface."""
try:
self._eslconn = ESL.ESLconnection(self._eslhost,
str(self._eslport),
self._eslpass)
except:
pass
if no... | [
"Connect",
"to",
"FreeSWITCH",
"ESL",
"Interface",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/freeswitch.py#L60-L72 | [
"def",
"_connect",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"_eslconn",
"=",
"ESL",
".",
"ESLconnection",
"(",
"self",
".",
"_eslhost",
",",
"str",
"(",
"self",
".",
"_eslport",
")",
",",
"self",
".",
"_eslpass",
")",
"except",
":",
"pass",
... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | FSinfo._execCmd | Execute command and return result body as list of lines.
@param cmd: Command string.
@param args: Comand arguments string.
@return: Result dictionary. | pysysinfo/freeswitch.py | def _execCmd(self, cmd, args):
"""Execute command and return result body as list of lines.
@param cmd: Command string.
@param args: Comand arguments string.
@return: Result dictionary.
"""
output = self._eslconn.api(cmd, args)
... | def _execCmd(self, cmd, args):
"""Execute command and return result body as list of lines.
@param cmd: Command string.
@param args: Comand arguments string.
@return: Result dictionary.
"""
output = self._eslconn.api(cmd, args)
... | [
"Execute",
"command",
"and",
"return",
"result",
"body",
"as",
"list",
"of",
"lines",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/freeswitch.py#L74-L87 | [
"def",
"_execCmd",
"(",
"self",
",",
"cmd",
",",
"args",
")",
":",
"output",
"=",
"self",
".",
"_eslconn",
".",
"api",
"(",
"cmd",
",",
"args",
")",
"if",
"output",
":",
"body",
"=",
"output",
".",
"getBody",
"(",
")",
"if",
"body",
":",
"return"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
train | FSinfo._execShowCmd | Execute 'show' command and return result dictionary.
@param cmd: Command string.
@return: Result dictionary. | pysysinfo/freeswitch.py | def _execShowCmd(self, showcmd):
"""Execute 'show' command and return result dictionary.
@param cmd: Command string.
@return: Result dictionary.
"""
result = None
lines = self._execCmd("show", showcmd)
if lines and len(lines) >= 2 and... | def _execShowCmd(self, showcmd):
"""Execute 'show' command and return result dictionary.
@param cmd: Command string.
@return: Result dictionary.
"""
result = None
lines = self._execCmd("show", showcmd)
if lines and len(lines) >= 2 and... | [
"Execute",
"show",
"command",
"and",
"return",
"result",
"dictionary",
"."
] | aouyar/PyMunin | python | https://github.com/aouyar/PyMunin/blob/4f58a64b6b37c85a84cc7e1e07aafaa0321b249d/pysysinfo/freeswitch.py#L89-L107 | [
"def",
"_execShowCmd",
"(",
"self",
",",
"showcmd",
")",
":",
"result",
"=",
"None",
"lines",
"=",
"self",
".",
"_execCmd",
"(",
"\"show\"",
",",
"showcmd",
")",
"if",
"lines",
"and",
"len",
"(",
"lines",
")",
">=",
"2",
"and",
"lines",
"[",
"0",
"... | 4f58a64b6b37c85a84cc7e1e07aafaa0321b249d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.