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 |
|---|---|---|---|---|---|---|---|---|---|---|
akfullfo/taskforce | taskforce/watch_files.py | watch._add_file | def _add_file(self, path, **params):
"""
Attempt to add a file to the system monitoring mechanism.
"""
log = self._getparam('log', self._discard, **params)
fd = None
try:
fd = os.open(path, os.O_RDONLY)
except Exception as e:
if not self.paths[... | python | def _add_file(self, path, **params):
"""
Attempt to add a file to the system monitoring mechanism.
"""
log = self._getparam('log', self._discard, **params)
fd = None
try:
fd = os.open(path, os.O_RDONLY)
except Exception as e:
if not self.paths[... | [
"def",
"_add_file",
"(",
"self",
",",
"path",
",",
"*",
"*",
"params",
")",
":",
"log",
"=",
"self",
".",
"_getparam",
"(",
"'log'",
",",
"self",
".",
"_discard",
",",
"*",
"*",
"params",
")",
"fd",
"=",
"None",
"try",
":",
"fd",
"=",
"os",
"."... | Attempt to add a file to the system monitoring mechanism. | [
"Attempt",
"to",
"add",
"a",
"file",
"to",
"the",
"system",
"monitoring",
"mechanism",
"."
] | train | https://github.com/akfullfo/taskforce/blob/bc6dd744bd33546447d085dbd18a350532220193/taskforce/watch_files.py#L383-L449 |
akfullfo/taskforce | taskforce/watch_files.py | watch.commit | def commit(self, **params):
"""
Rebuild kevent operations by removing open files that no longer need to
be watched, and adding new files if they are not currently being watched.
This is done by comparing self.paths to self.paths_open.
"""
log = self._getparam('log', self._di... | python | def commit(self, **params):
"""
Rebuild kevent operations by removing open files that no longer need to
be watched, and adding new files if they are not currently being watched.
This is done by comparing self.paths to self.paths_open.
"""
log = self._getparam('log', self._di... | [
"def",
"commit",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"log",
"=",
"self",
".",
"_getparam",
"(",
"'log'",
",",
"self",
".",
"_discard",
",",
"*",
"*",
"params",
")",
"# Find all the modules that no longer need watching",
"#",
"removed",
"=",
"0... | Rebuild kevent operations by removing open files that no longer need to
be watched, and adding new files if they are not currently being watched.
This is done by comparing self.paths to self.paths_open. | [
"Rebuild",
"kevent",
"operations",
"by",
"removing",
"open",
"files",
"that",
"no",
"longer",
"need",
"to",
"be",
"watched",
"and",
"adding",
"new",
"files",
"if",
"they",
"are",
"not",
"currently",
"being",
"watched",
"."
] | train | https://github.com/akfullfo/taskforce/blob/bc6dd744bd33546447d085dbd18a350532220193/taskforce/watch_files.py#L451-L524 |
akfullfo/taskforce | taskforce/watch_files.py | watch.get | def get(self, **params):
"""
Return a list of watched paths that where affected by recent
changes, following a successful poll() return for the controlling
file descriptor.
If param "timeout" is greater than 0, the event queue will be read
multiple times and reads contin... | python | def get(self, **params):
"""
Return a list of watched paths that where affected by recent
changes, following a successful poll() return for the controlling
file descriptor.
If param "timeout" is greater than 0, the event queue will be read
multiple times and reads contin... | [
"def",
"get",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"log",
"=",
"self",
".",
"_getparam",
"(",
"'log'",
",",
"self",
".",
"_discard",
",",
"*",
"*",
"params",
")",
"self",
".",
"last_changes",
"=",
"{",
"}",
"timeout",
"=",
"self",
".",... | Return a list of watched paths that where affected by recent
changes, following a successful poll() return for the controlling
file descriptor.
If param "timeout" is greater than 0, the event queue will be read
multiple times and reads continue until a timeout occurs.
With a ti... | [
"Return",
"a",
"list",
"of",
"watched",
"paths",
"that",
"where",
"affected",
"by",
"recent",
"changes",
"following",
"a",
"successful",
"poll",
"()",
"return",
"for",
"the",
"controlling",
"file",
"descriptor",
"."
] | train | https://github.com/akfullfo/taskforce/blob/bc6dd744bd33546447d085dbd18a350532220193/taskforce/watch_files.py#L526-L669 |
akfullfo/taskforce | taskforce/watch_files.py | watch.add | def add(self, paths, **params):
"""
Add a path (or list of paths) to the list of paths being
watched. The 'missing' setting for a file can also be
changed by re-adding the file.
"""
log = self._getparam('log', self._discard, **params)
missing = self._getparam('missin... | python | def add(self, paths, **params):
"""
Add a path (or list of paths) to the list of paths being
watched. The 'missing' setting for a file can also be
changed by re-adding the file.
"""
log = self._getparam('log', self._discard, **params)
missing = self._getparam('missin... | [
"def",
"add",
"(",
"self",
",",
"paths",
",",
"*",
"*",
"params",
")",
":",
"log",
"=",
"self",
".",
"_getparam",
"(",
"'log'",
",",
"self",
".",
"_discard",
",",
"*",
"*",
"params",
")",
"missing",
"=",
"self",
".",
"_getparam",
"(",
"'missing'",
... | Add a path (or list of paths) to the list of paths being
watched. The 'missing' setting for a file can also be
changed by re-adding the file. | [
"Add",
"a",
"path",
"(",
"or",
"list",
"of",
"paths",
")",
"to",
"the",
"list",
"of",
"paths",
"being",
"watched",
".",
"The",
"missing",
"setting",
"for",
"a",
"file",
"can",
"also",
"be",
"changed",
"by",
"re",
"-",
"adding",
"the",
"file",
"."
] | train | https://github.com/akfullfo/taskforce/blob/bc6dd744bd33546447d085dbd18a350532220193/taskforce/watch_files.py#L671-L698 |
akfullfo/taskforce | taskforce/watch_files.py | watch.remove | def remove(self, paths, **params):
"""
Delete paths from the watched list.
"""
log = self._getparam('log', self._discard, **params)
commit = self._getparam('commit', True, **params)
if type(paths) is not list:
paths = [paths]
rebuild = False
for ... | python | def remove(self, paths, **params):
"""
Delete paths from the watched list.
"""
log = self._getparam('log', self._discard, **params)
commit = self._getparam('commit', True, **params)
if type(paths) is not list:
paths = [paths]
rebuild = False
for ... | [
"def",
"remove",
"(",
"self",
",",
"paths",
",",
"*",
"*",
"params",
")",
":",
"log",
"=",
"self",
".",
"_getparam",
"(",
"'log'",
",",
"self",
".",
"_discard",
",",
"*",
"*",
"params",
")",
"commit",
"=",
"self",
".",
"_getparam",
"(",
"'commit'",... | Delete paths from the watched list. | [
"Delete",
"paths",
"from",
"the",
"watched",
"list",
"."
] | train | https://github.com/akfullfo/taskforce/blob/bc6dd744bd33546447d085dbd18a350532220193/taskforce/watch_files.py#L700-L721 |
akfullfo/taskforce | taskforce/watch_files.py | watch.scan | def scan(self, **params):
"""
This method should be called periodically if files were added
with "missing=False". It will check for the appearance of missing
files and ensure an event will be triggered for any that appear.
It also needs to be called if the instance could be in ... | python | def scan(self, **params):
"""
This method should be called periodically if files were added
with "missing=False". It will check for the appearance of missing
files and ensure an event will be triggered for any that appear.
It also needs to be called if the instance could be in ... | [
"def",
"scan",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"log",
"=",
"self",
".",
"_getparam",
"(",
"'log'",
",",
"self",
".",
"_discard",
",",
"*",
"*",
"params",
")",
"pending",
"=",
"len",
"(",
"self",
".",
"paths_pending",
")",
"log",
"... | This method should be called periodically if files were added
with "missing=False". It will check for the appearance of missing
files and ensure an event will be triggered for any that appear.
It also needs to be called if the instance could be in WF_POLLING
mode as file system changes... | [
"This",
"method",
"should",
"be",
"called",
"periodically",
"if",
"files",
"were",
"added",
"with",
"missing",
"=",
"False",
".",
"It",
"will",
"check",
"for",
"the",
"appearance",
"of",
"missing",
"files",
"and",
"ensure",
"an",
"event",
"will",
"be",
"tr... | train | https://github.com/akfullfo/taskforce/blob/bc6dd744bd33546447d085dbd18a350532220193/taskforce/watch_files.py#L723-L771 |
TissueMAPS/TmClient | src/python/tmclient/api.py | replace_ext | def replace_ext(filename, ext):
"""
Return new pathname formed by replacing extension in `filename` with `ext`.
"""
if ext.startswith('.'):
ext = ext[1:]
stem, _ = os.path.splitext(filename)
return (stem + '.' + ext) | python | def replace_ext(filename, ext):
"""
Return new pathname formed by replacing extension in `filename` with `ext`.
"""
if ext.startswith('.'):
ext = ext[1:]
stem, _ = os.path.splitext(filename)
return (stem + '.' + ext) | [
"def",
"replace_ext",
"(",
"filename",
",",
"ext",
")",
":",
"if",
"ext",
".",
"startswith",
"(",
"'.'",
")",
":",
"ext",
"=",
"ext",
"[",
"1",
":",
"]",
"stem",
",",
"_",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"filename",
")",
"return",
... | Return new pathname formed by replacing extension in `filename` with `ext`. | [
"Return",
"new",
"pathname",
"formed",
"by",
"replacing",
"extension",
"in",
"filename",
"with",
"ext",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L75-L82 |
TissueMAPS/TmClient | src/python/tmclient/api.py | check_imagemagick_supported_format | def check_imagemagick_supported_format(fmt):
"""
Return ``True`` if `convert` can be run and reports supporting image format `fmt`.
"""
try:
convert_output = check_output(['convert', '--version'])
# `subprocess` raises `OSError` if the executable is not found
except (CalledProcessError, ... | python | def check_imagemagick_supported_format(fmt):
"""
Return ``True`` if `convert` can be run and reports supporting image format `fmt`.
"""
try:
convert_output = check_output(['convert', '--version'])
# `subprocess` raises `OSError` if the executable is not found
except (CalledProcessError, ... | [
"def",
"check_imagemagick_supported_format",
"(",
"fmt",
")",
":",
"try",
":",
"convert_output",
"=",
"check_output",
"(",
"[",
"'convert'",
",",
"'--version'",
"]",
")",
"# `subprocess` raises `OSError` if the executable is not found",
"except",
"(",
"CalledProcessError",
... | Return ``True`` if `convert` can be run and reports supporting image format `fmt`. | [
"Return",
"True",
"if",
"convert",
"can",
"be",
"run",
"and",
"reports",
"supporting",
"image",
"format",
"fmt",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L85-L129 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.get_experiments | def get_experiments(self):
'''Gets information for all experiments.
Returns
-------
List[Dict[str, str]]
id, name and description for each experiment
See also
--------
:func:`tmserver.api.experiment.get_experiments`
:class:`tmlib.models.exper... | python | def get_experiments(self):
'''Gets information for all experiments.
Returns
-------
List[Dict[str, str]]
id, name and description for each experiment
See also
--------
:func:`tmserver.api.experiment.get_experiments`
:class:`tmlib.models.exper... | [
"def",
"get_experiments",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"'get experiments'",
")",
"url",
"=",
"self",
".",
"_build_api_url",
"(",
"'/experiments'",
")",
"res",
"=",
"self",
".",
"_session",
".",
"get",
"(",
"url",
")",
"res",
".",
... | Gets information for all experiments.
Returns
-------
List[Dict[str, str]]
id, name and description for each experiment
See also
--------
:func:`tmserver.api.experiment.get_experiments`
:class:`tmlib.models.experiment.Experiment` | [
"Gets",
"information",
"for",
"all",
"experiments",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L188-L205 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.create_experiment | def create_experiment(self, workflow_type, microscope_type, plate_format,
plate_acquisition_mode):
'''Creates the experiment.
Parameters
----------
workflow_type: str
workflow type
microscope_type: str
microscope type
plate_format: int... | python | def create_experiment(self, workflow_type, microscope_type, plate_format,
plate_acquisition_mode):
'''Creates the experiment.
Parameters
----------
workflow_type: str
workflow type
microscope_type: str
microscope type
plate_format: int... | [
"def",
"create_experiment",
"(",
"self",
",",
"workflow_type",
",",
"microscope_type",
",",
"plate_format",
",",
"plate_acquisition_mode",
")",
":",
"logger",
".",
"info",
"(",
"'create experiment \"%s\"'",
",",
"self",
".",
"experiment_name",
")",
"content",
"=",
... | Creates the experiment.
Parameters
----------
workflow_type: str
workflow type
microscope_type: str
microscope type
plate_format: int
well-plate format, i.e. total number of wells per plate
plate_acquisition_mode: str
mode ... | [
"Creates",
"the",
"experiment",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L337-L379 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.rename_experiment | def rename_experiment(self, new_name):
'''Renames the experiment.
Parameters
----------
See also
--------
:func:`tmserver.api.experiment.update_experiment`
:class:`tmlib.models.experiment.ExperimentReference`
'''
logger.info('rename experiment "%... | python | def rename_experiment(self, new_name):
'''Renames the experiment.
Parameters
----------
See also
--------
:func:`tmserver.api.experiment.update_experiment`
:class:`tmlib.models.experiment.ExperimentReference`
'''
logger.info('rename experiment "%... | [
"def",
"rename_experiment",
"(",
"self",
",",
"new_name",
")",
":",
"logger",
".",
"info",
"(",
"'rename experiment \"%s\"'",
",",
"self",
".",
"experiment_name",
")",
"content",
"=",
"{",
"'name'",
":",
"new_name",
"}",
"url",
"=",
"self",
".",
"_build_api_... | Renames the experiment.
Parameters
----------
See also
--------
:func:`tmserver.api.experiment.update_experiment`
:class:`tmlib.models.experiment.ExperimentReference` | [
"Renames",
"the",
"experiment",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L381-L401 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.delete_experiment | def delete_experiment(self):
'''Deletes the experiment.
See also
--------
:func:`tmserver.api.experiment.delete_experiment`
:class:`tmlib.models.experiment.ExperimentReference`
:class:`tmlib.models.experiment.Experiment`
'''
logger.info('delete experiment... | python | def delete_experiment(self):
'''Deletes the experiment.
See also
--------
:func:`tmserver.api.experiment.delete_experiment`
:class:`tmlib.models.experiment.ExperimentReference`
:class:`tmlib.models.experiment.Experiment`
'''
logger.info('delete experiment... | [
"def",
"delete_experiment",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"'delete experiment \"%s\"'",
",",
"self",
".",
"experiment_name",
")",
"url",
"=",
"self",
".",
"_build_api_url",
"(",
"'/experiments/{experiment_id}'",
".",
"format",
"(",
"experiment... | Deletes the experiment.
See also
--------
:func:`tmserver.api.experiment.delete_experiment`
:class:`tmlib.models.experiment.ExperimentReference`
:class:`tmlib.models.experiment.Experiment` | [
"Deletes",
"the",
"experiment",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L403-L420 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.delete_plate | def delete_plate(self, name):
'''Deletes a plate.
Parameters
----------
name: str
name of the plate that should be deleted
See also
--------
:func:`tmserver.api.plate.delete_plate`
:class:`tmlib.models.plate.Plate`
'''
logger.... | python | def delete_plate(self, name):
'''Deletes a plate.
Parameters
----------
name: str
name of the plate that should be deleted
See also
--------
:func:`tmserver.api.plate.delete_plate`
:class:`tmlib.models.plate.Plate`
'''
logger.... | [
"def",
"delete_plate",
"(",
"self",
",",
"name",
")",
":",
"logger",
".",
"info",
"(",
"'delete plate \"%s\" of experiment \"%s\"'",
",",
"name",
",",
"self",
".",
"experiment_name",
")",
"plate_id",
"=",
"self",
".",
"_get_plate_id",
"(",
"name",
")",
"url",
... | Deletes a plate.
Parameters
----------
name: str
name of the plate that should be deleted
See also
--------
:func:`tmserver.api.plate.delete_plate`
:class:`tmlib.models.plate.Plate` | [
"Deletes",
"a",
"plate",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L486-L510 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.rename_plate | def rename_plate(self, name, new_name):
'''Renames a plate.
Parameters
----------
name: str
name of the plate that should be renamed
new_name: str
name that should be given to the plate
See also
--------
:func:`tmserver.api.plate.... | python | def rename_plate(self, name, new_name):
'''Renames a plate.
Parameters
----------
name: str
name of the plate that should be renamed
new_name: str
name that should be given to the plate
See also
--------
:func:`tmserver.api.plate.... | [
"def",
"rename_plate",
"(",
"self",
",",
"name",
",",
"new_name",
")",
":",
"logger",
".",
"info",
"(",
"'rename plate \"%s\" of experiment \"%s\"'",
",",
"name",
",",
"self",
".",
"experiment_name",
")",
"plate_id",
"=",
"self",
".",
"_get_plate_id",
"(",
"na... | Renames a plate.
Parameters
----------
name: str
name of the plate that should be renamed
new_name: str
name that should be given to the plate
See also
--------
:func:`tmserver.api.plate.update_plate`
:class:`tmlib.models.plate.Pl... | [
"Renames",
"a",
"plate",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L512-L539 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.rename_acquisition | def rename_acquisition(self, plate_name, name, new_name):
'''Renames an acquisition.
Parameters
----------
plate_name: str
name of the parent plate
name: str
name of the acquisition that should be renamed
new_name: str
name that should... | python | def rename_acquisition(self, plate_name, name, new_name):
'''Renames an acquisition.
Parameters
----------
plate_name: str
name of the parent plate
name: str
name of the acquisition that should be renamed
new_name: str
name that should... | [
"def",
"rename_acquisition",
"(",
"self",
",",
"plate_name",
",",
"name",
",",
"new_name",
")",
":",
"logger",
".",
"info",
"(",
"'rename acquisistion \"%s\" of experiment \"%s\", plate \"%s\"'",
",",
"name",
",",
"self",
".",
"experiment_name",
",",
"plate_name",
"... | Renames an acquisition.
Parameters
----------
plate_name: str
name of the parent plate
name: str
name of the acquisition that should be renamed
new_name: str
name that should be given to the acquisition
See also
--------
... | [
"Renames",
"an",
"acquisition",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L645-L674 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.delete_acquisition | def delete_acquisition(self, plate_name, name):
'''Deletes an acquisition.
Parameters
----------
plate_name: str
name of the parent plate
name: str
name of the acquisition that should be deleted
See also
--------
:func:`tmserver.a... | python | def delete_acquisition(self, plate_name, name):
'''Deletes an acquisition.
Parameters
----------
plate_name: str
name of the parent plate
name: str
name of the acquisition that should be deleted
See also
--------
:func:`tmserver.a... | [
"def",
"delete_acquisition",
"(",
"self",
",",
"plate_name",
",",
"name",
")",
":",
"logger",
".",
"info",
"(",
"'delete acquisition \"%s\" of experiment \"%s\", plate \"%s\"'",
",",
"name",
",",
"self",
".",
"experiment_name",
",",
"plate_name",
")",
"acquisition_id"... | Deletes an acquisition.
Parameters
----------
plate_name: str
name of the parent plate
name: str
name of the acquisition that should be deleted
See also
--------
:func:`tmserver.api.acquisition.delete_acquisition`
:class:`tmlib.mo... | [
"Deletes",
"an",
"acquisition",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L676-L702 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.get_wells | def get_wells(self, plate_name=None):
'''Gets information about wells.
Parameters
----------
plate_name: str, optional
name of the parent plate
Returns
-------
List[Dict[str, str]]
id, name and description of each well
See also
... | python | def get_wells(self, plate_name=None):
'''Gets information about wells.
Parameters
----------
plate_name: str, optional
name of the parent plate
Returns
-------
List[Dict[str, str]]
id, name and description of each well
See also
... | [
"def",
"get_wells",
"(",
"self",
",",
"plate_name",
"=",
"None",
")",
":",
"logger",
".",
"info",
"(",
"'get wells of experiment \"%s\"'",
",",
"self",
".",
"experiment_name",
")",
"params",
"=",
"dict",
"(",
")",
"if",
"plate_name",
"is",
"not",
"None",
"... | Gets information about wells.
Parameters
----------
plate_name: str, optional
name of the parent plate
Returns
-------
List[Dict[str, str]]
id, name and description of each well
See also
--------
:func:`tmserver.api.well.... | [
"Gets",
"information",
"about",
"wells",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L779-L810 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.get_microscope_files | def get_microscope_files(self, plate_name, acquisition_name):
'''Gets status and name of files that have been registered for upload.
Parameters
----------
plate_name: str
name of the parent plate
acquisition_name: str
name of the parent acquisition
... | python | def get_microscope_files(self, plate_name, acquisition_name):
'''Gets status and name of files that have been registered for upload.
Parameters
----------
plate_name: str
name of the parent plate
acquisition_name: str
name of the parent acquisition
... | [
"def",
"get_microscope_files",
"(",
"self",
",",
"plate_name",
",",
"acquisition_name",
")",
":",
"logger",
".",
"info",
"(",
"'get names of already uploaded files for experiment \"%s\", '",
"'plate \"%s\" and acquisition \"%s\"'",
",",
"self",
".",
"experiment_name",
",",
... | Gets status and name of files that have been registered for upload.
Parameters
----------
plate_name: str
name of the parent plate
acquisition_name: str
name of the parent acquisition
Returns
-------
List[Dict[str, str]]
names... | [
"Gets",
"status",
"and",
"name",
"of",
"files",
"that",
"have",
"been",
"registered",
"for",
"upload",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1052-L1083 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.upload_microscope_files | def upload_microscope_files(self, plate_name, acquisition_name,
path, parallel=1, retry=5,
convert=None, delete_after_upload=False,
_deprecated_directory_option=False):
'''
Uploads microscope files contained ... | python | def upload_microscope_files(self, plate_name, acquisition_name,
path, parallel=1, retry=5,
convert=None, delete_after_upload=False,
_deprecated_directory_option=False):
'''
Uploads microscope files contained ... | [
"def",
"upload_microscope_files",
"(",
"self",
",",
"plate_name",
",",
"acquisition_name",
",",
"path",
",",
"parallel",
"=",
"1",
",",
"retry",
"=",
"5",
",",
"convert",
"=",
"None",
",",
"delete_after_upload",
"=",
"False",
",",
"_deprecated_directory_option",... | Uploads microscope files contained in `path`.
If `path` is a directory, upload all files contained in it.
Parameters
----------
plate_name: str
name of the parent plate
acquisition_name: str
name of the parent acquisition
path: str
pat... | [
"Uploads",
"microscope",
"files",
"contained",
"in",
"path",
".",
"If",
"path",
"is",
"a",
"directory",
"upload",
"all",
"files",
"contained",
"in",
"it",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1119-L1247 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.register_microscope_files | def register_microscope_files(self, plate_name, acquisition_name,
path):
'''
Register microscope files contained in `path` (Server side).
If `path` is a directory, upload all files contained in it.
Parameters
----------
plate_name: str
... | python | def register_microscope_files(self, plate_name, acquisition_name,
path):
'''
Register microscope files contained in `path` (Server side).
If `path` is a directory, upload all files contained in it.
Parameters
----------
plate_name: str
... | [
"def",
"register_microscope_files",
"(",
"self",
",",
"plate_name",
",",
"acquisition_name",
",",
"path",
")",
":",
"logger",
".",
"info",
"(",
"'register microscope files for experiment \"%s\", plate \"%s\" '",
"'and acquisition \"%s\"'",
",",
"self",
".",
"experiment_name... | Register microscope files contained in `path` (Server side).
If `path` is a directory, upload all files contained in it.
Parameters
----------
plate_name: str
name of the parent plate
acquisition_name: str
name of the parent acquisition
path: str
... | [
"Register",
"microscope",
"files",
"contained",
"in",
"path",
"(",
"Server",
"side",
")",
".",
"If",
"path",
"is",
"a",
"directory",
"upload",
"all",
"files",
"contained",
"in",
"it",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1251-L1289 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.rename_channel | def rename_channel(self, name, new_name):
'''Renames a channel.
Parameters
----------
name: str
name of the channel that should be renamed
new_name: str
name that should be given to the channel
See also
--------
:func:`tmserver.ap... | python | def rename_channel(self, name, new_name):
'''Renames a channel.
Parameters
----------
name: str
name of the channel that should be renamed
new_name: str
name that should be given to the channel
See also
--------
:func:`tmserver.ap... | [
"def",
"rename_channel",
"(",
"self",
",",
"name",
",",
"new_name",
")",
":",
"logger",
".",
"info",
"(",
"'rename channel \"%s\" of experiment \"%s\"'",
",",
"name",
",",
"self",
".",
"experiment_name",
")",
"channel_id",
"=",
"self",
".",
"_get_channel_id",
"(... | Renames a channel.
Parameters
----------
name: str
name of the channel that should be renamed
new_name: str
name that should be given to the channel
See also
--------
:func:`tmserver.api.channel.update_channel`
:class:`tmlib.model... | [
"Renames",
"a",
"channel",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1412-L1439 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.get_cycles | def get_cycles(self):
'''Gets cycles.
Returns
-------
List[Dict[str, str]]
information about each cycle
See also
--------
:func:`tmserver.api.cycle.get_cycles`
:class:`tmlib.models.cycles.Cycle`
'''
logger.info('get cycles of ... | python | def get_cycles(self):
'''Gets cycles.
Returns
-------
List[Dict[str, str]]
information about each cycle
See also
--------
:func:`tmserver.api.cycle.get_cycles`
:class:`tmlib.models.cycles.Cycle`
'''
logger.info('get cycles of ... | [
"def",
"get_cycles",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"'get cycles of experiment \"%s\"'",
",",
"self",
".",
"experiment_name",
")",
"url",
"=",
"self",
".",
"_build_api_url",
"(",
"'/experiments/{experiment_id}/cycles'",
".",
"format",
"(",
"exp... | Gets cycles.
Returns
-------
List[Dict[str, str]]
information about each cycle
See also
--------
:func:`tmserver.api.cycle.get_cycles`
:class:`tmlib.models.cycles.Cycle` | [
"Gets",
"cycles",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1441-L1462 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.download_channel_image | def download_channel_image(self, channel_name, plate_name,
well_name, well_pos_y, well_pos_x,
cycle_index=0, tpoint=0, zplane=0, correct=True, align =False):
'''Downloads a channel image.
Parameters
----------
channel_name: str
name of the channel
... | python | def download_channel_image(self, channel_name, plate_name,
well_name, well_pos_y, well_pos_x,
cycle_index=0, tpoint=0, zplane=0, correct=True, align =False):
'''Downloads a channel image.
Parameters
----------
channel_name: str
name of the channel
... | [
"def",
"download_channel_image",
"(",
"self",
",",
"channel_name",
",",
"plate_name",
",",
"well_name",
",",
"well_pos_y",
",",
"well_pos_x",
",",
"cycle_index",
"=",
"0",
",",
"tpoint",
"=",
"0",
",",
"zplane",
"=",
"0",
",",
"correct",
"=",
"True",
",",
... | Downloads a channel image.
Parameters
----------
channel_name: str
name of the channel
plate_name: str
name of the plate
well_name: str
name of the well
well_pos_x: int
zero-based x cooridinate of the acquisition site withi... | [
"Downloads",
"a",
"channel",
"image",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1496-L1543 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.download_channel_image_file | def download_channel_image_file(self, channel_name, plate_name,
well_name, well_pos_y, well_pos_x, cycle_index,
tpoint, zplane, correct, align, directory):
'''Downloads a channel image and writes it to a `PNG` file on disk.
Parameters
----------
channel_name: str... | python | def download_channel_image_file(self, channel_name, plate_name,
well_name, well_pos_y, well_pos_x, cycle_index,
tpoint, zplane, correct, align, directory):
'''Downloads a channel image and writes it to a `PNG` file on disk.
Parameters
----------
channel_name: str... | [
"def",
"download_channel_image_file",
"(",
"self",
",",
"channel_name",
",",
"plate_name",
",",
"well_name",
",",
"well_pos_y",
",",
"well_pos_x",
",",
"cycle_index",
",",
"tpoint",
",",
"zplane",
",",
"correct",
",",
"align",
",",
"directory",
")",
":",
"resp... | Downloads a channel image and writes it to a `PNG` file on disk.
Parameters
----------
channel_name: str
name of the channel
plate_name: str
name of the plate
well_name: str
name of the well
well_pos_x: int
zero-based x coo... | [
"Downloads",
"a",
"channel",
"image",
"and",
"writes",
"it",
"to",
"a",
"PNG",
"file",
"on",
"disk",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1545-L1590 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.download_segmentation_image | def download_segmentation_image(self, mapobject_type_name,
plate_name, well_name, well_pos_y, well_pos_x, tpoint=0, zplane=0, align = False):
'''Downloads a segmentation image.
Parameters
----------
plate_id: int
ID of the parent experiment
mapobject_type... | python | def download_segmentation_image(self, mapobject_type_name,
plate_name, well_name, well_pos_y, well_pos_x, tpoint=0, zplane=0, align = False):
'''Downloads a segmentation image.
Parameters
----------
plate_id: int
ID of the parent experiment
mapobject_type... | [
"def",
"download_segmentation_image",
"(",
"self",
",",
"mapobject_type_name",
",",
"plate_name",
",",
"well_name",
",",
"well_pos_y",
",",
"well_pos_x",
",",
"tpoint",
"=",
"0",
",",
"zplane",
"=",
"0",
",",
"align",
"=",
"False",
")",
":",
"response",
"=",... | Downloads a segmentation image.
Parameters
----------
plate_id: int
ID of the parent experiment
mapobject_type_name: str
name of the segmented objects
plate_name: str
name of the plate
well_name: str
name of the well in whi... | [
"Downloads",
"a",
"segmentation",
"image",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1621-L1660 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.download_segmentation_image_file | def download_segmentation_image_file(self, mapobject_type_name,
plate_name, well_name, well_pos_y, well_pos_x, tpoint, zplane, align,
directory):
'''Downloads a segmentation image and writes it to a *PNG* file on disk.
Parameters
----------
mapobject_type_name: s... | python | def download_segmentation_image_file(self, mapobject_type_name,
plate_name, well_name, well_pos_y, well_pos_x, tpoint, zplane, align,
directory):
'''Downloads a segmentation image and writes it to a *PNG* file on disk.
Parameters
----------
mapobject_type_name: s... | [
"def",
"download_segmentation_image_file",
"(",
"self",
",",
"mapobject_type_name",
",",
"plate_name",
",",
"well_name",
",",
"well_pos_y",
",",
"well_pos_x",
",",
"tpoint",
",",
"zplane",
",",
"align",
",",
"directory",
")",
":",
"response",
"=",
"self",
".",
... | Downloads a segmentation image and writes it to a *PNG* file on disk.
Parameters
----------
mapobject_type_name: str
name of the segmented objects
plate_name: str
name of the plate
well_name: str
name of the well in which the image is located
... | [
"Downloads",
"a",
"segmentation",
"image",
"and",
"writes",
"it",
"to",
"a",
"*",
"PNG",
"*",
"file",
"on",
"disk",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1662-L1712 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.upload_segmentation_image | def upload_segmentation_image(self, mapobject_type_name,
plate_name, well_name, well_pos_y, well_pos_x, tpoint, zplane,
image):
'''Uploads a segmentation image.
Parameters
----------
mapobject_type_name: str
name of the segmented objects
plate... | python | def upload_segmentation_image(self, mapobject_type_name,
plate_name, well_name, well_pos_y, well_pos_x, tpoint, zplane,
image):
'''Uploads a segmentation image.
Parameters
----------
mapobject_type_name: str
name of the segmented objects
plate... | [
"def",
"upload_segmentation_image",
"(",
"self",
",",
"mapobject_type_name",
",",
"plate_name",
",",
"well_name",
",",
"well_pos_y",
",",
"well_pos_x",
",",
"tpoint",
",",
"zplane",
",",
"image",
")",
":",
"if",
"not",
"isinstance",
"(",
"image",
",",
"np",
... | Uploads a segmentation image.
Parameters
----------
mapobject_type_name: str
name of the segmented objects
plate_name: str
name of the plate
well_name: str
name of the well in which the image is located
well_pos_y: int
y-po... | [
"Uploads",
"a",
"segmentation",
"image",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1751-L1794 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.upload_segmentation_image_file | def upload_segmentation_image_file(self, mapobject_type_name,
plate_name, well_name, well_pos_y, well_pos_x, tpoint, zplane,
filename):
'''Uploads segmentations from a *PNG* image file.
Parameters
----------
mapobject_type_name: str
name of the segmen... | python | def upload_segmentation_image_file(self, mapobject_type_name,
plate_name, well_name, well_pos_y, well_pos_x, tpoint, zplane,
filename):
'''Uploads segmentations from a *PNG* image file.
Parameters
----------
mapobject_type_name: str
name of the segmen... | [
"def",
"upload_segmentation_image_file",
"(",
"self",
",",
"mapobject_type_name",
",",
"plate_name",
",",
"well_name",
",",
"well_pos_y",
",",
"well_pos_x",
",",
"tpoint",
",",
"zplane",
",",
"filename",
")",
":",
"logger",
".",
"info",
"(",
"'upload segmentation ... | Uploads segmentations from a *PNG* image file.
Parameters
----------
mapobject_type_name: str
name of the segmented objects
plate_name: str
name of the plate
well_name: str
name of the well in which the image is located
well_pos_y: int... | [
"Uploads",
"segmentations",
"from",
"a",
"*",
"PNG",
"*",
"image",
"file",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1796-L1837 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.rename_feature | def rename_feature(self, mapobject_type_name, name, new_name):
'''Renames a feature.
Parameters
----------
mapobject_type_name: str
name of the segmented objects type
name: str
name of the feature that should be renamed
new_name: str
n... | python | def rename_feature(self, mapobject_type_name, name, new_name):
'''Renames a feature.
Parameters
----------
mapobject_type_name: str
name of the segmented objects type
name: str
name of the feature that should be renamed
new_name: str
n... | [
"def",
"rename_feature",
"(",
"self",
",",
"mapobject_type_name",
",",
"name",
",",
"new_name",
")",
":",
"logger",
".",
"info",
"(",
"'rename feature \"%s\" of experiment \"%s\", mapobject type \"%s\"'",
",",
"name",
",",
"self",
".",
"experiment_name",
",",
"mapobje... | Renames a feature.
Parameters
----------
mapobject_type_name: str
name of the segmented objects type
name: str
name of the feature that should be renamed
new_name: str
name that should be given to the feature
See also
--------... | [
"Renames",
"a",
"feature",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1839-L1870 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.delete_feature | def delete_feature(self, mapobject_type_name, name):
'''Deletes a feature.
Parameters
----------
mapobject_type_name: str
name of the segmented objects type
name: str
name of the feature that should be renamed
See also
--------
:f... | python | def delete_feature(self, mapobject_type_name, name):
'''Deletes a feature.
Parameters
----------
mapobject_type_name: str
name of the segmented objects type
name: str
name of the feature that should be renamed
See also
--------
:f... | [
"def",
"delete_feature",
"(",
"self",
",",
"mapobject_type_name",
",",
"name",
")",
":",
"logger",
".",
"info",
"(",
"'delete feature \"%s\" of experiment \"%s\", mapobject type \"%s\"'",
",",
"name",
",",
"self",
".",
"experiment_name",
",",
"mapobject_type_name",
")",... | Deletes a feature.
Parameters
----------
mapobject_type_name: str
name of the segmented objects type
name: str
name of the feature that should be renamed
See also
--------
:func:`tmserver.api.feature.delete_feature`
:class:`tmlib.... | [
"Deletes",
"a",
"feature",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1872-L1898 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.rename_mapobject_type | def rename_mapobject_type(self, name, new_name):
'''Renames a mapobject type.
Parameters
----------
name: str
name of the mapobject type that should be renamed
new_name: str
name that should be given to the mapobject type
See also
-------... | python | def rename_mapobject_type(self, name, new_name):
'''Renames a mapobject type.
Parameters
----------
name: str
name of the mapobject type that should be renamed
new_name: str
name that should be given to the mapobject type
See also
-------... | [
"def",
"rename_mapobject_type",
"(",
"self",
",",
"name",
",",
"new_name",
")",
":",
"logger",
".",
"info",
"(",
"'rename mapobject type \"%s\" of experiment \"%s\"'",
",",
"name",
",",
"self",
".",
"experiment_name",
")",
"content",
"=",
"{",
"'name'",
":",
"ne... | Renames a mapobject type.
Parameters
----------
name: str
name of the mapobject type that should be renamed
new_name: str
name that should be given to the mapobject type
See also
--------
:func:`tmserver.api.mapobject.update_mapobject_typ... | [
"Renames",
"a",
"mapobject",
"type",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1927-L1955 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.delete_mapobject_type | def delete_mapobject_type(self, name):
'''Deletes a mapobject type.
Parameters
----------
name: str
name of the mapobject type that should be renamed
See also
--------
:func:`tmserver.api.mapobject.delete_mapobject_type`
:class:`tmlib.models.... | python | def delete_mapobject_type(self, name):
'''Deletes a mapobject type.
Parameters
----------
name: str
name of the mapobject type that should be renamed
See also
--------
:func:`tmserver.api.mapobject.delete_mapobject_type`
:class:`tmlib.models.... | [
"def",
"delete_mapobject_type",
"(",
"self",
",",
"name",
")",
":",
"logger",
".",
"info",
"(",
"'delete mapobject type \"%s\" of experiment \"%s\"'",
",",
"name",
",",
"self",
".",
"experiment_name",
")",
"mapobject_type_id",
"=",
"self",
".",
"_get_mapobject_type_id... | Deletes a mapobject type.
Parameters
----------
name: str
name of the mapobject type that should be renamed
See also
--------
:func:`tmserver.api.mapobject.delete_mapobject_type`
:class:`tmlib.models.mapobject.MapobjectType` | [
"Deletes",
"a",
"mapobject",
"type",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L1957-L1982 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.get_features | def get_features(self, mapobject_type_name):
'''Gets features for a given object type.
Parameters
----------
mapobject_type_name: str
type of the segmented objects
Returns
-------
List[Dict[str, str]]
information about each feature
... | python | def get_features(self, mapobject_type_name):
'''Gets features for a given object type.
Parameters
----------
mapobject_type_name: str
type of the segmented objects
Returns
-------
List[Dict[str, str]]
information about each feature
... | [
"def",
"get_features",
"(",
"self",
",",
"mapobject_type_name",
")",
":",
"logger",
".",
"info",
"(",
"'get features of experiment \"%s\", object type \"%s\"'",
",",
"self",
".",
"experiment_name",
",",
"mapobject_type_name",
")",
"mapobject_type_id",
"=",
"self",
".",
... | Gets features for a given object type.
Parameters
----------
mapobject_type_name: str
type of the segmented objects
Returns
-------
List[Dict[str, str]]
information about each feature
See also
--------
:func:`tmserver.api... | [
"Gets",
"features",
"for",
"a",
"given",
"object",
"type",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2016-L2047 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.upload_feature_value_file | def upload_feature_value_file(self, mapobject_type_name, plate_name,
well_name, well_pos_y, well_pos_x, tpoint, filename, index_col):
'''Uploads feature values for the given
:class:`MapobjectType <tmlib.models.mapobject.MapobjectType>` at the
specified :class:`Site <tmlib.models.site... | python | def upload_feature_value_file(self, mapobject_type_name, plate_name,
well_name, well_pos_y, well_pos_x, tpoint, filename, index_col):
'''Uploads feature values for the given
:class:`MapobjectType <tmlib.models.mapobject.MapobjectType>` at the
specified :class:`Site <tmlib.models.site... | [
"def",
"upload_feature_value_file",
"(",
"self",
",",
"mapobject_type_name",
",",
"plate_name",
",",
"well_name",
",",
"well_pos_y",
",",
"well_pos_x",
",",
"tpoint",
",",
"filename",
",",
"index_col",
")",
":",
"logger",
".",
"info",
"(",
"'upload feature value f... | Uploads feature values for the given
:class:`MapobjectType <tmlib.models.mapobject.MapobjectType>` at the
specified :class:`Site <tmlib.models.site.Site>`.
Parameters
----------
mapobject_type_name: str
type of the segmented objects
plate_name: str
... | [
"Uploads",
"feature",
"values",
"for",
"the",
"given",
":",
"class",
":",
"MapobjectType",
"<tmlib",
".",
"models",
".",
"mapobject",
".",
"MapobjectType",
">",
"at",
"the",
"specified",
":",
"class",
":",
"Site",
"<tmlib",
".",
"models",
".",
"site",
".",... | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2114-L2152 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.download_feature_values | def download_feature_values(self, mapobject_type_name,
plate_name=None, well_name=None, well_pos_y=None, well_pos_x=None,
tpoint=None):
'''Downloads feature values for the given
:class:`MapobjectType <tmlib.models.mapobject.MapobjectType>`.
Parameters
----------
... | python | def download_feature_values(self, mapobject_type_name,
plate_name=None, well_name=None, well_pos_y=None, well_pos_x=None,
tpoint=None):
'''Downloads feature values for the given
:class:`MapobjectType <tmlib.models.mapobject.MapobjectType>`.
Parameters
----------
... | [
"def",
"download_feature_values",
"(",
"self",
",",
"mapobject_type_name",
",",
"plate_name",
"=",
"None",
",",
"well_name",
"=",
"None",
",",
"well_pos_y",
"=",
"None",
",",
"well_pos_x",
"=",
"None",
",",
"tpoint",
"=",
"None",
")",
":",
"res",
"=",
"sel... | Downloads feature values for the given
:class:`MapobjectType <tmlib.models.mapobject.MapobjectType>`.
Parameters
----------
mapobject_type_name: str
type of the segmented objects
plate_name: str, optional
name of the plate
well_name: str, optional... | [
"Downloads",
"feature",
"values",
"for",
"the",
"given",
":",
"class",
":",
"MapobjectType",
"<tmlib",
".",
"models",
".",
"mapobject",
".",
"MapobjectType",
">",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2155-L2201 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.download_feature_values_and_metadata_files | def download_feature_values_and_metadata_files(self, mapobject_type_name,
directory, parallel=1):
'''Downloads all feature values for the given object type and stores the
data as *CSV* files on disk.
Parameters
----------
mapobj... | python | def download_feature_values_and_metadata_files(self, mapobject_type_name,
directory, parallel=1):
'''Downloads all feature values for the given object type and stores the
data as *CSV* files on disk.
Parameters
----------
mapobj... | [
"def",
"download_feature_values_and_metadata_files",
"(",
"self",
",",
"mapobject_type_name",
",",
"directory",
",",
"parallel",
"=",
"1",
")",
":",
"def",
"download_per_well",
"(",
"well",
")",
":",
"logger",
".",
"info",
"(",
"'download feature data at well: plate=%... | Downloads all feature values for the given object type and stores the
data as *CSV* files on disk.
Parameters
----------
mapobject_type_name: str
type of the segmented objects
directory: str
absolute path to the directory on disk where the file should be
... | [
"Downloads",
"all",
"feature",
"values",
"for",
"the",
"given",
"object",
"type",
"and",
"stores",
"the",
"data",
"as",
"*",
"CSV",
"*",
"files",
"on",
"disk",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2203-L2253 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.download_object_metadata | def download_object_metadata(self, mapobject_type_name, plate_name=None,
well_name=None, well_pos_y=None, well_pos_x=None, tpoint=None):
'''Downloads metadata for the given object type, which describes the
position of each segmented object on the map.
Parameters
----------
... | python | def download_object_metadata(self, mapobject_type_name, plate_name=None,
well_name=None, well_pos_y=None, well_pos_x=None, tpoint=None):
'''Downloads metadata for the given object type, which describes the
position of each segmented object on the map.
Parameters
----------
... | [
"def",
"download_object_metadata",
"(",
"self",
",",
"mapobject_type_name",
",",
"plate_name",
"=",
"None",
",",
"well_name",
"=",
"None",
",",
"well_pos_y",
"=",
"None",
",",
"well_pos_x",
"=",
"None",
",",
"tpoint",
"=",
"None",
")",
":",
"res",
"=",
"se... | Downloads metadata for the given object type, which describes the
position of each segmented object on the map.
Parameters
----------
mapobject_type_name: str
type of the segmented objects
plate_name: str, optional
name of the plate
well_name: str... | [
"Downloads",
"metadata",
"for",
"the",
"given",
"object",
"type",
"which",
"describes",
"the",
"position",
"of",
"each",
"segmented",
"object",
"on",
"the",
"map",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2286-L2324 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.download_workflow_description_file | def download_workflow_description_file(self, filename):
'''Downloads the workflow description and writes it to a *YAML* file.
Parameters
----------
filename: str
path to the file to which description should be written
See also
--------
:meth:`tmclien... | python | def download_workflow_description_file(self, filename):
'''Downloads the workflow description and writes it to a *YAML* file.
Parameters
----------
filename: str
path to the file to which description should be written
See also
--------
:meth:`tmclien... | [
"def",
"download_workflow_description_file",
"(",
"self",
",",
"filename",
")",
":",
"description",
"=",
"self",
".",
"download_workflow_description",
"(",
")",
"logger",
".",
"info",
"(",
"'write workflow description to file: %s'",
",",
"filename",
")",
"with",
"open... | Downloads the workflow description and writes it to a *YAML* file.
Parameters
----------
filename: str
path to the file to which description should be written
See also
--------
:meth:`tmclient.api.TmClient.download_workflow_description` | [
"Downloads",
"the",
"workflow",
"description",
"and",
"writes",
"it",
"to",
"a",
"*",
"YAML",
"*",
"file",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2353-L2371 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.upload_workflow_description_file | def upload_workflow_description_file(self, filename):
'''Uploads workflow description from a *YAML* file.
Parameters
----------
filename: str
path to the file from which description should be read
See also
--------
:meth:`tmclient.api.TmClient.upload... | python | def upload_workflow_description_file(self, filename):
'''Uploads workflow description from a *YAML* file.
Parameters
----------
filename: str
path to the file from which description should be read
See also
--------
:meth:`tmclient.api.TmClient.upload... | [
"def",
"upload_workflow_description_file",
"(",
"self",
",",
"filename",
")",
":",
"if",
"(",
"not",
"filename",
".",
"lower",
"(",
")",
".",
"endswith",
"(",
"'yml'",
")",
"and",
"not",
"filename",
".",
"lower",
"(",
")",
".",
"endswith",
"(",
"'yaml'",... | Uploads workflow description from a *YAML* file.
Parameters
----------
filename: str
path to the file from which description should be read
See also
--------
:meth:`tmclient.api.TmClient.upload_workflow_description` | [
"Uploads",
"workflow",
"description",
"from",
"a",
"*",
"YAML",
"*",
"file",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2399-L2419 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.resubmit_workflow | def resubmit_workflow(self, stage_name=None, description=None):
'''Resubmits the workflow.
Parameters
----------
stage_name: str, optional
name of the stage at which workflow should be resubmitted
(when omitted workflow will be restarted from the beginning)
... | python | def resubmit_workflow(self, stage_name=None, description=None):
'''Resubmits the workflow.
Parameters
----------
stage_name: str, optional
name of the stage at which workflow should be resubmitted
(when omitted workflow will be restarted from the beginning)
... | [
"def",
"resubmit_workflow",
"(",
"self",
",",
"stage_name",
"=",
"None",
",",
"description",
"=",
"None",
")",
":",
"logger",
".",
"info",
"(",
"'resubmit workflow of experiment \"%s\"'",
",",
"self",
".",
"experiment_name",
")",
"content",
"=",
"dict",
"(",
"... | Resubmits the workflow.
Parameters
----------
stage_name: str, optional
name of the stage at which workflow should be resubmitted
(when omitted workflow will be restarted from the beginning)
description: dict, optional
workflow description
Se... | [
"Resubmits",
"the",
"workflow",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2446-L2476 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.kill_workflow | def kill_workflow(self):
'''Kills the workflow.
See also
--------
:func:`tmserver.api.workflow.kill_workflow`
:class:`tmlib.workflow.workflow.Workflow`
'''
logger.info('kill workflow of experiment "%s"', self.experiment_name)
content = dict()
url ... | python | def kill_workflow(self):
'''Kills the workflow.
See also
--------
:func:`tmserver.api.workflow.kill_workflow`
:class:`tmlib.workflow.workflow.Workflow`
'''
logger.info('kill workflow of experiment "%s"', self.experiment_name)
content = dict()
url ... | [
"def",
"kill_workflow",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"'kill workflow of experiment \"%s\"'",
",",
"self",
".",
"experiment_name",
")",
"content",
"=",
"dict",
"(",
")",
"url",
"=",
"self",
".",
"_build_api_url",
"(",
"'/experiments/{experim... | Kills the workflow.
See also
--------
:func:`tmserver.api.workflow.kill_workflow`
:class:`tmlib.workflow.workflow.Workflow` | [
"Kills",
"the",
"workflow",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2478-L2494 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.get_workflow_status | def get_workflow_status(self, depth=2):
'''Gets the workflow status.
Parameters
----------
depth: int, optional
query depth - in which detail status of subtasks will be queried
Returns
-------
dict
status information about the workflow
... | python | def get_workflow_status(self, depth=2):
'''Gets the workflow status.
Parameters
----------
depth: int, optional
query depth - in which detail status of subtasks will be queried
Returns
-------
dict
status information about the workflow
... | [
"def",
"get_workflow_status",
"(",
"self",
",",
"depth",
"=",
"2",
")",
":",
"logger",
".",
"info",
"(",
"'get status for workflow of experiment \"%s\"'",
",",
"self",
".",
"experiment_name",
")",
"params",
"=",
"{",
"'depth'",
":",
"depth",
"}",
"url",
"=",
... | Gets the workflow status.
Parameters
----------
depth: int, optional
query depth - in which detail status of subtasks will be queried
Returns
-------
dict
status information about the workflow
See also
--------
:func:`tms... | [
"Gets",
"the",
"workflow",
"status",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2496-L2527 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.upload_jterator_project | def upload_jterator_project(self, pipeline, handles):
'''Uploads a *jterator* project.
Parameters
----------
pipeline: dict
description of the jterator pipeline
handles: dict, optional
description of each module in the jterator pipeline
See also
... | python | def upload_jterator_project(self, pipeline, handles):
'''Uploads a *jterator* project.
Parameters
----------
pipeline: dict
description of the jterator pipeline
handles: dict, optional
description of each module in the jterator pipeline
See also
... | [
"def",
"upload_jterator_project",
"(",
"self",
",",
"pipeline",
",",
"handles",
")",
":",
"logger",
".",
"info",
"(",
"'upload jterator project for experiment \"%s\"'",
",",
"self",
".",
"experiment_name",
")",
"content",
"=",
"{",
"'pipeline'",
":",
"pipeline",
"... | Uploads a *jterator* project.
Parameters
----------
pipeline: dict
description of the jterator pipeline
handles: dict, optional
description of each module in the jterator pipeline
See also
--------
:func:`tmserver.api.workflow.update_jter... | [
"Uploads",
"a",
"*",
"jterator",
"*",
"project",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2642-L2671 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.download_jterator_project_files | def download_jterator_project_files(self, directory):
'''Downloads the *jterator* project and stores it
on disk in YAML format. The pipeline description will be stored
in a ``pipeline.yaml`` file in `directory` and each handle description
will be stored in a ``*handles.yaml`` file and pl... | python | def download_jterator_project_files(self, directory):
'''Downloads the *jterator* project and stores it
on disk in YAML format. The pipeline description will be stored
in a ``pipeline.yaml`` file in `directory` and each handle description
will be stored in a ``*handles.yaml`` file and pl... | [
"def",
"download_jterator_project_files",
"(",
"self",
",",
"directory",
")",
":",
"descriptions",
"=",
"self",
".",
"download_jterator_project",
"(",
")",
"directory",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"os",
".",
"path",
".",
"expandvars",
"(",
... | Downloads the *jterator* project and stores it
on disk in YAML format. The pipeline description will be stored
in a ``pipeline.yaml`` file in `directory` and each handle description
will be stored in a ``*handles.yaml`` file and placed into a ``handles``
subfolder of `directory`.
... | [
"Downloads",
"the",
"*",
"jterator",
"*",
"project",
"and",
"stores",
"it",
"on",
"disk",
"in",
"YAML",
"format",
".",
"The",
"pipeline",
"description",
"will",
"be",
"stored",
"in",
"a",
"pipeline",
".",
"yaml",
"file",
"in",
"directory",
"and",
"each",
... | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2673-L2723 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.upload_jterator_project_files | def upload_jterator_project_files(self, directory):
'''Uploads the *jterator* project description from files on disk in
YAML format. It expects a ``pipeline.yaml`` file in `directory` and
optionally ``*handles.yaml`` files in a ``handles`` subfolder of
`directory`.
Parameters
... | python | def upload_jterator_project_files(self, directory):
'''Uploads the *jterator* project description from files on disk in
YAML format. It expects a ``pipeline.yaml`` file in `directory` and
optionally ``*handles.yaml`` files in a ``handles`` subfolder of
`directory`.
Parameters
... | [
"def",
"upload_jterator_project_files",
"(",
"self",
",",
"directory",
")",
":",
"logger",
".",
"info",
"(",
"'load jterator project description from directory: %s'",
",",
"directory",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"directory",
")",
":",... | Uploads the *jterator* project description from files on disk in
YAML format. It expects a ``pipeline.yaml`` file in `directory` and
optionally ``*handles.yaml`` files in a ``handles`` subfolder of
`directory`.
Parameters
----------
directory: str
path to the... | [
"Uploads",
"the",
"*",
"jterator",
"*",
"project",
"description",
"from",
"files",
"on",
"disk",
"in",
"YAML",
"format",
".",
"It",
"expects",
"a",
"pipeline",
".",
"yaml",
"file",
"in",
"directory",
"and",
"optionally",
"*",
"handles",
".",
"yaml",
"files... | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2725-L2776 |
TissueMAPS/TmClient | src/python/tmclient/api.py | TmClient.get_tools_status | def get_tools_status(self, tool_name=None):
'''Gets the status of tool jobs.
Parameters
----------
tool_name: str, optional
filter jobs by tool name
Returns
-------
dict
status information about tool jobs
See also
-------... | python | def get_tools_status(self, tool_name=None):
'''Gets the status of tool jobs.
Parameters
----------
tool_name: str, optional
filter jobs by tool name
Returns
-------
dict
status information about tool jobs
See also
-------... | [
"def",
"get_tools_status",
"(",
"self",
",",
"tool_name",
"=",
"None",
")",
":",
"logger",
".",
"info",
"(",
"'get status for tools of experiment \"%s\"'",
",",
"self",
".",
"experiment_name",
")",
"params",
"=",
"dict",
"(",
")",
"if",
"tool_name",
"is",
"not... | Gets the status of tool jobs.
Parameters
----------
tool_name: str, optional
filter jobs by tool name
Returns
-------
dict
status information about tool jobs
See also
--------
:func:`tmserver.api.tools.get_tools_status`
... | [
"Gets",
"the",
"status",
"of",
"tool",
"jobs",
"."
] | train | https://github.com/TissueMAPS/TmClient/blob/6fb40622af19142cb5169a64b8c2965993a25ab1/src/python/tmclient/api.py#L2835-L2868 |
heuer/cablemap | examples/convertberlincablestocsv.py | generate_csv | def generate_csv(path, out):
"""\
Walks through the `path` and generates the CSV file `out`
"""
def is_berlin_cable(filename):
return 'BERLIN' in filename
writer = UnicodeWriter(open(out, 'wb'), delimiter=';')
writer.writerow(('Reference ID', 'Created', 'Origin', 'Subject'))
for cabl... | python | def generate_csv(path, out):
"""\
Walks through the `path` and generates the CSV file `out`
"""
def is_berlin_cable(filename):
return 'BERLIN' in filename
writer = UnicodeWriter(open(out, 'wb'), delimiter=';')
writer.writerow(('Reference ID', 'Created', 'Origin', 'Subject'))
for cabl... | [
"def",
"generate_csv",
"(",
"path",
",",
"out",
")",
":",
"def",
"is_berlin_cable",
"(",
"filename",
")",
":",
"return",
"'BERLIN'",
"in",
"filename",
"writer",
"=",
"UnicodeWriter",
"(",
"open",
"(",
"out",
",",
"'wb'",
")",
",",
"delimiter",
"=",
"';'"... | \
Walks through the `path` and generates the CSV file `out` | [
"\\",
"Walks",
"through",
"the",
"path",
"and",
"generates",
"the",
"CSV",
"file",
"out"
] | train | https://github.com/heuer/cablemap/blob/42066c8fc2972d237a2c35578e14525aaf705f38/examples/convertberlincablestocsv.py#L50-L59 |
basilfx/flask-daapserver | daapserver/__init__.py | DaapServer.serve_forever | def serve_forever(self):
"""
Run the DAAP server. Start by advertising the server via Bonjour. Then
serve requests until CTRL + C is received.
"""
# Verify that the provider has a server.
if self.provider.server is None:
raise ValueError(
"Can... | python | def serve_forever(self):
"""
Run the DAAP server. Start by advertising the server via Bonjour. Then
serve requests until CTRL + C is received.
"""
# Verify that the provider has a server.
if self.provider.server is None:
raise ValueError(
"Can... | [
"def",
"serve_forever",
"(",
"self",
")",
":",
"# Verify that the provider has a server.",
"if",
"self",
".",
"provider",
".",
"server",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Cannot start server because the provider has no server to \"",
"\"publish.\"",
")",
"... | Run the DAAP server. Start by advertising the server via Bonjour. Then
serve requests until CTRL + C is received. | [
"Run",
"the",
"DAAP",
"server",
".",
"Start",
"by",
"advertising",
"the",
"server",
"via",
"Bonjour",
".",
"Then",
"serve",
"requests",
"until",
"CTRL",
"+",
"C",
"is",
"received",
"."
] | train | https://github.com/basilfx/flask-daapserver/blob/ca595fcbc5b657cba826eccd3be5cebba0a1db0e/daapserver/__init__.py#L37-L70 |
quantmind/pulsar-odm | odm/mapper.py | model_base | def model_base(bind_label=None, info=None):
"""Create a base declarative class
"""
Model = type('Model', (BaseModel,), {'__odm_abstract__': True})
info = {}
Model.__table_args__ = table_args(info=info)
if bind_label:
info['bind_label'] = bind_label
return Model | python | def model_base(bind_label=None, info=None):
"""Create a base declarative class
"""
Model = type('Model', (BaseModel,), {'__odm_abstract__': True})
info = {}
Model.__table_args__ = table_args(info=info)
if bind_label:
info['bind_label'] = bind_label
return Model | [
"def",
"model_base",
"(",
"bind_label",
"=",
"None",
",",
"info",
"=",
"None",
")",
":",
"Model",
"=",
"type",
"(",
"'Model'",
",",
"(",
"BaseModel",
",",
")",
",",
"{",
"'__odm_abstract__'",
":",
"True",
"}",
")",
"info",
"=",
"{",
"}",
"Model",
"... | Create a base declarative class | [
"Create",
"a",
"base",
"declarative",
"class"
] | train | https://github.com/quantmind/pulsar-odm/blob/5955c20beca0a89270c2b390335838deb7d5915e/odm/mapper.py#L114-L122 |
quantmind/pulsar-odm | odm/mapper.py | copy_models | def copy_models(module_from, module_to):
"""Copy models from one module to another
:param module_from:
:param module_to:
:return:
"""
module_from = get_module(module_from)
module_to = get_module(module_to)
models = get_models(module_from)
if models:
models = models.copy()
... | python | def copy_models(module_from, module_to):
"""Copy models from one module to another
:param module_from:
:param module_to:
:return:
"""
module_from = get_module(module_from)
module_to = get_module(module_to)
models = get_models(module_from)
if models:
models = models.copy()
... | [
"def",
"copy_models",
"(",
"module_from",
",",
"module_to",
")",
":",
"module_from",
"=",
"get_module",
"(",
"module_from",
")",
"module_to",
"=",
"get_module",
"(",
"module_to",
")",
"models",
"=",
"get_models",
"(",
"module_from",
")",
"if",
"models",
":",
... | Copy models from one module to another
:param module_from:
:param module_to:
:return: | [
"Copy",
"models",
"from",
"one",
"module",
"to",
"another",
":",
"param",
"module_from",
":",
":",
"param",
"module_to",
":",
":",
"return",
":"
] | train | https://github.com/quantmind/pulsar-odm/blob/5955c20beca0a89270c2b390335838deb7d5915e/odm/mapper.py#L131-L144 |
quantmind/pulsar-odm | odm/mapper.py | Mapper.register | def register(self, model, **attr):
"""Register a model or a table with this mapper
:param model: a table or a :class:`.BaseModel` class
:return: a Model class or a table
"""
metadata = self.metadata
if not isinstance(model, Table):
model_name = self._create_m... | python | def register(self, model, **attr):
"""Register a model or a table with this mapper
:param model: a table or a :class:`.BaseModel` class
:return: a Model class or a table
"""
metadata = self.metadata
if not isinstance(model, Table):
model_name = self._create_m... | [
"def",
"register",
"(",
"self",
",",
"model",
",",
"*",
"*",
"attr",
")",
":",
"metadata",
"=",
"self",
".",
"metadata",
"if",
"not",
"isinstance",
"(",
"model",
",",
"Table",
")",
":",
"model_name",
"=",
"self",
".",
"_create_model",
"(",
"model",
"... | Register a model or a table with this mapper
:param model: a table or a :class:`.BaseModel` class
:return: a Model class or a table | [
"Register",
"a",
"model",
"or",
"a",
"table",
"with",
"this",
"mapper"
] | train | https://github.com/quantmind/pulsar-odm/blob/5955c20beca0a89270c2b390335838deb7d5915e/odm/mapper.py#L223-L259 |
quantmind/pulsar-odm | odm/mapper.py | Mapper.create_table | def create_table(self, name, *columns, **kwargs):
"""Create a new table with the same metadata and info
"""
targs = table_args(**kwargs)
args, kwargs = targs[:-1], targs[-1]
return Table(name, self.metadata, *columns, *args, **kwargs) | python | def create_table(self, name, *columns, **kwargs):
"""Create a new table with the same metadata and info
"""
targs = table_args(**kwargs)
args, kwargs = targs[:-1], targs[-1]
return Table(name, self.metadata, *columns, *args, **kwargs) | [
"def",
"create_table",
"(",
"self",
",",
"name",
",",
"*",
"columns",
",",
"*",
"*",
"kwargs",
")",
":",
"targs",
"=",
"table_args",
"(",
"*",
"*",
"kwargs",
")",
"args",
",",
"kwargs",
"=",
"targs",
"[",
":",
"-",
"1",
"]",
",",
"targs",
"[",
... | Create a new table with the same metadata and info | [
"Create",
"a",
"new",
"table",
"with",
"the",
"same",
"metadata",
"and",
"info"
] | train | https://github.com/quantmind/pulsar-odm/blob/5955c20beca0a89270c2b390335838deb7d5915e/odm/mapper.py#L274-L279 |
quantmind/pulsar-odm | odm/mapper.py | Mapper.database_create | def database_create(self, database, **params):
"""Create databases for each engine and return a new :class:`.Mapper`.
"""
binds = {}
dbname = database
for key, engine in self.keys_engines():
if hasattr(database, '__call__'):
dbname = database(engine)
... | python | def database_create(self, database, **params):
"""Create databases for each engine and return a new :class:`.Mapper`.
"""
binds = {}
dbname = database
for key, engine in self.keys_engines():
if hasattr(database, '__call__'):
dbname = database(engine)
... | [
"def",
"database_create",
"(",
"self",
",",
"database",
",",
"*",
"*",
"params",
")",
":",
"binds",
"=",
"{",
"}",
"dbname",
"=",
"database",
"for",
"key",
",",
"engine",
"in",
"self",
".",
"keys_engines",
"(",
")",
":",
"if",
"hasattr",
"(",
"databa... | Create databases for each engine and return a new :class:`.Mapper`. | [
"Create",
"databases",
"for",
"each",
"engine",
"and",
"return",
"a",
"new",
":",
"class",
":",
".",
"Mapper",
"."
] | train | https://github.com/quantmind/pulsar-odm/blob/5955c20beca0a89270c2b390335838deb7d5915e/odm/mapper.py#L281-L292 |
quantmind/pulsar-odm | odm/mapper.py | Mapper.database_exist | def database_exist(self):
"""Create databases for each engine and return a new :class:`.Mapper`.
"""
binds = {}
for key, engine in self.keys_engines():
key = key if key else 'default'
binds[key] = self._database_exist(engine)
return binds | python | def database_exist(self):
"""Create databases for each engine and return a new :class:`.Mapper`.
"""
binds = {}
for key, engine in self.keys_engines():
key = key if key else 'default'
binds[key] = self._database_exist(engine)
return binds | [
"def",
"database_exist",
"(",
"self",
")",
":",
"binds",
"=",
"{",
"}",
"for",
"key",
",",
"engine",
"in",
"self",
".",
"keys_engines",
"(",
")",
":",
"key",
"=",
"key",
"if",
"key",
"else",
"'default'",
"binds",
"[",
"key",
"]",
"=",
"self",
".",
... | Create databases for each engine and return a new :class:`.Mapper`. | [
"Create",
"databases",
"for",
"each",
"engine",
"and",
"return",
"a",
"new",
":",
"class",
":",
".",
"Mapper",
"."
] | train | https://github.com/quantmind/pulsar-odm/blob/5955c20beca0a89270c2b390335838deb7d5915e/odm/mapper.py#L294-L301 |
quantmind/pulsar-odm | odm/mapper.py | Mapper.database_all | def database_all(self):
"""Return a dictionary mapping engines with databases
"""
all = {}
for engine in self.engines():
all[engine] = self._database_all(engine)
return all | python | def database_all(self):
"""Return a dictionary mapping engines with databases
"""
all = {}
for engine in self.engines():
all[engine] = self._database_all(engine)
return all | [
"def",
"database_all",
"(",
"self",
")",
":",
"all",
"=",
"{",
"}",
"for",
"engine",
"in",
"self",
".",
"engines",
"(",
")",
":",
"all",
"[",
"engine",
"]",
"=",
"self",
".",
"_database_all",
"(",
"engine",
")",
"return",
"all"
] | Return a dictionary mapping engines with databases | [
"Return",
"a",
"dictionary",
"mapping",
"engines",
"with",
"databases"
] | train | https://github.com/quantmind/pulsar-odm/blob/5955c20beca0a89270c2b390335838deb7d5915e/odm/mapper.py#L303-L309 |
quantmind/pulsar-odm | odm/mapper.py | Mapper.table_create | def table_create(self, remove_existing=False):
"""Creates all tables.
"""
for engine in self.engines():
tables = self._get_tables(engine, create_drop=True)
logger.info('Create all tables for %s', engine)
try:
self.metadata.create_all(engine, ta... | python | def table_create(self, remove_existing=False):
"""Creates all tables.
"""
for engine in self.engines():
tables = self._get_tables(engine, create_drop=True)
logger.info('Create all tables for %s', engine)
try:
self.metadata.create_all(engine, ta... | [
"def",
"table_create",
"(",
"self",
",",
"remove_existing",
"=",
"False",
")",
":",
"for",
"engine",
"in",
"self",
".",
"engines",
"(",
")",
":",
"tables",
"=",
"self",
".",
"_get_tables",
"(",
"engine",
",",
"create_drop",
"=",
"True",
")",
"logger",
... | Creates all tables. | [
"Creates",
"all",
"tables",
"."
] | train | https://github.com/quantmind/pulsar-odm/blob/5955c20beca0a89270c2b390335838deb7d5915e/odm/mapper.py#L327-L336 |
quantmind/pulsar-odm | odm/mapper.py | Mapper.table_drop | def table_drop(self):
"""Drops all tables.
"""
for engine in self.engines():
tables = self._get_tables(engine, create_drop=True)
logger.info('Drop all tables for %s', engine)
self.metadata.drop_all(engine, tables=tables) | python | def table_drop(self):
"""Drops all tables.
"""
for engine in self.engines():
tables = self._get_tables(engine, create_drop=True)
logger.info('Drop all tables for %s', engine)
self.metadata.drop_all(engine, tables=tables) | [
"def",
"table_drop",
"(",
"self",
")",
":",
"for",
"engine",
"in",
"self",
".",
"engines",
"(",
")",
":",
"tables",
"=",
"self",
".",
"_get_tables",
"(",
"engine",
",",
"create_drop",
"=",
"True",
")",
"logger",
".",
"info",
"(",
"'Drop all tables for %s... | Drops all tables. | [
"Drops",
"all",
"tables",
"."
] | train | https://github.com/quantmind/pulsar-odm/blob/5955c20beca0a89270c2b390335838deb7d5915e/odm/mapper.py#L338-L344 |
quantmind/pulsar-odm | odm/mapper.py | Mapper.begin | def begin(self, close=True, expire_on_commit=False, session=None,
commit=False, **options):
"""Provide a transactional scope around a series of operations.
By default, ``expire_on_commit`` is set to False so that instances
can be used outside the session.
"""
if no... | python | def begin(self, close=True, expire_on_commit=False, session=None,
commit=False, **options):
"""Provide a transactional scope around a series of operations.
By default, ``expire_on_commit`` is set to False so that instances
can be used outside the session.
"""
if no... | [
"def",
"begin",
"(",
"self",
",",
"close",
"=",
"True",
",",
"expire_on_commit",
"=",
"False",
",",
"session",
"=",
"None",
",",
"commit",
"=",
"False",
",",
"*",
"*",
"options",
")",
":",
"if",
"not",
"session",
":",
"commit",
"=",
"True",
"session"... | Provide a transactional scope around a series of operations.
By default, ``expire_on_commit`` is set to False so that instances
can be used outside the session. | [
"Provide",
"a",
"transactional",
"scope",
"around",
"a",
"series",
"of",
"operations",
"."
] | train | https://github.com/quantmind/pulsar-odm/blob/5955c20beca0a89270c2b390335838deb7d5915e/odm/mapper.py#L347-L369 |
quantmind/pulsar-odm | odm/mapper.py | Mapper._database_create | def _database_create(self, engine, database):
"""Create a new database and return a new url representing
a connection to the new database
"""
logger.info('Creating database "%s" in "%s"', database, engine)
database_operation(engine, 'create', database)
url = copy(engine.u... | python | def _database_create(self, engine, database):
"""Create a new database and return a new url representing
a connection to the new database
"""
logger.info('Creating database "%s" in "%s"', database, engine)
database_operation(engine, 'create', database)
url = copy(engine.u... | [
"def",
"_database_create",
"(",
"self",
",",
"engine",
",",
"database",
")",
":",
"logger",
".",
"info",
"(",
"'Creating database \"%s\" in \"%s\"'",
",",
"database",
",",
"engine",
")",
"database_operation",
"(",
"engine",
",",
"'create'",
",",
"database",
")",... | Create a new database and return a new url representing
a connection to the new database | [
"Create",
"a",
"new",
"database",
"and",
"return",
"a",
"new",
"url",
"representing",
"a",
"connection",
"to",
"the",
"new",
"database"
] | train | https://github.com/quantmind/pulsar-odm/blob/5955c20beca0a89270c2b390335838deb7d5915e/odm/mapper.py#L459-L467 |
inveniosoftware-contrib/invenio-classifier | invenio_classifier/normalizer.py | get_washing_regex | def get_washing_regex():
"""Return a washing regex list."""
global _washing_regex
if len(_washing_regex):
return _washing_regex
washing_regex = [
# Replace non and anti with non- and anti-. This allows a better
# detection of keywords such as nonabelian.
(re.compile(r"(\... | python | def get_washing_regex():
"""Return a washing regex list."""
global _washing_regex
if len(_washing_regex):
return _washing_regex
washing_regex = [
# Replace non and anti with non- and anti-. This allows a better
# detection of keywords such as nonabelian.
(re.compile(r"(\... | [
"def",
"get_washing_regex",
"(",
")",
":",
"global",
"_washing_regex",
"if",
"len",
"(",
"_washing_regex",
")",
":",
"return",
"_washing_regex",
"washing_regex",
"=",
"[",
"# Replace non and anti with non- and anti-. This allows a better",
"# detection of keywords such as nonab... | Return a washing regex list. | [
"Return",
"a",
"washing",
"regex",
"list",
"."
] | train | https://github.com/inveniosoftware-contrib/invenio-classifier/blob/3c758cf34dca6bf0548e7da5de34e5f72e3b255e/invenio_classifier/normalizer.py#L40-L105 |
inveniosoftware-contrib/invenio-classifier | invenio_classifier/normalizer.py | normalize_fulltext | def normalize_fulltext(fulltext):
"""Return a 'cleaned' version of the output provided by pdftotext."""
# We recognize keywords by the spaces. We need these to match the
# first and last words of the document.
fulltext = " " + fulltext + " "
# Replace some weird unicode characters.
fulltext = r... | python | def normalize_fulltext(fulltext):
"""Return a 'cleaned' version of the output provided by pdftotext."""
# We recognize keywords by the spaces. We need these to match the
# first and last words of the document.
fulltext = " " + fulltext + " "
# Replace some weird unicode characters.
fulltext = r... | [
"def",
"normalize_fulltext",
"(",
"fulltext",
")",
":",
"# We recognize keywords by the spaces. We need these to match the",
"# first and last words of the document.",
"fulltext",
"=",
"\" \"",
"+",
"fulltext",
"+",
"\" \"",
"# Replace some weird unicode characters.",
"fulltext",
"... | Return a 'cleaned' version of the output provided by pdftotext. | [
"Return",
"a",
"cleaned",
"version",
"of",
"the",
"output",
"provided",
"by",
"pdftotext",
"."
] | train | https://github.com/inveniosoftware-contrib/invenio-classifier/blob/3c758cf34dca6bf0548e7da5de34e5f72e3b255e/invenio_classifier/normalizer.py#L108-L125 |
inveniosoftware-contrib/invenio-classifier | invenio_classifier/normalizer.py | cut_references | def cut_references(text_lines):
"""Return the text lines with the references cut."""
ref_sect_start = find_reference_section(text_lines)
if ref_sect_start is not None:
start = ref_sect_start["start_line"]
end = find_end_of_reference_section(text_lines, start,
... | python | def cut_references(text_lines):
"""Return the text lines with the references cut."""
ref_sect_start = find_reference_section(text_lines)
if ref_sect_start is not None:
start = ref_sect_start["start_line"]
end = find_end_of_reference_section(text_lines, start,
... | [
"def",
"cut_references",
"(",
"text_lines",
")",
":",
"ref_sect_start",
"=",
"find_reference_section",
"(",
"text_lines",
")",
"if",
"ref_sect_start",
"is",
"not",
"None",
":",
"start",
"=",
"ref_sect_start",
"[",
"\"start_line\"",
"]",
"end",
"=",
"find_end_of_re... | Return the text lines with the references cut. | [
"Return",
"the",
"text",
"lines",
"with",
"the",
"references",
"cut",
"."
] | train | https://github.com/inveniosoftware-contrib/invenio-classifier/blob/3c758cf34dca6bf0548e7da5de34e5f72e3b255e/invenio_classifier/normalizer.py#L128-L141 |
inveniosoftware-contrib/invenio-classifier | invenio_classifier/normalizer.py | _replace_greek_characters | def _replace_greek_characters(line):
"""Replace greek characters in a string."""
for greek_char, replacement in iteritems(_GREEK_REPLACEMENTS):
try:
line = line.replace(greek_char, replacement)
except UnicodeDecodeError:
current_app.logger.exception("Unicode decoding erro... | python | def _replace_greek_characters(line):
"""Replace greek characters in a string."""
for greek_char, replacement in iteritems(_GREEK_REPLACEMENTS):
try:
line = line.replace(greek_char, replacement)
except UnicodeDecodeError:
current_app.logger.exception("Unicode decoding erro... | [
"def",
"_replace_greek_characters",
"(",
"line",
")",
":",
"for",
"greek_char",
",",
"replacement",
"in",
"iteritems",
"(",
"_GREEK_REPLACEMENTS",
")",
":",
"try",
":",
"line",
"=",
"line",
".",
"replace",
"(",
"greek_char",
",",
"replacement",
")",
"except",
... | Replace greek characters in a string. | [
"Replace",
"greek",
"characters",
"in",
"a",
"string",
"."
] | train | https://github.com/inveniosoftware-contrib/invenio-classifier/blob/3c758cf34dca6bf0548e7da5de34e5f72e3b255e/invenio_classifier/normalizer.py#L645-L653 |
PMBio/limix-backup | limix/mtSet/mtset.py | MTSet.fitNull | def fitNull(self, verbose=False, cache=False, out_dir='./cache', fname=None, rewrite=False, seed=None, n_times=10, factr=1e3, init_method=None):
"""
Fit null model
"""
if seed is not None: sp.random.seed(seed)
read_from_file = False
if cache:
assert fname ... | python | def fitNull(self, verbose=False, cache=False, out_dir='./cache', fname=None, rewrite=False, seed=None, n_times=10, factr=1e3, init_method=None):
"""
Fit null model
"""
if seed is not None: sp.random.seed(seed)
read_from_file = False
if cache:
assert fname ... | [
"def",
"fitNull",
"(",
"self",
",",
"verbose",
"=",
"False",
",",
"cache",
"=",
"False",
",",
"out_dir",
"=",
"'./cache'",
",",
"fname",
"=",
"None",
",",
"rewrite",
"=",
"False",
",",
"seed",
"=",
"None",
",",
"n_times",
"=",
"10",
",",
"factr",
"... | Fit null model | [
"Fit",
"null",
"model"
] | train | https://github.com/PMBio/limix-backup/blob/1e201fdb5c694d0d5506f207f3de65d8ef66146c/limix/mtSet/mtset.py#L143-L207 |
PMBio/limix-backup | limix/mtSet/mtset.py | MTSet.optimize | def optimize(self, G, params0=None, n_times=10, verbose=False, vmax=5, perturb=1e-3, factr=1e7):
"""
Optimize the model considering G
"""
# set params0 from null if params0 is None
if params0 is None:
if self.null is None:
if verbose: print(".. fit... | python | def optimize(self, G, params0=None, n_times=10, verbose=False, vmax=5, perturb=1e-3, factr=1e7):
"""
Optimize the model considering G
"""
# set params0 from null if params0 is None
if params0 is None:
if self.null is None:
if verbose: print(".. fit... | [
"def",
"optimize",
"(",
"self",
",",
"G",
",",
"params0",
"=",
"None",
",",
"n_times",
"=",
"10",
",",
"verbose",
"=",
"False",
",",
"vmax",
"=",
"5",
",",
"perturb",
"=",
"1e-3",
",",
"factr",
"=",
"1e7",
")",
":",
"# set params0 from null if params0 ... | Optimize the model considering G | [
"Optimize",
"the",
"model",
"considering",
"G"
] | train | https://github.com/PMBio/limix-backup/blob/1e201fdb5c694d0d5506f207f3de65d8ef66146c/limix/mtSet/mtset.py#L221-L269 |
PMBio/limix-backup | limix/mtSet/mtset.py | MTSet.getVariances | def getVariances(self):
"""
get variances
"""
var = []
var.append(self.Cr.K().diagonal())
if self.bgRE:
var.append(self.Cg.K().diagonal())
var.append(self.Cn.K().diagonal())
var = sp.array(var)
return var | python | def getVariances(self):
"""
get variances
"""
var = []
var.append(self.Cr.K().diagonal())
if self.bgRE:
var.append(self.Cg.K().diagonal())
var.append(self.Cn.K().diagonal())
var = sp.array(var)
return var | [
"def",
"getVariances",
"(",
"self",
")",
":",
"var",
"=",
"[",
"]",
"var",
".",
"append",
"(",
"self",
".",
"Cr",
".",
"K",
"(",
")",
".",
"diagonal",
"(",
")",
")",
"if",
"self",
".",
"bgRE",
":",
"var",
".",
"append",
"(",
"self",
".",
"Cg"... | get variances | [
"get",
"variances"
] | train | https://github.com/PMBio/limix-backup/blob/1e201fdb5c694d0d5506f207f3de65d8ef66146c/limix/mtSet/mtset.py#L275-L285 |
PMBio/limix-backup | limix/mtSet/mtset.py | MTSet.fitNullTraitByTrait | def fitNullTraitByTrait(self, verbose=False, cache=False, out_dir='./cache', fname=None, rewrite=False):
"""
Fit null model trait by trait
"""
read_from_file = False
if cache:
assert fname is not None, 'MultiTraitSetTest:: specify fname'
if not os.path.exi... | python | def fitNullTraitByTrait(self, verbose=False, cache=False, out_dir='./cache', fname=None, rewrite=False):
"""
Fit null model trait by trait
"""
read_from_file = False
if cache:
assert fname is not None, 'MultiTraitSetTest:: specify fname'
if not os.path.exi... | [
"def",
"fitNullTraitByTrait",
"(",
"self",
",",
"verbose",
"=",
"False",
",",
"cache",
"=",
"False",
",",
"out_dir",
"=",
"'./cache'",
",",
"fname",
"=",
"None",
",",
"rewrite",
"=",
"False",
")",
":",
"read_from_file",
"=",
"False",
"if",
"cache",
":",
... | Fit null model trait by trait | [
"Fit",
"null",
"model",
"trait",
"by",
"trait"
] | train | https://github.com/PMBio/limix-backup/blob/1e201fdb5c694d0d5506f207f3de65d8ef66146c/limix/mtSet/mtset.py#L306-L343 |
PMBio/limix-backup | limix/mtSet/mtset.py | MTSet.optimizeTraitByTrait | def optimizeTraitByTrait(self, G, verbose=False, n_times=10, factr=1e3):
""" Optimize trait by trait """
assert self.nullST is not None, 'fit null model beforehand'
RV = {}
self.infoOptST = {}
for p in range(self.P):
trait_id = self.traitID[p]
self.stSet.Y... | python | def optimizeTraitByTrait(self, G, verbose=False, n_times=10, factr=1e3):
""" Optimize trait by trait """
assert self.nullST is not None, 'fit null model beforehand'
RV = {}
self.infoOptST = {}
for p in range(self.P):
trait_id = self.traitID[p]
self.stSet.Y... | [
"def",
"optimizeTraitByTrait",
"(",
"self",
",",
"G",
",",
"verbose",
"=",
"False",
",",
"n_times",
"=",
"10",
",",
"factr",
"=",
"1e3",
")",
":",
"assert",
"self",
".",
"nullST",
"is",
"not",
"None",
",",
"'fit null model beforehand'",
"RV",
"=",
"{",
... | Optimize trait by trait | [
"Optimize",
"trait",
"by",
"trait"
] | train | https://github.com/PMBio/limix-backup/blob/1e201fdb5c694d0d5506f207f3de65d8ef66146c/limix/mtSet/mtset.py#L345-L356 |
PMBio/limix-backup | limix/mtSet/mtset.py | MTSet._initParams | def _initParams(self, init_method=None):
""" this function initializes the paramenter and Ifilter """
if self.bgRE:
if init_method=='random':
params0 = {'covar': sp.randn(self._gpNull.covar.getNumberParams())}
else:
if self.P==1:
... | python | def _initParams(self, init_method=None):
""" this function initializes the paramenter and Ifilter """
if self.bgRE:
if init_method=='random':
params0 = {'covar': sp.randn(self._gpNull.covar.getNumberParams())}
else:
if self.P==1:
... | [
"def",
"_initParams",
"(",
"self",
",",
"init_method",
"=",
"None",
")",
":",
"if",
"self",
".",
"bgRE",
":",
"if",
"init_method",
"==",
"'random'",
":",
"params0",
"=",
"{",
"'covar'",
":",
"sp",
".",
"randn",
"(",
"self",
".",
"_gpNull",
".",
"cova... | this function initializes the paramenter and Ifilter | [
"this",
"function",
"initializes",
"the",
"paramenter",
"and",
"Ifilter"
] | train | https://github.com/PMBio/limix-backup/blob/1e201fdb5c694d0d5506f207f3de65d8ef66146c/limix/mtSet/mtset.py#L362-L383 |
thomasleese/mo | mo/frontends.py | SerialisingFrontend.serialise | def serialise(self, obj):
"""
Take an object from the project or the runner and serialise it into a
dictionary.
Parameters
----------
obj : object
An object to serialise.
Returns
-------
object
A serialised version of the ... | python | def serialise(self, obj):
"""
Take an object from the project or the runner and serialise it into a
dictionary.
Parameters
----------
obj : object
An object to serialise.
Returns
-------
object
A serialised version of the ... | [
"def",
"serialise",
"(",
"self",
",",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"(",
"list",
",",
"VariableCollection",
",",
"StepCollection",
")",
")",
":",
"return",
"[",
"self",
".",
"serialise",
"(",
"element",
")",
"for",
"element",
"i... | Take an object from the project or the runner and serialise it into a
dictionary.
Parameters
----------
obj : object
An object to serialise.
Returns
-------
object
A serialised version of the input object. | [
"Take",
"an",
"object",
"from",
"the",
"project",
"or",
"the",
"runner",
"and",
"serialise",
"it",
"into",
"a",
"dictionary",
"."
] | train | https://github.com/thomasleese/mo/blob/b757f52b42e51ad19c14724ceb7c5db5d52abaea/mo/frontends.py#L152-L179 |
millar/provstore-api | provstore/document.py | Document.create | def create(self, prov_document, prov_format=None, refresh=False, **props):
"""
Create a document on ProvStore.
:param prov_document: The document to be stored
:param prov_format: The format of the document provided
:param bool refresh: Whether or not to load back the document af... | python | def create(self, prov_document, prov_format=None, refresh=False, **props):
"""
Create a document on ProvStore.
:param prov_document: The document to be stored
:param prov_format: The format of the document provided
:param bool refresh: Whether or not to load back the document af... | [
"def",
"create",
"(",
"self",
",",
"prov_document",
",",
"prov_format",
"=",
"None",
",",
"refresh",
"=",
"False",
",",
"*",
"*",
"props",
")",
":",
"if",
"not",
"self",
".",
"abstract",
":",
"raise",
"ImmutableDocumentException",
"(",
")",
"if",
"isinst... | Create a document on ProvStore.
:param prov_document: The document to be stored
:param prov_format: The format of the document provided
:param bool refresh: Whether or not to load back the document after saving
:param dict props: Properties for this document [**name** (required), **publ... | [
"Create",
"a",
"document",
"on",
"ProvStore",
"."
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L69-L99 |
millar/provstore-api | provstore/document.py | Document.set | def set(self, document_id):
"""
Associate this document with a ProvStore document without making any calls to the API.
:param int document_id: ID of the document on ProvStore
:return: self
"""
if not self.abstract:
raise ImmutableDocumentException()
se... | python | def set(self, document_id):
"""
Associate this document with a ProvStore document without making any calls to the API.
:param int document_id: ID of the document on ProvStore
:return: self
"""
if not self.abstract:
raise ImmutableDocumentException()
se... | [
"def",
"set",
"(",
"self",
",",
"document_id",
")",
":",
"if",
"not",
"self",
".",
"abstract",
":",
"raise",
"ImmutableDocumentException",
"(",
")",
"self",
".",
"_id",
"=",
"document_id",
"return",
"self"
] | Associate this document with a ProvStore document without making any calls to the API.
:param int document_id: ID of the document on ProvStore
:return: self | [
"Associate",
"this",
"document",
"with",
"a",
"ProvStore",
"document",
"without",
"making",
"any",
"calls",
"to",
"the",
"API",
".",
":",
"param",
"int",
"document_id",
":",
"ID",
"of",
"the",
"document",
"on",
"ProvStore",
":",
"return",
":",
"self"
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L103-L113 |
millar/provstore-api | provstore/document.py | Document.read_prov | def read_prov(self, document_id=None):
"""
Load the provenance of this document
.. note::
This method is called automatically if needed when the :py:meth:`prov` property is accessed. Manual use of
this method is unusual.
:param document_id: (optional) set the docu... | python | def read_prov(self, document_id=None):
"""
Load the provenance of this document
.. note::
This method is called automatically if needed when the :py:meth:`prov` property is accessed. Manual use of
this method is unusual.
:param document_id: (optional) set the docu... | [
"def",
"read_prov",
"(",
"self",
",",
"document_id",
"=",
"None",
")",
":",
"if",
"document_id",
":",
"if",
"not",
"self",
".",
"abstract",
":",
"raise",
"ImmutableDocumentException",
"(",
")",
"self",
".",
"_id",
"=",
"document_id",
"if",
"self",
".",
"... | Load the provenance of this document
.. note::
This method is called automatically if needed when the :py:meth:`prov` property is accessed. Manual use of
this method is unusual.
:param document_id: (optional) set the document id if this is an :py:meth:`abstract` document
... | [
"Load",
"the",
"provenance",
"of",
"this",
"document"
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L163-L183 |
millar/provstore-api | provstore/document.py | Document.read_meta | def read_meta(self, document_id=None):
"""
Load metadata associated with the document
.. note::
This method is called automatically if needed when a property is first accessed. You will not normally have
to use this method manually.
:param document_id: (optional) ... | python | def read_meta(self, document_id=None):
"""
Load metadata associated with the document
.. note::
This method is called automatically if needed when a property is first accessed. You will not normally have
to use this method manually.
:param document_id: (optional) ... | [
"def",
"read_meta",
"(",
"self",
",",
"document_id",
"=",
"None",
")",
":",
"if",
"document_id",
":",
"if",
"not",
"self",
".",
"abstract",
":",
"raise",
"ImmutableDocumentException",
"(",
")",
"self",
".",
"_id",
"=",
"document_id",
"if",
"self",
".",
"... | Load metadata associated with the document
.. note::
This method is called automatically if needed when a property is first accessed. You will not normally have
to use this method manually.
:param document_id: (optional) set the document id if this is an :py:meth:`abstract` docum... | [
"Load",
"metadata",
"associated",
"with",
"the",
"document"
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L185-L214 |
millar/provstore-api | provstore/document.py | Document.add_bundle | def add_bundle(self, prov_bundle, identifier):
"""
Verbose method of adding a bundle.
Can also be done as:
>>> api = Api()
>>> document = api.document.get(148)
>>> document.bundles['identifier'] = prov_bundle
:param prov_bundle: The bundle to be added
... | python | def add_bundle(self, prov_bundle, identifier):
"""
Verbose method of adding a bundle.
Can also be done as:
>>> api = Api()
>>> document = api.document.get(148)
>>> document.bundles['identifier'] = prov_bundle
:param prov_bundle: The bundle to be added
... | [
"def",
"add_bundle",
"(",
"self",
",",
"prov_bundle",
",",
"identifier",
")",
":",
"if",
"self",
".",
"abstract",
":",
"raise",
"AbstractDocumentException",
"(",
")",
"self",
".",
"_api",
".",
"add_bundle",
"(",
"self",
".",
"id",
",",
"prov_bundle",
".",
... | Verbose method of adding a bundle.
Can also be done as:
>>> api = Api()
>>> document = api.document.get(148)
>>> document.bundles['identifier'] = prov_bundle
:param prov_bundle: The bundle to be added
:param str identifier: URI or QName for this bundle
:ty... | [
"Verbose",
"method",
"of",
"adding",
"a",
"bundle",
"."
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L216-L232 |
millar/provstore-api | provstore/document.py | Document.delete | def delete(self):
"""
Remove the document and all of its bundles from ProvStore.
.. warning::
Cannot be undone.
"""
if self.abstract:
raise AbstractDocumentException()
self._api.delete_document(self.id)
self._id = None
return True | python | def delete(self):
"""
Remove the document and all of its bundles from ProvStore.
.. warning::
Cannot be undone.
"""
if self.abstract:
raise AbstractDocumentException()
self._api.delete_document(self.id)
self._id = None
return True | [
"def",
"delete",
"(",
"self",
")",
":",
"if",
"self",
".",
"abstract",
":",
"raise",
"AbstractDocumentException",
"(",
")",
"self",
".",
"_api",
".",
"delete_document",
"(",
"self",
".",
"id",
")",
"self",
".",
"_id",
"=",
"None",
"return",
"True"
] | Remove the document and all of its bundles from ProvStore.
.. warning::
Cannot be undone. | [
"Remove",
"the",
"document",
"and",
"all",
"of",
"its",
"bundles",
"from",
"ProvStore",
"."
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L245-L258 |
millar/provstore-api | provstore/document.py | Document.name | def name(self):
"""
Name of document as seen on ProvStore
"""
if self._name:
return self._name
elif not self.abstract:
return self.read_meta()._name
raise EmptyDocumentException() | python | def name(self):
"""
Name of document as seen on ProvStore
"""
if self._name:
return self._name
elif not self.abstract:
return self.read_meta()._name
raise EmptyDocumentException() | [
"def",
"name",
"(",
"self",
")",
":",
"if",
"self",
".",
"_name",
":",
"return",
"self",
".",
"_name",
"elif",
"not",
"self",
".",
"abstract",
":",
"return",
"self",
".",
"read_meta",
"(",
")",
".",
"_name",
"raise",
"EmptyDocumentException",
"(",
")"
... | Name of document as seen on ProvStore | [
"Name",
"of",
"document",
"as",
"seen",
"on",
"ProvStore"
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L275-L284 |
millar/provstore-api | provstore/document.py | Document.public | def public(self):
"""
Is this document visible to anyone?
"""
if self._public:
return self._public
elif not self.abstract:
return self.read_meta()._public
raise EmptyDocumentException() | python | def public(self):
"""
Is this document visible to anyone?
"""
if self._public:
return self._public
elif not self.abstract:
return self.read_meta()._public
raise EmptyDocumentException() | [
"def",
"public",
"(",
"self",
")",
":",
"if",
"self",
".",
"_public",
":",
"return",
"self",
".",
"_public",
"elif",
"not",
"self",
".",
"abstract",
":",
"return",
"self",
".",
"read_meta",
"(",
")",
".",
"_public",
"raise",
"EmptyDocumentException",
"("... | Is this document visible to anyone? | [
"Is",
"this",
"document",
"visible",
"to",
"anyone?"
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L287-L296 |
millar/provstore-api | provstore/document.py | Document.owner | def owner(self):
"""
Username of document creator
"""
if self._owner:
return self._owner
elif not self.abstract:
return self.read_meta()._owner
raise EmptyDocumentException() | python | def owner(self):
"""
Username of document creator
"""
if self._owner:
return self._owner
elif not self.abstract:
return self.read_meta()._owner
raise EmptyDocumentException() | [
"def",
"owner",
"(",
"self",
")",
":",
"if",
"self",
".",
"_owner",
":",
"return",
"self",
".",
"_owner",
"elif",
"not",
"self",
".",
"abstract",
":",
"return",
"self",
".",
"read_meta",
"(",
")",
".",
"_owner",
"raise",
"EmptyDocumentException",
"(",
... | Username of document creator | [
"Username",
"of",
"document",
"creator"
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L299-L308 |
millar/provstore-api | provstore/document.py | Document.created_at | def created_at(self):
"""
:return: When the document was created
:rtype: :py:class:`datetime.datetime`
"""
if self._created_at:
return self._created_at
elif not self.abstract:
return self.read_meta()._created_at
raise EmptyDocumentExceptio... | python | def created_at(self):
"""
:return: When the document was created
:rtype: :py:class:`datetime.datetime`
"""
if self._created_at:
return self._created_at
elif not self.abstract:
return self.read_meta()._created_at
raise EmptyDocumentExceptio... | [
"def",
"created_at",
"(",
"self",
")",
":",
"if",
"self",
".",
"_created_at",
":",
"return",
"self",
".",
"_created_at",
"elif",
"not",
"self",
".",
"abstract",
":",
"return",
"self",
".",
"read_meta",
"(",
")",
".",
"_created_at",
"raise",
"EmptyDocumentE... | :return: When the document was created
:rtype: :py:class:`datetime.datetime` | [
":",
"return",
":",
"When",
"the",
"document",
"was",
"created",
":",
"rtype",
":",
":",
"py",
":",
"class",
":",
"datetime",
".",
"datetime"
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L311-L321 |
millar/provstore-api | provstore/document.py | Document.views | def views(self):
"""
Number of views this document has received on ProvStore
"""
if self._views:
return self._views
elif not self.abstract:
return self.read_meta()._views
raise EmptyDocumentException() | python | def views(self):
"""
Number of views this document has received on ProvStore
"""
if self._views:
return self._views
elif not self.abstract:
return self.read_meta()._views
raise EmptyDocumentException() | [
"def",
"views",
"(",
"self",
")",
":",
"if",
"self",
".",
"_views",
":",
"return",
"self",
".",
"_views",
"elif",
"not",
"self",
".",
"abstract",
":",
"return",
"self",
".",
"read_meta",
"(",
")",
".",
"_views",
"raise",
"EmptyDocumentException",
"(",
... | Number of views this document has received on ProvStore | [
"Number",
"of",
"views",
"this",
"document",
"has",
"received",
"on",
"ProvStore"
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L324-L333 |
millar/provstore-api | provstore/document.py | Document.url | def url(self):
"""
URL of document on ProvStore
:Example:
>>> stored_document.url
'https://provenance.ecs.soton.ac.uk/store/documents/148'
"""
if not self.abstract:
return "%s/documents/%i" % ("/".join(self._api.base_url.split("/")[:-2]), self.id) | python | def url(self):
"""
URL of document on ProvStore
:Example:
>>> stored_document.url
'https://provenance.ecs.soton.ac.uk/store/documents/148'
"""
if not self.abstract:
return "%s/documents/%i" % ("/".join(self._api.base_url.split("/")[:-2]), self.id) | [
"def",
"url",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"abstract",
":",
"return",
"\"%s/documents/%i\"",
"%",
"(",
"\"/\"",
".",
"join",
"(",
"self",
".",
"_api",
".",
"base_url",
".",
"split",
"(",
"\"/\"",
")",
"[",
":",
"-",
"2",
"]",
... | URL of document on ProvStore
:Example:
>>> stored_document.url
'https://provenance.ecs.soton.ac.uk/store/documents/148' | [
"URL",
"of",
"document",
"on",
"ProvStore"
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L336-L345 |
millar/provstore-api | provstore/document.py | Document.prov | def prov(self):
"""
Provenance stored for this document as :py:class:`prov.model.ProvDocument`
"""
if self._prov:
return self._prov
elif not self.abstract:
return self.read_prov()
raise EmptyDocumentException() | python | def prov(self):
"""
Provenance stored for this document as :py:class:`prov.model.ProvDocument`
"""
if self._prov:
return self._prov
elif not self.abstract:
return self.read_prov()
raise EmptyDocumentException() | [
"def",
"prov",
"(",
"self",
")",
":",
"if",
"self",
".",
"_prov",
":",
"return",
"self",
".",
"_prov",
"elif",
"not",
"self",
".",
"abstract",
":",
"return",
"self",
".",
"read_prov",
"(",
")",
"raise",
"EmptyDocumentException",
"(",
")"
] | Provenance stored for this document as :py:class:`prov.model.ProvDocument` | [
"Provenance",
"stored",
"for",
"this",
"document",
"as",
":",
"py",
":",
"class",
":",
"prov",
".",
"model",
".",
"ProvDocument"
] | train | https://github.com/millar/provstore-api/blob/0dd506b4f0e00623b95a52caa70debe758817179/provstore/document.py#L348-L357 |
StyXman/ayrton | ayrton/parser/astcompiler/astbuilder.py | ASTBuilder.build_ast | def build_ast(self):
"""Convert an top level parse tree node into an AST mod."""
n = self.root_node
if n.type == syms.file_input:
stmts = []
for i in range(len(n.children) - 1):
stmt = n.children[i]
if stmt.type == tokens.NEWLINE:
... | python | def build_ast(self):
"""Convert an top level parse tree node into an AST mod."""
n = self.root_node
if n.type == syms.file_input:
stmts = []
for i in range(len(n.children) - 1):
stmt = n.children[i]
if stmt.type == tokens.NEWLINE:
... | [
"def",
"build_ast",
"(",
"self",
")",
":",
"n",
"=",
"self",
".",
"root_node",
"if",
"n",
".",
"type",
"==",
"syms",
".",
"file_input",
":",
"stmts",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"n",
".",
"children",
")",
"-",
"1"... | Convert an top level parse tree node into an AST mod. | [
"Convert",
"an",
"top",
"level",
"parse",
"tree",
"node",
"into",
"an",
"AST",
"mod",
"."
] | train | https://github.com/StyXman/ayrton/blob/e1eed5c7ef230e3c2340a1f0bf44c72bbdc0debb/ayrton/parser/astcompiler/astbuilder.py#L139-L178 |
StyXman/ayrton | ayrton/parser/astcompiler/astbuilder.py | ASTBuilder.number_of_statements | def number_of_statements(self, n):
"""Compute the number of AST statements contained in a node."""
stmt_type = n.type
if stmt_type == syms.compound_stmt:
return 1
elif stmt_type == syms.stmt:
return self.number_of_statements(n.children[0])
elif stmt_type =... | python | def number_of_statements(self, n):
"""Compute the number of AST statements contained in a node."""
stmt_type = n.type
if stmt_type == syms.compound_stmt:
return 1
elif stmt_type == syms.stmt:
return self.number_of_statements(n.children[0])
elif stmt_type =... | [
"def",
"number_of_statements",
"(",
"self",
",",
"n",
")",
":",
"stmt_type",
"=",
"n",
".",
"type",
"if",
"stmt_type",
"==",
"syms",
".",
"compound_stmt",
":",
"return",
"1",
"elif",
"stmt_type",
"==",
"syms",
".",
"stmt",
":",
"return",
"self",
".",
"... | Compute the number of AST statements contained in a node. | [
"Compute",
"the",
"number",
"of",
"AST",
"statements",
"contained",
"in",
"a",
"node",
"."
] | train | https://github.com/StyXman/ayrton/blob/e1eed5c7ef230e3c2340a1f0bf44c72bbdc0debb/ayrton/parser/astcompiler/astbuilder.py#L180-L191 |
StyXman/ayrton | ayrton/parser/astcompiler/astbuilder.py | ASTBuilder.error | def error(self, msg, n):
"""Raise a SyntaxError with the lineno and col_offset set to n's."""
raise SyntaxError(msg, n.lineno, n.col_offset,
filename=self.compile_info.filename) | python | def error(self, msg, n):
"""Raise a SyntaxError with the lineno and col_offset set to n's."""
raise SyntaxError(msg, n.lineno, n.col_offset,
filename=self.compile_info.filename) | [
"def",
"error",
"(",
"self",
",",
"msg",
",",
"n",
")",
":",
"raise",
"SyntaxError",
"(",
"msg",
",",
"n",
".",
"lineno",
",",
"n",
".",
"col_offset",
",",
"filename",
"=",
"self",
".",
"compile_info",
".",
"filename",
")"
] | Raise a SyntaxError with the lineno and col_offset set to n's. | [
"Raise",
"a",
"SyntaxError",
"with",
"the",
"lineno",
"and",
"col_offset",
"set",
"to",
"n",
"s",
"."
] | train | https://github.com/StyXman/ayrton/blob/e1eed5c7ef230e3c2340a1f0bf44c72bbdc0debb/ayrton/parser/astcompiler/astbuilder.py#L193-L196 |
StyXman/ayrton | ayrton/parser/astcompiler/astbuilder.py | ASTBuilder.set_context | def set_context(self, expr, ctx):
"""Set the context of an expression to Store or Del if possible."""
t = type(expr)
try:
# TODO: check if Starred is ok
if t in (ast.Attribute, ast.Name):
if type(ctx) == ast.Store():
mis.check_forbidden... | python | def set_context(self, expr, ctx):
"""Set the context of an expression to Store or Del if possible."""
t = type(expr)
try:
# TODO: check if Starred is ok
if t in (ast.Attribute, ast.Name):
if type(ctx) == ast.Store():
mis.check_forbidden... | [
"def",
"set_context",
"(",
"self",
",",
"expr",
",",
"ctx",
")",
":",
"t",
"=",
"type",
"(",
"expr",
")",
"try",
":",
"# TODO: check if Starred is ok",
"if",
"t",
"in",
"(",
"ast",
".",
"Attribute",
",",
"ast",
".",
"Name",
")",
":",
"if",
"type",
... | Set the context of an expression to Store or Del if possible. | [
"Set",
"the",
"context",
"of",
"an",
"expression",
"to",
"Store",
"or",
"Del",
"if",
"possible",
"."
] | train | https://github.com/StyXman/ayrton/blob/e1eed5c7ef230e3c2340a1f0bf44c72bbdc0debb/ayrton/parser/astcompiler/astbuilder.py#L211-L226 |
avinassh/prawoauth2 | prawoauth2/PrawOAuth2Server.py | PrawOAuth2Server.start | def start(self):
"""Starts the `PrawOAuth2Server` server. It will open the default
web browser and it will take you to Reddit's authorization page,
asking you to authorize your Reddit account(or account of the bot's)
with your app(or bot script). Once authorized successfully, it will
... | python | def start(self):
"""Starts the `PrawOAuth2Server` server. It will open the default
web browser and it will take you to Reddit's authorization page,
asking you to authorize your Reddit account(or account of the bot's)
with your app(or bot script). Once authorized successfully, it will
... | [
"def",
"start",
"(",
"self",
")",
":",
"global",
"CODE",
"url",
"=",
"self",
".",
"_get_auth_url",
"(",
")",
"webbrowser",
".",
"open",
"(",
"url",
")",
"tornado",
".",
"ioloop",
".",
"IOLoop",
".",
"current",
"(",
")",
".",
"start",
"(",
")",
"sel... | Starts the `PrawOAuth2Server` server. It will open the default
web browser and it will take you to Reddit's authorization page,
asking you to authorize your Reddit account(or account of the bot's)
with your app(or bot script). Once authorized successfully, it will
show `successful` messa... | [
"Starts",
"the",
"PrawOAuth2Server",
"server",
".",
"It",
"will",
"open",
"the",
"default",
"web",
"browser",
"and",
"it",
"will",
"take",
"you",
"to",
"Reddit",
"s",
"authorization",
"page",
"asking",
"you",
"to",
"authorize",
"your",
"Reddit",
"account",
"... | train | https://github.com/avinassh/prawoauth2/blob/a7c9ab5a93666d8468c6bf8455a4bdff6cda6583/prawoauth2/PrawOAuth2Server.py#L84-L95 |
praekelt/django-moderator | moderator/templatetags/moderator_inclusion_tags.py | report_comment_abuse | def report_comment_abuse(context, obj):
"""
Checks whether a user can report abuse (has not liked comment previously)
or has reported abuse previously and renders appropriate response.
If requesting user is part of the 'Moderators' group a vote equal to
ABUSE_CUTOFF setting will be made, thereby im... | python | def report_comment_abuse(context, obj):
"""
Checks whether a user can report abuse (has not liked comment previously)
or has reported abuse previously and renders appropriate response.
If requesting user is part of the 'Moderators' group a vote equal to
ABUSE_CUTOFF setting will be made, thereby im... | [
"def",
"report_comment_abuse",
"(",
"context",
",",
"obj",
")",
":",
"context",
".",
"update",
"(",
"{",
"'content_obj'",
":",
"obj",
",",
"'vote'",
":",
"-",
"1",
",",
"'content_type'",
":",
"\"-\"",
".",
"join",
"(",
"(",
"obj",
".",
"_meta",
".",
... | Checks whether a user can report abuse (has not liked comment previously)
or has reported abuse previously and renders appropriate response.
If requesting user is part of the 'Moderators' group a vote equal to
ABUSE_CUTOFF setting will be made, thereby immediately marking the comment
as abusive. | [
"Checks",
"whether",
"a",
"user",
"can",
"report",
"abuse",
"(",
"has",
"not",
"liked",
"comment",
"previously",
")",
"or",
"has",
"reported",
"abuse",
"previously",
"and",
"renders",
"appropriate",
"response",
"."
] | train | https://github.com/praekelt/django-moderator/blob/72f1d5259128ff5a1a0341d4a573bfd561ba4665/moderator/templatetags/moderator_inclusion_tags.py#L8-L22 |
jf-parent/brome | brome/core/proxy_element.py | ProxyElement.send_keys | def send_keys(self, value, **kwargs):
self.debug_log("Sending keys")
highlight = kwargs.get(
'highlight',
BROME_CONFIG['highlight']['highlight_when_element_receive_keys'] # noqa
)
"""
wait_until_clickable = kwargs.get(
'wait_until_clickable',... | python | def send_keys(self, value, **kwargs):
self.debug_log("Sending keys")
highlight = kwargs.get(
'highlight',
BROME_CONFIG['highlight']['highlight_when_element_receive_keys'] # noqa
)
"""
wait_until_clickable = kwargs.get(
'wait_until_clickable',... | [
"def",
"send_keys",
"(",
"self",
",",
"value",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"debug_log",
"(",
"\"Sending keys\"",
")",
"highlight",
"=",
"kwargs",
".",
"get",
"(",
"'highlight'",
",",
"BROME_CONFIG",
"[",
"'highlight'",
"]",
"[",
"'hig... | wait_until_clickable = kwargs.get(
'wait_until_clickable',
BROME_CONFIG['proxy_element']['wait_until_clickable']
)
if wait_until_clickable:
# TODO manage the raise exception better
self.pdriver.wait_until_clickable(
self.selector._selector... | [
"wait_until_clickable",
"=",
"kwargs",
".",
"get",
"(",
"wait_until_clickable",
"BROME_CONFIG",
"[",
"proxy_element",
"]",
"[",
"wait_until_clickable",
"]",
")"
] | train | https://github.com/jf-parent/brome/blob/784f45d96b83b703dd2181cb59ca8ea777c2510e/brome/core/proxy_element.py#L197-L251 |
jf-parent/brome | brome/core/proxy_element.py | ProxyElement.highlight | def highlight(self, **kwargs):
"""
kwargs:
style: css
highlight_time: int; default: .3
"""
self.debug_log("Highlighting element")
style = kwargs.get('style')
highlight_time = kwargs.get('highlight_time', .3)
driver = self._el... | python | def highlight(self, **kwargs):
"""
kwargs:
style: css
highlight_time: int; default: .3
"""
self.debug_log("Highlighting element")
style = kwargs.get('style')
highlight_time = kwargs.get('highlight_time', .3)
driver = self._el... | [
"def",
"highlight",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"debug_log",
"(",
"\"Highlighting element\"",
")",
"style",
"=",
"kwargs",
".",
"get",
"(",
"'style'",
")",
"highlight_time",
"=",
"kwargs",
".",
"get",
"(",
"'highlight_time'... | kwargs:
style: css
highlight_time: int; default: .3 | [
"kwargs",
":",
"style",
":",
"css",
"highlight_time",
":",
"int",
";",
"default",
":",
".",
"3"
] | train | https://github.com/jf-parent/brome/blob/784f45d96b83b703dd2181cb59ca8ea777c2510e/brome/core/proxy_element.py#L275-L311 |
jf-parent/brome | brome/runner/ec2_instance.py | EC2Instance.scp_file_remote_to_local | def scp_file_remote_to_local(self, remote_path, local_path):
"""Scp a remote file to local
Args:
remote_path (str)
local_path (str)
"""
scp_command = [
'scp',
'-o',
'StrictHostKeyChecking=no',
'-i',
sel... | python | def scp_file_remote_to_local(self, remote_path, local_path):
"""Scp a remote file to local
Args:
remote_path (str)
local_path (str)
"""
scp_command = [
'scp',
'-o',
'StrictHostKeyChecking=no',
'-i',
sel... | [
"def",
"scp_file_remote_to_local",
"(",
"self",
",",
"remote_path",
",",
"local_path",
")",
":",
"scp_command",
"=",
"[",
"'scp'",
",",
"'-o'",
",",
"'StrictHostKeyChecking=no'",
",",
"'-i'",
",",
"self",
".",
"browser_config",
".",
"get",
"(",
"'ssh_key_path'",... | Scp a remote file to local
Args:
remote_path (str)
local_path (str) | [
"Scp",
"a",
"remote",
"file",
"to",
"local"
] | train | https://github.com/jf-parent/brome/blob/784f45d96b83b703dd2181cb59ca8ea777c2510e/brome/runner/ec2_instance.py#L36-L63 |
jf-parent/brome | brome/runner/ec2_instance.py | EC2Instance.execute_command | def execute_command(self, command):
"""Execute a command on the node
Args:
command (str)
"""
self.info_log("executing command: %s" % command)
try:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
... | python | def execute_command(self, command):
"""Execute a command on the node
Args:
command (str)
"""
self.info_log("executing command: %s" % command)
try:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
... | [
"def",
"execute_command",
"(",
"self",
",",
"command",
")",
":",
"self",
".",
"info_log",
"(",
"\"executing command: %s\"",
"%",
"command",
")",
"try",
":",
"ssh",
"=",
"paramiko",
".",
"SSHClient",
"(",
")",
"ssh",
".",
"set_missing_host_key_policy",
"(",
"... | Execute a command on the node
Args:
command (str) | [
"Execute",
"a",
"command",
"on",
"the",
"node"
] | train | https://github.com/jf-parent/brome/blob/784f45d96b83b703dd2181cb59ca8ea777c2510e/brome/runner/ec2_instance.py#L65-L119 |
jf-parent/brome | brome/runner/ec2_instance.py | EC2Instance.startup | def startup(self):
"""Startup the ec2 instance
"""
import boto.ec2
if not self.browser_config.get('launch'):
self.warning_log("Skipping launch")
return True
self.info_log("Starting up")
instance = None
try:
# KEY NAME
... | python | def startup(self):
"""Startup the ec2 instance
"""
import boto.ec2
if not self.browser_config.get('launch'):
self.warning_log("Skipping launch")
return True
self.info_log("Starting up")
instance = None
try:
# KEY NAME
... | [
"def",
"startup",
"(",
"self",
")",
":",
"import",
"boto",
".",
"ec2",
"if",
"not",
"self",
".",
"browser_config",
".",
"get",
"(",
"'launch'",
")",
":",
"self",
".",
"warning_log",
"(",
"\"Skipping launch\"",
")",
"return",
"True",
"self",
".",
"info_lo... | Startup the ec2 instance | [
"Startup",
"the",
"ec2",
"instance"
] | train | https://github.com/jf-parent/brome/blob/784f45d96b83b703dd2181cb59ca8ea777c2510e/brome/runner/ec2_instance.py#L121-L304 |
jf-parent/brome | brome/runner/ec2_instance.py | EC2Instance.tear_down | def tear_down(self):
"""Tear down the instance
"""
import boto.ec2
if not self.browser_config.get('terminate'):
self.warning_log("Skipping terminate")
return
self.info_log("Tearing down...")
ec2 = boto.ec2.connect_to_region(self.browser_config.g... | python | def tear_down(self):
"""Tear down the instance
"""
import boto.ec2
if not self.browser_config.get('terminate'):
self.warning_log("Skipping terminate")
return
self.info_log("Tearing down...")
ec2 = boto.ec2.connect_to_region(self.browser_config.g... | [
"def",
"tear_down",
"(",
"self",
")",
":",
"import",
"boto",
".",
"ec2",
"if",
"not",
"self",
".",
"browser_config",
".",
"get",
"(",
"'terminate'",
")",
":",
"self",
".",
"warning_log",
"(",
"\"Skipping terminate\"",
")",
"return",
"self",
".",
"info_log"... | Tear down the instance | [
"Tear",
"down",
"the",
"instance"
] | train | https://github.com/jf-parent/brome/blob/784f45d96b83b703dd2181cb59ca8ea777c2510e/brome/runner/ec2_instance.py#L306-L318 |
jf-parent/brome | brome/runner/ec2_instance.py | EC2Instance.start_proxy | def start_proxy(self):
"""Start the mitmproxy
"""
self.runner.info_log("Starting proxy...")
self.proxy_port = self.browser_config.get('proxy_port', 8080)
self.network_data_path = os.path.join(
self.runner.runner_dir,
'network_capture'
)
... | python | def start_proxy(self):
"""Start the mitmproxy
"""
self.runner.info_log("Starting proxy...")
self.proxy_port = self.browser_config.get('proxy_port', 8080)
self.network_data_path = os.path.join(
self.runner.runner_dir,
'network_capture'
)
... | [
"def",
"start_proxy",
"(",
"self",
")",
":",
"self",
".",
"runner",
".",
"info_log",
"(",
"\"Starting proxy...\"",
")",
"self",
".",
"proxy_port",
"=",
"self",
".",
"browser_config",
".",
"get",
"(",
"'proxy_port'",
",",
"8080",
")",
"self",
".",
"network_... | Start the mitmproxy | [
"Start",
"the",
"mitmproxy"
] | train | https://github.com/jf-parent/brome/blob/784f45d96b83b703dd2181cb59ca8ea777c2510e/brome/runner/ec2_instance.py#L349-L401 |
jf-parent/brome | brome/runner/ec2_instance.py | EC2Instance.stop_proxy | def stop_proxy(self):
"""Stop the mitmproxy
"""
self.runner.info_log("Stopping proxy...")
files = [
(self.remote_proxy_output_path, self.local_proxy_output_path),
(self.remote_proxy_log_path, self.local_proxy_log_path)
]
for remote_file_path, loc... | python | def stop_proxy(self):
"""Stop the mitmproxy
"""
self.runner.info_log("Stopping proxy...")
files = [
(self.remote_proxy_output_path, self.local_proxy_output_path),
(self.remote_proxy_log_path, self.local_proxy_log_path)
]
for remote_file_path, loc... | [
"def",
"stop_proxy",
"(",
"self",
")",
":",
"self",
".",
"runner",
".",
"info_log",
"(",
"\"Stopping proxy...\"",
")",
"files",
"=",
"[",
"(",
"self",
".",
"remote_proxy_output_path",
",",
"self",
".",
"local_proxy_output_path",
")",
",",
"(",
"self",
".",
... | Stop the mitmproxy | [
"Stop",
"the",
"mitmproxy"
] | train | https://github.com/jf-parent/brome/blob/784f45d96b83b703dd2181cb59ca8ea777c2510e/brome/runner/ec2_instance.py#L403-L417 |
akfullfo/taskforce | taskforce/utils.py | get_caller | def get_caller(*caller_class, **params):
"""
This is obsolete and references are being removed
"""
(frame, file, line, func, contextlist, index) = inspect.stack()[1]
try: class_name = frame.f_locals["self"].__class__.__name__
except: class_name = None
if class_name:
name = class_name +... | python | def get_caller(*caller_class, **params):
"""
This is obsolete and references are being removed
"""
(frame, file, line, func, contextlist, index) = inspect.stack()[1]
try: class_name = frame.f_locals["self"].__class__.__name__
except: class_name = None
if class_name:
name = class_name +... | [
"def",
"get_caller",
"(",
"*",
"caller_class",
",",
"*",
"*",
"params",
")",
":",
"(",
"frame",
",",
"file",
",",
"line",
",",
"func",
",",
"contextlist",
",",
"index",
")",
"=",
"inspect",
".",
"stack",
"(",
")",
"[",
"1",
"]",
"try",
":",
"clas... | This is obsolete and references are being removed | [
"This",
"is",
"obsolete",
"and",
"references",
"are",
"being",
"removed"
] | train | https://github.com/akfullfo/taskforce/blob/bc6dd744bd33546447d085dbd18a350532220193/taskforce/utils.py#L23-L54 |
akfullfo/taskforce | taskforce/utils.py | version_sort_key | def version_sort_key(version, digits=6):
"""
Produces a canonicalized version string for standard version strings
in the dotted-numeric-label format. Function appropriate for use as
the key function of sort().
The conversion removes a possible prefix and reformats each key element
as a long st... | python | def version_sort_key(version, digits=6):
"""
Produces a canonicalized version string for standard version strings
in the dotted-numeric-label format. Function appropriate for use as
the key function of sort().
The conversion removes a possible prefix and reformats each key element
as a long st... | [
"def",
"version_sort_key",
"(",
"version",
",",
"digits",
"=",
"6",
")",
":",
"m",
"=",
"re",
".",
"match",
"(",
"'^(\\w+[_-])(\\d.*)$'",
",",
"version",
")",
"if",
"m",
":",
"prefix",
"=",
"m",
".",
"group",
"(",
"1",
")",
"version",
"=",
"m",
"."... | Produces a canonicalized version string for standard version strings
in the dotted-numeric-label format. Function appropriate for use as
the key function of sort().
The conversion removes a possible prefix and reformats each key element
as a long string of digits with leading zeros. The number of dig... | [
"Produces",
"a",
"canonicalized",
"version",
"string",
"for",
"standard",
"version",
"strings",
"in",
"the",
"dotted",
"-",
"numeric",
"-",
"label",
"format",
".",
"Function",
"appropriate",
"for",
"use",
"as",
"the",
"key",
"function",
"of",
"sort",
"()",
"... | train | https://github.com/akfullfo/taskforce/blob/bc6dd744bd33546447d085dbd18a350532220193/taskforce/utils.py#L57-L86 |
akfullfo/taskforce | taskforce/utils.py | version_cmp | def version_cmp(ver_a, ver_b):
"""
Compares two version strings in the dotted-numeric-label format.
Returns -1 if a < b, 0 if a == b, and +1 if a > b.
Inputs may include a prefix string that matches '^\w+[_-]', but
both strings must start with the same prefix. If present, it
is ignored for pu... | python | def version_cmp(ver_a, ver_b):
"""
Compares two version strings in the dotted-numeric-label format.
Returns -1 if a < b, 0 if a == b, and +1 if a > b.
Inputs may include a prefix string that matches '^\w+[_-]', but
both strings must start with the same prefix. If present, it
is ignored for pu... | [
"def",
"version_cmp",
"(",
"ver_a",
",",
"ver_b",
")",
":",
"if",
"ver_a",
"is",
"None",
"and",
"ver_b",
"is",
"None",
":",
"return",
"0",
"if",
"ver_a",
"is",
"None",
":",
"return",
"-",
"1",
"elif",
"ver_b",
"is",
"None",
":",
"return",
"1",
"try... | Compares two version strings in the dotted-numeric-label format.
Returns -1 if a < b, 0 if a == b, and +1 if a > b.
Inputs may include a prefix string that matches '^\w+[_-]', but
both strings must start with the same prefix. If present, it
is ignored for purposes of comparision. If it does not matc... | [
"Compares",
"two",
"version",
"strings",
"in",
"the",
"dotted",
"-",
"numeric",
"-",
"label",
"format",
"."
] | train | https://github.com/akfullfo/taskforce/blob/bc6dd744bd33546447d085dbd18a350532220193/taskforce/utils.py#L88-L154 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.