repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
bede/tictax | tictax/tictax.py | annotate_diamond | def annotate_diamond(records, diamond_path):
'''
Retrieve scientific names and lineages for taxon IDs in Diamond output
Returns taxonomically annotated SeqRecords with modified description attributes
'''
contigs_metadata = {}
with open(diamond_path) as diamond_tax_fh:
for line in diamond... | python | def annotate_diamond(records, diamond_path):
'''
Retrieve scientific names and lineages for taxon IDs in Diamond output
Returns taxonomically annotated SeqRecords with modified description attributes
'''
contigs_metadata = {}
with open(diamond_path) as diamond_tax_fh:
for line in diamond... | [
"def",
"annotate_diamond",
"(",
"records",
",",
"diamond_path",
")",
":",
"contigs_metadata",
"=",
"{",
"}",
"with",
"open",
"(",
"diamond_path",
")",
"as",
"diamond_tax_fh",
":",
"for",
"line",
"in",
"diamond_tax_fh",
":",
"contig",
",",
"taxid",
",",
"eval... | Retrieve scientific names and lineages for taxon IDs in Diamond output
Returns taxonomically annotated SeqRecords with modified description attributes | [
"Retrieve",
"scientific",
"names",
"and",
"lineages",
"for",
"taxon",
"IDs",
"in",
"Diamond",
"output",
"Returns",
"taxonomically",
"annotated",
"SeqRecords",
"with",
"modified",
"description",
"attributes"
] | train | https://github.com/bede/tictax/blob/acc9811be3a8b5ad905daf4b5d413f2c5e6ad06c/tictax/tictax.py#L155-L183 |
bede/tictax | tictax/tictax.py | filter_taxa | def filter_taxa(records, taxids, unclassified=False, discard=False):
'''
Selectively include or discard specified taxon IDs from tictax annotated FASTA/Qs
Filters all children of specified taxon IDs
Returns subset of input SeqRecords
Taxon IDs of 1 and 2 are considered unclassified
'''
taxi... | python | def filter_taxa(records, taxids, unclassified=False, discard=False):
'''
Selectively include or discard specified taxon IDs from tictax annotated FASTA/Qs
Filters all children of specified taxon IDs
Returns subset of input SeqRecords
Taxon IDs of 1 and 2 are considered unclassified
'''
taxi... | [
"def",
"filter_taxa",
"(",
"records",
",",
"taxids",
",",
"unclassified",
"=",
"False",
",",
"discard",
"=",
"False",
")",
":",
"taxids",
"=",
"set",
"(",
"taxids",
")",
"kept_records",
"=",
"[",
"]",
"ncbi",
"=",
"ete3",
".",
"NCBITaxa",
"(",
")",
"... | Selectively include or discard specified taxon IDs from tictax annotated FASTA/Qs
Filters all children of specified taxon IDs
Returns subset of input SeqRecords
Taxon IDs of 1 and 2 are considered unclassified | [
"Selectively",
"include",
"or",
"discard",
"specified",
"taxon",
"IDs",
"from",
"tictax",
"annotated",
"FASTA",
"/",
"Qs",
"Filters",
"all",
"children",
"of",
"specified",
"taxon",
"IDs",
"Returns",
"subset",
"of",
"input",
"SeqRecords",
"Taxon",
"IDs",
"of",
... | train | https://github.com/bede/tictax/blob/acc9811be3a8b5ad905daf4b5d413f2c5e6ad06c/tictax/tictax.py#L186-L209 |
bede/tictax | tictax/tictax.py | matrix | def matrix(records, scafstats_path):
'''
Generate taxonomic count matrix from BBMap scafstats output to tictax classified contigs
'''
ncbi = ete3.NCBITaxa()
# # Single file version
# contigs_lineages = {r.id: r.description.strip().partition(' ')[2].split('|')[2] for r in records}
# df ... | python | def matrix(records, scafstats_path):
'''
Generate taxonomic count matrix from BBMap scafstats output to tictax classified contigs
'''
ncbi = ete3.NCBITaxa()
# # Single file version
# contigs_lineages = {r.id: r.description.strip().partition(' ')[2].split('|')[2] for r in records}
# df ... | [
"def",
"matrix",
"(",
"records",
",",
"scafstats_path",
")",
":",
"ncbi",
"=",
"ete3",
".",
"NCBITaxa",
"(",
")",
"# # Single file version ",
"# contigs_lineages = {r.id: r.description.strip().partition(' ')[2].split('|')[2] for r in records}",
"# df = pd.read_csv(scafstats_path, s... | Generate taxonomic count matrix from BBMap scafstats output to tictax classified contigs | [
"Generate",
"taxonomic",
"count",
"matrix",
"from",
"BBMap",
"scafstats",
"output",
"to",
"tictax",
"classified",
"contigs"
] | train | https://github.com/bede/tictax/blob/acc9811be3a8b5ad905daf4b5d413f2c5e6ad06c/tictax/tictax.py#L230-L263 |
simoninireland/epyc | epyc/repeatedexperiment.py | RepeatedExperiment.do | def do( self, params ):
"""Perform the number of repetitions we want. The results returned
will be a list of the results dicts generated by the repeated experiments.
The metedata for each experiment will include an entry
:attr:`RepeatedExperiment.REPETITIONS` for the number of
re... | python | def do( self, params ):
"""Perform the number of repetitions we want. The results returned
will be a list of the results dicts generated by the repeated experiments.
The metedata for each experiment will include an entry
:attr:`RepeatedExperiment.REPETITIONS` for the number of
re... | [
"def",
"do",
"(",
"self",
",",
"params",
")",
":",
"N",
"=",
"self",
".",
"repetitions",
"(",
")",
"e",
"=",
"self",
".",
"experiment",
"(",
")",
"results",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"N",
")",
":",
"res",
"=",
"e",
".",
... | Perform the number of repetitions we want. The results returned
will be a list of the results dicts generated by the repeated experiments.
The metedata for each experiment will include an entry
:attr:`RepeatedExperiment.REPETITIONS` for the number of
repetitions that occurred (which will... | [
"Perform",
"the",
"number",
"of",
"repetitions",
"we",
"want",
".",
"The",
"results",
"returned",
"will",
"be",
"a",
"list",
"of",
"the",
"results",
"dicts",
"generated",
"by",
"the",
"repeated",
"experiments",
".",
"The",
"metedata",
"for",
"each",
"experim... | train | https://github.com/simoninireland/epyc/blob/b3b61007741a0ab3de64df89070a6f30de8ec268/epyc/repeatedexperiment.py#L42-L70 |
tomi77/django-extra-tools | django_extra_tools/auth/view_permissions/signals.py | add_view_permissions | def add_view_permissions(sender, verbosity, **kwargs):
"""
This post_syncdb/post_migrate hooks takes care of adding a view permission too all our
content types.
"""
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Permission
for content_type ... | python | def add_view_permissions(sender, verbosity, **kwargs):
"""
This post_syncdb/post_migrate hooks takes care of adding a view permission too all our
content types.
"""
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Permission
for content_type ... | [
"def",
"add_view_permissions",
"(",
"sender",
",",
"verbosity",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"django",
".",
"contrib",
".",
"contenttypes",
".",
"models",
"import",
"ContentType",
"from",
"django",
".",
"contrib",
".",
"auth",
".",
"models",
... | This post_syncdb/post_migrate hooks takes care of adding a view permission too all our
content types. | [
"This",
"post_syncdb",
"/",
"post_migrate",
"hooks",
"takes",
"care",
"of",
"adding",
"a",
"view",
"permission",
"too",
"all",
"our",
"content",
"types",
"."
] | train | https://github.com/tomi77/django-extra-tools/blob/fb6d226bc5cf3fc0eb8abe61a512c3f5c7dcc8a8/django_extra_tools/auth/view_permissions/signals.py#L4-L20 |
gasparka/pyhacores | pyhacores/filter/moving_average.py | MovingAverage.main | def main(self, x):
"""
This works by keeping a history of 'window_len' elements and the sum of them.
Every clock last element will be subtracted and new added to the sum.
More good infos: https://www.dsprelated.com/showarticle/58.php
:param x: input to average
:return: a... | python | def main(self, x):
"""
This works by keeping a history of 'window_len' elements and the sum of them.
Every clock last element will be subtracted and new added to the sum.
More good infos: https://www.dsprelated.com/showarticle/58.php
:param x: input to average
:return: a... | [
"def",
"main",
"(",
"self",
",",
"x",
")",
":",
"# divide by window_pow",
"div",
"=",
"x",
">>",
"self",
".",
"WINDOW_POW",
"# add new element to shift register",
"self",
".",
"mem",
"=",
"[",
"div",
"]",
"+",
"self",
".",
"mem",
"[",
":",
"-",
"1",
"]... | This works by keeping a history of 'window_len' elements and the sum of them.
Every clock last element will be subtracted and new added to the sum.
More good infos: https://www.dsprelated.com/showarticle/58.php
:param x: input to average
:return: averaged output
:rtype: Sfix | [
"This",
"works",
"by",
"keeping",
"a",
"history",
"of",
"window_len",
"elements",
"and",
"the",
"sum",
"of",
"them",
".",
"Every",
"clock",
"last",
"element",
"will",
"be",
"subtracted",
"and",
"new",
"added",
"to",
"the",
"sum",
".",
"More",
"good",
"in... | train | https://github.com/gasparka/pyhacores/blob/16c186fbbf90385f2ba3498395123e79b6fcf340/pyhacores/filter/moving_average.py#L31-L49 |
sukujgrg/pptx-builder-from-yaml | pptx_builder/__init__.py | build_slide | def build_slide(filename: Path, pptx_template: Path, master_slide_idx: int, slide_layout_idx: int, font_size: int,
dst_dir: Path, font_name: str, slide_txt_alignment: str = "left") -> Path:
"""Builds a powerpoint presentation using data read from a yaml file
:param filename: path to the yaml fi... | python | def build_slide(filename: Path, pptx_template: Path, master_slide_idx: int, slide_layout_idx: int, font_size: int,
dst_dir: Path, font_name: str, slide_txt_alignment: str = "left") -> Path:
"""Builds a powerpoint presentation using data read from a yaml file
:param filename: path to the yaml fi... | [
"def",
"build_slide",
"(",
"filename",
":",
"Path",
",",
"pptx_template",
":",
"Path",
",",
"master_slide_idx",
":",
"int",
",",
"slide_layout_idx",
":",
"int",
",",
"font_size",
":",
"int",
",",
"dst_dir",
":",
"Path",
",",
"font_name",
":",
"str",
",",
... | Builds a powerpoint presentation using data read from a yaml file
:param filename: path to the yaml file
:param pptx_template: path to powerpoint template
:param master_slide_idx: slide master index
:param slide_layout_idx: slide layout index
:param font_size: size of the font
:param dst_dir: ... | [
"Builds",
"a",
"powerpoint",
"presentation",
"using",
"data",
"read",
"from",
"a",
"yaml",
"file"
] | train | https://github.com/sukujgrg/pptx-builder-from-yaml/blob/2218290f2394a133f0937e432e588f687b2deb7b/pptx_builder/__init__.py#L44-L124 |
sukujgrg/pptx-builder-from-yaml | pptx_builder/__init__.py | pick_master_slide | def pick_master_slide(master_slides_path: Path) -> Path:
"""Returns path to a master slide. If argument is a directory,
returns a randomly chosen file in the directory and if argument
is a file, returns the argument itself
:return: path to chosen master slide
"""
if master_slides_path.is_file(... | python | def pick_master_slide(master_slides_path: Path) -> Path:
"""Returns path to a master slide. If argument is a directory,
returns a randomly chosen file in the directory and if argument
is a file, returns the argument itself
:return: path to chosen master slide
"""
if master_slides_path.is_file(... | [
"def",
"pick_master_slide",
"(",
"master_slides_path",
":",
"Path",
")",
"->",
"Path",
":",
"if",
"master_slides_path",
".",
"is_file",
"(",
")",
":",
"return",
"master_slides_path",
"master_slides",
"=",
"[",
"f",
".",
"name",
"for",
"f",
"in",
"master_slides... | Returns path to a master slide. If argument is a directory,
returns a randomly chosen file in the directory and if argument
is a file, returns the argument itself
:return: path to chosen master slide | [
"Returns",
"path",
"to",
"a",
"master",
"slide",
".",
"If",
"argument",
"is",
"a",
"directory",
"returns",
"a",
"randomly",
"chosen",
"file",
"in",
"the",
"directory",
"and",
"if",
"argument",
"is",
"a",
"file",
"returns",
"the",
"argument",
"itself"
] | train | https://github.com/sukujgrg/pptx-builder-from-yaml/blob/2218290f2394a133f0937e432e588f687b2deb7b/pptx_builder/__init__.py#L127-L147 |
sukujgrg/pptx-builder-from-yaml | pptx_builder/__init__.py | validate_yaml_file | def validate_yaml_file(schema: dict, yaml_file: Path):
"""Validates yaml data against the defined schema
:param schema: schema in json format
:param yaml_file: path to yaml_file
:return:
"""
with yaml_file.open() as f:
data = yaml.load(f)
jsonschema.validate(data, schema) | python | def validate_yaml_file(schema: dict, yaml_file: Path):
"""Validates yaml data against the defined schema
:param schema: schema in json format
:param yaml_file: path to yaml_file
:return:
"""
with yaml_file.open() as f:
data = yaml.load(f)
jsonschema.validate(data, schema) | [
"def",
"validate_yaml_file",
"(",
"schema",
":",
"dict",
",",
"yaml_file",
":",
"Path",
")",
":",
"with",
"yaml_file",
".",
"open",
"(",
")",
"as",
"f",
":",
"data",
"=",
"yaml",
".",
"load",
"(",
"f",
")",
"jsonschema",
".",
"validate",
"(",
"data",... | Validates yaml data against the defined schema
:param schema: schema in json format
:param yaml_file: path to yaml_file
:return: | [
"Validates",
"yaml",
"data",
"against",
"the",
"defined",
"schema"
] | train | https://github.com/sukujgrg/pptx-builder-from-yaml/blob/2218290f2394a133f0937e432e588f687b2deb7b/pptx_builder/__init__.py#L150-L161 |
sukujgrg/pptx-builder-from-yaml | pptx_builder/__init__.py | cli | def cli(yaml_paths, pptx_template_path, font_size, master_slide_idx, slide_layout_idx, dst_dir, font_name,
slide_txt_alignment, validate):
"""
A powerpoint builder
https://github.com/sukujgrg/pptx-builder-from-yaml
"""
dst_dir = Path(dst_dir)
pptx_template_path = Path(pptx_template_p... | python | def cli(yaml_paths, pptx_template_path, font_size, master_slide_idx, slide_layout_idx, dst_dir, font_name,
slide_txt_alignment, validate):
"""
A powerpoint builder
https://github.com/sukujgrg/pptx-builder-from-yaml
"""
dst_dir = Path(dst_dir)
pptx_template_path = Path(pptx_template_p... | [
"def",
"cli",
"(",
"yaml_paths",
",",
"pptx_template_path",
",",
"font_size",
",",
"master_slide_idx",
",",
"slide_layout_idx",
",",
"dst_dir",
",",
"font_name",
",",
"slide_txt_alignment",
",",
"validate",
")",
":",
"dst_dir",
"=",
"Path",
"(",
"dst_dir",
")",
... | A powerpoint builder
https://github.com/sukujgrg/pptx-builder-from-yaml | [
"A",
"powerpoint",
"builder"
] | train | https://github.com/sukujgrg/pptx-builder-from-yaml/blob/2218290f2394a133f0937e432e588f687b2deb7b/pptx_builder/__init__.py#L176-L229 |
mymusise/Ants | ants/utils.py | RuleManager.exec_rule | def exec_rule(self, rule):
"""
:rule : the Ant class of rule, which must have a start() function
"""
print("running Rule: {0}".format(rule.__name__))
ant = rule()
ant.start() | python | def exec_rule(self, rule):
"""
:rule : the Ant class of rule, which must have a start() function
"""
print("running Rule: {0}".format(rule.__name__))
ant = rule()
ant.start() | [
"def",
"exec_rule",
"(",
"self",
",",
"rule",
")",
":",
"print",
"(",
"\"running Rule: {0}\"",
".",
"format",
"(",
"rule",
".",
"__name__",
")",
")",
"ant",
"=",
"rule",
"(",
")",
"ant",
".",
"start",
"(",
")"
] | :rule : the Ant class of rule, which must have a start() function | [
":",
"rule",
":",
"the",
"Ant",
"class",
"of",
"rule",
"which",
"must",
"have",
"a",
"start",
"()",
"function"
] | train | https://github.com/mymusise/Ants/blob/30d7e5e0af9f60da4c757047d532ac400d079f0d/ants/utils.py#L91-L97 |
radjkarl/fancyWidgets | fancywidgets/pyQtBased/Console.py | Console.addTextOut | def addTextOut(self, text):
"""add black text"""
self._currentColor = self._black
self.addText(text) | python | def addTextOut(self, text):
"""add black text"""
self._currentColor = self._black
self.addText(text) | [
"def",
"addTextOut",
"(",
"self",
",",
"text",
")",
":",
"self",
".",
"_currentColor",
"=",
"self",
".",
"_black",
"self",
".",
"addText",
"(",
"text",
")"
] | add black text | [
"add",
"black",
"text"
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/fancywidgets/pyQtBased/Console.py#L52-L55 |
radjkarl/fancyWidgets | fancywidgets/pyQtBased/Console.py | Console.addTextErr | def addTextErr(self, text):
"""add red text"""
self._currentColor = self._red
self.addText(text) | python | def addTextErr(self, text):
"""add red text"""
self._currentColor = self._red
self.addText(text) | [
"def",
"addTextErr",
"(",
"self",
",",
"text",
")",
":",
"self",
".",
"_currentColor",
"=",
"self",
".",
"_red",
"self",
".",
"addText",
"(",
"text",
")"
] | add red text | [
"add",
"red",
"text"
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/fancywidgets/pyQtBased/Console.py#L57-L60 |
radjkarl/fancyWidgets | fancywidgets/pyQtBased/Console.py | Console.addText | def addText(self, text):
"""append text in the chosen color"""
# move to the end of the doc
self.moveCursor(QtGui.QTextCursor.End)
# insert the text
self.setTextColor(self._currentColor)
self.textCursor().insertText(text) | python | def addText(self, text):
"""append text in the chosen color"""
# move to the end of the doc
self.moveCursor(QtGui.QTextCursor.End)
# insert the text
self.setTextColor(self._currentColor)
self.textCursor().insertText(text) | [
"def",
"addText",
"(",
"self",
",",
"text",
")",
":",
"# move to the end of the doc",
"self",
".",
"moveCursor",
"(",
"QtGui",
".",
"QTextCursor",
".",
"End",
")",
"# insert the text",
"self",
".",
"setTextColor",
"(",
"self",
".",
"_currentColor",
")",
"self"... | append text in the chosen color | [
"append",
"text",
"in",
"the",
"chosen",
"color"
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/fancywidgets/pyQtBased/Console.py#L62-L68 |
radjkarl/fancyWidgets | fancywidgets/pyQtBased/Console.py | Console.contextMenuEvent | def contextMenuEvent(self, event):
"""
Add menu action:
* 'Show line numbers'
* 'Save to file'
"""
menu = QtWidgets.QTextEdit.createStandardContextMenu(self)
# create max.lines spin box:
w = QtWidgets.QWidget()
l = QtWidgets.QHBoxLayout()
... | python | def contextMenuEvent(self, event):
"""
Add menu action:
* 'Show line numbers'
* 'Save to file'
"""
menu = QtWidgets.QTextEdit.createStandardContextMenu(self)
# create max.lines spin box:
w = QtWidgets.QWidget()
l = QtWidgets.QHBoxLayout()
... | [
"def",
"contextMenuEvent",
"(",
"self",
",",
"event",
")",
":",
"menu",
"=",
"QtWidgets",
".",
"QTextEdit",
".",
"createStandardContextMenu",
"(",
"self",
")",
"# create max.lines spin box:",
"w",
"=",
"QtWidgets",
".",
"QWidget",
"(",
")",
"l",
"=",
"QtWidget... | Add menu action:
* 'Show line numbers'
* 'Save to file' | [
"Add",
"menu",
"action",
":",
"*",
"Show",
"line",
"numbers",
"*",
"Save",
"to",
"file"
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/fancywidgets/pyQtBased/Console.py#L74-L98 |
xen/webcraft | webcraft/admin/saform.py | generate_form | def generate_form(model, only=None, meta=None):
"""
Generate WTForm based on SQLAlchemy table
:param model: SQLAlchemy sa.Table
:param only: list or set of columns that should be used in final form
:param meta: Meta class with settings for form
:return: WTForm object
"""
fields = Ordered... | python | def generate_form(model, only=None, meta=None):
"""
Generate WTForm based on SQLAlchemy table
:param model: SQLAlchemy sa.Table
:param only: list or set of columns that should be used in final form
:param meta: Meta class with settings for form
:return: WTForm object
"""
fields = Ordered... | [
"def",
"generate_form",
"(",
"model",
",",
"only",
"=",
"None",
",",
"meta",
"=",
"None",
")",
":",
"fields",
"=",
"OrderedDict",
"(",
")",
"if",
"meta",
":",
"fields",
"[",
"'Meta'",
"]",
"=",
"meta",
"for",
"name",
",",
"column",
"in",
"model",
"... | Generate WTForm based on SQLAlchemy table
:param model: SQLAlchemy sa.Table
:param only: list or set of columns that should be used in final form
:param meta: Meta class with settings for form
:return: WTForm object | [
"Generate",
"WTForm",
"based",
"on",
"SQLAlchemy",
"table",
":",
"param",
"model",
":",
"SQLAlchemy",
"sa",
".",
"Table",
":",
"param",
"only",
":",
"list",
"or",
"set",
"of",
"columns",
"that",
"should",
"be",
"used",
"in",
"final",
"form",
":",
"param"... | train | https://github.com/xen/webcraft/blob/74ff1e5b253048d9260446bfbc95de2e402a8005/webcraft/admin/saform.py#L91-L117 |
gasparka/pyhacores | pyhacores/packet/crc16.py | CRC16.main | def main(self, din, reload):
"""
:param din: bit in
:param reload: when True, reloads the initial value to LFSR
:return: current LFSR value (integer), CRC is correct if this is 0. Once it gets to 0 it STAYS 0, reset needed.
"""
if reload:
lfsr = self.INIT_GALO... | python | def main(self, din, reload):
"""
:param din: bit in
:param reload: when True, reloads the initial value to LFSR
:return: current LFSR value (integer), CRC is correct if this is 0. Once it gets to 0 it STAYS 0, reset needed.
"""
if reload:
lfsr = self.INIT_GALO... | [
"def",
"main",
"(",
"self",
",",
"din",
",",
"reload",
")",
":",
"if",
"reload",
":",
"lfsr",
"=",
"self",
".",
"INIT_GALOIS",
"else",
":",
"lfsr",
"=",
"self",
".",
"lfsr",
"out",
"=",
"lfsr",
"&",
"0x8000",
"next",
"=",
"(",
"(",
"lfsr",
"<<",
... | :param din: bit in
:param reload: when True, reloads the initial value to LFSR
:return: current LFSR value (integer), CRC is correct if this is 0. Once it gets to 0 it STAYS 0, reset needed. | [
":",
"param",
"din",
":",
"bit",
"in",
":",
"param",
"reload",
":",
"when",
"True",
"reloads",
"the",
"initial",
"value",
"to",
"LFSR",
":",
"return",
":",
"current",
"LFSR",
"value",
"(",
"integer",
")",
"CRC",
"is",
"correct",
"if",
"this",
"is",
"... | train | https://github.com/gasparka/pyhacores/blob/16c186fbbf90385f2ba3498395123e79b6fcf340/pyhacores/packet/crc16.py#L20-L35 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | main | def main(argString=None):
"""The main function of the module..
Here are the steps for duplicated samples:
1. Prints the options.
2. Reads the ``map`` file to gather marker's position
(:py:func:`readMAP`).
3. Reads the ``tfam`` file (:py:func:`readTFAM`).
4. Finds the unique markers... | python | def main(argString=None):
"""The main function of the module..
Here are the steps for duplicated samples:
1. Prints the options.
2. Reads the ``map`` file to gather marker's position
(:py:func:`readMAP`).
3. Reads the ``tfam`` file (:py:func:`readTFAM`).
4. Finds the unique markers... | [
"def",
"main",
"(",
"argString",
"=",
"None",
")",
":",
"# Getting and checking the options",
"args",
"=",
"parseArgs",
"(",
"argString",
")",
"checkArgs",
"(",
"args",
")",
"logger",
".",
"info",
"(",
"\"Options used:\"",
")",
"for",
"key",
",",
"value",
"i... | The main function of the module..
Here are the steps for duplicated samples:
1. Prints the options.
2. Reads the ``map`` file to gather marker's position
(:py:func:`readMAP`).
3. Reads the ``tfam`` file (:py:func:`readTFAM`).
4. Finds the unique markers using the ``map`` file
(... | [
"The",
"main",
"function",
"of",
"the",
"module",
".."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L38-L178 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | createFinalTPEDandTFAM | def createFinalTPEDandTFAM(tped, toReadPrefix, prefix, snpToRemove):
"""Creates the final TPED and TFAM.
:param tped: a representation of the ``tped`` of duplicated markers.
:param toReadPrefix: the prefix of the unique files.
:param prefix: the prefix of the output files.
:param snpToRemove: the m... | python | def createFinalTPEDandTFAM(tped, toReadPrefix, prefix, snpToRemove):
"""Creates the final TPED and TFAM.
:param tped: a representation of the ``tped`` of duplicated markers.
:param toReadPrefix: the prefix of the unique files.
:param prefix: the prefix of the output files.
:param snpToRemove: the m... | [
"def",
"createFinalTPEDandTFAM",
"(",
"tped",
",",
"toReadPrefix",
",",
"prefix",
",",
"snpToRemove",
")",
":",
"# First, copying the tfam",
"try",
":",
"shutil",
".",
"copy",
"(",
"toReadPrefix",
"+",
"\".tfam\"",
",",
"prefix",
"+",
"\".final.tfam\"",
")",
"ex... | Creates the final TPED and TFAM.
:param tped: a representation of the ``tped`` of duplicated markers.
:param toReadPrefix: the prefix of the unique files.
:param prefix: the prefix of the output files.
:param snpToRemove: the markers to remove.
:type tped: numpy.array
:type toReadPrefix: str
... | [
"Creates",
"the",
"final",
"TPED",
"and",
"TFAM",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L181-L228 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | createAndCleanTPED | def createAndCleanTPED(tped, tfam, snps, prefix, chosenSNPs, completion,
concordance, snpsToComplete, tfamFileName, completionT,
concordanceT):
"""Complete a TPED for duplicated SNPs.
:param tped: a representation of the ``tped`` of duplicated markers.
:param t... | python | def createAndCleanTPED(tped, tfam, snps, prefix, chosenSNPs, completion,
concordance, snpsToComplete, tfamFileName, completionT,
concordanceT):
"""Complete a TPED for duplicated SNPs.
:param tped: a representation of the ``tped`` of duplicated markers.
:param t... | [
"def",
"createAndCleanTPED",
"(",
"tped",
",",
"tfam",
",",
"snps",
",",
"prefix",
",",
"chosenSNPs",
",",
"completion",
",",
"concordance",
",",
"snpsToComplete",
",",
"tfamFileName",
",",
"completionT",
",",
"concordanceT",
")",
":",
"zeroedOutFile",
"=",
"N... | Complete a TPED for duplicated SNPs.
:param tped: a representation of the ``tped`` of duplicated markers.
:param tfam: a representation of the ``tfam``.
:param snps: the position of duplicated markers in the ``tped``.
:param prefix: the prefix of the output files.
:param chosenSNPs: the markers tha... | [
"Complete",
"a",
"TPED",
"for",
"duplicated",
"SNPs",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L231-L438 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | chooseBestSnps | def chooseBestSnps(tped, snps, trueCompletion, trueConcordance, prefix):
"""Choose the best duplicates according to the completion and concordance.
:param tped: a representation of the ``tped`` of duplicated markers.
:param snps: the position of the duplicated markers in the ``tped``.
:param trueComple... | python | def chooseBestSnps(tped, snps, trueCompletion, trueConcordance, prefix):
"""Choose the best duplicates according to the completion and concordance.
:param tped: a representation of the ``tped`` of duplicated markers.
:param snps: the position of the duplicated markers in the ``tped``.
:param trueComple... | [
"def",
"chooseBestSnps",
"(",
"tped",
",",
"snps",
",",
"trueCompletion",
",",
"trueConcordance",
",",
"prefix",
")",
":",
"# The output files",
"chosenFile",
"=",
"None",
"try",
":",
"chosenFile",
"=",
"open",
"(",
"prefix",
"+",
"\".chosen_snps.info\"",
",",
... | Choose the best duplicates according to the completion and concordance.
:param tped: a representation of the ``tped`` of duplicated markers.
:param snps: the position of the duplicated markers in the ``tped``.
:param trueCompletion: the completion of each markers.
:param trueConcordance: the pairwise c... | [
"Choose",
"the",
"best",
"duplicates",
"according",
"to",
"the",
"completion",
"and",
"concordance",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L441-L561 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | computeFrequency | def computeFrequency(prefix, outPrefix):
"""Computes the frequency of the SNPs using Plink.
:param prefix: the prefix of the input files.
:param outPrefix: the prefix of the output files.
:type prefix: str
:type outPrefix: str
:returns: a :py:class:`dict` containing the frequency of each mark... | python | def computeFrequency(prefix, outPrefix):
"""Computes the frequency of the SNPs using Plink.
:param prefix: the prefix of the input files.
:param outPrefix: the prefix of the output files.
:type prefix: str
:type outPrefix: str
:returns: a :py:class:`dict` containing the frequency of each mark... | [
"def",
"computeFrequency",
"(",
"prefix",
",",
"outPrefix",
")",
":",
"# The plink command",
"plinkCommand",
"=",
"[",
"\"plink\"",
",",
"\"--noweb\"",
",",
"\"--tfile\"",
",",
"prefix",
",",
"\"--freq\"",
",",
"\"--out\"",
",",
"outPrefix",
"+",
"\".duplicated_sn... | Computes the frequency of the SNPs using Plink.
:param prefix: the prefix of the input files.
:param outPrefix: the prefix of the output files.
:type prefix: str
:type outPrefix: str
:returns: a :py:class:`dict` containing the frequency of each marker.
Start by computing the frequency of all... | [
"Computes",
"the",
"frequency",
"of",
"the",
"SNPs",
"using",
"Plink",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L564-L623 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | printDuplicatedTPEDandTFAM | def printDuplicatedTPEDandTFAM(tped, tfamFileName, outPrefix):
"""Print the duplicated SNPs TPED and TFAM.
:param tped: a representation of the ``tped`` of duplicated markers.
:param tfamFileName: the name of the original ``tfam`` file.
:param outPrefix: the output prefix.
:type tped: numpy.array
... | python | def printDuplicatedTPEDandTFAM(tped, tfamFileName, outPrefix):
"""Print the duplicated SNPs TPED and TFAM.
:param tped: a representation of the ``tped`` of duplicated markers.
:param tfamFileName: the name of the original ``tfam`` file.
:param outPrefix: the output prefix.
:type tped: numpy.array
... | [
"def",
"printDuplicatedTPEDandTFAM",
"(",
"tped",
",",
"tfamFileName",
",",
"outPrefix",
")",
":",
"# Copying the tfam file",
"try",
":",
"shutil",
".",
"copy",
"(",
"tfamFileName",
",",
"outPrefix",
"+",
"\".duplicated_snps.tfam\"",
")",
"except",
"IOError",
":",
... | Print the duplicated SNPs TPED and TFAM.
:param tped: a representation of the ``tped`` of duplicated markers.
:param tfamFileName: the name of the original ``tfam`` file.
:param outPrefix: the output prefix.
:type tped: numpy.array
:type tfamFileName: str
:type outPrefix: str
First, it co... | [
"Print",
"the",
"duplicated",
"SNPs",
"TPED",
"and",
"TFAM",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L646-L680 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | printConcordance | def printConcordance(concordance, prefix, tped, snps):
"""Print the concordance.
:param concordance: the concordance.
:param prefix: the prefix if the output files.
:param tped: a representation of the ``tped`` of duplicated markers.
:param snps: the position of the duplicated markers in the ``tped... | python | def printConcordance(concordance, prefix, tped, snps):
"""Print the concordance.
:param concordance: the concordance.
:param prefix: the prefix if the output files.
:param tped: a representation of the ``tped`` of duplicated markers.
:param snps: the position of the duplicated markers in the ``tped... | [
"def",
"printConcordance",
"(",
"concordance",
",",
"prefix",
",",
"tped",
",",
"snps",
")",
":",
"outFile",
"=",
"None",
"try",
":",
"outFile",
"=",
"open",
"(",
"prefix",
"+",
"\".concordance\"",
",",
"\"w\"",
")",
"except",
"IOError",
":",
"msg",
"=",... | Print the concordance.
:param concordance: the concordance.
:param prefix: the prefix if the output files.
:param tped: a representation of the ``tped`` of duplicated markers.
:param snps: the position of the duplicated markers in the ``tped``.
:type concordance: dict
:type prefix: str
:ty... | [
"Print",
"the",
"concordance",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L683-L724 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | printProblems | def printProblems(completion, concordance, tped, snps, frequencies, prefix,
diffFreq):
"""Print the statistics.
:param completion: the completion of each duplicated markers.
:param concordance: the pairwise concordance between duplicated markers.
:param tped: a representation of the `... | python | def printProblems(completion, concordance, tped, snps, frequencies, prefix,
diffFreq):
"""Print the statistics.
:param completion: the completion of each duplicated markers.
:param concordance: the pairwise concordance between duplicated markers.
:param tped: a representation of the `... | [
"def",
"printProblems",
"(",
"completion",
",",
"concordance",
",",
"tped",
",",
"snps",
",",
"frequencies",
",",
"prefix",
",",
"diffFreq",
")",
":",
"completionPercentage",
"=",
"np",
".",
"true_divide",
"(",
"completion",
"[",
"0",
"]",
",",
"completion",... | Print the statistics.
:param completion: the completion of each duplicated markers.
:param concordance: the pairwise concordance between duplicated markers.
:param tped: a representation of the ``tped`` of duplicated markers.
:param snps: the positions of the duplicated markers in the ``tped``
:par... | [
"Print",
"the",
"statistics",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L727-L930 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | computeStatistics | def computeStatistics(tped, tfam, snps):
"""Computes the completion and concordance of each SNPs.
:param tped: a representation of the ``tped``.
:param tfam: a representation of the ``tfam``
:param snps: the position of the duplicated markers in the ``tped``.
:type tped: numpy.array
:type tfam... | python | def computeStatistics(tped, tfam, snps):
"""Computes the completion and concordance of each SNPs.
:param tped: a representation of the ``tped``.
:param tfam: a representation of the ``tfam``
:param snps: the position of the duplicated markers in the ``tped``.
:type tped: numpy.array
:type tfam... | [
"def",
"computeStatistics",
"(",
"tped",
",",
"tfam",
",",
"snps",
")",
":",
"# The completion data type",
"completion",
"=",
"np",
".",
"array",
"(",
"[",
"[",
"0",
"for",
"i",
"in",
"xrange",
"(",
"len",
"(",
"tped",
")",
")",
"]",
",",
"[",
"0",
... | Computes the completion and concordance of each SNPs.
:param tped: a representation of the ``tped``.
:param tfam: a representation of the ``tfam``
:param snps: the position of the duplicated markers in the ``tped``.
:type tped: numpy.array
:type tfam: list
:type snps: dict
:returns: a tup... | [
"Computes",
"the",
"completion",
"and",
"concordance",
"of",
"each",
"SNPs",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L933-L1063 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | getIndexOfHeteroMen | def getIndexOfHeteroMen(genotypes, menIndex):
"""Get the indexes of heterozygous men.
:param genotypes: the genotypes of everybody.
:param menIndex: the indexes of the men (for the genotypes).
:type genotypes: numpy.array
:type menIndex: numpy.array
:returns: a :py:class:`numpy.array` contain... | python | def getIndexOfHeteroMen(genotypes, menIndex):
"""Get the indexes of heterozygous men.
:param genotypes: the genotypes of everybody.
:param menIndex: the indexes of the men (for the genotypes).
:type genotypes: numpy.array
:type menIndex: numpy.array
:returns: a :py:class:`numpy.array` contain... | [
"def",
"getIndexOfHeteroMen",
"(",
"genotypes",
",",
"menIndex",
")",
":",
"toRemove",
"=",
"set",
"(",
")",
"for",
"i",
"in",
"menIndex",
"[",
"0",
"]",
":",
"for",
"genotype",
"in",
"[",
"set",
"(",
"j",
".",
"split",
"(",
"\" \"",
")",
")",
"for... | Get the indexes of heterozygous men.
:param genotypes: the genotypes of everybody.
:param menIndex: the indexes of the men (for the genotypes).
:type genotypes: numpy.array
:type menIndex: numpy.array
:returns: a :py:class:`numpy.array` containing the indexes of the genotypes
to rem... | [
"Get",
"the",
"indexes",
"of",
"heterozygous",
"men",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L1066-L1092 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | flipGenotype | def flipGenotype(genotype):
"""Flips a genotype.
:param genotype: the genotype to flip.
:type genotype: set
:returns: the new flipped genotype (as a :py:class:`set`)
.. testsetup::
from pyGenClean.DupSNPs.duplicated_snps import flipGenotype
.. doctest::
>>> flipGenotype({"... | python | def flipGenotype(genotype):
"""Flips a genotype.
:param genotype: the genotype to flip.
:type genotype: set
:returns: the new flipped genotype (as a :py:class:`set`)
.. testsetup::
from pyGenClean.DupSNPs.duplicated_snps import flipGenotype
.. doctest::
>>> flipGenotype({"... | [
"def",
"flipGenotype",
"(",
"genotype",
")",
":",
"newGenotype",
"=",
"set",
"(",
")",
"for",
"allele",
"in",
"genotype",
":",
"if",
"allele",
"==",
"\"A\"",
":",
"newGenotype",
".",
"add",
"(",
"\"T\"",
")",
"elif",
"allele",
"==",
"\"C\"",
":",
"newG... | Flips a genotype.
:param genotype: the genotype to flip.
:type genotype: set
:returns: the new flipped genotype (as a :py:class:`set`)
.. testsetup::
from pyGenClean.DupSNPs.duplicated_snps import flipGenotype
.. doctest::
>>> flipGenotype({"A", "T"})
set(['A', 'T'])
... | [
"Flips",
"a",
"genotype",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L1095-L1140 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | processTPED | def processTPED(uniqueSNPs, mapF, fileName, tfam, prefix):
"""Process the TPED file.
:param uniqueSNPs: the unique markers.
:param mapF: a representation of the ``map`` file.
:param fileName: the name of the ``tped`` file.
:param tfam: the name of the ``tfam`` file.
:param prefix: the prefix of... | python | def processTPED(uniqueSNPs, mapF, fileName, tfam, prefix):
"""Process the TPED file.
:param uniqueSNPs: the unique markers.
:param mapF: a representation of the ``map`` file.
:param fileName: the name of the ``tped`` file.
:param tfam: the name of the ``tfam`` file.
:param prefix: the prefix of... | [
"def",
"processTPED",
"(",
"uniqueSNPs",
",",
"mapF",
",",
"fileName",
",",
"tfam",
",",
"prefix",
")",
":",
"# Copying the tfam file",
"try",
":",
"shutil",
".",
"copy",
"(",
"tfam",
",",
"prefix",
"+",
"\".unique_snps.tfam\"",
")",
"except",
"IOError",
":"... | Process the TPED file.
:param uniqueSNPs: the unique markers.
:param mapF: a representation of the ``map`` file.
:param fileName: the name of the ``tped`` file.
:param tfam: the name of the ``tfam`` file.
:param prefix: the prefix of all the files.
:type uniqueSNPs: dict
:type mapF: list
... | [
"Process",
"the",
"TPED",
"file",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L1144-L1212 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | findUniques | def findUniques(mapF):
"""Finds the unique markers in a MAP.
:param mapF: representation of a ``map`` file.
:type mapF: list
:returns: a :py:class:`dict` containing unique markers (according to their
genomic localisation).
"""
uSNPs = {}
dSNPs = defaultdict(list)
for i,... | python | def findUniques(mapF):
"""Finds the unique markers in a MAP.
:param mapF: representation of a ``map`` file.
:type mapF: list
:returns: a :py:class:`dict` containing unique markers (according to their
genomic localisation).
"""
uSNPs = {}
dSNPs = defaultdict(list)
for i,... | [
"def",
"findUniques",
"(",
"mapF",
")",
":",
"uSNPs",
"=",
"{",
"}",
"dSNPs",
"=",
"defaultdict",
"(",
"list",
")",
"for",
"i",
",",
"row",
"in",
"enumerate",
"(",
"mapF",
")",
":",
"chromosome",
"=",
"row",
"[",
"0",
"]",
"position",
"=",
"row",
... | Finds the unique markers in a MAP.
:param mapF: representation of a ``map`` file.
:type mapF: list
:returns: a :py:class:`dict` containing unique markers (according to their
genomic localisation). | [
"Finds",
"the",
"unique",
"markers",
"in",
"a",
"MAP",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L1215-L1249 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | readTFAM | def readTFAM(fileName):
"""Reads the TFAM file.
:param fileName: the name of the ``tfam`` file.
:type fileName: str
:returns: a representation the ``tfam`` file (:py:class:`numpy.array`).
"""
# Saving the TFAM file
tfam = None
with open(fileName, 'r') as inputFile:
tfam = [
... | python | def readTFAM(fileName):
"""Reads the TFAM file.
:param fileName: the name of the ``tfam`` file.
:type fileName: str
:returns: a representation the ``tfam`` file (:py:class:`numpy.array`).
"""
# Saving the TFAM file
tfam = None
with open(fileName, 'r') as inputFile:
tfam = [
... | [
"def",
"readTFAM",
"(",
"fileName",
")",
":",
"# Saving the TFAM file",
"tfam",
"=",
"None",
"with",
"open",
"(",
"fileName",
",",
"'r'",
")",
"as",
"inputFile",
":",
"tfam",
"=",
"[",
"tuple",
"(",
"i",
".",
"rstrip",
"(",
"\"\\r\\n\"",
")",
".",
"spl... | Reads the TFAM file.
:param fileName: the name of the ``tfam`` file.
:type fileName: str
:returns: a representation the ``tfam`` file (:py:class:`numpy.array`). | [
"Reads",
"the",
"TFAM",
"file",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L1252-L1271 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | readMAP | def readMAP(fileName, prefix):
"""Reads the MAP file.
:param fileName: the name of the ``map`` file.
:type fileName: str
:returns: a list of tuples, representing the ``map`` file.
While reading the ``map`` file, it saves a file
(``prefix.duplicated_marker_names``) containing the name of the ... | python | def readMAP(fileName, prefix):
"""Reads the MAP file.
:param fileName: the name of the ``map`` file.
:type fileName: str
:returns: a list of tuples, representing the ``map`` file.
While reading the ``map`` file, it saves a file
(``prefix.duplicated_marker_names``) containing the name of the ... | [
"def",
"readMAP",
"(",
"fileName",
",",
"prefix",
")",
":",
"# Saving the MAP file",
"mapF",
"=",
"None",
"with",
"open",
"(",
"fileName",
",",
"'r'",
")",
"as",
"inputFile",
":",
"mapF",
"=",
"[",
"tuple",
"(",
"i",
".",
"rstrip",
"(",
"\"\\r\\n\"",
"... | Reads the MAP file.
:param fileName: the name of the ``map`` file.
:type fileName: str
:returns: a list of tuples, representing the ``map`` file.
While reading the ``map`` file, it saves a file
(``prefix.duplicated_marker_names``) containing the name of the unique
duplicated markers. | [
"Reads",
"the",
"MAP",
"file",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L1274-L1321 |
lemieuxl/pyGenClean | pyGenClean/DupSNPs/duplicated_snps.py | checkArgs | def checkArgs(args):
"""Checks the arguments and options.
:param args: an object containing the options of the program.
:type args: argparse.Namespace
:returns: ``True`` if everything was OK.
If there is a problem with an option, an exception is raised using the
:py:class:`ProgramError` clas... | python | def checkArgs(args):
"""Checks the arguments and options.
:param args: an object containing the options of the program.
:type args: argparse.Namespace
:returns: ``True`` if everything was OK.
If there is a problem with an option, an exception is raised using the
:py:class:`ProgramError` clas... | [
"def",
"checkArgs",
"(",
"args",
")",
":",
"# Checking the input files",
"for",
"suffix",
"in",
"[",
"\".tped\"",
",",
"\".tfam\"",
",",
"\".map\"",
"]",
":",
"fileName",
"=",
"args",
".",
"tfile",
"+",
"suffix",
"if",
"not",
"os",
".",
"path",
".",
"isf... | Checks the arguments and options.
:param args: an object containing the options of the program.
:type args: argparse.Namespace
:returns: ``True`` if everything was OK.
If there is a problem with an option, an exception is raised using the
:py:class:`ProgramError` class, a message is printed to t... | [
"Checks",
"the",
"arguments",
"and",
"options",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/DupSNPs/duplicated_snps.py#L1324-L1365 |
radjkarl/fancyWidgets | fancywidgets/pyQtBased/MenuBar.py | MenuBar.findMenu | def findMenu(self, title):
"""
find a menu with a given title
@type title: string
@param title: English title of the menu
@rtype: QMenu
@return: None if no menu was found, else the menu with title
"""
# See also http://www.riverbankcomputing.c... | python | def findMenu(self, title):
"""
find a menu with a given title
@type title: string
@param title: English title of the menu
@rtype: QMenu
@return: None if no menu was found, else the menu with title
"""
# See also http://www.riverbankcomputing.c... | [
"def",
"findMenu",
"(",
"self",
",",
"title",
")",
":",
"# See also http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#differences-between-pyqt-and-qt",
"#title = QApplication.translate(mikro.classname(self.window), title)",
"for",
"menu",
"in",
"self",
".",
"iter_menu... | find a menu with a given title
@type title: string
@param title: English title of the menu
@rtype: QMenu
@return: None if no menu was found, else the menu with title | [
"find",
"a",
"menu",
"with",
"a",
"given",
"title"
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/fancywidgets/pyQtBased/MenuBar.py#L28-L44 |
radjkarl/fancyWidgets | fancywidgets/pyQtBased/MenuBar.py | MenuBar.insertMenuBefore | def insertMenuBefore(self, before_menu, new_menu):
"""
Insert a menu after another menu in the menubar
@type: before_menu QMenu instance or title string of menu
@param before_menu: menu which should be after the newly inserted menu
@rtype: QAction instance
@return: actio... | python | def insertMenuBefore(self, before_menu, new_menu):
"""
Insert a menu after another menu in the menubar
@type: before_menu QMenu instance or title string of menu
@param before_menu: menu which should be after the newly inserted menu
@rtype: QAction instance
@return: actio... | [
"def",
"insertMenuBefore",
"(",
"self",
",",
"before_menu",
",",
"new_menu",
")",
":",
"if",
"isinstance",
"(",
"before_menu",
",",
"string_types",
")",
":",
"before_menu",
"=",
"self",
".",
"findMenu",
"(",
"before_menu",
")",
"before_action",
"=",
"self",
... | Insert a menu after another menu in the menubar
@type: before_menu QMenu instance or title string of menu
@param before_menu: menu which should be after the newly inserted menu
@rtype: QAction instance
@return: action for inserted menu | [
"Insert",
"a",
"menu",
"after",
"another",
"menu",
"in",
"the",
"menubar"
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/fancywidgets/pyQtBased/MenuBar.py#L51-L66 |
radjkarl/fancyWidgets | DUMP/pyqtgraphBased/parametertree/parameterTypes.py | WidgetParameterItem.makeWidget | def makeWidget(self):
"""
Return a single widget that should be placed in the second tree column.
The widget must be given three attributes:
========== ============================================================
sigChanged a signal that is emitted when the widget's value is c... | python | def makeWidget(self):
"""
Return a single widget that should be placed in the second tree column.
The widget must be given three attributes:
========== ============================================================
sigChanged a signal that is emitted when the widget's value is c... | [
"def",
"makeWidget",
"(",
"self",
")",
":",
"opts",
"=",
"self",
".",
"param",
".",
"opts",
"t",
"=",
"opts",
"[",
"'type'",
"]",
"if",
"t",
"==",
"'int'",
":",
"defs",
"=",
"{",
"'value'",
":",
"0",
",",
"'min'",
":",
"None",
",",
"'max'",
":"... | Return a single widget that should be placed in the second tree column.
The widget must be given three attributes:
========== ============================================================
sigChanged a signal that is emitted when the widget's value is changed
value a function that... | [
"Return",
"a",
"single",
"widget",
"that",
"should",
"be",
"placed",
"in",
"the",
"second",
"tree",
"column",
".",
"The",
"widget",
"must",
"be",
"given",
"three",
"attributes",
":"
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/DUMP/pyqtgraphBased/parametertree/parameterTypes.py#L94-L168 |
radjkarl/fancyWidgets | DUMP/pyqtgraphBased/parametertree/parameterTypes.py | WidgetParameterItem.updateDisplayLabel | def updateDisplayLabel(self, value=None):
"""Update the display label to reflect the value of the parameter."""
if value is None:
value = self.param.value()
opts = self.param.opts
if isinstance(self.widget, QtWidgets.QAbstractSpinBox):
text = asUnicode(self.widget... | python | def updateDisplayLabel(self, value=None):
"""Update the display label to reflect the value of the parameter."""
if value is None:
value = self.param.value()
opts = self.param.opts
if isinstance(self.widget, QtWidgets.QAbstractSpinBox):
text = asUnicode(self.widget... | [
"def",
"updateDisplayLabel",
"(",
"self",
",",
"value",
"=",
"None",
")",
":",
"if",
"value",
"is",
"None",
":",
"value",
"=",
"self",
".",
"param",
".",
"value",
"(",
")",
"opts",
"=",
"self",
".",
"param",
".",
"opts",
"if",
"isinstance",
"(",
"s... | Update the display label to reflect the value of the parameter. | [
"Update",
"the",
"display",
"label",
"to",
"reflect",
"the",
"value",
"of",
"the",
"parameter",
"."
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/DUMP/pyqtgraphBased/parametertree/parameterTypes.py#L211-L222 |
radjkarl/fancyWidgets | DUMP/pyqtgraphBased/parametertree/parameterTypes.py | WidgetParameterItem.widgetValueChanging | def widgetValueChanging(self, *args):
"""
Called when the widget's value is changing, but not finalized.
For example: editing text before pressing enter or changing focus.
"""
# This is a bit sketchy: assume the last argument of each signal is
# the value..
self.p... | python | def widgetValueChanging(self, *args):
"""
Called when the widget's value is changing, but not finalized.
For example: editing text before pressing enter or changing focus.
"""
# This is a bit sketchy: assume the last argument of each signal is
# the value..
self.p... | [
"def",
"widgetValueChanging",
"(",
"self",
",",
"*",
"args",
")",
":",
"# This is a bit sketchy: assume the last argument of each signal is",
"# the value..",
"self",
".",
"param",
".",
"sigValueChanging",
".",
"emit",
"(",
"self",
".",
"param",
",",
"args",
"[",
"-... | Called when the widget's value is changing, but not finalized.
For example: editing text before pressing enter or changing focus. | [
"Called",
"when",
"the",
"widget",
"s",
"value",
"is",
"changing",
"but",
"not",
"finalized",
".",
"For",
"example",
":",
"editing",
"text",
"before",
"pressing",
"enter",
"or",
"changing",
"focus",
"."
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/DUMP/pyqtgraphBased/parametertree/parameterTypes.py#L229-L236 |
radjkarl/fancyWidgets | DUMP/pyqtgraphBased/parametertree/parameterTypes.py | WidgetParameterItem.selected | def selected(self, sel):
"""Called when this item has been selected (sel=True) OR deselected (sel=False)"""
ParameterItem.selected(self, sel)
if self.widget is None:
return
if sel and self.param.writable():
self.showEditor()
elif self.hideWidget:
... | python | def selected(self, sel):
"""Called when this item has been selected (sel=True) OR deselected (sel=False)"""
ParameterItem.selected(self, sel)
if self.widget is None:
return
if sel and self.param.writable():
self.showEditor()
elif self.hideWidget:
... | [
"def",
"selected",
"(",
"self",
",",
"sel",
")",
":",
"ParameterItem",
".",
"selected",
"(",
"self",
",",
"sel",
")",
"if",
"self",
".",
"widget",
"is",
"None",
":",
"return",
"if",
"sel",
"and",
"self",
".",
"param",
".",
"writable",
"(",
")",
":"... | Called when this item has been selected (sel=True) OR deselected (sel=False) | [
"Called",
"when",
"this",
"item",
"has",
"been",
"selected",
"(",
"sel",
"=",
"True",
")",
"OR",
"deselected",
"(",
"sel",
"=",
"False",
")"
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/DUMP/pyqtgraphBased/parametertree/parameterTypes.py#L238-L247 |
radjkarl/fancyWidgets | DUMP/pyqtgraphBased/parametertree/parameterTypes.py | WidgetParameterItem.limitsChanged | def limitsChanged(self, param, limits):
"""Called when the parameter's limits have changed"""
ParameterItem.limitsChanged(self, param, limits)
t = self.param.opts['type']
if t == 'int' or t == 'float':
self.widget.setOpts(bounds=limits)
else:
return | python | def limitsChanged(self, param, limits):
"""Called when the parameter's limits have changed"""
ParameterItem.limitsChanged(self, param, limits)
t = self.param.opts['type']
if t == 'int' or t == 'float':
self.widget.setOpts(bounds=limits)
else:
return | [
"def",
"limitsChanged",
"(",
"self",
",",
"param",
",",
"limits",
")",
":",
"ParameterItem",
".",
"limitsChanged",
"(",
"self",
",",
"param",
",",
"limits",
")",
"t",
"=",
"self",
".",
"param",
".",
"opts",
"[",
"'type'",
"]",
"if",
"t",
"==",
"'int'... | Called when the parameter's limits have changed | [
"Called",
"when",
"the",
"parameter",
"s",
"limits",
"have",
"changed"
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/DUMP/pyqtgraphBased/parametertree/parameterTypes.py#L258-L266 |
radjkarl/fancyWidgets | DUMP/pyqtgraphBased/parametertree/parameterTypes.py | WidgetParameterItem.treeWidgetChanged | def treeWidgetChanged(self):
"""Called when this item is added or removed from a tree."""
ParameterItem.treeWidgetChanged(self)
# add all widgets for this item into the tree
if self.widget is not None:
tree = self.treeWidget()
if tree is None:
ret... | python | def treeWidgetChanged(self):
"""Called when this item is added or removed from a tree."""
ParameterItem.treeWidgetChanged(self)
# add all widgets for this item into the tree
if self.widget is not None:
tree = self.treeWidget()
if tree is None:
ret... | [
"def",
"treeWidgetChanged",
"(",
"self",
")",
":",
"ParameterItem",
".",
"treeWidgetChanged",
"(",
"self",
")",
"# add all widgets for this item into the tree",
"if",
"self",
".",
"widget",
"is",
"not",
"None",
":",
"tree",
"=",
"self",
".",
"treeWidget",
"(",
"... | Called when this item is added or removed from a tree. | [
"Called",
"when",
"this",
"item",
"is",
"added",
"or",
"removed",
"from",
"a",
"tree",
"."
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/DUMP/pyqtgraphBased/parametertree/parameterTypes.py#L271-L282 |
radjkarl/fancyWidgets | DUMP/pyqtgraphBased/parametertree/parameterTypes.py | WidgetParameterItem.optsChanged | def optsChanged(self, param, opts):
"""Called when any options are changed that are not
name, value, default, or limits"""
# print "opts changed:", opts
ParameterItem.optsChanged(self, param, opts)
w = self.widget
if 'readonly' in opts:
self.updateDefaultBtn()... | python | def optsChanged(self, param, opts):
"""Called when any options are changed that are not
name, value, default, or limits"""
# print "opts changed:", opts
ParameterItem.optsChanged(self, param, opts)
w = self.widget
if 'readonly' in opts:
self.updateDefaultBtn()... | [
"def",
"optsChanged",
"(",
"self",
",",
"param",
",",
"opts",
")",
":",
"# print \"opts changed:\", opts",
"ParameterItem",
".",
"optsChanged",
"(",
"self",
",",
"param",
",",
"opts",
")",
"w",
"=",
"self",
".",
"widget",
"if",
"'readonly'",
"in",
"opts",
... | Called when any options are changed that are not
name, value, default, or limits | [
"Called",
"when",
"any",
"options",
"are",
"changed",
"that",
"are",
"not",
"name",
"value",
"default",
"or",
"limits"
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/DUMP/pyqtgraphBased/parametertree/parameterTypes.py#L287-L303 |
radjkarl/fancyWidgets | DUMP/pyqtgraphBased/parametertree/parameterTypes.py | GroupParameterItem.addChanged | def addChanged(self):
"""Called when "add new" combo is changed
The parameter MUST have an 'addNew' method defined.
"""
if self.addWidget.currentIndex() == 0:
return
typ = asUnicode(self.addWidget.currentText())
self.param.addNew(typ)
self.addWidget.se... | python | def addChanged(self):
"""Called when "add new" combo is changed
The parameter MUST have an 'addNew' method defined.
"""
if self.addWidget.currentIndex() == 0:
return
typ = asUnicode(self.addWidget.currentText())
self.param.addNew(typ)
self.addWidget.se... | [
"def",
"addChanged",
"(",
"self",
")",
":",
"if",
"self",
".",
"addWidget",
".",
"currentIndex",
"(",
")",
"==",
"0",
":",
"return",
"typ",
"=",
"asUnicode",
"(",
"self",
".",
"addWidget",
".",
"currentText",
"(",
")",
")",
"self",
".",
"param",
".",... | Called when "add new" combo is changed
The parameter MUST have an 'addNew' method defined. | [
"Called",
"when",
"add",
"new",
"combo",
"is",
"changed",
"The",
"parameter",
"MUST",
"have",
"an",
"addNew",
"method",
"defined",
"."
] | train | https://github.com/radjkarl/fancyWidgets/blob/ffe0d5747c5296c78575f0e0909af915a4a5698f/DUMP/pyqtgraphBased/parametertree/parameterTypes.py#L416-L424 |
CulturePlex/django-zotero | django_zotero/templatetags/zotero_inline_extras.py | zotero_inline_tags | def zotero_inline_tags(parser, token):
"""
Render an inline formset of tags.
Usage:
{% zotero_inline_tags formset[ option] %}
option = "all" | "media" | "formset"
"""
args = token.split_contents()
length = len(args)
if length == 2:
rendered_node = RenderedAl... | python | def zotero_inline_tags(parser, token):
"""
Render an inline formset of tags.
Usage:
{% zotero_inline_tags formset[ option] %}
option = "all" | "media" | "formset"
"""
args = token.split_contents()
length = len(args)
if length == 2:
rendered_node = RenderedAl... | [
"def",
"zotero_inline_tags",
"(",
"parser",
",",
"token",
")",
":",
"args",
"=",
"token",
".",
"split_contents",
"(",
")",
"length",
"=",
"len",
"(",
"args",
")",
"if",
"length",
"==",
"2",
":",
"rendered_node",
"=",
"RenderedAllNode",
"(",
"args",
"[",
... | Render an inline formset of tags.
Usage:
{% zotero_inline_tags formset[ option] %}
option = "all" | "media" | "formset" | [
"Render",
"an",
"inline",
"formset",
"of",
"tags",
".",
"Usage",
":",
"{",
"%",
"zotero_inline_tags",
"formset",
"[",
"option",
"]",
"%",
"}",
"option",
"=",
"all",
"|",
"media",
"|",
"formset"
] | train | https://github.com/CulturePlex/django-zotero/blob/de31583a80a2bd2459c118fb5aa767a2842e0b00/django_zotero/templatetags/zotero_inline_extras.py#L10-L32 |
emdb-empiar/ahds | ahds/grammar.py | detect_format | def detect_format(fn, format_bytes=50, verbose=False, *args, **kwargs):
"""Detect Amira file format (AmiraMesh or HyperSurface)
:param str fn: file name
:param int format_bytes: number of bytes in which to search for the format [default: 50]
:param bool verbose: verbose (default) or not
:return... | python | def detect_format(fn, format_bytes=50, verbose=False, *args, **kwargs):
"""Detect Amira file format (AmiraMesh or HyperSurface)
:param str fn: file name
:param int format_bytes: number of bytes in which to search for the format [default: 50]
:param bool verbose: verbose (default) or not
:return... | [
"def",
"detect_format",
"(",
"fn",
",",
"format_bytes",
"=",
"50",
",",
"verbose",
"=",
"False",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"assert",
"format_bytes",
">",
"0",
"assert",
"verbose",
"in",
"[",
"True",
",",
"False",
"]",
"with... | Detect Amira file format (AmiraMesh or HyperSurface)
:param str fn: file name
:param int format_bytes: number of bytes in which to search for the format [default: 50]
:param bool verbose: verbose (default) or not
:return str file_format: either ``AmiraMesh`` or ``HyperSurface`` | [
"Detect",
"Amira",
"file",
"format",
"(",
"AmiraMesh",
"or",
"HyperSurface",
")",
":",
"param",
"str",
"fn",
":",
"file",
"name",
":",
"param",
"int",
"format_bytes",
":",
"number",
"of",
"bytes",
"in",
"which",
"to",
"search",
"for",
"the",
"format",
"[... | train | https://github.com/emdb-empiar/ahds/blob/6a752f6806d4f62155cd2e1194de8aabe7195e0f/ahds/grammar.py#L218-L242 |
emdb-empiar/ahds | ahds/grammar.py | get_header | def get_header(fn, file_format, header_bytes=20000, verbose=False, *args, **kwargs):
"""Apply rules for detecting the boundary of the header
:param str fn: file name
:param str file_format: either ``AmiraMesh`` or ``HyperSurface``
:param int header_bytes: number of bytes in which to search for the ... | python | def get_header(fn, file_format, header_bytes=20000, verbose=False, *args, **kwargs):
"""Apply rules for detecting the boundary of the header
:param str fn: file name
:param str file_format: either ``AmiraMesh`` or ``HyperSurface``
:param int header_bytes: number of bytes in which to search for the ... | [
"def",
"get_header",
"(",
"fn",
",",
"file_format",
",",
"header_bytes",
"=",
"20000",
",",
"verbose",
"=",
"False",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"assert",
"header_bytes",
">",
"0",
"assert",
"file_format",
"in",
"[",
"'AmiraMesh'... | Apply rules for detecting the boundary of the header
:param str fn: file name
:param str file_format: either ``AmiraMesh`` or ``HyperSurface``
:param int header_bytes: number of bytes in which to search for the header [default: 20000]
:return str data: the header as per the ``file_format`` | [
"Apply",
"rules",
"for",
"detecting",
"the",
"boundary",
"of",
"the",
"header",
":",
"param",
"str",
"fn",
":",
"file",
"name",
":",
"param",
"str",
"file_format",
":",
"either",
"AmiraMesh",
"or",
"HyperSurface",
":",
"param",
"int",
"header_bytes",
":",
... | train | https://github.com/emdb-empiar/ahds/blob/6a752f6806d4f62155cd2e1194de8aabe7195e0f/ahds/grammar.py#L245-L275 |
emdb-empiar/ahds | ahds/grammar.py | parse_header | def parse_header(data, verbose=False, *args, **kwargs):
"""Parse the data using the grammar specified in this module
:param str data: delimited data to be parsed for metadata
:return list parsed_data: structured metadata
"""
# the parser
if verbose:
print >> sys.stderr, "Creating p... | python | def parse_header(data, verbose=False, *args, **kwargs):
"""Parse the data using the grammar specified in this module
:param str data: delimited data to be parsed for metadata
:return list parsed_data: structured metadata
"""
# the parser
if verbose:
print >> sys.stderr, "Creating p... | [
"def",
"parse_header",
"(",
"data",
",",
"verbose",
"=",
"False",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# the parser",
"if",
"verbose",
":",
"print",
">>",
"sys",
".",
"stderr",
",",
"\"Creating parser object...\"",
"parser",
"=",
"Parser",... | Parse the data using the grammar specified in this module
:param str data: delimited data to be parsed for metadata
:return list parsed_data: structured metadata | [
"Parse",
"the",
"data",
"using",
"the",
"grammar",
"specified",
"in",
"this",
"module",
":",
"param",
"str",
"data",
":",
"delimited",
"data",
"to",
"be",
"parsed",
"for",
"metadata",
":",
"return",
"list",
"parsed_data",
":",
"structured",
"metadata"
] | train | https://github.com/emdb-empiar/ahds/blob/6a752f6806d4f62155cd2e1194de8aabe7195e0f/ahds/grammar.py#L278-L304 |
emdb-empiar/ahds | ahds/grammar.py | get_parsed_data | def get_parsed_data(fn, *args, **kwargs):
"""All above functions as a single function
:param str fn: file name
:return list parsed_data: structured metadata
"""
file_format = detect_format(fn, *args, **kwargs)
data = get_header(fn, file_format, *args, **kwargs)
parsed_data = parse_heade... | python | def get_parsed_data(fn, *args, **kwargs):
"""All above functions as a single function
:param str fn: file name
:return list parsed_data: structured metadata
"""
file_format = detect_format(fn, *args, **kwargs)
data = get_header(fn, file_format, *args, **kwargs)
parsed_data = parse_heade... | [
"def",
"get_parsed_data",
"(",
"fn",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"file_format",
"=",
"detect_format",
"(",
"fn",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"data",
"=",
"get_header",
"(",
"fn",
",",
"file_format",
",",
... | All above functions as a single function
:param str fn: file name
:return list parsed_data: structured metadata | [
"All",
"above",
"functions",
"as",
"a",
"single",
"function",
":",
"param",
"str",
"fn",
":",
"file",
"name",
":",
"return",
"list",
"parsed_data",
":",
"structured",
"metadata"
] | train | https://github.com/emdb-empiar/ahds/blob/6a752f6806d4f62155cd2e1194de8aabe7195e0f/ahds/grammar.py#L307-L316 |
titusz/epubcheck | src/epubcheck/cli.py | create_parser | def create_parser():
"""Creat a commandline parser for epubcheck
:return Argumentparser:
"""
parser = ArgumentParser(
prog='epubcheck',
description="EpubCheck v%s - Validate your ebooks" % __version__
)
# Arguments
parser.add_argument(
'path',
nargs='?',
... | python | def create_parser():
"""Creat a commandline parser for epubcheck
:return Argumentparser:
"""
parser = ArgumentParser(
prog='epubcheck',
description="EpubCheck v%s - Validate your ebooks" % __version__
)
# Arguments
parser.add_argument(
'path',
nargs='?',
... | [
"def",
"create_parser",
"(",
")",
":",
"parser",
"=",
"ArgumentParser",
"(",
"prog",
"=",
"'epubcheck'",
",",
"description",
"=",
"\"EpubCheck v%s - Validate your ebooks\"",
"%",
"__version__",
")",
"# Arguments",
"parser",
".",
"add_argument",
"(",
"'path'",
",",
... | Creat a commandline parser for epubcheck
:return Argumentparser: | [
"Creat",
"a",
"commandline",
"parser",
"for",
"epubcheck"
] | train | https://github.com/titusz/epubcheck/blob/7adde81543d3ae7385ab7062adb76e1414d49c2e/src/epubcheck/cli.py#L22-L61 |
titusz/epubcheck | src/epubcheck/cli.py | main | def main(argv=None):
"""Command line app main function.
:param list | None argv: Overrides command options (for libuse or testing)
"""
parser = create_parser()
args = parser.parse_args() if argv is None else parser.parse_args(argv)
if not os.path.exists(args.path):
sys.exit(0)
al... | python | def main(argv=None):
"""Command line app main function.
:param list | None argv: Overrides command options (for libuse or testing)
"""
parser = create_parser()
args = parser.parse_args() if argv is None else parser.parse_args(argv)
if not os.path.exists(args.path):
sys.exit(0)
al... | [
"def",
"main",
"(",
"argv",
"=",
"None",
")",
":",
"parser",
"=",
"create_parser",
"(",
")",
"args",
"=",
"parser",
".",
"parse_args",
"(",
")",
"if",
"argv",
"is",
"None",
"else",
"parser",
".",
"parse_args",
"(",
"argv",
")",
"if",
"not",
"os",
"... | Command line app main function.
:param list | None argv: Overrides command options (for libuse or testing) | [
"Command",
"line",
"app",
"main",
"function",
"."
] | train | https://github.com/titusz/epubcheck/blob/7adde81543d3ae7385ab7062adb76e1414d49c2e/src/epubcheck/cli.py#L64-L109 |
CalebBell/fpi | fpi/geometry.py | A_cylinder | def A_cylinder(D, L):
r'''Returns the surface area of a cylinder.
.. math::
A = \pi D L + 2\cdot \frac{\pi D^2}{4}
Parameters
----------
D : float
Diameter of the cylinder, [m]
L : float
Length of the cylinder, [m]
Returns
-------
A : float
Surface ... | python | def A_cylinder(D, L):
r'''Returns the surface area of a cylinder.
.. math::
A = \pi D L + 2\cdot \frac{\pi D^2}{4}
Parameters
----------
D : float
Diameter of the cylinder, [m]
L : float
Length of the cylinder, [m]
Returns
-------
A : float
Surface ... | [
"def",
"A_cylinder",
"(",
"D",
",",
"L",
")",
":",
"cap",
"=",
"pi",
"*",
"D",
"**",
"2",
"/",
"4",
"*",
"2",
"side",
"=",
"pi",
"*",
"D",
"*",
"L",
"A",
"=",
"cap",
"+",
"side",
"return",
"A"
] | r'''Returns the surface area of a cylinder.
.. math::
A = \pi D L + 2\cdot \frac{\pi D^2}{4}
Parameters
----------
D : float
Diameter of the cylinder, [m]
L : float
Length of the cylinder, [m]
Returns
-------
A : float
Surface area [m]
Examples
... | [
"r",
"Returns",
"the",
"surface",
"area",
"of",
"a",
"cylinder",
"."
] | train | https://github.com/CalebBell/fpi/blob/6e6da3b9d0c17e10cc0886c97bc1bb8aeba2cca5/fpi/geometry.py#L115-L141 |
CalebBell/fpi | fpi/geometry.py | V_hollow_cylinder | def V_hollow_cylinder(Di, Do, L):
r'''Returns the volume of a hollow cylinder.
.. math::
V = \frac{\pi D_o^2}{4}L - L\frac{\pi D_i^2}{4}
Parameters
----------
Di : float
Diameter of the hollow in the cylinder, [m]
Do : float
Diameter of the exterior of the cylinder, [m]... | python | def V_hollow_cylinder(Di, Do, L):
r'''Returns the volume of a hollow cylinder.
.. math::
V = \frac{\pi D_o^2}{4}L - L\frac{\pi D_i^2}{4}
Parameters
----------
Di : float
Diameter of the hollow in the cylinder, [m]
Do : float
Diameter of the exterior of the cylinder, [m]... | [
"def",
"V_hollow_cylinder",
"(",
"Di",
",",
"Do",
",",
"L",
")",
":",
"V",
"=",
"pi",
"*",
"Do",
"**",
"2",
"/",
"4",
"*",
"L",
"-",
"pi",
"*",
"Di",
"**",
"2",
"/",
"4",
"*",
"L",
"return",
"V"
] | r'''Returns the volume of a hollow cylinder.
.. math::
V = \frac{\pi D_o^2}{4}L - L\frac{\pi D_i^2}{4}
Parameters
----------
Di : float
Diameter of the hollow in the cylinder, [m]
Do : float
Diameter of the exterior of the cylinder, [m]
L : float
Length of the c... | [
"r",
"Returns",
"the",
"volume",
"of",
"a",
"hollow",
"cylinder",
"."
] | train | https://github.com/CalebBell/fpi/blob/6e6da3b9d0c17e10cc0886c97bc1bb8aeba2cca5/fpi/geometry.py#L205-L231 |
CalebBell/fpi | fpi/geometry.py | V_multiple_hole_cylinder | def V_multiple_hole_cylinder(Do, L, holes):
r'''Returns the solid volume of a cylinder with multiple cylindrical holes.
Calculation will naively return a negative value or other impossible
result if the number of cylinders added is physically impossible.
.. math::
V = \frac{\pi D_o^2}{4}L - L\f... | python | def V_multiple_hole_cylinder(Do, L, holes):
r'''Returns the solid volume of a cylinder with multiple cylindrical holes.
Calculation will naively return a negative value or other impossible
result if the number of cylinders added is physically impossible.
.. math::
V = \frac{\pi D_o^2}{4}L - L\f... | [
"def",
"V_multiple_hole_cylinder",
"(",
"Do",
",",
"L",
",",
"holes",
")",
":",
"V",
"=",
"pi",
"*",
"Do",
"**",
"2",
"/",
"4",
"*",
"L",
"for",
"Di",
",",
"n",
"in",
"holes",
":",
"V",
"-=",
"pi",
"*",
"Di",
"**",
"2",
"/",
"4",
"*",
"L",
... | r'''Returns the solid volume of a cylinder with multiple cylindrical holes.
Calculation will naively return a negative value or other impossible
result if the number of cylinders added is physically impossible.
.. math::
V = \frac{\pi D_o^2}{4}L - L\frac{\pi D_i^2}{4}
Parameters
----------... | [
"r",
"Returns",
"the",
"solid",
"volume",
"of",
"a",
"cylinder",
"with",
"multiple",
"cylindrical",
"holes",
".",
"Calculation",
"will",
"naively",
"return",
"a",
"negative",
"value",
"or",
"other",
"impossible",
"result",
"if",
"the",
"number",
"of",
"cylinde... | train | https://github.com/CalebBell/fpi/blob/6e6da3b9d0c17e10cc0886c97bc1bb8aeba2cca5/fpi/geometry.py#L275-L306 |
jameserrico/python-gamesdb | gamesdb/urlutils/urlencode_no_plus.py | urlencode_no_plus | def urlencode_no_plus(query, doseq=0):
"""Encode a sequence of two-element tuples or dictionary into a URL query string.
If any values in the query arg are sequences and doseq is true, each
sequence element is converted to a separate parameter.
If the query arg is a sequence of two-element tuples, the... | python | def urlencode_no_plus(query, doseq=0):
"""Encode a sequence of two-element tuples or dictionary into a URL query string.
If any values in the query arg are sequences and doseq is true, each
sequence element is converted to a separate parameter.
If the query arg is a sequence of two-element tuples, the... | [
"def",
"urlencode_no_plus",
"(",
"query",
",",
"doseq",
"=",
"0",
")",
":",
"if",
"hasattr",
"(",
"query",
",",
"\"items\"",
")",
":",
"# mapping objects",
"query",
"=",
"query",
".",
"items",
"(",
")",
"else",
":",
"# it's a bother at times that strings and s... | Encode a sequence of two-element tuples or dictionary into a URL query string.
If any values in the query arg are sequences and doseq is true, each
sequence element is converted to a separate parameter.
If the query arg is a sequence of two-element tuples, the order of the
parameters in the output wil... | [
"Encode",
"a",
"sequence",
"of",
"two",
"-",
"element",
"tuples",
"or",
"dictionary",
"into",
"a",
"URL",
"query",
"string",
"."
] | train | https://github.com/jameserrico/python-gamesdb/blob/163da9a1c64918fd644e349148babb66fd44607d/gamesdb/urlutils/urlencode_no_plus.py#L20-L83 |
ilblackdragon/django-misc | misc/views.py | handler500 | def handler500(request, template_name='500.html'):
"""
500 error handler.
Templates: `500.html`
Context:
MEDIA_URL
Path of static media (e.g. "media.example.org")
STATIC_URL
"""
t = loader.get_template(template_name) # You need to create a 500... | python | def handler500(request, template_name='500.html'):
"""
500 error handler.
Templates: `500.html`
Context:
MEDIA_URL
Path of static media (e.g. "media.example.org")
STATIC_URL
"""
t = loader.get_template(template_name) # You need to create a 500... | [
"def",
"handler500",
"(",
"request",
",",
"template_name",
"=",
"'500.html'",
")",
":",
"t",
"=",
"loader",
".",
"get_template",
"(",
"template_name",
")",
"# You need to create a 500.html template.",
"return",
"http",
".",
"HttpResponseServerError",
"(",
"t",
".",
... | 500 error handler.
Templates: `500.html`
Context:
MEDIA_URL
Path of static media (e.g. "media.example.org")
STATIC_URL | [
"500",
"error",
"handler",
"."
] | train | https://github.com/ilblackdragon/django-misc/blob/0accd2dc97de656a1c9e275be81e817f78a2eb9d/misc/views.py#L22-L36 |
ilblackdragon/django-misc | misc/views.py | handler404 | def handler404(request, template_name='404.html'):
"""
404 error handler.
Templates: `404.html`
Context:
MEDIA_URL
Path of static media (e.g. "media.example.org")
STATIC_URL
"""
t = loader.get_template(template_name) # You need to create a 404... | python | def handler404(request, template_name='404.html'):
"""
404 error handler.
Templates: `404.html`
Context:
MEDIA_URL
Path of static media (e.g. "media.example.org")
STATIC_URL
"""
t = loader.get_template(template_name) # You need to create a 404... | [
"def",
"handler404",
"(",
"request",
",",
"template_name",
"=",
"'404.html'",
")",
":",
"t",
"=",
"loader",
".",
"get_template",
"(",
"template_name",
")",
"# You need to create a 404.html template.",
"return",
"http",
".",
"HttpResponseNotFound",
"(",
"t",
".",
"... | 404 error handler.
Templates: `404.html`
Context:
MEDIA_URL
Path of static media (e.g. "media.example.org")
STATIC_URL | [
"404",
"error",
"handler",
"."
] | train | https://github.com/ilblackdragon/django-misc/blob/0accd2dc97de656a1c9e275be81e817f78a2eb9d/misc/views.py#L38-L52 |
yougov/excuses | excuses/__init__.py | RandomExcuseGenerator.pmxbot_excuse | def pmxbot_excuse(self, rest):
"Provide a convenient excuse"
args = rest.split(' ')[:2]
parser = argparse.ArgumentParser()
parser.add_argument('word', nargs="?")
parser.add_argument('index', type=int, nargs="?")
args = parser.parse_args(args)
if not args.word:
... | python | def pmxbot_excuse(self, rest):
"Provide a convenient excuse"
args = rest.split(' ')[:2]
parser = argparse.ArgumentParser()
parser.add_argument('word', nargs="?")
parser.add_argument('index', type=int, nargs="?")
args = parser.parse_args(args)
if not args.word:
... | [
"def",
"pmxbot_excuse",
"(",
"self",
",",
"rest",
")",
":",
"args",
"=",
"rest",
".",
"split",
"(",
"' '",
")",
"[",
":",
"2",
"]",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
")",
"parser",
".",
"add_argument",
"(",
"'word'",
",",
"nargs"... | Provide a convenient excuse | [
"Provide",
"a",
"convenient",
"excuse"
] | train | https://github.com/yougov/excuses/blob/d235529ee6bf96e5250511ca799f364a4fd52bfc/excuses/__init__.py#L35-L44 |
jor-/util | util/io/netcdf.py | load_with_scipy | def load_with_scipy(file, data_name):
import scipy.io
"""
Loads data from a netcdf file.
Parameters
----------
file : string or file-like
The name of the netcdf file to open.
data_name : string
The name of the data to extract from the netcdf file.
Returns
-------
... | python | def load_with_scipy(file, data_name):
import scipy.io
"""
Loads data from a netcdf file.
Parameters
----------
file : string or file-like
The name of the netcdf file to open.
data_name : string
The name of the data to extract from the netcdf file.
Returns
-------
... | [
"def",
"load_with_scipy",
"(",
"file",
",",
"data_name",
")",
":",
"import",
"scipy",
".",
"io",
"logger",
".",
"debug",
"(",
"'Loading data {} of netcdf file {} with scipy.io.'",
".",
"format",
"(",
"data_name",
",",
"file",
")",
")",
"f",
"=",
"scipy",
".",
... | Loads data from a netcdf file.
Parameters
----------
file : string or file-like
The name of the netcdf file to open.
data_name : string
The name of the data to extract from the netcdf file.
Returns
-------
data : ndarray
The desired data from the netcdf file as ndar... | [
"Loads",
"data",
"from",
"a",
"netcdf",
"file",
"."
] | train | https://github.com/jor-/util/blob/0eb0be84430f88885f4d48335596ca8881f85587/util/io/netcdf.py#L9-L36 |
jor-/util | util/math/sparse/decompose/with_cholmod.py | cholesky | def cholesky(A, ordering_method='default', return_type=RETURN_P_L, use_long=False):
'''
P A P' = L L'
'''
logger.debug('Calculating cholesky decomposition for matrix {!r} with ordering method {}, return type {} and use_long {}.'.format(A, ordering_method, return_type, use_long))
## check input
... | python | def cholesky(A, ordering_method='default', return_type=RETURN_P_L, use_long=False):
'''
P A P' = L L'
'''
logger.debug('Calculating cholesky decomposition for matrix {!r} with ordering method {}, return type {} and use_long {}.'.format(A, ordering_method, return_type, use_long))
## check input
... | [
"def",
"cholesky",
"(",
"A",
",",
"ordering_method",
"=",
"'default'",
",",
"return_type",
"=",
"RETURN_P_L",
",",
"use_long",
"=",
"False",
")",
":",
"logger",
".",
"debug",
"(",
"'Calculating cholesky decomposition for matrix {!r} with ordering method {}, return type {}... | P A P' = L L' | [
"P",
"A",
"P",
"=",
"L",
"L"
] | train | https://github.com/jor-/util/blob/0eb0be84430f88885f4d48335596ca8881f85587/util/math/sparse/decompose/with_cholmod.py#L189-L252 |
marioidival/pyramid_mongoengine | pyramid_mongoengine/__init__.py | _connect_database | def _connect_database(config):
"""Create simple connection with Mongodb
config comes with settings from .ini file.
"""
settings = config.registry.settings
mongo_uri = "mongodb://localhost:27017"
mongodb_name = "test"
if settings.get("mongo_url"):
mongo_uri = settings["mongo_url"]
... | python | def _connect_database(config):
"""Create simple connection with Mongodb
config comes with settings from .ini file.
"""
settings = config.registry.settings
mongo_uri = "mongodb://localhost:27017"
mongodb_name = "test"
if settings.get("mongo_url"):
mongo_uri = settings["mongo_url"]
... | [
"def",
"_connect_database",
"(",
"config",
")",
":",
"settings",
"=",
"config",
".",
"registry",
".",
"settings",
"mongo_uri",
"=",
"\"mongodb://localhost:27017\"",
"mongodb_name",
"=",
"\"test\"",
"if",
"settings",
".",
"get",
"(",
"\"mongo_url\"",
")",
":",
"m... | Create simple connection with Mongodb
config comes with settings from .ini file. | [
"Create",
"simple",
"connection",
"with",
"Mongodb"
] | train | https://github.com/marioidival/pyramid_mongoengine/blob/3fcf45714cb3fc114ee613fea0f508a0119077d1/pyramid_mongoengine/__init__.py#L44-L60 |
bitlabstudio/django-dynamic-content | dynamic_content/templatetags/dynamic_content_tags.py | get_content | def get_content(identifier, default=None):
'''
Returns the DynamicContent instance for the given identifier.
If no object is found, a new one will be created.
:param identifier: String representing the unique identifier of a
``DynamicContent`` object.
:param default: String that should be us... | python | def get_content(identifier, default=None):
'''
Returns the DynamicContent instance for the given identifier.
If no object is found, a new one will be created.
:param identifier: String representing the unique identifier of a
``DynamicContent`` object.
:param default: String that should be us... | [
"def",
"get_content",
"(",
"identifier",
",",
"default",
"=",
"None",
")",
":",
"if",
"default",
"is",
"None",
":",
"default",
"=",
"''",
"try",
":",
"return",
"models",
".",
"DynamicContent",
".",
"objects",
".",
"get",
"(",
"identifier",
"=",
"identifi... | Returns the DynamicContent instance for the given identifier.
If no object is found, a new one will be created.
:param identifier: String representing the unique identifier of a
``DynamicContent`` object.
:param default: String that should be used in case that no matching
``DynamicContent`` ob... | [
"Returns",
"the",
"DynamicContent",
"instance",
"for",
"the",
"given",
"identifier",
"."
] | train | https://github.com/bitlabstudio/django-dynamic-content/blob/65fc557872c1a3d789fa6cc345532ad6f1e4bba7/dynamic_content/templatetags/dynamic_content_tags.py#L11-L30 |
gasparka/pyhacores | under_construction/fir_alt/model_atom.py | rescale_taps | def rescale_taps(taps):
"""
Rescale taps in that way that their sum equals 1
"""
taps = np.array(taps)
cs = sum(taps)
# fixme: not sure here, abs seems right as it avoids overflows in core,
# then again it reduces the fir gain
# cs = sum(abs(taps))
for (i, x) in enumerate(taps):
... | python | def rescale_taps(taps):
"""
Rescale taps in that way that their sum equals 1
"""
taps = np.array(taps)
cs = sum(taps)
# fixme: not sure here, abs seems right as it avoids overflows in core,
# then again it reduces the fir gain
# cs = sum(abs(taps))
for (i, x) in enumerate(taps):
... | [
"def",
"rescale_taps",
"(",
"taps",
")",
":",
"taps",
"=",
"np",
".",
"array",
"(",
"taps",
")",
"cs",
"=",
"sum",
"(",
"taps",
")",
"# fixme: not sure here, abs seems right as it avoids overflows in core,",
"# then again it reduces the fir gain",
"# cs = sum(abs(taps))",... | Rescale taps in that way that their sum equals 1 | [
"Rescale",
"taps",
"in",
"that",
"way",
"that",
"their",
"sum",
"equals",
"1"
] | train | https://github.com/gasparka/pyhacores/blob/16c186fbbf90385f2ba3498395123e79b6fcf340/under_construction/fir_alt/model_atom.py#L8-L20 |
halfak/python-jsonable | jsonable/functions.py | to_json | def to_json(value):
"""
Converts a value to a jsonable type.
"""
if type(value) in JSON_TYPES:
return value
elif hasattr(value, "to_json"):
return value.to_json()
elif isinstance(value, list) or isinstance(value, set) or \
isinstance(value, deque) or isinstance(value,... | python | def to_json(value):
"""
Converts a value to a jsonable type.
"""
if type(value) in JSON_TYPES:
return value
elif hasattr(value, "to_json"):
return value.to_json()
elif isinstance(value, list) or isinstance(value, set) or \
isinstance(value, deque) or isinstance(value,... | [
"def",
"to_json",
"(",
"value",
")",
":",
"if",
"type",
"(",
"value",
")",
"in",
"JSON_TYPES",
":",
"return",
"value",
"elif",
"hasattr",
"(",
"value",
",",
"\"to_json\"",
")",
":",
"return",
"value",
".",
"to_json",
"(",
")",
"elif",
"isinstance",
"("... | Converts a value to a jsonable type. | [
"Converts",
"a",
"value",
"to",
"a",
"jsonable",
"type",
"."
] | train | https://github.com/halfak/python-jsonable/blob/70a53aedaca84d078228b3564fdd8f60a586d43f/jsonable/functions.py#L6-L20 |
jor-/util | util/io/filelock/unix_exclusive.py | FileLock.lock_pid | def lock_pid(self):
"""
Get the pid of the lock.
"""
if os.path.exists(self.lock_filename):
return int(open(self.lock_filename).read())
else:
return None | python | def lock_pid(self):
"""
Get the pid of the lock.
"""
if os.path.exists(self.lock_filename):
return int(open(self.lock_filename).read())
else:
return None | [
"def",
"lock_pid",
"(",
"self",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"lock_filename",
")",
":",
"return",
"int",
"(",
"open",
"(",
"self",
".",
"lock_filename",
")",
".",
"read",
"(",
")",
")",
"else",
":",
"return",
... | Get the pid of the lock. | [
"Get",
"the",
"pid",
"of",
"the",
"lock",
"."
] | train | https://github.com/jor-/util/blob/0eb0be84430f88885f4d48335596ca8881f85587/util/io/filelock/unix_exclusive.py#L32-L40 |
jor-/util | util/io/filelock/unix_exclusive.py | FileLock.is_locked_by_me | def is_locked_by_me(self):
"""
See if the lock exists and is belongs to this process.
"""
## get pid of lock
lock_pid = self.lock_pid()
## not locked
if lock_pid is None:
logger.debug('Lock {} is not aquired.'.format(self.lock_filename))
... | python | def is_locked_by_me(self):
"""
See if the lock exists and is belongs to this process.
"""
## get pid of lock
lock_pid = self.lock_pid()
## not locked
if lock_pid is None:
logger.debug('Lock {} is not aquired.'.format(self.lock_filename))
... | [
"def",
"is_locked_by_me",
"(",
"self",
")",
":",
"## get pid of lock",
"lock_pid",
"=",
"self",
".",
"lock_pid",
"(",
")",
"## not locked",
"if",
"lock_pid",
"is",
"None",
":",
"logger",
".",
"debug",
"(",
"'Lock {} is not aquired.'",
".",
"format",
"(",
"self... | See if the lock exists and is belongs to this process. | [
"See",
"if",
"the",
"lock",
"exists",
"and",
"is",
"belongs",
"to",
"this",
"process",
"."
] | train | https://github.com/jor-/util/blob/0eb0be84430f88885f4d48335596ca8881f85587/util/io/filelock/unix_exclusive.py#L43-L86 |
jor-/util | util/io/filelock/unix_exclusive.py | FileLock.acquire_try_once | def acquire_try_once(self):
"""
Try to aquire the lock once.
"""
if self.is_locked_by_me():
return True
else:
try:
self.fd = os.open(self.lock_filename, os.O_CREAT | os.O_RDWR | os.O_EXCL)
except FileExistsError:
... | python | def acquire_try_once(self):
"""
Try to aquire the lock once.
"""
if self.is_locked_by_me():
return True
else:
try:
self.fd = os.open(self.lock_filename, os.O_CREAT | os.O_RDWR | os.O_EXCL)
except FileExistsError:
... | [
"def",
"acquire_try_once",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_locked_by_me",
"(",
")",
":",
"return",
"True",
"else",
":",
"try",
":",
"self",
".",
"fd",
"=",
"os",
".",
"open",
"(",
"self",
".",
"lock_filename",
",",
"os",
".",
"O_CREAT",... | Try to aquire the lock once. | [
"Try",
"to",
"aquire",
"the",
"lock",
"once",
"."
] | train | https://github.com/jor-/util/blob/0eb0be84430f88885f4d48335596ca8881f85587/util/io/filelock/unix_exclusive.py#L89-L105 |
jor-/util | util/io/filelock/unix_exclusive.py | FileLock.acquire | def acquire(self):
"""
Try to aquire the lock.
"""
if self.timeout is not None:
sleep_intervals = int(self.timeout / self.sleep_time)
else:
sleep_intervals = float('inf')
while not self.acquire_try_once() and sleep_intervals > 0:
... | python | def acquire(self):
"""
Try to aquire the lock.
"""
if self.timeout is not None:
sleep_intervals = int(self.timeout / self.sleep_time)
else:
sleep_intervals = float('inf')
while not self.acquire_try_once() and sleep_intervals > 0:
... | [
"def",
"acquire",
"(",
"self",
")",
":",
"if",
"self",
".",
"timeout",
"is",
"not",
"None",
":",
"sleep_intervals",
"=",
"int",
"(",
"self",
".",
"timeout",
"/",
"self",
".",
"sleep_time",
")",
"else",
":",
"sleep_intervals",
"=",
"float",
"(",
"'inf'"... | Try to aquire the lock. | [
"Try",
"to",
"aquire",
"the",
"lock",
"."
] | train | https://github.com/jor-/util/blob/0eb0be84430f88885f4d48335596ca8881f85587/util/io/filelock/unix_exclusive.py#L108-L123 |
jor-/util | util/io/filelock/unix_exclusive.py | FileLock.release | def release(self):
"""
Release the lock.
"""
if self.is_locked_by_me():
os.remove(self.lock_filename)
logger.debug('The lock {} is released by me (pid: {}).'.format(self.lock_filename, self.pid))
if self.fd:
os.close(self.fd)
... | python | def release(self):
"""
Release the lock.
"""
if self.is_locked_by_me():
os.remove(self.lock_filename)
logger.debug('The lock {} is released by me (pid: {}).'.format(self.lock_filename, self.pid))
if self.fd:
os.close(self.fd)
... | [
"def",
"release",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_locked_by_me",
"(",
")",
":",
"os",
".",
"remove",
"(",
"self",
".",
"lock_filename",
")",
"logger",
".",
"debug",
"(",
"'The lock {} is released by me (pid: {}).'",
".",
"format",
"(",
"self",
... | Release the lock. | [
"Release",
"the",
"lock",
"."
] | train | https://github.com/jor-/util/blob/0eb0be84430f88885f4d48335596ca8881f85587/util/io/filelock/unix_exclusive.py#L126-L136 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | main | def main(argString=None):
"""The main function.
:param argString: the options.
:type argString: list
These are the steps of this module:
1. Prints the options.
2. Finds the overlapping markers between the three reference panels and
the source panel (:py:func:`findOverlappingSNPsWit... | python | def main(argString=None):
"""The main function.
:param argString: the options.
:type argString: list
These are the steps of this module:
1. Prints the options.
2. Finds the overlapping markers between the three reference panels and
the source panel (:py:func:`findOverlappingSNPsWit... | [
"def",
"main",
"(",
"argString",
"=",
"None",
")",
":",
"# Getting and checking the options",
"args",
"=",
"parseArgs",
"(",
"argString",
")",
"checkArgs",
"(",
"args",
")",
"logger",
".",
"info",
"(",
"\"Options used:\"",
")",
"for",
"key",
",",
"value",
"i... | The main function.
:param argString: the options.
:type argString: list
These are the steps of this module:
1. Prints the options.
2. Finds the overlapping markers between the three reference panels and
the source panel (:py:func:`findOverlappingSNPsWithReference`).
3. Extract the... | [
"The",
"main",
"function",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L43-L276 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | create_scree_plot | def create_scree_plot(in_filename, out_filename, plot_title):
"""Creates a scree plot using smartpca results.
:param in_filename: the name of the input file.
:param out_filename: the name of the output file.
:param plot_title: the title of the scree plot.
:type in_filename: str
:type out_filen... | python | def create_scree_plot(in_filename, out_filename, plot_title):
"""Creates a scree plot using smartpca results.
:param in_filename: the name of the input file.
:param out_filename: the name of the output file.
:param plot_title: the title of the scree plot.
:type in_filename: str
:type out_filen... | [
"def",
"create_scree_plot",
"(",
"in_filename",
",",
"out_filename",
",",
"plot_title",
")",
":",
"# Constructing the arguments",
"scree_plot_args",
"=",
"(",
"\"--evec\"",
",",
"in_filename",
",",
"\"--out\"",
",",
"out_filename",
",",
"\"--scree-plot-title\"",
",",
... | Creates a scree plot using smartpca results.
:param in_filename: the name of the input file.
:param out_filename: the name of the output file.
:param plot_title: the title of the scree plot.
:type in_filename: str
:type out_filename: str
:type plot_title: str | [
"Creates",
"a",
"scree",
"plot",
"using",
"smartpca",
"results",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L279-L300 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | compute_eigenvalues | def compute_eigenvalues(in_prefix, out_prefix):
"""Computes the Eigenvalues using smartpca from Eigensoft.
:param in_prefix: the prefix of the input files.
:param out_prefix: the prefix of the output files.
:type in_prefix: str
:type out_prefix: str
Creates a "parameter file" used by smartpca... | python | def compute_eigenvalues(in_prefix, out_prefix):
"""Computes the Eigenvalues using smartpca from Eigensoft.
:param in_prefix: the prefix of the input files.
:param out_prefix: the prefix of the output files.
:type in_prefix: str
:type out_prefix: str
Creates a "parameter file" used by smartpca... | [
"def",
"compute_eigenvalues",
"(",
"in_prefix",
",",
"out_prefix",
")",
":",
"# First, we create the parameter file",
"with",
"open",
"(",
"out_prefix",
"+",
"\".parameters\"",
",",
"\"w\"",
")",
"as",
"o_file",
":",
"print",
">>",
"o_file",
",",
"\"genotypename: ... | Computes the Eigenvalues using smartpca from Eigensoft.
:param in_prefix: the prefix of the input files.
:param out_prefix: the prefix of the output files.
:type in_prefix: str
:type out_prefix: str
Creates a "parameter file" used by smartpca and runs it. | [
"Computes",
"the",
"Eigenvalues",
"using",
"smartpca",
"from",
"Eigensoft",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L303-L327 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | find_the_outliers | def find_the_outliers(mds_file_name, population_file_name, ref_pop_name,
multiplier, out_prefix):
"""Finds the outliers of a given population.
:param mds_file_name: the name of the ``mds`` file.
:param population_file_name: the name of the population file.
:param ref_pop_name: the... | python | def find_the_outliers(mds_file_name, population_file_name, ref_pop_name,
multiplier, out_prefix):
"""Finds the outliers of a given population.
:param mds_file_name: the name of the ``mds`` file.
:param population_file_name: the name of the population file.
:param ref_pop_name: the... | [
"def",
"find_the_outliers",
"(",
"mds_file_name",
",",
"population_file_name",
",",
"ref_pop_name",
",",
"multiplier",
",",
"out_prefix",
")",
":",
"options",
"=",
"[",
"\"--mds\"",
",",
"mds_file_name",
",",
"\"--population-file\"",
",",
"population_file_name",
",",
... | Finds the outliers of a given population.
:param mds_file_name: the name of the ``mds`` file.
:param population_file_name: the name of the population file.
:param ref_pop_name: the name of the reference population for which to find
outliers from.
:param multiplier: the multipli... | [
"Finds",
"the",
"outliers",
"of",
"a",
"given",
"population",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L330-L361 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | createPopulationFile | def createPopulationFile(inputFiles, labels, outputFileName):
"""Creates a population file.
:param inputFiles: the list of input files.
:param labels: the list of labels (corresponding to the input files).
:param outputFileName: the name of the output file.
:type inputFiles: list
:type labels:... | python | def createPopulationFile(inputFiles, labels, outputFileName):
"""Creates a population file.
:param inputFiles: the list of input files.
:param labels: the list of labels (corresponding to the input files).
:param outputFileName: the name of the output file.
:type inputFiles: list
:type labels:... | [
"def",
"createPopulationFile",
"(",
"inputFiles",
",",
"labels",
",",
"outputFileName",
")",
":",
"outputFile",
"=",
"None",
"try",
":",
"outputFile",
"=",
"open",
"(",
"outputFileName",
",",
"'w'",
")",
"except",
"IOError",
":",
"msg",
"=",
"\"%(outputFileNam... | Creates a population file.
:param inputFiles: the list of input files.
:param labels: the list of labels (corresponding to the input files).
:param outputFileName: the name of the output file.
:type inputFiles: list
:type labels: list
:type outputFileName: str
The ``inputFiles`` is in rea... | [
"Creates",
"a",
"population",
"file",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L364-L412 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | plotMDS | def plotMDS(inputFileName, outPrefix, populationFileName, options):
"""Plots the MDS value.
:param inputFileName: the name of the ``mds`` file.
:param outPrefix: the prefix of the output files.
:param populationFileName: the name of the population file.
:param options: the options
:type inputF... | python | def plotMDS(inputFileName, outPrefix, populationFileName, options):
"""Plots the MDS value.
:param inputFileName: the name of the ``mds`` file.
:param outPrefix: the prefix of the output files.
:param populationFileName: the name of the population file.
:param options: the options
:type inputF... | [
"def",
"plotMDS",
"(",
"inputFileName",
",",
"outPrefix",
",",
"populationFileName",
",",
"options",
")",
":",
"# The options",
"plotMDS_options",
"=",
"Dummy",
"(",
")",
"plotMDS_options",
".",
"file",
"=",
"inputFileName",
"plotMDS_options",
".",
"out",
"=",
"... | Plots the MDS value.
:param inputFileName: the name of the ``mds`` file.
:param outPrefix: the prefix of the output files.
:param populationFileName: the name of the population file.
:param options: the options
:type inputFileName: str
:type outPrefix: str
:type populationFileName: str
... | [
"Plots",
"the",
"MDS",
"value",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L415-L469 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | createMDSFile | def createMDSFile(nb_components, inPrefix, outPrefix, genomeFileName):
"""Creates a MDS file using Plink.
:param nb_components: the number of component.
:param inPrefix: the prefix of the input file.
:param outPrefix: the prefix of the output file.
:param genomeFileName: the name of the ``genome`` ... | python | def createMDSFile(nb_components, inPrefix, outPrefix, genomeFileName):
"""Creates a MDS file using Plink.
:param nb_components: the number of component.
:param inPrefix: the prefix of the input file.
:param outPrefix: the prefix of the output file.
:param genomeFileName: the name of the ``genome`` ... | [
"def",
"createMDSFile",
"(",
"nb_components",
",",
"inPrefix",
",",
"outPrefix",
",",
"genomeFileName",
")",
":",
"plinkCommand",
"=",
"[",
"\"plink\"",
",",
"\"--noweb\"",
",",
"\"--bfile\"",
",",
"inPrefix",
",",
"\"--read-genome\"",
",",
"genomeFileName",
",",
... | Creates a MDS file using Plink.
:param nb_components: the number of component.
:param inPrefix: the prefix of the input file.
:param outPrefix: the prefix of the output file.
:param genomeFileName: the name of the ``genome`` file.
:type nb_components: int
:type inPrefix: str
:type outPrefi... | [
"Creates",
"a",
"MDS",
"file",
"using",
"Plink",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L472-L493 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | runRelatedness | def runRelatedness(inputPrefix, outPrefix, options):
"""Run the relatedness step of the data clean up.
:param inputPrefix: the prefix of the input file.
:param outPrefix: the prefix of the output file.
:param options: the options
:type inputPrefix: str
:type outPrefix: str
:type options: a... | python | def runRelatedness(inputPrefix, outPrefix, options):
"""Run the relatedness step of the data clean up.
:param inputPrefix: the prefix of the input file.
:param outPrefix: the prefix of the output file.
:param options: the options
:type inputPrefix: str
:type outPrefix: str
:type options: a... | [
"def",
"runRelatedness",
"(",
"inputPrefix",
",",
"outPrefix",
",",
"options",
")",
":",
"# The options",
"new_options",
"=",
"[",
"\"--bfile\"",
",",
"inputPrefix",
",",
"\"--genome-only\"",
",",
"\"--min-nb-snp\"",
",",
"str",
"(",
"options",
".",
"min_nb_snp",
... | Run the relatedness step of the data clean up.
:param inputPrefix: the prefix of the input file.
:param outPrefix: the prefix of the output file.
:param options: the options
:type inputPrefix: str
:type outPrefix: str
:type options: argparse.Namespace
:returns: the prefix of the new bfile... | [
"Run",
"the",
"relatedness",
"step",
"of",
"the",
"data",
"clean",
"up",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L496-L541 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | allFileExists | def allFileExists(fileList):
"""Check that all file exists.
:param fileList: the list of file to check.
:type fileList: list
Check if all the files in ``fileList`` exists.
"""
allExists = True
for fileName in fileList:
allExists = allExists and os.path.isfile(fileName)
return... | python | def allFileExists(fileList):
"""Check that all file exists.
:param fileList: the list of file to check.
:type fileList: list
Check if all the files in ``fileList`` exists.
"""
allExists = True
for fileName in fileList:
allExists = allExists and os.path.isfile(fileName)
return... | [
"def",
"allFileExists",
"(",
"fileList",
")",
":",
"allExists",
"=",
"True",
"for",
"fileName",
"in",
"fileList",
":",
"allExists",
"=",
"allExists",
"and",
"os",
".",
"path",
".",
"isfile",
"(",
"fileName",
")",
"return",
"allExists"
] | Check that all file exists.
:param fileList: the list of file to check.
:type fileList: list
Check if all the files in ``fileList`` exists. | [
"Check",
"that",
"all",
"file",
"exists",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L544-L557 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | excludeSNPs | def excludeSNPs(inPrefix, outPrefix, exclusionFileName):
"""Exclude some SNPs using Plink.
:param inPrefix: the prefix of the input file.
:param outPrefix: the prefix of the output file.
:param exclusionFileName: the name of the file containing the markers to be
excluded.
... | python | def excludeSNPs(inPrefix, outPrefix, exclusionFileName):
"""Exclude some SNPs using Plink.
:param inPrefix: the prefix of the input file.
:param outPrefix: the prefix of the output file.
:param exclusionFileName: the name of the file containing the markers to be
excluded.
... | [
"def",
"excludeSNPs",
"(",
"inPrefix",
",",
"outPrefix",
",",
"exclusionFileName",
")",
":",
"plinkCommand",
"=",
"[",
"\"plink\"",
",",
"\"--noweb\"",
",",
"\"--bfile\"",
",",
"inPrefix",
",",
"\"--exclude\"",
",",
"exclusionFileName",
",",
"\"--make-bed\"",
",",... | Exclude some SNPs using Plink.
:param inPrefix: the prefix of the input file.
:param outPrefix: the prefix of the output file.
:param exclusionFileName: the name of the file containing the markers to be
excluded.
:type inPrefix: str
:type outPrefix: str
:type excl... | [
"Exclude",
"some",
"SNPs",
"using",
"Plink",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L580-L598 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | findFlippedSNPs | def findFlippedSNPs(frqFile1, frqFile2, outPrefix):
"""Find flipped SNPs and flip them in the data.
:param frqFile1: the name of the first frequency file.
:param frqFile2: the name of the second frequency file.
:param outPrefix: the prefix of the output files.
:type frqFile1: str
:type frqFile... | python | def findFlippedSNPs(frqFile1, frqFile2, outPrefix):
"""Find flipped SNPs and flip them in the data.
:param frqFile1: the name of the first frequency file.
:param frqFile2: the name of the second frequency file.
:param outPrefix: the prefix of the output files.
:type frqFile1: str
:type frqFile... | [
"def",
"findFlippedSNPs",
"(",
"frqFile1",
",",
"frqFile2",
",",
"outPrefix",
")",
":",
"allelesFiles",
"=",
"[",
"{",
"}",
",",
"{",
"}",
"]",
"files",
"=",
"[",
"frqFile1",
",",
"frqFile2",
"]",
"for",
"k",
",",
"fileName",
"in",
"enumerate",
"(",
... | Find flipped SNPs and flip them in the data.
:param frqFile1: the name of the first frequency file.
:param frqFile2: the name of the second frequency file.
:param outPrefix: the prefix of the output files.
:type frqFile1: str
:type frqFile2: str
:type outPrefix: str
By reading two frequen... | [
"Find",
"flipped",
"SNPs",
"and",
"flip",
"them",
"in",
"the",
"data",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L623-L726 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | combinePlinkBinaryFiles | def combinePlinkBinaryFiles(prefixes, outPrefix):
"""Combine Plink binary files.
:param prefixes: a list of the prefix of the files that need to be
combined.
:param outPrefix: the prefix of the output file (the combined file).
:type prefixes: list
:type outPrefix: str
It ... | python | def combinePlinkBinaryFiles(prefixes, outPrefix):
"""Combine Plink binary files.
:param prefixes: a list of the prefix of the files that need to be
combined.
:param outPrefix: the prefix of the output file (the combined file).
:type prefixes: list
:type outPrefix: str
It ... | [
"def",
"combinePlinkBinaryFiles",
"(",
"prefixes",
",",
"outPrefix",
")",
":",
"# The first file is the bfile, the others are the ones to merge",
"outputFile",
"=",
"None",
"try",
":",
"outputFile",
"=",
"open",
"(",
"outPrefix",
"+",
"\".files_to_merge\"",
",",
"\"w\"",
... | Combine Plink binary files.
:param prefixes: a list of the prefix of the files that need to be
combined.
:param outPrefix: the prefix of the output file (the combined file).
:type prefixes: list
:type outPrefix: str
It uses Plink to merge a list of binary files (which is a li... | [
"Combine",
"Plink",
"binary",
"files",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L748-L783 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | findOverlappingSNPsWithReference | def findOverlappingSNPsWithReference(prefix, referencePrefixes,
referencePopulations, outPrefix):
"""Find the overlapping SNPs in 4 different data sets.
:param prefix: the prefix of all the files.
:param referencePrefixes: the prefix of the reference population files.
... | python | def findOverlappingSNPsWithReference(prefix, referencePrefixes,
referencePopulations, outPrefix):
"""Find the overlapping SNPs in 4 different data sets.
:param prefix: the prefix of all the files.
:param referencePrefixes: the prefix of the reference population files.
... | [
"def",
"findOverlappingSNPsWithReference",
"(",
"prefix",
",",
"referencePrefixes",
",",
"referencePopulations",
",",
"outPrefix",
")",
":",
"# Reading the main file",
"sourceSnpToExtract",
"=",
"{",
"}",
"duplicates",
"=",
"set",
"(",
")",
"try",
":",
"with",
"open... | Find the overlapping SNPs in 4 different data sets.
:param prefix: the prefix of all the files.
:param referencePrefixes: the prefix of the reference population files.
:param referencePopulations: the name of the reference population (same
order as ``referencePrefixes``)
... | [
"Find",
"the",
"overlapping",
"SNPs",
"in",
"4",
"different",
"data",
"sets",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L786-L920 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | extractSNPs | def extractSNPs(snpToExtractFileNames, referencePrefixes, popNames, outPrefix,
runSGE, options):
"""Extract a list of SNPs using Plink.
:param snpToExtractFileNames: the name of the files which contains the
markers to extract from the original data
... | python | def extractSNPs(snpToExtractFileNames, referencePrefixes, popNames, outPrefix,
runSGE, options):
"""Extract a list of SNPs using Plink.
:param snpToExtractFileNames: the name of the files which contains the
markers to extract from the original data
... | [
"def",
"extractSNPs",
"(",
"snpToExtractFileNames",
",",
"referencePrefixes",
",",
"popNames",
",",
"outPrefix",
",",
"runSGE",
",",
"options",
")",
":",
"s",
"=",
"None",
"jobIDs",
"=",
"[",
"]",
"jobTemplates",
"=",
"[",
"]",
"if",
"runSGE",
":",
"# Add ... | Extract a list of SNPs using Plink.
:param snpToExtractFileNames: the name of the files which contains the
markers to extract from the original data
set.
:param referencePrefixes: a list containing the three reference population
... | [
"Extract",
"a",
"list",
"of",
"SNPs",
"using",
"Plink",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L923-L1019 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | runCommand | def runCommand(command):
"""Run a command.
:param command: the command to run.
:type command: list
Tries to run a command. If it fails, raise a :py:class:`ProgramError`. This
function uses the :py:mod:`subprocess` module.
.. warning::
The variable ``command`` should be a list of stri... | python | def runCommand(command):
"""Run a command.
:param command: the command to run.
:type command: list
Tries to run a command. If it fails, raise a :py:class:`ProgramError`. This
function uses the :py:mod:`subprocess` module.
.. warning::
The variable ``command`` should be a list of stri... | [
"def",
"runCommand",
"(",
"command",
")",
":",
"output",
"=",
"None",
"try",
":",
"output",
"=",
"subprocess",
".",
"check_output",
"(",
"command",
",",
"stderr",
"=",
"subprocess",
".",
"STDOUT",
",",
"shell",
"=",
"False",
",",
")",
"except",
"subproce... | Run a command.
:param command: the command to run.
:type command: list
Tries to run a command. If it fails, raise a :py:class:`ProgramError`. This
function uses the :py:mod:`subprocess` module.
.. warning::
The variable ``command`` should be a list of strings (no other type). | [
"Run",
"a",
"command",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L1022-L1045 |
lemieuxl/pyGenClean | pyGenClean/Ethnicity/check_ethnicity.py | checkArgs | def checkArgs(args):
"""Checks the arguments and options.
:param args: an object containing the options of the program.
:type args: argparse.Namespace
:returns: ``True`` if everything was OK.
If there is a problem with an option, an exception is raised using the
:py:class:`ProgramError` clas... | python | def checkArgs(args):
"""Checks the arguments and options.
:param args: an object containing the options of the program.
:type args: argparse.Namespace
:returns: ``True`` if everything was OK.
If there is a problem with an option, an exception is raised using the
:py:class:`ProgramError` clas... | [
"def",
"checkArgs",
"(",
"args",
")",
":",
"# Check if we have the tped and the tfam files",
"prefixes_to_check",
"=",
"[",
"args",
".",
"bfile",
"]",
"if",
"not",
"args",
".",
"skip_ref_pops",
":",
"for",
"pop",
"in",
"(",
"\"ceu\"",
",",
"\"yri\"",
",",
"\"j... | Checks the arguments and options.
:param args: an object containing the options of the program.
:type args: argparse.Namespace
:returns: ``True`` if everything was OK.
If there is a problem with an option, an exception is raised using the
:py:class:`ProgramError` class, a message is printed to t... | [
"Checks",
"the",
"arguments",
"and",
"options",
"."
] | train | https://github.com/lemieuxl/pyGenClean/blob/6173a48ccc0cf3a3bd711b1f2a1fa16248b8bf55/pyGenClean/Ethnicity/check_ethnicity.py#L1048-L1121 |
slaveofcode/pycrawler | pycrawler/page.py | extract_favicon | def extract_favicon(bs4):
"""Extracting favicon url from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of favicon urls
"""
favicon = []
selectors = [
'link[rel="icon"]',
'link[rel="Icon"]',
'link[rel="ICON"]',
'link[rel^="shortcut"]',
... | python | def extract_favicon(bs4):
"""Extracting favicon url from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of favicon urls
"""
favicon = []
selectors = [
'link[rel="icon"]',
'link[rel="Icon"]',
'link[rel="ICON"]',
'link[rel^="shortcut"]',
... | [
"def",
"extract_favicon",
"(",
"bs4",
")",
":",
"favicon",
"=",
"[",
"]",
"selectors",
"=",
"[",
"'link[rel=\"icon\"]'",
",",
"'link[rel=\"Icon\"]'",
",",
"'link[rel=\"ICON\"]'",
",",
"'link[rel^=\"shortcut\"]'",
",",
"'link[rel^=\"Shortcut\"]'",
",",
"'link[rel^=\"SHOR... | Extracting favicon url from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of favicon urls | [
"Extracting",
"favicon",
"url",
"from",
"BeautifulSoup",
"object"
] | train | https://github.com/slaveofcode/pycrawler/blob/6d19b5b378f42f9586e2d3a0d0c013cb03c82f6d/pycrawler/page.py#L42-L72 |
slaveofcode/pycrawler | pycrawler/page.py | extract_metas | def extract_metas(bs4):
"""Extracting meta tags from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of meta tags
"""
meta_tags = []
metas = bs4.select('meta')
for meta in metas:
meta_content = {}
meta_attrs = [
'charset',
'... | python | def extract_metas(bs4):
"""Extracting meta tags from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of meta tags
"""
meta_tags = []
metas = bs4.select('meta')
for meta in metas:
meta_content = {}
meta_attrs = [
'charset',
'... | [
"def",
"extract_metas",
"(",
"bs4",
")",
":",
"meta_tags",
"=",
"[",
"]",
"metas",
"=",
"bs4",
".",
"select",
"(",
"'meta'",
")",
"for",
"meta",
"in",
"metas",
":",
"meta_content",
"=",
"{",
"}",
"meta_attrs",
"=",
"[",
"'charset'",
",",
"'name'",
",... | Extracting meta tags from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of meta tags | [
"Extracting",
"meta",
"tags",
"from",
"BeautifulSoup",
"object"
] | train | https://github.com/slaveofcode/pycrawler/blob/6d19b5b378f42f9586e2d3a0d0c013cb03c82f6d/pycrawler/page.py#L75-L105 |
slaveofcode/pycrawler | pycrawler/page.py | convert_invalid_url | def convert_invalid_url(url):
"""Convert invalid url with adding extra 'http://' schema into it
:param url:
:return:
"""
regex_valid_url = re.compile(
r'^(?:http|ftp)s?://' # http:// or https://
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #do... | python | def convert_invalid_url(url):
"""Convert invalid url with adding extra 'http://' schema into it
:param url:
:return:
"""
regex_valid_url = re.compile(
r'^(?:http|ftp)s?://' # http:// or https://
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #do... | [
"def",
"convert_invalid_url",
"(",
"url",
")",
":",
"regex_valid_url",
"=",
"re",
".",
"compile",
"(",
"r'^(?:http|ftp)s?://'",
"# http:// or https://",
"r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\\.)+(?:[A-Z]{2,6}\\.?|[A-Z0-9-]{2,}\\.?)|'",
"#domain...",
"r'localhost|'",
"#local... | Convert invalid url with adding extra 'http://' schema into it
:param url:
:return: | [
"Convert",
"invalid",
"url",
"with",
"adding",
"extra",
"http",
":",
"//",
"schema",
"into",
"it"
] | train | https://github.com/slaveofcode/pycrawler/blob/6d19b5b378f42f9586e2d3a0d0c013cb03c82f6d/pycrawler/page.py#L108-L122 |
slaveofcode/pycrawler | pycrawler/page.py | extract_links | def extract_links(bs4):
"""Extracting links from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of links
"""
unique_links = list(set([anchor['href'] for anchor in bs4.select('a[href]') if anchor.has_attr('href')]))
# remove irrelevant link
unique_links = [link for l... | python | def extract_links(bs4):
"""Extracting links from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of links
"""
unique_links = list(set([anchor['href'] for anchor in bs4.select('a[href]') if anchor.has_attr('href')]))
# remove irrelevant link
unique_links = [link for l... | [
"def",
"extract_links",
"(",
"bs4",
")",
":",
"unique_links",
"=",
"list",
"(",
"set",
"(",
"[",
"anchor",
"[",
"'href'",
"]",
"for",
"anchor",
"in",
"bs4",
".",
"select",
"(",
"'a[href]'",
")",
"if",
"anchor",
".",
"has_attr",
"(",
"'href'",
")",
"]... | Extracting links from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of links | [
"Extracting",
"links",
"from",
"BeautifulSoup",
"object"
] | train | https://github.com/slaveofcode/pycrawler/blob/6d19b5b378f42f9586e2d3a0d0c013cb03c82f6d/pycrawler/page.py#L125-L138 |
slaveofcode/pycrawler | pycrawler/page.py | extract_original_links | def extract_original_links(base_url, bs4):
"""Extracting links that contains specific url from BeautifulSoup object
:param base_url: `str` specific url that matched with the links
:param bs4: `BeautifulSoup`
:return: `list` List of links
"""
valid_url = convert_invalid_url(base_url)
url = ... | python | def extract_original_links(base_url, bs4):
"""Extracting links that contains specific url from BeautifulSoup object
:param base_url: `str` specific url that matched with the links
:param bs4: `BeautifulSoup`
:return: `list` List of links
"""
valid_url = convert_invalid_url(base_url)
url = ... | [
"def",
"extract_original_links",
"(",
"base_url",
",",
"bs4",
")",
":",
"valid_url",
"=",
"convert_invalid_url",
"(",
"base_url",
")",
"url",
"=",
"urlparse",
"(",
"valid_url",
")",
"base_url",
"=",
"'{}://{}'",
".",
"format",
"(",
"url",
".",
"scheme",
",",... | Extracting links that contains specific url from BeautifulSoup object
:param base_url: `str` specific url that matched with the links
:param bs4: `BeautifulSoup`
:return: `list` List of links | [
"Extracting",
"links",
"that",
"contains",
"specific",
"url",
"from",
"BeautifulSoup",
"object"
] | train | https://github.com/slaveofcode/pycrawler/blob/6d19b5b378f42f9586e2d3a0d0c013cb03c82f6d/pycrawler/page.py#L141-L162 |
slaveofcode/pycrawler | pycrawler/page.py | extract_css_links | def extract_css_links(bs4):
"""Extracting css links from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of links
"""
links = extract_links(bs4)
real_css = [anchor for anchor in links if anchor.endswith(('.css', '.CSS'))]
css_link_tags = [anchor['href'] for anchor i... | python | def extract_css_links(bs4):
"""Extracting css links from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of links
"""
links = extract_links(bs4)
real_css = [anchor for anchor in links if anchor.endswith(('.css', '.CSS'))]
css_link_tags = [anchor['href'] for anchor i... | [
"def",
"extract_css_links",
"(",
"bs4",
")",
":",
"links",
"=",
"extract_links",
"(",
"bs4",
")",
"real_css",
"=",
"[",
"anchor",
"for",
"anchor",
"in",
"links",
"if",
"anchor",
".",
"endswith",
"(",
"(",
"'.css'",
",",
"'.CSS'",
")",
")",
"]",
"css_li... | Extracting css links from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of links | [
"Extracting",
"css",
"links",
"from",
"BeautifulSoup",
"object"
] | train | https://github.com/slaveofcode/pycrawler/blob/6d19b5b378f42f9586e2d3a0d0c013cb03c82f6d/pycrawler/page.py#L165-L179 |
slaveofcode/pycrawler | pycrawler/page.py | extract_js_links | def extract_js_links(bs4):
"""Extracting js links from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of links
"""
links = extract_links(bs4)
real_js = [anchor for anchor in links if anchor.endswith(('.js', '.JS'))]
js_tags = [anchor['src'] for anchor in bs4.select... | python | def extract_js_links(bs4):
"""Extracting js links from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of links
"""
links = extract_links(bs4)
real_js = [anchor for anchor in links if anchor.endswith(('.js', '.JS'))]
js_tags = [anchor['src'] for anchor in bs4.select... | [
"def",
"extract_js_links",
"(",
"bs4",
")",
":",
"links",
"=",
"extract_links",
"(",
"bs4",
")",
"real_js",
"=",
"[",
"anchor",
"for",
"anchor",
"in",
"links",
"if",
"anchor",
".",
"endswith",
"(",
"(",
"'.js'",
",",
"'.JS'",
")",
")",
"]",
"js_tags",
... | Extracting js links from BeautifulSoup object
:param bs4: `BeautifulSoup`
:return: `list` List of links | [
"Extracting",
"js",
"links",
"from",
"BeautifulSoup",
"object"
] | train | https://github.com/slaveofcode/pycrawler/blob/6d19b5b378f42f9586e2d3a0d0c013cb03c82f6d/pycrawler/page.py#L182-L196 |
slaveofcode/pycrawler | pycrawler/page.py | extract_images | def extract_images(bs4, lazy_image_attribute=None):
"""If lazy attribute is supplied, find image url on that attribute
:param bs4:
:param lazy_image_attribute:
:return:
"""
# get images form 'img' tags
if lazy_image_attribute:
images = [image[lazy_image_attribute] for image in bs4... | python | def extract_images(bs4, lazy_image_attribute=None):
"""If lazy attribute is supplied, find image url on that attribute
:param bs4:
:param lazy_image_attribute:
:return:
"""
# get images form 'img' tags
if lazy_image_attribute:
images = [image[lazy_image_attribute] for image in bs4... | [
"def",
"extract_images",
"(",
"bs4",
",",
"lazy_image_attribute",
"=",
"None",
")",
":",
"# get images form 'img' tags",
"if",
"lazy_image_attribute",
":",
"images",
"=",
"[",
"image",
"[",
"lazy_image_attribute",
"]",
"for",
"image",
"in",
"bs4",
".",
"select",
... | If lazy attribute is supplied, find image url on that attribute
:param bs4:
:param lazy_image_attribute:
:return: | [
"If",
"lazy",
"attribute",
"is",
"supplied",
"find",
"image",
"url",
"on",
"that",
"attribute"
] | train | https://github.com/slaveofcode/pycrawler/blob/6d19b5b378f42f9586e2d3a0d0c013cb03c82f6d/pycrawler/page.py#L209-L234 |
slaveofcode/pycrawler | pycrawler/page.py | extract_canonical | def extract_canonical(bs4):
"""Extracting canonical url
:param bs4:
:return:
"""
link_rel = bs4.select('link[rel="canonical"]')
if link_rel.__len__() > 0:
if link_rel[0].has_attr('href'):
return link_rel[0]['href']
return None | python | def extract_canonical(bs4):
"""Extracting canonical url
:param bs4:
:return:
"""
link_rel = bs4.select('link[rel="canonical"]')
if link_rel.__len__() > 0:
if link_rel[0].has_attr('href'):
return link_rel[0]['href']
return None | [
"def",
"extract_canonical",
"(",
"bs4",
")",
":",
"link_rel",
"=",
"bs4",
".",
"select",
"(",
"'link[rel=\"canonical\"]'",
")",
"if",
"link_rel",
".",
"__len__",
"(",
")",
">",
"0",
":",
"if",
"link_rel",
"[",
"0",
"]",
".",
"has_attr",
"(",
"'href'",
... | Extracting canonical url
:param bs4:
:return: | [
"Extracting",
"canonical",
"url"
] | train | https://github.com/slaveofcode/pycrawler/blob/6d19b5b378f42f9586e2d3a0d0c013cb03c82f6d/pycrawler/page.py#L237-L252 |
slaveofcode/pycrawler | pycrawler/page.py | Page.html | def html(self, selector):
"""Return html result that executed by given css selector
:param selector: `str` css selector
:return: `list` or `None`
"""
result = self.__bs4.select(selector)
return [str(r) for r in result] \
if result.__len__() > 1 else \
... | python | def html(self, selector):
"""Return html result that executed by given css selector
:param selector: `str` css selector
:return: `list` or `None`
"""
result = self.__bs4.select(selector)
return [str(r) for r in result] \
if result.__len__() > 1 else \
... | [
"def",
"html",
"(",
"self",
",",
"selector",
")",
":",
"result",
"=",
"self",
".",
"__bs4",
".",
"select",
"(",
"selector",
")",
"return",
"[",
"str",
"(",
"r",
")",
"for",
"r",
"in",
"result",
"]",
"if",
"result",
".",
"__len__",
"(",
")",
">",
... | Return html result that executed by given css selector
:param selector: `str` css selector
:return: `list` or `None` | [
"Return",
"html",
"result",
"that",
"executed",
"by",
"given",
"css",
"selector"
] | train | https://github.com/slaveofcode/pycrawler/blob/6d19b5b378f42f9586e2d3a0d0c013cb03c82f6d/pycrawler/page.py#L419-L430 |
slaveofcode/pycrawler | pycrawler/page.py | Page.text | def text(self, selector):
"""Return text result that executed by given css selector
:param selector: `str` css selector
:return: `list` or `None`
"""
result = self.__bs4.select(selector)
return [r.get_text() for r in result] \
if result.__len__() > 1 else \... | python | def text(self, selector):
"""Return text result that executed by given css selector
:param selector: `str` css selector
:return: `list` or `None`
"""
result = self.__bs4.select(selector)
return [r.get_text() for r in result] \
if result.__len__() > 1 else \... | [
"def",
"text",
"(",
"self",
",",
"selector",
")",
":",
"result",
"=",
"self",
".",
"__bs4",
".",
"select",
"(",
"selector",
")",
"return",
"[",
"r",
".",
"get_text",
"(",
")",
"for",
"r",
"in",
"result",
"]",
"if",
"result",
".",
"__len__",
"(",
... | Return text result that executed by given css selector
:param selector: `str` css selector
:return: `list` or `None` | [
"Return",
"text",
"result",
"that",
"executed",
"by",
"given",
"css",
"selector"
] | train | https://github.com/slaveofcode/pycrawler/blob/6d19b5b378f42f9586e2d3a0d0c013cb03c82f6d/pycrawler/page.py#L432-L443 |
ryanpetrello/cleaver | cleaver/experiment.py | VariantStat.conversion_rate | def conversion_rate(self):
"""
The percentage of participants that have converted for this variant.
Returns a > 0 float representing a percentage rate.
"""
participants = self.participant_count
if participants == 0:
return 0.0
return self.experiment.c... | python | def conversion_rate(self):
"""
The percentage of participants that have converted for this variant.
Returns a > 0 float representing a percentage rate.
"""
participants = self.participant_count
if participants == 0:
return 0.0
return self.experiment.c... | [
"def",
"conversion_rate",
"(",
"self",
")",
":",
"participants",
"=",
"self",
".",
"participant_count",
"if",
"participants",
"==",
"0",
":",
"return",
"0.0",
"return",
"self",
".",
"experiment",
".",
"conversions_for",
"(",
"self",
".",
"name",
")",
"/",
... | The percentage of participants that have converted for this variant.
Returns a > 0 float representing a percentage rate. | [
"The",
"percentage",
"of",
"participants",
"that",
"have",
"converted",
"for",
"this",
"variant",
"."
] | train | https://github.com/ryanpetrello/cleaver/blob/0ef266e1a0603c6d414df4b9926ce2a59844db35/cleaver/experiment.py#L116-L125 |
ryanpetrello/cleaver | cleaver/experiment.py | VariantStat.z_score | def z_score(self):
"""
Calculate the Z-Score between this alternative and the project control.
Statistical formulas based on:
http://20bits.com/article/statistical-analysis-and-ab-testing
"""
control = VariantStat(self.experiment.control, self.experiment)
altern... | python | def z_score(self):
"""
Calculate the Z-Score between this alternative and the project control.
Statistical formulas based on:
http://20bits.com/article/statistical-analysis-and-ab-testing
"""
control = VariantStat(self.experiment.control, self.experiment)
altern... | [
"def",
"z_score",
"(",
"self",
")",
":",
"control",
"=",
"VariantStat",
"(",
"self",
".",
"experiment",
".",
"control",
",",
"self",
".",
"experiment",
")",
"alternative",
"=",
"self",
"if",
"control",
".",
"name",
"==",
"alternative",
".",
"name",
":",
... | Calculate the Z-Score between this alternative and the project control.
Statistical formulas based on:
http://20bits.com/article/statistical-analysis-and-ab-testing | [
"Calculate",
"the",
"Z",
"-",
"Score",
"between",
"this",
"alternative",
"and",
"the",
"project",
"control",
"."
] | train | https://github.com/ryanpetrello/cleaver/blob/0ef266e1a0603c6d414df4b9926ce2a59844db35/cleaver/experiment.py#L128-L164 |
ryanpetrello/cleaver | cleaver/experiment.py | VariantStat.confidence_level | def confidence_level(self):
"""
Based on the variant's Z-Score, returns a human-readable string that
describes the confidence with which we can say the results are
statistically significant.
"""
z = self.z_score
if isinstance(z, string_types):
return z... | python | def confidence_level(self):
"""
Based on the variant's Z-Score, returns a human-readable string that
describes the confidence with which we can say the results are
statistically significant.
"""
z = self.z_score
if isinstance(z, string_types):
return z... | [
"def",
"confidence_level",
"(",
"self",
")",
":",
"z",
"=",
"self",
".",
"z_score",
"if",
"isinstance",
"(",
"z",
",",
"string_types",
")",
":",
"return",
"z",
"z",
"=",
"abs",
"(",
"round",
"(",
"z",
",",
"3",
")",
")",
"if",
"z",
"==",
"0.0",
... | Based on the variant's Z-Score, returns a human-readable string that
describes the confidence with which we can say the results are
statistically significant. | [
"Based",
"on",
"the",
"variant",
"s",
"Z",
"-",
"Score",
"returns",
"a",
"human",
"-",
"readable",
"string",
"that",
"describes",
"the",
"confidence",
"with",
"which",
"we",
"can",
"say",
"the",
"results",
"are",
"statistically",
"significant",
"."
] | train | https://github.com/ryanpetrello/cleaver/blob/0ef266e1a0603c6d414df4b9926ce2a59844db35/cleaver/experiment.py#L167-L187 |
radujica/baloo | baloo/core/indexes/base.py | Index.evaluate | def evaluate(self, verbose=False, decode=True, passes=None, num_threads=1, apply_experimental=True):
"""Evaluates by creating an Index containing evaluated data.
See `LazyResult`
Returns
-------
Index
Index with evaluated data.
"""
evaluated_data = ... | python | def evaluate(self, verbose=False, decode=True, passes=None, num_threads=1, apply_experimental=True):
"""Evaluates by creating an Index containing evaluated data.
See `LazyResult`
Returns
-------
Index
Index with evaluated data.
"""
evaluated_data = ... | [
"def",
"evaluate",
"(",
"self",
",",
"verbose",
"=",
"False",
",",
"decode",
"=",
"True",
",",
"passes",
"=",
"None",
",",
"num_threads",
"=",
"1",
",",
"apply_experimental",
"=",
"True",
")",
":",
"evaluated_data",
"=",
"super",
"(",
"Index",
",",
"se... | Evaluates by creating an Index containing evaluated data.
See `LazyResult`
Returns
-------
Index
Index with evaluated data. | [
"Evaluates",
"by",
"creating",
"an",
"Index",
"containing",
"evaluated",
"data",
"."
] | train | https://github.com/radujica/baloo/blob/f6e05e35b73a75e8a300754c6bdc575e5f2d53b9/baloo/core/indexes/base.py#L180-L193 |
radujica/baloo | baloo/core/indexes/base.py | Index.tail | def tail(self, n=5):
"""Return Index with the last n values.
Parameters
----------
n : int
Number of values.
Returns
-------
Series
Index containing the last n values.
Examples
--------
>>> ind = bl.Index(np.arang... | python | def tail(self, n=5):
"""Return Index with the last n values.
Parameters
----------
n : int
Number of values.
Returns
-------
Series
Index containing the last n values.
Examples
--------
>>> ind = bl.Index(np.arang... | [
"def",
"tail",
"(",
"self",
",",
"n",
"=",
"5",
")",
":",
"if",
"self",
".",
"empty",
":",
"return",
"self",
"else",
":",
"if",
"self",
".",
"_length",
"is",
"not",
"None",
":",
"length",
"=",
"self",
".",
"_length",
"else",
":",
"length",
"=",
... | Return Index with the last n values.
Parameters
----------
n : int
Number of values.
Returns
-------
Series
Index containing the last n values.
Examples
--------
>>> ind = bl.Index(np.arange(3, dtype=np.float64))
... | [
"Return",
"Index",
"with",
"the",
"last",
"n",
"values",
"."
] | train | https://github.com/radujica/baloo/blob/f6e05e35b73a75e8a300754c6bdc575e5f2d53b9/baloo/core/indexes/base.py#L217-L248 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.