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 |
|---|---|---|---|---|---|---|---|---|---|
4d83c6161cae77fbde9e0988eb273557a2c24cb523f0a314e782702f03b613e8 | def __init__(self, app, camAttr, value, writeOK, camAttrList=None, **kwargs):
"\n additional / used params:\n \n camAttr : the PiCamera class attribute to read and write this setting.\n \n camAttrList : the Picamera class attribute that retrieves a list of valid values for this s... | additional / used params:
camAttr : the PiCamera class attribute to read and write this setting.
camAttrList : the Picamera class attribute that retrieves a list of valid values for this setting
if None, the values is uppercase of camAttr with 'S' on the end | piCamHandler.py | __init__ | pootle/piCameraWeb | 1 | python | def __init__(self, app, camAttr, value, writeOK, camAttrList=None, **kwargs):
"\n additional / used params:\n \n camAttr : the PiCamera class attribute to read and write this setting.\n \n camAttrList : the Picamera class attribute that retrieves a list of valid values for this s... | def __init__(self, app, camAttr, value, writeOK, camAttrList=None, **kwargs):
"\n additional / used params:\n \n camAttr : the PiCamera class attribute to read and write this setting.\n \n camAttrList : the Picamera class attribute that retrieves a list of valid values for this s... |
2af2445226653fb827b0b5b0a1566e5d945938c57c242ec4729f658304b2a928 | def __init__(self, app, value, **kwargs):
'\n app is a cameraHandler object with camType already setup\n '
assert (app.camType in self.resolutions), ('unknown camera type %s' % app.camType)
camprops = self.resolutions[app.camType]
useval = (camprops[1] if ((value is 0) or (not (value in ca... | app is a cameraHandler object with camType already setup | piCamHandler.py | __init__ | pootle/piCameraWeb | 1 | python | def __init__(self, app, value, **kwargs):
'\n \n '
assert (app.camType in self.resolutions), ('unknown camera type %s' % app.camType)
camprops = self.resolutions[app.camType]
useval = (camprops[1] if ((value is 0) or (not (value in camprops[0]))) else value)
super().__init__(value=usev... | def __init__(self, app, value, **kwargs):
'\n \n '
assert (app.camType in self.resolutions), ('unknown camera type %s' % app.camType)
camprops = self.resolutions[app.camType]
useval = (camprops[1] if ((value is 0) or (not (value in camprops[0]))) else value)
super().__init__(value=usev... |
8d013457fb45dccc5553501b217edcf0216f2de01956b2ead81cd01c3d6fd948 | def __init__(self, acts, **kwargs):
'\n Runs the camera and everything it does as well as other camera related activities\n '
self.picam = None
self.cameraTimeout = None
self.activityports = ([None] * 3)
self.running = True
wables = [('cam_framerate', wv.floatWatch, 20, True, {'max... | Runs the camera and everything it does as well as other camera related activities | piCamHandler.py | __init__ | pootle/piCameraWeb | 1 | python | def __init__(self, acts, **kwargs):
'\n \n '
self.picam = None
self.cameraTimeout = None
self.activityports = ([None] * 3)
self.running = True
wables = [('cam_framerate', wv.floatWatch, 20, True, {'maxv': 100, 'minv': 0.001}), ('cam_resolution', camResolution, 0, True), ('cam_u_wid... | def __init__(self, acts, **kwargs):
'\n \n '
self.picam = None
self.cameraTimeout = None
self.activityports = ([None] * 3)
self.running = True
wables = [('cam_framerate', wv.floatWatch, 20, True, {'maxv': 100, 'minv': 0.001}), ('cam_resolution', camResolution, 0, True), ('cam_u_wid... |
15d0d541cd5e58ad2185445116bcd3b9d66ccfd620aa1d4b7861413ffd384861 | def camres(self):
'\n fetches the current resolution the camera is using.\n \n returns (width, height) \n '
return [x for x in self.picam.resolution] | fetches the current resolution the camera is using.
returns (width, height) | piCamHandler.py | camres | pootle/piCameraWeb | 1 | python | def camres(self):
'\n fetches the current resolution the camera is using.\n \n returns (width, height) \n '
return [x for x in self.picam.resolution] | def camres(self):
'\n fetches the current resolution the camera is using.\n \n returns (width, height) \n '
return [x for x in self.picam.resolution]<|docstring|>fetches the current resolution the camera is using.
returns (width, height)<|endoftext|> |
8a88ac9743de353fc6479798ce94f927d111d1305faf3ee999a826bd09dbc36e | def camrmode(self):
'\n fetches the appropriate string for the resolution param on opening camera\n '
if (self.cam_resolution.getIndex() == 0):
return ('%dx%d' % (self.cam_u_width.getValue(), self.cam_u_height.getValue()))
else:
return self.cam_resolution.getValue() | fetches the appropriate string for the resolution param on opening camera | piCamHandler.py | camrmode | pootle/piCameraWeb | 1 | python | def camrmode(self):
'\n \n '
if (self.cam_resolution.getIndex() == 0):
return ('%dx%d' % (self.cam_u_width.getValue(), self.cam_u_height.getValue()))
else:
return self.cam_resolution.getValue() | def camrmode(self):
'\n \n '
if (self.cam_resolution.getIndex() == 0):
return ('%dx%d' % (self.cam_u_width.getValue(), self.cam_u_height.getValue()))
else:
return self.cam_resolution.getValue()<|docstring|>fetches the appropriate string for the resolution param on opening camer... |
f8ea98cbb266cd88e4b905010158050f244c52fb65c09f836e108fc04c4aedd1 | def fetchsettings(self):
'\n override the standard fetchsettings to add in settings for the activities\n '
acts = {}
for (actname, act) in self.activities.items():
acts[actname] = (act.fetchsettings() if hasattr(act, 'fetchsettings') else {})
setts = super().fetchsettings()
set... | override the standard fetchsettings to add in settings for the activities | piCamHandler.py | fetchsettings | pootle/piCameraWeb | 1 | python | def fetchsettings(self):
'\n \n '
acts = {}
for (actname, act) in self.activities.items():
acts[actname] = (act.fetchsettings() if hasattr(act, 'fetchsettings') else {})
setts = super().fetchsettings()
setts['acts'] = acts
return setts | def fetchsettings(self):
'\n \n '
acts = {}
for (actname, act) in self.activities.items():
acts[actname] = (act.fetchsettings() if hasattr(act, 'fetchsettings') else {})
setts = super().fetchsettings()
setts['acts'] = acts
return setts<|docstring|>override the standard fetc... |
90aec97a6ec468ee850bd483d052c7ac7180240797f7fb4f0c0d9f5202cb0da0 | def startCamera(self):
'\n starts the camera using the settings originally passed to the constructor. Does nothing if the camera is already running.\n '
if (self.picam is None):
cres = self.camrmode()
self.picam = picamera.PiCamera(resolution=cres, framerate=self.cam_framerate.getV... | starts the camera using the settings originally passed to the constructor. Does nothing if the camera is already running. | piCamHandler.py | startCamera | pootle/piCameraWeb | 1 | python | def startCamera(self):
'\n \n '
if (self.picam is None):
cres = self.camrmode()
self.picam = picamera.PiCamera(resolution=cres, framerate=self.cam_framerate.getValue())
for camval in ('cam_rotation', 'cam_awb_mode', 'cam_exposure_mode', 'cam_meter_mode', 'cam_shutter_speed'... | def startCamera(self):
'\n \n '
if (self.picam is None):
cres = self.camrmode()
self.picam = picamera.PiCamera(resolution=cres, framerate=self.cam_framerate.getValue())
for camval in ('cam_rotation', 'cam_awb_mode', 'cam_exposure_mode', 'cam_meter_mode', 'cam_shutter_speed'... |
368e199908bcc544e61e1997df9f02524b82100a27a1eacff438abf86b7ff543 | def stopCamera(self):
'\n stops the camera and releases the associated resources . Does nothing if the camera is not active\n '
if (self.picam is None):
self.log(wv.loglvls.INFO, 'stop ignored - camera not running')
else:
try:
self.picam.close()
except:
... | stops the camera and releases the associated resources . Does nothing if the camera is not active | piCamHandler.py | stopCamera | pootle/piCameraWeb | 1 | python | def stopCamera(self):
'\n \n '
if (self.picam is None):
self.log(wv.loglvls.INFO, 'stop ignored - camera not running')
else:
try:
self.picam.close()
except:
pass
self.log(wv.loglvls.INFO, 'pi camera closed')
self.picam = None
... | def stopCamera(self):
'\n \n '
if (self.picam is None):
self.log(wv.loglvls.INFO, 'stop ignored - camera not running')
else:
try:
self.picam.close()
except:
pass
self.log(wv.loglvls.INFO, 'pi camera closed')
self.picam = None
... |
2304a6577f596f87f9ccd86bb43752b0e258b30499eb526644ddfee7e4564095 | def _getSplitterPort(self, activity):
'\n finds the camera port and allocates it, returning the number, None if problem\n '
try:
freeport = self.activityports.index(None)
except ValueError:
self.log(wv.loglvls.ERROR, ('unable to find free port for activity %s' % activity))
... | finds the camera port and allocates it, returning the number, None if problem | piCamHandler.py | _getSplitterPort | pootle/piCameraWeb | 1 | python | def _getSplitterPort(self, activity):
'\n \n '
try:
freeport = self.activityports.index(None)
except ValueError:
self.log(wv.loglvls.ERROR, ('unable to find free port for activity %s' % activity))
return None
self.activityports[freeport] = activity
self.log(wv.l... | def _getSplitterPort(self, activity):
'\n \n '
try:
freeport = self.activityports.index(None)
except ValueError:
self.log(wv.loglvls.ERROR, ('unable to find free port for activity %s' % activity))
return None
self.activityports[freeport] = activity
self.log(wv.l... |
f05ca3388855ed67746ae740d8012fafee5199f4b7fb7746e6aef2dc2fb26592 | def flipActivity(self, actname, withport, start=None, **kwargs):
'\n starts and stops activities on demand\n \n actname: name of the activity\n \n actclass: class to use to create the activity\n \n withport: if true, a splitter port is allocated and passed to the... | starts and stops activities on demand
actname: name of the activity
actclass: class to use to create the activity
withport: if true, a splitter port is allocated and passed to the activity
start : if True then the activity is started if not present, otherwise no action
if False then the activity i... | piCamHandler.py | flipActivity | pootle/piCameraWeb | 1 | python | def flipActivity(self, actname, withport, start=None, **kwargs):
'\n starts and stops activities on demand\n \n actname: name of the activity\n \n actclass: class to use to create the activity\n \n withport: if true, a splitter port is allocated and passed to the... | def flipActivity(self, actname, withport, start=None, **kwargs):
'\n starts and stops activities on demand\n \n actname: name of the activity\n \n actclass: class to use to create the activity\n \n withport: if true, a splitter port is allocated and passed to the... |
6eb0aae01ef8ef29558005039b20a2dcf223502d8e486dbf120b29853adb2abd | def __dir__():
'Support nice tab completion'
return __all__ | Support nice tab completion | plumbum/__init__.py | __dir__ | ink-splatters/plumbum | 1,918 | python | def __dir__():
return __all__ | def __dir__():
return __all__<|docstring|>Support nice tab completion<|endoftext|> |
255c3d0f77fcbac389ef8c3a4b9e2edce542b6ac774c3ef38c3904de27fbc86c | def ClusterDasVmConfigSpec(vim, *args, **kwargs):
'An incremental update to the per-virtual-machine vSphere HA configuration.'
obj = vim.client.factory.create('{urn:vim25}ClusterDasVmConfigSpec')
if ((len(args) + len(kwargs)) < 1):
raise IndexError(('Expected at least 2 arguments got: %d' % len(args... | An incremental update to the per-virtual-machine vSphere HA configuration. | pyvisdk/do/cluster_das_vm_config_spec.py | ClusterDasVmConfigSpec | Infinidat/pyvisdk | 0 | python | def ClusterDasVmConfigSpec(vim, *args, **kwargs):
obj = vim.client.factory.create('{urn:vim25}ClusterDasVmConfigSpec')
if ((len(args) + len(kwargs)) < 1):
raise IndexError(('Expected at least 2 arguments got: %d' % len(args)))
required = ['operation']
optional = ['info', 'removeKey', 'dynam... | def ClusterDasVmConfigSpec(vim, *args, **kwargs):
obj = vim.client.factory.create('{urn:vim25}ClusterDasVmConfigSpec')
if ((len(args) + len(kwargs)) < 1):
raise IndexError(('Expected at least 2 arguments got: %d' % len(args)))
required = ['operation']
optional = ['info', 'removeKey', 'dynam... |
94ae3ec4de85118c15218ed4a9320be7374e1bfbc73ac22a43847970a012450d | @eg009.route('/eg009', methods=['POST'])
@authenticate(eg=eg)
def assign_form_to_form_group():
'\n 1. Get required arguments\n 2. Call the worker method\n 3. Render the response\n '
args = Eg009AssignFormToFormGroupController.get_args()
try:
results = Eg009AssignFormToFormGroupController... | 1. Get required arguments
2. Call the worker method
3. Render the response | app/rooms/views/eg009_assign_form_to_form_group.py | assign_form_to_form_group | docusign/eg-03-python-auth-code-grant | 7 | python | @eg009.route('/eg009', methods=['POST'])
@authenticate(eg=eg)
def assign_form_to_form_group():
'\n 1. Get required arguments\n 2. Call the worker method\n 3. Render the response\n '
args = Eg009AssignFormToFormGroupController.get_args()
try:
results = Eg009AssignFormToFormGroupController... | @eg009.route('/eg009', methods=['POST'])
@authenticate(eg=eg)
def assign_form_to_form_group():
'\n 1. Get required arguments\n 2. Call the worker method\n 3. Render the response\n '
args = Eg009AssignFormToFormGroupController.get_args()
try:
results = Eg009AssignFormToFormGroupController... |
8fc42ebf370583b54975c8a5db88054768d4e8a041366379b2b44d4d732963c4 | @eg009.route('/eg009', methods=['GET'])
@authenticate(eg=eg)
def get_view():
'\n 1. Get required arguments\n 2. Get form groups\n 3. Get forms\n 4. Render the response\n '
args = Eg009AssignFormToFormGroupController.get_args()
form_groups = Eg009AssignFormToFormGroupController.get_form_groups... | 1. Get required arguments
2. Get form groups
3. Get forms
4. Render the response | app/rooms/views/eg009_assign_form_to_form_group.py | get_view | docusign/eg-03-python-auth-code-grant | 7 | python | @eg009.route('/eg009', methods=['GET'])
@authenticate(eg=eg)
def get_view():
'\n 1. Get required arguments\n 2. Get form groups\n 3. Get forms\n 4. Render the response\n '
args = Eg009AssignFormToFormGroupController.get_args()
form_groups = Eg009AssignFormToFormGroupController.get_form_groups... | @eg009.route('/eg009', methods=['GET'])
@authenticate(eg=eg)
def get_view():
'\n 1. Get required arguments\n 2. Get form groups\n 3. Get forms\n 4. Render the response\n '
args = Eg009AssignFormToFormGroupController.get_args()
form_groups = Eg009AssignFormToFormGroupController.get_form_groups... |
b474c351aa57188042eed56d791f28fcb5c7b74aacb402ec3c11cef8ce120239 | @property
def pa_powerup_current(self) -> float:
'A current between transparency and backfire thresholds.'
return (self._spec.pa_transparency + (0.3 * (self._spec.pa_backfire - self._spec.pa_transparency))) | A current between transparency and backfire thresholds. | pyodine/drivers/ecdl_mopa.py | pa_powerup_current | trimitri/jokarus | 1 | python | @property
def pa_powerup_current(self) -> float:
return (self._spec.pa_transparency + (0.3 * (self._spec.pa_backfire - self._spec.pa_transparency))) | @property
def pa_powerup_current(self) -> float:
return (self._spec.pa_transparency + (0.3 * (self._spec.pa_backfire - self._spec.pa_transparency)))<|docstring|>A current between transparency and backfire thresholds.<|endoftext|> |
fdb4d9045bad20eb603ce1a81b0f457f4fa780a358fcbfdfeed6fa564ef320b8 | @property
def mo_powerup_current(self) -> float:
'A current above seeding threshold.'
candidate = (1.3 * self._spec.mo_seed)
if (candidate < self._spec.mo_max):
return candidate
return self._spec.mo_max | A current above seeding threshold. | pyodine/drivers/ecdl_mopa.py | mo_powerup_current | trimitri/jokarus | 1 | python | @property
def mo_powerup_current(self) -> float:
candidate = (1.3 * self._spec.mo_seed)
if (candidate < self._spec.mo_max):
return candidate
return self._spec.mo_max | @property
def mo_powerup_current(self) -> float:
candidate = (1.3 * self._spec.mo_seed)
if (candidate < self._spec.mo_max):
return candidate
return self._spec.mo_max<|docstring|>A current above seeding threshold.<|endoftext|> |
bee19a9ec2caa9a6ad96bbbfaf40213f4cb4e00842f19d98bba664c5dde3fbea | def get_mo_current(self) -> float:
'The master oscillator laser diode current in milliamps.\n\n :raises CallbackError: Some exception occured in callback function.\n '
try:
return self._get_mo_current()
except Exception as err:
raise CallbackError('Error executing get_mo_curren... | The master oscillator laser diode current in milliamps.
:raises CallbackError: Some exception occured in callback function. | pyodine/drivers/ecdl_mopa.py | get_mo_current | trimitri/jokarus | 1 | python | def get_mo_current(self) -> float:
'The master oscillator laser diode current in milliamps.\n\n :raises CallbackError: Some exception occured in callback function.\n '
try:
return self._get_mo_current()
except Exception as err:
raise CallbackError('Error executing get_mo_curren... | def get_mo_current(self) -> float:
'The master oscillator laser diode current in milliamps.\n\n :raises CallbackError: Some exception occured in callback function.\n '
try:
return self._get_mo_current()
except Exception as err:
raise CallbackError('Error executing get_mo_curren... |
3fc4759753a1147d4fa5dd74e8e58ecd57e5314403e976d18ebffe9ca4378815 | def set_mo_current(self, milliamps: float) -> None:
'Set the current setpoint for the master oscillator laser diode.\n\n :raises ValueError: The given value must not be applied in the current\n operating regime.\n :raises CallbackError: Some exception occured in callback fun... | Set the current setpoint for the master oscillator laser diode.
:raises ValueError: The given value must not be applied in the current
operating regime.
:raises CallbackError: Some exception occured in callback function. | pyodine/drivers/ecdl_mopa.py | set_mo_current | trimitri/jokarus | 1 | python | def set_mo_current(self, milliamps: float) -> None:
'Set the current setpoint for the master oscillator laser diode.\n\n :raises ValueError: The given value must not be applied in the current\n operating regime.\n :raises CallbackError: Some exception occured in callback fun... | def set_mo_current(self, milliamps: float) -> None:
'Set the current setpoint for the master oscillator laser diode.\n\n :raises ValueError: The given value must not be applied in the current\n operating regime.\n :raises CallbackError: Some exception occured in callback fun... |
f3bc638aa317d20cb82f2cc90effaee76f4c536f5fc75e981826c3ade7e6aab9 | def get_pa_current(self) -> float:
'The laser power amplifier current in milliamps.\n\n :raises CallbackError: Some exception occured in callback function.\n '
try:
return self._get_pa_current()
except Exception as err:
raise CallbackError('Error executing get_pa_current_callba... | The laser power amplifier current in milliamps.
:raises CallbackError: Some exception occured in callback function. | pyodine/drivers/ecdl_mopa.py | get_pa_current | trimitri/jokarus | 1 | python | def get_pa_current(self) -> float:
'The laser power amplifier current in milliamps.\n\n :raises CallbackError: Some exception occured in callback function.\n '
try:
return self._get_pa_current()
except Exception as err:
raise CallbackError('Error executing get_pa_current_callba... | def get_pa_current(self) -> float:
'The laser power amplifier current in milliamps.\n\n :raises CallbackError: Some exception occured in callback function.\n '
try:
return self._get_pa_current()
except Exception as err:
raise CallbackError('Error executing get_pa_current_callba... |
e33d90e6b2179b4fb265114ea1db70f9921236c32aac11ab3d5a6bd9ccd93fbc | def set_pa_current(self, milliamps: float) -> None:
'Set the current setpoint for the laser power amplifier.\n\n :raises ValueError: The given value must not be applied in the current\n operating regime.\n :raises CallbackError: Some exception occured in callback function.\n... | Set the current setpoint for the laser power amplifier.
:raises ValueError: The given value must not be applied in the current
operating regime.
:raises CallbackError: Some exception occured in callback function. | pyodine/drivers/ecdl_mopa.py | set_pa_current | trimitri/jokarus | 1 | python | def set_pa_current(self, milliamps: float) -> None:
'Set the current setpoint for the laser power amplifier.\n\n :raises ValueError: The given value must not be applied in the current\n operating regime.\n :raises CallbackError: Some exception occured in callback function.\n... | def set_pa_current(self, milliamps: float) -> None:
'Set the current setpoint for the laser power amplifier.\n\n :raises ValueError: The given value must not be applied in the current\n operating regime.\n :raises CallbackError: Some exception occured in callback function.\n... |
df703f89ecdbbba6ec981781ccb0eb6265623dbf3502e6b22003254435ecab0d | def disable_mo(self, force: bool=False) -> None:
'Switch off master oscillator if safe. Use force to skip checks.\n\n :raises ValueError: Turning off MO not allowable in current regime.\n This is only raised if "force" is not used.\n '
if (not force):
self.set_mo... | Switch off master oscillator if safe. Use force to skip checks.
:raises ValueError: Turning off MO not allowable in current regime.
This is only raised if "force" is not used. | pyodine/drivers/ecdl_mopa.py | disable_mo | trimitri/jokarus | 1 | python | def disable_mo(self, force: bool=False) -> None:
'Switch off master oscillator if safe. Use force to skip checks.\n\n :raises ValueError: Turning off MO not allowable in current regime.\n This is only raised if "force" is not used.\n '
if (not force):
self.set_mo... | def disable_mo(self, force: bool=False) -> None:
'Switch off master oscillator if safe. Use force to skip checks.\n\n :raises ValueError: Turning off MO not allowable in current regime.\n This is only raised if "force" is not used.\n '
if (not force):
self.set_mo... |
adaf6517152746ac8d14b85280e2a3cd3b57c49441abc16144749fa8a5044952 | def disable_pa(self, force: bool=False) -> None:
'Switch off power amplifier if safe. Use force to skip checks.\n\n :raises ValueError: Turning off PA not allowable in current regime.\n This is only raised if "force" is not used.\n '
if (not force):
self.set_pa_c... | Switch off power amplifier if safe. Use force to skip checks.
:raises ValueError: Turning off PA not allowable in current regime.
This is only raised if "force" is not used. | pyodine/drivers/ecdl_mopa.py | disable_pa | trimitri/jokarus | 1 | python | def disable_pa(self, force: bool=False) -> None:
'Switch off power amplifier if safe. Use force to skip checks.\n\n :raises ValueError: Turning off PA not allowable in current regime.\n This is only raised if "force" is not used.\n '
if (not force):
self.set_pa_c... | def disable_pa(self, force: bool=False) -> None:
'Switch off power amplifier if safe. Use force to skip checks.\n\n :raises ValueError: Turning off PA not allowable in current regime.\n This is only raised if "force" is not used.\n '
if (not force):
self.set_pa_c... |
5c98eaaf336a69373d39f5e7aeadfb573f15b25716a482fc36d86efa6acff664 | def enable_mo(self, force: bool=False) -> None:
'Switch on master oscillator (setting it to 0 mA).\n\n Use "force" to skip all sanity checks and switch it on. This skips\n setting the current to 0 mA!\n\n :raises ValueError: Current regime doesn\'t allow setting MO to 0 mA. Is\n ... | Switch on master oscillator (setting it to 0 mA).
Use "force" to skip all sanity checks and switch it on. This skips
setting the current to 0 mA!
:raises ValueError: Current regime doesn't allow setting MO to 0 mA. Is
only raised if "force" is not used. | pyodine/drivers/ecdl_mopa.py | enable_mo | trimitri/jokarus | 1 | python | def enable_mo(self, force: bool=False) -> None:
'Switch on master oscillator (setting it to 0 mA).\n\n Use "force" to skip all sanity checks and switch it on. This skips\n setting the current to 0 mA!\n\n :raises ValueError: Current regime doesn\'t allow setting MO to 0 mA. Is\n ... | def enable_mo(self, force: bool=False) -> None:
'Switch on master oscillator (setting it to 0 mA).\n\n Use "force" to skip all sanity checks and switch it on. This skips\n setting the current to 0 mA!\n\n :raises ValueError: Current regime doesn\'t allow setting MO to 0 mA. Is\n ... |
5934c132d78526a97b5275816d233787e17f6b6e3d0accf13bf14c6aaa4257c3 | def enable_pa(self, force: bool=False) -> None:
'Switch on power amplifier (setting it to 0 mA).\n\n Use "force" to skip all sanity checks and switch it on. This skips\n setting the current to 0 mA!\n\n :raises ValueError: Current regime doesn\'t allow setting PA to 0 mA. Is\n ... | Switch on power amplifier (setting it to 0 mA).
Use "force" to skip all sanity checks and switch it on. This skips
setting the current to 0 mA!
:raises ValueError: Current regime doesn't allow setting PA to 0 mA. Is
only raised if "force" is not used. | pyodine/drivers/ecdl_mopa.py | enable_pa | trimitri/jokarus | 1 | python | def enable_pa(self, force: bool=False) -> None:
'Switch on power amplifier (setting it to 0 mA).\n\n Use "force" to skip all sanity checks and switch it on. This skips\n setting the current to 0 mA!\n\n :raises ValueError: Current regime doesn\'t allow setting PA to 0 mA. Is\n ... | def enable_pa(self, force: bool=False) -> None:
'Switch on power amplifier (setting it to 0 mA).\n\n Use "force" to skip all sanity checks and switch it on. This skips\n setting the current to 0 mA!\n\n :raises ValueError: Current regime doesn\'t allow setting PA to 0 mA. Is\n ... |
c403d0fe862dde0acc3d51ea01d1b1dc7b1521ed8749f9ab2b76bf353d31cd1a | def get_state(self) -> LaserState:
"Identify the laser's current state."
if ((not self._is_mo_on()) and (not self._is_pa_on())):
return LaserState.OFF
mo_current = self.get_mo_current()
pa_current = self.get_pa_current()
if all([self._is_mo_on(), self._is_pa_on(), (mo_current > self._spec.mo... | Identify the laser's current state. | pyodine/drivers/ecdl_mopa.py | get_state | trimitri/jokarus | 1 | python | def get_state(self) -> LaserState:
if ((not self._is_mo_on()) and (not self._is_pa_on())):
return LaserState.OFF
mo_current = self.get_mo_current()
pa_current = self.get_pa_current()
if all([self._is_mo_on(), self._is_pa_on(), (mo_current > self._spec.mo_seed), (mo_current < self._spec.mo_m... | def get_state(self) -> LaserState:
if ((not self._is_mo_on()) and (not self._is_pa_on())):
return LaserState.OFF
mo_current = self.get_mo_current()
pa_current = self.get_pa_current()
if all([self._is_mo_on(), self._is_pa_on(), (mo_current > self._spec.mo_seed), (mo_current < self._spec.mo_m... |
1ba39c6736bc0947db7ac99bec0de304fa88f58d9e42fae3fb47500c97e903f8 | def _to_datetime(value):
' Example: 2018-05-06T19:44:00Z\n\n :return: datetime with milliseconds stripped\n '
return datetime.datetime.strptime(str(value), '%Y-%m-%dT%H:%M:%SZ') | Example: 2018-05-06T19:44:00Z
:return: datetime with milliseconds stripped | pyofd/providers/kontur.py | _to_datetime | sergelevin/pyofd | 16 | python | def _to_datetime(value):
' Example: 2018-05-06T19:44:00Z\n\n :return: datetime with milliseconds stripped\n '
return datetime.datetime.strptime(str(value), '%Y-%m-%dT%H:%M:%SZ') | def _to_datetime(value):
' Example: 2018-05-06T19:44:00Z\n\n :return: datetime with milliseconds stripped\n '
return datetime.datetime.strptime(str(value), '%Y-%m-%dT%H:%M:%SZ')<|docstring|>Example: 2018-05-06T19:44:00Z
:return: datetime with milliseconds stripped<|endoftext|> |
7773bee4787d1a1f8b7f6badacf9241e01b4939f6248a60809697d7923d073e5 | def __init__(self, f=None, g=None, operator=None, tau=None, sigma=1.0, x_init=None, use_axpby=True, **kwargs):
'PDHG algorithm creator\n\n Optional parameters\n\n :param operator: a Linear Operator\n :param f: Convex function with "simple" proximal of its conjugate. \n :param g: Convex f... | PDHG algorithm creator
Optional parameters
:param operator: a Linear Operator
:param f: Convex function with "simple" proximal of its conjugate.
:param g: Convex function with "simple" proximal
:param sigma: Step size parameter for Primal problem
:param tau: Step size parameter for Dual problem
:param x_init: Initi... | Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py | __init__ | KrisThielemans/CCPi-Framework | 0 | python | def __init__(self, f=None, g=None, operator=None, tau=None, sigma=1.0, x_init=None, use_axpby=True, **kwargs):
'PDHG algorithm creator\n\n Optional parameters\n\n :param operator: a Linear Operator\n :param f: Convex function with "simple" proximal of its conjugate. \n :param g: Convex f... | def __init__(self, f=None, g=None, operator=None, tau=None, sigma=1.0, x_init=None, use_axpby=True, **kwargs):
'PDHG algorithm creator\n\n Optional parameters\n\n :param operator: a Linear Operator\n :param f: Convex function with "simple" proximal of its conjugate. \n :param g: Convex f... |
ce63bc55525271941e4dae9ecb23a2900e627dc12024629d55ac0015a881b421 | def set_up(self, f, g, operator, tau=None, sigma=1.0, x_init=None):
'initialisation of the algorithm\n\n :param operator: a Linear Operator\n :param f: Convex function with "simple" proximal of its conjugate. \n :param g: Convex function with "simple" proximal \n :param sigma: Step size ... | initialisation of the algorithm
:param operator: a Linear Operator
:param f: Convex function with "simple" proximal of its conjugate.
:param g: Convex function with "simple" proximal
:param sigma: Step size parameter for Primal problem
:param tau: Step size parameter for Dual problem
:param x_init: Initial guess ( D... | Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py | set_up | KrisThielemans/CCPi-Framework | 0 | python | def set_up(self, f, g, operator, tau=None, sigma=1.0, x_init=None):
'initialisation of the algorithm\n\n :param operator: a Linear Operator\n :param f: Convex function with "simple" proximal of its conjugate. \n :param g: Convex function with "simple" proximal \n :param sigma: Step size ... | def set_up(self, f, g, operator, tau=None, sigma=1.0, x_init=None):
'initialisation of the algorithm\n\n :param operator: a Linear Operator\n :param f: Convex function with "simple" proximal of its conjugate. \n :param g: Convex function with "simple" proximal \n :param sigma: Step size ... |
974b52d6ec37d1d2636f29772584a039cc8d048334e0cbd1416b245e94b4a642 | @property
def objective(self):
'alias of loss'
return [x[0] for x in self.loss] | alias of loss | Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py | objective | KrisThielemans/CCPi-Framework | 0 | python | @property
def objective(self):
return [x[0] for x in self.loss] | @property
def objective(self):
return [x[0] for x in self.loss]<|docstring|>alias of loss<|endoftext|> |
8e47ede5225c5ad63f193e501920ec21b9a6f4ea7d780a59d9037e9db8bad630 | def get():
'\n Get the quartiles score for each dispersion of a given background subtraction mode\n :param bg: "global" for Poisson distribution (only one currently supported)\n :return:\n '
dbfile = os.path.join(os.path.dirname(__file__), 'db', 'quartiles.db')
con = sqlite3.connect(dbfile)
... | Get the quartiles score for each dispersion of a given background subtraction mode
:param bg: "global" for Poisson distribution (only one currently supported)
:return: | tools/ngs-qc/libquartiles.py | get | SysFate/tools-iuc | 0 | python | def get():
'\n Get the quartiles score for each dispersion of a given background subtraction mode\n :param bg: "global" for Poisson distribution (only one currently supported)\n :return:\n '
dbfile = os.path.join(os.path.dirname(__file__), 'db', 'quartiles.db')
con = sqlite3.connect(dbfile)
... | def get():
'\n Get the quartiles score for each dispersion of a given background subtraction mode\n :param bg: "global" for Poisson distribution (only one currently supported)\n :return:\n '
dbfile = os.path.join(os.path.dirname(__file__), 'db', 'quartiles.db')
con = sqlite3.connect(dbfile)
... |
365cb148b3b842c2aa47b3b0671412358bd16bb6081e788470c21e4c515c0241 | def load_switch_config(config_fd):
'Loads the switch configuration from config_fd.\n\n Args:\n config_fd: readable file-like object, contains the switch configuration.\n\n Returns:\n Config, the complete model and OID switch configuraion.\n\n Raises:\n BadConfiguration: the yaml config... | Loads the switch configuration from config_fd.
Args:
config_fd: readable file-like object, contains the switch configuration.
Returns:
Config, the complete model and OID switch configuraion.
Raises:
BadConfiguration: the yaml configuration contained an error. | site-packages/mlab/disco/models.py | load_switch_config | m-lab/collectd-mlab | 3 | python | def load_switch_config(config_fd):
'Loads the switch configuration from config_fd.\n\n Args:\n config_fd: readable file-like object, contains the switch configuration.\n\n Returns:\n Config, the complete model and OID switch configuraion.\n\n Raises:\n BadConfiguration: the yaml config... | def load_switch_config(config_fd):
'Loads the switch configuration from config_fd.\n\n Args:\n config_fd: readable file-like object, contains the switch configuration.\n\n Returns:\n Config, the complete model and OID switch configuraion.\n\n Raises:\n BadConfiguration: the yaml config... |
9e7bc73ba275891643832016d47b96ba3c9c563ffdf5add44e828bd96bba43f1 | def __init__(self, models=None, default_oids=None, **kwargs):
"Initializes the object.\n\n Args:\n models: list of Model, the models for this config.\n default_oids: dict of OID, a mapping from OID names to OID objects.\n **kwargs: dict, remaining key word arguments. kwargs['line']... | Initializes the object.
Args:
models: list of Model, the models for this config.
default_oids: dict of OID, a mapping from OID names to OID objects.
**kwargs: dict, remaining key word arguments. kwargs['line'] is used
to report errors. | site-packages/mlab/disco/models.py | __init__ | m-lab/collectd-mlab | 3 | python | def __init__(self, models=None, default_oids=None, **kwargs):
"Initializes the object.\n\n Args:\n models: list of Model, the models for this config.\n default_oids: dict of OID, a mapping from OID names to OID objects.\n **kwargs: dict, remaining key word arguments. kwargs['line']... | def __init__(self, models=None, default_oids=None, **kwargs):
"Initializes the object.\n\n Args:\n models: list of Model, the models for this config.\n default_oids: dict of OID, a mapping from OID names to OID objects.\n **kwargs: dict, remaining key word arguments. kwargs['line']... |
b6a7af1db84ae997996f367778d3f03564eb8b80011109ffa58b145d49de1747 | def _populate_model_oids(self):
'Populates the model OIDs based on the configuration default_oids.'
for model in self.models:
total_oids = copy.deepcopy(self.default_oids)
if model.oids:
for (name, oid) in model.oids.iteritems():
total_oids[name] = oid
model.o... | Populates the model OIDs based on the configuration default_oids. | site-packages/mlab/disco/models.py | _populate_model_oids | m-lab/collectd-mlab | 3 | python | def _populate_model_oids(self):
for model in self.models:
total_oids = copy.deepcopy(self.default_oids)
if model.oids:
for (name, oid) in model.oids.iteritems():
total_oids[name] = oid
model.oids = total_oids | def _populate_model_oids(self):
for model in self.models:
total_oids = copy.deepcopy(self.default_oids)
if model.oids:
for (name, oid) in model.oids.iteritems():
total_oids[name] = oid
model.oids = total_oids<|docstring|>Populates the model OIDs based on the ... |
08122252e70281ba8f6a3d10ac4f699e488401085bf733d297d5a34be685ddee | def get_model(self, sysdescr):
'Returns a model configuration based on the switch model.\n\n Args:\n sysdescr: str, the value returned for the sysDescr.0 OID.\n\n Returns:\n Model, a switch configuration based on the switch model.\n\n Raises:\n UnknownSwitchMode... | Returns a model configuration based on the switch model.
Args:
sysdescr: str, the value returned for the sysDescr.0 OID.
Returns:
Model, a switch configuration based on the switch model.
Raises:
UnknownSwitchModel: could not identify the model corresponding to
sysdescr.
MultipleMatches: more ... | site-packages/mlab/disco/models.py | get_model | m-lab/collectd-mlab | 3 | python | def get_model(self, sysdescr):
'Returns a model configuration based on the switch model.\n\n Args:\n sysdescr: str, the value returned for the sysDescr.0 OID.\n\n Returns:\n Model, a switch configuration based on the switch model.\n\n Raises:\n UnknownSwitchMode... | def get_model(self, sysdescr):
'Returns a model configuration based on the switch model.\n\n Args:\n sysdescr: str, the value returned for the sysDescr.0 OID.\n\n Returns:\n Model, a switch configuration based on the switch model.\n\n Raises:\n UnknownSwitchMode... |
25af9cad5e9c4f2f6c9236dbe8dae0c50e7b2725fef25ea94803fd967d94a532 | def oid_names(self):
'Returns list of OID names in the model OID configuration.'
return self.oids.keys() | Returns list of OID names in the model OID configuration. | site-packages/mlab/disco/models.py | oid_names | m-lab/collectd-mlab | 3 | python | def oid_names(self):
return self.oids.keys() | def oid_names(self):
return self.oids.keys()<|docstring|>Returns list of OID names in the model OID configuration.<|endoftext|> |
a90bfdaac6f654741d075da2c5511c8be0524cbbf29c86906e577e42bc48eeaf | def lookup_oids(self, oid_name, ifindex):
'Returns the input and output OIDs for oid_name on ifindex.\n\n Args:\n oid_name: str, a supported oid_name; one returned by\n SwitchConfig.oid_names.\n ifindex: str, the interface index number as returned by\n DiscoverySes... | Returns the input and output OIDs for oid_name on ifindex.
Args:
oid_name: str, a supported oid_name; one returned by
SwitchConfig.oid_names.
ifindex: str, the interface index number as returned by
DiscoverySession.auto_discover_ports.
Returns:
tuple of (str, str), containing the input and output OI... | site-packages/mlab/disco/models.py | lookup_oids | m-lab/collectd-mlab | 3 | python | def lookup_oids(self, oid_name, ifindex):
'Returns the input and output OIDs for oid_name on ifindex.\n\n Args:\n oid_name: str, a supported oid_name; one returned by\n SwitchConfig.oid_names.\n ifindex: str, the interface index number as returned by\n DiscoverySes... | def lookup_oids(self, oid_name, ifindex):
'Returns the input and output OIDs for oid_name on ifindex.\n\n Args:\n oid_name: str, a supported oid_name; one returned by\n SwitchConfig.oid_names.\n ifindex: str, the interface index number as returned by\n DiscoverySes... |
345f77cb6613ada4535d0ea72f9636ecf2a5243ad6338198fe56c9850cad858a | def init_display():
'\n The minimum amount of code required to init the display.\n '
if (not renpy.game.interface):
renpy.display.core.Interface()
renpy.loader.index_archives()
renpy.display.im.cache.init()
renpy.ui.reset() | The minimum amount of code required to init the display. | renpy/display/error.py | init_display | derektoub/Arven-s-DLD-Adventure | 1 | python | def init_display():
'\n \n '
if (not renpy.game.interface):
renpy.display.core.Interface()
renpy.loader.index_archives()
renpy.display.im.cache.init()
renpy.ui.reset() | def init_display():
'\n \n '
if (not renpy.game.interface):
renpy.display.core.Interface()
renpy.loader.index_archives()
renpy.display.im.cache.init()
renpy.ui.reset()<|docstring|>The minimum amount of code required to init the display.<|endoftext|> |
44ef4ff02e433e32782a2cd0d4829ee9509aa2d357dacf84050822ba87755c93 | def error_dump():
'\n Handles dumps in the case where an error occurs.\n '
renpy.dump.dump(True) | Handles dumps in the case where an error occurs. | renpy/display/error.py | error_dump | derektoub/Arven-s-DLD-Adventure | 1 | python | def error_dump():
'\n \n '
renpy.dump.dump(True) | def error_dump():
'\n \n '
renpy.dump.dump(True)<|docstring|>Handles dumps in the case where an error occurs.<|endoftext|> |
7fcd78f9ba4894c70a13361343fbf67d621eea5efc89d7f19609ab01a7864e6c | def report_exception(short, full, traceback_fn):
'\n Reports an exception to the user. Returns True if the exception should\n be raised by the normal reporting mechanisms. Otherwise, should raise\n the appropriate exception to cause a reload or quit or rollback.\n '
global error_handled
error_ha... | Reports an exception to the user. Returns True if the exception should
be raised by the normal reporting mechanisms. Otherwise, should raise
the appropriate exception to cause a reload or quit or rollback. | renpy/display/error.py | report_exception | derektoub/Arven-s-DLD-Adventure | 1 | python | def report_exception(short, full, traceback_fn):
'\n Reports an exception to the user. Returns True if the exception should\n be raised by the normal reporting mechanisms. Otherwise, should raise\n the appropriate exception to cause a reload or quit or rollback.\n '
global error_handled
error_ha... | def report_exception(short, full, traceback_fn):
'\n Reports an exception to the user. Returns True if the exception should\n be raised by the normal reporting mechanisms. Otherwise, should raise\n the appropriate exception to cause a reload or quit or rollback.\n '
global error_handled
error_ha... |
86e474c1907f166b1deee7f7ef84f5436e5ebfae5b4f58e09e73f3520713db1a | def report_parse_errors(errors, error_fn):
'\n Reports an exception to the user. Returns True if the exception should\n be raised by the normal reporting mechanisms. Otherwise, should raise\n the appropriate exception.\n '
global error_handled
error_handled = True
error_dump()
if (renpy.... | Reports an exception to the user. Returns True if the exception should
be raised by the normal reporting mechanisms. Otherwise, should raise
the appropriate exception. | renpy/display/error.py | report_parse_errors | derektoub/Arven-s-DLD-Adventure | 1 | python | def report_parse_errors(errors, error_fn):
'\n Reports an exception to the user. Returns True if the exception should\n be raised by the normal reporting mechanisms. Otherwise, should raise\n the appropriate exception.\n '
global error_handled
error_handled = True
error_dump()
if (renpy.... | def report_parse_errors(errors, error_fn):
'\n Reports an exception to the user. Returns True if the exception should\n be raised by the normal reporting mechanisms. Otherwise, should raise\n the appropriate exception.\n '
global error_handled
error_handled = True
error_dump()
if (renpy.... |
b41e31306e5d70db0050f54236735e405cf145a974f1e93f8fc9d80f6a4491cb | def createSymbolArrow(width, x1=0, y1=0, x2=0, y2=0, headLength=0, filled=fillType.none, points=[]):
'\n Create arrow as a list of primitives (line + polyline) from x1,y1 to x2,y2\n arrLen: headLength: length of arrow head\n If headLength<= _arrow length_, return only head pointing to x2, y2\n '
if ... | Create arrow as a list of primitives (line + polyline) from x1,y1 to x2,y2
arrLen: headLength: length of arrow head
If headLength<= _arrow length_, return only head pointing to x2, y2 | src/pcbLibraryManager/libraryManager/symbolPrimitive.py | createSymbolArrow | NiceCircuits/pcbLibraryManager | 0 | python | def createSymbolArrow(width, x1=0, y1=0, x2=0, y2=0, headLength=0, filled=fillType.none, points=[]):
'\n Create arrow as a list of primitives (line + polyline) from x1,y1 to x2,y2\n arrLen: headLength: length of arrow head\n If headLength<= _arrow length_, return only head pointing to x2, y2\n '
if ... | def createSymbolArrow(width, x1=0, y1=0, x2=0, y2=0, headLength=0, filled=fillType.none, points=[]):
'\n Create arrow as a list of primitives (line + polyline) from x1,y1 to x2,y2\n arrLen: headLength: length of arrow head\n If headLength<= _arrow length_, return only head pointing to x2, y2\n '
if ... |
764d817426f30bbf03e46e717252ac4e667816558771bee9a35c095868929018 | def __init__(self, width=defaults.symbolLineWidth, x1=0, y1=0, x2=0, y2=0, points=[]):
'\n Initialize with points or x1, y1, x2, y2\n '
if (not points):
points = [[x1, y1], [x2, y2]]
super().__init__(width, points) | Initialize with points or x1, y1, x2, y2 | src/pcbLibraryManager/libraryManager/symbolPrimitive.py | __init__ | NiceCircuits/pcbLibraryManager | 0 | python | def __init__(self, width=defaults.symbolLineWidth, x1=0, y1=0, x2=0, y2=0, points=[]):
'\n \n '
if (not points):
points = [[x1, y1], [x2, y2]]
super().__init__(width, points) | def __init__(self, width=defaults.symbolLineWidth, x1=0, y1=0, x2=0, y2=0, points=[]):
'\n \n '
if (not points):
points = [[x1, y1], [x2, y2]]
super().__init__(width, points)<|docstring|>Initialize with points or x1, y1, x2, y2<|endoftext|> |
0639ceaf891366f67f9d4bcb5152ebd144fb091c665cdc6969d844c1333a2337 | def __init__(self, width, x1=0, y1=0, x2=0, y2=0, position=[], dimensions=[], rotation=0.0, points=[], filled=fillType.none):
'\n Initialize with one of options:\n * position and dimensions \n * points\n * x1, y1, x2, y2\n '
if (not position):
if points:
... | Initialize with one of options:
* position and dimensions
* points
* x1, y1, x2, y2 | src/pcbLibraryManager/libraryManager/symbolPrimitive.py | __init__ | NiceCircuits/pcbLibraryManager | 0 | python | def __init__(self, width, x1=0, y1=0, x2=0, y2=0, position=[], dimensions=[], rotation=0.0, points=[], filled=fillType.none):
'\n Initialize with one of options:\n * position and dimensions \n * points\n * x1, y1, x2, y2\n '
if (not position):
if points:
... | def __init__(self, width, x1=0, y1=0, x2=0, y2=0, position=[], dimensions=[], rotation=0.0, points=[], filled=fillType.none):
'\n Initialize with one of options:\n * position and dimensions \n * points\n * x1, y1, x2, y2\n '
if (not position):
if points:
... |
16805f3b93cf81b45e86a73601a7bc2d6323b738060674f3ae47c7354f2713bc | def __init__(self, control_count, control_eval_count, evolution_time, max_bandwidths, cost_multiplier=1.0):
'\n See class fields for arguments not listed here.\n\n Arguments:\n control_count\n control_eval_count\n evolution_time\n '
super().__init__(cost_multiplier=cost... | See class fields for arguments not listed here.
Arguments:
control_count
control_eval_count
evolution_time | qoc/standard/costs/controlbandwidthmax.py | __init__ | alibabaquantumlab/qoc | 12 | python | def __init__(self, control_count, control_eval_count, evolution_time, max_bandwidths, cost_multiplier=1.0):
'\n See class fields for arguments not listed here.\n\n Arguments:\n control_count\n control_eval_count\n evolution_time\n '
super().__init__(cost_multiplier=cost... | def __init__(self, control_count, control_eval_count, evolution_time, max_bandwidths, cost_multiplier=1.0):
'\n See class fields for arguments not listed here.\n\n Arguments:\n control_count\n control_eval_count\n evolution_time\n '
super().__init__(cost_multiplier=cost... |
cfcf73df9d3a14662e677a3df03c466948422e2fb401afdd61a32d9d59897520 | def cost(self, controls, states, system_eval_step):
'\n Compute the penalty.\n\n Arguments:\n controls\n states\n system_eval_step\n\n Returns:\n cost\n '
cost = 0
for (i, max_bandwidth) in enumerate(self.max_bandwidths):
control_fft = anp.fft.... | Compute the penalty.
Arguments:
controls
states
system_eval_step
Returns:
cost | qoc/standard/costs/controlbandwidthmax.py | cost | alibabaquantumlab/qoc | 12 | python | def cost(self, controls, states, system_eval_step):
'\n Compute the penalty.\n\n Arguments:\n controls\n states\n system_eval_step\n\n Returns:\n cost\n '
cost = 0
for (i, max_bandwidth) in enumerate(self.max_bandwidths):
control_fft = anp.fft.... | def cost(self, controls, states, system_eval_step):
'\n Compute the penalty.\n\n Arguments:\n controls\n states\n system_eval_step\n\n Returns:\n cost\n '
cost = 0
for (i, max_bandwidth) in enumerate(self.max_bandwidths):
control_fft = anp.fft.... |
ed76b27406ef4a778b69cbef6db7a2750a317a4d81fe2bd3095aab06d2d1257a | def __init__(self, center, radius):
'\n Initialises sphere with center-coordinate and radius.\n '
self.center = center
self.radius = radius | Initialises sphere with center-coordinate and radius. | lib/python2.7/site-packages/esys/lsm/vis/core/sphere.py | __init__ | danielfrascarelli/esys-particle | 0 | python | def __init__(self, center, radius):
'\n \n '
self.center = center
self.radius = radius | def __init__(self, center, radius):
'\n \n '
self.center = center
self.radius = radius<|docstring|>Initialises sphere with center-coordinate and radius.<|endoftext|> |
93a5315201a11a0cc561ae425839ff82555c5a617336fb7bac76e9d1601a0710 | def getCenter(self):
'\n Returns the coordinate of the center of this sphere.\n @return: Center coordinate of this sphere.\n '
return self.center | Returns the coordinate of the center of this sphere.
@return: Center coordinate of this sphere. | lib/python2.7/site-packages/esys/lsm/vis/core/sphere.py | getCenter | danielfrascarelli/esys-particle | 0 | python | def getCenter(self):
'\n Returns the coordinate of the center of this sphere.\n @return: Center coordinate of this sphere.\n '
return self.center | def getCenter(self):
'\n Returns the coordinate of the center of this sphere.\n @return: Center coordinate of this sphere.\n '
return self.center<|docstring|>Returns the coordinate of the center of this sphere.
@return: Center coordinate of this sphere.<|endoftext|> |
9bc605b4cf8298343750788010bd2ae2bfe66b456a7b1488a2d5d74ea280e774 | def getRadius(self):
'\n Returns the radius of this sphere.\n @return: Radius of this sphere.\n '
return self.radius | Returns the radius of this sphere.
@return: Radius of this sphere. | lib/python2.7/site-packages/esys/lsm/vis/core/sphere.py | getRadius | danielfrascarelli/esys-particle | 0 | python | def getRadius(self):
'\n Returns the radius of this sphere.\n @return: Radius of this sphere.\n '
return self.radius | def getRadius(self):
'\n Returns the radius of this sphere.\n @return: Radius of this sphere.\n '
return self.radius<|docstring|>Returns the radius of this sphere.
@return: Radius of this sphere.<|endoftext|> |
54f1926da46b19767edc6181f4806b912eb5e5b2c020e36e9f3d34b11d4c8089 | def DataProcess(dataset):
'\n msg: 数据预处理\n param {\n dataset:pandas.DataFrame 数据集\n } \n return: None\n '
dataset_len = len(dataset)
for i in range(dataset_len):
dataset.loc[(i, 'Region')] = dataset.loc[(i, 'Region')].strip()
for j in range(2, 20):
value = d... | msg: 数据预处理
param {
dataset:pandas.DataFrame 数据集
}
return: None | ClusterHandWriting/Cluster.py | DataProcess | stepondust/AIHandWriting | 0 | python | def DataProcess(dataset):
'\n msg: 数据预处理\n param {\n dataset:pandas.DataFrame 数据集\n } \n return: None\n '
dataset_len = len(dataset)
for i in range(dataset_len):
dataset.loc[(i, 'Region')] = dataset.loc[(i, 'Region')].strip()
for j in range(2, 20):
value = d... | def DataProcess(dataset):
'\n msg: 数据预处理\n param {\n dataset:pandas.DataFrame 数据集\n } \n return: None\n '
dataset_len = len(dataset)
for i in range(dataset_len):
dataset.loc[(i, 'Region')] = dataset.loc[(i, 'Region')].strip()
for j in range(2, 20):
value = d... |
b21c78d0abb294c0fe9af92c90c18f5ac81eea30a06b2411c6e024186f02d8f2 | def oneHot(raw_dataset):
'\n msg: 使用 One-Hot 处理离散的无序属性\n param {\n raw_dataset:pandas.DataFrame 数据集\n } \n return: None\n '
dataset_len = len(raw_dataset)
regions = sorted(set(raw_dataset['Region']))
dataset = raw_dataset.drop(columns='Region')
for region in regions:
re... | msg: 使用 One-Hot 处理离散的无序属性
param {
raw_dataset:pandas.DataFrame 数据集
}
return: None | ClusterHandWriting/Cluster.py | oneHot | stepondust/AIHandWriting | 0 | python | def oneHot(raw_dataset):
'\n msg: 使用 One-Hot 处理离散的无序属性\n param {\n raw_dataset:pandas.DataFrame 数据集\n } \n return: None\n '
dataset_len = len(raw_dataset)
regions = sorted(set(raw_dataset['Region']))
dataset = raw_dataset.drop(columns='Region')
for region in regions:
re... | def oneHot(raw_dataset):
'\n msg: 使用 One-Hot 处理离散的无序属性\n param {\n raw_dataset:pandas.DataFrame 数据集\n } \n return: None\n '
dataset_len = len(raw_dataset)
regions = sorted(set(raw_dataset['Region']))
dataset = raw_dataset.drop(columns='Region')
for region in regions:
re... |
4d88c093180173fcc20df8d9d7031b1bd77b9a9b7e75cfa318c62ad3adfd6153 | def initClusters(dataset, clusters_num, seed):
'\n msg: 初始化聚类簇\n param {\n dataset:pandas.DataFrame 数据集\n clusters_num:int 簇的数量\n seed:int 随机数种子\n } \n return {\n mean_vector_dict:dict 簇均值向量字典\n }\n '
dataset_len = len(dataset)
dataset['Class'] = [(- 1) for i in... | msg: 初始化聚类簇
param {
dataset:pandas.DataFrame 数据集
clusters_num:int 簇的数量
seed:int 随机数种子
}
return {
mean_vector_dict:dict 簇均值向量字典
} | ClusterHandWriting/Cluster.py | initClusters | stepondust/AIHandWriting | 0 | python | def initClusters(dataset, clusters_num, seed):
'\n msg: 初始化聚类簇\n param {\n dataset:pandas.DataFrame 数据集\n clusters_num:int 簇的数量\n seed:int 随机数种子\n } \n return {\n mean_vector_dict:dict 簇均值向量字典\n }\n '
dataset_len = len(dataset)
dataset['Class'] = [(- 1) for i in... | def initClusters(dataset, clusters_num, seed):
'\n msg: 初始化聚类簇\n param {\n dataset:pandas.DataFrame 数据集\n clusters_num:int 簇的数量\n seed:int 随机数种子\n } \n return {\n mean_vector_dict:dict 簇均值向量字典\n }\n '
dataset_len = len(dataset)
dataset['Class'] = [(- 1) for i in... |
39533904cecb16854968f3fae2b0ac9770111f33404871d9dac51ccf49e2d1e6 | def kMeansClusters(dataset, mean_vector_dict):
'\n msg: 实现 k-means 聚类\n param {\n dataset:pandas.DataFrame 数据集\n mean_vector_dict:dict 簇均值向量字典\n } \n return: None\n '
dataset_len = len(dataset)
bar = trange(100)
for _ in bar:
bar.set_description('The clustering is ru... | msg: 实现 k-means 聚类
param {
dataset:pandas.DataFrame 数据集
mean_vector_dict:dict 簇均值向量字典
}
return: None | ClusterHandWriting/Cluster.py | kMeansClusters | stepondust/AIHandWriting | 0 | python | def kMeansClusters(dataset, mean_vector_dict):
'\n msg: 实现 k-means 聚类\n param {\n dataset:pandas.DataFrame 数据集\n mean_vector_dict:dict 簇均值向量字典\n } \n return: None\n '
dataset_len = len(dataset)
bar = trange(100)
for _ in bar:
bar.set_description('The clustering is ru... | def kMeansClusters(dataset, mean_vector_dict):
'\n msg: 实现 k-means 聚类\n param {\n dataset:pandas.DataFrame 数据集\n mean_vector_dict:dict 簇均值向量字典\n } \n return: None\n '
dataset_len = len(dataset)
bar = trange(100)
for _ in bar:
bar.set_description('The clustering is ru... |
1101644d3730b51f61d2450bf55a70267eb626c14c0a79e5db164d9576ad4f30 | def getClusters(dataset, clusters_num):
'\n msg: 提取聚类结果\n param {\n dataset:pandas.DataFrame 数据集\n clusters_num:int 簇的数量\n } \n return {\n clusters_dict:dict 键值对的值为 pandas.DataFrame 类型\n cluster_indexs_dict:dict 键值对的值为 list 类型\n cluster_countries_dict:dict 键值对的值为 list ... | msg: 提取聚类结果
param {
dataset:pandas.DataFrame 数据集
clusters_num:int 簇的数量
}
return {
clusters_dict:dict 键值对的值为 pandas.DataFrame 类型
cluster_indexs_dict:dict 键值对的值为 list 类型
cluster_countries_dict:dict 键值对的值为 list 类型
} | ClusterHandWriting/Cluster.py | getClusters | stepondust/AIHandWriting | 0 | python | def getClusters(dataset, clusters_num):
'\n msg: 提取聚类结果\n param {\n dataset:pandas.DataFrame 数据集\n clusters_num:int 簇的数量\n } \n return {\n clusters_dict:dict 键值对的值为 pandas.DataFrame 类型\n cluster_indexs_dict:dict 键值对的值为 list 类型\n cluster_countries_dict:dict 键值对的值为 list ... | def getClusters(dataset, clusters_num):
'\n msg: 提取聚类结果\n param {\n dataset:pandas.DataFrame 数据集\n clusters_num:int 簇的数量\n } \n return {\n clusters_dict:dict 键值对的值为 pandas.DataFrame 类型\n cluster_indexs_dict:dict 键值对的值为 list 类型\n cluster_countries_dict:dict 键值对的值为 list ... |
acc9a4b617cc4e261e06d69c50c90f82b994c81440ed215683435e4b9b53ff5e | def distanceMatrix(dataset, path):
'\n msg: 以字典形式构建数据集的距离矩阵\n param {\n dataset:pandas.DataFrame 数据集\n path:str 存放距离矩阵的文件,建议格式为 .json\n } \n return{\n matrix_dict:dict 字典形式的距离矩阵\n }\n '
if (not os.path.exists(path)):
dataset_len = len(dataset)
matrix_dict =... | msg: 以字典形式构建数据集的距离矩阵
param {
dataset:pandas.DataFrame 数据集
path:str 存放距离矩阵的文件,建议格式为 .json
}
return{
matrix_dict:dict 字典形式的距离矩阵
} | ClusterHandWriting/Cluster.py | distanceMatrix | stepondust/AIHandWriting | 0 | python | def distanceMatrix(dataset, path):
'\n msg: 以字典形式构建数据集的距离矩阵\n param {\n dataset:pandas.DataFrame 数据集\n path:str 存放距离矩阵的文件,建议格式为 .json\n } \n return{\n matrix_dict:dict 字典形式的距离矩阵\n }\n '
if (not os.path.exists(path)):
dataset_len = len(dataset)
matrix_dict =... | def distanceMatrix(dataset, path):
'\n msg: 以字典形式构建数据集的距离矩阵\n param {\n dataset:pandas.DataFrame 数据集\n path:str 存放距离矩阵的文件,建议格式为 .json\n } \n return{\n matrix_dict:dict 字典形式的距离矩阵\n }\n '
if (not os.path.exists(path)):
dataset_len = len(dataset)
matrix_dict =... |
5e7381fcb7283c5201d17481502bafb0ba61aa2ba4a4576dfd0cef1fd88c3caf | def silhouetteCoefficient(dataset, clusters_num, clusters_dict, cluster_indexs_dict, dist_matrix):
'\n msg: 计算数据集中所有样本的轮廓系数的平均值\n param {\n dataset:pandas.DataFrame 数据集\n clusters_num:int 簇的数量\n clusters_dict:dict 键值对的值为 pandas.DataFrame 类型\n cluster_indexs_dict:dict 键值对的值为 list 类型... | msg: 计算数据集中所有样本的轮廓系数的平均值
param {
dataset:pandas.DataFrame 数据集
clusters_num:int 簇的数量
clusters_dict:dict 键值对的值为 pandas.DataFrame 类型
cluster_indexs_dict:dict 键值对的值为 list 类型
dist_matrix:dict 字典形式的距离矩阵
}
return {
silhouette_coefficient:float 数据集中所有样本的轮廓系数的平均值
} | ClusterHandWriting/Cluster.py | silhouetteCoefficient | stepondust/AIHandWriting | 0 | python | def silhouetteCoefficient(dataset, clusters_num, clusters_dict, cluster_indexs_dict, dist_matrix):
'\n msg: 计算数据集中所有样本的轮廓系数的平均值\n param {\n dataset:pandas.DataFrame 数据集\n clusters_num:int 簇的数量\n clusters_dict:dict 键值对的值为 pandas.DataFrame 类型\n cluster_indexs_dict:dict 键值对的值为 list 类型... | def silhouetteCoefficient(dataset, clusters_num, clusters_dict, cluster_indexs_dict, dist_matrix):
'\n msg: 计算数据集中所有样本的轮廓系数的平均值\n param {\n dataset:pandas.DataFrame 数据集\n clusters_num:int 簇的数量\n clusters_dict:dict 键值对的值为 pandas.DataFrame 类型\n cluster_indexs_dict:dict 键值对的值为 list 类型... |
28a5285e3ee1432c90bed01e9db7e5ea919404302834397ee3afd471e5cba002 | @use_file_name_or_kwds
def __init__(self, grid, Pemaxg=0.35, ING=2.0, ThetaGrass=0.62, PmbGrass=0.05, Pemaxsh=0.2, ThetaShrub=0.8, PmbShrub=0.01, tpmaxShrub=600, Pemaxtr=0.25, ThetaTree=0.72, PmbTree=0.01, tpmaxTree=350, ThetaShrubSeedling=0.64, PmbShrubSeedling=0.03, tpmaxShrubSeedling=18, ThetaTreeSeedling=0.64, PmbT... | Parameters
----------
grid: RasterModelGrid
A grid.
Pemaxg: float, optional
Maximal establishment probability of grass.
ING: float, optional
Parameter to define allelopathic effect of creosote on grass.
ThetaGrass: float, optional
Drought resistance threshold of grass.
PmbGrass: float, optional
Back... | tutorials/plant_competition_ca_lb_pap.py | __init__ | ChristinaB/Observatory-1 | 7 | python | @use_file_name_or_kwds
def __init__(self, grid, Pemaxg=0.35, ING=2.0, ThetaGrass=0.62, PmbGrass=0.05, Pemaxsh=0.2, ThetaShrub=0.8, PmbShrub=0.01, tpmaxShrub=600, Pemaxtr=0.25, ThetaTree=0.72, PmbTree=0.01, tpmaxTree=350, ThetaShrubSeedling=0.64, PmbShrubSeedling=0.03, tpmaxShrubSeedling=18, ThetaTreeSeedling=0.64, PmbT... | @use_file_name_or_kwds
def __init__(self, grid, Pemaxg=0.35, ING=2.0, ThetaGrass=0.62, PmbGrass=0.05, Pemaxsh=0.2, ThetaShrub=0.8, PmbShrub=0.01, tpmaxShrub=600, Pemaxtr=0.25, ThetaTree=0.72, PmbTree=0.01, tpmaxTree=350, ThetaShrubSeedling=0.64, PmbShrubSeedling=0.03, tpmaxShrubSeedling=18, ThetaTreeSeedling=0.64, PmbT... |
ac6f51b0a29736c2c4b3fcc044607340d08c7c0e893f20e0cae8a22383d30e4c | def update(self, time_elapsed=1, edit_vegcov=False):
"\n Update fields with current loading conditions.\n\n Parameters\n ----------\n time_elapsed: int, optional\n Time elapsed - time step (years).\n edit_vegcov: bool, optional\n If edit_vegcov=True, an optio... | Update fields with current loading conditions.
Parameters
----------
time_elapsed: int, optional
Time elapsed - time step (years).
edit_vegcov: bool, optional
If edit_vegcov=True, an optional field 'vegetation__boolean_vegetated'
will be output, (i.e.) if a cell is vegetated the corresponding
cell of t... | tutorials/plant_competition_ca_lb_pap.py | update | ChristinaB/Observatory-1 | 7 | python | def update(self, time_elapsed=1, edit_vegcov=False):
"\n Update fields with current loading conditions.\n\n Parameters\n ----------\n time_elapsed: int, optional\n Time elapsed - time step (years).\n edit_vegcov: bool, optional\n If edit_vegcov=True, an optio... | def update(self, time_elapsed=1, edit_vegcov=False):
"\n Update fields with current loading conditions.\n\n Parameters\n ----------\n time_elapsed: int, optional\n Time elapsed - time step (years).\n edit_vegcov: bool, optional\n If edit_vegcov=True, an optio... |
e5842ccc3c483e0b56385ae1346e6a76079bf7c0dbebdb534903f330952eb24c | def read_single_file(file_name):
' Read in current file, rename columns, and create date_time column '
df = pd.read_csv(file_name, delim_whitespace=True)
df.rename(columns={'___e-ref(m)': 'e_ref'}, inplace=True)
df.rename(columns={'___n-ref(m)': 'n_ref'}, inplace=True)
df.rename(columns={'___v-ref(m... | Read in current file, rename columns, and create date_time column | convert_unr.py | read_single_file | brendanjmeade/rapid_gps | 2 | python | def read_single_file(file_name):
' '
df = pd.read_csv(file_name, delim_whitespace=True)
df.rename(columns={'___e-ref(m)': 'e_ref'}, inplace=True)
df.rename(columns={'___n-ref(m)': 'n_ref'}, inplace=True)
df.rename(columns={'___v-ref(m)': 'v_ref'}, inplace=True)
df.rename(columns={'_e-mean(m)': ... | def read_single_file(file_name):
' '
df = pd.read_csv(file_name, delim_whitespace=True)
df.rename(columns={'___e-ref(m)': 'e_ref'}, inplace=True)
df.rename(columns={'___n-ref(m)': 'n_ref'}, inplace=True)
df.rename(columns={'___v-ref(m)': 'v_ref'}, inplace=True)
df.rename(columns={'_e-mean(m)': ... |
387d4d37996a125d6ba5c9713a4f909a6c4d22ee84ebec8b82630d732f0ddb99 | def write_to_disk(df):
' Write latest df to disk in multiple formats '
df.to_pickle((OUTPUT_FILE_NAME + '.pkl')) | Write latest df to disk in multiple formats | convert_unr.py | write_to_disk | brendanjmeade/rapid_gps | 2 | python | def write_to_disk(df):
' '
df.to_pickle((OUTPUT_FILE_NAME + '.pkl')) | def write_to_disk(df):
' '
df.to_pickle((OUTPUT_FILE_NAME + '.pkl'))<|docstring|>Write latest df to disk in multiple formats<|endoftext|> |
4d1143a8725eecb4ec687f31eab2284ef67f0938c7a190ccc8bb77124d1b676f | def main():
' Get all valid filenames, read in each, build giant dataframe, and save to disk '
print('Globbing file names')
file_names = glob.glob((KENV_ROOT_DIR + '/**/*.kenv'), recursive=True)
print('Done globbing file names')
df_list = []
for i in range(0, len(file_names)):
try:
... | Get all valid filenames, read in each, build giant dataframe, and save to disk | convert_unr.py | main | brendanjmeade/rapid_gps | 2 | python | def main():
' '
print('Globbing file names')
file_names = glob.glob((KENV_ROOT_DIR + '/**/*.kenv'), recursive=True)
print('Done globbing file names')
df_list = []
for i in range(0, len(file_names)):
try:
print(((((str((i + 1)) + ' of ') + str(len(file_names))) + ' : ') + fil... | def main():
' '
print('Globbing file names')
file_names = glob.glob((KENV_ROOT_DIR + '/**/*.kenv'), recursive=True)
print('Done globbing file names')
df_list = []
for i in range(0, len(file_names)):
try:
print(((((str((i + 1)) + ' of ') + str(len(file_names))) + ' : ') + fil... |
4a1a76471bf620f8999a92abd4912335e1c964773a32fddccbd221f6f2a92f78 | def lambda_handler(event, context):
'Entry point for the lambda function.'
ec2 = boto3.resource('ec2', region_name=REGION)
ec2_client = boto3.client('ec2', region_name=REGION)
logger.debug('Event: {}'.format(event))
user = event['user']
ip_address = event['ip']
logger.info('Received paramete... | Entry point for the lambda function. | src/lambda_add_rule.py | lambda_handler | fvinas/lambda_ip_whitelist | 5 | python | def lambda_handler(event, context):
ec2 = boto3.resource('ec2', region_name=REGION)
ec2_client = boto3.client('ec2', region_name=REGION)
logger.debug('Event: {}'.format(event))
user = event['user']
ip_address = event['ip']
logger.info('Received parameters:')
logger.info(' - user = {}'.f... | def lambda_handler(event, context):
ec2 = boto3.resource('ec2', region_name=REGION)
ec2_client = boto3.client('ec2', region_name=REGION)
logger.debug('Event: {}'.format(event))
user = event['user']
ip_address = event['ip']
logger.info('Received parameters:')
logger.info(' - user = {}'.f... |
88e01ff4547434abd3ed966636f6942ce17ab4a853a47b798b2312ad8b8e8ee5 | def plot_logs(logs, fields=('class_error', 'loss_bbox_unscaled', 'mAP'), ewm_col=0, log_name='log.txt'):
"\n Function to plot specific fields from training log(s). Plots both training and test results.\n\n :: Inputs - logs = list containing Path objects, each pointing to individual dir with a log file\n ... | Function to plot specific fields from training log(s). Plots both training and test results.
:: Inputs - logs = list containing Path objects, each pointing to individual dir with a log file
- fields = which results to plot from each log file - plots both training and test for each field.
- ewm_col ... | util/plot_utils.py | plot_logs | Tarandro/MOTR_4 | 191 | python | def plot_logs(logs, fields=('class_error', 'loss_bbox_unscaled', 'mAP'), ewm_col=0, log_name='log.txt'):
"\n Function to plot specific fields from training log(s). Plots both training and test results.\n\n :: Inputs - logs = list containing Path objects, each pointing to individual dir with a log file\n ... | def plot_logs(logs, fields=('class_error', 'loss_bbox_unscaled', 'mAP'), ewm_col=0, log_name='log.txt'):
"\n Function to plot specific fields from training log(s). Plots both training and test results.\n\n :: Inputs - logs = list containing Path objects, each pointing to individual dir with a log file\n ... |
4e72e0254467a0a4132efe6343aed222ed9f347ed79426ebfeb078a2bfc1e327 | def from_dict(self, value: dict):
'\n The Avro Python library does not support code generation.\n For this reason we must provide conversion from dict to our class for de-serialization\n :param value: incoming message dictionary\n '
self.delegation_id = value['delegation_id']
sel... | The Avro Python library does not support code generation.
For this reason we must provide conversion from dict to our class for de-serialization
:param value: incoming message dictionary | fabric_mb/message_bus/messages/delegation_avro.py | from_dict | fabric-testbed/MessageBusSchema | 2 | python | def from_dict(self, value: dict):
'\n The Avro Python library does not support code generation.\n For this reason we must provide conversion from dict to our class for de-serialization\n :param value: incoming message dictionary\n '
self.delegation_id = value['delegation_id']
sel... | def from_dict(self, value: dict):
'\n The Avro Python library does not support code generation.\n For this reason we must provide conversion from dict to our class for de-serialization\n :param value: incoming message dictionary\n '
self.delegation_id = value['delegation_id']
sel... |
9f4cc4b92d57660fe7fbc5309a18022be1d84a2fab4e102402d58180960d41aa | def to_dict(self) -> dict:
'\n The Avro Python library does not support code generation.\n For this reason we must provide a dict representation of our class for serialization.\n :return dict representing the class\n '
if (not self.validate()):
raise MessageBusException('Inva... | The Avro Python library does not support code generation.
For this reason we must provide a dict representation of our class for serialization.
:return dict representing the class | fabric_mb/message_bus/messages/delegation_avro.py | to_dict | fabric-testbed/MessageBusSchema | 2 | python | def to_dict(self) -> dict:
'\n The Avro Python library does not support code generation.\n For this reason we must provide a dict representation of our class for serialization.\n :return dict representing the class\n '
if (not self.validate()):
raise MessageBusException('Inva... | def to_dict(self) -> dict:
'\n The Avro Python library does not support code generation.\n For this reason we must provide a dict representation of our class for serialization.\n :return dict representing the class\n '
if (not self.validate()):
raise MessageBusException('Inva... |
32d0286bb128ed1d00f85506a3808ccc5a4900ed4b5eea28bb4afddb5de7248e | def validate(self) -> bool:
'\n Check if the object is valid and contains all mandatory fields\n :return True on success; False on failure\n '
ret_val = True
if ((self.delegation_id is None) or (self.slice is None) or (self.sequence is None)):
ret_val = False
return ret_val | Check if the object is valid and contains all mandatory fields
:return True on success; False on failure | fabric_mb/message_bus/messages/delegation_avro.py | validate | fabric-testbed/MessageBusSchema | 2 | python | def validate(self) -> bool:
'\n Check if the object is valid and contains all mandatory fields\n :return True on success; False on failure\n '
ret_val = True
if ((self.delegation_id is None) or (self.slice is None) or (self.sequence is None)):
ret_val = False
return ret_val | def validate(self) -> bool:
'\n Check if the object is valid and contains all mandatory fields\n :return True on success; False on failure\n '
ret_val = True
if ((self.delegation_id is None) or (self.slice is None) or (self.sequence is None)):
ret_val = False
return ret_val<... |
3365533b23170ca995c85aee7d300038d3c1e513b0e3e7518d9e13444b361d3f | def get_delegation_id(self) -> str:
'\n Return delegation id\n '
return self.delegation_id | Return delegation id | fabric_mb/message_bus/messages/delegation_avro.py | get_delegation_id | fabric-testbed/MessageBusSchema | 2 | python | def get_delegation_id(self) -> str:
'\n \n '
return self.delegation_id | def get_delegation_id(self) -> str:
'\n \n '
return self.delegation_id<|docstring|>Return delegation id<|endoftext|> |
b5c75ea2095c5c33d884a486ada623a348ff8184b74bd83144a9a6be49a6350f | def get_slice_object(self) -> SliceAvro:
'\n Return slice object\n '
return self.slice | Return slice object | fabric_mb/message_bus/messages/delegation_avro.py | get_slice_object | fabric-testbed/MessageBusSchema | 2 | python | def get_slice_object(self) -> SliceAvro:
'\n \n '
return self.slice | def get_slice_object(self) -> SliceAvro:
'\n \n '
return self.slice<|docstring|>Return slice object<|endoftext|> |
363e516f48638cac10705af387d6f99037f5566ae74d5087ae7c06306d139a16 | def get_graph(self) -> str:
'\n Return delegation graph\n '
return self.graph | Return delegation graph | fabric_mb/message_bus/messages/delegation_avro.py | get_graph | fabric-testbed/MessageBusSchema | 2 | python | def get_graph(self) -> str:
'\n \n '
return self.graph | def get_graph(self) -> str:
'\n \n '
return self.graph<|docstring|>Return delegation graph<|endoftext|> |
65c32e38e7b503f922df0c11d71d0ab67e616d1aa2dcbaa8ba67f98582414444 | def get_sequence(self) -> int:
'\n Return sequence number\n '
return self.sequence | Return sequence number | fabric_mb/message_bus/messages/delegation_avro.py | get_sequence | fabric-testbed/MessageBusSchema | 2 | python | def get_sequence(self) -> int:
'\n \n '
return self.sequence | def get_sequence(self) -> int:
'\n \n '
return self.sequence<|docstring|>Return sequence number<|endoftext|> |
81c637472a4f5f02fd0c21bf3386b71c8b8b92f88c889261551ca27ede6f1844 | def print(self):
'\n Print on console\n '
print('')
print('Delegation ID: {} Slice ID: {}'.format(self.delegation_id, self.slice.get_slice_id()))
if (self.sequence is not None):
print('Sequence: {}'.format(self.sequence))
if (self.state is not None):
print(f'State: {sel... | Print on console | fabric_mb/message_bus/messages/delegation_avro.py | print | fabric-testbed/MessageBusSchema | 2 | python | def print(self):
'\n \n '
print()
print('Delegation ID: {} Slice ID: {}'.format(self.delegation_id, self.slice.get_slice_id()))
if (self.sequence is not None):
print('Sequence: {}'.format(self.sequence))
if (self.state is not None):
print(f'State: {self.state}')
if ... | def print(self):
'\n \n '
print()
print('Delegation ID: {} Slice ID: {}'.format(self.delegation_id, self.slice.get_slice_id()))
if (self.sequence is not None):
print('Sequence: {}'.format(self.sequence))
if (self.state is not None):
print(f'State: {self.state}')
if ... |
24eeacad0996466d2c58b1ec952c5b84ddb8b595e87436a371c3d4b7bbff8aaf | def set_verbose(self, verbose: bool) -> None:
'\n Set, if verbose message should be logged.\n ' | Set, if verbose message should be logged. | datastore/migrations/core/migration_logger.py | set_verbose | reiterl/openslides-datastore-service | 2 | python | def set_verbose(self, verbose: bool) -> None:
'\n \n ' | def set_verbose(self, verbose: bool) -> None:
'\n \n '<|docstring|>Set, if verbose message should be logged.<|endoftext|> |
430c4eccbd3231949dd41f0a249d0b00d6bf16efbebe86dae5a7f08712227067 | def info(self, message: str) -> None:
'\n Logs the message.\n ' | Logs the message. | datastore/migrations/core/migration_logger.py | info | reiterl/openslides-datastore-service | 2 | python | def info(self, message: str) -> None:
'\n \n ' | def info(self, message: str) -> None:
'\n \n '<|docstring|>Logs the message.<|endoftext|> |
a6cfeee53973b25c781ce282840edbfa053bf15b15bed9f4c450b7181a543889 | def debug(self, message: str) -> None:
'\n Logs the message, if verbose is true.\n ' | Logs the message, if verbose is true. | datastore/migrations/core/migration_logger.py | debug | reiterl/openslides-datastore-service | 2 | python | def debug(self, message: str) -> None:
'\n \n ' | def debug(self, message: str) -> None:
'\n \n '<|docstring|>Logs the message, if verbose is true.<|endoftext|> |
f5d6b8d06c32a43a223f4067e7b2885848fd66faf1e87dfdf2deeb76192db293 | def optimize(self, conf=None):
'Combine and optimize Javascript and CSS files'
if (conf is None):
conf = self.conf.get('optimize', {})
optimize(conf, self.indir, self.outdir) | Combine and optimize Javascript and CSS files | build/builder.py | optimize | heigeo/wq.app | 0 | python | def optimize(self, conf=None):
if (conf is None):
conf = self.conf.get('optimize', {})
optimize(conf, self.indir, self.outdir) | def optimize(self, conf=None):
if (conf is None):
conf = self.conf.get('optimize', {})
optimize(conf, self.indir, self.outdir)<|docstring|>Combine and optimize Javascript and CSS files<|endoftext|> |
b2e9a3b8eee90a5c89a88621ae39ab41353930a1be12302acdc51f6f9cf65a15 | def test_no_scopes():
'The credential should raise when get_token is called with no scopes'
with pytest.raises(ValueError):
InteractiveBrowserCredential().get_token() | The credential should raise when get_token is called with no scopes | sdk/identity/azure-identity/tests/test_browser_credential.py | test_no_scopes | huamichaelchen/azure-sdk-for-python | 1 | python | def test_no_scopes():
with pytest.raises(ValueError):
InteractiveBrowserCredential().get_token() | def test_no_scopes():
with pytest.raises(ValueError):
InteractiveBrowserCredential().get_token()<|docstring|>The credential should raise when get_token is called with no scopes<|endoftext|> |
c4e4bc736611d24aaafb107cecfb82094ee7dff688c8d892c701386789162d82 | def test_disable_automatic_authentication():
'When configured for strict silent auth, the credential should raise when silent auth fails'
empty_cache = TokenCache()
transport = Mock(send=Mock(side_effect=Exception('no request should be sent')))
credential = InteractiveBrowserCredential(disable_automatic... | When configured for strict silent auth, the credential should raise when silent auth fails | sdk/identity/azure-identity/tests/test_browser_credential.py | test_disable_automatic_authentication | huamichaelchen/azure-sdk-for-python | 1 | python | def test_disable_automatic_authentication():
empty_cache = TokenCache()
transport = Mock(send=Mock(side_effect=Exception('no request should be sent')))
credential = InteractiveBrowserCredential(disable_automatic_authentication=True, transport=transport, _cache=empty_cache)
with patch(WEBBROWSER_OPE... | def test_disable_automatic_authentication():
empty_cache = TokenCache()
transport = Mock(send=Mock(side_effect=Exception('no request should be sent')))
credential = InteractiveBrowserCredential(disable_automatic_authentication=True, transport=transport, _cache=empty_cache)
with patch(WEBBROWSER_OPE... |
06f81d3604c2c7718be48178acb3d9070d9f50425f1ec2a6665c60ef24ecaa01 | def test_cannot_bind_port():
"get_token should raise CredentialUnavailableError when the redirect listener can't bind a port"
credential = InteractiveBrowserCredential(server_class=Mock(side_effect=socket.error))
with pytest.raises(CredentialUnavailableError):
credential.get_token('scope') | get_token should raise CredentialUnavailableError when the redirect listener can't bind a port | sdk/identity/azure-identity/tests/test_browser_credential.py | test_cannot_bind_port | huamichaelchen/azure-sdk-for-python | 1 | python | def test_cannot_bind_port():
credential = InteractiveBrowserCredential(server_class=Mock(side_effect=socket.error))
with pytest.raises(CredentialUnavailableError):
credential.get_token('scope') | def test_cannot_bind_port():
credential = InteractiveBrowserCredential(server_class=Mock(side_effect=socket.error))
with pytest.raises(CredentialUnavailableError):
credential.get_token('scope')<|docstring|>get_token should raise CredentialUnavailableError when the redirect listener can't bind a por... |
43d2a52eb2fc58ae0314888540caa423965fbcd62ce755ac9d2c81cc761c2deb | def __init__(self, confirmation_key, access_token, group_id, secret_key=None):
' Constructor '
self.__message_handlers = []
self.__payload_handlers = []
self.__next_step_handlers = []
self.secret_key = secret_key
self.confirmation_key = confirmation_key
self.access_token = access_token
s... | Constructor | vkbot/__init__.py | __init__ | KH9IZ/PyVkBotAPI | 0 | python | def __init__(self, confirmation_key, access_token, group_id, secret_key=None):
' '
self.__message_handlers = []
self.__payload_handlers = []
self.__next_step_handlers = []
self.secret_key = secret_key
self.confirmation_key = confirmation_key
self.access_token = access_token
self.api_ver... | def __init__(self, confirmation_key, access_token, group_id, secret_key=None):
' '
self.__message_handlers = []
self.__payload_handlers = []
self.__next_step_handlers = []
self.secret_key = secret_key
self.confirmation_key = confirmation_key
self.access_token = access_token
self.api_ver... |
f7c33340f9315d7d95131a87d5db6a4f54554698347c3dca71ee0097043f4198 | def postorderTraversal(self, root):
'\n :type root: TreeNode\n :rtype: List[int]\n '
res = []
self.iterative(root, res)
return res | :type root: TreeNode
:rtype: List[int] | 101-150/145.py | postorderTraversal | yshshadow/Leetcode | 0 | python | def postorderTraversal(self, root):
'\n :type root: TreeNode\n :rtype: List[int]\n '
res = []
self.iterative(root, res)
return res | def postorderTraversal(self, root):
'\n :type root: TreeNode\n :rtype: List[int]\n '
res = []
self.iterative(root, res)
return res<|docstring|>:type root: TreeNode
:rtype: List[int]<|endoftext|> |
b49dde729ed46bb5b34a5f8928ad459bf1e4860db35d3fbf0b997c2534c734ab | def test_write_subregion_calls_fields(self):
'Check that writing a subregion to file calls the field functions\n with each key and that any extra arguments are passed along.\n '
keys = [(Signal(BitField(32)), {}) for _ in range(10)]
fields = [mock.Mock() for _ in range(2)]
fields[0].return... | Check that writing a subregion to file calls the field functions
with each key and that any extra arguments are passed along. | tests/regions/test_keyspace_region.py | test_write_subregion_calls_fields | SpiNNakerManchester/nengo_spinnaker | 13 | python | def test_write_subregion_calls_fields(self):
'Check that writing a subregion to file calls the field functions\n with each key and that any extra arguments are passed along.\n '
keys = [(Signal(BitField(32)), {}) for _ in range(10)]
fields = [mock.Mock() for _ in range(2)]
fields[0].return... | def test_write_subregion_calls_fields(self):
'Check that writing a subregion to file calls the field functions\n with each key and that any extra arguments are passed along.\n '
keys = [(Signal(BitField(32)), {}) for _ in range(10)]
fields = [mock.Mock() for _ in range(2)]
fields[0].return... |
75ffedbefd08b1ebf1b7d4416b6984cd8aef1ffe85a8f0f26aa0d9d07dd850c5 | def test_write_subregion_simple(self, ks):
'A simple test that ensures the appropriate keyspace data is written\n out.'
keyspaces = [(Signal(ks), dict(x=1, y=1, p=31)), (Signal(ks(x=3, y=7, p=2)), {})]
kf = KeyField(maps={'c': 'c'})
mf = MaskField(tag='routing')
r = KeyspacesRegion(keyspaces,... | A simple test that ensures the appropriate keyspace data is written
out. | tests/regions/test_keyspace_region.py | test_write_subregion_simple | SpiNNakerManchester/nengo_spinnaker | 13 | python | def test_write_subregion_simple(self, ks):
'A simple test that ensures the appropriate keyspace data is written\n out.'
keyspaces = [(Signal(ks), dict(x=1, y=1, p=31)), (Signal(ks(x=3, y=7, p=2)), {})]
kf = KeyField(maps={'c': 'c'})
mf = MaskField(tag='routing')
r = KeyspacesRegion(keyspaces,... | def test_write_subregion_simple(self, ks):
'A simple test that ensures the appropriate keyspace data is written\n out.'
keyspaces = [(Signal(ks), dict(x=1, y=1, p=31)), (Signal(ks(x=3, y=7, p=2)), {})]
kf = KeyField(maps={'c': 'c'})
mf = MaskField(tag='routing')
r = KeyspacesRegion(keyspaces,... |
084faaf7e84ea61511ce8342b455a895e36091f05ad4deb443c5d8caa9b069eb | def test_key_no_fills(self, ks):
'Check the key field when no key fields require filling in.'
k = ks(x=1, y=2, p=17, c=33)
kf = KeyField()
assert (kf(k, subvertex_index=3, spam=4) == k.get_value()) | Check the key field when no key fields require filling in. | tests/regions/test_keyspace_region.py | test_key_no_fills | SpiNNakerManchester/nengo_spinnaker | 13 | python | def test_key_no_fills(self, ks):
k = ks(x=1, y=2, p=17, c=33)
kf = KeyField()
assert (kf(k, subvertex_index=3, spam=4) == k.get_value()) | def test_key_no_fills(self, ks):
k = ks(x=1, y=2, p=17, c=33)
kf = KeyField()
assert (kf(k, subvertex_index=3, spam=4) == k.get_value())<|docstring|>Check the key field when no key fields require filling in.<|endoftext|> |
8ed366d97f54b2e986ecf4e7e3e253bbc01f448e06f36619444a6f9ebe411c18 | def test_key_single_fill(self, ks):
'Check the key field when no key fields require filling in.'
k = ks(x=3, y=6, c=7)
kf = KeyField(maps={'subvertex_index': 'p'})
assert (kf(k, subvertex_index=3, spam=4) == k(p=3).get_value()) | Check the key field when no key fields require filling in. | tests/regions/test_keyspace_region.py | test_key_single_fill | SpiNNakerManchester/nengo_spinnaker | 13 | python | def test_key_single_fill(self, ks):
k = ks(x=3, y=6, c=7)
kf = KeyField(maps={'subvertex_index': 'p'})
assert (kf(k, subvertex_index=3, spam=4) == k(p=3).get_value()) | def test_key_single_fill(self, ks):
k = ks(x=3, y=6, c=7)
kf = KeyField(maps={'subvertex_index': 'p'})
assert (kf(k, subvertex_index=3, spam=4) == k(p=3).get_value())<|docstring|>Check the key field when no key fields require filling in.<|endoftext|> |
e9bb763f985d19ba97b190ce4f5960d581dffe4424822b3e5ad3e34f3ba51328 | def test_key_multiple(self, ks):
'Check the key field when no key fields require filling in.'
k = ks(x=3, c=7)
kf = KeyField(maps={'subvertex_index': 'p', 'spam': 'y'})
assert (kf(k, subvertex_index=3, spam=4) == k(y=4, p=3).get_value()) | Check the key field when no key fields require filling in. | tests/regions/test_keyspace_region.py | test_key_multiple | SpiNNakerManchester/nengo_spinnaker | 13 | python | def test_key_multiple(self, ks):
k = ks(x=3, c=7)
kf = KeyField(maps={'subvertex_index': 'p', 'spam': 'y'})
assert (kf(k, subvertex_index=3, spam=4) == k(y=4, p=3).get_value()) | def test_key_multiple(self, ks):
k = ks(x=3, c=7)
kf = KeyField(maps={'subvertex_index': 'p', 'spam': 'y'})
assert (kf(k, subvertex_index=3, spam=4) == k(y=4, p=3).get_value())<|docstring|>Check the key field when no key fields require filling in.<|endoftext|> |
b550bd0d3b6acb64c013fef11c71e9b4bf1288f8c396c522b2f8c7deacf99aed | def get_start_time(self):
'Start time of the model.\n\n Model times should be of type float. The default model start\n time is 0.\n\n Returns\n -------\n float\n The model start time.\n\n Notes\n -----\n .. code-block:: c\n\n /* C */\n ... | Start time of the model.
Model times should be of type float. The default model start
time is 0.
Returns
-------
float
The model start time.
Notes
-----
.. code-block:: c
/* C */
int get_start_time(void * self, double * time); | basic_modeling_interface/time.py | get_start_time | bmi-forum/bmi-python | 1 | python | def get_start_time(self):
'Start time of the model.\n\n Model times should be of type float. The default model start\n time is 0.\n\n Returns\n -------\n float\n The model start time.\n\n Notes\n -----\n .. code-block:: c\n\n /* C */\n ... | def get_start_time(self):
'Start time of the model.\n\n Model times should be of type float. The default model start\n time is 0.\n\n Returns\n -------\n float\n The model start time.\n\n Notes\n -----\n .. code-block:: c\n\n /* C */\n ... |
b83b971869a8a6b398940804a622624fc4f7bc1a496e311b76ced7191aac20c9 | def get_current_time(self):
'Current time of the model.\n\n Returns\n -------\n float\n The current model time.\n\n See Also\n --------\n get_start_time\n\n Notes\n -----\n .. code-block:: c\n\n /* C */\n int get_current_t... | Current time of the model.
Returns
-------
float
The current model time.
See Also
--------
get_start_time
Notes
-----
.. code-block:: c
/* C */
int get_current_time(void * self, double * time); | basic_modeling_interface/time.py | get_current_time | bmi-forum/bmi-python | 1 | python | def get_current_time(self):
'Current time of the model.\n\n Returns\n -------\n float\n The current model time.\n\n See Also\n --------\n get_start_time\n\n Notes\n -----\n .. code-block:: c\n\n /* C */\n int get_current_t... | def get_current_time(self):
'Current time of the model.\n\n Returns\n -------\n float\n The current model time.\n\n See Also\n --------\n get_start_time\n\n Notes\n -----\n .. code-block:: c\n\n /* C */\n int get_current_t... |
fa2e61831a9daf28221cfdcff2ae20c63a6e40445c6039a16ac013b3344e3b6a | def get_end_time(self):
'End time of the model.\n\n Returns\n -------\n float\n The maximum model time.\n\n See Also\n --------\n get_start_time\n\n Notes\n -----\n .. code-block:: c\n\n /* C */\n int get_end_time(void * s... | End time of the model.
Returns
-------
float
The maximum model time.
See Also
--------
get_start_time
Notes
-----
.. code-block:: c
/* C */
int get_end_time(void * self, double * time); | basic_modeling_interface/time.py | get_end_time | bmi-forum/bmi-python | 1 | python | def get_end_time(self):
'End time of the model.\n\n Returns\n -------\n float\n The maximum model time.\n\n See Also\n --------\n get_start_time\n\n Notes\n -----\n .. code-block:: c\n\n /* C */\n int get_end_time(void * s... | def get_end_time(self):
'End time of the model.\n\n Returns\n -------\n float\n The maximum model time.\n\n See Also\n --------\n get_start_time\n\n Notes\n -----\n .. code-block:: c\n\n /* C */\n int get_end_time(void * s... |
b9d5b571092951aee9150ff1bc8b01847c0d5ce81d6cdb062073ad3a2ee7abd0 | def get_time_step(self):
'Current time step of the model.\n\n The model time step should be of type float. The default time\n step is 1.0.\n\n Returns\n -------\n float\n The time step used in model.\n\n Notes\n -----\n .. code-block:: c\n\n ... | Current time step of the model.
The model time step should be of type float. The default time
step is 1.0.
Returns
-------
float
The time step used in model.
Notes
-----
.. code-block:: c
/* C */
int get_time_step(void * self, double * dt); | basic_modeling_interface/time.py | get_time_step | bmi-forum/bmi-python | 1 | python | def get_time_step(self):
'Current time step of the model.\n\n The model time step should be of type float. The default time\n step is 1.0.\n\n Returns\n -------\n float\n The time step used in model.\n\n Notes\n -----\n .. code-block:: c\n\n ... | def get_time_step(self):
'Current time step of the model.\n\n The model time step should be of type float. The default time\n step is 1.0.\n\n Returns\n -------\n float\n The time step used in model.\n\n Notes\n -----\n .. code-block:: c\n\n ... |
ad0e79878f4d63003511005c93cfc8b7a65c23fca90692a9af61c5fa2e7907f7 | def get_time_units(self):
'Time units of the model.\n\n Returns\n -------\n float\n The model time unit; e.g., `days` or `s`.\n\n Notes\n -----\n CSDMS uses the UDUNITS standard from Unidata.\n\n .. code-block:: c\n\n /* C */\n int get_... | Time units of the model.
Returns
-------
float
The model time unit; e.g., `days` or `s`.
Notes
-----
CSDMS uses the UDUNITS standard from Unidata.
.. code-block:: c
/* C */
int get_time_units(void * self, char * units); | basic_modeling_interface/time.py | get_time_units | bmi-forum/bmi-python | 1 | python | def get_time_units(self):
'Time units of the model.\n\n Returns\n -------\n float\n The model time unit; e.g., `days` or `s`.\n\n Notes\n -----\n CSDMS uses the UDUNITS standard from Unidata.\n\n .. code-block:: c\n\n /* C */\n int get_... | def get_time_units(self):
'Time units of the model.\n\n Returns\n -------\n float\n The model time unit; e.g., `days` or `s`.\n\n Notes\n -----\n CSDMS uses the UDUNITS standard from Unidata.\n\n .. code-block:: c\n\n /* C */\n int get_... |
3965ae208161a001b1f7596a0fd93e7c38380a6cdfe4a4fb87101bc91d182a63 | def synthetic(n, categorical=[], continuous=[]):
'Synthetic dataset.\n\n For each element in ``categorical``, either 0 or 1 is generated randomly.\n Similarly, for each element in ``continuous``, a random value between 0 and\n 100 is generated.\n\n Parameters\n ----------\n n: int\n Number ... | Synthetic dataset.
For each element in ``categorical``, either 0 or 1 is generated randomly.
Similarly, for each element in ``continuous``, a random value between 0 and
100 is generated.
Parameters
----------
n: int
Number of people
categorical: iterable(str), optional
Categorical properties, e.g. gender, cou... | teambuilder/util/util.py | synthetic | marijanbeg/teambuilder | 0 | python | def synthetic(n, categorical=[], continuous=[]):
'Synthetic dataset.\n\n For each element in ``categorical``, either 0 or 1 is generated randomly.\n Similarly, for each element in ``continuous``, a random value between 0 and\n 100 is generated.\n\n Parameters\n ----------\n n: int\n Number ... | def synthetic(n, categorical=[], continuous=[]):
'Synthetic dataset.\n\n For each element in ``categorical``, either 0 or 1 is generated randomly.\n Similarly, for each element in ``continuous``, a random value between 0 and\n 100 is generated.\n\n Parameters\n ----------\n n: int\n Number ... |
f1eedf1a406167aa8f4a787bf8c5b3d2ecb9c2c590560cdbfc5f9dbd6f1b879b | @property
def rv_Arn(self) -> GetAtt:
'Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssmcontacts-contact.html#aws-resource-ssmcontacts-contact-return-values'
return GetAtt(resource=self, attr_name='Arn') | Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssmcontacts-contact.html#aws-resource-ssmcontacts-contact-return-values | cottonformation/res/ssmcontacts.py | rv_Arn | MacHu-GWU/cottonformation-project | 5 | python | @property
def rv_Arn(self) -> GetAtt:
return GetAtt(resource=self, attr_name='Arn') | @property
def rv_Arn(self) -> GetAtt:
return GetAtt(resource=self, attr_name='Arn')<|docstring|>Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssmcontacts-contact.html#aws-resource-ssmcontacts-contact-return-values<|endoftext|> |
8378313a32ed10b987ae457cdb44ee02f54cc9bd5b04c8615c4f7b81af984227 | @property
def rv_Arn(self) -> GetAtt:
'Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssmcontacts-contactchannel.html#aws-resource-ssmcontacts-contactchannel-return-values'
return GetAtt(resource=self, attr_name='Arn') | Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssmcontacts-contactchannel.html#aws-resource-ssmcontacts-contactchannel-return-values | cottonformation/res/ssmcontacts.py | rv_Arn | MacHu-GWU/cottonformation-project | 5 | python | @property
def rv_Arn(self) -> GetAtt:
return GetAtt(resource=self, attr_name='Arn') | @property
def rv_Arn(self) -> GetAtt:
return GetAtt(resource=self, attr_name='Arn')<|docstring|>Doc: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssmcontacts-contactchannel.html#aws-resource-ssmcontacts-contactchannel-return-values<|endoftext|> |
d79a0fe401f3f64deb935584f2a7fda0a5c93d6ba02f2825502d0a7cf27d8cb5 | def set_all_default(self, **kwargs):
'\n 设置默认值\n :param kwargs:\n :return:\n '
for level in self._levels:
for (k, v) in kwargs.items():
self._default.setdefault(level.upper(), {}).update({k: v}) | 设置默认值
:param kwargs:
:return: | colour_printing/config/config.py | set_all_default | Faithforus/Colour-printing | 3 | python | def set_all_default(self, **kwargs):
'\n 设置默认值\n :param kwargs:\n :return:\n '
for level in self._levels:
for (k, v) in kwargs.items():
self._default.setdefault(level.upper(), {}).update({k: v}) | def set_all_default(self, **kwargs):
'\n 设置默认值\n :param kwargs:\n :return:\n '
for level in self._levels:
for (k, v) in kwargs.items():
self._default.setdefault(level.upper(), {}).update({k: v})<|docstring|>设置默认值
:param kwargs:
:return:<|endoftext|> |
53d19aba55fedb535d9f1098b1e37f22f845d016d4130a8b9adeaa58a8c1772a | def get_potential(self, num: int) -> float:
'Return the potential energy of replica #num.'
return self._potentials[num] | Return the potential energy of replica #num. | reform/tests/test_replica_exchange.py | get_potential | noegroup/reform | 5 | python | def get_potential(self, num: int) -> float:
return self._potentials[num] | def get_potential(self, num: int) -> float:
return self._potentials[num]<|docstring|>Return the potential energy of replica #num.<|endoftext|> |
bbf2cbe0859c984b2d41f8252ab21b1a04eaaad4bf821c5ba801b1aa40140a90 | def exchange_pair(self, pair: Tuple[(int, int)]):
'Perform exchange of the given two replicas. Scale the velocities when necessary.'
pass | Perform exchange of the given two replicas. Scale the velocities when necessary. | reform/tests/test_replica_exchange.py | exchange_pair | noegroup/reform | 5 | python | def exchange_pair(self, pair: Tuple[(int, int)]):
pass | def exchange_pair(self, pair: Tuple[(int, int)]):
pass<|docstring|>Perform exchange of the given two replicas. Scale the velocities when necessary.<|endoftext|> |
173a3a1ec82ef386b4e0997f90bd3a682b590fb1208ca012996be2a4dade7983 | def test_exchange(self):
'This is a test case where the exchange rate should be around 1/e.'
context = ExampleMultiTContext([1.0, 2.0, 4.0])
context.set_potentials([(- 2.0), 0.0, 4.0])
re = ReplicaExchange(context, proposing_mode='one_at_a_time')
for i in range(1000):
re.perform_exchange()
... | This is a test case where the exchange rate should be around 1/e. | reform/tests/test_replica_exchange.py | test_exchange | noegroup/reform | 5 | python | def test_exchange(self):
context = ExampleMultiTContext([1.0, 2.0, 4.0])
context.set_potentials([(- 2.0), 0.0, 4.0])
re = ReplicaExchange(context, proposing_mode='one_at_a_time')
for i in range(1000):
re.perform_exchange()
assert (np.abs((re.exchange_rate - (1.0 / np.e))) < 0.05), "Ther... | def test_exchange(self):
context = ExampleMultiTContext([1.0, 2.0, 4.0])
context.set_potentials([(- 2.0), 0.0, 4.0])
re = ReplicaExchange(context, proposing_mode='one_at_a_time')
for i in range(1000):
re.perform_exchange()
assert (np.abs((re.exchange_rate - (1.0 / np.e))) < 0.05), "Ther... |
b30503e07f0967d4f20a7509c4953915959ba16384dcda0a632b65c8735f7517 | def test_get_sandbox_subnet(self):
"Check that method will call network service to get sandbox vNet and will return it's subnet by given name"
network_client = MagicMock()
cloud_provider_model = MagicMock()
subnet_name = 'testsubnetname'
sandbox_subnet = MagicMock()
sandbox_subnet.name = subnet_... | Check that method will call network service to get sandbox vNet and will return it's subnet by given name | package/tests/test_cp/test_azure/test_domain/test_vm_management/test_operations/test_deploy_operation.py | test_get_sandbox_subnet | tim-spiglanin/Azure-Shell | 0 | python | def test_get_sandbox_subnet(self):
network_client = MagicMock()
cloud_provider_model = MagicMock()
subnet_name = 'testsubnetname'
sandbox_subnet = MagicMock()
sandbox_subnet.name = subnet_name
self.network_service.get_sandbox_virtual_network = MagicMock(return_value=MagicMock(subnets=[Magic... | def test_get_sandbox_subnet(self):
network_client = MagicMock()
cloud_provider_model = MagicMock()
subnet_name = 'testsubnetname'
sandbox_subnet = MagicMock()
sandbox_subnet.name = subnet_name
self.network_service.get_sandbox_virtual_network = MagicMock(return_value=MagicMock(subnets=[Magic... |
d3d3092cbcdaa40f20c097642aaec2af5df358a86810c8f4c9f6925982ccaefe | def test_get_sandbox_subnet_will_raise_no_valid_subnet_exception(self):
'Check that method will raise Exception if there is no subnet with given name under the MGMT network'
network_client = MagicMock()
cloud_provider_model = MagicMock()
subnet_name = 'testsubnetname'
self.network_service.get_sandbo... | Check that method will raise Exception if there is no subnet with given name under the MGMT network | package/tests/test_cp/test_azure/test_domain/test_vm_management/test_operations/test_deploy_operation.py | test_get_sandbox_subnet_will_raise_no_valid_subnet_exception | tim-spiglanin/Azure-Shell | 0 | python | def test_get_sandbox_subnet_will_raise_no_valid_subnet_exception(self):
network_client = MagicMock()
cloud_provider_model = MagicMock()
subnet_name = 'testsubnetname'
self.network_service.get_sandbox_virtual_network = MagicMock(return_value=MagicMock(subnets=[MagicMock(), MagicMock(), MagicMock()])... | def test_get_sandbox_subnet_will_raise_no_valid_subnet_exception(self):
network_client = MagicMock()
cloud_provider_model = MagicMock()
subnet_name = 'testsubnetname'
self.network_service.get_sandbox_virtual_network = MagicMock(return_value=MagicMock(subnets=[MagicMock(), MagicMock(), MagicMock()])... |
e829cabfa25debb9221058c1daa465488d2339a1bbc81301d3e5140f3117c93c | def test_get_public_ip_address(self):
"Check that method will use network service to get Public IP by it's name"
network_client = MagicMock()
azure_vm_deployment_model = MagicMock(add_public_ip=True)
group_name = 'testgroupname'
ip_name = 'testipname'
expected_ip_addr = '10.10.10.10'
public_... | Check that method will use network service to get Public IP by it's name | package/tests/test_cp/test_azure/test_domain/test_vm_management/test_operations/test_deploy_operation.py | test_get_public_ip_address | tim-spiglanin/Azure-Shell | 0 | python | def test_get_public_ip_address(self):
network_client = MagicMock()
azure_vm_deployment_model = MagicMock(add_public_ip=True)
group_name = 'testgroupname'
ip_name = 'testipname'
expected_ip_addr = '10.10.10.10'
public_ip = MagicMock(ip_address=expected_ip_addr)
cancellation_context = Mag... | def test_get_public_ip_address(self):
network_client = MagicMock()
azure_vm_deployment_model = MagicMock(add_public_ip=True)
group_name = 'testgroupname'
ip_name = 'testipname'
expected_ip_addr = '10.10.10.10'
public_ip = MagicMock(ip_address=expected_ip_addr)
cancellation_context = Mag... |
3f46b48691d441d8035169b299f28bf28d99595e0070ea20718d521bc3bfd15d | def test_get_public_ip_address_add_public_ip_is_false(self):
'Check that method will return None if "add_public_ip" attribute is False'
network_client = MagicMock()
azure_vm_deployment_model = MagicMock(add_public_ip=False)
group_name = 'testgroupname'
ip_name = 'testipname'
cancellation_context... | Check that method will return None if "add_public_ip" attribute is False | package/tests/test_cp/test_azure/test_domain/test_vm_management/test_operations/test_deploy_operation.py | test_get_public_ip_address_add_public_ip_is_false | tim-spiglanin/Azure-Shell | 0 | python | def test_get_public_ip_address_add_public_ip_is_false(self):
network_client = MagicMock()
azure_vm_deployment_model = MagicMock(add_public_ip=False)
group_name = 'testgroupname'
ip_name = 'testipname'
cancellation_context = MagicMock()
self.network_service.get_public_ip = MagicMock()
ip... | def test_get_public_ip_address_add_public_ip_is_false(self):
network_client = MagicMock()
azure_vm_deployment_model = MagicMock(add_public_ip=False)
group_name = 'testgroupname'
ip_name = 'testipname'
cancellation_context = MagicMock()
self.network_service.get_public_ip = MagicMock()
ip... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.