body_hash
stringlengths
64
64
body
stringlengths
23
109k
docstring
stringlengths
1
57k
path
stringlengths
4
198
name
stringlengths
1
115
repository_name
stringlengths
7
111
repository_stars
float64
0
191k
lang
stringclasses
1 value
body_without_docstring
stringlengths
14
108k
unified
stringlengths
45
133k
c3c6c4becc690e070f210d8cf6ac2afdc386a212bcb66751db28e0968656f64a
def _write(self, preset_type, data): "\n Utility function to overwrite a particular preset's datum dictionary.\n " logger.debug('write presets for %s', self._device.name) with self._file_open_rlock(preset_type) as f: f.seek(0) yaml.dump(data, f, default_flow_style=False) ...
Utility function to overwrite a particular preset's datum dictionary.
pcdsdevices/interface.py
_write
slacAWallace/pcdsdevices
0
python
def _write(self, preset_type, data): "\n \n " logger.debug('write presets for %s', self._device.name) with self._file_open_rlock(preset_type) as f: f.seek(0) yaml.dump(data, f, default_flow_style=False) f.truncate()
def _write(self, preset_type, data): "\n \n " logger.debug('write presets for %s', self._device.name) with self._file_open_rlock(preset_type) as f: f.seek(0) yaml.dump(data, f, default_flow_style=False) f.truncate()<|docstring|>Utility function to overwrite a particular...
0b238487aeda2482d12a526115f9945b1a01b9be1f8279d89c092ac22953ee5c
@contextmanager def _file_open_rlock(self, preset_type, timeout=1.0): '\n File locking context manager for this object.\n\n Works like threading.Rlock in that you can acquire it multiple times\n safely.\n\n Parameters\n ----------\n fd: ``file``\n The file descri...
File locking context manager for this object. Works like threading.Rlock in that you can acquire it multiple times safely. Parameters ---------- fd: ``file`` The file descriptor to lock on. Raises ------ BlockingIOError: If we cannot acquire the file lock.
pcdsdevices/interface.py
_file_open_rlock
slacAWallace/pcdsdevices
0
python
@contextmanager def _file_open_rlock(self, preset_type, timeout=1.0): '\n File locking context manager for this object.\n\n Works like threading.Rlock in that you can acquire it multiple times\n safely.\n\n Parameters\n ----------\n fd: ``file``\n The file descri...
@contextmanager def _file_open_rlock(self, preset_type, timeout=1.0): '\n File locking context manager for this object.\n\n Works like threading.Rlock in that you can acquire it multiple times\n safely.\n\n Parameters\n ----------\n fd: ``file``\n The file descri...
8a63a2ec69356fd2fbb61008cc12104f9055924890fd7471de990629ed7312cb
def _update(self, preset_type, name, value=None, comment=None, active=True): "\n Utility function to update a preset position.\n\n Reads the existing preset's datum, updates the value the comment, and\n the active state, and then writes the datum back to the file, updating\n the history ...
Utility function to update a preset position. Reads the existing preset's datum, updates the value the comment, and the active state, and then writes the datum back to the file, updating the history accordingly.
pcdsdevices/interface.py
_update
slacAWallace/pcdsdevices
0
python
def _update(self, preset_type, name, value=None, comment=None, active=True): "\n Utility function to update a preset position.\n\n Reads the existing preset's datum, updates the value the comment, and\n the active state, and then writes the datum back to the file, updating\n the history ...
def _update(self, preset_type, name, value=None, comment=None, active=True): "\n Utility function to update a preset position.\n\n Reads the existing preset's datum, updates the value the comment, and\n the active state, and then writes the datum back to the file, updating\n the history ...
bf1f5c3c5c1184b71d0e0472d4ff3326f30a33ec5069e3be461317ec827af7f6
def sync(self): '\n Synchronize the presets with the database.\n ' logger.debug('call %s presets.sync()', self._device.name) self._remove_methods() self._cache = {} logger.debug('filling %s cache', self.name) for preset_type in self._paths.keys(): path = self._path(preset_t...
Synchronize the presets with the database.
pcdsdevices/interface.py
sync
slacAWallace/pcdsdevices
0
python
def sync(self): '\n \n ' logger.debug('call %s presets.sync()', self._device.name) self._remove_methods() self._cache = {} logger.debug('filling %s cache', self.name) for preset_type in self._paths.keys(): path = self._path(preset_type) if path.exists(): ...
def sync(self): '\n \n ' logger.debug('call %s presets.sync()', self._device.name) self._remove_methods() self._cache = {} logger.debug('filling %s cache', self.name) for preset_type in self._paths.keys(): path = self._path(preset_type) if path.exists(): ...
d717358afd5df40b55e9521d618c6d08ee3aa976b3ce3432e9e1bc5532e0a49a
def _create_methods(self): '\n Create the dynamic methods based on the configured paths.\n\n Add methods to this object for adding presets of each type, add\n methods to the associated device to move and check each preset, and\n add `PresetPosition` instances to ``self.positions`` for ea...
Create the dynamic methods based on the configured paths. Add methods to this object for adding presets of each type, add methods to the associated device to move and check each preset, and add `PresetPosition` instances to ``self.positions`` for each preset name.
pcdsdevices/interface.py
_create_methods
slacAWallace/pcdsdevices
0
python
def _create_methods(self): '\n Create the dynamic methods based on the configured paths.\n\n Add methods to this object for adding presets of each type, add\n methods to the associated device to move and check each preset, and\n add `PresetPosition` instances to ``self.positions`` for ea...
def _create_methods(self): '\n Create the dynamic methods based on the configured paths.\n\n Add methods to this object for adding presets of each type, add\n methods to the associated device to move and check each preset, and\n add `PresetPosition` instances to ``self.positions`` for ea...
df01e1bbb521c973768c126a6ec7f73c018514eaffc3087448908e61a80f8bc6
def _register_method(self, obj, method_name, method): '\n Utility function for managing dynamic methods.\n\n Adds a method to the ``_methods`` list and binds the method to an\n object.\n ' logger.debug('register method %s to %s', method_name, obj.name) self._methods.append((obj, ...
Utility function for managing dynamic methods. Adds a method to the ``_methods`` list and binds the method to an object.
pcdsdevices/interface.py
_register_method
slacAWallace/pcdsdevices
0
python
def _register_method(self, obj, method_name, method): '\n Utility function for managing dynamic methods.\n\n Adds a method to the ``_methods`` list and binds the method to an\n object.\n ' logger.debug('register method %s to %s', method_name, obj.name) self._methods.append((obj, ...
def _register_method(self, obj, method_name, method): '\n Utility function for managing dynamic methods.\n\n Adds a method to the ``_methods`` list and binds the method to an\n object.\n ' logger.debug('register method %s to %s', method_name, obj.name) self._methods.append((obj, ...
c755351fb8efb127973689c643ea63cdf093d48c3fa874066f4abab3104392cf
def _make_add(self, preset_type): '\n Create the functions that add preset positions.\n\n Creates suitable versions of ``add`` and ``add_here`` for a particular\n preset type, e.g. ``add_preset_type`` and ``add_here_preset_type``.\n ' def add(self, name, value, comment=None): ...
Create the functions that add preset positions. Creates suitable versions of ``add`` and ``add_here`` for a particular preset type, e.g. ``add_preset_type`` and ``add_here_preset_type``.
pcdsdevices/interface.py
_make_add
slacAWallace/pcdsdevices
0
python
def _make_add(self, preset_type): '\n Create the functions that add preset positions.\n\n Creates suitable versions of ``add`` and ``add_here`` for a particular\n preset type, e.g. ``add_preset_type`` and ``add_here_preset_type``.\n ' def add(self, name, value, comment=None): ...
def _make_add(self, preset_type): '\n Create the functions that add preset positions.\n\n Creates suitable versions of ``add`` and ``add_here`` for a particular\n preset type, e.g. ``add_preset_type`` and ``add_here_preset_type``.\n ' def add(self, name, value, comment=None): ...
1a630ffafc89c446d23b2ae61e0a994fcdeb62288da827f60655571dbdcee780
def _make_mv_pre(self, preset_type, name): '\n Create the functions that move to preset positions.\n\n Creates a suitable versions of ``mv`` and ``umv`` for a particular\n preset type and name e.g. ``mv_sample``.\n ' def mv_pre(self, timeout=None, wait=False): "\n ...
Create the functions that move to preset positions. Creates a suitable versions of ``mv`` and ``umv`` for a particular preset type and name e.g. ``mv_sample``.
pcdsdevices/interface.py
_make_mv_pre
slacAWallace/pcdsdevices
0
python
def _make_mv_pre(self, preset_type, name): '\n Create the functions that move to preset positions.\n\n Creates a suitable versions of ``mv`` and ``umv`` for a particular\n preset type and name e.g. ``mv_sample``.\n ' def mv_pre(self, timeout=None, wait=False): "\n ...
def _make_mv_pre(self, preset_type, name): '\n Create the functions that move to preset positions.\n\n Creates a suitable versions of ``mv`` and ``umv`` for a particular\n preset type and name e.g. ``mv_sample``.\n ' def mv_pre(self, timeout=None, wait=False): "\n ...
5864c4f4548fcc7e5d25d8d9ce968362ee11ff7059676446db697e2cf446ceec
def _make_wm_pre(self, preset_type, name): '\n Create a method to get the offset from a preset position.\n\n Creates a suitable version of ``wm`` for a particular preset type and\n name e.g. ``wm_sample``.\n ' def wm_pre(self): '\n Check the offset from the {} pre...
Create a method to get the offset from a preset position. Creates a suitable version of ``wm`` for a particular preset type and name e.g. ``wm_sample``.
pcdsdevices/interface.py
_make_wm_pre
slacAWallace/pcdsdevices
0
python
def _make_wm_pre(self, preset_type, name): '\n Create a method to get the offset from a preset position.\n\n Creates a suitable version of ``wm`` for a particular preset type and\n name e.g. ``wm_sample``.\n ' def wm_pre(self): '\n Check the offset from the {} pre...
def _make_wm_pre(self, preset_type, name): '\n Create a method to get the offset from a preset position.\n\n Creates a suitable version of ``wm`` for a particular preset type and\n name e.g. ``wm_sample``.\n ' def wm_pre(self): '\n Check the offset from the {} pre...
efec9516f8c81b0aaff698d7d5a682705ce0f802ae493576bf9d6ebe25e0ecbb
def _remove_methods(self): '\n Remove all methods created in the last call to _create_methods.\n ' logger.debug('call %s presets._remove_methods()', self._device.name) for (obj, method_name) in self._methods: try: delattr(obj, method_name) except AttributeError: ...
Remove all methods created in the last call to _create_methods.
pcdsdevices/interface.py
_remove_methods
slacAWallace/pcdsdevices
0
python
def _remove_methods(self): '\n \n ' logger.debug('call %s presets._remove_methods()', self._device.name) for (obj, method_name) in self._methods: try: delattr(obj, method_name) except AttributeError: pass self._methods = [] self.positions = Simpl...
def _remove_methods(self): '\n \n ' logger.debug('call %s presets._remove_methods()', self._device.name) for (obj, method_name) in self._methods: try: delattr(obj, method_name) except AttributeError: pass self._methods = [] self.positions = Simpl...
2f161fd6dc72c4311fa646dd1729793643ede7ef2c740d7cb514385ffeb1c32b
def update_pos(self, pos=None, comment=None): "\n Change this preset position and save it.\n\n Parameters\n ----------\n pos: ``float``, optional\n The position to use for this preset. If omitted, we'll use the\n current position.\n\n comment: ``str``, option...
Change this preset position and save it. Parameters ---------- pos: ``float``, optional The position to use for this preset. If omitted, we'll use the current position. comment: ``str``, optional A comment to associate with the preset position.
pcdsdevices/interface.py
update_pos
slacAWallace/pcdsdevices
0
python
def update_pos(self, pos=None, comment=None): "\n Change this preset position and save it.\n\n Parameters\n ----------\n pos: ``float``, optional\n The position to use for this preset. If omitted, we'll use the\n current position.\n\n comment: ``str``, option...
def update_pos(self, pos=None, comment=None): "\n Change this preset position and save it.\n\n Parameters\n ----------\n pos: ``float``, optional\n The position to use for this preset. If omitted, we'll use the\n current position.\n\n comment: ``str``, option...
545681446657839417eb5a675396c6a6729b695bef7d30b3cdb5a2262ba02ded
def update_comment(self, comment): '\n Revise the most recent comment in the preset history.\n\n Parameters\n ----------\n comment: ``str``\n A comment to associate with the preset position.\n ' self._presets._update(self._preset_type, self._name, comment=comment) ...
Revise the most recent comment in the preset history. Parameters ---------- comment: ``str`` A comment to associate with the preset position.
pcdsdevices/interface.py
update_comment
slacAWallace/pcdsdevices
0
python
def update_comment(self, comment): '\n Revise the most recent comment in the preset history.\n\n Parameters\n ----------\n comment: ``str``\n A comment to associate with the preset position.\n ' self._presets._update(self._preset_type, self._name, comment=comment) ...
def update_comment(self, comment): '\n Revise the most recent comment in the preset history.\n\n Parameters\n ----------\n comment: ``str``\n A comment to associate with the preset position.\n ' self._presets._update(self._preset_type, self._name, comment=comment) ...
fcb52551e5d25dcb22fa03ae97d10bae8d5437f75be45ca30fbb3544a32b9fe0
def deactivate(self): '\n Deactivate a preset from a device.\n\n This can always be undone unless you edit the underlying file.\n ' self._presets._update(self._preset_type, self._name, active=False) self._presets.sync()
Deactivate a preset from a device. This can always be undone unless you edit the underlying file.
pcdsdevices/interface.py
deactivate
slacAWallace/pcdsdevices
0
python
def deactivate(self): '\n Deactivate a preset from a device.\n\n This can always be undone unless you edit the underlying file.\n ' self._presets._update(self._preset_type, self._name, active=False) self._presets.sync()
def deactivate(self): '\n Deactivate a preset from a device.\n\n This can always be undone unless you edit the underlying file.\n ' self._presets._update(self._preset_type, self._name, active=False) self._presets.sync()<|docstring|>Deactivate a preset from a device. This can always be ...
540a94b989055ba85c22fcebc5bea5de44a9d411a542797d2e8a04ca54f66ab7
@property def info(self): '\n All information associated with this preset.\n\n Returns\n -------\n info: ``dict``\n ' return self._presets._cache[self._preset_type][self._name]
All information associated with this preset. Returns ------- info: ``dict``
pcdsdevices/interface.py
info
slacAWallace/pcdsdevices
0
python
@property def info(self): '\n All information associated with this preset.\n\n Returns\n -------\n info: ``dict``\n ' return self._presets._cache[self._preset_type][self._name]
@property def info(self): '\n All information associated with this preset.\n\n Returns\n -------\n info: ``dict``\n ' return self._presets._cache[self._preset_type][self._name]<|docstring|>All information associated with this preset. Returns ------- info: ``dict``<|endoftext|...
0d8cda27e6f357bcfe11f7f0808f403d487515fa6086f36759c5ec947b0c7470
@property def pos(self): '\n The set position of this preset.\n\n Returns\n -------\n pos: ``float``\n ' return self.info['value']
The set position of this preset. Returns ------- pos: ``float``
pcdsdevices/interface.py
pos
slacAWallace/pcdsdevices
0
python
@property def pos(self): '\n The set position of this preset.\n\n Returns\n -------\n pos: ``float``\n ' return self.info['value']
@property def pos(self): '\n The set position of this preset.\n\n Returns\n -------\n pos: ``float``\n ' return self.info['value']<|docstring|>The set position of this preset. Returns ------- pos: ``float``<|endoftext|>
3ecfa4b4b69ce86696b4a305083234e634d5a1d0e44f364183f51dbdd1efd840
@property def history(self): '\n This position history associated with this preset.\n\n Returns\n -------\n history: ``dict``\n ' return self.info['history']
This position history associated with this preset. Returns ------- history: ``dict``
pcdsdevices/interface.py
history
slacAWallace/pcdsdevices
0
python
@property def history(self): '\n This position history associated with this preset.\n\n Returns\n -------\n history: ``dict``\n ' return self.info['history']
@property def history(self): '\n This position history associated with this preset.\n\n Returns\n -------\n history: ``dict``\n ' return self.info['history']<|docstring|>This position history associated with this preset. Returns ------- history: ``dict``<|endoftext|>
4627cd54a6023ffc494b62ecd6ae016db7d8e3137ec15a196af0fbde8a575934
@property def path(self): '\n The filepath that defines this preset.\n\n Returns\n -------\n path: ``str``\n ' return str(self._presets._path(self._preset_type))
The filepath that defines this preset. Returns ------- path: ``str``
pcdsdevices/interface.py
path
slacAWallace/pcdsdevices
0
python
@property def path(self): '\n The filepath that defines this preset.\n\n Returns\n -------\n path: ``str``\n ' return str(self._presets._path(self._preset_type))
@property def path(self): '\n The filepath that defines this preset.\n\n Returns\n -------\n path: ``str``\n ' return str(self._presets._path(self._preset_type))<|docstring|>The filepath that defines this preset. Returns ------- path: ``str``<|endoftext|>
4b3fdb8c41bf9c00ae9ed71da25557e67d22586c35e4b42604402bcd7c00ded9
def thread_event(): '\n Function call camonitor to display motor position.\n ' thrd = Thread(target=args[0].camonitor) thrd.start() args[0]._mov_ev.set()
Function call camonitor to display motor position.
pcdsdevices/interface.py
thread_event
slacAWallace/pcdsdevices
0
python
def thread_event(): '\n \n ' thrd = Thread(target=args[0].camonitor) thrd.start() args[0]._mov_ev.set()
def thread_event(): '\n \n ' thrd = Thread(target=args[0].camonitor) thrd.start() args[0]._mov_ev.set()<|docstring|>Function call camonitor to display motor position.<|endoftext|>
d63011e576560cdb0721223f1d999cc6f5ef7d526d493252254467bc5251e503
def _scale(scale, direction): '\n Function used to change the scale.\n ' if ((direction == up) or (direction == shift_up)): scale = (scale * 2) print('\r {0:4f}'.format(scale), end=' ') elif ((direction == down) or (direction == shift_down)): scale = (scale / 2) ...
Function used to change the scale.
pcdsdevices/interface.py
_scale
slacAWallace/pcdsdevices
0
python
def _scale(scale, direction): '\n \n ' if ((direction == up) or (direction == shift_up)): scale = (scale * 2) print('\r {0:4f}'.format(scale), end=' ') elif ((direction == down) or (direction == shift_down)): scale = (scale / 2) print('\r {0:4f}'.format(scale), ...
def _scale(scale, direction): '\n \n ' if ((direction == up) or (direction == shift_up)): scale = (scale * 2) print('\r {0:4f}'.format(scale), end=' ') elif ((direction == down) or (direction == shift_down)): scale = (scale / 2) print('\r {0:4f}'.format(scale), ...
237074d207f5d057e59c4d21d7f8619ddaaa1fd5c54e02e236f1667520c92994
def movement(scale, direction): '\n Function used to know when and the direction to move the motor.\n ' try: if (direction == left): args[0].umvr((- scale)) thread_event() elif (direction == right): args[0].umvr(scale) thread_event() ...
Function used to know when and the direction to move the motor.
pcdsdevices/interface.py
movement
slacAWallace/pcdsdevices
0
python
def movement(scale, direction): '\n \n ' try: if (direction == left): args[0].umvr((- scale)) thread_event() elif (direction == right): args[0].umvr(scale) thread_event() elif ((direction == up) and (len(args) > 1)): ...
def movement(scale, direction): '\n \n ' try: if (direction == left): args[0].umvr((- scale)) thread_event() elif (direction == right): args[0].umvr(scale) thread_event() elif ((direction == up) and (len(args) > 1)): ...
e2cd6ebcf93c72585639f4cc3a0a9e3e5a486002182bbf26e7faf920b66af363
def add(self, name, value, comment=None): '\n Add a preset position of type "{}".\n\n Parameters\n ----------\n name: ``str``\n The name of the new preset position.\n\n value: ``float``\n The value of the new preset_position.\n\n ...
Add a preset position of type "{}". Parameters ---------- name: ``str`` The name of the new preset position. value: ``float`` The value of the new preset_position. comment: ``str``, optional A comment to associate with the preset position.
pcdsdevices/interface.py
add
slacAWallace/pcdsdevices
0
python
def add(self, name, value, comment=None): '\n Add a preset position of type "{}".\n\n Parameters\n ----------\n name: ``str``\n The name of the new preset position.\n\n value: ``float``\n The value of the new preset_position.\n\n ...
def add(self, name, value, comment=None): '\n Add a preset position of type "{}".\n\n Parameters\n ----------\n name: ``str``\n The name of the new preset position.\n\n value: ``float``\n The value of the new preset_position.\n\n ...
83cd358a37b7bf4acd39cf6b8b555724ca904215b415bba344f8ac2cd072a150
def add_here(self, name, comment=None): '\n Add a preset of the current position of type "{}".\n\n Parameters\n ----------\n name: ``str``\n The name of the new preset position.\n\n comment: ``str``, optional\n A comment to associa...
Add a preset of the current position of type "{}". Parameters ---------- name: ``str`` The name of the new preset position. comment: ``str``, optional A comment to associate with the preset position.
pcdsdevices/interface.py
add_here
slacAWallace/pcdsdevices
0
python
def add_here(self, name, comment=None): '\n Add a preset of the current position of type "{}".\n\n Parameters\n ----------\n name: ``str``\n The name of the new preset position.\n\n comment: ``str``, optional\n A comment to associa...
def add_here(self, name, comment=None): '\n Add a preset of the current position of type "{}".\n\n Parameters\n ----------\n name: ``str``\n The name of the new preset position.\n\n comment: ``str``, optional\n A comment to associa...
134c4302e9d86d99368d039c95487e7cea1fc3a72296ac01a43b2b69ab840413
def mv_pre(self, timeout=None, wait=False): "\n Move to the {} preset position.\n\n Parameters\n ----------\n timeout: ``float``, optional\n If provided, the mover will throw an error if motion takes\n longer than timeout to complete. If omit...
Move to the {} preset position. Parameters ---------- timeout: ``float``, optional If provided, the mover will throw an error if motion takes longer than timeout to complete. If omitted, the mover's default timeout will be use. wait: ``bool``, optional If ``True``, wait for motion completion before re...
pcdsdevices/interface.py
mv_pre
slacAWallace/pcdsdevices
0
python
def mv_pre(self, timeout=None, wait=False): "\n Move to the {} preset position.\n\n Parameters\n ----------\n timeout: ``float``, optional\n If provided, the mover will throw an error if motion takes\n longer than timeout to complete. If omit...
def mv_pre(self, timeout=None, wait=False): "\n Move to the {} preset position.\n\n Parameters\n ----------\n timeout: ``float``, optional\n If provided, the mover will throw an error if motion takes\n longer than timeout to complete. If omit...
7261892c6437b850c8ad58a1dcbd29259556d3bdebb68cca0cf3b74e23d471d2
def umv_pre(self, timeout=None): "\n Update move to the {} preset position.\n\n Parameters\n ----------\n timeout: ``float``, optional\n If provided, the mover will throw an error if motion takes\n longer than timeout to complete. If omitted,...
Update move to the {} preset position. Parameters ---------- timeout: ``float``, optional If provided, the mover will throw an error if motion takes longer than timeout to complete. If omitted, the mover's default timeout will be use.
pcdsdevices/interface.py
umv_pre
slacAWallace/pcdsdevices
0
python
def umv_pre(self, timeout=None): "\n Update move to the {} preset position.\n\n Parameters\n ----------\n timeout: ``float``, optional\n If provided, the mover will throw an error if motion takes\n longer than timeout to complete. If omitted,...
def umv_pre(self, timeout=None): "\n Update move to the {} preset position.\n\n Parameters\n ----------\n timeout: ``float``, optional\n If provided, the mover will throw an error if motion takes\n longer than timeout to complete. If omitted,...
eddff5e80f0dda51dce03b85e86c6b87ed5fb65999ba3bac23fb67310787f3a6
def wm_pre(self): '\n Check the offset from the {} preset position.\n\n Returns\n -------\n offset: ``float``\n How far we are from the preset position. If this is near zero,\n we are at the position. If this positive, the preset position\n ...
Check the offset from the {} preset position. Returns ------- offset: ``float`` How far we are from the preset position. If this is near zero, we are at the position. If this positive, the preset position is in the positive direction from us.
pcdsdevices/interface.py
wm_pre
slacAWallace/pcdsdevices
0
python
def wm_pre(self): '\n Check the offset from the {} preset position.\n\n Returns\n -------\n offset: ``float``\n How far we are from the preset position. If this is near zero,\n we are at the position. If this positive, the preset position\n ...
def wm_pre(self): '\n Check the offset from the {} preset position.\n\n Returns\n -------\n offset: ``float``\n How far we are from the preset position. If this is near zero,\n we are at the position. If this positive, the preset position\n ...
be15f94777407edb996ddb8441fc8ecb7d0bde6ce920d15e8d9c5fa8e40538dc
@cli.group() def lccs(): 'More lccs database commands.'
More lccs database commands.
lccs_db/cli.py
lccs
brazil-data-cube/lccs-db
6
python
@cli.group() def lccs():
@cli.group() def lccs(): <|docstring|>More lccs database commands.<|endoftext|>
7bb3705622f53d1f3067f67baf6879eb96bacca3f15a4bc4abd040910d110052
@db.command() @with_appcontext def create_extension_hstore(): 'Enable the HSTORE extension in the database.' click.secho(f'Creating extension hstore...', bold=True, fg='yellow') with _db.session.begin_nested(): _db.session.execute('CREATE EXTENSION IF NOT EXISTS hstore') _db.session.commit() ...
Enable the HSTORE extension in the database.
lccs_db/cli.py
create_extension_hstore
brazil-data-cube/lccs-db
6
python
@db.command() @with_appcontext def create_extension_hstore(): click.secho(f'Creating extension hstore...', bold=True, fg='yellow') with _db.session.begin_nested(): _db.session.execute('CREATE EXTENSION IF NOT EXISTS hstore') _db.session.commit() click.secho('Extension created!', bold=True, ...
@db.command() @with_appcontext def create_extension_hstore(): click.secho(f'Creating extension hstore...', bold=True, fg='yellow') with _db.session.begin_nested(): _db.session.execute('CREATE EXTENSION IF NOT EXISTS hstore') _db.session.commit() click.secho('Extension created!', bold=True, ...
1eb14777a508d6b9fc20c977a68b452ccff3d161bf9088d3340d5e888bb316a4
@lccs.command() @with_appcontext @click.option('-v', '--verbose', is_flag=True, default=False) @click.option('--system_name', type=click.STRING, required=True, help='The classification system name.') @click.option('--system_version', type=click.STRING, required=True, help='The classification system version.') @click.op...
Insert style of classification system.
lccs_db/cli.py
insert_style
brazil-data-cube/lccs-db
6
python
@lccs.command() @with_appcontext @click.option('-v', '--verbose', is_flag=True, default=False) @click.option('--system_name', type=click.STRING, required=True, help='The classification system name.') @click.option('--system_version', type=click.STRING, required=True, help='The classification system version.') @click.op...
@lccs.command() @with_appcontext @click.option('-v', '--verbose', is_flag=True, default=False) @click.option('--system_name', type=click.STRING, required=True, help='The classification system name.') @click.option('--system_version', type=click.STRING, required=True, help='The classification system version.') @click.op...
03c2c53cf5325f8550e4dc71f93c607a1c54a053b11c288aade9239019ac1cf4
def main(as_module=False): 'Define a main function for executing the module.' import sys cli.main(args=sys.argv[1:], prog_name=('python -m lccs_db' if as_module else None))
Define a main function for executing the module.
lccs_db/cli.py
main
brazil-data-cube/lccs-db
6
python
def main(as_module=False): import sys cli.main(args=sys.argv[1:], prog_name=('python -m lccs_db' if as_module else None))
def main(as_module=False): import sys cli.main(args=sys.argv[1:], prog_name=('python -m lccs_db' if as_module else None))<|docstring|>Define a main function for executing the module.<|endoftext|>
597593fe222a45cca90396c7ad0eda8b7b00fcc97fd5da2b4689ec0b786584f8
def __init__(self): '\n initializes an instance of DatabaseManager.\n ' super().__init__()
initializes an instance of DatabaseManager.
src/tests/unit/database/manager.py
__init__
wilsonGmn/pyrin
0
python
def __init__(self): '\n \n ' super().__init__()
def __init__(self): '\n \n ' super().__init__()<|docstring|>initializes an instance of DatabaseManager.<|endoftext|>
49234933d40edce30b4e9ec28de176cd014589eb98b8a93ece6832c852d474dc
def get_binds(self): '\n gets a shallow copy of binds dictionary.\n\n :returns: dict[type entity: str bind_name]\n :rtype: dict\n ' return self._binds.copy()
gets a shallow copy of binds dictionary. :returns: dict[type entity: str bind_name] :rtype: dict
src/tests/unit/database/manager.py
get_binds
wilsonGmn/pyrin
0
python
def get_binds(self): '\n gets a shallow copy of binds dictionary.\n\n :returns: dict[type entity: str bind_name]\n :rtype: dict\n ' return self._binds.copy()
def get_binds(self): '\n gets a shallow copy of binds dictionary.\n\n :returns: dict[type entity: str bind_name]\n :rtype: dict\n ' return self._binds.copy()<|docstring|>gets a shallow copy of binds dictionary. :returns: dict[type entity: str bind_name] :rtype: dict<|endoftext|>
001634c7c1bad23bf9dcc2457d8b7f8188d76a9c4db2c443c848403a02edf064
def get_all_engines(self): '\n gets all database engines.\n\n :rtype: list[Engine]\n ' engines = [self.get_default_engine()] engines.extend([engine for engine in self.get_bounded_engines().values()]) return engines
gets all database engines. :rtype: list[Engine]
src/tests/unit/database/manager.py
get_all_engines
wilsonGmn/pyrin
0
python
def get_all_engines(self): '\n gets all database engines.\n\n :rtype: list[Engine]\n ' engines = [self.get_default_engine()] engines.extend([engine for engine in self.get_bounded_engines().values()]) return engines
def get_all_engines(self): '\n gets all database engines.\n\n :rtype: list[Engine]\n ' engines = [self.get_default_engine()] engines.extend([engine for engine in self.get_bounded_engines().values()]) return engines<|docstring|>gets all database engines. :rtype: list[Engine]<|endoft...
e1f2ebbaa5a456097a6f9bd8c092213714342a2ca6ef0dd430e03a033339f1ac
def remove_bind(self, entity): '\n removes the given entity from binds dictionary.\n\n :param type entity: entity type to be removed.\n ' self._binds.pop(entity)
removes the given entity from binds dictionary. :param type entity: entity type to be removed.
src/tests/unit/database/manager.py
remove_bind
wilsonGmn/pyrin
0
python
def remove_bind(self, entity): '\n removes the given entity from binds dictionary.\n\n :param type entity: entity type to be removed.\n ' self._binds.pop(entity)
def remove_bind(self, entity): '\n removes the given entity from binds dictionary.\n\n :param type entity: entity type to be removed.\n ' self._binds.pop(entity)<|docstring|>removes the given entity from binds dictionary. :param type entity: entity type to be removed.<|endoftext|>
166f369793ed29d22a648b3cfeca99033eebe856b4338c13be77428ced21c9e1
def tile(x, count, dim=0): '\n Tiles x on dimension dim count times.\n ' perm = list(range(len(x.size()))) if (dim != 0): (perm[0], perm[dim]) = (perm[dim], perm[0]) x = x.permute(perm).contiguous() out_size = list(x.size()) out_size[0] *= count batch = x.size(0) x = x....
Tiles x on dimension dim count times.
ppg2mel/utils/basic_layers.py
tile
chloe5685/MockingBird
1
python
def tile(x, count, dim=0): '\n \n ' perm = list(range(len(x.size()))) if (dim != 0): (perm[0], perm[dim]) = (perm[dim], perm[0]) x = x.permute(perm).contiguous() out_size = list(x.size()) out_size[0] *= count batch = x.size(0) x = x.view(batch, (- 1)).transpose(0, 1).re...
def tile(x, count, dim=0): '\n \n ' perm = list(range(len(x.size()))) if (dim != 0): (perm[0], perm[dim]) = (perm[dim], perm[0]) x = x.permute(perm).contiguous() out_size = list(x.size()) out_size[0] *= count batch = x.size(0) x = x.view(batch, (- 1)).transpose(0, 1).re...
166f369793ed29d22a648b3cfeca99033eebe856b4338c13be77428ced21c9e1
def tile(x, count, dim=0): '\n Tiles x on dimension dim count times.\n ' perm = list(range(len(x.size()))) if (dim != 0): (perm[0], perm[dim]) = (perm[dim], perm[0]) x = x.permute(perm).contiguous() out_size = list(x.size()) out_size[0] *= count batch = x.size(0) x = x....
Tiles x on dimension dim count times.
ppg2mel/utils/basic_layers.py
tile
chloe5685/MockingBird
1
python
def tile(x, count, dim=0): '\n \n ' perm = list(range(len(x.size()))) if (dim != 0): (perm[0], perm[dim]) = (perm[dim], perm[0]) x = x.permute(perm).contiguous() out_size = list(x.size()) out_size[0] *= count batch = x.size(0) x = x.view(batch, (- 1)).transpose(0, 1).re...
def tile(x, count, dim=0): '\n \n ' perm = list(range(len(x.size()))) if (dim != 0): (perm[0], perm[dim]) = (perm[dim], perm[0]) x = x.permute(perm).contiguous() out_size = list(x.size()) out_size[0] *= count batch = x.size(0) x = x.view(batch, (- 1)).transpose(0, 1).re...
35f8dd5f202c1da3acb5e43e985a38ecad57f4e77244d8fb258a34ac557876ae
@scheduler.scheduled_job('cron', id='calculate_enrollment_schedule', hour=2) def _class_enrollment_schedule_calculate(): '\n 计算学生报名情况,每天凌晨2点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: today_date = get_now().strftime('%Y-%m-%d') manager = ClassTemplateManage...
计算学生报名情况,每天凌晨2点执行一次 :return:
etutorservice/jobs/scheduler.py
_class_enrollment_schedule_calculate
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='calculate_enrollment_schedule', hour=2) def _class_enrollment_schedule_calculate(): '\n 计算学生报名情况,每天凌晨2点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: today_date = get_now().strftime('%Y-%m-%d') manager = ClassTemplateManage...
@scheduler.scheduled_job('cron', id='calculate_enrollment_schedule', hour=2) def _class_enrollment_schedule_calculate(): '\n 计算学生报名情况,每天凌晨2点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: today_date = get_now().strftime('%Y-%m-%d') manager = ClassTemplateManage...
030185eab87e4ca0bf9ce5fed46e8aeba4814ec1144363b3d28def306920c500
@scheduler.scheduled_job('interval', id='send_sms', minutes=1) def _send_sms(): '\n 发送短信定时任务,每分钟运行一次。\n :return:\n ' if config.data.get('testing'): return with db_session_manager.with_session() as db_session: sender = MessageSender() manager = SmsMessageManager(db_session) ...
发送短信定时任务,每分钟运行一次。 :return:
etutorservice/jobs/scheduler.py
_send_sms
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('interval', id='send_sms', minutes=1) def _send_sms(): '\n 发送短信定时任务,每分钟运行一次。\n :return:\n ' if config.data.get('testing'): return with db_session_manager.with_session() as db_session: sender = MessageSender() manager = SmsMessageManager(db_session) ...
@scheduler.scheduled_job('interval', id='send_sms', minutes=1) def _send_sms(): '\n 发送短信定时任务,每分钟运行一次。\n :return:\n ' if config.data.get('testing'): return with db_session_manager.with_session() as db_session: sender = MessageSender() manager = SmsMessageManager(db_session) ...
d6d39a9ecabe7e0648e5ddb001f127b21e351842e0312b5e549b2eff080d0c70
@scheduler.scheduled_job('interval', id='send_mail', minutes=1) def _send_mail(): '\n 发送邮件定时任务,每分钟运行一次。\n :return:\n ' if config.data.get('testing'): return from_address = config.data['smtp']['user_name'] has_sent_mail_ids = [] with db_session_manager.with_session() as db_session: ...
发送邮件定时任务,每分钟运行一次。 :return:
etutorservice/jobs/scheduler.py
_send_mail
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('interval', id='send_mail', minutes=1) def _send_mail(): '\n 发送邮件定时任务,每分钟运行一次。\n :return:\n ' if config.data.get('testing'): return from_address = config.data['smtp']['user_name'] has_sent_mail_ids = [] with db_session_manager.with_session() as db_session: ...
@scheduler.scheduled_job('interval', id='send_mail', minutes=1) def _send_mail(): '\n 发送邮件定时任务,每分钟运行一次。\n :return:\n ' if config.data.get('testing'): return from_address = config.data['smtp']['user_name'] has_sent_mail_ids = [] with db_session_manager.with_session() as db_session: ...
53491f2b7fb7801feee84691a5c1aee111cc1d6309cddbaff4512533b506acf5
@scheduler.scheduled_job('cron', id='init_class_template_place', hour=2) def _init_class_template_place(): '\n 初始化班型剩余名额占用缓存数据,每天凌晨2点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassTemplatePlaceManager(db_session) manager.init_all_place_data()
初始化班型剩余名额占用缓存数据,每天凌晨2点执行一次 :return:
etutorservice/jobs/scheduler.py
_init_class_template_place
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='init_class_template_place', hour=2) def _init_class_template_place(): '\n 初始化班型剩余名额占用缓存数据,每天凌晨2点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassTemplatePlaceManager(db_session) manager.init_all_place_data()
@scheduler.scheduled_job('cron', id='init_class_template_place', hour=2) def _init_class_template_place(): '\n 初始化班型剩余名额占用缓存数据,每天凌晨2点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassTemplatePlaceManager(db_session) manager.init_all_place_data()<|d...
12718320ae473c81c863a1c0158da3b14157aa8b07a60e0d5b22fee83956479b
@scheduler.scheduled_job('cron', id='class_create', hour=2) def _class_create(): '\n 清除班级过期学员、释放教师可用时段、创建组班任务,每日凌晨2点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_session) manager.process_expired_student() with db_session...
清除班级过期学员、释放教师可用时段、创建组班任务,每日凌晨2点执行一次 :return:
etutorservice/jobs/scheduler.py
_class_create
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='class_create', hour=2) def _class_create(): '\n 清除班级过期学员、释放教师可用时段、创建组班任务,每日凌晨2点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_session) manager.process_expired_student() with db_session...
@scheduler.scheduled_job('cron', id='class_create', hour=2) def _class_create(): '\n 清除班级过期学员、释放教师可用时段、创建组班任务,每日凌晨2点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_session) manager.process_expired_student() with db_session...
d4d83b6d9d672c78badc3eae63d7b43d761b4ba087f95ffb37682a617d9eed01
@scheduler.scheduled_job('cron', id='next_day_class_notify', hour=20) def _next_day_class_notify(): '\n 第二天课通知任务(第二天上的课,前一天晚上8点进行通知),每日晚上8点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_session) manager.notify_next_day_class(...
第二天课通知任务(第二天上的课,前一天晚上8点进行通知),每日晚上8点执行一次 :return:
etutorservice/jobs/scheduler.py
_next_day_class_notify
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='next_day_class_notify', hour=20) def _next_day_class_notify(): '\n 第二天课通知任务(第二天上的课,前一天晚上8点进行通知),每日晚上8点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_session) manager.notify_next_day_class(...
@scheduler.scheduled_job('cron', id='next_day_class_notify', hour=20) def _next_day_class_notify(): '\n 第二天课通知任务(第二天上的课,前一天晚上8点进行通知),每日晚上8点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_session) manager.notify_next_day_class(...
7528a1f6605734cfa3a33b159ced9cf2e85531912a5b181149e559db33b6b961
@scheduler.scheduled_job('cron', id='notify_need_test_coaches', hour='18,22') def _notify_need_test_coaches(): '\n 已接受邀请但在软件测试截止时间前还没通过测试的教练,在测试截止时间前2小时提醒教练去测试\n (上午接受邀请的教练软件测试截止晚上8点,非上午接受的截止晚上12点),每日下午5点和晚上10点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager ...
已接受邀请但在软件测试截止时间前还没通过测试的教练,在测试截止时间前2小时提醒教练去测试 (上午接受邀请的教练软件测试截止晚上8点,非上午接受的截止晚上12点),每日下午5点和晚上10点执行一次 :return:
etutorservice/jobs/scheduler.py
_notify_need_test_coaches
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='notify_need_test_coaches', hour='18,22') def _notify_need_test_coaches(): '\n 已接受邀请但在软件测试截止时间前还没通过测试的教练,在测试截止时间前2小时提醒教练去测试\n (上午接受邀请的教练软件测试截止晚上8点,非上午接受的截止晚上12点),每日下午5点和晚上10点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager ...
@scheduler.scheduled_job('cron', id='notify_need_test_coaches', hour='18,22') def _notify_need_test_coaches(): '\n 已接受邀请但在软件测试截止时间前还没通过测试的教练,在测试截止时间前2小时提醒教练去测试\n (上午接受邀请的教练软件测试截止晚上8点,非上午接受的截止晚上12点),每日下午5点和晚上10点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager ...
23fcbb617b6969ca00186c9f57839957c076b38f16b303bc189638c29b6a4ec8
@scheduler.scheduled_job('cron', id='check_not_on_time_coaches', hour='6-23', minute='5-59/15') def _check_not_on_time_coaches(): '\n 检查没有准时上课的教练(教练必须上课前10分钟登录系统),每日早上6点至晚上11点的1至59分每15分钟执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_...
检查没有准时上课的教练(教练必须上课前10分钟登录系统),每日早上6点至晚上11点的1至59分每15分钟执行一次 :return:
etutorservice/jobs/scheduler.py
_check_not_on_time_coaches
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='check_not_on_time_coaches', hour='6-23', minute='5-59/15') def _check_not_on_time_coaches(): '\n 检查没有准时上课的教练(教练必须上课前10分钟登录系统),每日早上6点至晚上11点的1至59分每15分钟执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_...
@scheduler.scheduled_job('cron', id='check_not_on_time_coaches', hour='6-23', minute='5-59/15') def _check_not_on_time_coaches(): '\n 检查没有准时上课的教练(教练必须上课前10分钟登录系统),每日早上6点至晚上11点的1至59分每15分钟执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_...
de1ea8581c3b422140598d5995e88794cdf7090dc95dcd357888608bbf85a0a8
@scheduler.scheduled_job('cron', id='assign_students', minute='0-59/15') def _assign_students(): '\n 在上课前3小时为新开班分配教练和学员,每日的早上4点至晚上8点,每15分钟执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassAllocationManager(db_session) task_manager = ClassCreateTask...
在上课前3小时为新开班分配教练和学员,每日的早上4点至晚上8点,每15分钟执行一次 :return:
etutorservice/jobs/scheduler.py
_assign_students
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='assign_students', minute='0-59/15') def _assign_students(): '\n 在上课前3小时为新开班分配教练和学员,每日的早上4点至晚上8点,每15分钟执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassAllocationManager(db_session) task_manager = ClassCreateTask...
@scheduler.scheduled_job('cron', id='assign_students', minute='0-59/15') def _assign_students(): '\n 在上课前3小时为新开班分配教练和学员,每日的早上4点至晚上8点,每15分钟执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassAllocationManager(db_session) task_manager = ClassCreateTask...
9a50eaaa1ba3628c12cf40fa6e407cd4f101114f4f2d6023f14824684ff5bf2e
@scheduler.scheduled_job('cron', id='task_coach_not_ready_notify', hour='2-18', minute='0-59/15') def _task_coach_not_ready_notify(): '\n 开班预警通知,新开班如果在开班前26小时还没有找齐教练,通知教务,每日的早上2点至下午6点,每15分钟执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassCreateTaskManager...
开班预警通知,新开班如果在开班前26小时还没有找齐教练,通知教务,每日的早上2点至下午6点,每15分钟执行一次 :return:
etutorservice/jobs/scheduler.py
_task_coach_not_ready_notify
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='task_coach_not_ready_notify', hour='2-18', minute='0-59/15') def _task_coach_not_ready_notify(): '\n 开班预警通知,新开班如果在开班前26小时还没有找齐教练,通知教务,每日的早上2点至下午6点,每15分钟执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassCreateTaskManager...
@scheduler.scheduled_job('cron', id='task_coach_not_ready_notify', hour='2-18', minute='0-59/15') def _task_coach_not_ready_notify(): '\n 开班预警通知,新开班如果在开班前26小时还没有找齐教练,通知教务,每日的早上2点至下午6点,每15分钟执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassCreateTaskManager...
38191baf3653e46c92d75d6e61756d09c9d405260d3826d1c622e214fd22a6ba
@scheduler.scheduled_job('cron', id='check_and_invite_coach', hour='6-24', minute='*') def _check_and_invite_coach(): '\n 教练开班邀请定时任务,主要处理:\n 1. 教练邀请过期检查及处理;\n 2. 教练自动邀请;\n 3. 如果教练已找齐,设置邀请完成\n 每日早上6点到晚上12点,每分钟运行一次\n :return:\n ' with db_session_manager.with_session() as db_session: m...
教练开班邀请定时任务,主要处理: 1. 教练邀请过期检查及处理; 2. 教练自动邀请; 3. 如果教练已找齐,设置邀请完成 每日早上6点到晚上12点,每分钟运行一次 :return:
etutorservice/jobs/scheduler.py
_check_and_invite_coach
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='check_and_invite_coach', hour='6-24', minute='*') def _check_and_invite_coach(): '\n 教练开班邀请定时任务,主要处理:\n 1. 教练邀请过期检查及处理;\n 2. 教练自动邀请;\n 3. 如果教练已找齐,设置邀请完成\n 每日早上6点到晚上12点,每分钟运行一次\n :return:\n ' with db_session_manager.with_session() as db_session: m...
@scheduler.scheduled_job('cron', id='check_and_invite_coach', hour='6-24', minute='*') def _check_and_invite_coach(): '\n 教练开班邀请定时任务,主要处理:\n 1. 教练邀请过期检查及处理;\n 2. 教练自动邀请;\n 3. 如果教练已找齐,设置邀请完成\n 每日早上6点到晚上12点,每分钟运行一次\n :return:\n ' with db_session_manager.with_session() as db_session: m...
614a1057274f14c76c6db7deaa561e80fd393066e4d3fc8839b4c82cde8ee0cd
@scheduler.scheduled_job('cron', id='correct_coach_status', hour=2) def _correct_coach_status(): '\n 矫正储备、待岗、在岗老师的状态,每天凌晨2点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = CorrectCoachStatusTaskManager(db_session) manager.process_correct_coach_status()
矫正储备、待岗、在岗老师的状态,每天凌晨2点执行一次 :return:
etutorservice/jobs/scheduler.py
_correct_coach_status
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='correct_coach_status', hour=2) def _correct_coach_status(): '\n 矫正储备、待岗、在岗老师的状态,每天凌晨2点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = CorrectCoachStatusTaskManager(db_session) manager.process_correct_coach_status()
@scheduler.scheduled_job('cron', id='correct_coach_status', hour=2) def _correct_coach_status(): '\n 矫正储备、待岗、在岗老师的状态,每天凌晨2点执行一次\n :return:\n ' with db_session_manager.with_session() as db_session: manager = CorrectCoachStatusTaskManager(db_session) manager.process_correct_coach_status()...
3bed91081084052efc051b95e7bf28e186eb0633810343a870bf2d95659af2c1
@scheduler.scheduled_job('interval', id='notify_disconnect', minutes=1) def _notify_disconnect(): '\n 通知教务处理掉线的班级,每分钟运行一次\n ' with db_session_manager.with_session() as db_session: manager = MonitorManager(db_session) manager.notify_disconnect()
通知教务处理掉线的班级,每分钟运行一次
etutorservice/jobs/scheduler.py
_notify_disconnect
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('interval', id='notify_disconnect', minutes=1) def _notify_disconnect(): '\n \n ' with db_session_manager.with_session() as db_session: manager = MonitorManager(db_session) manager.notify_disconnect()
@scheduler.scheduled_job('interval', id='notify_disconnect', minutes=1) def _notify_disconnect(): '\n \n ' with db_session_manager.with_session() as db_session: manager = MonitorManager(db_session) manager.notify_disconnect()<|docstring|>通知教务处理掉线的班级,每分钟运行一次<|endoftext|>
f7a2db54aca6af858be0b44359764c64a75fff1857115bb4f2493cd6b9274927
@scheduler.scheduled_job('interval', id='notify_none', minutes=10) def _notify_none(): '\n 通知教务处理没有学生的班级,每十分钟运行一次\n ' with db_session_manager.with_session() as db_session: manager = MonitorManager(db_session) manager.notify_none()
通知教务处理没有学生的班级,每十分钟运行一次
etutorservice/jobs/scheduler.py
_notify_none
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('interval', id='notify_none', minutes=10) def _notify_none(): '\n \n ' with db_session_manager.with_session() as db_session: manager = MonitorManager(db_session) manager.notify_none()
@scheduler.scheduled_job('interval', id='notify_none', minutes=10) def _notify_none(): '\n \n ' with db_session_manager.with_session() as db_session: manager = MonitorManager(db_session) manager.notify_none()<|docstring|>通知教务处理没有学生的班级,每十分钟运行一次<|endoftext|>
df93dd47819e568efa7fbd59f8ed08772e1e38bb4420ec257fc8f0179cafa54b
@scheduler.scheduled_job('cron', id='auto_change_coach', hour='6-24', minute='*') def _auto_change_coach(): '\n 自动更换可用时段结束的班级教练,自动找教练添加更换教练任务、发邀请。\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassCoachManager(db_session) days = [get_now().replace(days=...
自动更换可用时段结束的班级教练,自动找教练添加更换教练任务、发邀请。 :return:
etutorservice/jobs/scheduler.py
_auto_change_coach
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='auto_change_coach', hour='6-24', minute='*') def _auto_change_coach(): '\n 自动更换可用时段结束的班级教练,自动找教练添加更换教练任务、发邀请。\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassCoachManager(db_session) days = [get_now().replace(days=...
@scheduler.scheduled_job('cron', id='auto_change_coach', hour='6-24', minute='*') def _auto_change_coach(): '\n 自动更换可用时段结束的班级教练,自动找教练添加更换教练任务、发邀请。\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassCoachManager(db_session) days = [get_now().replace(days=...
5a672eb7c64d9f02999f2b9ec4d2ebf0300fb55fa4618af62188cc6a75ccc356
@scheduler.scheduled_job('cron', id='daily_complete_change_coach', hour=3) def _daily_complete_change_coach(): '\n 自动完成教练更换,将当天需要替换的教练完成替换。\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassCoachManager(db_session) day = get_now().date() process...
自动完成教练更换,将当天需要替换的教练完成替换。 :return:
etutorservice/jobs/scheduler.py
_daily_complete_change_coach
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='daily_complete_change_coach', hour=3) def _daily_complete_change_coach(): '\n 自动完成教练更换,将当天需要替换的教练完成替换。\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassCoachManager(db_session) day = get_now().date() process...
@scheduler.scheduled_job('cron', id='daily_complete_change_coach', hour=3) def _daily_complete_change_coach(): '\n 自动完成教练更换,将当天需要替换的教练完成替换。\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassCoachManager(db_session) day = get_now().date() process...
f5a64320a187516324e28643af77f0d5e3447e57996567cb3b0d573a2ca10ab7
@scheduler.scheduled_job('cron', id='daily_check_fail_change_coach_task', hour=3) def _daily_check_fail_change_coach_task(): '\n 检查自动换老师失败任务\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassCoachManager(db_session) day = get_now().replace(days=(+ 6)).d...
检查自动换老师失败任务 :return:
etutorservice/jobs/scheduler.py
_daily_check_fail_change_coach_task
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='daily_check_fail_change_coach_task', hour=3) def _daily_check_fail_change_coach_task(): '\n 检查自动换老师失败任务\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassCoachManager(db_session) day = get_now().replace(days=(+ 6)).d...
@scheduler.scheduled_job('cron', id='daily_check_fail_change_coach_task', hour=3) def _daily_check_fail_change_coach_task(): '\n 检查自动换老师失败任务\n :return:\n ' with db_session_manager.with_session() as db_session: manager = ClassCoachManager(db_session) day = get_now().replace(days=(+ 6)).d...
349c61a680b8c179ff52f695980809edd2e81931b5d67eb08b6c01ffd66fe0df
@scheduler.scheduled_job('cron', id='daily_check_coach_continue_class', hour=20) def _daily_check_coach_continue_class(): '\n 提醒教练设置续接班\n ' with db_session_manager.with_session() as db_session: manager = ContinueClassManager(db_session) day = get_now().date() manager.auto_check(day...
提醒教练设置续接班
etutorservice/jobs/scheduler.py
_daily_check_coach_continue_class
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='daily_check_coach_continue_class', hour=20) def _daily_check_coach_continue_class(): '\n \n ' with db_session_manager.with_session() as db_session: manager = ContinueClassManager(db_session) day = get_now().date() manager.auto_check(day) ...
@scheduler.scheduled_job('cron', id='daily_check_coach_continue_class', hour=20) def _daily_check_coach_continue_class(): '\n \n ' with db_session_manager.with_session() as db_session: manager = ContinueClassManager(db_session) day = get_now().date() manager.auto_check(day) ...
64cee74ace62d09591ebf1178ad35267f139a2305ad208eeaf3f3e1a4dc75bc4
@scheduler.scheduled_job('cron', id='daily_notify_no_continue_class_coaches', hour=10) def _daily_notify_no_continue_class_coaches(): '\n 提醒教务:已短信提醒教练设置续接班3次 当前续接班仍为0的教练\n ' with db_session_manager.with_session() as db_session: manager = ContinueClassManager(db_session) day = get_now().dat...
提醒教务:已短信提醒教练设置续接班3次 当前续接班仍为0的教练
etutorservice/jobs/scheduler.py
_daily_notify_no_continue_class_coaches
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='daily_notify_no_continue_class_coaches', hour=10) def _daily_notify_no_continue_class_coaches(): '\n \n ' with db_session_manager.with_session() as db_session: manager = ContinueClassManager(db_session) day = get_now().date() manager.notify_admi...
@scheduler.scheduled_job('cron', id='daily_notify_no_continue_class_coaches', hour=10) def _daily_notify_no_continue_class_coaches(): '\n \n ' with db_session_manager.with_session() as db_session: manager = ContinueClassManager(db_session) day = get_now().date() manager.notify_admi...
08bf368ca6f49394cd769223d6a3103e819c29441959a6efaedf37aa6b0eeeac
@scheduler.scheduled_job('cron', id='daily_notify_coach_continue_class_start', hour=20) def _daily_notify_coach_continue_class_start(): '\n 提前7天、3天提醒教练续接班即将开课\n ' with db_session_manager.with_session() as db_session: manager = ContinueClassManager(db_session) day = get_now().date() ...
提前7天、3天提醒教练续接班即将开课
etutorservice/jobs/scheduler.py
_daily_notify_coach_continue_class_start
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='daily_notify_coach_continue_class_start', hour=20) def _daily_notify_coach_continue_class_start(): '\n \n ' with db_session_manager.with_session() as db_session: manager = ContinueClassManager(db_session) day = get_now().date() manager.notify_co...
@scheduler.scheduled_job('cron', id='daily_notify_coach_continue_class_start', hour=20) def _daily_notify_coach_continue_class_start(): '\n \n ' with db_session_manager.with_session() as db_session: manager = ContinueClassManager(db_session) day = get_now().date() manager.notify_co...
9a394843f7f9513100ad17525dad6eab852698614521d9bb8c298f9bc7a31fef
@scheduler.scheduled_job('cron', id='daily_check_expired_class', hour=2) def _daily_check_expired_class(): '\n 关闭过期班级\n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_session) day = get_now().date() manager.auto_close_expired_classes(day)...
关闭过期班级
etutorservice/jobs/scheduler.py
_daily_check_expired_class
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='daily_check_expired_class', hour=2) def _daily_check_expired_class(): '\n \n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_session) day = get_now().date() manager.auto_close_expired_classes(day) ...
@scheduler.scheduled_job('cron', id='daily_check_expired_class', hour=2) def _daily_check_expired_class(): '\n \n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_session) day = get_now().date() manager.auto_close_expired_classes(day) ...
b3a7bf5096da7b691b4eef4cbdd29f6c5e4f8316f400f17c0b6b2c6c068e7c9d
@scheduler.scheduled_job('cron', id='close_none_student_continue_class', hour=0) def _close_none_student_continue_class(): '\n 学季开始前第4天, 关闭没有学生的续接班\n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_session) result = manager.close_none_student_cont...
学季开始前第4天, 关闭没有学生的续接班
etutorservice/jobs/scheduler.py
_close_none_student_continue_class
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='close_none_student_continue_class', hour=0) def _close_none_student_continue_class(): '\n \n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_session) result = manager.close_none_student_continue_class() ...
@scheduler.scheduled_job('cron', id='close_none_student_continue_class', hour=0) def _close_none_student_continue_class(): '\n \n ' with db_session_manager.with_session() as db_session: manager = ClassSuperviseManager(db_session) result = manager.close_none_student_continue_class() ...
40aa1c3ce86428c6e74fccedf5ab588ef7b06227e0d354df133a702f03f2d508
@scheduler.scheduled_job('cron', id='send_everyday_reservation', hour=9) def _send_everyday_reservation(): '\n 获取前一天报名学员的信息\n (约课日期、学员账号、姓名、手机、时段、课程开始日期、课程结束日期)\n ' with db_session_manager.with_session() as db_session: today = get_now() start_time = format_date(today.replace(days=(- 1))...
获取前一天报名学员的信息 (约课日期、学员账号、姓名、手机、时段、课程开始日期、课程结束日期)
etutorservice/jobs/scheduler.py
_send_everyday_reservation
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='send_everyday_reservation', hour=9) def _send_everyday_reservation(): '\n 获取前一天报名学员的信息\n (约课日期、学员账号、姓名、手机、时段、课程开始日期、课程结束日期)\n ' with db_session_manager.with_session() as db_session: today = get_now() start_time = format_date(today.replace(days=(- 1))...
@scheduler.scheduled_job('cron', id='send_everyday_reservation', hour=9) def _send_everyday_reservation(): '\n 获取前一天报名学员的信息\n (约课日期、学员账号、姓名、手机、时段、课程开始日期、课程结束日期)\n ' with db_session_manager.with_session() as db_session: today = get_now() start_time = format_date(today.replace(days=(- 1))...
478aa3ca8af37e461f014ebd8c0c6d068eee605da4fe96177ed9b49ee6a9a48e
@scheduler.scheduled_job('cron', id='everyday_add_sale_cards', hour=0) def _everyday_add_sale_cards(): '\n 每天矫正销售卡信息\n ' with db_session_manager.with_session() as db_session: manager = SaleCardManager(db_session) manager.everyday_add_sale_cards() logger.info('daily_everyday_add_sa...
每天矫正销售卡信息
etutorservice/jobs/scheduler.py
_everyday_add_sale_cards
wangbaliang/thrift_service
0
python
@scheduler.scheduled_job('cron', id='everyday_add_sale_cards', hour=0) def _everyday_add_sale_cards(): '\n \n ' with db_session_manager.with_session() as db_session: manager = SaleCardManager(db_session) manager.everyday_add_sale_cards() logger.info('daily_everyday_add_sale_cards'...
@scheduler.scheduled_job('cron', id='everyday_add_sale_cards', hour=0) def _everyday_add_sale_cards(): '\n \n ' with db_session_manager.with_session() as db_session: manager = SaleCardManager(db_session) manager.everyday_add_sale_cards() logger.info('daily_everyday_add_sale_cards'...
15a43d70fee23f2e3d366353825ca03ec4a1768d64ea9f3639f47bf21ec917bd
def generate_unique_filename(num_chars, extension='.wav'): "Makes a unique filename from alphanumeric characters.\n\n Parameters\n ----------\n num_chars : int\n How long should the filename be.\n\n extension : string (optional, default='.wav')\n The extension to append to the end of the r...
Makes a unique filename from alphanumeric characters. Parameters ---------- num_chars : int How long should the filename be. extension : string (optional, default='.wav') The extension to append to the end of the random string. Returns ------- fname : string Random string with extension appended.
app/streaming/utils.py
generate_unique_filename
regginold/talk-like-ted
0
python
def generate_unique_filename(num_chars, extension='.wav'): "Makes a unique filename from alphanumeric characters.\n\n Parameters\n ----------\n num_chars : int\n How long should the filename be.\n\n extension : string (optional, default='.wav')\n The extension to append to the end of the r...
def generate_unique_filename(num_chars, extension='.wav'): "Makes a unique filename from alphanumeric characters.\n\n Parameters\n ----------\n num_chars : int\n How long should the filename be.\n\n extension : string (optional, default='.wav')\n The extension to append to the end of the r...
dc5cea3f6b8af1d0eec12c988f788f7a4b3b39e4be511dca6b25b887db871324
def format_transcript_data(google_speech): "Formats transcript data so that it can be plotted by D3.\n\n Parameters\n ----------\n google_speech : GoogleSpeech\n\n Returns\n -------\n list of dict\n Each item is a single word in the transcript, like [{'word': <word>}]\n " transcript ...
Formats transcript data so that it can be plotted by D3. Parameters ---------- google_speech : GoogleSpeech Returns ------- list of dict Each item is a single word in the transcript, like [{'word': <word>}]
app/streaming/utils.py
format_transcript_data
regginold/talk-like-ted
0
python
def format_transcript_data(google_speech): "Formats transcript data so that it can be plotted by D3.\n\n Parameters\n ----------\n google_speech : GoogleSpeech\n\n Returns\n -------\n list of dict\n Each item is a single word in the transcript, like [{'word': <word>}]\n " transcript ...
def format_transcript_data(google_speech): "Formats transcript data so that it can be plotted by D3.\n\n Parameters\n ----------\n google_speech : GoogleSpeech\n\n Returns\n -------\n list of dict\n Each item is a single word in the transcript, like [{'word': <word>}]\n " transcript ...
5c5b9b34e5d7c836c0cadbbb7cf75ce55a765364f99649ea2cac90dc39414039
def lovasz_grad(gt_sorted): '\n Computes gradient of the Lovasz extension w.r.t sorted errors\n See Alg. 1 in paper\n ' p = len(gt_sorted) gts = gt_sorted.sum() intersection = (gts - gt_sorted.float().cumsum(0)) union = (gts + (1 - gt_sorted).float().cumsum(0)) jaccard = (1.0 - (interse...
Computes gradient of the Lovasz extension w.r.t sorted errors See Alg. 1 in paper
mmdet3d/selectiveseg/utils.py
lovasz_grad
BB88Lee/mmdetection3d
0
python
def lovasz_grad(gt_sorted): '\n Computes gradient of the Lovasz extension w.r.t sorted errors\n See Alg. 1 in paper\n ' p = len(gt_sorted) gts = gt_sorted.sum() intersection = (gts - gt_sorted.float().cumsum(0)) union = (gts + (1 - gt_sorted).float().cumsum(0)) jaccard = (1.0 - (interse...
def lovasz_grad(gt_sorted): '\n Computes gradient of the Lovasz extension w.r.t sorted errors\n See Alg. 1 in paper\n ' p = len(gt_sorted) gts = gt_sorted.sum() intersection = (gts - gt_sorted.float().cumsum(0)) union = (gts + (1 - gt_sorted).float().cumsum(0)) jaccard = (1.0 - (interse...
f2cb4a9e825ec0b320efc1eb959fa690311f754dd794b949a4632ccd64ffd799
def lovasz_softmax(probas, labels, classes='present', per_image=False, ignore=None): "\n Multi-class Lovasz-Softmax loss\n probas: [B, C, H, W] Variable, class probabilities at each prediction (between 0 and 1).\n Interpreted as binary (sigmoid) output with outputs of size [B, H, W].\n lab...
Multi-class Lovasz-Softmax loss probas: [B, C, H, W] Variable, class probabilities at each prediction (between 0 and 1). Interpreted as binary (sigmoid) output with outputs of size [B, H, W]. labels: [B, H, W] Tensor, ground truth labels (between 0 and C - 1) classes: 'all' for all, 'present' for classe...
mmdet3d/selectiveseg/utils.py
lovasz_softmax
BB88Lee/mmdetection3d
0
python
def lovasz_softmax(probas, labels, classes='present', per_image=False, ignore=None): "\n Multi-class Lovasz-Softmax loss\n probas: [B, C, H, W] Variable, class probabilities at each prediction (between 0 and 1).\n Interpreted as binary (sigmoid) output with outputs of size [B, H, W].\n lab...
def lovasz_softmax(probas, labels, classes='present', per_image=False, ignore=None): "\n Multi-class Lovasz-Softmax loss\n probas: [B, C, H, W] Variable, class probabilities at each prediction (between 0 and 1).\n Interpreted as binary (sigmoid) output with outputs of size [B, H, W].\n lab...
78dce6937b575e9e59739dd540d808f278cea7ff393fffb2d1dfe64f784a84e1
def lovasz_softmax_flat(probas, labels, classes='present'): "\n Multi-class Lovasz-Softmax loss\n probas: [P, C] Variable, class probabilities at each prediction (between 0 and 1)\n labels: [P] Tensor, ground truth labels (between 0 and C - 1)\n classes: 'all' for all, 'present' for classes presen...
Multi-class Lovasz-Softmax loss probas: [P, C] Variable, class probabilities at each prediction (between 0 and 1) labels: [P] Tensor, ground truth labels (between 0 and C - 1) classes: 'all' for all, 'present' for classes present in labels, or a list of classes to average.
mmdet3d/selectiveseg/utils.py
lovasz_softmax_flat
BB88Lee/mmdetection3d
0
python
def lovasz_softmax_flat(probas, labels, classes='present'): "\n Multi-class Lovasz-Softmax loss\n probas: [P, C] Variable, class probabilities at each prediction (between 0 and 1)\n labels: [P] Tensor, ground truth labels (between 0 and C - 1)\n classes: 'all' for all, 'present' for classes presen...
def lovasz_softmax_flat(probas, labels, classes='present'): "\n Multi-class Lovasz-Softmax loss\n probas: [P, C] Variable, class probabilities at each prediction (between 0 and 1)\n labels: [P] Tensor, ground truth labels (between 0 and C - 1)\n classes: 'all' for all, 'present' for classes presen...
8c6239ad406c2069bb5c80c38e3e1c295474ae9aef1261279b9717997b510dc9
def flatten_probas(probas, labels, ignore=None, sparse=True): '\n Flattens predictions in the batch\n ' if (probas.dim() != 2): if (probas.dim() == 3): (B, H, W) = probas.size() probas = probas.view(B, 1, H, W) elif (probas.dim() == 5): (B, C, L, H, W) =...
Flattens predictions in the batch
mmdet3d/selectiveseg/utils.py
flatten_probas
BB88Lee/mmdetection3d
0
python
def flatten_probas(probas, labels, ignore=None, sparse=True): '\n \n ' if (probas.dim() != 2): if (probas.dim() == 3): (B, H, W) = probas.size() probas = probas.view(B, 1, H, W) elif (probas.dim() == 5): (B, C, L, H, W) = probas.size() probas...
def flatten_probas(probas, labels, ignore=None, sparse=True): '\n \n ' if (probas.dim() != 2): if (probas.dim() == 3): (B, H, W) = probas.size() probas = probas.view(B, 1, H, W) elif (probas.dim() == 5): (B, C, L, H, W) = probas.size() probas...
2ca7dcc9387214f7b654eb60faee9adac15767969b43495e0d8db9ffa4544f2d
def __init__(self, file_path: str, *args, **kwargs): '\n\n Parameters\n ----------\n file_path : str\n Full path of the CSV file with the urls\n *args : typing.Tuple\n Non-keyworded variable-length argument\n **kwargs:\n Keyworded, variable-length ...
Parameters ---------- file_path : str Full path of the CSV file with the urls *args : typing.Tuple Non-keyworded variable-length argument **kwargs: Keyworded, variable-length arguments
monitor/monitor/utils/urls_provider/csv_urls_provider.py
__init__
reynierg/websites-monitor
0
python
def __init__(self, file_path: str, *args, **kwargs): '\n\n Parameters\n ----------\n file_path : str\n Full path of the CSV file with the urls\n *args : typing.Tuple\n Non-keyworded variable-length argument\n **kwargs:\n Keyworded, variable-length ...
def __init__(self, file_path: str, *args, **kwargs): '\n\n Parameters\n ----------\n file_path : str\n Full path of the CSV file with the urls\n *args : typing.Tuple\n Non-keyworded variable-length argument\n **kwargs:\n Keyworded, variable-length ...
90d61049d911a7f5bc1e6898a0b4f7b9958c09c7f8fc835809fe974fd5b0e664
def _parse_csv_lines(self) -> typing.Generator[(typing.Optional[UrlModel], None, None)]: 'Yields one line at a time from the input CSV file.' self._logger.debug('%s._parse_csv_lines()', self.__class__.__name__) io_file = typing.cast(io.TextIOWrapper, self._file) csv_reader = csv.DictReader(io_file, deli...
Yields one line at a time from the input CSV file.
monitor/monitor/utils/urls_provider/csv_urls_provider.py
_parse_csv_lines
reynierg/websites-monitor
0
python
def _parse_csv_lines(self) -> typing.Generator[(typing.Optional[UrlModel], None, None)]: self._logger.debug('%s._parse_csv_lines()', self.__class__.__name__) io_file = typing.cast(io.TextIOWrapper, self._file) csv_reader = csv.DictReader(io_file, delimiter=self._delimiter) line_index = 1 proces...
def _parse_csv_lines(self) -> typing.Generator[(typing.Optional[UrlModel], None, None)]: self._logger.debug('%s._parse_csv_lines()', self.__class__.__name__) io_file = typing.cast(io.TextIOWrapper, self._file) csv_reader = csv.DictReader(io_file, delimiter=self._delimiter) line_index = 1 proces...
502edc68c9a23fcddc3f805cc511e4b5126b99adfa1579f82a7f3e95301b76ee
def _map_dict_to_model(self, row: typing.Dict[(str, str)], line_index: int) -> typing.Optional[UrlModel]: "Instantiate a model from a dict with an website's metadata.\n\n After validate the website's metadata, it will initialize a UrlModel\n with it.\n\n Parameters\n ----------\n ...
Instantiate a model from a dict with an website's metadata. After validate the website's metadata, it will initialize a UrlModel with it. Parameters ---------- row : typing.Dict[str, str] A dict that should contains an url related metadata line_index : int Represents the base 0 index, of the string line in th...
monitor/monitor/utils/urls_provider/csv_urls_provider.py
_map_dict_to_model
reynierg/websites-monitor
0
python
def _map_dict_to_model(self, row: typing.Dict[(str, str)], line_index: int) -> typing.Optional[UrlModel]: "Instantiate a model from a dict with an website's metadata.\n\n After validate the website's metadata, it will initialize a UrlModel\n with it.\n\n Parameters\n ----------\n ...
def _map_dict_to_model(self, row: typing.Dict[(str, str)], line_index: int) -> typing.Optional[UrlModel]: "Instantiate a model from a dict with an website's metadata.\n\n After validate the website's metadata, it will initialize a UrlModel\n with it.\n\n Parameters\n ----------\n ...
26e3108c80e5a71fb56494d77fcf407fcefee2d249eb0ebcacf663b00ab374c4
def __init__(self, path: typing.Union[(str, pathlib.Path)], assume_filename: typing.Optional[typing.Union[(str, pathlib.Path)]]=None): "Create an archive.\n\n Will determine the type of the archive from the suffix, e.g. if path is\n 'foo.zip', will treat the file as a zip file. The assume_filename path\n c...
Create an archive. Will determine the type of the archive from the suffix, e.g. if path is 'foo.zip', will treat the file as a zip file. The assume_filename path can be used to change the determined type. Args: path: The path to the data, including the name of the workspace. assume_filename: For the purpose of de...
labm8/py/archive.py
__init__
Zacharias030/ProGraML
3
python
def __init__(self, path: typing.Union[(str, pathlib.Path)], assume_filename: typing.Optional[typing.Union[(str, pathlib.Path)]]=None): "Create an archive.\n\n Will determine the type of the archive from the suffix, e.g. if path is\n 'foo.zip', will treat the file as a zip file. The assume_filename path\n c...
def __init__(self, path: typing.Union[(str, pathlib.Path)], assume_filename: typing.Optional[typing.Union[(str, pathlib.Path)]]=None): "Create an archive.\n\n Will determine the type of the archive from the suffix, e.g. if path is\n 'foo.zip', will treat the file as a zip file. The assume_filename path\n c...
22fe5dde6c74da73ccaebbc8b62a5f275c1e0099a2265a1b285b9eb078ac162b
@property def path(self) -> pathlib.Path: 'Return the path of the archive.' return self._compressed_path
Return the path of the archive.
labm8/py/archive.py
path
Zacharias030/ProGraML
3
python
@property def path(self) -> pathlib.Path: return self._compressed_path
@property def path(self) -> pathlib.Path: return self._compressed_path<|docstring|>Return the path of the archive.<|endoftext|>
4058ebc5863a84c37a62c3a79c574e2b83ae14f00fb653b4d62ee1de8a2f2a51
def ExtractAll(self, path: pathlib.Path) -> pathlib.Path: 'Extract the archive contents to a directory.\n\n Args:\n path: The directory to extract to.\n\n Returns:\n The path of the extracted archive.\n ' with self._open_function(str(self._compressed_path)) as f: f.extractall(path=str...
Extract the archive contents to a directory. Args: path: The directory to extract to. Returns: The path of the extracted archive.
labm8/py/archive.py
ExtractAll
Zacharias030/ProGraML
3
python
def ExtractAll(self, path: pathlib.Path) -> pathlib.Path: 'Extract the archive contents to a directory.\n\n Args:\n path: The directory to extract to.\n\n Returns:\n The path of the extracted archive.\n ' with self._open_function(str(self._compressed_path)) as f: f.extractall(path=str...
def ExtractAll(self, path: pathlib.Path) -> pathlib.Path: 'Extract the archive contents to a directory.\n\n Args:\n path: The directory to extract to.\n\n Returns:\n The path of the extracted archive.\n ' with self._open_function(str(self._compressed_path)) as f: f.extractall(path=str...
84822fc5ff0d7c3157f3326f80c6ca6696ed1a73f3cce924c7ad28fa4bc32bf6
def __enter__(self) -> pathlib.Path: 'Unpack the archive and return the uncompressed path.\n\n Returns:\n The path of the directory containing the uncompressed archive.\n ' assert (not self._uncompressed_path) self._uncompressed_path = pathlib.Path(tempfile.mkdtemp(prefix='phd_')) return self...
Unpack the archive and return the uncompressed path. Returns: The path of the directory containing the uncompressed archive.
labm8/py/archive.py
__enter__
Zacharias030/ProGraML
3
python
def __enter__(self) -> pathlib.Path: 'Unpack the archive and return the uncompressed path.\n\n Returns:\n The path of the directory containing the uncompressed archive.\n ' assert (not self._uncompressed_path) self._uncompressed_path = pathlib.Path(tempfile.mkdtemp(prefix='phd_')) return self...
def __enter__(self) -> pathlib.Path: 'Unpack the archive and return the uncompressed path.\n\n Returns:\n The path of the directory containing the uncompressed archive.\n ' assert (not self._uncompressed_path) self._uncompressed_path = pathlib.Path(tempfile.mkdtemp(prefix='phd_')) return self...
b5584750566a3905667770be1d3bd8ba24a1ba14fd1fdd38c86f089d3811398b
def __exit__(self, *args): 'Exit the scope of the archive.\n\n This deletes the temporary directory that the archive has been unpacked to.\n ' assert self._uncompressed_path shutil.rmtree(self._uncompressed_path) self._uncompressed_path = None
Exit the scope of the archive. This deletes the temporary directory that the archive has been unpacked to.
labm8/py/archive.py
__exit__
Zacharias030/ProGraML
3
python
def __exit__(self, *args): 'Exit the scope of the archive.\n\n This deletes the temporary directory that the archive has been unpacked to.\n ' assert self._uncompressed_path shutil.rmtree(self._uncompressed_path) self._uncompressed_path = None
def __exit__(self, *args): 'Exit the scope of the archive.\n\n This deletes the temporary directory that the archive has been unpacked to.\n ' assert self._uncompressed_path shutil.rmtree(self._uncompressed_path) self._uncompressed_path = None<|docstring|>Exit the scope of the archive. This delet...
371b1909a05fb06f2c8aaab87b6635b92f6ed8b31fdc20288de3034d73a02cb2
def main(): 'Shows basic usage of the Tasks API.\n Prints the title and ID of the first 10 task lists.\n ' store = file.Storage('token.json') creds = store.get() if ((not creds) or creds.invalid): flow = client.flow_from_clientsecrets('credentials.json', SCOPES) creds = tools.run_f...
Shows basic usage of the Tasks API. Prints the title and ID of the first 10 task lists.
tasks/quickstart/quickstart.py
main
slokhorst/python-samples
1
python
def main(): 'Shows basic usage of the Tasks API.\n Prints the title and ID of the first 10 task lists.\n ' store = file.Storage('token.json') creds = store.get() if ((not creds) or creds.invalid): flow = client.flow_from_clientsecrets('credentials.json', SCOPES) creds = tools.run_f...
def main(): 'Shows basic usage of the Tasks API.\n Prints the title and ID of the first 10 task lists.\n ' store = file.Storage('token.json') creds = store.get() if ((not creds) or creds.invalid): flow = client.flow_from_clientsecrets('credentials.json', SCOPES) creds = tools.run_f...
8b1910276ab79c519077b05df18f0e0773c91af207f97c26c7722170c6d41b30
def get_abi_by_name(self, func_name: str) -> dict: 'Find the correct function abi for the name' t = filter_by_name(func_name, self.abi) if (len(t) > 0): return t[0] raise NoABIFunctionsFound('The abi for this contract contains no function definitions. ', 'Are you sure you provided the correct ca...
Find the correct function abi for the name
tronpytool/contract.py
get_abi_by_name
tokenchain/tronpytool
0
python
def get_abi_by_name(self, func_name: str) -> dict: t = filter_by_name(func_name, self.abi) if (len(t) > 0): return t[0] raise NoABIFunctionsFound('The abi for this contract contains no function definitions. ', 'Are you sure you provided the correct call name from the abi?')
def get_abi_by_name(self, func_name: str) -> dict: t = filter_by_name(func_name, self.abi) if (len(t) > 0): return t[0] raise NoABIFunctionsFound('The abi for this contract contains no function definitions. ', 'Are you sure you provided the correct call name from the abi?')<|docstring|>Find the...
0a8b320eb22068a73464be33b8d1a379f6d9511792a3a59a7b5aabd11b75d040
def print_functions(self): 'only for testing, list all the functions that can be called. ' for func in self._functions: if (func['type'] == 'function'): if (func['stateMutability'] in ['pure', 'view']): printdebugfunc('read', func) if (func['stateMutability'] in [...
only for testing, list all the functions that can be called.
tronpytool/contract.py
print_functions
tokenchain/tronpytool
0
python
def print_functions(self): ' ' for func in self._functions: if (func['type'] == 'function'): if (func['stateMutability'] in ['pure', 'view']): printdebugfunc('read', func) if (func['stateMutability'] in ['nonpayable']): printdebugfunc('write', func...
def print_functions(self): ' ' for func in self._functions: if (func['type'] == 'function'): if (func['stateMutability'] in ['pure', 'view']): printdebugfunc('read', func) if (func['stateMutability'] in ['nonpayable']): printdebugfunc('write', func...
94f39d297cedb6f44590e0f9b1aefe41986146b3c1a0000f9f0f8250aca946d0
def __init__(self, address=None): 'Create a new smart contract proxy object.\n :param address: Contract address as 0x hex string\n ' if (self.tron is None): raise AttributeError('The `Contract` class has not been initialized. Please use the `tron.contract` interface to create your contrac...
Create a new smart contract proxy object. :param address: Contract address as 0x hex string
tronpytool/contract.py
__init__
tokenchain/tronpytool
0
python
def __init__(self, address=None): 'Create a new smart contract proxy object.\n :param address: Contract address as 0x hex string\n ' if (self.tron is None): raise AttributeError('The `Contract` class has not been initialized. Please use the `tron.contract` interface to create your contrac...
def __init__(self, address=None): 'Create a new smart contract proxy object.\n :param address: Contract address as 0x hex string\n ' if (self.tron is None): raise AttributeError('The `Contract` class has not been initialized. Please use the `tron.contract` interface to create your contrac...
ee7a5a7e30dd212dc6fae3c34b7c1413fdbf2561d7851735e6c704070cac5eea
@classmethod @deprecated_for('contract.constructor.transact') def deploy(cls, **kwargs): 'Deploy Contract\n\n This method can also be done in "contract.constructor.transact"\n\n Deploys a contract.\n Returns TransactionExtention, which contains an unsigned transaction.\n\n Example:\n ...
Deploy Contract This method can also be done in "contract.constructor.transact" Deploys a contract. Returns TransactionExtention, which contains an unsigned transaction. Example: .. code-block:: python >>> MyContract.deploy( fee_limit=10**9, call_value=0, consume_user_resource_percent=10 ...
tronpytool/contract.py
deploy
tokenchain/tronpytool
0
python
@classmethod @deprecated_for('contract.constructor.transact') def deploy(cls, **kwargs): 'Deploy Contract\n\n This method can also be done in "contract.constructor.transact"\n\n Deploys a contract.\n Returns TransactionExtention, which contains an unsigned transaction.\n\n Example:\n ...
@classmethod @deprecated_for('contract.constructor.transact') def deploy(cls, **kwargs): 'Deploy Contract\n\n This method can also be done in "contract.constructor.transact"\n\n Deploys a contract.\n Returns TransactionExtention, which contains an unsigned transaction.\n\n Example:\n ...
5e29d5f4e264fb2a53f11f85bd10ec5c057667aff96efc92892204655cae68ee
@combomethod def encodeABI(cls, fn_name, args=None, kwargs=None, data=None) -> Union[(HexStr, str)]: 'Encodes the arguments using the Tron ABI for the contract function\n that matches the given name and arguments..\n ' (fn_abi, fn_selector, fn_arguments) = get_function_info(fn_name, contract_abi=c...
Encodes the arguments using the Tron ABI for the contract function that matches the given name and arguments..
tronpytool/contract.py
encodeABI
tokenchain/tronpytool
0
python
@combomethod def encodeABI(cls, fn_name, args=None, kwargs=None, data=None) -> Union[(HexStr, str)]: 'Encodes the arguments using the Tron ABI for the contract function\n that matches the given name and arguments..\n ' (fn_abi, fn_selector, fn_arguments) = get_function_info(fn_name, contract_abi=c...
@combomethod def encodeABI(cls, fn_name, args=None, kwargs=None, data=None) -> Union[(HexStr, str)]: 'Encodes the arguments using the Tron ABI for the contract function\n that matches the given name and arguments..\n ' (fn_abi, fn_selector, fn_arguments) = get_function_info(fn_name, contract_abi=c...
0901b340457084bd0c449cc002142c7df90605df95bbeef56cc890042c460719
@combomethod def transact(self, **kwargs): 'Deploy Contract\n\n Deploys a contract.\n Returns TransactionExtention, which contains an unsigned transaction.\n\n Args:\n **kwargs: Additional options to send\n ' return self.tron.transaction_builder.create_smart_contract(**kwa...
Deploy Contract Deploys a contract. Returns TransactionExtention, which contains an unsigned transaction. Args: **kwargs: Additional options to send
tronpytool/contract.py
transact
tokenchain/tronpytool
0
python
@combomethod def transact(self, **kwargs): 'Deploy Contract\n\n Deploys a contract.\n Returns TransactionExtention, which contains an unsigned transaction.\n\n Args:\n **kwargs: Additional options to send\n ' return self.tron.transaction_builder.create_smart_contract(**kwa...
@combomethod def transact(self, **kwargs): 'Deploy Contract\n\n Deploys a contract.\n Returns TransactionExtention, which contains an unsigned transaction.\n\n Args:\n **kwargs: Additional options to send\n ' return self.tron.transaction_builder.create_smart_contract(**kwa...
63b3c19a709fea3002fd8abf4da1c50dbaff4d164a825c8243afe8be7e896188
def select_keys(dict_obj, keys): 'Return copy of dict_obj containing only the given keys.' return {k: v for (k, v) in six.iteritems(dict_obj) if (k in keys)}
Return copy of dict_obj containing only the given keys.
sandbox/grist/useractions.py
select_keys
gristlabs/grist-core
2,667
python
def select_keys(dict_obj, keys): return {k: v for (k, v) in six.iteritems(dict_obj) if (k in keys)}
def select_keys(dict_obj, keys): return {k: v for (k, v) in six.iteritems(dict_obj) if (k in keys)}<|docstring|>Return copy of dict_obj containing only the given keys.<|endoftext|>
84cd545de3204175db1c194d2328a46cdddbadf5b7020997def6cb9c674d73ff
def has_value(dict_obj, key, value): 'Returns True if dict_obj contains key, and its value is value.' return ((key in dict_obj) and (dict_obj[key] == value))
Returns True if dict_obj contains key, and its value is value.
sandbox/grist/useractions.py
has_value
gristlabs/grist-core
2,667
python
def has_value(dict_obj, key, value): return ((key in dict_obj) and (dict_obj[key] == value))
def has_value(dict_obj, key, value): return ((key in dict_obj) and (dict_obj[key] == value))<|docstring|>Returns True if dict_obj contains key, and its value is value.<|endoftext|>
46f028194ae8ee9c25b909c42240064418dc067ca909655bf438f5f18f9f33ea
def has_diff_value(dict_obj, key, value): 'Returns True if dict_obj contains key, and its value is something other than value.' return ((key in dict_obj) and (dict_obj[key] != value))
Returns True if dict_obj contains key, and its value is something other than value.
sandbox/grist/useractions.py
has_diff_value
gristlabs/grist-core
2,667
python
def has_diff_value(dict_obj, key, value): return ((key in dict_obj) and (dict_obj[key] != value))
def has_diff_value(dict_obj, key, value): return ((key in dict_obj) and (dict_obj[key] != value))<|docstring|>Returns True if dict_obj contains key, and its value is something other than value.<|endoftext|>
a7a74a57f0ba362b0da65ca4fc31669abde3786df019060888bd5e8736d91404
def make_bulk_values_dict(record_values_pairs): '\n Given a list of (record, values_dict) pairs, returns a single dict with a union of the keys of\n all values_dicts, mapping each key to the array of values parallel to records. The output is the\n kind of dict required for BulkUpdateRecord/BulkAddRecord actions....
Given a list of (record, values_dict) pairs, returns a single dict with a union of the keys of all values_dicts, mapping each key to the array of values parallel to records. The output is the kind of dict required for BulkUpdateRecord/BulkAddRecord actions. Missing values are filled in with corresponding attributes fro...
sandbox/grist/useractions.py
make_bulk_values_dict
gristlabs/grist-core
2,667
python
def make_bulk_values_dict(record_values_pairs): '\n Given a list of (record, values_dict) pairs, returns a single dict with a union of the keys of\n all values_dicts, mapping each key to the array of values parallel to records. The output is the\n kind of dict required for BulkUpdateRecord/BulkAddRecord actions....
def make_bulk_values_dict(record_values_pairs): '\n Given a list of (record, values_dict) pairs, returns a single dict with a union of the keys of\n all values_dicts, mapping each key to the array of values parallel to records. The output is the\n kind of dict required for BulkUpdateRecord/BulkAddRecord actions....
a9ce015b5b0f7aefcf2153308ec56cf0158d8f2257f252406957585c98ba2856
def useraction(method): '\n Decorator for a method, which creates an action class with the same name and arguments.\n ' code = method.__code__ name = method.__name__ cls = namedtuple(name, code.co_varnames[1:code.co_argcount]) setattr(_current_module, name, cls) _action_types[name] = cls r...
Decorator for a method, which creates an action class with the same name and arguments.
sandbox/grist/useractions.py
useraction
gristlabs/grist-core
2,667
python
def useraction(method): '\n \n ' code = method.__code__ name = method.__name__ cls = namedtuple(name, code.co_varnames[1:code.co_argcount]) setattr(_current_module, name, cls) _action_types[name] = cls return method
def useraction(method): '\n \n ' code = method.__code__ name = method.__name__ cls = namedtuple(name, code.co_varnames[1:code.co_argcount]) setattr(_current_module, name, cls) _action_types[name] = cls return method<|docstring|>Decorator for a method, which creates an action class with the...
1598f3e98e3eb08a0f0ff54b13f0826591fddf90dc62c264eac89f0a173b0953
def from_repr(user_action): '\n Converts a UserAction array into an object such as UpdateRecord.\n ' action_type = _action_types.get(user_action[0]) if (not action_type): raise ValueError(('Unknown action %s' % user_action[0])) try: return action_type(*user_action[1:]) except TypeE...
Converts a UserAction array into an object such as UpdateRecord.
sandbox/grist/useractions.py
from_repr
gristlabs/grist-core
2,667
python
def from_repr(user_action): '\n \n ' action_type = _action_types.get(user_action[0]) if (not action_type): raise ValueError(('Unknown action %s' % user_action[0])) try: return action_type(*user_action[1:]) except TypeError as e: raise TypeError(('%s: %s' % (user_action[0], ...
def from_repr(user_action): '\n \n ' action_type = _action_types.get(user_action[0]) if (not action_type): raise ValueError(('Unknown action %s' % user_action[0])) try: return action_type(*user_action[1:]) except TypeError as e: raise TypeError(('%s: %s' % (user_action[0], ...
bc2a0d991e12a4a60c03878e8313c93e2839e8e792abda334abe00af944e7907
def _make_clean_col_info(col_info, col_id=None): '\n Fills in missing fields in a col_info object of AddColumn or AddTable user actions.\n ' is_formula = col_info.get('isFormula', True) ret = {'isFormula': is_formula, 'type': col_info.get('type', ('Any' if is_formula else 'Text')), 'formula': col_info.get...
Fills in missing fields in a col_info object of AddColumn or AddTable user actions.
sandbox/grist/useractions.py
_make_clean_col_info
gristlabs/grist-core
2,667
python
def _make_clean_col_info(col_info, col_id=None): '\n \n ' is_formula = col_info.get('isFormula', True) ret = {'isFormula': is_formula, 'type': col_info.get('type', ('Any' if is_formula else 'Text')), 'formula': col_info.get('formula', )} if col_id: ret['id'] = col_id return ret
def _make_clean_col_info(col_info, col_id=None): '\n \n ' is_formula = col_info.get('isFormula', True) ret = {'isFormula': is_formula, 'type': col_info.get('type', ('Any' if is_formula else 'Text')), 'formula': col_info.get('formula', )} if col_id: ret['id'] = col_id return ret<|docstring|...
dd026268c89d6ed5e582a0b00f0ae17c701043391be40477ff6b78ca6ba53c8c
def guess_type(values, convert=False): '\n Returns a suitable type for the given iterable of values, optionally attempting conversions.\n ' numeric = usertypes.Numeric() counter = Counter((bool(numeric.is_right_type((numeric.convert(v) if convert else v))) for v in values if (v not in ('', None)))) to...
Returns a suitable type for the given iterable of values, optionally attempting conversions.
sandbox/grist/useractions.py
guess_type
gristlabs/grist-core
2,667
python
def guess_type(values, convert=False): '\n \n ' numeric = usertypes.Numeric() counter = Counter((bool(numeric.is_right_type((numeric.convert(v) if convert else v))) for v in values if (v not in (, None)))) total = sum(counter.values()) return ('Numeric' if (total and (counter[True] >= (total * 0.9...
def guess_type(values, convert=False): '\n \n ' numeric = usertypes.Numeric() counter = Counter((bool(numeric.is_right_type((numeric.convert(v) if convert else v))) for v in values if (v not in (, None)))) total = sum(counter.values()) return ('Numeric' if (total and (counter[True] >= (total * 0.9...
aae162b15062847e8a1740874ca36741a521e7585b75d0332f6dd9f2b3969e02
def enter_indirection(self): '\n Mark any actions following this call as being indirect, until leave_indirection is\n called. Nesting is supported (but not used).\n ' self._indirection_level += 1
Mark any actions following this call as being indirect, until leave_indirection is called. Nesting is supported (but not used).
sandbox/grist/useractions.py
enter_indirection
gristlabs/grist-core
2,667
python
def enter_indirection(self): '\n Mark any actions following this call as being indirect, until leave_indirection is\n called. Nesting is supported (but not used).\n ' self._indirection_level += 1
def enter_indirection(self): '\n Mark any actions following this call as being indirect, until leave_indirection is\n called. Nesting is supported (but not used).\n ' self._indirection_level += 1<|docstring|>Mark any actions following this call as being indirect, until leave_indirection is called. Nest...
550929cd2ebc24e416261ae5748710636b3ef5e4ac49506dd0edd7c1afb99cc7
def leave_indirection(self): '\n Undo an enter_indirection.\n ' self._indirection_level -= 1 assert (self._indirection_level >= 0)
Undo an enter_indirection.
sandbox/grist/useractions.py
leave_indirection
gristlabs/grist-core
2,667
python
def leave_indirection(self): '\n \n ' self._indirection_level -= 1 assert (self._indirection_level >= 0)
def leave_indirection(self): '\n \n ' self._indirection_level -= 1 assert (self._indirection_level >= 0)<|docstring|>Undo an enter_indirection.<|endoftext|>
40a703d4c65bf68321c7245d1a81e27aa0fddddeaee204c51465653aaafd6229
def _bulk_action_iter(self, table_id, row_ids, col_values=None): '\n Helper for processing Bulk actions, which generates a list of (i, record, value_dict) tuples,\n one for each record, where value_dict maps keys to values for that particular record.\n If col_values is None, generates a list of (i, record)...
Helper for processing Bulk actions, which generates a list of (i, record, value_dict) tuples, one for each record, where value_dict maps keys to values for that particular record. If col_values is None, generates a list of (i, record) pairs.
sandbox/grist/useractions.py
_bulk_action_iter
gristlabs/grist-core
2,667
python
def _bulk_action_iter(self, table_id, row_ids, col_values=None): '\n Helper for processing Bulk actions, which generates a list of (i, record, value_dict) tuples,\n one for each record, where value_dict maps keys to values for that particular record.\n If col_values is None, generates a list of (i, record)...
def _bulk_action_iter(self, table_id, row_ids, col_values=None): '\n Helper for processing Bulk actions, which generates a list of (i, record, value_dict) tuples,\n one for each record, where value_dict maps keys to values for that particular record.\n If col_values is None, generates a list of (i, record)...
24976a8fc59fe72e3b85299d77482fcc57c6e848780b78f1454e19e129783639
def _collect_back_references(self, table_recs): '\n Return a list of columns records for Reference or ReferenceList columns that refer to any of\n the passed-in tables.\n ' cols = [] for table_rec in table_recs: table_obj = self._engine.tables[table_rec.tableId] for col in table_obj...
Return a list of columns records for Reference or ReferenceList columns that refer to any of the passed-in tables.
sandbox/grist/useractions.py
_collect_back_references
gristlabs/grist-core
2,667
python
def _collect_back_references(self, table_recs): '\n Return a list of columns records for Reference or ReferenceList columns that refer to any of\n the passed-in tables.\n ' cols = [] for table_rec in table_recs: table_obj = self._engine.tables[table_rec.tableId] for col in table_obj...
def _collect_back_references(self, table_recs): '\n Return a list of columns records for Reference or ReferenceList columns that refer to any of\n the passed-in tables.\n ' cols = [] for table_rec in table_recs: table_obj = self._engine.tables[table_rec.tableId] for col in table_obj...
ae7768971533701d5069e742c7bf19f2b659c3642fa6e36d9986c3fe7ccb083a
@useraction def Calculate(self): '\n This is a dummy action whose only purpose is to trigger calculation\n of any dirty cells.\n ' pass
This is a dummy action whose only purpose is to trigger calculation of any dirty cells.
sandbox/grist/useractions.py
Calculate
gristlabs/grist-core
2,667
python
@useraction def Calculate(self): '\n This is a dummy action whose only purpose is to trigger calculation\n of any dirty cells.\n ' pass
@useraction def Calculate(self): '\n This is a dummy action whose only purpose is to trigger calculation\n of any dirty cells.\n ' pass<|docstring|>This is a dummy action whose only purpose is to trigger calculation of any dirty cells.<|endoftext|>
0fa1493b0128f226de1b66af33e8ea4755b0e5e733c91c56095e161d8083632b
def _prepare_formula_renames(self, renames): '\n Helper that accepts a dict of {(table_id, col_id): new_name} (where col_id is None when table\n is being renamed) and returns a dictionary mapping col_recs to updated formulas, for all\n columns whose formula is affected by the rename.\n ' patches_map...
Helper that accepts a dict of {(table_id, col_id): new_name} (where col_id is None when table is being renamed) and returns a dictionary mapping col_recs to updated formulas, for all columns whose formula is affected by the rename.
sandbox/grist/useractions.py
_prepare_formula_renames
gristlabs/grist-core
2,667
python
def _prepare_formula_renames(self, renames): '\n Helper that accepts a dict of {(table_id, col_id): new_name} (where col_id is None when table\n is being renamed) and returns a dictionary mapping col_recs to updated formulas, for all\n columns whose formula is affected by the rename.\n ' patches_map...
def _prepare_formula_renames(self, renames): '\n Helper that accepts a dict of {(table_id, col_id): new_name} (where col_id is None when table\n is being renamed) and returns a dictionary mapping col_recs to updated formulas, for all\n columns whose formula is affected by the rename.\n ' patches_map...
4b3a90dcd24673ecc04d38f25a78b479f81ce77ccd7c8b400496153d44870a81
def _get_sister_columns(self, source_table, col): '\n Returns all summary columns based on the given source_table, with colId matching that of col,\n and excluding col from the returned list.\n ' col_recs = [self._docmodel.columns.lookupOne(parentId=t, colId=col.colId, isFormula=True) for t in source_t...
Returns all summary columns based on the given source_table, with colId matching that of col, and excluding col from the returned list.
sandbox/grist/useractions.py
_get_sister_columns
gristlabs/grist-core
2,667
python
def _get_sister_columns(self, source_table, col): '\n Returns all summary columns based on the given source_table, with colId matching that of col,\n and excluding col from the returned list.\n ' col_recs = [self._docmodel.columns.lookupOne(parentId=t, colId=col.colId, isFormula=True) for t in source_t...
def _get_sister_columns(self, source_table, col): '\n Returns all summary columns based on the given source_table, with colId matching that of col,\n and excluding col from the returned list.\n ' col_recs = [self._docmodel.columns.lookupOne(parentId=t, colId=col.colId, isFormula=True) for t in source_t...
bc6a945955cf7ef9d699da1463476b1ec52e6105bee0d3bbfc1c750c225c2ca6
def _ensure_column_accepts_data(self, table_id, col_id, values): "\n When we store values (via Add or Update), check that the column is a data column. If it is an\n empty column (formula column with an empty formula), convert to data. If it's a real formula\n column, then fail.\n " schema_col = self...
When we store values (via Add or Update), check that the column is a data column. If it is an empty column (formula column with an empty formula), convert to data. If it's a real formula column, then fail.
sandbox/grist/useractions.py
_ensure_column_accepts_data
gristlabs/grist-core
2,667
python
def _ensure_column_accepts_data(self, table_id, col_id, values): "\n When we store values (via Add or Update), check that the column is a data column. If it is an\n empty column (formula column with an empty formula), convert to data. If it's a real formula\n column, then fail.\n " schema_col = self...
def _ensure_column_accepts_data(self, table_id, col_id, values): "\n When we store values (via Add or Update), check that the column is a data column. If it is an\n empty column (formula column with an empty formula), convert to data. If it's a real formula\n column, then fail.\n " schema_col = self...
df90a6dcf623539ad9ee52576745cc0523d9aa79492f0ee50659d7d6025942c3
@override_action('BulkRemoveRecord', '_grist_Views') def _removeViewRecords(self, table_id, row_ids): '\n Remove views, including all related items (tab bar, sections, etc.)\n ' view_recs = [rec for (i, rec) in self._bulk_action_iter(table_id, row_ids)] self._docmodel.remove((t for v in view_recs for ...
Remove views, including all related items (tab bar, sections, etc.)
sandbox/grist/useractions.py
_removeViewRecords
gristlabs/grist-core
2,667
python
@override_action('BulkRemoveRecord', '_grist_Views') def _removeViewRecords(self, table_id, row_ids): '\n \n ' view_recs = [rec for (i, rec) in self._bulk_action_iter(table_id, row_ids)] self._docmodel.remove((t for v in view_recs for t in v.tabBarItems)) self._docmodel.remove((t for v in view_rec...
@override_action('BulkRemoveRecord', '_grist_Views') def _removeViewRecords(self, table_id, row_ids): '\n \n ' view_recs = [rec for (i, rec) in self._bulk_action_iter(table_id, row_ids)] self._docmodel.remove((t for v in view_recs for t in v.tabBarItems)) self._docmodel.remove((t for v in view_rec...
36441e1e313ee8e57c78bf14bd94be60c0d4b8a4ff9012599e1ecbcec8395d75
@override_action('BulkRemoveRecord', '_grist_Pages') def _removePageRecords(self, table_id, row_ids): "\n Remove page records and for the those that have children, udpate the first child's indentation\n so that it becomes the new parent. Note that this run a O(n) routine for each page to remove but\n it's ...
Remove page records and for the those that have children, udpate the first child's indentation so that it becomes the new parent. Note that this run a O(n) routine for each page to remove but it's ok considering that the list of _grist_Pages is not meant to grow that big.
sandbox/grist/useractions.py
_removePageRecords
gristlabs/grist-core
2,667
python
@override_action('BulkRemoveRecord', '_grist_Pages') def _removePageRecords(self, table_id, row_ids): "\n Remove page records and for the those that have children, udpate the first child's indentation\n so that it becomes the new parent. Note that this run a O(n) routine for each page to remove but\n it's ...
@override_action('BulkRemoveRecord', '_grist_Pages') def _removePageRecords(self, table_id, row_ids): "\n Remove page records and for the those that have children, udpate the first child's indentation\n so that it becomes the new parent. Note that this run a O(n) routine for each page to remove but\n it's ...
82c988f370e94470b440c17d130b40c4b56db311439ff4c5513f8caabe324142
@override_action('BulkRemoveRecord', '_grist_Views_section') def _removeViewSectionRecords(self, table_id, row_ids): '\n Remove view sections, including their fields.\n ' view_section_recs = [rec for (i, rec) in self._bulk_action_iter(table_id, row_ids)] self._docmodel.remove((f for vs in view_section...
Remove view sections, including their fields.
sandbox/grist/useractions.py
_removeViewSectionRecords
gristlabs/grist-core
2,667
python
@override_action('BulkRemoveRecord', '_grist_Views_section') def _removeViewSectionRecords(self, table_id, row_ids): '\n \n ' view_section_recs = [rec for (i, rec) in self._bulk_action_iter(table_id, row_ids)] self._docmodel.remove((f for vs in view_section_recs for f in vs.fields)) self.doBulkRem...
@override_action('BulkRemoveRecord', '_grist_Views_section') def _removeViewSectionRecords(self, table_id, row_ids): '\n \n ' view_section_recs = [rec for (i, rec) in self._bulk_action_iter(table_id, row_ids)] self._docmodel.remove((f for vs in view_section_recs for f in vs.fields)) self.doBulkRem...
2ebe99dcbbd3ed933d3fd329b7d41f42b2c0f875db4ce7be7a716fb1bba30245
def doModifyColumn(self, table_id, col_id, col_info): '\n ModifyColumn involves a ModifyColumn docaction which changes the column\'s schema, and creates\n a new Column object, destroying the old one. Additionally, it may have an effect on the\n column\'s data:\n\n (1) It may change the column\'s type, w...
ModifyColumn involves a ModifyColumn docaction which changes the column's schema, and creates a new Column object, destroying the old one. Additionally, it may have an effect on the column's data: (1) It may change the column's type, which requires a conversion of the data. Note that the action to fill in converted da...
sandbox/grist/useractions.py
doModifyColumn
gristlabs/grist-core
2,667
python
def doModifyColumn(self, table_id, col_id, col_info): '\n ModifyColumn involves a ModifyColumn docaction which changes the column\'s schema, and creates\n a new Column object, destroying the old one. Additionally, it may have an effect on the\n column\'s data:\n\n (1) It may change the column\'s type, w...
def doModifyColumn(self, table_id, col_id, col_info): '\n ModifyColumn involves a ModifyColumn docaction which changes the column\'s schema, and creates\n a new Column object, destroying the old one. Additionally, it may have an effect on the\n column\'s data:\n\n (1) It may change the column\'s type, w...