repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 3
values | summary stringlengths 4 350 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
aptivate/django-sortable-listview | sortable_listview/views.py | SortableListView.get_basic_sort_link | def get_basic_sort_link(self, request, field):
"""
Thanks to del_query_parameters and get_querystring, we build the link
with preserving interesting get parameters and removing the others
"""
query_string = self.get_querystring()
sort_string = self.get_next_sort_string(fi... | python | def get_basic_sort_link(self, request, field):
"""
Thanks to del_query_parameters and get_querystring, we build the link
with preserving interesting get parameters and removing the others
"""
query_string = self.get_querystring()
sort_string = self.get_next_sort_string(fi... | [
"def",
"get_basic_sort_link",
"(",
"self",
",",
"request",
",",
"field",
")",
":",
"query_string",
"=",
"self",
".",
"get_querystring",
"(",
")",
"sort_string",
"=",
"self",
".",
"get_next_sort_string",
"(",
"field",
")",
"if",
"sort_string",
":",
"sort_link",... | Thanks to del_query_parameters and get_querystring, we build the link
with preserving interesting get parameters and removing the others | [
"Thanks",
"to",
"del_query_parameters",
"and",
"get_querystring",
"we",
"build",
"the",
"link",
"with",
"preserving",
"interesting",
"get",
"parameters",
"and",
"removing",
"the",
"others"
] | 9d5fa5847f0c3e80893780c6540e5098635ace9f | https://github.com/aptivate/django-sortable-listview/blob/9d5fa5847f0c3e80893780c6540e5098635ace9f/sortable_listview/views.py#L180-L195 | train | This method builds the sort link for the current resource based on the field and the request. |
manikos/django-progressiveimagefield | progressiveimagefield/fields.py | ProgressiveImageField.build_thumb_path | def build_thumb_path(self, image):
"""
Build the absolute path of the to-be-saved thumbnail.
"""
image_file = image.file
image_name_w_ext = split(image.name)[-1]
image_name, ext = splitext(image_name_w_ext)
if not self.in_memory(image_file):
# `image_f... | python | def build_thumb_path(self, image):
"""
Build the absolute path of the to-be-saved thumbnail.
"""
image_file = image.file
image_name_w_ext = split(image.name)[-1]
image_name, ext = splitext(image_name_w_ext)
if not self.in_memory(image_file):
# `image_f... | [
"def",
"build_thumb_path",
"(",
"self",
",",
"image",
")",
":",
"image_file",
"=",
"image",
".",
"file",
"image_name_w_ext",
"=",
"split",
"(",
"image",
".",
"name",
")",
"[",
"-",
"1",
"]",
"image_name",
",",
"ext",
"=",
"splitext",
"(",
"image_name_w_e... | Build the absolute path of the to-be-saved thumbnail. | [
"Build",
"the",
"absolute",
"path",
"of",
"the",
"to",
"-",
"be",
"-",
"saved",
"thumbnail",
"."
] | a432c79d23d87ea8944ac252ae7d15df1e4f3072 | https://github.com/manikos/django-progressiveimagefield/blob/a432c79d23d87ea8944ac252ae7d15df1e4f3072/progressiveimagefield/fields.py#L22-L37 | train | Build the absolute path of the to - be - saved thumbnail. |
manikos/django-progressiveimagefield | progressiveimagefield/fields.py | ProgressiveImageField.generate_thumb | def generate_thumb(self, image):
"""
Given a (large) image, generate a 10x10px thumbnail
with blur effect (in order to keep the size small)
"""
image_file = image.file
picture = Image.open(image_file).convert('RGB')
picture.thumbnail((10, 10))
picture.filt... | python | def generate_thumb(self, image):
"""
Given a (large) image, generate a 10x10px thumbnail
with blur effect (in order to keep the size small)
"""
image_file = image.file
picture = Image.open(image_file).convert('RGB')
picture.thumbnail((10, 10))
picture.filt... | [
"def",
"generate_thumb",
"(",
"self",
",",
"image",
")",
":",
"image_file",
"=",
"image",
".",
"file",
"picture",
"=",
"Image",
".",
"open",
"(",
"image_file",
")",
".",
"convert",
"(",
"'RGB'",
")",
"picture",
".",
"thumbnail",
"(",
"(",
"10",
",",
... | Given a (large) image, generate a 10x10px thumbnail
with blur effect (in order to keep the size small) | [
"Given",
"a",
"(",
"large",
")",
"image",
"generate",
"a",
"10x10px",
"thumbnail",
"with",
"blur",
"effect",
"(",
"in",
"order",
"to",
"keep",
"the",
"size",
"small",
")"
] | a432c79d23d87ea8944ac252ae7d15df1e4f3072 | https://github.com/manikos/django-progressiveimagefield/blob/a432c79d23d87ea8944ac252ae7d15df1e4f3072/progressiveimagefield/fields.py#L39-L49 | train | Generate a 10x10px thumbnail for the image |
thomasdelaet/python-velbus | velbus/messages/update_led_status.py | UpdateLedStatusMessage.data_to_binary | def data_to_binary(self):
"""
:return: bytes
"""
return bytes([
COMMAND_CODE,
self.channels_to_byte(self.led_on),
self.channels_to_byte(self.led_slow_blinking),
self.channels_to_byte(self.led_fast_blinking)
]) | python | def data_to_binary(self):
"""
:return: bytes
"""
return bytes([
COMMAND_CODE,
self.channels_to_byte(self.led_on),
self.channels_to_byte(self.led_slow_blinking),
self.channels_to_byte(self.led_fast_blinking)
]) | [
"def",
"data_to_binary",
"(",
"self",
")",
":",
"return",
"bytes",
"(",
"[",
"COMMAND_CODE",
",",
"self",
".",
"channels_to_byte",
"(",
"self",
".",
"led_on",
")",
",",
"self",
".",
"channels_to_byte",
"(",
"self",
".",
"led_slow_blinking",
")",
",",
"self... | :return: bytes | [
":",
"return",
":",
"bytes"
] | af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd | https://github.com/thomasdelaet/python-velbus/blob/af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd/velbus/messages/update_led_status.py#L35-L44 | train | Converts the data to binary format. |
uranusjr/django-gunicorn | djgunicorn/management/commands/gunserver.py | Command.run | def run(self, **options):
"""Override runserver's entry point to bring Gunicorn on.
A large portion of code in this method is copied from
`django.core.management.commands.runserver`.
"""
shutdown_message = options.get('shutdown_message', '')
self.stdout.write("Performin... | python | def run(self, **options):
"""Override runserver's entry point to bring Gunicorn on.
A large portion of code in this method is copied from
`django.core.management.commands.runserver`.
"""
shutdown_message = options.get('shutdown_message', '')
self.stdout.write("Performin... | [
"def",
"run",
"(",
"self",
",",
"*",
"*",
"options",
")",
":",
"shutdown_message",
"=",
"options",
".",
"get",
"(",
"'shutdown_message'",
",",
"''",
")",
"self",
".",
"stdout",
".",
"write",
"(",
"\"Performing system checks...\\n\\n\"",
")",
"self",
".",
"... | Override runserver's entry point to bring Gunicorn on.
A large portion of code in this method is copied from
`django.core.management.commands.runserver`. | [
"Override",
"runserver",
"s",
"entry",
"point",
"to",
"bring",
"Gunicorn",
"on",
"."
] | 4fb16f48048ff5fff8f889a007f376236646497b | https://github.com/uranusjr/django-gunicorn/blob/4fb16f48048ff5fff8f889a007f376236646497b/djgunicorn/management/commands/gunserver.py#L34-L63 | train | Override this method to bring Gunicorn on. |
KE-works/pykechain | pykechain/models/property_multi_reference.py | MultiReferenceProperty.value | def value(self):
"""Value of a reference property.
You can set the reference with a Part, Part id or None value.
Ensure that the model of the provided part, matches the configured model
:return: a :class:`Part` or None
:raises APIError: When unable to find the associated :class... | python | def value(self):
"""Value of a reference property.
You can set the reference with a Part, Part id or None value.
Ensure that the model of the provided part, matches the configured model
:return: a :class:`Part` or None
:raises APIError: When unable to find the associated :class... | [
"def",
"value",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_value",
":",
"return",
"None",
"if",
"not",
"self",
".",
"_cached_values",
"and",
"isinstance",
"(",
"self",
".",
"_value",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"ids",
"="... | Value of a reference property.
You can set the reference with a Part, Part id or None value.
Ensure that the model of the provided part, matches the configured model
:return: a :class:`Part` or None
:raises APIError: When unable to find the associated :class:`Part`
Example
... | [
"Value",
"of",
"a",
"reference",
"property",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/property_multi_reference.py#L21-L69 | train | Return the value of a reference property. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/external_packages/novainstrumentation/panthomkins/detect_panthomkins_peaks.py | detect_panthomkins_peaks | def detect_panthomkins_peaks(x, mph=None, mpd=1, threshold=0, edge='rising',
kpsh=False, valley=False, show=False, ax=None):
"""Detect peaks in data based on their amplitude and other features.
Parameters
----------
x : 1D array_like
data.
mph : {None, number}, optional (d... | python | def detect_panthomkins_peaks(x, mph=None, mpd=1, threshold=0, edge='rising',
kpsh=False, valley=False, show=False, ax=None):
"""Detect peaks in data based on their amplitude and other features.
Parameters
----------
x : 1D array_like
data.
mph : {None, number}, optional (d... | [
"def",
"detect_panthomkins_peaks",
"(",
"x",
",",
"mph",
"=",
"None",
",",
"mpd",
"=",
"1",
",",
"threshold",
"=",
"0",
",",
"edge",
"=",
"'rising'",
",",
"kpsh",
"=",
"False",
",",
"valley",
"=",
"False",
",",
"show",
"=",
"False",
",",
"ax",
"=",... | Detect peaks in data based on their amplitude and other features.
Parameters
----------
x : 1D array_like
data.
mph : {None, number}, optional (default = None)
detect peaks that are greater than minimum peak height.
mpd : positive integer, optional (default = 1)
detect peaks... | [
"Detect",
"peaks",
"in",
"data",
"based",
"on",
"their",
"amplitude",
"and",
"other",
"features",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/external_packages/novainstrumentation/panthomkins/detect_panthomkins_peaks.py#L11-L116 | train | Detect peaks in data based on their amplitude and other features. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/external_packages/novainstrumentation/panthomkins/detect_panthomkins_peaks.py | _plot | def _plot(x, mph, mpd, threshold, edge, valley, ax, ind):
"""Plot results of the detect_peaks function, see its help."""
try:
import matplotlib.pyplot as plt
except ImportError:
print('matplotlib is not available.')
else:
if ax is None:
_, ax = plt.subplots(1, 1, figs... | python | def _plot(x, mph, mpd, threshold, edge, valley, ax, ind):
"""Plot results of the detect_peaks function, see its help."""
try:
import matplotlib.pyplot as plt
except ImportError:
print('matplotlib is not available.')
else:
if ax is None:
_, ax = plt.subplots(1, 1, figs... | [
"def",
"_plot",
"(",
"x",
",",
"mph",
",",
"mpd",
",",
"threshold",
",",
"edge",
",",
"valley",
",",
"ax",
",",
"ind",
")",
":",
"try",
":",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"except",
"ImportError",
":",
"print",
"(",
"'matplotlib ... | Plot results of the detect_peaks function, see its help. | [
"Plot",
"results",
"of",
"the",
"detect_peaks",
"function",
"see",
"its",
"help",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/external_packages/novainstrumentation/panthomkins/detect_panthomkins_peaks.py#L119-L144 | train | Plots the results of the detect_peaks function. |
KE-works/pykechain | pykechain/models/activity2.py | Activity2.refresh | def refresh(self):
# type: () -> None
"""Refresh the object in place."""
from pykechain.client import API_EXTRA_PARAMS
src = self._client.reload(self, extra_params=API_EXTRA_PARAMS['activity'])
self.__dict__.update(src.__dict__) | python | def refresh(self):
# type: () -> None
"""Refresh the object in place."""
from pykechain.client import API_EXTRA_PARAMS
src = self._client.reload(self, extra_params=API_EXTRA_PARAMS['activity'])
self.__dict__.update(src.__dict__) | [
"def",
"refresh",
"(",
"self",
")",
":",
"# type: () -> None",
"from",
"pykechain",
".",
"client",
"import",
"API_EXTRA_PARAMS",
"src",
"=",
"self",
".",
"_client",
".",
"reload",
"(",
"self",
",",
"extra_params",
"=",
"API_EXTRA_PARAMS",
"[",
"'activity'",
"]... | Refresh the object in place. | [
"Refresh",
"the",
"object",
"in",
"place",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/activity2.py#L33-L38 | train | Refresh the object in place. |
KE-works/pykechain | pykechain/models/activity2.py | Activity2.assignees | def assignees(self):
"""List of assignees to the activity."""
if 'assignees' in self._json_data and self._json_data.get('assignees_ids') == list():
return []
elif 'assignees' in self._json_data and self._json_data.get('assignees_ids'):
assignees_ids_str = ','.join([str(id... | python | def assignees(self):
"""List of assignees to the activity."""
if 'assignees' in self._json_data and self._json_data.get('assignees_ids') == list():
return []
elif 'assignees' in self._json_data and self._json_data.get('assignees_ids'):
assignees_ids_str = ','.join([str(id... | [
"def",
"assignees",
"(",
"self",
")",
":",
"if",
"'assignees'",
"in",
"self",
".",
"_json_data",
"and",
"self",
".",
"_json_data",
".",
"get",
"(",
"'assignees_ids'",
")",
"==",
"list",
"(",
")",
":",
"return",
"[",
"]",
"elif",
"'assignees'",
"in",
"s... | List of assignees to the activity. | [
"List",
"of",
"assignees",
"to",
"the",
"activity",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/activity2.py#L45-L52 | train | List of assignees to the activity. |
KE-works/pykechain | pykechain/models/activity2.py | Activity2.is_rootlevel | def is_rootlevel(self):
"""
Determine if the Activity is at the root level of a project.
It will look for the name of the parent which should be either ActivityRootNames.WORKFLOW_ROOT or
ActivityRootNames.CATALOG_ROOT. If the name of the parent cannot be found an additional API call is ... | python | def is_rootlevel(self):
"""
Determine if the Activity is at the root level of a project.
It will look for the name of the parent which should be either ActivityRootNames.WORKFLOW_ROOT or
ActivityRootNames.CATALOG_ROOT. If the name of the parent cannot be found an additional API call is ... | [
"def",
"is_rootlevel",
"(",
"self",
")",
":",
"# when the activity itself is a root, than return False immediately",
"if",
"self",
".",
"is_root",
"(",
")",
":",
"return",
"False",
"parent_name",
"=",
"None",
"parent_dict",
"=",
"self",
".",
"_json_data",
".",
"get"... | Determine if the Activity is at the root level of a project.
It will look for the name of the parent which should be either ActivityRootNames.WORKFLOW_ROOT or
ActivityRootNames.CATALOG_ROOT. If the name of the parent cannot be found an additional API call is made
to retrieve the parent object (... | [
"Determine",
"if",
"the",
"Activity",
"is",
"at",
"the",
"root",
"level",
"of",
"a",
"project",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/activity2.py#L58-L82 | train | Determines if the Activity is at the root level of a project. |
KE-works/pykechain | pykechain/models/activity2.py | Activity2.parent | def parent(self):
"""Retrieve the parent in which this activity is defined.
If this is a task on top level, it raises NotFounderror.
:return: a :class:`Activity2`
:raises NotFoundError: when it is a task in the top level of a project
:raises APIError: when other error occurs
... | python | def parent(self):
"""Retrieve the parent in which this activity is defined.
If this is a task on top level, it raises NotFounderror.
:return: a :class:`Activity2`
:raises NotFoundError: when it is a task in the top level of a project
:raises APIError: when other error occurs
... | [
"def",
"parent",
"(",
"self",
")",
":",
"parent_id",
"=",
"self",
".",
"_json_data",
".",
"get",
"(",
"'parent_id'",
")",
"if",
"parent_id",
"is",
"None",
":",
"raise",
"NotFoundError",
"(",
"\"Cannot find subprocess for this task '{}', \"",
"\"as this task exist on... | Retrieve the parent in which this activity is defined.
If this is a task on top level, it raises NotFounderror.
:return: a :class:`Activity2`
:raises NotFoundError: when it is a task in the top level of a project
:raises APIError: when other error occurs
Example
------... | [
"Retrieve",
"the",
"parent",
"in",
"which",
"this",
"activity",
"is",
"defined",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/activity2.py#L192-L211 | train | Retrieve the parent of this activity. |
KE-works/pykechain | pykechain/models/activity2.py | Activity2.children | def children(self, **kwargs):
"""Retrieve the direct activities of this subprocess.
It returns a combination of Tasks (a.o. UserTasks) and Subprocesses on the direct descending level.
Only when the activity is a Subprocess, otherwise it raises a NotFoundError
:param kwargs: Additional ... | python | def children(self, **kwargs):
"""Retrieve the direct activities of this subprocess.
It returns a combination of Tasks (a.o. UserTasks) and Subprocesses on the direct descending level.
Only when the activity is a Subprocess, otherwise it raises a NotFoundError
:param kwargs: Additional ... | [
"def",
"children",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"activity_type",
"!=",
"ActivityType",
".",
"PROCESS",
":",
"raise",
"NotFoundError",
"(",
"\"Only subprocesses can have children, please choose a subprocess instead of a '{}' \"",
"\"... | Retrieve the direct activities of this subprocess.
It returns a combination of Tasks (a.o. UserTasks) and Subprocesses on the direct descending level.
Only when the activity is a Subprocess, otherwise it raises a NotFoundError
:param kwargs: Additional search arguments, check :func:`pykechain.... | [
"Retrieve",
"the",
"direct",
"activities",
"of",
"this",
"subprocess",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/activity2.py#L213-L239 | train | Retrieve the direct activities of this subprocess. |
KE-works/pykechain | pykechain/models/activity2.py | Activity2.siblings | def siblings(self, **kwargs):
"""Retrieve the other activities that also belong to the parent.
It returns a combination of Tasks (a.o. UserTasks) and Subprocesses on the level of the current task, including
itself. This also works if the activity is of type `ActivityType.PROCESS`.
:par... | python | def siblings(self, **kwargs):
"""Retrieve the other activities that also belong to the parent.
It returns a combination of Tasks (a.o. UserTasks) and Subprocesses on the level of the current task, including
itself. This also works if the activity is of type `ActivityType.PROCESS`.
:par... | [
"def",
"siblings",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"parent_id",
"=",
"self",
".",
"_json_data",
".",
"get",
"(",
"'parent_id'",
")",
"if",
"parent_id",
"is",
"None",
":",
"raise",
"NotFoundError",
"(",
"\"Cannot find subprocess for this task '{... | Retrieve the other activities that also belong to the parent.
It returns a combination of Tasks (a.o. UserTasks) and Subprocesses on the level of the current task, including
itself. This also works if the activity is of type `ActivityType.PROCESS`.
:param kwargs: Additional search arguments, c... | [
"Retrieve",
"the",
"other",
"activities",
"that",
"also",
"belong",
"to",
"the",
"parent",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/activity2.py#L241-L266 | train | Retrieve the other activities that also belong to the parent. |
KE-works/pykechain | pykechain/models/activity2.py | Activity2.edit | def edit(self, name=None, description=None, start_date=None, due_date=None, assignees=None, assignees_ids=None,
status=None):
"""Edit the details of an activity.
:param name: (optionally) edit the name of the activity
:type name: basestring or None
:param description: (opti... | python | def edit(self, name=None, description=None, start_date=None, due_date=None, assignees=None, assignees_ids=None,
status=None):
"""Edit the details of an activity.
:param name: (optionally) edit the name of the activity
:type name: basestring or None
:param description: (opti... | [
"def",
"edit",
"(",
"self",
",",
"name",
"=",
"None",
",",
"description",
"=",
"None",
",",
"start_date",
"=",
"None",
",",
"due_date",
"=",
"None",
",",
"assignees",
"=",
"None",
",",
"assignees_ids",
"=",
"None",
",",
"status",
"=",
"None",
")",
":... | Edit the details of an activity.
:param name: (optionally) edit the name of the activity
:type name: basestring or None
:param description: (optionally) edit the description of the activity
:type description: basestring or None
:param start_date: (optionally) edit the start date... | [
"Edit",
"the",
"details",
"of",
"an",
"activity",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/activity2.py#L268-L395 | train | Edit the details of an activity. |
KE-works/pykechain | pykechain/models/activity2.py | Activity2.configure | def configure(self, inputs, outputs):
"""Configure activity input and output.
You need to provide a list of input and output :class:`Property`. Does not work with lists of propery id's.
:param inputs: iterable of input property models
:type inputs: list(:class:`Property`)
:para... | python | def configure(self, inputs, outputs):
"""Configure activity input and output.
You need to provide a list of input and output :class:`Property`. Does not work with lists of propery id's.
:param inputs: iterable of input property models
:type inputs: list(:class:`Property`)
:para... | [
"def",
"configure",
"(",
"self",
",",
"inputs",
",",
"outputs",
")",
":",
"def",
"_get_propertyset",
"(",
"proplist",
")",
":",
"\"\"\"Make it into a unique list of properties to configure for either inputs or outputs.\"\"\"",
"from",
"pykechain",
".",
"models",
"import",
... | Configure activity input and output.
You need to provide a list of input and output :class:`Property`. Does not work with lists of propery id's.
:param inputs: iterable of input property models
:type inputs: list(:class:`Property`)
:param outputs: iterable of output property models
... | [
"Configure",
"activity",
"input",
"and",
"output",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/activity2.py#L401-L435 | train | Configure the activity input and output. |
KE-works/pykechain | pykechain/models/activity2.py | Activity2.download_as_pdf | def download_as_pdf(self, target_dir=None, pdf_filename=None, paper_size=PaperSize.A4,
paper_orientation=PaperOrientation.PORTRAIT, include_appendices=False):
"""
Retrieve the PDF of the Activity.
.. versionadded:: 2.1
:param target_dir: (optional) directory pat... | python | def download_as_pdf(self, target_dir=None, pdf_filename=None, paper_size=PaperSize.A4,
paper_orientation=PaperOrientation.PORTRAIT, include_appendices=False):
"""
Retrieve the PDF of the Activity.
.. versionadded:: 2.1
:param target_dir: (optional) directory pat... | [
"def",
"download_as_pdf",
"(",
"self",
",",
"target_dir",
"=",
"None",
",",
"pdf_filename",
"=",
"None",
",",
"paper_size",
"=",
"PaperSize",
".",
"A4",
",",
"paper_orientation",
"=",
"PaperOrientation",
".",
"PORTRAIT",
",",
"include_appendices",
"=",
"False",
... | Retrieve the PDF of the Activity.
.. versionadded:: 2.1
:param target_dir: (optional) directory path name where the store the log.txt to.
:type target_dir: basestring or None
:param pdf_filename: (optional) log filename to write the log to, defaults to `log.txt`.
:type pdf_file... | [
"Retrieve",
"the",
"PDF",
"of",
"the",
"Activity",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/activity2.py#L437-L509 | train | Download the activity as a PDF. |
thomasdelaet/python-velbus | velbus/messages/cover_down.py | CoverDownMessage2.populate | def populate(self, priority, address, rtr, data):
"""
:return: None
"""
assert isinstance(data, bytes)
self.needs_high_priority(priority)
self.needs_no_rtr(rtr)
self.needs_data(data, 4)
self.set_attributes(priority, address, rtr)
# 00000011 = chann... | python | def populate(self, priority, address, rtr, data):
"""
:return: None
"""
assert isinstance(data, bytes)
self.needs_high_priority(priority)
self.needs_no_rtr(rtr)
self.needs_data(data, 4)
self.set_attributes(priority, address, rtr)
# 00000011 = chann... | [
"def",
"populate",
"(",
"self",
",",
"priority",
",",
"address",
",",
"rtr",
",",
"data",
")",
":",
"assert",
"isinstance",
"(",
"data",
",",
"bytes",
")",
"self",
".",
"needs_high_priority",
"(",
"priority",
")",
"self",
".",
"needs_no_rtr",
"(",
"rtr",... | :return: None | [
":",
"return",
":",
"None"
] | af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd | https://github.com/thomasdelaet/python-velbus/blob/af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd/velbus/messages/cover_down.py#L75-L91 | train | Populates the internal state of the object with the data. |
thomasdelaet/python-velbus | velbus/messages/cover_down.py | CoverDownMessage2.data_to_binary | def data_to_binary(self):
"""
:return: bytes
"""
if self.channel == 0x01:
tmp = 0x03
else:
tmp = 0x0C
return bytes([
COMMAND_CODE,
tmp
]) + struct.pack('>L', self.delay_time)[-3:] | python | def data_to_binary(self):
"""
:return: bytes
"""
if self.channel == 0x01:
tmp = 0x03
else:
tmp = 0x0C
return bytes([
COMMAND_CODE,
tmp
]) + struct.pack('>L', self.delay_time)[-3:] | [
"def",
"data_to_binary",
"(",
"self",
")",
":",
"if",
"self",
".",
"channel",
"==",
"0x01",
":",
"tmp",
"=",
"0x03",
"else",
":",
"tmp",
"=",
"0x0C",
"return",
"bytes",
"(",
"[",
"COMMAND_CODE",
",",
"tmp",
"]",
")",
"+",
"struct",
".",
"pack",
"("... | :return: bytes | [
":",
"return",
":",
"bytes"
] | af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd | https://github.com/thomasdelaet/python-velbus/blob/af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd/velbus/messages/cover_down.py#L108-L120 | train | Convert the data to binary format. |
kytos/kytos-utils | kytos/cli/commands/users/parser.py | parse | def parse(argv):
"""Parse cli args."""
args = docopt(__doc__, argv=argv)
try:
call(sys.argv[2], args)
except KytosException as exception:
print("Error parsing args: {}".format(exception))
exit() | python | def parse(argv):
"""Parse cli args."""
args = docopt(__doc__, argv=argv)
try:
call(sys.argv[2], args)
except KytosException as exception:
print("Error parsing args: {}".format(exception))
exit() | [
"def",
"parse",
"(",
"argv",
")",
":",
"args",
"=",
"docopt",
"(",
"__doc__",
",",
"argv",
"=",
"argv",
")",
"try",
":",
"call",
"(",
"sys",
".",
"argv",
"[",
"2",
"]",
",",
"args",
")",
"except",
"KytosException",
"as",
"exception",
":",
"print",
... | Parse cli args. | [
"Parse",
"cli",
"args",
"."
] | b4750c618d15cff75970ea6124bda4d2b9a33578 | https://github.com/kytos/kytos-utils/blob/b4750c618d15cff75970ea6124bda4d2b9a33578/kytos/cli/commands/users/parser.py#L26-L33 | train | Parse cli args. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/signal_samples.py | load_signal | def load_signal(signal_handler, get_header=False):
"""
-----
Brief
-----
Function that returns a dictionary with the data contained inside 'signal_name' file (stored in
the biosignalsnotebooks signal samples directory).
-----------
Description
-----------
Biosignalsnotebooks lib... | python | def load_signal(signal_handler, get_header=False):
"""
-----
Brief
-----
Function that returns a dictionary with the data contained inside 'signal_name' file (stored in
the biosignalsnotebooks signal samples directory).
-----------
Description
-----------
Biosignalsnotebooks lib... | [
"def",
"load_signal",
"(",
"signal_handler",
",",
"get_header",
"=",
"False",
")",
":",
"available_signals",
"=",
"[",
"\"ecg_4000_Hz\"",
",",
"\"ecg_5_min\"",
",",
"\"ecg_sample\"",
",",
"\"ecg_20_sec_10_Hz\"",
",",
"\"ecg_20_sec_100_Hz\"",
",",
"\"ecg_20_sec_1000_Hz\"... | -----
Brief
-----
Function that returns a dictionary with the data contained inside 'signal_name' file (stored in
the biosignalsnotebooks signal samples directory).
-----------
Description
-----------
Biosignalsnotebooks library provides data samples in order to the users that are new t... | [
"-----",
"Brief",
"-----",
"Function",
"that",
"returns",
"a",
"dictionary",
"with",
"the",
"data",
"contained",
"inside",
"signal_name",
"file",
"(",
"stored",
"in",
"the",
"biosignalsnotebooks",
"signal",
"samples",
"directory",
")",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/signal_samples.py#L39-L203 | train | This function loads the signal from the specified file and returns the data contained inside the signal samples directory. |
thomasdelaet/python-velbus | velbus/messages/module_type.py | ModuleTypeMessage.module_name | def module_name(self):
"""
:return: str
"""
if self.module_type in velbus.MODULE_DIRECTORY.keys():
return velbus.MODULE_DIRECTORY[self.module_type]
return "Unknown" | python | def module_name(self):
"""
:return: str
"""
if self.module_type in velbus.MODULE_DIRECTORY.keys():
return velbus.MODULE_DIRECTORY[self.module_type]
return "Unknown" | [
"def",
"module_name",
"(",
"self",
")",
":",
"if",
"self",
".",
"module_type",
"in",
"velbus",
".",
"MODULE_DIRECTORY",
".",
"keys",
"(",
")",
":",
"return",
"velbus",
".",
"MODULE_DIRECTORY",
"[",
"self",
".",
"module_type",
"]",
"return",
"\"Unknown\""
] | :return: str | [
":",
"return",
":",
"str"
] | af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd | https://github.com/thomasdelaet/python-velbus/blob/af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd/velbus/messages/module_type.py#L28-L34 | train | Returns the name of the module that this instance is in. |
thomasdelaet/python-velbus | velbus/messages/module_type.py | ModuleTypeMessage.populate | def populate(self, priority, address, rtr, data):
"""
:return: None
"""
assert isinstance(data, bytes)
self.needs_low_priority(priority)
self.needs_no_rtr(rtr)
self.needs_data(data, 4)
self.set_attributes(priority, address, rtr)
self.module_type = ... | python | def populate(self, priority, address, rtr, data):
"""
:return: None
"""
assert isinstance(data, bytes)
self.needs_low_priority(priority)
self.needs_no_rtr(rtr)
self.needs_data(data, 4)
self.set_attributes(priority, address, rtr)
self.module_type = ... | [
"def",
"populate",
"(",
"self",
",",
"priority",
",",
"address",
",",
"rtr",
",",
"data",
")",
":",
"assert",
"isinstance",
"(",
"data",
",",
"bytes",
")",
"self",
".",
"needs_low_priority",
"(",
"priority",
")",
"self",
".",
"needs_no_rtr",
"(",
"rtr",
... | :return: None | [
":",
"return",
":",
"None"
] | af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd | https://github.com/thomasdelaet/python-velbus/blob/af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd/velbus/messages/module_type.py#L36-L51 | train | Populates the internal state of the object with the data from the specified memory map. |
thomasdelaet/python-velbus | velbus/messages/module_type.py | ModuleTypeMessage.data_to_binary | def data_to_binary(self):
"""
:return: bytes
"""
return bytes([
COMMAND_CODE,
self.module_type,
self.channels_to_byte(self.led_on),
self.channels_to_byte(self.led_slow_blinking),
self.channels_to_byte(self.led_fast_blinking),
... | python | def data_to_binary(self):
"""
:return: bytes
"""
return bytes([
COMMAND_CODE,
self.module_type,
self.channels_to_byte(self.led_on),
self.channels_to_byte(self.led_slow_blinking),
self.channels_to_byte(self.led_fast_blinking),
... | [
"def",
"data_to_binary",
"(",
"self",
")",
":",
"return",
"bytes",
"(",
"[",
"COMMAND_CODE",
",",
"self",
".",
"module_type",
",",
"self",
".",
"channels_to_byte",
"(",
"self",
".",
"led_on",
")",
",",
"self",
".",
"channels_to_byte",
"(",
"self",
".",
"... | :return: bytes | [
":",
"return",
":",
"bytes"
] | af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd | https://github.com/thomasdelaet/python-velbus/blob/af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd/velbus/messages/module_type.py#L53-L65 | train | Converts the ISO - 1452 status to binary format. |
kytos/kytos-utils | setup.py | Cleaner.run | def run(self):
"""Clean build, dist, pyc and egg from package and docs."""
super().run()
call('rm -vrf ./build ./dist ./*.egg-info', shell=True)
call('find . -name __pycache__ -type d | xargs rm -rf', shell=True)
call('test -d docs && make -C docs/ clean', shell=True) | python | def run(self):
"""Clean build, dist, pyc and egg from package and docs."""
super().run()
call('rm -vrf ./build ./dist ./*.egg-info', shell=True)
call('find . -name __pycache__ -type d | xargs rm -rf', shell=True)
call('test -d docs && make -C docs/ clean', shell=True) | [
"def",
"run",
"(",
"self",
")",
":",
"super",
"(",
")",
".",
"run",
"(",
")",
"call",
"(",
"'rm -vrf ./build ./dist ./*.egg-info'",
",",
"shell",
"=",
"True",
")",
"call",
"(",
"'find . -name __pycache__ -type d | xargs rm -rf'",
",",
"shell",
"=",
"True",
")"... | Clean build, dist, pyc and egg from package and docs. | [
"Clean",
"build",
"dist",
"pyc",
"and",
"egg",
"from",
"package",
"and",
"docs",
"."
] | b4750c618d15cff75970ea6124bda4d2b9a33578 | https://github.com/kytos/kytos-utils/blob/b4750c618d15cff75970ea6124bda4d2b9a33578/setup.py#L71-L76 | train | Clean build dist pyc and egg from package and docs. |
kytos/kytos-utils | setup.py | Linter.run | def run(self):
"""Run yala."""
print('Yala is running. It may take several seconds...')
try:
check_call('yala setup.py tests kytos', shell=True)
print('No linter error found.')
except CalledProcessError:
print('Linter check failed. Fix the error(s) abo... | python | def run(self):
"""Run yala."""
print('Yala is running. It may take several seconds...')
try:
check_call('yala setup.py tests kytos', shell=True)
print('No linter error found.')
except CalledProcessError:
print('Linter check failed. Fix the error(s) abo... | [
"def",
"run",
"(",
"self",
")",
":",
"print",
"(",
"'Yala is running. It may take several seconds...'",
")",
"try",
":",
"check_call",
"(",
"'yala setup.py tests kytos'",
",",
"shell",
"=",
"True",
")",
"print",
"(",
"'No linter error found.'",
")",
"except",
"Calle... | Run yala. | [
"Run",
"yala",
"."
] | b4750c618d15cff75970ea6124bda4d2b9a33578 | https://github.com/kytos/kytos-utils/blob/b4750c618d15cff75970ea6124bda4d2b9a33578/setup.py#L106-L114 | train | Run yala. |
kytos/kytos-utils | setup.py | CommonInstall._create_data_files_directory | def _create_data_files_directory(symlink=False):
"""Install data_files in the /etc directory."""
current_directory = os.path.abspath(os.path.dirname(__file__))
etc_kytos = os.path.join(BASE_ENV, ETC_KYTOS)
if not os.path.exists(etc_kytos):
os.makedirs(etc_kytos)
sr... | python | def _create_data_files_directory(symlink=False):
"""Install data_files in the /etc directory."""
current_directory = os.path.abspath(os.path.dirname(__file__))
etc_kytos = os.path.join(BASE_ENV, ETC_KYTOS)
if not os.path.exists(etc_kytos):
os.makedirs(etc_kytos)
sr... | [
"def",
"_create_data_files_directory",
"(",
"symlink",
"=",
"False",
")",
":",
"current_directory",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",
")",
"etc_kytos",
"=",
"os",
".",
"path",
".",
"join... | Install data_files in the /etc directory. | [
"Install",
"data_files",
"in",
"the",
"/",
"etc",
"directory",
"."
] | b4750c618d15cff75970ea6124bda4d2b9a33578 | https://github.com/kytos/kytos-utils/blob/b4750c618d15cff75970ea6124bda4d2b9a33578/setup.py#L121-L144 | train | Create the data_files directory in the / etc directory. |
mozilla/FoxPuppet | foxpuppet/windows/browser/notifications/addons.py | AddOnInstallBlocked.allow | def allow(self):
"""Allow the add-on to be installed."""
with self.selenium.context(self.selenium.CONTEXT_CHROME):
self.find_primary_button().click() | python | def allow(self):
"""Allow the add-on to be installed."""
with self.selenium.context(self.selenium.CONTEXT_CHROME):
self.find_primary_button().click() | [
"def",
"allow",
"(",
"self",
")",
":",
"with",
"self",
".",
"selenium",
".",
"context",
"(",
"self",
".",
"selenium",
".",
"CONTEXT_CHROME",
")",
":",
"self",
".",
"find_primary_button",
"(",
")",
".",
"click",
"(",
")"
] | Allow the add-on to be installed. | [
"Allow",
"the",
"add",
"-",
"on",
"to",
"be",
"installed",
"."
] | 6575eb4c72fd024c986b254e198c8b4e6f68cddd | https://github.com/mozilla/FoxPuppet/blob/6575eb4c72fd024c986b254e198c8b4e6f68cddd/foxpuppet/windows/browser/notifications/addons.py#L14-L17 | train | Allow the add - on to be installed. |
mozilla/FoxPuppet | foxpuppet/windows/browser/notifications/addons.py | AddOnInstallConfirmation.addon_name | def addon_name(self):
"""Provide access to the add-on name.
Returns:
str: Add-on name.
"""
with self.selenium.context(self.selenium.CONTEXT_CHROME):
el = self.find_description()
return el.find_element(By.CSS_SELECTOR, "b").text | python | def addon_name(self):
"""Provide access to the add-on name.
Returns:
str: Add-on name.
"""
with self.selenium.context(self.selenium.CONTEXT_CHROME):
el = self.find_description()
return el.find_element(By.CSS_SELECTOR, "b").text | [
"def",
"addon_name",
"(",
"self",
")",
":",
"with",
"self",
".",
"selenium",
".",
"context",
"(",
"self",
".",
"selenium",
".",
"CONTEXT_CHROME",
")",
":",
"el",
"=",
"self",
".",
"find_description",
"(",
")",
"return",
"el",
".",
"find_element",
"(",
... | Provide access to the add-on name.
Returns:
str: Add-on name. | [
"Provide",
"access",
"to",
"the",
"add",
"-",
"on",
"name",
"."
] | 6575eb4c72fd024c986b254e198c8b4e6f68cddd | https://github.com/mozilla/FoxPuppet/blob/6575eb4c72fd024c986b254e198c8b4e6f68cddd/foxpuppet/windows/browser/notifications/addons.py#L24-L33 | train | Provide access to the add - on name. |
mozilla/FoxPuppet | foxpuppet/windows/browser/notifications/addons.py | AddOnInstallConfirmation.cancel | def cancel(self):
"""Cancel add-on install."""
with self.selenium.context(self.selenium.CONTEXT_CHROME):
self.find_secondary_button().click() | python | def cancel(self):
"""Cancel add-on install."""
with self.selenium.context(self.selenium.CONTEXT_CHROME):
self.find_secondary_button().click() | [
"def",
"cancel",
"(",
"self",
")",
":",
"with",
"self",
".",
"selenium",
".",
"context",
"(",
"self",
".",
"selenium",
".",
"CONTEXT_CHROME",
")",
":",
"self",
".",
"find_secondary_button",
"(",
")",
".",
"click",
"(",
")"
] | Cancel add-on install. | [
"Cancel",
"add",
"-",
"on",
"install",
"."
] | 6575eb4c72fd024c986b254e198c8b4e6f68cddd | https://github.com/mozilla/FoxPuppet/blob/6575eb4c72fd024c986b254e198c8b4e6f68cddd/foxpuppet/windows/browser/notifications/addons.py#L35-L38 | train | Cancel add - on install. |
mozilla/FoxPuppet | foxpuppet/windows/browser/notifications/addons.py | AddOnInstallConfirmation.install | def install(self):
"""Confirm add-on install."""
with self.selenium.context(self.selenium.CONTEXT_CHROME):
self.find_primary_button().click() | python | def install(self):
"""Confirm add-on install."""
with self.selenium.context(self.selenium.CONTEXT_CHROME):
self.find_primary_button().click() | [
"def",
"install",
"(",
"self",
")",
":",
"with",
"self",
".",
"selenium",
".",
"context",
"(",
"self",
".",
"selenium",
".",
"CONTEXT_CHROME",
")",
":",
"self",
".",
"find_primary_button",
"(",
")",
".",
"click",
"(",
")"
] | Confirm add-on install. | [
"Confirm",
"add",
"-",
"on",
"install",
"."
] | 6575eb4c72fd024c986b254e198c8b4e6f68cddd | https://github.com/mozilla/FoxPuppet/blob/6575eb4c72fd024c986b254e198c8b4e6f68cddd/foxpuppet/windows/browser/notifications/addons.py#L40-L43 | train | Confirm add - on install. |
mozilla/FoxPuppet | foxpuppet/windows/browser/notifications/addons.py | AddOnInstallComplete.close | def close(self):
"""Close the notification."""
with self.selenium.context(self.selenium.CONTEXT_CHROME):
if self.window.firefox_version > 63:
self.find_primary_button().click()
self.window.wait_for_notification(None)
else:
BaseNotif... | python | def close(self):
"""Close the notification."""
with self.selenium.context(self.selenium.CONTEXT_CHROME):
if self.window.firefox_version > 63:
self.find_primary_button().click()
self.window.wait_for_notification(None)
else:
BaseNotif... | [
"def",
"close",
"(",
"self",
")",
":",
"with",
"self",
".",
"selenium",
".",
"context",
"(",
"self",
".",
"selenium",
".",
"CONTEXT_CHROME",
")",
":",
"if",
"self",
".",
"window",
".",
"firefox_version",
">",
"63",
":",
"self",
".",
"find_primary_button"... | Close the notification. | [
"Close",
"the",
"notification",
"."
] | 6575eb4c72fd024c986b254e198c8b4e6f68cddd | https://github.com/mozilla/FoxPuppet/blob/6575eb4c72fd024c986b254e198c8b4e6f68cddd/foxpuppet/windows/browser/notifications/addons.py#L49-L56 | train | Close the notification. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py | load | def load(file, channels=None, devices=None, get_header=False, remote=False, out_dict=False, signal_sample=False, **kwargs):
"""
-----
Brief
-----
Universal function for reading .txt, .h5 and .edf (future) files generated by OpenSignals.
-----------
Description
-----------
Each acqui... | python | def load(file, channels=None, devices=None, get_header=False, remote=False, out_dict=False, signal_sample=False, **kwargs):
"""
-----
Brief
-----
Universal function for reading .txt, .h5 and .edf (future) files generated by OpenSignals.
-----------
Description
-----------
Each acqui... | [
"def",
"load",
"(",
"file",
",",
"channels",
"=",
"None",
",",
"devices",
"=",
"None",
",",
"get_header",
"=",
"False",
",",
"remote",
"=",
"False",
",",
"out_dict",
"=",
"False",
",",
"signal_sample",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",... | -----
Brief
-----
Universal function for reading .txt, .h5 and .edf (future) files generated by OpenSignals.
-----------
Description
-----------
Each acquisition made using the OpenSignals software (available at https://www.biosignalsplux.com/en/software)
stores the acquired data in thr... | [
"-----",
"Brief",
"-----",
"Universal",
"function",
"for",
"reading",
".",
"txt",
".",
"h5",
"and",
".",
"edf",
"(",
"future",
")",
"files",
"generated",
"by",
"OpenSignals",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py#L67-L277 | train | This function loads the data from a file. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py | read_header | def read_header(file):
"""
-----
Brief
-----
Universal function for reading the header of .txt, .h5 and .edf files generated by OpenSignals.
-----------
Description
-----------
Each file generated by the OpenSignals software (available at https://www.biosignalsplux.com/en/software) ... | python | def read_header(file):
"""
-----
Brief
-----
Universal function for reading the header of .txt, .h5 and .edf files generated by OpenSignals.
-----------
Description
-----------
Each file generated by the OpenSignals software (available at https://www.biosignalsplux.com/en/software) ... | [
"def",
"read_header",
"(",
"file",
")",
":",
"# =============================================================================================",
"# ============================== Identification of File Type ==================================",
"# ======================================================... | -----
Brief
-----
Universal function for reading the header of .txt, .h5 and .edf files generated by OpenSignals.
-----------
Description
-----------
Each file generated by the OpenSignals software (available at https://www.biosignalsplux.com/en/software) owns a set
of metadata that all... | [
"-----",
"Brief",
"-----",
"Universal",
"function",
"for",
"reading",
"the",
"header",
"of",
".",
"txt",
".",
"h5",
"and",
".",
"edf",
"files",
"generated",
"by",
"OpenSignals",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py#L280-L452 | train | Reads the header of a file and returns a dictionary containing the header data. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py | clean_temp | def clean_temp():
"""
-----
Brief
-----
Function for cleaning the temporary folder inside the package.
-----------
Description
-----------
Data processing may generate temporary files that occupy the storage of the computer.
This function allows the user to clean the temporary ... | python | def clean_temp():
"""
-----
Brief
-----
Function for cleaning the temporary folder inside the package.
-----------
Description
-----------
Data processing may generate temporary files that occupy the storage of the computer.
This function allows the user to clean the temporary ... | [
"def",
"clean_temp",
"(",
")",
":",
"folder",
"=",
"'tempOST'",
"for",
"the_file",
"in",
"os",
".",
"listdir",
"(",
"folder",
")",
":",
"file_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"folder",
",",
"the_file",
")",
"try",
":",
"if",
"os",
"... | -----
Brief
-----
Function for cleaning the temporary folder inside the package.
-----------
Description
-----------
Data processing may generate temporary files that occupy the storage of the computer.
This function allows the user to clean the temporary files when necessary.
sou... | [
"-----",
"Brief",
"-----",
"Function",
"for",
"cleaning",
"the",
"temporary",
"folder",
"inside",
"the",
"package",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py#L455-L480 | train | Function for cleaning the temporary folder inside the package. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py | _load_txt | def _load_txt(file, devices, channels, header, **kwargs):
"""
Function used for reading .txt files generated by OpenSignals.
----------
Parameters
----------
file : file, str, or pathlib.Path
File, filename, or generator to read. If the filename extension is
``.gz`` or ``.bz2``... | python | def _load_txt(file, devices, channels, header, **kwargs):
"""
Function used for reading .txt files generated by OpenSignals.
----------
Parameters
----------
file : file, str, or pathlib.Path
File, filename, or generator to read. If the filename extension is
``.gz`` or ``.bz2``... | [
"def",
"_load_txt",
"(",
"file",
",",
"devices",
",",
"channels",
",",
"header",
",",
"*",
"*",
"kwargs",
")",
":",
"# %%%%%%%%%%%%%%%%%%%%%%%%%%% Exclusion of invalid keywords %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
"kwargs_txt",
"=",
"_filter_keywords",
"(",
"numpy",
".",... | Function used for reading .txt files generated by OpenSignals.
----------
Parameters
----------
file : file, str, or pathlib.Path
File, filename, or generator to read. If the filename extension is
``.gz`` or ``.bz2``, the file is first decompressed. Note that
generators should ... | [
"Function",
"used",
"for",
"reading",
".",
"txt",
"files",
"generated",
"by",
"OpenSignals",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py#L487-L533 | train | Function used for reading. txt files generated by OpenSignals. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py | _load_h5 | def _load_h5(file, devices, channels):
"""
Function used for reading .h5 files generated by OpenSignals.
----------
Parameters
----------
file : file path.
File Path.
devices : list ["mac_address_1" <str>, "mac_address_2" <str>...]
List of devices selected by the user.
... | python | def _load_h5(file, devices, channels):
"""
Function used for reading .h5 files generated by OpenSignals.
----------
Parameters
----------
file : file path.
File Path.
devices : list ["mac_address_1" <str>, "mac_address_2" <str>...]
List of devices selected by the user.
... | [
"def",
"_load_h5",
"(",
"file",
",",
"devices",
",",
"channels",
")",
":",
"# %%%%%%%%%%%%%%%%%%%%%%%%%%%% Creation of h5py object %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
"h5_object",
"=",
"h5py",
".",
"File",
"(",
"file",
")",
"# %%%%%%%%%%%%%%%%%%%%%%%%% Data of the selec... | Function used for reading .h5 files generated by OpenSignals.
----------
Parameters
----------
file : file path.
File Path.
devices : list ["mac_address_1" <str>, "mac_address_2" <str>...]
List of devices selected by the user.
channels : list [[mac_address_1_channel_1 <int>, m... | [
"Function",
"used",
"for",
"reading",
".",
"h5",
"files",
"generated",
"by",
"OpenSignals",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py#L536-L577 | train | Function used for reading the H5 file. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py | _check_shape_and_type | def _check_shape_and_type(devices, channels):
"""
Function used for checking if the shape of "devices" and "channels" fields of load function
have the same shape (the number of elements in the list specified in "devices" is equal to
the number of sublists inside "channels" field).
Both "devices" and... | python | def _check_shape_and_type(devices, channels):
"""
Function used for checking if the shape of "devices" and "channels" fields of load function
have the same shape (the number of elements in the list specified in "devices" is equal to
the number of sublists inside "channels" field).
Both "devices" and... | [
"def",
"_check_shape_and_type",
"(",
"devices",
",",
"channels",
")",
":",
"if",
"isinstance",
"(",
"devices",
",",
"type",
"(",
"channels",
")",
")",
":",
"# Comparision of type.",
"dev_chn_type",
"=",
"type",
"(",
"devices",
")",
"if",
"devices",
"is",
"No... | Function used for checking if the shape of "devices" and "channels" fields of load function
have the same shape (the number of elements in the list specified in "devices" is equal to
the number of sublists inside "channels" field).
Both "devices" and "channels" must be lists.
----------
Parameters
... | [
"Function",
"used",
"for",
"checking",
"if",
"the",
"shape",
"of",
"devices",
"and",
"channels",
"fields",
"of",
"load",
"function",
"have",
"the",
"same",
"shape",
"(",
"the",
"number",
"of",
"elements",
"in",
"the",
"list",
"specified",
"in",
"devices",
... | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py#L580-L639 | train | Checks if the shape of devices and channels fields of load function are consistent. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py | _check_chn_type | def _check_chn_type(channels, available_channels):
"""
Function used for checking weather the elements in "channels" input are coincident with the
available channels.
----------
Parameters
----------
channels : list [[mac_address_1_channel_1 <int>, mac_address_1_channel_2 <int>...],
... | python | def _check_chn_type(channels, available_channels):
"""
Function used for checking weather the elements in "channels" input are coincident with the
available channels.
----------
Parameters
----------
channels : list [[mac_address_1_channel_1 <int>, mac_address_1_channel_2 <int>...],
... | [
"def",
"_check_chn_type",
"(",
"channels",
",",
"available_channels",
")",
":",
"# ------------------------ Definition of constants and variables -------------------------------",
"chn_list_standardized",
"=",
"[",
"]",
"# %%%%%%%%%%%%%%%%%%%%%%%%%%% Fill of \"chn_list_standardized\" %%%%%... | Function used for checking weather the elements in "channels" input are coincident with the
available channels.
----------
Parameters
----------
channels : list [[mac_address_1_channel_1 <int>, mac_address_1_channel_2 <int>...],
[mac_address_2_channel_1 <int>...]...]
Fro... | [
"Function",
"used",
"for",
"checking",
"weather",
"the",
"elements",
"in",
"channels",
"input",
"are",
"coincident",
"with",
"the",
"available",
"channels",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py#L642-L683 | train | Function used for checking weather the elements in channels input are coincident with the available channels. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py | _available_channels | def _available_channels(devices, header):
"""
Function used for the determination of the available channels in each device.
----------
Parameters
----------
devices : list ["mac_address_1" <str>, "mac_address_2" <str>...]
List of devices selected by the user.
header: dict
D... | python | def _available_channels(devices, header):
"""
Function used for the determination of the available channels in each device.
----------
Parameters
----------
devices : list ["mac_address_1" <str>, "mac_address_2" <str>...]
List of devices selected by the user.
header: dict
D... | [
"def",
"_available_channels",
"(",
"devices",
",",
"header",
")",
":",
"# ------------------------ Definition of constants and variables ------------------------------",
"chn_dict",
"=",
"{",
"}",
"# %%%%%%%%%%%%%%%%%%%%%% Access to the relevant data in the header %%%%%%%%%%%%%%%%%%%%%%%%%... | Function used for the determination of the available channels in each device.
----------
Parameters
----------
devices : list ["mac_address_1" <str>, "mac_address_2" <str>...]
List of devices selected by the user.
header: dict
Dictionary that contains auxiliary data of the acquisit... | [
"Function",
"used",
"for",
"the",
"determination",
"of",
"the",
"available",
"channels",
"in",
"each",
"device",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py#L686-L714 | train | Function used for determination of the available channels in each device. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py | _check_dev_type | def _check_dev_type(devices, dev_list):
"""
Function used for checking weather the "devices" field only contain devices used during the
acquisition.
----------
Parameters
----------
devices : list ["mac_address_1" <str>, "mac_address_2" <str>...]
List of devices selected by the user... | python | def _check_dev_type(devices, dev_list):
"""
Function used for checking weather the "devices" field only contain devices used during the
acquisition.
----------
Parameters
----------
devices : list ["mac_address_1" <str>, "mac_address_2" <str>...]
List of devices selected by the user... | [
"def",
"_check_dev_type",
"(",
"devices",
",",
"dev_list",
")",
":",
"if",
"devices",
"is",
"not",
"None",
":",
"for",
"device",
"in",
"devices",
":",
"if",
"device",
"in",
"dev_list",
":",
"# List element is one of the available devices.",
"continue",
"else",
"... | Function used for checking weather the "devices" field only contain devices used during the
acquisition.
----------
Parameters
----------
devices : list ["mac_address_1" <str>, "mac_address_2" <str>...]
List of devices selected by the user.
dev_list : list
List of available dev... | [
"Function",
"used",
"for",
"checking",
"weather",
"the",
"devices",
"field",
"only",
"contain",
"devices",
"used",
"during",
"the",
"acquisition",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py#L717-L750 | train | Function used for checking weather the devices field only contains devices used during the acquisition file. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py | _file_type | def _file_type(file):
"""
Function intended for identification of the file type.
----------
Parameters
----------
file : file path
File path.
Returns
-------
out : str
Identified file type.
"""
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%% Verification of file type %%%%%... | python | def _file_type(file):
"""
Function intended for identification of the file type.
----------
Parameters
----------
file : file path
File path.
Returns
-------
out : str
Identified file type.
"""
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%% Verification of file type %%%%%... | [
"def",
"_file_type",
"(",
"file",
")",
":",
"# %%%%%%%%%%%%%%%%%%%%%%%%%%%%% Verification of file type %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
"if",
"\".\"",
"in",
"file",
":",
"# File with known extension.",
"file_type",
"=",
"file",
".",
"split",
"(",
"\".\"",
")",
"[",
... | Function intended for identification of the file type.
----------
Parameters
----------
file : file path
File path.
Returns
-------
out : str
Identified file type. | [
"Function",
"intended",
"for",
"identification",
"of",
"the",
"file",
"type",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/load.py#L753-L775 | train | Function intended for identification of the file type. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py | _is_instance | def _is_instance(type_to_check, element, condition="any", deep=False):
"""
-----
Brief
-----
Function that verifies when "all" or "any" elements of the list "element" have the type
specified in "type_to_check" input.
-----------
Description
-----------
In some biosignalsnotebook... | python | def _is_instance(type_to_check, element, condition="any", deep=False):
"""
-----
Brief
-----
Function that verifies when "all" or "any" elements of the list "element" have the type
specified in "type_to_check" input.
-----------
Description
-----------
In some biosignalsnotebook... | [
"def",
"_is_instance",
"(",
"type_to_check",
",",
"element",
",",
"condition",
"=",
"\"any\"",
",",
"deep",
"=",
"False",
")",
":",
"out",
"=",
"None",
"# Direct check of \"condition\" in \"element\".",
"if",
"deep",
"is",
"False",
":",
"if",
"condition",
"==",
... | -----
Brief
-----
Function that verifies when "all" or "any" elements of the list "element" have the type
specified in "type_to_check" input.
-----------
Description
-----------
In some biosignalsnotebooks functions their implementation is extremely dependent on a specific
criterion... | [
"-----",
"Brief",
"-----",
"Function",
"that",
"verifies",
"when",
"all",
"or",
"any",
"elements",
"of",
"the",
"list",
"element",
"have",
"the",
"type",
"specified",
"in",
"type_to_check",
"input",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py#L48-L124 | train | Checks if a list of elements of a specific type is an instance of a specific data type. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py | _butter_bandpass_filter | def _butter_bandpass_filter(signal, low_cutoff, high_cutoff, sample_rate, order=6):
"""
-----
Brief
-----
Function with the purpose of applying a digital bandpass filter on signal, in order to attenuate
the signal content outside the frequency band [low_cutoff, high_cutoff].
-----------
... | python | def _butter_bandpass_filter(signal, low_cutoff, high_cutoff, sample_rate, order=6):
"""
-----
Brief
-----
Function with the purpose of applying a digital bandpass filter on signal, in order to attenuate
the signal content outside the frequency band [low_cutoff, high_cutoff].
-----------
... | [
"def",
"_butter_bandpass_filter",
"(",
"signal",
",",
"low_cutoff",
",",
"high_cutoff",
",",
"sample_rate",
",",
"order",
"=",
"6",
")",
":",
"order",
"=",
"order",
"nyquist_freq",
"=",
"0.5",
"*",
"sample_rate",
"# Transfer Function.",
"b_coeff",
",",
"a_coeff"... | -----
Brief
-----
Function with the purpose of applying a digital bandpass filter on signal, in order to attenuate
the signal content outside the frequency band [low_cutoff, high_cutoff].
-----------
Description
-----------
In signal processing, knowledge can be extracted from different... | [
"-----",
"Brief",
"-----",
"Function",
"with",
"the",
"purpose",
"of",
"applying",
"a",
"digital",
"bandpass",
"filter",
"on",
"signal",
"in",
"order",
"to",
"attenuate",
"the",
"signal",
"content",
"outside",
"the",
"frequency",
"band",
"[",
"low_cutoff",
"hi... | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py#L127-L197 | train | This function applies a digital bandpass filter on a signal and returns a new time - domain that can be used to extract the signal content within the frequency band. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py | _moving_average | def _moving_average(data, wind_size=3):
"""
-----
Brief
-----
Application of a moving average filter for signal smoothing.
-----------
Description
-----------
In certain situations it will be interesting to simplify a signal, particularly in cases where
some events with a random... | python | def _moving_average(data, wind_size=3):
"""
-----
Brief
-----
Application of a moving average filter for signal smoothing.
-----------
Description
-----------
In certain situations it will be interesting to simplify a signal, particularly in cases where
some events with a random... | [
"def",
"_moving_average",
"(",
"data",
",",
"wind_size",
"=",
"3",
")",
":",
"wind_size",
"=",
"int",
"(",
"wind_size",
")",
"ret",
"=",
"numpy",
".",
"cumsum",
"(",
"data",
",",
"dtype",
"=",
"float",
")",
"ret",
"[",
"wind_size",
":",
"]",
"=",
"... | -----
Brief
-----
Application of a moving average filter for signal smoothing.
-----------
Description
-----------
In certain situations it will be interesting to simplify a signal, particularly in cases where
some events with a random nature take place (the random nature of EMG activat... | [
"-----",
"Brief",
"-----",
"Application",
"of",
"a",
"moving",
"average",
"filter",
"for",
"signal",
"smoothing",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py#L200-L245 | train | This method is used to compute the moving average of a signal. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py | _filter_keywords | def _filter_keywords(function, kwargs_dict, is_class=False, warn_print=True):
"""
-----
Brief
-----
Function for filtering kwargs, ensuring that invalid keywords are not passed as arguments.
-----------
Description
-----------
Many Python functions included in the major packages, in... | python | def _filter_keywords(function, kwargs_dict, is_class=False, warn_print=True):
"""
-----
Brief
-----
Function for filtering kwargs, ensuring that invalid keywords are not passed as arguments.
-----------
Description
-----------
Many Python functions included in the major packages, in... | [
"def",
"_filter_keywords",
"(",
"function",
",",
"kwargs_dict",
",",
"is_class",
"=",
"False",
",",
"warn_print",
"=",
"True",
")",
":",
"# %%%%%%%%%%%%%%%%%%%%%%%%%% List of keywords of our input function %%%%%%%%%%%%%%%%%%%%%%%%%%%",
"if",
"is_class",
"is",
"False",
":",
... | -----
Brief
-----
Function for filtering kwargs, ensuring that invalid keywords are not passed as arguments.
-----------
Description
-----------
Many Python functions included in the major packages, include in their definition some
keyword arguments (kwargs), i.e., a dictionary having a... | [
"-----",
"Brief",
"-----",
"Function",
"for",
"filtering",
"kwargs",
"ensuring",
"that",
"invalid",
"keywords",
"are",
"not",
"passed",
"as",
"arguments",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py#L248-L315 | train | This function filters out the keyword arguments that are not valid in the function. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py | _inv_key | def _inv_key(list_keys, valid_keys):
"""
-----
Brief
-----
A sub-function of _filter_keywords function.
-----------
Description
-----------
Function used for identification when a list of keywords contains invalid keywords not present
in the valid list.
----------
Param... | python | def _inv_key(list_keys, valid_keys):
"""
-----
Brief
-----
A sub-function of _filter_keywords function.
-----------
Description
-----------
Function used for identification when a list of keywords contains invalid keywords not present
in the valid list.
----------
Param... | [
"def",
"_inv_key",
"(",
"list_keys",
",",
"valid_keys",
")",
":",
"inv_keys",
"=",
"[",
"]",
"bool_out",
"=",
"True",
"for",
"i",
"in",
"list_keys",
":",
"if",
"i",
"not",
"in",
"valid_keys",
":",
"bool_out",
"=",
"False",
"inv_keys",
".",
"append",
"(... | -----
Brief
-----
A sub-function of _filter_keywords function.
-----------
Description
-----------
Function used for identification when a list of keywords contains invalid keywords not present
in the valid list.
----------
Parameters
----------
list_keys : list
... | [
"-----",
"Brief",
"-----",
"A",
"sub",
"-",
"function",
"of",
"_filter_keywords",
"function",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py#L318-L355 | train | Internal function that returns True if all the keywords in list_keys are valid. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py | _generate_bokeh_file | def _generate_bokeh_file(file_name):
"""
-----
Brief
-----
Auxiliary function responsible for the creation of a directory where Bokeh figures will be
stored.
The "active" output file for Bokeh will also be updated for the new one.
-----------
Description
-----------
To ensur... | python | def _generate_bokeh_file(file_name):
"""
-----
Brief
-----
Auxiliary function responsible for the creation of a directory where Bokeh figures will be
stored.
The "active" output file for Bokeh will also be updated for the new one.
-----------
Description
-----------
To ensur... | [
"def",
"_generate_bokeh_file",
"(",
"file_name",
")",
":",
"# Creation of our output file instance.",
"if",
"file_name",
"is",
"None",
":",
"file_name",
"=",
"\"plot_\"",
"+",
"time_package",
".",
"strftime",
"(",
"\"%Y_%m_%d_%H_%M_%S.html\"",
")",
"else",
":",
"file_... | -----
Brief
-----
Auxiliary function responsible for the creation of a directory where Bokeh figures will be
stored.
The "active" output file for Bokeh will also be updated for the new one.
-----------
Description
-----------
To ensure that Bokeh plots are correctly observed in the ... | [
"-----",
"Brief",
"-----",
"Auxiliary",
"function",
"responsible",
"for",
"the",
"creation",
"of",
"a",
"directory",
"where",
"Bokeh",
"figures",
"will",
"be",
"stored",
".",
"The",
"active",
"output",
"file",
"for",
"Bokeh",
"will",
"also",
"be",
"updated",
... | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py#L358-L399 | train | Generate a Bokeh file for each plot. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py | _is_a_url | def _is_a_url(input_element):
"""
-----
Brief
-----
Auxiliary function responsible for checking if the input is a string that contains an url.
-----------
Description
-----------
Some biosignalsnotebooks functions support a remote access to files. In this situation it is
importa... | python | def _is_a_url(input_element):
"""
-----
Brief
-----
Auxiliary function responsible for checking if the input is a string that contains an url.
-----------
Description
-----------
Some biosignalsnotebooks functions support a remote access to files. In this situation it is
importa... | [
"def",
"_is_a_url",
"(",
"input_element",
")",
":",
"if",
"type",
"(",
"input_element",
")",
"is",
"str",
":",
"# Check if signal_handler is a url.",
"# [Statements to be executed if signal_handler is a url]",
"if",
"any",
"(",
"mark",
"in",
"input_element",
"for",
"mar... | -----
Brief
-----
Auxiliary function responsible for checking if the input is a string that contains an url.
-----------
Description
-----------
Some biosignalsnotebooks functions support a remote access to files. In this situation it is
important to understand if the input is an url, w... | [
"-----",
"Brief",
"-----",
"Auxiliary",
"function",
"responsible",
"for",
"checking",
"if",
"the",
"input",
"is",
"a",
"string",
"that",
"contains",
"an",
"url",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py#L402-L439 | train | Checks if the input_element is a url. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py | _generate_download_google_link | def _generate_download_google_link(link):
"""
-----
Brief
-----
Function that returns a direct download link of a file stored inside a Google Drive
Repository.
-----------
Description
-----------
Generally a link from a Google Drive file is only for viewing purposes.
If the... | python | def _generate_download_google_link(link):
"""
-----
Brief
-----
Function that returns a direct download link of a file stored inside a Google Drive
Repository.
-----------
Description
-----------
Generally a link from a Google Drive file is only for viewing purposes.
If the... | [
"def",
"_generate_download_google_link",
"(",
"link",
")",
":",
"# Get file id.",
"if",
"\"id=\"",
"not",
"in",
"link",
":",
"# Split link into segments (split character --> /)",
"split_link",
"=",
"link",
".",
"split",
"(",
"\"/\"",
")",
"file_id",
"=",
"split_link",... | -----
Brief
-----
Function that returns a direct download link of a file stored inside a Google Drive
Repository.
-----------
Description
-----------
Generally a link from a Google Drive file is only for viewing purposes.
If the user wants to download the file it can be done with G... | [
"-----",
"Brief",
"-----",
"Function",
"that",
"returns",
"a",
"direct",
"download",
"link",
"of",
"a",
"file",
"stored",
"inside",
"a",
"Google",
"Drive",
"Repository",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/aux_functions.py#L442-L485 | train | Generate a download google link from a link string. |
thomasdelaet/python-velbus | velbus/messages/switch_relay_off.py | SwitchRelayOffMessage.to_json | def to_json(self):
"""
:return: str
"""
json_dict = self.to_json_basic()
json_dict['channels'] = self.relay_channels
return json.dumps(json_dict) | python | def to_json(self):
"""
:return: str
"""
json_dict = self.to_json_basic()
json_dict['channels'] = self.relay_channels
return json.dumps(json_dict) | [
"def",
"to_json",
"(",
"self",
")",
":",
"json_dict",
"=",
"self",
".",
"to_json_basic",
"(",
")",
"json_dict",
"[",
"'channels'",
"]",
"=",
"self",
".",
"relay_channels",
"return",
"json",
".",
"dumps",
"(",
"json_dict",
")"
] | :return: str | [
":",
"return",
":",
"str"
] | af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd | https://github.com/thomasdelaet/python-velbus/blob/af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd/velbus/messages/switch_relay_off.py#L33-L39 | train | Returns a JSON string representation of the current object. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/conversion.py | raw_to_phy | def raw_to_phy(sensor, device, raw_signal, resolution, option):
"""
-----
Brief
-----
Function for converting raw units to physical units.
-----------
Description
-----------
Each sensor and device has a specific transfer function that models the inputs to outputs. This transfer fun... | python | def raw_to_phy(sensor, device, raw_signal, resolution, option):
"""
-----
Brief
-----
Function for converting raw units to physical units.
-----------
Description
-----------
Each sensor and device has a specific transfer function that models the inputs to outputs. This transfer fun... | [
"def",
"raw_to_phy",
"(",
"sensor",
",",
"device",
",",
"raw_signal",
",",
"resolution",
",",
"option",
")",
":",
"raw_signal",
"=",
"numpy",
".",
"array",
"(",
"raw_signal",
")",
"# Check if resolution has the correct data format.",
"if",
"not",
"isinstance",
"("... | -----
Brief
-----
Function for converting raw units to physical units.
-----------
Description
-----------
Each sensor and device has a specific transfer function that models the inputs to outputs. This transfer function
is, thus, used in order to convert the raw units that are measured... | [
"-----",
"Brief",
"-----",
"Function",
"for",
"converting",
"raw",
"units",
"to",
"physical",
"units",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/conversion.py#L30-L228 | train | This function converts raw signal samples to physical units. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/conversion.py | generate_time | def generate_time(signal, sample_rate=1000):
"""
-----
Brief
-----
Function intended to generate a time axis of the input signal.
-----------
Description
-----------
The time axis generated by the acquisition process originates a set of consecutive values that represents the
adv... | python | def generate_time(signal, sample_rate=1000):
"""
-----
Brief
-----
Function intended to generate a time axis of the input signal.
-----------
Description
-----------
The time axis generated by the acquisition process originates a set of consecutive values that represents the
adv... | [
"def",
"generate_time",
"(",
"signal",
",",
"sample_rate",
"=",
"1000",
")",
":",
"# Download of signal if the input is a url.",
"if",
"_is_a_url",
"(",
"signal",
")",
":",
"# Check if it is a Google Drive sharable link.",
"if",
"\"drive.google\"",
"in",
"signal",
":",
... | -----
Brief
-----
Function intended to generate a time axis of the input signal.
-----------
Description
-----------
The time axis generated by the acquisition process originates a set of consecutive values that represents the
advancement of time, but does not have specific units.
... | [
"-----",
"Brief",
"-----",
"Function",
"intended",
"to",
"generate",
"a",
"time",
"axis",
"of",
"the",
"input",
"signal",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/conversion.py#L231-L286 | train | This function generates a time axis for the acquisition process. |
KE-works/pykechain | pykechain/models/scope.py | Scope.team | def team(self):
"""Team to which the scope is assigned."""
team_dict = self._json_data.get('team')
if team_dict and team_dict.get('id'):
return self._client.team(id=team_dict.get('id'))
else:
return None | python | def team(self):
"""Team to which the scope is assigned."""
team_dict = self._json_data.get('team')
if team_dict and team_dict.get('id'):
return self._client.team(id=team_dict.get('id'))
else:
return None | [
"def",
"team",
"(",
"self",
")",
":",
"team_dict",
"=",
"self",
".",
"_json_data",
".",
"get",
"(",
"'team'",
")",
"if",
"team_dict",
"and",
"team_dict",
".",
"get",
"(",
"'id'",
")",
":",
"return",
"self",
".",
"_client",
".",
"team",
"(",
"id",
"... | Team to which the scope is assigned. | [
"Team",
"to",
"which",
"the",
"scope",
"is",
"assigned",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L56-L62 | train | Team to which the scope is assigned. |
KE-works/pykechain | pykechain/models/scope.py | Scope.parts | def parts(self, *args, **kwargs):
"""Retrieve parts belonging to this scope.
See :class:`pykechain.Client.parts` for available parameters.
"""
return self._client.parts(*args, bucket=self.bucket.get('id'), **kwargs) | python | def parts(self, *args, **kwargs):
"""Retrieve parts belonging to this scope.
See :class:`pykechain.Client.parts` for available parameters.
"""
return self._client.parts(*args, bucket=self.bucket.get('id'), **kwargs) | [
"def",
"parts",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_client",
".",
"parts",
"(",
"*",
"args",
",",
"bucket",
"=",
"self",
".",
"bucket",
".",
"get",
"(",
"'id'",
")",
",",
"*",
"*",
"kwargs"... | Retrieve parts belonging to this scope.
See :class:`pykechain.Client.parts` for available parameters. | [
"Retrieve",
"parts",
"belonging",
"to",
"this",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L76-L81 | train | Retrieve parts belonging to this scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.part | def part(self, *args, **kwargs):
"""Retrieve a single part belonging to this scope.
See :class:`pykechain.Client.part` for available parameters.
"""
return self._client.part(*args, bucket=self.bucket.get('id'), **kwargs) | python | def part(self, *args, **kwargs):
"""Retrieve a single part belonging to this scope.
See :class:`pykechain.Client.part` for available parameters.
"""
return self._client.part(*args, bucket=self.bucket.get('id'), **kwargs) | [
"def",
"part",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_client",
".",
"part",
"(",
"*",
"args",
",",
"bucket",
"=",
"self",
".",
"bucket",
".",
"get",
"(",
"'id'",
")",
",",
"*",
"*",
"kwargs",
... | Retrieve a single part belonging to this scope.
See :class:`pykechain.Client.part` for available parameters. | [
"Retrieve",
"a",
"single",
"part",
"belonging",
"to",
"this",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L83-L88 | train | Retrieve a single part belonging to this scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.create_model | def create_model(self, parent, name, multiplicity=Multiplicity.ZERO_MANY):
"""Create a single part model in this scope.
See :class:`pykechain.Client.create_model` for available parameters.
"""
return self._client.create_model(parent, name, multiplicity=multiplicity) | python | def create_model(self, parent, name, multiplicity=Multiplicity.ZERO_MANY):
"""Create a single part model in this scope.
See :class:`pykechain.Client.create_model` for available parameters.
"""
return self._client.create_model(parent, name, multiplicity=multiplicity) | [
"def",
"create_model",
"(",
"self",
",",
"parent",
",",
"name",
",",
"multiplicity",
"=",
"Multiplicity",
".",
"ZERO_MANY",
")",
":",
"return",
"self",
".",
"_client",
".",
"create_model",
"(",
"parent",
",",
"name",
",",
"multiplicity",
"=",
"multiplicity",... | Create a single part model in this scope.
See :class:`pykechain.Client.create_model` for available parameters. | [
"Create",
"a",
"single",
"part",
"model",
"in",
"this",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L90-L95 | train | Create a single part model in this scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.model | def model(self, *args, **kwargs):
"""Retrieve a single model belonging to this scope.
See :class:`pykechain.Client.model` for available parameters.
"""
return self._client.model(*args, bucket=self.bucket.get('id'), **kwargs) | python | def model(self, *args, **kwargs):
"""Retrieve a single model belonging to this scope.
See :class:`pykechain.Client.model` for available parameters.
"""
return self._client.model(*args, bucket=self.bucket.get('id'), **kwargs) | [
"def",
"model",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_client",
".",
"model",
"(",
"*",
"args",
",",
"bucket",
"=",
"self",
".",
"bucket",
".",
"get",
"(",
"'id'",
")",
",",
"*",
"*",
"kwargs"... | Retrieve a single model belonging to this scope.
See :class:`pykechain.Client.model` for available parameters. | [
"Retrieve",
"a",
"single",
"model",
"belonging",
"to",
"this",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L97-L102 | train | Retrieve a single model belonging to this scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.activities | def activities(self, *args, **kwargs):
"""Retrieve activities belonging to this scope.
See :class:`pykechain.Client.activities` for available parameters.
"""
if self._client.match_app_version(label='wim', version='<2.0.0', default=True):
return self._client.activities(*args,... | python | def activities(self, *args, **kwargs):
"""Retrieve activities belonging to this scope.
See :class:`pykechain.Client.activities` for available parameters.
"""
if self._client.match_app_version(label='wim', version='<2.0.0', default=True):
return self._client.activities(*args,... | [
"def",
"activities",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_client",
".",
"match_app_version",
"(",
"label",
"=",
"'wim'",
",",
"version",
"=",
"'<2.0.0'",
",",
"default",
"=",
"True",
")",
":",
"return... | Retrieve activities belonging to this scope.
See :class:`pykechain.Client.activities` for available parameters. | [
"Retrieve",
"activities",
"belonging",
"to",
"this",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L104-L112 | train | Retrieve activities belonging to this scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.create_activity | def create_activity(self, *args, **kwargs):
"""Create a new activity belonging to this scope.
See :class:`pykechain.Client.create_activity` for available parameters.
"""
if self._client.match_app_version(label='wim', version='<2.0.0', default=True):
return self._client.creat... | python | def create_activity(self, *args, **kwargs):
"""Create a new activity belonging to this scope.
See :class:`pykechain.Client.create_activity` for available parameters.
"""
if self._client.match_app_version(label='wim', version='<2.0.0', default=True):
return self._client.creat... | [
"def",
"create_activity",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_client",
".",
"match_app_version",
"(",
"label",
"=",
"'wim'",
",",
"version",
"=",
"'<2.0.0'",
",",
"default",
"=",
"True",
")",
":",
"r... | Create a new activity belonging to this scope.
See :class:`pykechain.Client.create_activity` for available parameters. | [
"Create",
"a",
"new",
"activity",
"belonging",
"to",
"this",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L124-L132 | train | Create a new activity belonging to this scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.services | def services(self, *args, **kwargs):
"""Retrieve services belonging to this scope.
See :class:`pykechain.Client.services` for available parameters.
.. versionadded:: 1.13
"""
return self._client.services(*args, scope=self.id, **kwargs) | python | def services(self, *args, **kwargs):
"""Retrieve services belonging to this scope.
See :class:`pykechain.Client.services` for available parameters.
.. versionadded:: 1.13
"""
return self._client.services(*args, scope=self.id, **kwargs) | [
"def",
"services",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_client",
".",
"services",
"(",
"*",
"args",
",",
"scope",
"=",
"self",
".",
"id",
",",
"*",
"*",
"kwargs",
")"
] | Retrieve services belonging to this scope.
See :class:`pykechain.Client.services` for available parameters.
.. versionadded:: 1.13 | [
"Retrieve",
"services",
"belonging",
"to",
"this",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L134-L141 | train | Retrieve services belonging to this scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.create_service | def create_service(self, *args, **kwargs):
"""Create a service to current scope.
See :class:`pykechain.Client.create_service` for available parameters.
.. versionadded:: 1.13
"""
return self._client.create_service(*args, scope=self.id, **kwargs) | python | def create_service(self, *args, **kwargs):
"""Create a service to current scope.
See :class:`pykechain.Client.create_service` for available parameters.
.. versionadded:: 1.13
"""
return self._client.create_service(*args, scope=self.id, **kwargs) | [
"def",
"create_service",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_client",
".",
"create_service",
"(",
"*",
"args",
",",
"scope",
"=",
"self",
".",
"id",
",",
"*",
"*",
"kwargs",
")"
] | Create a service to current scope.
See :class:`pykechain.Client.create_service` for available parameters.
.. versionadded:: 1.13 | [
"Create",
"a",
"service",
"to",
"current",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L143-L150 | train | Create a service to current scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.service | def service(self, *args, **kwargs):
"""Retrieve a single service belonging to this scope.
See :class:`pykechain.Client.service` for available parameters.
.. versionadded:: 1.13
"""
return self._client.service(*args, scope=self.id, **kwargs) | python | def service(self, *args, **kwargs):
"""Retrieve a single service belonging to this scope.
See :class:`pykechain.Client.service` for available parameters.
.. versionadded:: 1.13
"""
return self._client.service(*args, scope=self.id, **kwargs) | [
"def",
"service",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_client",
".",
"service",
"(",
"*",
"args",
",",
"scope",
"=",
"self",
".",
"id",
",",
"*",
"*",
"kwargs",
")"
] | Retrieve a single service belonging to this scope.
See :class:`pykechain.Client.service` for available parameters.
.. versionadded:: 1.13 | [
"Retrieve",
"a",
"single",
"service",
"belonging",
"to",
"this",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L152-L159 | train | Retrieve a single service belonging to this scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.service_executions | def service_executions(self, *args, **kwargs):
"""Retrieve services belonging to this scope.
See :class:`pykechain.Client.service_executions` for available parameters.
.. versionadded:: 1.13
"""
return self._client.service_executions(*args, scope=self.id, **kwargs) | python | def service_executions(self, *args, **kwargs):
"""Retrieve services belonging to this scope.
See :class:`pykechain.Client.service_executions` for available parameters.
.. versionadded:: 1.13
"""
return self._client.service_executions(*args, scope=self.id, **kwargs) | [
"def",
"service_executions",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_client",
".",
"service_executions",
"(",
"*",
"args",
",",
"scope",
"=",
"self",
".",
"id",
",",
"*",
"*",
"kwargs",
")"
] | Retrieve services belonging to this scope.
See :class:`pykechain.Client.service_executions` for available parameters.
.. versionadded:: 1.13 | [
"Retrieve",
"services",
"belonging",
"to",
"this",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L161-L168 | train | Retrieve services belonging to this scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.service_execution | def service_execution(self, *args, **kwargs):
"""Retrieve a single service execution belonging to this scope.
See :class:`pykechain.Client.service_execution` for available parameters.
.. versionadded:: 1.13
"""
return self._client.service_execution(*args, scope=self.id, **kwarg... | python | def service_execution(self, *args, **kwargs):
"""Retrieve a single service execution belonging to this scope.
See :class:`pykechain.Client.service_execution` for available parameters.
.. versionadded:: 1.13
"""
return self._client.service_execution(*args, scope=self.id, **kwarg... | [
"def",
"service_execution",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_client",
".",
"service_execution",
"(",
"*",
"args",
",",
"scope",
"=",
"self",
".",
"id",
",",
"*",
"*",
"kwargs",
")"
] | Retrieve a single service execution belonging to this scope.
See :class:`pykechain.Client.service_execution` for available parameters.
.. versionadded:: 1.13 | [
"Retrieve",
"a",
"single",
"service",
"execution",
"belonging",
"to",
"this",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L170-L177 | train | Retrieve a single service execution belonging to this scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.members | def members(self, is_manager=None):
"""
Retrieve members of the scope.
:param is_manager: (optional) set to True to return only Scope members that are also managers.
:type is_manager: bool
:return: List of members (usernames)
Examples
--------
>>> member... | python | def members(self, is_manager=None):
"""
Retrieve members of the scope.
:param is_manager: (optional) set to True to return only Scope members that are also managers.
:type is_manager: bool
:return: List of members (usernames)
Examples
--------
>>> member... | [
"def",
"members",
"(",
"self",
",",
"is_manager",
"=",
"None",
")",
":",
"if",
"not",
"is_manager",
":",
"return",
"[",
"member",
"for",
"member",
"in",
"self",
".",
"_json_data",
"[",
"'members'",
"]",
"if",
"member",
"[",
"'is_active'",
"]",
"]",
"el... | Retrieve members of the scope.
:param is_manager: (optional) set to True to return only Scope members that are also managers.
:type is_manager: bool
:return: List of members (usernames)
Examples
--------
>>> members = project.members()
>>> managers = project.mem... | [
"Retrieve",
"members",
"of",
"the",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L179-L197 | train | Retrieve members of the scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.add_member | def add_member(self, member):
"""
Add a single member to the scope.
You may only edit the list of members if the pykechain credentials allow this.
:param member: single username to be added to the scope list of members
:type member: basestring
:raises APIError: when una... | python | def add_member(self, member):
"""
Add a single member to the scope.
You may only edit the list of members if the pykechain credentials allow this.
:param member: single username to be added to the scope list of members
:type member: basestring
:raises APIError: when una... | [
"def",
"add_member",
"(",
"self",
",",
"member",
")",
":",
"select_action",
"=",
"'add_member'",
"self",
".",
"_update_scope_project_team",
"(",
"select_action",
"=",
"select_action",
",",
"user",
"=",
"member",
",",
"user_type",
"=",
"'member'",
")"
] | Add a single member to the scope.
You may only edit the list of members if the pykechain credentials allow this.
:param member: single username to be added to the scope list of members
:type member: basestring
:raises APIError: when unable to update the scope member | [
"Add",
"a",
"single",
"member",
"to",
"the",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L199-L211 | train | Add a single member to the scope list |
KE-works/pykechain | pykechain/models/scope.py | Scope.remove_member | def remove_member(self, member):
"""
Remove a single member to the scope.
:param member: single username to be removed from the scope list of members
:type member: basestring
:raises APIError: when unable to update the scope member
"""
select_action = 'remove_mem... | python | def remove_member(self, member):
"""
Remove a single member to the scope.
:param member: single username to be removed from the scope list of members
:type member: basestring
:raises APIError: when unable to update the scope member
"""
select_action = 'remove_mem... | [
"def",
"remove_member",
"(",
"self",
",",
"member",
")",
":",
"select_action",
"=",
"'remove_member'",
"self",
".",
"_update_scope_project_team",
"(",
"select_action",
"=",
"select_action",
",",
"user",
"=",
"member",
",",
"user_type",
"=",
"'member'",
")"
] | Remove a single member to the scope.
:param member: single username to be removed from the scope list of members
:type member: basestring
:raises APIError: when unable to update the scope member | [
"Remove",
"a",
"single",
"member",
"to",
"the",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L213-L223 | train | Removes a single member from the scope list. |
KE-works/pykechain | pykechain/models/scope.py | Scope.add_manager | def add_manager(self, manager):
"""
Add a single manager to the scope.
:param manager: single username to be added to the scope list of managers
:type manager: basestring
:raises APIError: when unable to update the scope manager
"""
select_action = 'add_manager'
... | python | def add_manager(self, manager):
"""
Add a single manager to the scope.
:param manager: single username to be added to the scope list of managers
:type manager: basestring
:raises APIError: when unable to update the scope manager
"""
select_action = 'add_manager'
... | [
"def",
"add_manager",
"(",
"self",
",",
"manager",
")",
":",
"select_action",
"=",
"'add_manager'",
"self",
".",
"_update_scope_project_team",
"(",
"select_action",
"=",
"select_action",
",",
"user",
"=",
"manager",
",",
"user_type",
"=",
"'manager'",
")"
] | Add a single manager to the scope.
:param manager: single username to be added to the scope list of managers
:type manager: basestring
:raises APIError: when unable to update the scope manager | [
"Add",
"a",
"single",
"manager",
"to",
"the",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L225-L235 | train | Add a single manager to the scope list. |
KE-works/pykechain | pykechain/models/scope.py | Scope.remove_manager | def remove_manager(self, manager):
"""
Remove a single manager to the scope.
:param manager: single username to be added to the scope list of managers
:type manager: basestring
:raises APIError: when unable to update the scope manager
"""
select_action = 'remove_... | python | def remove_manager(self, manager):
"""
Remove a single manager to the scope.
:param manager: single username to be added to the scope list of managers
:type manager: basestring
:raises APIError: when unable to update the scope manager
"""
select_action = 'remove_... | [
"def",
"remove_manager",
"(",
"self",
",",
"manager",
")",
":",
"select_action",
"=",
"'remove_manager'",
"self",
".",
"_update_scope_project_team",
"(",
"select_action",
"=",
"select_action",
",",
"user",
"=",
"manager",
",",
"user_type",
"=",
"'manager'",
")"
] | Remove a single manager to the scope.
:param manager: single username to be added to the scope list of managers
:type manager: basestring
:raises APIError: when unable to update the scope manager | [
"Remove",
"a",
"single",
"manager",
"to",
"the",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L237-L247 | train | Removes a single manager from the scope list. |
KE-works/pykechain | pykechain/models/scope.py | Scope._update_scope_project_team | def _update_scope_project_team(self, select_action, user, user_type):
"""
Update the Project Team of the Scope. Updates include addition or removing of managers or members.
:param select_action: type of action to be applied
:type select_action: basestring
:param user: the userna... | python | def _update_scope_project_team(self, select_action, user, user_type):
"""
Update the Project Team of the Scope. Updates include addition or removing of managers or members.
:param select_action: type of action to be applied
:type select_action: basestring
:param user: the userna... | [
"def",
"_update_scope_project_team",
"(",
"self",
",",
"select_action",
",",
"user",
",",
"user_type",
")",
":",
"if",
"isinstance",
"(",
"user",
",",
"str",
")",
":",
"users",
"=",
"self",
".",
"_client",
".",
"_retrieve_users",
"(",
")",
"manager_object",
... | Update the Project Team of the Scope. Updates include addition or removing of managers or members.
:param select_action: type of action to be applied
:type select_action: basestring
:param user: the username of the user to which the action applies to
:type user: basestring
:para... | [
"Update",
"the",
"Project",
"Team",
"of",
"the",
"Scope",
".",
"Updates",
"include",
"addition",
"or",
"removing",
"of",
"managers",
"or",
"members",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L249-L275 | train | Updates the scope project team of the Scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.edit | def edit(self, name=None, description=None, start_date=None, due_date=None, status=None, tags=None, team=None,
options=None, **kwargs):
"""Edit the details of a scope.
:param name: (optionally) edit the name of the scope
:type name: basestring or None
:param description: (o... | python | def edit(self, name=None, description=None, start_date=None, due_date=None, status=None, tags=None, team=None,
options=None, **kwargs):
"""Edit the details of a scope.
:param name: (optionally) edit the name of the scope
:type name: basestring or None
:param description: (o... | [
"def",
"edit",
"(",
"self",
",",
"name",
"=",
"None",
",",
"description",
"=",
"None",
",",
"start_date",
"=",
"None",
",",
"due_date",
"=",
"None",
",",
"status",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"team",
"=",
"None",
",",
"options",
"="... | Edit the details of a scope.
:param name: (optionally) edit the name of the scope
:type name: basestring or None
:param description: (optionally) edit the description of the scope
:type description: basestring or None
:param start_date: (optionally) edit the start date of the sc... | [
"Edit",
"the",
"details",
"of",
"a",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L277-L400 | train | Edit the details of a scope. |
KE-works/pykechain | pykechain/models/scope.py | Scope.clone | def clone(self, *args, **kwargs):
"""
Clone current scope.
See :class:`pykechain.Client.clone_scope` for available parameters.
.. versionadded:: 2.6.0
"""
return self._client.clone_scope(*args, source_scope=self, **kwargs) | python | def clone(self, *args, **kwargs):
"""
Clone current scope.
See :class:`pykechain.Client.clone_scope` for available parameters.
.. versionadded:: 2.6.0
"""
return self._client.clone_scope(*args, source_scope=self, **kwargs) | [
"def",
"clone",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_client",
".",
"clone_scope",
"(",
"*",
"args",
",",
"source_scope",
"=",
"self",
",",
"*",
"*",
"kwargs",
")"
] | Clone current scope.
See :class:`pykechain.Client.clone_scope` for available parameters.
.. versionadded:: 2.6.0 | [
"Clone",
"current",
"scope",
"."
] | b0296cf34328fd41660bf6f0b9114fd0167c40c4 | https://github.com/KE-works/pykechain/blob/b0296cf34328fd41660bf6f0b9114fd0167c40c4/pykechain/models/scope.py#L413-L421 | train | Clone current scope. |
hfurubotten/enturclient | enturclient/dto.py | Place.name | def name(self) -> str:
"""Friendly name for the stop place or platform"""
if self.is_platform:
if self._data["publicCode"]:
return self._data['name'] + " Platform " + \
self._data["publicCode"]
else:
return self._data['name']... | python | def name(self) -> str:
"""Friendly name for the stop place or platform"""
if self.is_platform:
if self._data["publicCode"]:
return self._data['name'] + " Platform " + \
self._data["publicCode"]
else:
return self._data['name']... | [
"def",
"name",
"(",
"self",
")",
"->",
"str",
":",
"if",
"self",
".",
"is_platform",
":",
"if",
"self",
".",
"_data",
"[",
"\"publicCode\"",
"]",
":",
"return",
"self",
".",
"_data",
"[",
"'name'",
"]",
"+",
"\" Platform \"",
"+",
"self",
".",
"_data... | Friendly name for the stop place or platform | [
"Friendly",
"name",
"for",
"the",
"stop",
"place",
"or",
"platform"
] | 8230f9e9cf5b3a4911e860bc8cbe621231aa5ae4 | https://github.com/hfurubotten/enturclient/blob/8230f9e9cf5b3a4911e860bc8cbe621231aa5ae4/enturclient/dto.py#L18-L28 | train | Friendly name for the stop place or platform |
SuryaSankar/flask-sqlalchemy-booster | flask_sqlalchemy_booster/custom_collections.py | MappedDictOfLists.remove | def remove(self, value, _sa_initiator=None):
"""Remove an item by value, consulting the keyfunc for the key."""
key = self.keyfunc(value)
# Let self[key] raise if key is not in this collection
# testlib.pragma exempt:__ne__
if not self.__contains__(key) or value not in self[key]... | python | def remove(self, value, _sa_initiator=None):
"""Remove an item by value, consulting the keyfunc for the key."""
key = self.keyfunc(value)
# Let self[key] raise if key is not in this collection
# testlib.pragma exempt:__ne__
if not self.__contains__(key) or value not in self[key]... | [
"def",
"remove",
"(",
"self",
",",
"value",
",",
"_sa_initiator",
"=",
"None",
")",
":",
"key",
"=",
"self",
".",
"keyfunc",
"(",
"value",
")",
"# Let self[key] raise if key is not in this collection",
"# testlib.pragma exempt:__ne__",
"if",
"not",
"self",
".",
"_... | Remove an item by value, consulting the keyfunc for the key. | [
"Remove",
"an",
"item",
"by",
"value",
"consulting",
"the",
"keyfunc",
"for",
"the",
"key",
"."
] | 444048d167ab7718f758e943665ef32d101423a5 | https://github.com/SuryaSankar/flask-sqlalchemy-booster/blob/444048d167ab7718f758e943665ef32d101423a5/flask_sqlalchemy_booster/custom_collections.py#L20-L33 | train | Remove an item by value consulting the keyfunc for the key. |
SuryaSankar/flask-sqlalchemy-booster | flask_sqlalchemy_booster/custom_collections.py | MappedDictOfLists._convert | def _convert(self, dictlike):
"""Validate and convert a dict-like object into values for set()ing.
This is called behind the scenes when a MappedCollection is replaced
entirely by another collection, as in::
myobj.mappedcollection = {'a':obj1, 'b': obj2} # ...
Raises a TypeE... | python | def _convert(self, dictlike):
"""Validate and convert a dict-like object into values for set()ing.
This is called behind the scenes when a MappedCollection is replaced
entirely by another collection, as in::
myobj.mappedcollection = {'a':obj1, 'b': obj2} # ...
Raises a TypeE... | [
"def",
"_convert",
"(",
"self",
",",
"dictlike",
")",
":",
"for",
"incoming_key",
",",
"valuelist",
"in",
"util",
".",
"dictlike_iteritems",
"(",
"dictlike",
")",
":",
"for",
"value",
"in",
"valuelist",
":",
"new_key",
"=",
"self",
".",
"keyfunc",
"(",
"... | Validate and convert a dict-like object into values for set()ing.
This is called behind the scenes when a MappedCollection is replaced
entirely by another collection, as in::
myobj.mappedcollection = {'a':obj1, 'b': obj2} # ...
Raises a TypeError if the key in any (key, value) pair ... | [
"Validate",
"and",
"convert",
"a",
"dict",
"-",
"like",
"object",
"into",
"values",
"for",
"set",
"()",
"ing",
"."
] | 444048d167ab7718f758e943665ef32d101423a5 | https://github.com/SuryaSankar/flask-sqlalchemy-booster/blob/444048d167ab7718f758e943665ef32d101423a5/flask_sqlalchemy_booster/custom_collections.py#L36-L58 | train | Validate and convert a dict - like object into values for set()ing. |
manikos/django-progressiveimagefield | progressiveimagefield/jinja/filters.py | progressive | def progressive(image_field, alt_text=''):
"""
Used as a Jinja2 filter, this function returns a safe HTML chunk.
Usage (in the HTML template):
{{ obj.image|progressive }}
:param django.db.models.fields.files.ImageFieldFile image_field: image
:param str alt_text: str
:return: a safe HT... | python | def progressive(image_field, alt_text=''):
"""
Used as a Jinja2 filter, this function returns a safe HTML chunk.
Usage (in the HTML template):
{{ obj.image|progressive }}
:param django.db.models.fields.files.ImageFieldFile image_field: image
:param str alt_text: str
:return: a safe HT... | [
"def",
"progressive",
"(",
"image_field",
",",
"alt_text",
"=",
"''",
")",
":",
"if",
"not",
"isinstance",
"(",
"image_field",
",",
"ImageFieldFile",
")",
":",
"raise",
"ValueError",
"(",
"'\"image_field\" argument must be an ImageField.'",
")",
"for",
"engine",
"... | Used as a Jinja2 filter, this function returns a safe HTML chunk.
Usage (in the HTML template):
{{ obj.image|progressive }}
:param django.db.models.fields.files.ImageFieldFile image_field: image
:param str alt_text: str
:return: a safe HTML template ready to be rendered | [
"Used",
"as",
"a",
"Jinja2",
"filter",
"this",
"function",
"returns",
"a",
"safe",
"HTML",
"chunk",
"."
] | a432c79d23d87ea8944ac252ae7d15df1e4f3072 | https://github.com/manikos/django-progressiveimagefield/blob/a432c79d23d87ea8944ac252ae7d15df1e4f3072/progressiveimagefield/jinja/filters.py#L17-L42 | train | Returns a safe HTML chunk that can be used as a Jinja2 filter. |
thomasdelaet/python-velbus | velbus/messages/kwh_status.py | KwhStatusMessage.populate | def populate(self, priority, address, rtr, data):
"""
-DB1 last 2 bits = channel
-DB1 first 6 bist = pulses
-DB2-5 = pulse counter
-DB6-7 = ms/pulse
:return: None
"""
assert isinstance(data, bytes)
... | python | def populate(self, priority, address, rtr, data):
"""
-DB1 last 2 bits = channel
-DB1 first 6 bist = pulses
-DB2-5 = pulse counter
-DB6-7 = ms/pulse
:return: None
"""
assert isinstance(data, bytes)
... | [
"def",
"populate",
"(",
"self",
",",
"priority",
",",
"address",
",",
"rtr",
",",
"data",
")",
":",
"assert",
"isinstance",
"(",
"data",
",",
"bytes",
")",
"self",
".",
"needs_no_rtr",
"(",
"rtr",
")",
"self",
".",
"needs_data",
"(",
"data",
",",
"7"... | -DB1 last 2 bits = channel
-DB1 first 6 bist = pulses
-DB2-5 = pulse counter
-DB6-7 = ms/pulse
:return: None | [
"-",
"DB1",
"last",
"2",
"bits",
"=",
"channel",
"-",
"DB1",
"first",
"6",
"bist",
"=",
"pulses",
"-",
"DB2",
"-",
"5",
"=",
"pulse",
"counter",
"-",
"DB6",
"-",
"7",
"=",
"ms",
"/",
"pulse",
":",
"return",
":",
"None"
] | af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd | https://github.com/thomasdelaet/python-velbus/blob/af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd/velbus/messages/kwh_status.py#L25-L44 | train | Populates the internal state of the object with the contents of the data. |
thomasdelaet/python-velbus | velbus/messages/kwh_status.py | KwhStatusMessage.to_json | def to_json(self):
"""
:return: str
"""
json_dict = self.to_json_basic()
json_dict['pulses'] = self.pulses
json_dict['counter'] = self.counter
json_dict['kwh'] = self.kwh
json_dict['delay'] = self.delay
json_dict['watt'] = self.watt
json_di... | python | def to_json(self):
"""
:return: str
"""
json_dict = self.to_json_basic()
json_dict['pulses'] = self.pulses
json_dict['counter'] = self.counter
json_dict['kwh'] = self.kwh
json_dict['delay'] = self.delay
json_dict['watt'] = self.watt
json_di... | [
"def",
"to_json",
"(",
"self",
")",
":",
"json_dict",
"=",
"self",
".",
"to_json_basic",
"(",
")",
"json_dict",
"[",
"'pulses'",
"]",
"=",
"self",
".",
"pulses",
"json_dict",
"[",
"'counter'",
"]",
"=",
"self",
".",
"counter",
"json_dict",
"[",
"'kwh'",
... | :return: str | [
":",
"return",
":",
"str"
] | af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd | https://github.com/thomasdelaet/python-velbus/blob/af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd/velbus/messages/kwh_status.py#L46-L57 | train | Returns a string representation of the object. |
Thermondo/viewflow-extensions | viewflow_extensions/views.py | SavableViewActivationMixin.get_form | def get_form(self, form_class=None):
"""If the task was only saved, treat all form fields as not required."""
form = super().get_form(form_class)
if self._save:
make_form_or_formset_fields_not_required(form)
return form | python | def get_form(self, form_class=None):
"""If the task was only saved, treat all form fields as not required."""
form = super().get_form(form_class)
if self._save:
make_form_or_formset_fields_not_required(form)
return form | [
"def",
"get_form",
"(",
"self",
",",
"form_class",
"=",
"None",
")",
":",
"form",
"=",
"super",
"(",
")",
".",
"get_form",
"(",
"form_class",
")",
"if",
"self",
".",
"_save",
":",
"make_form_or_formset_fields_not_required",
"(",
"form",
")",
"return",
"for... | If the task was only saved, treat all form fields as not required. | [
"If",
"the",
"task",
"was",
"only",
"saved",
"treat",
"all",
"form",
"fields",
"as",
"not",
"required",
"."
] | 5d2bbfe28ced7dda3e6832b96ea031c1b871053e | https://github.com/Thermondo/viewflow-extensions/blob/5d2bbfe28ced7dda3e6832b96ea031c1b871053e/viewflow_extensions/views.py#L40-L45 | train | Returns the form for this task. |
Thermondo/viewflow-extensions | viewflow_extensions/views.py | SavableViewActivationMixin.save_task | def save_task(self):
"""Transition to save the task and return to ``ASSIGNED`` state."""
task = self.request.activation.task
task.status = STATUS.ASSIGNED
task.save() | python | def save_task(self):
"""Transition to save the task and return to ``ASSIGNED`` state."""
task = self.request.activation.task
task.status = STATUS.ASSIGNED
task.save() | [
"def",
"save_task",
"(",
"self",
")",
":",
"task",
"=",
"self",
".",
"request",
".",
"activation",
".",
"task",
"task",
".",
"status",
"=",
"STATUS",
".",
"ASSIGNED",
"task",
".",
"save",
"(",
")"
] | Transition to save the task and return to ``ASSIGNED`` state. | [
"Transition",
"to",
"save",
"the",
"task",
"and",
"return",
"to",
"ASSIGNED",
"state",
"."
] | 5d2bbfe28ced7dda3e6832b96ea031c1b871053e | https://github.com/Thermondo/viewflow-extensions/blob/5d2bbfe28ced7dda3e6832b96ea031c1b871053e/viewflow_extensions/views.py#L47-L51 | train | Transition to save the task and return to ASSIGNED state. |
Thermondo/viewflow-extensions | viewflow_extensions/views.py | SavableViewActivationMixin.activation_done | def activation_done(self, *args, **kwargs):
"""Complete the ``activation`` or save only, depending on form submit."""
if self._save:
self.save_task()
else:
super().activation_done(*args, **kwargs) | python | def activation_done(self, *args, **kwargs):
"""Complete the ``activation`` or save only, depending on form submit."""
if self._save:
self.save_task()
else:
super().activation_done(*args, **kwargs) | [
"def",
"activation_done",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_save",
":",
"self",
".",
"save_task",
"(",
")",
"else",
":",
"super",
"(",
")",
".",
"activation_done",
"(",
"*",
"args",
",",
"*",
"... | Complete the ``activation`` or save only, depending on form submit. | [
"Complete",
"the",
"activation",
"or",
"save",
"only",
"depending",
"on",
"form",
"submit",
"."
] | 5d2bbfe28ced7dda3e6832b96ea031c1b871053e | https://github.com/Thermondo/viewflow-extensions/blob/5d2bbfe28ced7dda3e6832b96ea031c1b871053e/viewflow_extensions/views.py#L53-L58 | train | Complete the activation or save only depending on form submit. |
thomasdelaet/python-velbus | velbus/messages/set_realtime_clock.py | SetRealtimeClock.populate | def populate(self, priority, address, rtr, data):
"""
:return: None
"""
assert isinstance(data, bytes)
self.needs_low_priority(priority)
self.needs_no_rtr(rtr)
self.needs_data(data, 3)
self.set_attributes(priority, address, rtr)
self._wday = data[0... | python | def populate(self, priority, address, rtr, data):
"""
:return: None
"""
assert isinstance(data, bytes)
self.needs_low_priority(priority)
self.needs_no_rtr(rtr)
self.needs_data(data, 3)
self.set_attributes(priority, address, rtr)
self._wday = data[0... | [
"def",
"populate",
"(",
"self",
",",
"priority",
",",
"address",
",",
"rtr",
",",
"data",
")",
":",
"assert",
"isinstance",
"(",
"data",
",",
"bytes",
")",
"self",
".",
"needs_low_priority",
"(",
"priority",
")",
"self",
".",
"needs_no_rtr",
"(",
"rtr",
... | :return: None | [
":",
"return",
":",
"None"
] | af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd | https://github.com/thomasdelaet/python-velbus/blob/af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd/velbus/messages/set_realtime_clock.py#L35-L46 | train | Populates the object with the data from the given bytes. |
thomasdelaet/python-velbus | velbus/messages/set_realtime_clock.py | SetRealtimeClock.to_json | def to_json(self):
"""
:return: str
"""
json_dict = self.to_json_basic()
json_dict['wday'] = self._wday
json_dict['hour'] = self._hour
json_dict['min'] = self._min
return json.dumps(json_dict) | python | def to_json(self):
"""
:return: str
"""
json_dict = self.to_json_basic()
json_dict['wday'] = self._wday
json_dict['hour'] = self._hour
json_dict['min'] = self._min
return json.dumps(json_dict) | [
"def",
"to_json",
"(",
"self",
")",
":",
"json_dict",
"=",
"self",
".",
"to_json_basic",
"(",
")",
"json_dict",
"[",
"'wday'",
"]",
"=",
"self",
".",
"_wday",
"json_dict",
"[",
"'hour'",
"]",
"=",
"self",
".",
"_hour",
"json_dict",
"[",
"'min'",
"]",
... | :return: str | [
":",
"return",
":",
"str"
] | af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd | https://github.com/thomasdelaet/python-velbus/blob/af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd/velbus/messages/set_realtime_clock.py#L48-L56 | train | Returns a string representation of the object. |
thomasdelaet/python-velbus | velbus/messages/set_realtime_clock.py | SetRealtimeClock.data_to_binary | def data_to_binary(self):
"""
:return: bytes
"""
return bytes([
COMMAND_CODE,
self._wday,
self._hour,
self._min
]) | python | def data_to_binary(self):
"""
:return: bytes
"""
return bytes([
COMMAND_CODE,
self._wday,
self._hour,
self._min
]) | [
"def",
"data_to_binary",
"(",
"self",
")",
":",
"return",
"bytes",
"(",
"[",
"COMMAND_CODE",
",",
"self",
".",
"_wday",
",",
"self",
".",
"_hour",
",",
"self",
".",
"_min",
"]",
")"
] | :return: bytes | [
":",
"return",
":",
"bytes"
] | af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd | https://github.com/thomasdelaet/python-velbus/blob/af2f8af43f1a24bf854eff9f3126fd7b5c41b3dd/velbus/messages/set_realtime_clock.py#L58-L67 | train | Convert the ISO8601 date to binary format. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/external_packages/novainstrumentation/niplot.py | niplot | def niplot():
"""
This script extends the native matplolib keyboard bindings.
This script allows to use the `up`, `down`, `left`, and `right` keys
to move the visualization window. Zooming can be performed using the `+`
and `-` keys. Finally, the scroll wheel can be used to zoom under cursor.
R... | python | def niplot():
"""
This script extends the native matplolib keyboard bindings.
This script allows to use the `up`, `down`, `left`, and `right` keys
to move the visualization window. Zooming can be performed using the `+`
and `-` keys. Finally, the scroll wheel can be used to zoom under cursor.
R... | [
"def",
"niplot",
"(",
")",
":",
"fig",
"=",
"gcf",
"(",
")",
"cid",
"=",
"fig",
".",
"canvas",
".",
"mpl_connect",
"(",
"'key_press_event'",
",",
"# @UnusedVariable",
"on_key_press",
")",
"cid",
"=",
"fig",
".",
"canvas",
".",
"mpl_connect",
"(",
"'key_r... | This script extends the native matplolib keyboard bindings.
This script allows to use the `up`, `down`, `left`, and `right` keys
to move the visualization window. Zooming can be performed using the `+`
and `-` keys. Finally, the scroll wheel can be used to zoom under cursor.
Returns
------- | [
"This",
"script",
"extends",
"the",
"native",
"matplolib",
"keyboard",
"bindings",
".",
"This",
"script",
"allows",
"to",
"use",
"the",
"up",
"down",
"left",
"and",
"right",
"keys",
"to",
"move",
"the",
"visualization",
"window",
".",
"Zooming",
"can",
"be",... | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/external_packages/novainstrumentation/niplot.py#L101-L117 | train | This script extends the native matplolib keyboard bindings. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | css_style_apply | def css_style_apply():
"""
-----
Brief
-----
Function that apply the css configurations to the Jupyter Notebook pages.
-----------
Description
-----------
Taking into consideration that, ultimately, biosignalsnotebooks Jupyter Notebooks are web pages,
then a CSS file with the st... | python | def css_style_apply():
"""
-----
Brief
-----
Function that apply the css configurations to the Jupyter Notebook pages.
-----------
Description
-----------
Taking into consideration that, ultimately, biosignalsnotebooks Jupyter Notebooks are web pages,
then a CSS file with the st... | [
"def",
"css_style_apply",
"(",
")",
":",
"path",
"=",
"\"styles/theme_style.css\"",
"if",
"pathexist",
"(",
"path",
")",
":",
"style",
"=",
"open",
"(",
"path",
",",
"\"r\"",
")",
".",
"read",
"(",
")",
"else",
":",
"style",
"=",
"open",
"(",
"\"../../... | -----
Brief
-----
Function that apply the css configurations to the Jupyter Notebook pages.
-----------
Description
-----------
Taking into consideration that, ultimately, biosignalsnotebooks Jupyter Notebooks are web pages,
then a CSS file with the style options for customization of bi... | [
"-----",
"Brief",
"-----",
"Function",
"that",
"apply",
"the",
"css",
"configurations",
"to",
"the",
"Jupyter",
"Notebook",
"pages",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L73-L106 | train | A function that applies the css configurations to the Jupyter Notebook pages. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | plot_sample_rate_compare | def plot_sample_rate_compare(data_dict, file_name=None):
"""
-----
Brief
-----
Is a plotting function that shows a sequence of ECG plots, demonstrating the relevance of
choosing a wright sampling rate.
-----------
Description
-----------
Function intended to generate a Bokeh fig... | python | def plot_sample_rate_compare(data_dict, file_name=None):
"""
-----
Brief
-----
Is a plotting function that shows a sequence of ECG plots, demonstrating the relevance of
choosing a wright sampling rate.
-----------
Description
-----------
Function intended to generate a Bokeh fig... | [
"def",
"plot_sample_rate_compare",
"(",
"data_dict",
",",
"file_name",
"=",
"None",
")",
":",
"# Generation of the HTML file where the plot will be stored.",
"#file_name = _generate_bokeh_file(file_name)",
"nbr_rows",
"=",
"len",
"(",
"list",
"(",
"data_dict",
".",
"keys",
... | -----
Brief
-----
Is a plotting function that shows a sequence of ECG plots, demonstrating the relevance of
choosing a wright sampling rate.
-----------
Description
-----------
Function intended to generate a Bokeh figure with Nx2 format, being N the number of keys of
'data_dict' - ... | [
"-----",
"Brief",
"-----",
"Is",
"a",
"plotting",
"function",
"that",
"shows",
"a",
"sequence",
"of",
"ECG",
"plots",
"demonstrating",
"the",
"relevance",
"of",
"choosing",
"a",
"wright",
"sampling",
"rate",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L119-L202 | train | Generates a Bokeh file that will be used to plot the sample rate of the ECG signal at a specific sampling rate. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | acquire_subsamples_gp1 | def acquire_subsamples_gp1(input_data, file_name=None):
"""
Function invoked for plotting a grid-plot with 3x2 format, showing the differences in ECG
signals accordingly to the chosen sampling frequency.
Applied in the cell with tag "subsampling_grid_plot_1".
----------
Parameters
--------... | python | def acquire_subsamples_gp1(input_data, file_name=None):
"""
Function invoked for plotting a grid-plot with 3x2 format, showing the differences in ECG
signals accordingly to the chosen sampling frequency.
Applied in the cell with tag "subsampling_grid_plot_1".
----------
Parameters
--------... | [
"def",
"acquire_subsamples_gp1",
"(",
"input_data",
",",
"file_name",
"=",
"None",
")",
":",
"# Generation of the HTML file where the plot will be stored.",
"#file_name = _generate_bokeh_file(file_name)",
"# Number of acquired samples (Original sample_rate = 4000 Hz)",
"fs_orig",
"=",
... | Function invoked for plotting a grid-plot with 3x2 format, showing the differences in ECG
signals accordingly to the chosen sampling frequency.
Applied in the cell with tag "subsampling_grid_plot_1".
----------
Parameters
----------
input_data : dict
Dictionary with ECG signal to prese... | [
"Function",
"invoked",
"for",
"plotting",
"a",
"grid",
"-",
"plot",
"with",
"3x2",
"format",
"showing",
"the",
"differences",
"in",
"ECG",
"signals",
"accordingly",
"to",
"the",
"chosen",
"sampling",
"frequency",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L206-L266 | train | This function is used to acquire subsamples of a Bokeh grid with 3x2 format. It is used to plot a grid - plot with 3x2 format. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | plot_ecg_pan_tompkins_steps | def plot_ecg_pan_tompkins_steps(time, orig_ecg, pre_process_ecg, sampling_rate, titles):
"""
-----
Brief
-----
With this plotting function it will be possible to plot simultaneously (in pairs) "Original"/
"Filtered"/"Differentiated"/"Rectified"/"Integrated" ECG signals used at "Pan-Tompkins R Pe... | python | def plot_ecg_pan_tompkins_steps(time, orig_ecg, pre_process_ecg, sampling_rate, titles):
"""
-----
Brief
-----
With this plotting function it will be possible to plot simultaneously (in pairs) "Original"/
"Filtered"/"Differentiated"/"Rectified"/"Integrated" ECG signals used at "Pan-Tompkins R Pe... | [
"def",
"plot_ecg_pan_tompkins_steps",
"(",
"time",
",",
"orig_ecg",
",",
"pre_process_ecg",
",",
"sampling_rate",
",",
"titles",
")",
":",
"if",
"len",
"(",
"titles",
")",
"==",
"2",
":",
"# Representation of the output of Step 1 of Pan-Tompkins R-Peak Detection Algorithm... | -----
Brief
-----
With this plotting function it will be possible to plot simultaneously (in pairs) "Original"/
"Filtered"/"Differentiated"/"Rectified"/"Integrated" ECG signals used at "Pan-Tompkins R Peaks
Detection Algorithm".
-----------
Description
-----------
Function intended ... | [
"-----",
"Brief",
"-----",
"With",
"this",
"plotting",
"function",
"it",
"will",
"be",
"possible",
"to",
"plot",
"simultaneously",
"(",
"in",
"pairs",
")",
"Original",
"/",
"Filtered",
"/",
"Differentiated",
"/",
"Rectified",
"/",
"Integrated",
"ECG",
"signals... | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L274-L334 | train | This function generates a Bokeh figure for the specified time - axis series of values and the time - axis signal of the original signal and the original signal of the filtered signal of the original signal and the original signal of the original signal. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | plot_ecg_pan_tompkins_peaks | def plot_ecg_pan_tompkins_peaks(time, orig_ecg, integrated_ecg, sampling_rate, possible_peaks,
probable_peaks, definitive_peaks):
"""
-----
Brief
-----
With this plotting function it will be possible to demonstrate which "peaks" are being
detected in each stage of... | python | def plot_ecg_pan_tompkins_peaks(time, orig_ecg, integrated_ecg, sampling_rate, possible_peaks,
probable_peaks, definitive_peaks):
"""
-----
Brief
-----
With this plotting function it will be possible to demonstrate which "peaks" are being
detected in each stage of... | [
"def",
"plot_ecg_pan_tompkins_peaks",
"(",
"time",
",",
"orig_ecg",
",",
"integrated_ecg",
",",
"sampling_rate",
",",
"possible_peaks",
",",
"probable_peaks",
",",
"definitive_peaks",
")",
":",
"# List that store the figure handler",
"list_figures",
"=",
"[",
"]",
"# Pl... | -----
Brief
-----
With this plotting function it will be possible to demonstrate which "peaks" are being
detected in each stage of Pan-Tompkins Algorithm (possible, probable, definitive).
-----------
Description
-----------
Function intended to generate a Bokeh figure containing all pea... | [
"-----",
"Brief",
"-----",
"With",
"this",
"plotting",
"function",
"it",
"will",
"be",
"possible",
"to",
"demonstrate",
"which",
"peaks",
"are",
"being",
"detected",
"in",
"each",
"stage",
"of",
"Pan",
"-",
"Tompkins",
"Algorithm",
"(",
"possible",
"probable",... | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L337-L406 | train | This function generates a Bokeh figure containing all peaks detected from a PAN - Tompkins signal. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | plot_emg_graphical_durations | def plot_emg_graphical_durations(max_time, min_time, avg_time, std_time):
"""
-----
Brief
-----
This plotting function ensures a graphical representation of maximum, minimum and average time
durations of the muscular activation periods.
-----------
Description
-----------
Functi... | python | def plot_emg_graphical_durations(max_time, min_time, avg_time, std_time):
"""
-----
Brief
-----
This plotting function ensures a graphical representation of maximum, minimum and average time
durations of the muscular activation periods.
-----------
Description
-----------
Functi... | [
"def",
"plot_emg_graphical_durations",
"(",
"max_time",
",",
"min_time",
",",
"avg_time",
",",
"std_time",
")",
":",
"# List that store the figure handler",
"list_figures_1",
"=",
"[",
"]",
"color_1",
"=",
"\"#009EE3\"",
"color_2",
"=",
"\"#00893E\"",
"color_3",
"=",
... | -----
Brief
-----
This plotting function ensures a graphical representation of maximum, minimum and average time
durations of the muscular activation periods.
-----------
Description
-----------
Function intended to generate a single Bokeh figure graphically describing and identifying
... | [
"-----",
"Brief",
"-----",
"This",
"plotting",
"function",
"ensures",
"a",
"graphical",
"representation",
"of",
"maximum",
"minimum",
"and",
"average",
"time",
"durations",
"of",
"the",
"muscular",
"activation",
"periods",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L415-L475 | train | This function generates a single Bokeh figure that shows the maximum minimum and average time duration of the muscular activation set and the standard deviation of the muscular activation set. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | plot_emg_graphical_statistical | def plot_emg_graphical_statistical(time, signal, max_sample_value, min_sample_value, avg_sample_value,
std_sample_value):
"""
-----
Brief
-----
This plotting function ensures a graphical representation of maximum, minimum and average sample
values registered on... | python | def plot_emg_graphical_statistical(time, signal, max_sample_value, min_sample_value, avg_sample_value,
std_sample_value):
"""
-----
Brief
-----
This plotting function ensures a graphical representation of maximum, minimum and average sample
values registered on... | [
"def",
"plot_emg_graphical_statistical",
"(",
"time",
",",
"signal",
",",
"max_sample_value",
",",
"min_sample_value",
",",
"avg_sample_value",
",",
"std_sample_value",
")",
":",
"# List that store the figure handler",
"list_figures",
"=",
"[",
"]",
"# Plotting of EMG.",
... | -----
Brief
-----
This plotting function ensures a graphical representation of maximum, minimum and average sample
values registered on the entire EMG acquisition.
-----------
Description
-----------
Function intended to generate a single Bokeh figure with graphically describing and ide... | [
"-----",
"Brief",
"-----",
"This",
"plotting",
"function",
"ensures",
"a",
"graphical",
"representation",
"of",
"maximum",
"minimum",
"and",
"average",
"sample",
"values",
"registered",
"on",
"the",
"entire",
"EMG",
"acquisition",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L478-L548 | train | This function generates a single Bokeh figure that shows the maximum minimum and average sample values for the given time and signal. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | plot_emg_rms_area | def plot_emg_rms_area(time, signal, rms, area):
"""
-----
Brief
-----
With the current function it will be plotted the EMG signals together with RMS line and the time-series that
describes the evolution of the cumulative area.
-----------
Description
-----------
Function intende... | python | def plot_emg_rms_area(time, signal, rms, area):
"""
-----
Brief
-----
With the current function it will be plotted the EMG signals together with RMS line and the time-series that
describes the evolution of the cumulative area.
-----------
Description
-----------
Function intende... | [
"def",
"plot_emg_rms_area",
"(",
"time",
",",
"signal",
",",
"rms",
",",
"area",
")",
":",
"# List that store the figure handler",
"list_figures",
"=",
"[",
"]",
"# Plotting of EMG area and RMS line",
"list_figures",
".",
"append",
"(",
"figure",
"(",
"x_axis_label",
... | -----
Brief
-----
With the current function it will be plotted the EMG signals together with RMS line and the time-series that
describes the evolution of the cumulative area.
-----------
Description
-----------
Function intended to generate a single Bokeh figure graphically describing a... | [
"-----",
"Brief",
"-----",
"With",
"the",
"current",
"function",
"it",
"will",
"be",
"plotted",
"the",
"EMG",
"signals",
"together",
"with",
"RMS",
"line",
"and",
"the",
"time",
"-",
"series",
"that",
"describes",
"the",
"evolution",
"of",
"the",
"cumulative... | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L551-L604 | train | This function generates a single Bokeh figure that describes the EMG signal and the RMS value of the current cumulative area. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | plot_emg_spect_freq | def plot_emg_spect_freq(freq_axis, power_axis, max_freq, median_freq):
"""
-----
Brief
-----
A plot with frequency power spectrum of the input EMG signal is presented graphically, highlighting maximum and
median power frequency.
-----------
Description
-----------
Function inten... | python | def plot_emg_spect_freq(freq_axis, power_axis, max_freq, median_freq):
"""
-----
Brief
-----
A plot with frequency power spectrum of the input EMG signal is presented graphically, highlighting maximum and
median power frequency.
-----------
Description
-----------
Function inten... | [
"def",
"plot_emg_spect_freq",
"(",
"freq_axis",
",",
"power_axis",
",",
"max_freq",
",",
"median_freq",
")",
":",
"# List that store the figure handler",
"list_figures",
"=",
"[",
"]",
"# Plotting of EMG Power Spectrum",
"list_figures",
".",
"append",
"(",
"figure",
"("... | -----
Brief
-----
A plot with frequency power spectrum of the input EMG signal is presented graphically, highlighting maximum and
median power frequency.
-----------
Description
-----------
Function intended to generate a single Bokeh figure graphically describing and identifying maximu... | [
"-----",
"Brief",
"-----",
"A",
"plot",
"with",
"frequency",
"power",
"spectrum",
"of",
"the",
"input",
"EMG",
"signal",
"is",
"presented",
"graphically",
"highlighting",
"maximum",
"and",
"median",
"power",
"frequency",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L607-L658 | train | This function generates a single Bokeh figure that shows the frequency and power spectrum of the EMG signal. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | plot_compare_act_config | def plot_compare_act_config(signal, sample_rate, file_name=None):
"""
-----
Brief
-----
By invoking this function, a gridplot will be presented, in order to show the effect in muscular
activation detection, when some input parameters of the algorithm are changed.
-----------
Description... | python | def plot_compare_act_config(signal, sample_rate, file_name=None):
"""
-----
Brief
-----
By invoking this function, a gridplot will be presented, in order to show the effect in muscular
activation detection, when some input parameters of the algorithm are changed.
-----------
Description... | [
"def",
"plot_compare_act_config",
"(",
"signal",
",",
"sample_rate",
",",
"file_name",
"=",
"None",
")",
":",
"# Generation of the HTML file where the plot will be stored.",
"#file_name = _generate_bokeh_file(file_name)",
"time",
"=",
"numpy",
".",
"linspace",
"(",
"0",
","... | -----
Brief
-----
By invoking this function, a gridplot will be presented, in order to show the effect in muscular
activation detection, when some input parameters of the algorithm are changed.
-----------
Description
-----------
It will be generated a Bokeh figure with 3x2 format, comp... | [
"-----",
"Brief",
"-----",
"By",
"invoking",
"this",
"function",
"a",
"gridplot",
"will",
"be",
"presented",
"in",
"order",
"to",
"show",
"the",
"effect",
"in",
"muscular",
"activation",
"detection",
"when",
"some",
"input",
"parameters",
"of",
"the",
"algorit... | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L666-L792 | train | This function generates a Bokeh figure with 3x2 format comparing the results of the muscular activation algorithm with the given EMG signal and the given sample rate. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | plot_median_freq_evol | def plot_median_freq_evol(time_signal, signal, time_median_freq, median_freq, activations_begin,
activations_end, sample_rate, file_name=None):
"""
-----
Brief
-----
Graphical representation of the EMG median power frequency evolution time series.
-----------
Descr... | python | def plot_median_freq_evol(time_signal, signal, time_median_freq, median_freq, activations_begin,
activations_end, sample_rate, file_name=None):
"""
-----
Brief
-----
Graphical representation of the EMG median power frequency evolution time series.
-----------
Descr... | [
"def",
"plot_median_freq_evol",
"(",
"time_signal",
",",
"signal",
",",
"time_median_freq",
",",
"median_freq",
",",
"activations_begin",
",",
"activations_end",
",",
"sample_rate",
",",
"file_name",
"=",
"None",
")",
":",
"# Generation of the HTML file where the plot wil... | -----
Brief
-----
Graphical representation of the EMG median power frequency evolution time series.
-----------
Description
-----------
Function intended to generate a Bokeh figure with 2x1 format, where each muscular activation
period is identified through a colored box and the plot th... | [
"-----",
"Brief",
"-----",
"Graphical",
"representation",
"of",
"the",
"EMG",
"median",
"power",
"frequency",
"evolution",
"time",
"series",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L796-L877 | train | Generates the Bokeh plot of the median frequency evolution of the time series. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | plot_informational_band | def plot_informational_band(freqs, power, signal, sr, band_begin, band_end,
legend="Signal Power Spectrum", x_lim=[], y_lim=[],
show_plot=False, file_name=None):
"""
-----
Brief
-----
With this function it is possible to present a plot containi... | python | def plot_informational_band(freqs, power, signal, sr, band_begin, band_end,
legend="Signal Power Spectrum", x_lim=[], y_lim=[],
show_plot=False, file_name=None):
"""
-----
Brief
-----
With this function it is possible to present a plot containi... | [
"def",
"plot_informational_band",
"(",
"freqs",
",",
"power",
",",
"signal",
",",
"sr",
",",
"band_begin",
",",
"band_end",
",",
"legend",
"=",
"\"Signal Power Spectrum\"",
",",
"x_lim",
"=",
"[",
"]",
",",
"y_lim",
"=",
"[",
"]",
",",
"show_plot",
"=",
... | -----
Brief
-----
With this function it is possible to present a plot containing the FFT Power Spectrum of an ECG
signal, highlighting the informative frequency band.
-----------
Description
-----------
The FFT Power Spectrum, of an input signal, can be generated through plotfft functio... | [
"-----",
"Brief",
"-----",
"With",
"this",
"function",
"it",
"is",
"possible",
"to",
"present",
"a",
"plot",
"containing",
"the",
"FFT",
"Power",
"Spectrum",
"of",
"an",
"ECG",
"signal",
"highlighting",
"the",
"informative",
"frequency",
"band",
"."
] | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L883-L1020 | train | This function generates a graphical plot of the informational band of a physiological signal. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | plot_before_after_filter | def plot_before_after_filter(signal, sr, band_begin, band_end, order=1, x_lim=[], y_lim=[],
orientation="hor", show_plot=False, file_name=None):
"""
-----
Brief
-----
The use of the current function is very useful for comparing two power spectrum's (before and
after ... | python | def plot_before_after_filter(signal, sr, band_begin, band_end, order=1, x_lim=[], y_lim=[],
orientation="hor", show_plot=False, file_name=None):
"""
-----
Brief
-----
The use of the current function is very useful for comparing two power spectrum's (before and
after ... | [
"def",
"plot_before_after_filter",
"(",
"signal",
",",
"sr",
",",
"band_begin",
",",
"band_end",
",",
"order",
"=",
"1",
",",
"x_lim",
"=",
"[",
"]",
",",
"y_lim",
"=",
"[",
"]",
",",
"orientation",
"=",
"\"hor\"",
",",
"show_plot",
"=",
"False",
",",
... | -----
Brief
-----
The use of the current function is very useful for comparing two power spectrum's (before and
after filtering the signal).
This function invokes "plot_informational_band" in order to get the power spectrum before
applying the signal to the lowpass filter.
-----------
D... | [
"-----",
"Brief",
"-----",
"The",
"use",
"of",
"the",
"current",
"function",
"is",
"very",
"useful",
"for",
"comparing",
"two",
"power",
"spectrum",
"s",
"(",
"before",
"and",
"after",
"filtering",
"the",
"signal",
")",
".",
"This",
"function",
"invokes",
... | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L1023-L1135 | train | This function is used to plot the frequency components of a signal before and after filtering. |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py | plot_low_pass_filter_response | def plot_low_pass_filter_response(show_plot=False, file_name=None):
"""
-----
Brief
-----
Taking into consideration the generic transfer function that defines the frequency response of
a low-pass filter (|H|=1/(sqrt(1+(f/fc)^2n), where fc is the corner frequency and n is the
filter order), t... | python | def plot_low_pass_filter_response(show_plot=False, file_name=None):
"""
-----
Brief
-----
Taking into consideration the generic transfer function that defines the frequency response of
a low-pass filter (|H|=1/(sqrt(1+(f/fc)^2n), where fc is the corner frequency and n is the
filter order), t... | [
"def",
"plot_low_pass_filter_response",
"(",
"show_plot",
"=",
"False",
",",
"file_name",
"=",
"None",
")",
":",
"# Generation of the HTML file where the plot will be stored.",
"#file_name = _generate_bokeh_file(file_name)",
"# Frequency list.",
"freqs",
"=",
"numpy",
".",
"lin... | -----
Brief
-----
Taking into consideration the generic transfer function that defines the frequency response of
a low-pass filter (|H|=1/(sqrt(1+(f/fc)^2n), where fc is the corner frequency and n is the
filter order), the current function will generate a figure for comparing the frequency response
... | [
"-----",
"Brief",
"-----",
"Taking",
"into",
"consideration",
"the",
"generic",
"transfer",
"function",
"that",
"defines",
"the",
"frequency",
"response",
"of",
"a",
"low",
"-",
"pass",
"filter",
"(",
"|H|",
"=",
"1",
"/",
"(",
"sqrt",
"(",
"1",
"+",
"("... | aaa01d4125180b3a34f1e26e0d3ff08c23f666d3 | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/__notebook_support__.py#L1138-L1224 | train | Generates a single low - pass filter response for a single Bokeh component. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.