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 |
|---|---|---|---|---|---|---|---|---|---|
c0f8f62ef290d770a0f3612b243341227fd0a5d5a9e0662a9d203426c2ec4374 | def cconv2d(x, w, **kwargs):
' Performs convolution with complex inputs and weights\n\n Need to create the weights and feed to this function. If you want to have\n this done for you automatically, use :py:func:`complex_convolution`.\n\n Parameters\n ----------\n x : tf tensor\n input tensor\n ... | Performs convolution with complex inputs and weights
Need to create the weights and feed to this function. If you want to have
this done for you automatically, use :py:func:`complex_convolution`.
Parameters
----------
x : tf tensor
input tensor
w : tf tensor
weights tensor
kwargs : (key, val) pairs
Same a... | tf_ops/general.py | cconv2d | fbcotter/tf_ops | 0 | python | def cconv2d(x, w, **kwargs):
' Performs convolution with complex inputs and weights\n\n Need to create the weights and feed to this function. If you want to have\n this done for you automatically, use :py:func:`complex_convolution`.\n\n Parameters\n ----------\n x : tf tensor\n input tensor\n ... | def cconv2d(x, w, **kwargs):
' Performs convolution with complex inputs and weights\n\n Need to create the weights and feed to this function. If you want to have\n this done for you automatically, use :py:func:`complex_convolution`.\n\n Parameters\n ----------\n x : tf tensor\n input tensor\n ... |
e2c146a479e5b6329339212aa23fa19a4be1db3d54ce70b593655cbf759a7d3d | def cconv2d_transpose(y, w, output_shape, **kwargs):
' Performs transpose convolution with complex outputs and weights.\n\n Need to create the weights and feed to this function. If you want to have\n this done for you automatically, use\n :py:func:`complex_convolution_transpose`.\n\n Parameters\n ---... | Performs transpose convolution with complex outputs and weights.
Need to create the weights and feed to this function. If you want to have
this done for you automatically, use
:py:func:`complex_convolution_transpose`.
Parameters
----------
x : tf tensor
input tensor
w : tf tensor
weights tensor
kwargs : (key,... | tf_ops/general.py | cconv2d_transpose | fbcotter/tf_ops | 0 | python | def cconv2d_transpose(y, w, output_shape, **kwargs):
' Performs transpose convolution with complex outputs and weights.\n\n Need to create the weights and feed to this function. If you want to have\n this done for you automatically, use\n :py:func:`complex_convolution_transpose`.\n\n Parameters\n ---... | def cconv2d_transpose(y, w, output_shape, **kwargs):
' Performs transpose convolution with complex outputs and weights.\n\n Need to create the weights and feed to this function. If you want to have\n this done for you automatically, use\n :py:func:`complex_convolution_transpose`.\n\n Parameters\n ---... |
8fdb0d8a8df9b8152f3b3c1533834930aa7c47ed980d2790842befef8a084c14 | def separable_conv_with_pad(x, h_row, h_col, stride=1):
' Function to do spatial separable convolution.\n\n The filter weights must already be defined. It will use symmetric extension\n before convolution.\n\n Parameters\n ----------\n x : :py:class:`tf.Tensor` of shape [Batch, height, width, c]\n ... | Function to do spatial separable convolution.
The filter weights must already be defined. It will use symmetric extension
before convolution.
Parameters
----------
x : :py:class:`tf.Tensor` of shape [Batch, height, width, c]
The input variable. Should be of shape
h_row : tf tensor of shape [1, l, c_in, c_out]
... | tf_ops/general.py | separable_conv_with_pad | fbcotter/tf_ops | 0 | python | def separable_conv_with_pad(x, h_row, h_col, stride=1):
' Function to do spatial separable convolution.\n\n The filter weights must already be defined. It will use symmetric extension\n before convolution.\n\n Parameters\n ----------\n x : :py:class:`tf.Tensor` of shape [Batch, height, width, c]\n ... | def separable_conv_with_pad(x, h_row, h_col, stride=1):
' Function to do spatial separable convolution.\n\n The filter weights must already be defined. It will use symmetric extension\n before convolution.\n\n Parameters\n ----------\n x : :py:class:`tf.Tensor` of shape [Batch, height, width, c]\n ... |
c0b459b94a69d4569a72039a956877ce99e1e7952e052744e36950471885e2ae | def _get_var_name(x):
' Find the name of the variable by stripping off the scopes\n\n Notes\n -----\n A typical name will be scope1/scope2/.../name/kernel:0.\n This function serves to split off the scopes and return kernel\n '
split_colon = x.name.split(':')[0]
slash_strs = split_colon.split(... | Find the name of the variable by stripping off the scopes
Notes
-----
A typical name will be scope1/scope2/.../name/kernel:0.
This function serves to split off the scopes and return kernel | tf_ops/general.py | _get_var_name | fbcotter/tf_ops | 0 | python | def _get_var_name(x):
' Find the name of the variable by stripping off the scopes\n\n Notes\n -----\n A typical name will be scope1/scope2/.../name/kernel:0.\n This function serves to split off the scopes and return kernel\n '
split_colon = x.name.split(':')[0]
slash_strs = split_colon.split(... | def _get_var_name(x):
' Find the name of the variable by stripping off the scopes\n\n Notes\n -----\n A typical name will be scope1/scope2/.../name/kernel:0.\n This function serves to split off the scopes and return kernel\n '
split_colon = x.name.split(':')[0]
slash_strs = split_colon.split(... |
c34c5bd4aa383d5e5d5fc6b09df4758339f5b0d004a6844de49e5eb761fe2c63 | def get_static_shape_dyn_batch(x):
'Returns a tensor representing the static shape of x but keeping the batch\n unkown'
batch = tf.shape(x)[0]
static = x.get_shape()
return tf.concat([[batch], static[1:]], axis=0) | Returns a tensor representing the static shape of x but keeping the batch
unkown | tf_ops/general.py | get_static_shape_dyn_batch | fbcotter/tf_ops | 0 | python | def get_static_shape_dyn_batch(x):
'Returns a tensor representing the static shape of x but keeping the batch\n unkown'
batch = tf.shape(x)[0]
static = x.get_shape()
return tf.concat([[batch], static[1:]], axis=0) | def get_static_shape_dyn_batch(x):
'Returns a tensor representing the static shape of x but keeping the batch\n unkown'
batch = tf.shape(x)[0]
static = x.get_shape()
return tf.concat([[batch], static[1:]], axis=0)<|docstring|>Returns a tensor representing the static shape of x but keeping the batch
u... |
3d0a16b63247a21f6c1914203a23b6b7f69405195d454c13816ecf22a92f22df | def get_xavier_stddev(shape, uniform=False, factor=1.0, mode='FAN_AVG'):
"Get the correct stddev for a set of weights\n\n When initializing a deep network, it is in principle advantageous to keep\n the scale of the input variance constant, so it does not explode or diminish\n by reaching the final layer. T... | Get the correct stddev for a set of weights
When initializing a deep network, it is in principle advantageous to keep
the scale of the input variance constant, so it does not explode or diminish
by reaching the final layer. This initializer use the following formula:
.. code:: python
if mode='FAN_IN': # Count only... | tf_ops/general.py | get_xavier_stddev | fbcotter/tf_ops | 0 | python | def get_xavier_stddev(shape, uniform=False, factor=1.0, mode='FAN_AVG'):
"Get the correct stddev for a set of weights\n\n When initializing a deep network, it is in principle advantageous to keep\n the scale of the input variance constant, so it does not explode or diminish\n by reaching the final layer. T... | def get_xavier_stddev(shape, uniform=False, factor=1.0, mode='FAN_AVG'):
"Get the correct stddev for a set of weights\n\n When initializing a deep network, it is in principle advantageous to keep\n the scale of the input variance constant, so it does not explode or diminish\n by reaching the final layer. T... |
f09f2193a7cbae820ab7574ad1e81e136e966eaac4506d432745ca6cc5a7be6d | def real_reg(w, wd=0.01, norm=2):
' Apply regularization on real weights\n\n norm can be any positive float. Of course the most commonly used values\n would be 2 and 1 (for L2 and L1 regularization), but you can experiment by\n making it some value in between. A value of p returns:\n\n .. math::\n\n ... | Apply regularization on real weights
norm can be any positive float. Of course the most commonly used values
would be 2 and 1 (for L2 and L1 regularization), but you can experiment by
making it some value in between. A value of p returns:
.. math::
wd \times \sum_{i} ||w_{i}||_{p}^{p}
Parameters
----------
w : ... | tf_ops/general.py | real_reg | fbcotter/tf_ops | 0 | python | def real_reg(w, wd=0.01, norm=2):
' Apply regularization on real weights\n\n norm can be any positive float. Of course the most commonly used values\n would be 2 and 1 (for L2 and L1 regularization), but you can experiment by\n making it some value in between. A value of p returns:\n\n .. math::\n\n ... | def real_reg(w, wd=0.01, norm=2):
' Apply regularization on real weights\n\n norm can be any positive float. Of course the most commonly used values\n would be 2 and 1 (for L2 and L1 regularization), but you can experiment by\n making it some value in between. A value of p returns:\n\n .. math::\n\n ... |
a8f0e67d7e7a584ed68055acb84b608cfe2dc2a9166701803b9d4bd7743e4f09 | def complex_reg(w, wd=0.01, norm=1):
' Apply regularization on complex weights.\n\n norm can be any positive float. Of course the most commonly used values\n would be 2 and 1 (for L2 and L1 regularization), but you can experiment by\n making it some value in between. A value of p returns:\n\n .. math::\... | Apply regularization on complex weights.
norm can be any positive float. Of course the most commonly used values
would be 2 and 1 (for L2 and L1 regularization), but you can experiment by
making it some value in between. A value of p returns:
.. math::
wd \times \sum_{i} ||w_{i}||_{p}^{p}
Parameters
----------... | tf_ops/general.py | complex_reg | fbcotter/tf_ops | 0 | python | def complex_reg(w, wd=0.01, norm=1):
' Apply regularization on complex weights.\n\n norm can be any positive float. Of course the most commonly used values\n would be 2 and 1 (for L2 and L1 regularization), but you can experiment by\n making it some value in between. A value of p returns:\n\n .. math::\... | def complex_reg(w, wd=0.01, norm=1):
' Apply regularization on complex weights.\n\n norm can be any positive float. Of course the most commonly used values\n would be 2 and 1 (for L2 and L1 regularization), but you can experiment by\n making it some value in between. A value of p returns:\n\n .. math::\... |
e5aa3c837eb6559d5d55b198cc157e8f992bbb0eb40196cefe8fa6fc944dd007 | def initialise(cosmo, data, command_line):
'\n Main call to prepare the information for the NeuralNest run.\n '
varying_param_names = data.get_mcmc_parameters(['varying'])
derived_param_names = data.get_mcmc_parameters(['derived'])
if (getattr(command_line, (NN_prefix + 'sampler'), '').lower() == ... | Main call to prepare the information for the NeuralNest run. | montepython/NeuralNest.py | initialise | LBJ-Wade/montepython_public_NN | 2 | python | def initialise(cosmo, data, command_line):
'\n \n '
varying_param_names = data.get_mcmc_parameters(['varying'])
derived_param_names = data.get_mcmc_parameters(['derived'])
if (getattr(command_line, (NN_prefix + 'sampler'), ).lower() == 'nested'):
(is_flat, is_bound) = sampler.check_flat_bo... | def initialise(cosmo, data, command_line):
'\n \n '
varying_param_names = data.get_mcmc_parameters(['varying'])
derived_param_names = data.get_mcmc_parameters(['derived'])
if (getattr(command_line, (NN_prefix + 'sampler'), ).lower() == 'nested'):
(is_flat, is_bound) = sampler.check_flat_bo... |
fc3bda68117645a768a7662835eb78e86c71e507ff2aa059a29f80d74931f36e | async def async_select_program(self, call) -> None:
' Service for selecting a program '
data = call.data
appliance = self.get_appliance_from_device_id(data['device_id'])
if appliance:
program_key = data['program_key']
options = data.get('options')
(await appliance.async_select_pr... | Service for selecting a program | custom_components/home_connect_alt/services.py | async_select_program | code-echobase/home-connect-hass | 0 | python | async def async_select_program(self, call) -> None:
' '
data = call.data
appliance = self.get_appliance_from_device_id(data['device_id'])
if appliance:
program_key = data['program_key']
options = data.get('options')
(await appliance.async_select_program(key=program_key, options=... | async def async_select_program(self, call) -> None:
' '
data = call.data
appliance = self.get_appliance_from_device_id(data['device_id'])
if appliance:
program_key = data['program_key']
options = data.get('options')
(await appliance.async_select_program(key=program_key, options=... |
09dd5b6b35adbc044064d519c25d786c0edea92bc3b9cfb53eacedce7bebf5a6 | async def async_start_program(self, call) -> None:
' Service for starting the currently selected program '
data = call.data
appliance = self.get_appliance_from_device_id(data['device_id'])
if appliance:
(await appliance.async_start_program()) | Service for starting the currently selected program | custom_components/home_connect_alt/services.py | async_start_program | code-echobase/home-connect-hass | 0 | python | async def async_start_program(self, call) -> None:
' '
data = call.data
appliance = self.get_appliance_from_device_id(data['device_id'])
if appliance:
(await appliance.async_start_program()) | async def async_start_program(self, call) -> None:
' '
data = call.data
appliance = self.get_appliance_from_device_id(data['device_id'])
if appliance:
(await appliance.async_start_program())<|docstring|>Service for starting the currently selected program<|endoftext|> |
24a2f7abc9552d2251bd021d1713a0a6a6867d7399cf58f1e477c099596e5bfa | async def async_stop_program(self, call) -> None:
' Service for stopping the currently active program '
data = call.data
appliance = self.get_appliance_from_device_id(data['device_id'])
if appliance:
(await appliance.async_stop_active_program()) | Service for stopping the currently active program | custom_components/home_connect_alt/services.py | async_stop_program | code-echobase/home-connect-hass | 0 | python | async def async_stop_program(self, call) -> None:
' '
data = call.data
appliance = self.get_appliance_from_device_id(data['device_id'])
if appliance:
(await appliance.async_stop_active_program()) | async def async_stop_program(self, call) -> None:
' '
data = call.data
appliance = self.get_appliance_from_device_id(data['device_id'])
if appliance:
(await appliance.async_stop_active_program())<|docstring|>Service for stopping the currently active program<|endoftext|> |
d9af549ff94fc7f249a16e80698f68817c448e74e4c6a608f6ab9336312e08ca | def get_appliance_from_device_id(self, device_id):
' Helper function to get an appliance from the Home Assistant device_id '
device = self.dr.devices[device_id]
haId = list(device.identifiers)[0][1]
for (key, appliance) in self.homeconnect.appliances.items():
if (key.lower().replace('-', '_') ==... | Helper function to get an appliance from the Home Assistant device_id | custom_components/home_connect_alt/services.py | get_appliance_from_device_id | code-echobase/home-connect-hass | 0 | python | def get_appliance_from_device_id(self, device_id):
' '
device = self.dr.devices[device_id]
haId = list(device.identifiers)[0][1]
for (key, appliance) in self.homeconnect.appliances.items():
if (key.lower().replace('-', '_') == haId):
return appliance
return None | def get_appliance_from_device_id(self, device_id):
' '
device = self.dr.devices[device_id]
haId = list(device.identifiers)[0][1]
for (key, appliance) in self.homeconnect.appliances.items():
if (key.lower().replace('-', '_') == haId):
return appliance
return None<|docstring|>Help... |
7539d215a85dd21936d94dbd5cede58af5ca5b50d73f9753413d43829b6f80bd | def app_info(self, **kwargs):
'重写此方法'
self.name = kwargs.get('name', 'desktop')
self.desc = kwargs.get('desc', 'ctpbee桌面端')
self.icon = kwargs.get('icon', ':/icon/icon/bee_temp_grey.png')
self.versions = kwargs.get('versions', {'1.0': 'https://github.com/ctpbee/ctpbee_desktop/archive/master.zip'})
... | 重写此方法 | app/honey/applications/example.py | app_info | ctpbee/bee-box | 2 | python | def app_info(self, **kwargs):
self.name = kwargs.get('name', 'desktop')
self.desc = kwargs.get('desc', 'ctpbee桌面端')
self.icon = kwargs.get('icon', ':/icon/icon/bee_temp_grey.png')
self.versions = kwargs.get('versions', {'1.0': 'https://github.com/ctpbee/ctpbee_desktop/archive/master.zip'})
self... | def app_info(self, **kwargs):
self.name = kwargs.get('name', 'desktop')
self.desc = kwargs.get('desc', 'ctpbee桌面端')
self.icon = kwargs.get('icon', ':/icon/icon/bee_temp_grey.png')
self.versions = kwargs.get('versions', {'1.0': 'https://github.com/ctpbee/ctpbee_desktop/archive/master.zip'})
self... |
e3960fcd78c21a117b73c9968ec94adc9b215b9552db1d786f20f6ba43fd1a74 | def orthonormalise(self, n_lyap, delay):
'\n\t\tOrthonormalise separation functions (with Gram-Schmidt) and return their norms after orthogonalisation (but before normalisation).\n\t\t'
vectors = np.split(np.arange(self.n, dtype=int), (n_lyap + 1))[1:]
norms = []
for (i, vector) in enumerate(vectors):
... | Orthonormalise separation functions (with Gram-Schmidt) and return their norms after orthogonalisation (but before normalisation). | jitcdde/past.py | orthonormalise | neurophysik/jitcdde | 49 | python | def orthonormalise(self, n_lyap, delay):
'\n\t\t\n\t\t'
vectors = np.split(np.arange(self.n, dtype=int), (n_lyap + 1))[1:]
norms = []
for (i, vector) in enumerate(vectors):
for j in range(i):
sp = self.scalar_product(delay, vector, vectors[j])
self.subtract(vector, vector... | def orthonormalise(self, n_lyap, delay):
'\n\t\t\n\t\t'
vectors = np.split(np.arange(self.n, dtype=int), (n_lyap + 1))[1:]
norms = []
for (i, vector) in enumerate(vectors):
for j in range(i):
sp = self.scalar_product(delay, vector, vectors[j])
self.subtract(vector, vector... |
0f11de2211009e355dff01b3670705282405642abefed19d6506578aa047d4b7 | def remove_projections(self, delay, vectors):
'\n\t\tRemove projections of separation function to vectors and return norm after normalisation.\n\t\t'
sep_func = np.arange(self.n_basic, (2 * self.n_basic), 1, dtype=int)
assert np.all((sep_func == np.split(np.arange(self.n, dtype=int), (2 + (2 * len(vectors))... | Remove projections of separation function to vectors and return norm after normalisation. | jitcdde/past.py | remove_projections | neurophysik/jitcdde | 49 | python | def remove_projections(self, delay, vectors):
'\n\t\t\n\t\t'
sep_func = np.arange(self.n_basic, (2 * self.n_basic), 1, dtype=int)
assert np.all((sep_func == np.split(np.arange(self.n, dtype=int), (2 + (2 * len(vectors))))[1]))
assert (self.n_basic == len(sep_func))
d = (len(vectors) * 2)
def ge... | def remove_projections(self, delay, vectors):
'\n\t\t\n\t\t'
sep_func = np.arange(self.n_basic, (2 * self.n_basic), 1, dtype=int)
assert np.all((sep_func == np.split(np.arange(self.n, dtype=int), (2 + (2 * len(vectors))))[1]))
assert (self.n_basic == len(sep_func))
d = (len(vectors) * 2)
def ge... |
b5c2cd2ec3c08d2ee3be4106c0ed9193819714f9f8d7419b9e806f4319081589 | def normalise_indices(self, delay):
'\n\t\tNormalise the separation function of the tangent indices and return the norm (before normalisation).\n\t\t'
norm = self.norm(delay, self.tangent_indices)
if (norm > NORM_THRESHOLD):
self.scale(self.tangent_indices, (1.0 / norm))
return norm | Normalise the separation function of the tangent indices and return the norm (before normalisation). | jitcdde/past.py | normalise_indices | neurophysik/jitcdde | 49 | python | def normalise_indices(self, delay):
'\n\t\t\n\t\t'
norm = self.norm(delay, self.tangent_indices)
if (norm > NORM_THRESHOLD):
self.scale(self.tangent_indices, (1.0 / norm))
return norm | def normalise_indices(self, delay):
'\n\t\t\n\t\t'
norm = self.norm(delay, self.tangent_indices)
if (norm > NORM_THRESHOLD):
self.scale(self.tangent_indices, (1.0 / norm))
return norm<|docstring|>Normalise the separation function of the tangent indices and return the norm (before normalisation).... |
38ed7f66c861906d2b3ac85a14ffeb42eddc3630c59bf23b73c4df0c6a9541e9 | def test_obtain_read_lock_with_no_existing_locks(self):
' Test that a lock can be obtained when no locks exist '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T1, x2)')
self.assertEquals(instruction.variable_identifier, 'x2')
variable = self.data_manager... | Test that a lock can be obtained when no locks exist | tests/test_data_manager.py | test_obtain_read_lock_with_no_existing_locks | cfnyu/distributed_db | 0 | python | def test_obtain_read_lock_with_no_existing_locks(self):
' '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T1, x2)')
self.assertEquals(instruction.variable_identifier, 'x2')
variable = self.data_manager.variables['x2']
self.assertTrue(variable.readab... | def test_obtain_read_lock_with_no_existing_locks(self):
' '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T1, x2)')
self.assertEquals(instruction.variable_identifier, 'x2')
variable = self.data_manager.variables['x2']
self.assertTrue(variable.readab... |
4d9853b808ad373c96ab8bf168b875956a6512681bed88a85aef0e75db72b0e5 | def test_obtain_read_lock_with_existing_locks(self):
' Test that a lock can be obtained when other locks exist '
dummy_tran = Transaction('T3', TransactionType.READ_WRITE, 1)
dummy_var = Variable(1, 4)
dummy_var1 = Variable(1, 6)
self.data_manager.locks['x4'] = [Lock(LockType.READ, dummy_tran, dummy... | Test that a lock can be obtained when other locks exist | tests/test_data_manager.py | test_obtain_read_lock_with_existing_locks | cfnyu/distributed_db | 0 | python | def test_obtain_read_lock_with_existing_locks(self):
' '
dummy_tran = Transaction('T3', TransactionType.READ_WRITE, 1)
dummy_var = Variable(1, 4)
dummy_var1 = Variable(1, 6)
self.data_manager.locks['x4'] = [Lock(LockType.READ, dummy_tran, dummy_var)]
self.data_manager.locks['x6'] = [Lock(LockTy... | def test_obtain_read_lock_with_existing_locks(self):
' '
dummy_tran = Transaction('T3', TransactionType.READ_WRITE, 1)
dummy_var = Variable(1, 4)
dummy_var1 = Variable(1, 6)
self.data_manager.locks['x4'] = [Lock(LockType.READ, dummy_tran, dummy_var)]
self.data_manager.locks['x6'] = [Lock(LockTy... |
219c9d0634d66402f3404d26a81096a13fedb9be2e2f5f1a9dadb9f7205be7fa | def test_obtain_read_lock_when_variable_unreadable(self):
' Test that a lock cannot be obtained when the Variable Readable is set to False '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T1, x2)')
variable = self.data_manager.variables['x2']
variable.rea... | Test that a lock cannot be obtained when the Variable Readable is set to False | tests/test_data_manager.py | test_obtain_read_lock_when_variable_unreadable | cfnyu/distributed_db | 0 | python | def test_obtain_read_lock_when_variable_unreadable(self):
' '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T1, x2)')
variable = self.data_manager.variables['x2']
variable.readable = False
self.data_manager.variables['x2'] = variable
self.assert... | def test_obtain_read_lock_when_variable_unreadable(self):
' '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T1, x2)')
variable = self.data_manager.variables['x2']
variable.readable = False
self.data_manager.variables['x2'] = variable
self.assert... |
c2644c0a6d43237c2266537b2921d26b44e3d1117add4fdc6b927059cf78de9f | def test_obtain_read_lock_with_ro_transaction(self):
' Test that a lock can be obtained when the Transaction Is Read-Only '
transaction = Transaction('T1', TransactionType.READ_ONLY, 1)
instruction = Instruction('R(T1, x2)')
self.assertTrue((transaction.transaction_type == TransactionType.READ_ONLY))
... | Test that a lock can be obtained when the Transaction Is Read-Only | tests/test_data_manager.py | test_obtain_read_lock_with_ro_transaction | cfnyu/distributed_db | 0 | python | def test_obtain_read_lock_with_ro_transaction(self):
' '
transaction = Transaction('T1', TransactionType.READ_ONLY, 1)
instruction = Instruction('R(T1, x2)')
self.assertTrue((transaction.transaction_type == TransactionType.READ_ONLY))
self.assertTrue(self.data_manager.obtain_read_lock(transaction, ... | def test_obtain_read_lock_with_ro_transaction(self):
' '
transaction = Transaction('T1', TransactionType.READ_ONLY, 1)
instruction = Instruction('R(T1, x2)')
self.assertTrue((transaction.transaction_type == TransactionType.READ_ONLY))
self.assertTrue(self.data_manager.obtain_read_lock(transaction, ... |
252f82fe740ad96e5adc102f011afbdcece183ac81aa911eba6562b68466a644 | def test_obtain_read_lock_with_existing_read_lock(self):
' Test that a lock cannot be obtained when another Transaction has a lock '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T1, x2)')
self.assertTrue(self.data_manager.obtain_read_lock(transaction, instr... | Test that a lock cannot be obtained when another Transaction has a lock | tests/test_data_manager.py | test_obtain_read_lock_with_existing_read_lock | cfnyu/distributed_db | 0 | python | def test_obtain_read_lock_with_existing_read_lock(self):
' '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T1, x2)')
self.assertTrue(self.data_manager.obtain_read_lock(transaction, instruction))
new_lock = self.data_manager.locks['x2'][0]
self.asser... | def test_obtain_read_lock_with_existing_read_lock(self):
' '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T1, x2)')
self.assertTrue(self.data_manager.obtain_read_lock(transaction, instruction))
new_lock = self.data_manager.locks['x2'][0]
self.asser... |
6fd5612cd9a5bb6f6a7996c5992f8b7afdf9c421cb85268785468a611bbd80a6 | def test_obtain_read_lock_with_existing_write_lock(self):
' Test that a lock cannot be obtained when another Transaction has a lock '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('W(T1,x2, 103)')
self.data_manager.obtain_write_lock(instruction, transaction)
... | Test that a lock cannot be obtained when another Transaction has a lock | tests/test_data_manager.py | test_obtain_read_lock_with_existing_write_lock | cfnyu/distributed_db | 0 | python | def test_obtain_read_lock_with_existing_write_lock(self):
' '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('W(T1,x2, 103)')
self.data_manager.obtain_write_lock(instruction, transaction)
transaction = Transaction('T2', TransactionType.READ_WRITE, 1)
in... | def test_obtain_read_lock_with_existing_write_lock(self):
' '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('W(T1,x2, 103)')
self.data_manager.obtain_write_lock(instruction, transaction)
transaction = Transaction('T2', TransactionType.READ_WRITE, 1)
in... |
db44160bf950dd3d3415671fcdee94afff7c5cfed2c59ed5c8e742b8f3249138 | def test_obtain_read_lock_when_trans_has_exiting_lock(self):
' Test that a lock can be obtained when same Transaction requests the same lock '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T2, x2)')
self.assertTrue(self.data_manager.obtain_read_lock(transact... | Test that a lock can be obtained when same Transaction requests the same lock | tests/test_data_manager.py | test_obtain_read_lock_when_trans_has_exiting_lock | cfnyu/distributed_db | 0 | python | def test_obtain_read_lock_when_trans_has_exiting_lock(self):
' '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T2, x2)')
self.assertTrue(self.data_manager.obtain_read_lock(transaction, instruction))
self.assertTrue(('x2' in self.data_manager.locks))
... | def test_obtain_read_lock_when_trans_has_exiting_lock(self):
' '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T2, x2)')
self.assertTrue(self.data_manager.obtain_read_lock(transaction, instruction))
self.assertTrue(('x2' in self.data_manager.locks))
... |
c04f437d9c1065bbce8f7e87d49b5e917d6d6a1bfb355f52ec53cdfac9be0503 | def test_read_with_no_locks(self):
' Test the read method, which should return the last committed value '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T1, x2)')
self.assertEquals(self.data_manager.read(transaction, instruction), '20') | Test the read method, which should return the last committed value | tests/test_data_manager.py | test_read_with_no_locks | cfnyu/distributed_db | 0 | python | def test_read_with_no_locks(self):
' '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T1, x2)')
self.assertEquals(self.data_manager.read(transaction, instruction), '20') | def test_read_with_no_locks(self):
' '
transaction = Transaction('T1', TransactionType.READ_WRITE, 1)
instruction = Instruction('R(T1, x2)')
self.assertEquals(self.data_manager.read(transaction, instruction), '20')<|docstring|>Test the read method, which should return the last committed value<|endoftex... |
344a6db131e9468fbf7b1ffcba2089d5b5fc86b1b926a0bb86733bce6337346c | def test_entries_maintains_values_per_transaction(self):
' Ensure that entities is keeping the log of committed values per transaction '
self.assertEquals(self.data_manager.variables['x6'].value, '60')
self.data_manager.write_new_data(2, 'x6', 999, 'T1')
self.assertEquals(self.data_manager.variables['x6... | Ensure that entities is keeping the log of committed values per transaction | tests/test_data_manager.py | test_entries_maintains_values_per_transaction | cfnyu/distributed_db | 0 | python | def test_entries_maintains_values_per_transaction(self):
' '
self.assertEquals(self.data_manager.variables['x6'].value, '60')
self.data_manager.write_new_data(2, 'x6', 999, 'T1')
self.assertEquals(self.data_manager.variables['x6'].value, '60')
self.assertEquals(self.data_manager.entries['T1']['x6']... | def test_entries_maintains_values_per_transaction(self):
' '
self.assertEquals(self.data_manager.variables['x6'].value, '60')
self.data_manager.write_new_data(2, 'x6', 999, 'T1')
self.assertEquals(self.data_manager.variables['x6'].value, '60')
self.assertEquals(self.data_manager.entries['T1']['x6']... |
a947e01e27bf9a62eccfa9c189e1ecf18023a9bf10337c7c58c84ba5d220d5be | def _get_serdesmode(self):
'\n Getter method for serdesmode, mapped from YANG variable /sfm_state/serdesmode/serdesmode (uint32)\n\n YANG Description: SFM Serdes Mode\n '
return self.__serdesmode | Getter method for serdesmode, mapped from YANG variable /sfm_state/serdesmode/serdesmode (uint32)
YANG Description: SFM Serdes Mode | pybind/slxos/v16r_1_00b/sfm_state/serdesmode/__init__.py | _get_serdesmode | shivharis/pybind | 0 | python | def _get_serdesmode(self):
'\n Getter method for serdesmode, mapped from YANG variable /sfm_state/serdesmode/serdesmode (uint32)\n\n YANG Description: SFM Serdes Mode\n '
return self.__serdesmode | def _get_serdesmode(self):
'\n Getter method for serdesmode, mapped from YANG variable /sfm_state/serdesmode/serdesmode (uint32)\n\n YANG Description: SFM Serdes Mode\n '
return self.__serdesmode<|docstring|>Getter method for serdesmode, mapped from YANG variable /sfm_state/serdesmode/serdesmode (uint3... |
099e26b8f59c84f45a6eaba86b3ed5a672bc8afdc668fe0c626413af1481fcae | def _set_serdesmode(self, v, load=False):
'\n Setter method for serdesmode, mapped from YANG variable /sfm_state/serdesmode/serdesmode (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_serdesmode is considered as a private\n method. Backends looking to populat... | Setter method for serdesmode, mapped from YANG variable /sfm_state/serdesmode/serdesmode (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_serdesmode is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_serdesmode() d... | pybind/slxos/v16r_1_00b/sfm_state/serdesmode/__init__.py | _set_serdesmode | shivharis/pybind | 0 | python | def _set_serdesmode(self, v, load=False):
'\n Setter method for serdesmode, mapped from YANG variable /sfm_state/serdesmode/serdesmode (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_serdesmode is considered as a private\n method. Backends looking to populat... | def _set_serdesmode(self, v, load=False):
'\n Setter method for serdesmode, mapped from YANG variable /sfm_state/serdesmode/serdesmode (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_serdesmode is considered as a private\n method. Backends looking to populat... |
e0d872c4e11aedb913163dcfaab8f4914a605d6e0fd33d588f3fb659dcf033f1 | def _get_serdesmode_sfmid(self):
'\n Getter method for serdesmode_sfmid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_sfmid (uint32)\n\n YANG Description: SFM Serdes Mode\n '
return self.__serdesmode_sfmid | Getter method for serdesmode_sfmid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_sfmid (uint32)
YANG Description: SFM Serdes Mode | pybind/slxos/v16r_1_00b/sfm_state/serdesmode/__init__.py | _get_serdesmode_sfmid | shivharis/pybind | 0 | python | def _get_serdesmode_sfmid(self):
'\n Getter method for serdesmode_sfmid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_sfmid (uint32)\n\n YANG Description: SFM Serdes Mode\n '
return self.__serdesmode_sfmid | def _get_serdesmode_sfmid(self):
'\n Getter method for serdesmode_sfmid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_sfmid (uint32)\n\n YANG Description: SFM Serdes Mode\n '
return self.__serdesmode_sfmid<|docstring|>Getter method for serdesmode_sfmid, mapped from YANG variable /sfm_stat... |
45c1de1e0de9973aa45d415ea50639c49aa7cb683ded32675c8e5bbb0f20a7cc | def _set_serdesmode_sfmid(self, v, load=False):
'\n Setter method for serdesmode_sfmid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_sfmid (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_serdesmode_sfmid is considered as a private\n method. Bac... | Setter method for serdesmode_sfmid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_sfmid (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_serdesmode_sfmid is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._... | pybind/slxos/v16r_1_00b/sfm_state/serdesmode/__init__.py | _set_serdesmode_sfmid | shivharis/pybind | 0 | python | def _set_serdesmode_sfmid(self, v, load=False):
'\n Setter method for serdesmode_sfmid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_sfmid (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_serdesmode_sfmid is considered as a private\n method. Bac... | def _set_serdesmode_sfmid(self, v, load=False):
'\n Setter method for serdesmode_sfmid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_sfmid (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_serdesmode_sfmid is considered as a private\n method. Bac... |
973d585b61ab169ff9cb5198656127317b25e1f293824227acac73302b268e41 | def _get_serdesmode_feid(self):
'\n Getter method for serdesmode_feid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_feid (uint32)\n\n YANG Description: SFM Serdes Mode\n '
return self.__serdesmode_feid | Getter method for serdesmode_feid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_feid (uint32)
YANG Description: SFM Serdes Mode | pybind/slxos/v16r_1_00b/sfm_state/serdesmode/__init__.py | _get_serdesmode_feid | shivharis/pybind | 0 | python | def _get_serdesmode_feid(self):
'\n Getter method for serdesmode_feid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_feid (uint32)\n\n YANG Description: SFM Serdes Mode\n '
return self.__serdesmode_feid | def _get_serdesmode_feid(self):
'\n Getter method for serdesmode_feid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_feid (uint32)\n\n YANG Description: SFM Serdes Mode\n '
return self.__serdesmode_feid<|docstring|>Getter method for serdesmode_feid, mapped from YANG variable /sfm_state/ser... |
6a35a393b92b4f0cc5412735feca8f09d82eee2e57512f4251b25d579f36cdf5 | def _set_serdesmode_feid(self, v, load=False):
'\n Setter method for serdesmode_feid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_feid (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_serdesmode_feid is considered as a private\n method. Backend... | Setter method for serdesmode_feid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_feid (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_serdesmode_feid is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set... | pybind/slxos/v16r_1_00b/sfm_state/serdesmode/__init__.py | _set_serdesmode_feid | shivharis/pybind | 0 | python | def _set_serdesmode_feid(self, v, load=False):
'\n Setter method for serdesmode_feid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_feid (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_serdesmode_feid is considered as a private\n method. Backend... | def _set_serdesmode_feid(self, v, load=False):
'\n Setter method for serdesmode_feid, mapped from YANG variable /sfm_state/serdesmode/serdesmode_feid (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_serdesmode_feid is considered as a private\n method. Backend... |
69722da69c2664f33919822bdb78ebdd7c819112935de527273321b937ea2ccd | def test_source_volume_missing_1(sevenmode):
'Test missing input params.'
with pytest.raises(NidhoggException):
' no source volume '
sevenmode.update_snapmirror('dst_volume', source_filer='host')
with pytest.raises(NidhoggException):
' no source filer '
sevenmode.update_snapm... | Test missing input params. | tests/test_snapmirror_params.py | test_source_volume_missing_1 | ifxit/nidho | 11 | python | def test_source_volume_missing_1(sevenmode):
with pytest.raises(NidhoggException):
' no source volume '
sevenmode.update_snapmirror('dst_volume', source_filer='host')
with pytest.raises(NidhoggException):
' no source filer '
sevenmode.update_snapmirror('dst_volume', source_v... | def test_source_volume_missing_1(sevenmode):
with pytest.raises(NidhoggException):
' no source volume '
sevenmode.update_snapmirror('dst_volume', source_filer='host')
with pytest.raises(NidhoggException):
' no source filer '
sevenmode.update_snapmirror('dst_volume', source_v... |
bffe0bb063defd97022f67083e8424d29208a4a5488effa0220c5a1ce9553ba0 | def test_source_volume_missing_2(sevenmode):
'Test missing input params.'
with pytest.raises(NidhoggException):
sevenmode.update_snapmirror_with_snapshot('name', 'dst_volume', source_filer='host')
with pytest.raises(NidhoggException):
sevenmode.update_snapmirror_with_snapshot('name', 'dst_vo... | Test missing input params. | tests/test_snapmirror_params.py | test_source_volume_missing_2 | ifxit/nidho | 11 | python | def test_source_volume_missing_2(sevenmode):
with pytest.raises(NidhoggException):
sevenmode.update_snapmirror_with_snapshot('name', 'dst_volume', source_filer='host')
with pytest.raises(NidhoggException):
sevenmode.update_snapmirror_with_snapshot('name', 'dst_volume', source_volume='vol')
... | def test_source_volume_missing_2(sevenmode):
with pytest.raises(NidhoggException):
sevenmode.update_snapmirror_with_snapshot('name', 'dst_volume', source_filer='host')
with pytest.raises(NidhoggException):
sevenmode.update_snapmirror_with_snapshot('name', 'dst_volume', source_volume='vol')
... |
fe3c41802a62d0765c70cad8bf38189387cc920afac5d12b80e8a83325b058f4 | def main() -> None:
'Process command line execution.'
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'the_htvms.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError("Couldn't import Django. Are you sure it's installed ... | Process command line execution. | dramatic-dragonflies/manage.py | main | lavirlifiliol/summer-code-jam-2020 | 0 | python | def main() -> None:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'the_htvms.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError("Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH ... | def main() -> None:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'the_htvms.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError("Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH ... |
42b542dccf1c7f2da240196224a1f046a9062a12d7b9ae81beade4eac4ea314d | def prepare_server(self) -> None:
'Perform preparation tasks before running the server.'
django.setup()
if self.migrate:
print('Applying migrations.')
call_command('migrate', verbosity=self.verbosity)
if self.collectstatic:
print('Collecting static files.')
call_command('... | Perform preparation tasks before running the server. | dramatic-dragonflies/manage.py | prepare_server | lavirlifiliol/summer-code-jam-2020 | 0 | python | def prepare_server(self) -> None:
django.setup()
if self.migrate:
print('Applying migrations.')
call_command('migrate', verbosity=self.verbosity)
if self.collectstatic:
print('Collecting static files.')
call_command('collectstatic', interactive=False, clear=True, verbosi... | def prepare_server(self) -> None:
django.setup()
if self.migrate:
print('Applying migrations.')
call_command('migrate', verbosity=self.verbosity)
if self.collectstatic:
print('Collecting static files.')
call_command('collectstatic', interactive=False, clear=True, verbosi... |
d81d5d52b8fd998b1781e1e8c3c85bc83240ed248fa0671da3f5893515a76676 | @staticmethod
def perform_security_check() -> None:
'Perform django security tests.'
print('Running security checks.')
call_command('check', '--deploy', '--fail-level', 'WARNING') | Perform django security tests. | dramatic-dragonflies/manage.py | perform_security_check | lavirlifiliol/summer-code-jam-2020 | 0 | python | @staticmethod
def perform_security_check() -> None:
print('Running security checks.')
call_command('check', '--deploy', '--fail-level', 'WARNING') | @staticmethod
def perform_security_check() -> None:
print('Running security checks.')
call_command('check', '--deploy', '--fail-level', 'WARNING')<|docstring|>Perform django security tests.<|endoftext|> |
3c5ca71a88d8c0cb0a404f3a22a3271f3ef0da8d2822404ee36c6ed307c39ff7 | def run_server(self) -> None:
'Prepare and run the web server.'
in_reloader = (os.environ.get('RUN_MAIN') == 'true')
if in_reloader:
self.prepare_server()
if self.check:
self.perform_security_check()
print('Starting server.')
call_command('runserver', '0.0.0.0:5000')
... | Prepare and run the web server. | dramatic-dragonflies/manage.py | run_server | lavirlifiliol/summer-code-jam-2020 | 0 | python | def run_server(self) -> None:
in_reloader = (os.environ.get('RUN_MAIN') == 'true')
if in_reloader:
self.prepare_server()
if self.check:
self.perform_security_check()
print('Starting server.')
call_command('runserver', '0.0.0.0:5000')
return | def run_server(self) -> None:
in_reloader = (os.environ.get('RUN_MAIN') == 'true')
if in_reloader:
self.prepare_server()
if self.check:
self.perform_security_check()
print('Starting server.')
call_command('runserver', '0.0.0.0:5000')
return<|docstring|>Prepare and ru... |
ee5f03d7199a8420149201cabf99281ef1680660d34d1bfc6d8b653f08e71755 | def get_distance_matrix(mmcif_file, chain_id):
'\n Given a protein structure in mmcif format and a chain id, extract the\n residue type, the coordinate of each residue, and the residue numbering.\n Compute all the pairwise euclidean distances among residues. Returns a\n dictionary containing all of thes... | Given a protein structure in mmcif format and a chain id, extract the
residue type, the coordinate of each residue, and the residue numbering.
Compute all the pairwise euclidean distances among residues. Returns a
dictionary containing all of these data. | python/pdb_to_distance_matrix.py | get_distance_matrix | saulpierotti/.bioscripts | 0 | python | def get_distance_matrix(mmcif_file, chain_id):
'\n Given a protein structure in mmcif format and a chain id, extract the\n residue type, the coordinate of each residue, and the residue numbering.\n Compute all the pairwise euclidean distances among residues. Returns a\n dictionary containing all of thes... | def get_distance_matrix(mmcif_file, chain_id):
'\n Given a protein structure in mmcif format and a chain id, extract the\n residue type, the coordinate of each residue, and the residue numbering.\n Compute all the pairwise euclidean distances among residues. Returns a\n dictionary containing all of thes... |
8ce1b61a33713c05b463135ef7fc4b1ff6a26b280fb4f88e4d1ea9725efb57c4 | def main(args):
'\n Main function\n '
assert os.path.isfile(args.i)
assert args.i.endswith('.cif')
assert (len(args.c) == 1)
assert args.o.endswith('.pdb_distance_matrix.joblib.xz')
assert (not os.path.isfile(args.o))
out_dict = get_distance_matrix(args.i, args.c)
joblib.dump(out_d... | Main function | python/pdb_to_distance_matrix.py | main | saulpierotti/.bioscripts | 0 | python | def main(args):
'\n \n '
assert os.path.isfile(args.i)
assert args.i.endswith('.cif')
assert (len(args.c) == 1)
assert args.o.endswith('.pdb_distance_matrix.joblib.xz')
assert (not os.path.isfile(args.o))
out_dict = get_distance_matrix(args.i, args.c)
joblib.dump(out_dict, args.o) | def main(args):
'\n \n '
assert os.path.isfile(args.i)
assert args.i.endswith('.cif')
assert (len(args.c) == 1)
assert args.o.endswith('.pdb_distance_matrix.joblib.xz')
assert (not os.path.isfile(args.o))
out_dict = get_distance_matrix(args.i, args.c)
joblib.dump(out_dict, args.o)<... |
82a5babcb11c543c7c0150b10a32046cb2ab34bd3576ac360043ce89fa76c585 | def parse_arguments():
'\n Parse command line arguments.\n '
description = ' '.join(__doc__.splitlines()[4:])
epilog = ', '.join(__doc__.splitlines()[1:4])
parser = argparse.ArgumentParser(description=description, epilog=epilog)
parser.add_argument('-i', type=str, help='the mmcif file to be us... | Parse command line arguments. | python/pdb_to_distance_matrix.py | parse_arguments | saulpierotti/.bioscripts | 0 | python | def parse_arguments():
'\n \n '
description = ' '.join(__doc__.splitlines()[4:])
epilog = ', '.join(__doc__.splitlines()[1:4])
parser = argparse.ArgumentParser(description=description, epilog=epilog)
parser.add_argument('-i', type=str, help='the mmcif file to be used', metavar='<file>', requir... | def parse_arguments():
'\n \n '
description = ' '.join(__doc__.splitlines()[4:])
epilog = ', '.join(__doc__.splitlines()[1:4])
parser = argparse.ArgumentParser(description=description, epilog=epilog)
parser.add_argument('-i', type=str, help='the mmcif file to be used', metavar='<file>', requir... |
75a53b7f92b132dd3548a84ab00f9b5f467325dba36ff06a8957e5f9bc1b8fc4 | def __init__(self, *args, **kwargs):
"\n Method is used to initialize the User mapping module and it's base module.\n\n Args:\n *args:\n **kwargs:\n "
self.min_ver = None
self.max_ver = None
super(UserMappingModule, self).__init__(*args, **kwargs) | Method is used to initialize the User mapping module and it's base module.
Args:
*args:
**kwargs: | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | __init__ | Anillab/One-Minute-Pitch | 4 | python | def __init__(self, *args, **kwargs):
"\n Method is used to initialize the User mapping module and it's base module.\n\n Args:\n *args:\n **kwargs:\n "
self.min_ver = None
self.max_ver = None
super(UserMappingModule, self).__init__(*args, **kwargs) | def __init__(self, *args, **kwargs):
"\n Method is used to initialize the User mapping module and it's base module.\n\n Args:\n *args:\n **kwargs:\n "
self.min_ver = None
self.max_ver = None
super(UserMappingModule, self).__init__(*args, **kwargs)<|docstring|>M... |
15d4251ae31bfe7b4a4a94bcf8f04a4c392633fd774dcb5978761f884176aab4 | def get_nodes(self, gid, sid, did, fid, fsid):
'\n Method is used to generate the browser collection node\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: foreign data wrapper ID\n fsid: Foreign server ID\n '
... | Method is used to generate the browser collection node
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
fid: foreign data wrapper ID
fsid: Foreign server ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | get_nodes | Anillab/One-Minute-Pitch | 4 | python | def get_nodes(self, gid, sid, did, fid, fsid):
'\n Method is used to generate the browser collection node\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: foreign data wrapper ID\n fsid: Foreign server ID\n '
... | def get_nodes(self, gid, sid, did, fid, fsid):
'\n Method is used to generate the browser collection node\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: foreign data wrapper ID\n fsid: Foreign server ID\n '
... |
42908e6e8b56fe91d013a49570882d6b85b3ed05811aae63fed9ad0859fc4bcd | @property
def node_inode(self):
'\n node_inode\n\n Override this property to make the node as leaf node.\n '
return False | node_inode
Override this property to make the node as leaf node. | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | node_inode | Anillab/One-Minute-Pitch | 4 | python | @property
def node_inode(self):
'\n node_inode\n\n Override this property to make the node as leaf node.\n '
return False | @property
def node_inode(self):
'\n node_inode\n\n Override this property to make the node as leaf node.\n '
return False<|docstring|>node_inode
Override this property to make the node as leaf node.<|endoftext|> |
cb8a64ff0dc5af05d33acee800489fd61e213248ee9930ef382f4f12f79fffb9 | @property
def script_load(self):
'\n Load the module script for user mapping, when any of the foreign server node is initialized.\n\n Returns: node type of the server module.\n '
return servers.ServerModule.NODE_TYPE | Load the module script for user mapping, when any of the foreign server node is initialized.
Returns: node type of the server module. | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | script_load | Anillab/One-Minute-Pitch | 4 | python | @property
def script_load(self):
'\n Load the module script for user mapping, when any of the foreign server node is initialized.\n\n Returns: node type of the server module.\n '
return servers.ServerModule.NODE_TYPE | @property
def script_load(self):
'\n Load the module script for user mapping, when any of the foreign server node is initialized.\n\n Returns: node type of the server module.\n '
return servers.ServerModule.NODE_TYPE<|docstring|>Load the module script for user mapping, when any of the forei... |
9ca67c4c0fb2138137ace45583cef1c88b14b4d76fe6ec5b6523ff824df90910 | @property
def module_use_template_javascript(self):
'\n Returns whether Jinja2 template is used for generating the javascript\n module.\n '
return False | Returns whether Jinja2 template is used for generating the javascript
module. | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | module_use_template_javascript | Anillab/One-Minute-Pitch | 4 | python | @property
def module_use_template_javascript(self):
'\n Returns whether Jinja2 template is used for generating the javascript\n module.\n '
return False | @property
def module_use_template_javascript(self):
'\n Returns whether Jinja2 template is used for generating the javascript\n module.\n '
return False<|docstring|>Returns whether Jinja2 template is used for generating the javascript
module.<|endoftext|> |
33a8234c84cfcfa0d6e7e52761dc240a57c36e810ae6352c14bc2d3b1bc846f2 | def module_js(self):
'\n This property defines (if javascript) exists for this node.\n Override this property for your own logic.\n '
return make_response(render_template('user_mappings/js/user_mappings.js', _=gettext), 200, {'Content-Type': 'application/x-javascript'}) | This property defines (if javascript) exists for this node.
Override this property for your own logic. | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | module_js | Anillab/One-Minute-Pitch | 4 | python | def module_js(self):
'\n This property defines (if javascript) exists for this node.\n Override this property for your own logic.\n '
return make_response(render_template('user_mappings/js/user_mappings.js', _=gettext), 200, {'Content-Type': 'application/x-javascript'}) | def module_js(self):
'\n This property defines (if javascript) exists for this node.\n Override this property for your own logic.\n '
return make_response(render_template('user_mappings/js/user_mappings.js', _=gettext), 200, {'Content-Type': 'application/x-javascript'})<|docstring|>This pro... |
92deb6e9f2d494eb3cedaf101eb2ae4d2d5a749121e03f84fd35049d359c27dd | def check_precondition(f):
'\n This function will behave as a decorator which will checks\n database connection before running view, it will also attaches\n manager,conn & template_path properties to self\n '
@wraps(f)
def wrap(*args, **kwargs):
self = args[0]
se... | This function will behave as a decorator which will checks
database connection before running view, it will also attaches
manager,conn & template_path properties to self | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | check_precondition | Anillab/One-Minute-Pitch | 4 | python | def check_precondition(f):
'\n This function will behave as a decorator which will checks\n database connection before running view, it will also attaches\n manager,conn & template_path properties to self\n '
@wraps(f)
def wrap(*args, **kwargs):
self = args[0]
se... | def check_precondition(f):
'\n This function will behave as a decorator which will checks\n database connection before running view, it will also attaches\n manager,conn & template_path properties to self\n '
@wraps(f)
def wrap(*args, **kwargs):
self = args[0]
se... |
775bb1a2dcbf818bde3ca111ba02db4930e2199489f25c2fbe79b154402e4466 | @check_precondition
def list(self, gid, sid, did, fid, fsid):
'\n This function is used to list all the user mapping nodes within that collection.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n ... | This function is used to list all the user mapping nodes within that collection.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
fid: Foreign data wrapper ID
fsid: Foreign server ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | list | Anillab/One-Minute-Pitch | 4 | python | @check_precondition
def list(self, gid, sid, did, fid, fsid):
'\n This function is used to list all the user mapping nodes within that collection.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n ... | @check_precondition
def list(self, gid, sid, did, fid, fsid):
'\n This function is used to list all the user mapping nodes within that collection.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n ... |
3f56abff5141d6096623496c67ef0312ba707f1f4fffce7a3bf403f71783a592 | @check_precondition
def nodes(self, gid, sid, did, fid, fsid):
'\n This function will used to create all the child node within that collection.\n Here it will create all the user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\... | This function will used to create all the child node within that collection.
Here it will create all the user mapping node.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
fid: Foreign data wrapper ID
fsid: Foreign server ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | nodes | Anillab/One-Minute-Pitch | 4 | python | @check_precondition
def nodes(self, gid, sid, did, fid, fsid):
'\n This function will used to create all the child node within that collection.\n Here it will create all the user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\... | @check_precondition
def nodes(self, gid, sid, did, fid, fsid):
'\n This function will used to create all the child node within that collection.\n Here it will create all the user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\... |
04fed26bc6f10ead5ce2931fd183581f817345f7171ad5699a81f8b3be06ca06 | @check_precondition
def node(self, gid, sid, did, fid, fsid, umid):
'\n This function will fetch properties of user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n fsid: Foreign s... | This function will fetch properties of user mapping node.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
fid: Foreign data wrapper ID
fsid: Foreign server ID
umid: User mapping ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | node | Anillab/One-Minute-Pitch | 4 | python | @check_precondition
def node(self, gid, sid, did, fid, fsid, umid):
'\n This function will fetch properties of user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n fsid: Foreign s... | @check_precondition
def node(self, gid, sid, did, fid, fsid, umid):
'\n This function will fetch properties of user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n fsid: Foreign s... |
c1b8b4e83a65c11548fae40ccd6986be41d7ad3419c8731760fbac007725b062 | @check_precondition
def properties(self, gid, sid, did, fid, fsid, umid):
'\n This function will show the properties of the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n ... | This function will show the properties of the selected user mapping node.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
fid: Foreign data wrapper ID
fsid: Foreign server ID
umid: User mapping ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | properties | Anillab/One-Minute-Pitch | 4 | python | @check_precondition
def properties(self, gid, sid, did, fid, fsid, umid):
'\n This function will show the properties of the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n ... | @check_precondition
def properties(self, gid, sid, did, fid, fsid, umid):
'\n This function will show the properties of the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n ... |
4013d8645bd4b0e95738c464c55849f81df67ac5da306a66c005a121b5052de3 | @check_precondition
def create(self, gid, sid, did, fid, fsid):
'\n This function will create the user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n fsid: Foreign server ID\n ... | This function will create the user mapping node.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
fid: Foreign data wrapper ID
fsid: Foreign server ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | create | Anillab/One-Minute-Pitch | 4 | python | @check_precondition
def create(self, gid, sid, did, fid, fsid):
'\n This function will create the user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n fsid: Foreign server ID\n ... | @check_precondition
def create(self, gid, sid, did, fid, fsid):
'\n This function will create the user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n fsid: Foreign server ID\n ... |
d5763374d34306ef1a760195fa391f34ce1490571f396fe43a7cfcfe8d417aed | @check_precondition
def update(self, gid, sid, did, fid, fsid, umid):
'\n This function will update the data for the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n ... | This function will update the data for the selected user mapping node.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
fid: Foreign data wrapper ID
fsid: Foreign server ID
umid: User mapping ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | update | Anillab/One-Minute-Pitch | 4 | python | @check_precondition
def update(self, gid, sid, did, fid, fsid, umid):
'\n This function will update the data for the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n ... | @check_precondition
def update(self, gid, sid, did, fid, fsid, umid):
'\n This function will update the data for the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper ID\n ... |
1ea67583b3e887e78bd01491bb50e537681ffe29d9daff0ff68387186fa457f8 | @check_precondition
def delete(self, gid, sid, did, fid, fsid, umid):
'\n This function will delete the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: foreign data wrapper ID\n fsid: foreign... | This function will delete the selected user mapping node.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
fid: foreign data wrapper ID
fsid: foreign server ID
umid: User mapping ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | delete | Anillab/One-Minute-Pitch | 4 | python | @check_precondition
def delete(self, gid, sid, did, fid, fsid, umid):
'\n This function will delete the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: foreign data wrapper ID\n fsid: foreign... | @check_precondition
def delete(self, gid, sid, did, fid, fsid, umid):
'\n This function will delete the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: foreign data wrapper ID\n fsid: foreign... |
75e47ec24d34c62970dbd0d61c858904e294290143e0a69046bc274015a3e456 | @check_precondition
def msql(self, gid, sid, did, fid, fsid, umid=None):
'\n This function is used to return modified SQL for the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: foreign data wrapper ID\... | This function is used to return modified SQL for the selected user mapping node.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
fid: foreign data wrapper ID
fsid: foreign server ID
umid: User mapping ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | msql | Anillab/One-Minute-Pitch | 4 | python | @check_precondition
def msql(self, gid, sid, did, fid, fsid, umid=None):
'\n This function is used to return modified SQL for the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: foreign data wrapper ID\... | @check_precondition
def msql(self, gid, sid, did, fid, fsid, umid=None):
'\n This function is used to return modified SQL for the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: foreign data wrapper ID\... |
96d3f4070d348c337f3ad799d8b899dbc5204b685c3b55aef9b3c4382330b0f7 | def get_sql(self, gid, sid, data, did, fid, fsid, umid=None):
'\n This function will generate sql from model data.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n data: Contains the data of the selected user mapping node\n f... | This function will generate sql from model data.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
data: Contains the data of the selected user mapping node
fid: foreign data wrapper ID
fsid: foreign server ID
umid: User mapping ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | get_sql | Anillab/One-Minute-Pitch | 4 | python | def get_sql(self, gid, sid, data, did, fid, fsid, umid=None):
'\n This function will generate sql from model data.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n data: Contains the data of the selected user mapping node\n f... | def get_sql(self, gid, sid, data, did, fid, fsid, umid=None):
'\n This function will generate sql from model data.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n data: Contains the data of the selected user mapping node\n f... |
e50be2aca60a4e9e49e46f1d73bb3bc7b5db92ea6b4f5596e807bbee931cf363 | @check_precondition
def sql(self, gid, sid, did, fid, fsid, umid):
'\n This function will generate sql to show it in sql pane for the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper... | This function will generate sql to show it in sql pane for the selected user mapping node.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
fid: Foreign data wrapper ID
fsid: Foreign server ID
umid: User mapping ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | sql | Anillab/One-Minute-Pitch | 4 | python | @check_precondition
def sql(self, gid, sid, did, fid, fsid, umid):
'\n This function will generate sql to show it in sql pane for the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper... | @check_precondition
def sql(self, gid, sid, did, fid, fsid, umid):
'\n This function will generate sql to show it in sql pane for the selected user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreign data wrapper... |
979b1fbe9c37405f761a2581af37b3ed32c918515a20f7af6a8eebf4a34918ba | @check_precondition
def dependents(self, gid, sid, did, fid, fsid, umid):
'\n This function get the dependents and return ajax response\n for the user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: foreign da... | This function get the dependents and return ajax response
for the user mapping node.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
fid: foreign data wrapper ID
fsid: Foreign server ID
umid: user mapping ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | dependents | Anillab/One-Minute-Pitch | 4 | python | @check_precondition
def dependents(self, gid, sid, did, fid, fsid, umid):
'\n This function get the dependents and return ajax response\n for the user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: foreign da... | @check_precondition
def dependents(self, gid, sid, did, fid, fsid, umid):
'\n This function get the dependents and return ajax response\n for the user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: foreign da... |
d15152dfef4b3bebc9ec66b9d0b32c22ff5078f29d37b6797bf9a79605d0e29d | @check_precondition
def dependencies(self, gid, sid, did, fid, fsid, umid):
'\n This function get the dependencies and return ajax response\n for the user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreig... | This function get the dependencies and return ajax response
for the user mapping node.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
fid: Foreign Data Wrapper ID
fsid: Foreign server ID
umid: user mapping ID | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py | dependencies | Anillab/One-Minute-Pitch | 4 | python | @check_precondition
def dependencies(self, gid, sid, did, fid, fsid, umid):
'\n This function get the dependencies and return ajax response\n for the user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreig... | @check_precondition
def dependencies(self, gid, sid, did, fid, fsid, umid):
'\n This function get the dependencies and return ajax response\n for the user mapping node.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n fid: Foreig... |
23f8288e5c754ba1a0686438fd2a0c622d7a70feae380a98e21154f40b997ed2 | def __add__(self, other):
'operator.add as: a = x + y or a = a + i\n Here __add__ will return a new object copy after operation. \n :param other: An iterable as dict, Xunitrpt, et.\n :return: A new object of result Xunitrpt type\n '
z = Xunitrpt()
z.case_dict = self.case_dict.cop... | operator.add as: a = x + y or a = a + i
Here __add__ will return a new object copy after operation.
:param other: An iterable as dict, Xunitrpt, et.
:return: A new object of result Xunitrpt type | src/cistat/model/xunit_report.py | __add__ | maxwu/cistat | 1 | python | def __add__(self, other):
'operator.add as: a = x + y or a = a + i\n Here __add__ will return a new object copy after operation. \n :param other: An iterable as dict, Xunitrpt, et.\n :return: A new object of result Xunitrpt type\n '
z = Xunitrpt()
z.case_dict = self.case_dict.cop... | def __add__(self, other):
'operator.add as: a = x + y or a = a + i\n Here __add__ will return a new object copy after operation. \n :param other: An iterable as dict, Xunitrpt, et.\n :return: A new object of result Xunitrpt type\n '
z = Xunitrpt()
z.case_dict = self.case_dict.cop... |
5fede6cee1c86530117c586a52e6bece03865498db21fa070ea435b8d1fa5882 | def __iadd__(self, other):
' operator.idd as: a += i\n :param other: An iterable as dict, Xunitrpt, et.\n :return: The original operand after updating with data from other.\n '
return self.extend(other) | operator.idd as: a += i
:param other: An iterable as dict, Xunitrpt, et.
:return: The original operand after updating with data from other. | src/cistat/model/xunit_report.py | __iadd__ | maxwu/cistat | 1 | python | def __iadd__(self, other):
' operator.idd as: a += i\n :param other: An iterable as dict, Xunitrpt, et.\n :return: The original operand after updating with data from other.\n '
return self.extend(other) | def __iadd__(self, other):
' operator.idd as: a += i\n :param other: An iterable as dict, Xunitrpt, et.\n :return: The original operand after updating with data from other.\n '
return self.extend(other)<|docstring|>operator.idd as: a += i
:param other: An iterable as dict, Xunitrpt, et.
:re... |
574496aab2db237b2b5c0528df60b3570595992e615f37c2c105475ab7ff8515 | def accumulate_xunit_str(self, xunit=None):
' Update data in given XUnit str to current XUnitReport Object\n If supplied with malformed str or None, silently do nothing but return itself.\n :param xunit: XUnit in a string\n :return: XunitReport Object itself after the accumulation\n '
... | Update data in given XUnit str to current XUnitReport Object
If supplied with malformed str or None, silently do nothing but return itself.
:param xunit: XUnit in a string
:return: XunitReport Object itself after the accumulation | src/cistat/model/xunit_report.py | accumulate_xunit_str | maxwu/cistat | 1 | python | def accumulate_xunit_str(self, xunit=None):
' Update data in given XUnit str to current XUnitReport Object\n If supplied with malformed str or None, silently do nothing but return itself.\n :param xunit: XUnit in a string\n :return: XunitReport Object itself after the accumulation\n '
... | def accumulate_xunit_str(self, xunit=None):
' Update data in given XUnit str to current XUnitReport Object\n If supplied with malformed str or None, silently do nothing but return itself.\n :param xunit: XUnit in a string\n :return: XunitReport Object itself after the accumulation\n '
... |
c3943e0d8dafdc8c1c074d3d57e87f08cc1cc0be273619834e4589c195954ec1 | def get_scatter_roi(self, title='CIStat', sub_title='Test ROI'):
' Return chart object to present ROI of each test class\n Here it is called Test ROI, not class ROI. Because a new feature is under primary scoping to allow case \n statistics being aggregated at any given level. Which means folks can ch... | Return chart object to present ROI of each test class
Here it is called Test ROI, not class ROI. Because a new feature is under primary scoping to allow case
statistics being aggregated at any given level. Which means folks can check which package or parent package
is consuming the most or producing the most. Users ca... | src/cistat/model/xunit_report.py | get_scatter_roi | maxwu/cistat | 1 | python | def get_scatter_roi(self, title='CIStat', sub_title='Test ROI'):
' Return chart object to present ROI of each test class\n Here it is called Test ROI, not class ROI. Because a new feature is under primary scoping to allow case \n statistics being aggregated at any given level. Which means folks can ch... | def get_scatter_roi(self, title='CIStat', sub_title='Test ROI'):
' Return chart object to present ROI of each test class\n Here it is called Test ROI, not class ROI. Because a new feature is under primary scoping to allow case \n statistics being aggregated at any given level. Which means folks can ch... |
c931d4f9a53982302640777dbacd42a812bf4e58067a20a7d20164a627b2c8c4 | def get_class_rpt(self):
' Generate Class level statistics in Xunitrpt type.\n :return: Xunitrpt object on classes\n '
clsrpt = Xunitrpt()
for (k, v) in self:
clsrpt += {Xunitrpt.get_class_name(k): v}.iteritems()
return clsrpt | Generate Class level statistics in Xunitrpt type.
:return: Xunitrpt object on classes | src/cistat/model/xunit_report.py | get_class_rpt | maxwu/cistat | 1 | python | def get_class_rpt(self):
' Generate Class level statistics in Xunitrpt type.\n :return: Xunitrpt object on classes\n '
clsrpt = Xunitrpt()
for (k, v) in self:
clsrpt += {Xunitrpt.get_class_name(k): v}.iteritems()
return clsrpt | def get_class_rpt(self):
' Generate Class level statistics in Xunitrpt type.\n :return: Xunitrpt object on classes\n '
clsrpt = Xunitrpt()
for (k, v) in self:
clsrpt += {Xunitrpt.get_class_name(k): v}.iteritems()
return clsrpt<|docstring|>Generate Class level statistics in Xunitrpt... |
9d277fa3df71ee4abad95345c181c23e711de44ae52e31c14a95b283d21af182 | def get_variable_parent_name(var):
'Get the name of the parent if it exists or return the variable name otherwise.'
if (hasattr(var, 'parent') and (var.parent is not None)):
return var.parent.name
else:
return var.name | Get the name of the parent if it exists or return the variable name otherwise. | src/empirical_fire_modelling/cache/hashing.py | get_variable_parent_name | akuhnregnier/empirical-fire-modelling | 0 | python | def get_variable_parent_name(var):
if (hasattr(var, 'parent') and (var.parent is not None)):
return var.parent.name
else:
return var.name | def get_variable_parent_name(var):
if (hasattr(var, 'parent') and (var.parent is not None)):
return var.parent.name
else:
return var.name<|docstring|>Get the name of the parent if it exists or return the variable name otherwise.<|endoftext|> |
92ca9825c3a93373a7e4e23844c6a7da87b0f3ca04e97112398cc113e04a526b | def as_dict(self):
'Return the flat dictionary as a dictionary.\n\n :rtype: dict\n\n '
dict_out = {}
for key in self._values.keys():
value = self._values[key]
if isinstance(value, FlatDict):
if (value.former_type == list):
dict_out[key] = [v for (k, ... | Return the flat dictionary as a dictionary.
:rtype: dict | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | as_dict | IndigoDomotics/GhostXML | 2 | python | def as_dict(self):
'Return the flat dictionary as a dictionary.\n\n :rtype: dict\n\n '
dict_out = {}
for key in self._values.keys():
value = self._values[key]
if isinstance(value, FlatDict):
if (value.former_type == list):
dict_out[key] = [v for (k, ... | def as_dict(self):
'Return the flat dictionary as a dictionary.\n\n :rtype: dict\n\n '
dict_out = {}
for key in self._values.keys():
value = self._values[key]
if isinstance(value, FlatDict):
if (value.former_type == list):
dict_out[key] = [v for (k, ... |
3255ea2549d890651d5817dffc5b4f0e0bfe693cc5a71eb9614dd6ac284de5e3 | def clear(self):
'Remove all items from the flat dictionary.'
self._values.clear() | Remove all items from the flat dictionary. | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | clear | IndigoDomotics/GhostXML | 2 | python | def clear(self):
self._values.clear() | def clear(self):
self._values.clear()<|docstring|>Remove all items from the flat dictionary.<|endoftext|> |
4a503f103d1d16e527bdaf7856e39b245a1671ff048ff42d6881af29b5c9aabb | def copy(self):
'Return a shallow copy of the flat dictionary.\n\n :rtype: flatdict.FlatDict\n\n '
values = {}
for key in self.keys():
values[key] = self.__getitem__(key)
return values | Return a shallow copy of the flat dictionary.
:rtype: flatdict.FlatDict | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | copy | IndigoDomotics/GhostXML | 2 | python | def copy(self):
'Return a shallow copy of the flat dictionary.\n\n :rtype: flatdict.FlatDict\n\n '
values = {}
for key in self.keys():
values[key] = self.__getitem__(key)
return values | def copy(self):
'Return a shallow copy of the flat dictionary.\n\n :rtype: flatdict.FlatDict\n\n '
values = {}
for key in self.keys():
values[key] = self.__getitem__(key)
return values<|docstring|>Return a shallow copy of the flat dictionary.
:rtype: flatdict.FlatDict<|endoftext|> |
a0b8ffac4d429595ce3f7af36f0b208f34ad82c20a4992dd47d177aa2d7be9bd | def get(self, key, d=None):
'Return the value for key if key is in the flat dictionary, else\n default. If default is not given, it defaults to ``None``, so that this\n method never raises a ``KeyError``.\n\n :param mixed key: The key to get\n :param mixed d: The default value\n :... | Return the value for key if key is in the flat dictionary, else
default. If default is not given, it defaults to ``None``, so that this
method never raises a ``KeyError``.
:param mixed key: The key to get
:param mixed d: The default value
:rtype: mixed | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | get | IndigoDomotics/GhostXML | 2 | python | def get(self, key, d=None):
'Return the value for key if key is in the flat dictionary, else\n default. If default is not given, it defaults to ``None``, so that this\n method never raises a ``KeyError``.\n\n :param mixed key: The key to get\n :param mixed d: The default value\n :... | def get(self, key, d=None):
'Return the value for key if key is in the flat dictionary, else\n default. If default is not given, it defaults to ``None``, so that this\n method never raises a ``KeyError``.\n\n :param mixed key: The key to get\n :param mixed d: The default value\n :... |
f5f716bcc4e5605b5947f0f09932e5ce3d86063a550c62649fc4a907fa157c2e | def has_key(self, key):
'Check to see if the flat dictionary has a specific key.\n\n :param mixed key: The key to check for\n :rtype: bool\n\n '
return (key in self.keys()) | Check to see if the flat dictionary has a specific key.
:param mixed key: The key to check for
:rtype: bool | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | has_key | IndigoDomotics/GhostXML | 2 | python | def has_key(self, key):
'Check to see if the flat dictionary has a specific key.\n\n :param mixed key: The key to check for\n :rtype: bool\n\n '
return (key in self.keys()) | def has_key(self, key):
'Check to see if the flat dictionary has a specific key.\n\n :param mixed key: The key to check for\n :rtype: bool\n\n '
return (key in self.keys())<|docstring|>Check to see if the flat dictionary has a specific key.
:param mixed key: The key to check for
:rtype: bo... |
33340a92503b54656aa16e7cc73da6d8f07aa529ecfc100ddbf1eb12180e6677 | def items(self):
"Return a copy of the flat dictionary's list of ``(key, value)``\n pairs.\n\n .. note:: CPython implementation detail: Keys and values are listed in an arbitrary order which is non-random, varies across Python implementations, and depends on the flat dictionary's histo... | Return a copy of the flat dictionary's list of ``(key, value)``
pairs.
.. note:: CPython implementation detail: Keys and values are listed in an arbitrary order which is non-random, varies across Python implementations, and depends on the flat dictionary's history of insertions and deletions.
... | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | items | IndigoDomotics/GhostXML | 2 | python | def items(self):
"Return a copy of the flat dictionary's list of ``(key, value)``\n pairs.\n\n .. note:: CPython implementation detail: Keys and values are listed in an arbitrary order which is non-random, varies across Python implementations, and depends on the flat dictionary's histo... | def items(self):
"Return a copy of the flat dictionary's list of ``(key, value)``\n pairs.\n\n .. note:: CPython implementation detail: Keys and values are listed in an arbitrary order which is non-random, varies across Python implementations, and depends on the flat dictionary's histo... |
e352ece74cd6ceaf41702e43b8b82eb7246a023d25edff7b5a1f4da63914cd40 | def iteritems(self):
"Return an iterator over the flat dictionary's (key, value) pairs.\n See the note for :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n Using ``iteritems()`` while adding or deleting entries in the flat\n dictionary may raise a ``RuntimeError`` or fail to iterate ... | Return an iterator over the flat dictionary's (key, value) pairs.
See the note for :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.
Using ``iteritems()`` while adding or deleting entries in the flat
dictionary may raise a ``RuntimeError`` or fail to iterate over all
entries.
:rtype: Iterator
:raises: RuntimeEr... | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | iteritems | IndigoDomotics/GhostXML | 2 | python | def iteritems(self):
"Return an iterator over the flat dictionary's (key, value) pairs.\n See the note for :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n Using ``iteritems()`` while adding or deleting entries in the flat\n dictionary may raise a ``RuntimeError`` or fail to iterate ... | def iteritems(self):
"Return an iterator over the flat dictionary's (key, value) pairs.\n See the note for :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n Using ``iteritems()`` while adding or deleting entries in the flat\n dictionary may raise a ``RuntimeError`` or fail to iterate ... |
d4d3bdbfb65bfe239c3eaa2b646ed8d23ccc0cf17e09a56aca26525ff5f721de | def iterkeys(self):
"Return an iterator over the flat dictionary's keys. See the note for\n :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n Using ``iterkeys()`` while adding or deleting entries in the flat\n dictionary may raise a ``RuntimeError`` or fail to iterate over all\n ... | Return an iterator over the flat dictionary's keys. See the note for
:py:class:`FlatDict.items() <flatdict.FlatDict.items>`.
Using ``iterkeys()`` while adding or deleting entries in the flat
dictionary may raise a ``RuntimeError`` or fail to iterate over all
entries.
:rtype: Iterator
:raises: RuntimeError | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | iterkeys | IndigoDomotics/GhostXML | 2 | python | def iterkeys(self):
"Return an iterator over the flat dictionary's keys. See the note for\n :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n Using ``iterkeys()`` while adding or deleting entries in the flat\n dictionary may raise a ``RuntimeError`` or fail to iterate over all\n ... | def iterkeys(self):
"Return an iterator over the flat dictionary's keys. See the note for\n :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n Using ``iterkeys()`` while adding or deleting entries in the flat\n dictionary may raise a ``RuntimeError`` or fail to iterate over all\n ... |
9738be90baab68fc8ab4973ae7bb36907f35dc59921a4bf53c878797ae63da89 | def itervalues(self):
"Return an iterator over the flat dictionary's values. See the note\n for :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n Using ``itervalues()`` while adding or deleting entries in the flat\n dictionary may raise a ``RuntimeError`` or fail to iterate over all\n... | Return an iterator over the flat dictionary's values. See the note
for :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.
Using ``itervalues()`` while adding or deleting entries in the flat
dictionary may raise a ``RuntimeError`` or fail to iterate over all
entries.
:rtype: Iterator
:raises: RuntimeError | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | itervalues | IndigoDomotics/GhostXML | 2 | python | def itervalues(self):
"Return an iterator over the flat dictionary's values. See the note\n for :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n Using ``itervalues()`` while adding or deleting entries in the flat\n dictionary may raise a ``RuntimeError`` or fail to iterate over all\n... | def itervalues(self):
"Return an iterator over the flat dictionary's values. See the note\n for :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n Using ``itervalues()`` while adding or deleting entries in the flat\n dictionary may raise a ``RuntimeError`` or fail to iterate over all\n... |
33ad4d414f696e8b244c202c8f5a856644a84827db166576ad0a2a1f579efedd | def keys(self):
"Return a copy of the flat dictionary's list of keys. See the note for\n :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n :rtype: list\n\n "
keys = list()
for key in self._values.keys():
if isinstance(self._values[key], FlatDict):
child_key... | Return a copy of the flat dictionary's list of keys. See the note for
:py:class:`FlatDict.items() <flatdict.FlatDict.items>`.
:rtype: list | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | keys | IndigoDomotics/GhostXML | 2 | python | def keys(self):
"Return a copy of the flat dictionary's list of keys. See the note for\n :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n :rtype: list\n\n "
keys = list()
for key in self._values.keys():
if isinstance(self._values[key], FlatDict):
child_key... | def keys(self):
"Return a copy of the flat dictionary's list of keys. See the note for\n :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n :rtype: list\n\n "
keys = list()
for key in self._values.keys():
if isinstance(self._values[key], FlatDict):
child_key... |
cfe76dc382942c5375598c58d188a6d23a5db5034e5aeb617d57c8f7bc1f2992 | def pop(self, key, default=None):
'If key is in the flat dictionary, remove it and return its value,\n else return default. If default is not given and key is not in the\n dictionary, a ``KeyError`` is raised.\n\n :param mixed key: The key name\n :param mixed default: The default value\n... | If key is in the flat dictionary, remove it and return its value,
else return default. If default is not given and key is not in the
dictionary, a ``KeyError`` is raised.
:param mixed key: The key name
:param mixed default: The default value
:rtype: mixed | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | pop | IndigoDomotics/GhostXML | 2 | python | def pop(self, key, default=None):
'If key is in the flat dictionary, remove it and return its value,\n else return default. If default is not given and key is not in the\n dictionary, a ``KeyError`` is raised.\n\n :param mixed key: The key name\n :param mixed default: The default value\n... | def pop(self, key, default=None):
'If key is in the flat dictionary, remove it and return its value,\n else return default. If default is not given and key is not in the\n dictionary, a ``KeyError`` is raised.\n\n :param mixed key: The key name\n :param mixed default: The default value\n... |
8548802ca2b913d39b0e7bb38103b9de36fb26d4e74503de9a9659c302b59515 | def setdefault(self, key, default=None):
' If key is in the flat dictionary, return its value. If not,\n insert key with a value of default and return default.\n default defaults to ``None``.\n\n :param mixed key: The key name\n :param mixed default: The default value\n :rtype: mi... | If key is in the flat dictionary, return its value. If not,
insert key with a value of default and return default.
default defaults to ``None``.
:param mixed key: The key name
:param mixed default: The default value
:rtype: mixed | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | setdefault | IndigoDomotics/GhostXML | 2 | python | def setdefault(self, key, default=None):
' If key is in the flat dictionary, return its value. If not,\n insert key with a value of default and return default.\n default defaults to ``None``.\n\n :param mixed key: The key name\n :param mixed default: The default value\n :rtype: mi... | def setdefault(self, key, default=None):
' If key is in the flat dictionary, return its value. If not,\n insert key with a value of default and return default.\n default defaults to ``None``.\n\n :param mixed key: The key name\n :param mixed default: The default value\n :rtype: mi... |
bfc6f220fb652f10a7bbdb947d2328f444f2edb5961d83ccc1b627301a3e61a9 | def set_delimiter(self, delimiter):
'Override the default or passed in delimiter with a new value.\n\n :param str delimiter: The delimiter to use\n\n '
self._delimiter = delimiter
for key in self._values.keys():
if isinstance(self._values[key], FlatDict):
self._values[key].... | Override the default or passed in delimiter with a new value.
:param str delimiter: The delimiter to use | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | set_delimiter | IndigoDomotics/GhostXML | 2 | python | def set_delimiter(self, delimiter):
'Override the default or passed in delimiter with a new value.\n\n :param str delimiter: The delimiter to use\n\n '
self._delimiter = delimiter
for key in self._values.keys():
if isinstance(self._values[key], FlatDict):
self._values[key].... | def set_delimiter(self, delimiter):
'Override the default or passed in delimiter with a new value.\n\n :param str delimiter: The delimiter to use\n\n '
self._delimiter = delimiter
for key in self._values.keys():
if isinstance(self._values[key], FlatDict):
self._values[key].... |
85b2159f4dd9dfec4c029fd2edc5b80e26b1d047d70496d30ad8dd9f20adbd8f | def update(self, other=None, **kwargs):
'Update the flat dictionary with the key/value pairs from other,\n overwriting existing keys.\n\n ``update()`` accepts either another flat dictionary object or an\n iterable of key/value pairs (as tuples or other iterables of length\n two). If keyw... | Update the flat dictionary with the key/value pairs from other,
overwriting existing keys.
``update()`` accepts either another flat dictionary object or an
iterable of key/value pairs (as tuples or other iterables of length
two). If keyword arguments are specified, the flat dictionary is then
updated with those key/va... | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | update | IndigoDomotics/GhostXML | 2 | python | def update(self, other=None, **kwargs):
'Update the flat dictionary with the key/value pairs from other,\n overwriting existing keys.\n\n ``update()`` accepts either another flat dictionary object or an\n iterable of key/value pairs (as tuples or other iterables of length\n two). If keyw... | def update(self, other=None, **kwargs):
'Update the flat dictionary with the key/value pairs from other,\n overwriting existing keys.\n\n ``update()`` accepts either another flat dictionary object or an\n iterable of key/value pairs (as tuples or other iterables of length\n two). If keyw... |
bef2a195e987e3bb5fc0f8341daa224b78c829185be62becf7660787714289f6 | def values(self):
"Return a copy of the flat dictionary's list of values. See the note\n for :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n :rtype: list\n\n "
values = list()
for key in self.keys():
values.append(self.__getitem__(key))
return values | Return a copy of the flat dictionary's list of values. See the note
for :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.
:rtype: list | GhostXML.indigoPlugin/Contents/Server Plugin/flatdict.py | values | IndigoDomotics/GhostXML | 2 | python | def values(self):
"Return a copy of the flat dictionary's list of values. See the note\n for :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n :rtype: list\n\n "
values = list()
for key in self.keys():
values.append(self.__getitem__(key))
return values | def values(self):
"Return a copy of the flat dictionary's list of values. See the note\n for :py:class:`FlatDict.items() <flatdict.FlatDict.items>`.\n\n :rtype: list\n\n "
values = list()
for key in self.keys():
values.append(self.__getitem__(key))
return values<|docstring|>... |
c02d15ee3af03ce6e3c85bd2c5a744dc56984f4946d8b28d1dfe9e749eb2c28c | @login_manager.request_loader
def authenticate_user(request):
'Require token for authentication to allow user to access resources'
token = request.headers.get('Authorization')
if token:
try:
data = auth_serializer.loads(token)
except SignatureExpired:
return None
... | Require token for authentication to allow user to access resources | blst/api.py | authenticate_user | collinmutembei/II | 0 | python | @login_manager.request_loader
def authenticate_user(request):
token = request.headers.get('Authorization')
if token:
try:
data = auth_serializer.loads(token)
except SignatureExpired:
return None
except BadSignature:
return None
user = User... | @login_manager.request_loader
def authenticate_user(request):
token = request.headers.get('Authorization')
if token:
try:
data = auth_serializer.loads(token)
except SignatureExpired:
return None
except BadSignature:
return None
user = User... |
f193fbbbdf6de30c1db1cc89af958a03713dc3025547d4634744a5dc2a1e2ccc | def int_tested(*j, **hint):
'\n Return all args as Python integers.\n\n In some cases a routine needs to work with integers\n but it is convenient to allow the user to pass a non-integer\n value or expression. In this case, the flag ``strict`` can be set\n to False. The default behavior is to raise a... | Return all args as Python integers.
In some cases a routine needs to work with integers
but it is convenient to allow the user to pass a non-integer
value or expression. In this case, the flag ``strict`` can be set
to False. The default behavior is to raise an error if any argument
cannot pass an int(arg) == arg test.... | sympy/ntheory/residue_ntheory.py | int_tested | goodok/sympy | 2 | python | def int_tested(*j, **hint):
'\n Return all args as Python integers.\n\n In some cases a routine needs to work with integers\n but it is convenient to allow the user to pass a non-integer\n value or expression. In this case, the flag ``strict`` can be set\n to False. The default behavior is to raise a... | def int_tested(*j, **hint):
'\n Return all args as Python integers.\n\n In some cases a routine needs to work with integers\n but it is convenient to allow the user to pass a non-integer\n value or expression. In this case, the flag ``strict`` can be set\n to False. The default behavior is to raise a... |
f091f82fbc863e4c04dc840b1545b1edbed6b1b77723edbf2e616b3c11f77ff8 | def n_order(a, n):
'Returns the order of ``a`` modulo ``n``.\n\n The order of ``a`` modulo ``n`` is the smallest integer\n ``k`` such that ``a**k`` leaves a remainder of 1 with ``n``.\n\n Examples\n ========\n\n >>> from sympy.ntheory import n_order\n >>> n_order(3, 7)\n 6\n >>> n_order(4, 7... | Returns the order of ``a`` modulo ``n``.
The order of ``a`` modulo ``n`` is the smallest integer
``k`` such that ``a**k`` leaves a remainder of 1 with ``n``.
Examples
========
>>> from sympy.ntheory import n_order
>>> n_order(3, 7)
6
>>> n_order(4, 7)
3 | sympy/ntheory/residue_ntheory.py | n_order | goodok/sympy | 2 | python | def n_order(a, n):
'Returns the order of ``a`` modulo ``n``.\n\n The order of ``a`` modulo ``n`` is the smallest integer\n ``k`` such that ``a**k`` leaves a remainder of 1 with ``n``.\n\n Examples\n ========\n\n >>> from sympy.ntheory import n_order\n >>> n_order(3, 7)\n 6\n >>> n_order(4, 7... | def n_order(a, n):
'Returns the order of ``a`` modulo ``n``.\n\n The order of ``a`` modulo ``n`` is the smallest integer\n ``k`` such that ``a**k`` leaves a remainder of 1 with ``n``.\n\n Examples\n ========\n\n >>> from sympy.ntheory import n_order\n >>> n_order(3, 7)\n 6\n >>> n_order(4, 7... |
9ed21e800a408b6ab4562196f041874bda9021f7e606fedc541fdb46cd42bf11 | def is_primitive_root(a, p):
'\n Returns True if ``a`` is a primitive root of ``p``\n\n ``a`` is said to be the primitive root of ``p`` if gcd(a, p) == 1 and\n totient(p) is the smallest positive number s.t.\n\n a**totient(p) cong 1 mod(p)\n\n Examples\n ========\n\n >>> from sympy.ntheory ... | Returns True if ``a`` is a primitive root of ``p``
``a`` is said to be the primitive root of ``p`` if gcd(a, p) == 1 and
totient(p) is the smallest positive number s.t.
a**totient(p) cong 1 mod(p)
Examples
========
>>> from sympy.ntheory import is_primitive_root, n_order, totient
>>> is_primitive_root(3, 10)
Tr... | sympy/ntheory/residue_ntheory.py | is_primitive_root | goodok/sympy | 2 | python | def is_primitive_root(a, p):
'\n Returns True if ``a`` is a primitive root of ``p``\n\n ``a`` is said to be the primitive root of ``p`` if gcd(a, p) == 1 and\n totient(p) is the smallest positive number s.t.\n\n a**totient(p) cong 1 mod(p)\n\n Examples\n ========\n\n >>> from sympy.ntheory ... | def is_primitive_root(a, p):
'\n Returns True if ``a`` is a primitive root of ``p``\n\n ``a`` is said to be the primitive root of ``p`` if gcd(a, p) == 1 and\n totient(p) is the smallest positive number s.t.\n\n a**totient(p) cong 1 mod(p)\n\n Examples\n ========\n\n >>> from sympy.ntheory ... |
006f1a18c7626b8e7f579f218bac5a67f6998d3570dcf68bdce9c2ed1ab1dd6e | def is_quad_residue(a, p):
'\n Returns True if ``a`` (mod ``p``) is in the set of squares mod ``p``,\n i.e a % p in set([i**2 % p for i in range(p)]). If ``p`` is an odd\n prime, an iterative method is used to make the determination:\n\n >>> from sympy.ntheory import is_quad_residue\n >>> list(set([i... | Returns True if ``a`` (mod ``p``) is in the set of squares mod ``p``,
i.e a % p in set([i**2 % p for i in range(p)]). If ``p`` is an odd
prime, an iterative method is used to make the determination:
>>> from sympy.ntheory import is_quad_residue
>>> list(set([i**2 % 7 for i in range(7)]))
[0, 1, 2, 4]
>>> [j for j in r... | sympy/ntheory/residue_ntheory.py | is_quad_residue | goodok/sympy | 2 | python | def is_quad_residue(a, p):
'\n Returns True if ``a`` (mod ``p``) is in the set of squares mod ``p``,\n i.e a % p in set([i**2 % p for i in range(p)]). If ``p`` is an odd\n prime, an iterative method is used to make the determination:\n\n >>> from sympy.ntheory import is_quad_residue\n >>> list(set([i... | def is_quad_residue(a, p):
'\n Returns True if ``a`` (mod ``p``) is in the set of squares mod ``p``,\n i.e a % p in set([i**2 % p for i in range(p)]). If ``p`` is an odd\n prime, an iterative method is used to make the determination:\n\n >>> from sympy.ntheory import is_quad_residue\n >>> list(set([i... |
e1fddf433a7e85f737b0c08db4a67a9e1fdff8b832addbc7bbb28e7d6e1df547 | def legendre_symbol(a, p):
'\n Returns\n =======\n\n 1. 0 if a is multiple of p\n 2. 1 if a is a quadratic residue of p\n 3. -1 otherwise\n\n p should be an odd prime by definition\n\n Examples\n ========\n\n >>> from sympy.ntheory import legendre_symbol\n >>> [legendre_symbol(i, 7) fo... | Returns
=======
1. 0 if a is multiple of p
2. 1 if a is a quadratic residue of p
3. -1 otherwise
p should be an odd prime by definition
Examples
========
>>> from sympy.ntheory import legendre_symbol
>>> [legendre_symbol(i, 7) for i in range(7)]
[0, 1, 1, -1, 1, -1, -1]
>>> list(set([i**2 % 7 for i in range(7)]))
[... | sympy/ntheory/residue_ntheory.py | legendre_symbol | goodok/sympy | 2 | python | def legendre_symbol(a, p):
'\n Returns\n =======\n\n 1. 0 if a is multiple of p\n 2. 1 if a is a quadratic residue of p\n 3. -1 otherwise\n\n p should be an odd prime by definition\n\n Examples\n ========\n\n >>> from sympy.ntheory import legendre_symbol\n >>> [legendre_symbol(i, 7) fo... | def legendre_symbol(a, p):
'\n Returns\n =======\n\n 1. 0 if a is multiple of p\n 2. 1 if a is a quadratic residue of p\n 3. -1 otherwise\n\n p should be an odd prime by definition\n\n Examples\n ========\n\n >>> from sympy.ntheory import legendre_symbol\n >>> [legendre_symbol(i, 7) fo... |
eeb5dba72a222b36f8d24eccbbfce745bcab4fc1cbc8bc09c94b44f481a21e7f | def jacobi_symbol(m, n):
'\n Returns the product of the legendre_symbol(m, p)\n for all the prime factors, p, of n.\n\n Returns\n =======\n\n 1. 0 if m cong 0 mod(n)\n 2. 1 if x**2 cong m mod(n) has a solution\n 3. -1 otherwise\n\n Examples\n ========\n\n >>> from sympy.ntheory import ... | Returns the product of the legendre_symbol(m, p)
for all the prime factors, p, of n.
Returns
=======
1. 0 if m cong 0 mod(n)
2. 1 if x**2 cong m mod(n) has a solution
3. -1 otherwise
Examples
========
>>> from sympy.ntheory import jacobi_symbol, legendre_symbol
>>> from sympy import Mul, S
>>> jacobi_symbol(45, 77)... | sympy/ntheory/residue_ntheory.py | jacobi_symbol | goodok/sympy | 2 | python | def jacobi_symbol(m, n):
'\n Returns the product of the legendre_symbol(m, p)\n for all the prime factors, p, of n.\n\n Returns\n =======\n\n 1. 0 if m cong 0 mod(n)\n 2. 1 if x**2 cong m mod(n) has a solution\n 3. -1 otherwise\n\n Examples\n ========\n\n >>> from sympy.ntheory import ... | def jacobi_symbol(m, n):
'\n Returns the product of the legendre_symbol(m, p)\n for all the prime factors, p, of n.\n\n Returns\n =======\n\n 1. 0 if m cong 0 mod(n)\n 2. 1 if x**2 cong m mod(n) has a solution\n 3. -1 otherwise\n\n Examples\n ========\n\n >>> from sympy.ntheory import ... |
164f792b287ec73f26b02fc6fd62e51e88673507708335095e9b5bede8e0fac8 | def get_membership_degree(self, value: float):
'\n for a given input value get the degrees of truth for each member available in the Membership object.\n\n :param value: float: value for which degrees of truth are of interest\n\n :return: returns memberships with an additional degree value\n ... | for a given input value get the degrees of truth for each member available in the Membership object.
:param value: float: value for which degrees of truth are of interest
:return: returns memberships with an additional degree value | components/controller/membership.py | get_membership_degree | Perledition/fuzzy-controller | 2 | python | def get_membership_degree(self, value: float):
'\n for a given input value get the degrees of truth for each member available in the Membership object.\n\n :param value: float: value for which degrees of truth are of interest\n\n :return: returns memberships with an additional degree value\n ... | def get_membership_degree(self, value: float):
'\n for a given input value get the degrees of truth for each member available in the Membership object.\n\n :param value: float: value for which degrees of truth are of interest\n\n :return: returns memberships with an additional degree value\n ... |
d2f81b551a58a92f22e77b92bee6973fb8793a79223e0b5ae10320287877577d | def get_member(self, name: str):
'\n get a member of the Membership object by it\'s name e.g "slow" if existing\n\n :param name: str: name of the member\n\n :return: dict of member, default or error case empty dict\n\n '
try:
return self.memberships[name]
except KeyError:... | get a member of the Membership object by it's name e.g "slow" if existing
:param name: str: name of the member
:return: dict of member, default or error case empty dict | components/controller/membership.py | get_member | Perledition/fuzzy-controller | 2 | python | def get_member(self, name: str):
'\n get a member of the Membership object by it\'s name e.g "slow" if existing\n\n :param name: str: name of the member\n\n :return: dict of member, default or error case empty dict\n\n '
try:
return self.memberships[name]
except KeyError:... | def get_member(self, name: str):
'\n get a member of the Membership object by it\'s name e.g "slow" if existing\n\n :param name: str: name of the member\n\n :return: dict of member, default or error case empty dict\n\n '
try:
return self.memberships[name]
except KeyError:... |
3f351955712ebf490cc1fcd63da82609a6d7ceb94a23aa2708f42ef2cf4aabb6 | def _contribute_max_min(self, value: float):
'\n class internal function to find the x and y values of a Membership object over all members\n :param value: float: x coordinate value of a member\n\n :return: None\n '
if (value > self.max_value):
self.max_value = value
elif... | class internal function to find the x and y values of a Membership object over all members
:param value: float: x coordinate value of a member
:return: None | components/controller/membership.py | _contribute_max_min | Perledition/fuzzy-controller | 2 | python | def _contribute_max_min(self, value: float):
'\n class internal function to find the x and y values of a Membership object over all members\n :param value: float: x coordinate value of a member\n\n :return: None\n '
if (value > self.max_value):
self.max_value = value
elif... | def _contribute_max_min(self, value: float):
'\n class internal function to find the x and y values of a Membership object over all members\n :param value: float: x coordinate value of a member\n\n :return: None\n '
if (value > self.max_value):
self.max_value = value
elif... |
09fb0460bec9b77ba7b182733b68d403fd0bee69bd4ad50bff611cdb2fd2f1d7 | def fit(self, members: dict, name: str=''):
'\n make the initialization of the Memberships objects members.\n\n :param members: dict: holding all members and ist lower, center and upper values\n :param name: str: name of the Membership object. Empty string default\n\n :return: None\n ... | make the initialization of the Memberships objects members.
:param members: dict: holding all members and ist lower, center and upper values
:param name: str: name of the Membership object. Empty string default
:return: None | components/controller/membership.py | fit | Perledition/fuzzy-controller | 2 | python | def fit(self, members: dict, name: str=):
'\n make the initialization of the Memberships objects members.\n\n :param members: dict: holding all members and ist lower, center and upper values\n :param name: str: name of the Membership object. Empty string default\n\n :return: None\n ... | def fit(self, members: dict, name: str=):
'\n make the initialization of the Memberships objects members.\n\n :param members: dict: holding all members and ist lower, center and upper values\n :param name: str: name of the Membership object. Empty string default\n\n :return: None\n ... |
9983b758d4218d6eb30539a4ba61abe2daa61a847ca3923def651062d3f9fae6 | def show(self):
'\n plots all class members.\n\n :return: None but displays graph\n '
for (category, values) in self.memberships.items():
plt.plot(values['coordinates']['x'], values['coordinates']['y'], label=category)
plt.title(self.name)
plt.xticks(self.measure)
plt.le... | plots all class members.
:return: None but displays graph | components/controller/membership.py | show | Perledition/fuzzy-controller | 2 | python | def show(self):
'\n plots all class members.\n\n :return: None but displays graph\n '
for (category, values) in self.memberships.items():
plt.plot(values['coordinates']['x'], values['coordinates']['y'], label=category)
plt.title(self.name)
plt.xticks(self.measure)
plt.le... | def show(self):
'\n plots all class members.\n\n :return: None but displays graph\n '
for (category, values) in self.memberships.items():
plt.plot(values['coordinates']['x'], values['coordinates']['y'], label=category)
plt.title(self.name)
plt.xticks(self.measure)
plt.le... |
24056e58902033fccd97c1d83f8f5feb00abd86009db64ac54b058a601794f7d | def normalize_context_key(string):
'Normalize context keys\n Function will normalize the string (remove white spaces and tailings)\n Args:\n string (str):\n Returns:\n Normalized string\n '
tmp = (string[:1].upper() + string[1:])
return tmp.replace(' ', '') | Normalize context keys
Function will normalize the string (remove white spaces and tailings)
Args:
string (str):
Returns:
Normalized string | Packs/AzureSecurityCenter/Integrations/AzureSecurityCenter_v2/AzureSecurityCenter_v2.py | normalize_context_key | jon-athon/content | 799 | python | def normalize_context_key(string):
'Normalize context keys\n Function will normalize the string (remove white spaces and tailings)\n Args:\n string (str):\n Returns:\n Normalized string\n '
tmp = (string[:1].upper() + string[1:])
return tmp.replace(' ', ) | def normalize_context_key(string):
'Normalize context keys\n Function will normalize the string (remove white spaces and tailings)\n Args:\n string (str):\n Returns:\n Normalized string\n '
tmp = (string[:1].upper() + string[1:])
return tmp.replace(' ', )<|docstring|>Normalize cont... |
61db247f85ff7a27cd8a7ccbe09791f397f4de69bdd962498ac5719eebd0759b | def get_alert_command(client: MsClient, args: dict):
'Getting specified alert from API\n Args\n args (dict): dictionary containing commands args\n '
resource_group_name = args.get('resource_group_name')
asc_location = args.get('asc_location')
alert_id = args.get('alert_id')
alert = clie... | Getting specified alert from API
Args
args (dict): dictionary containing commands args | Packs/AzureSecurityCenter/Integrations/AzureSecurityCenter_v2/AzureSecurityCenter_v2.py | get_alert_command | jon-athon/content | 799 | python | def get_alert_command(client: MsClient, args: dict):
'Getting specified alert from API\n Args\n args (dict): dictionary containing commands args\n '
resource_group_name = args.get('resource_group_name')
asc_location = args.get('asc_location')
alert_id = args.get('alert_id')
alert = clie... | def get_alert_command(client: MsClient, args: dict):
'Getting specified alert from API\n Args\n args (dict): dictionary containing commands args\n '
resource_group_name = args.get('resource_group_name')
asc_location = args.get('asc_location')
alert_id = args.get('alert_id')
alert = clie... |
0f18b51afcd9f33a3896b7d2af23435df7dc130017197030725aaf7bc17bd02c | def list_alerts_command(client: MsClient, args: dict):
'Getting all alerts\n\n Args:\n client:\n args (dict): usually demisto.args()\n '
resource_group_name = args.get('resource_group_name')
asc_location = args.get('asc_location')
filter_query = args.get('filter')
select_query = ... | Getting all alerts
Args:
client:
args (dict): usually demisto.args() | Packs/AzureSecurityCenter/Integrations/AzureSecurityCenter_v2/AzureSecurityCenter_v2.py | list_alerts_command | jon-athon/content | 799 | python | def list_alerts_command(client: MsClient, args: dict):
'Getting all alerts\n\n Args:\n client:\n args (dict): usually demisto.args()\n '
resource_group_name = args.get('resource_group_name')
asc_location = args.get('asc_location')
filter_query = args.get('filter')
select_query = ... | def list_alerts_command(client: MsClient, args: dict):
'Getting all alerts\n\n Args:\n client:\n args (dict): usually demisto.args()\n '
resource_group_name = args.get('resource_group_name')
asc_location = args.get('asc_location')
filter_query = args.get('filter')
select_query = ... |
79d6a7b04011934b5e2ad54149dd3849352d21b06b2c02173cad55fe6cab0dd3 | def update_alert_command(client: MsClient, args: dict):
'Update given alert\n\n Args:\n client: MsClient\n args (dict): usually demisto.args()\n '
resource_group_name = args.get('resource_group_name')
asc_location = args.get('asc_location')
alert_id = args.get('alert_id')
alert_u... | Update given alert
Args:
client: MsClient
args (dict): usually demisto.args() | Packs/AzureSecurityCenter/Integrations/AzureSecurityCenter_v2/AzureSecurityCenter_v2.py | update_alert_command | jon-athon/content | 799 | python | def update_alert_command(client: MsClient, args: dict):
'Update given alert\n\n Args:\n client: MsClient\n args (dict): usually demisto.args()\n '
resource_group_name = args.get('resource_group_name')
asc_location = args.get('asc_location')
alert_id = args.get('alert_id')
alert_u... | def update_alert_command(client: MsClient, args: dict):
'Update given alert\n\n Args:\n client: MsClient\n args (dict): usually demisto.args()\n '
resource_group_name = args.get('resource_group_name')
asc_location = args.get('asc_location')
alert_id = args.get('alert_id')
alert_u... |
a24c292f46d9cc37e910b5ed9b6a9865ca3c514b06ec8161156f2dbbde69ba6f | def list_locations_command(client: MsClient):
'Getting all locations\n '
locations = client.list_locations().get('value')
outputs = list()
if locations:
for location in locations:
if (location.get('properties') and location.get('properties').get('homeRegionName')):
... | Getting all locations | Packs/AzureSecurityCenter/Integrations/AzureSecurityCenter_v2/AzureSecurityCenter_v2.py | list_locations_command | jon-athon/content | 799 | python | def list_locations_command(client: MsClient):
'\n '
locations = client.list_locations().get('value')
outputs = list()
if locations:
for location in locations:
if (location.get('properties') and location.get('properties').get('homeRegionName')):
home_region_name = l... | def list_locations_command(client: MsClient):
'\n '
locations = client.list_locations().get('value')
outputs = list()
if locations:
for location in locations:
if (location.get('properties') and location.get('properties').get('homeRegionName')):
home_region_name = l... |
1404d27cda31f7d74ccb542f56045538bc2aad9595e64d10a761e95c6f697212 | def update_atp_command(client: MsClient, args: dict):
'Updating given Advanced Threat Protection (enable/disable)\n\n Args:\n client:\n args (dict): usually demisto.args()\n '
resource_group_name = args.get('resource_group_name')
setting_name = args.get('setting_name')
is_enabled = a... | Updating given Advanced Threat Protection (enable/disable)
Args:
client:
args (dict): usually demisto.args() | Packs/AzureSecurityCenter/Integrations/AzureSecurityCenter_v2/AzureSecurityCenter_v2.py | update_atp_command | jon-athon/content | 799 | python | def update_atp_command(client: MsClient, args: dict):
'Updating given Advanced Threat Protection (enable/disable)\n\n Args:\n client:\n args (dict): usually demisto.args()\n '
resource_group_name = args.get('resource_group_name')
setting_name = args.get('setting_name')
is_enabled = a... | def update_atp_command(client: MsClient, args: dict):
'Updating given Advanced Threat Protection (enable/disable)\n\n Args:\n client:\n args (dict): usually demisto.args()\n '
resource_group_name = args.get('resource_group_name')
setting_name = args.get('setting_name')
is_enabled = a... |
4c97fbe7b0b7d80b412623bd0aaa2a8f517bd0daad237f4f37cae7d99f262bcc | def get_atp_command(client: MsClient, args: dict):
'Get given Advanced Threat Protection settings\n\n Args:\n client:\n args (dict): usually demisto.args()\n '
resource_group_name = args.get('resource_group_name')
setting_name = args.get('setting_name')
storage_account = args.get('st... | Get given Advanced Threat Protection settings
Args:
client:
args (dict): usually demisto.args() | Packs/AzureSecurityCenter/Integrations/AzureSecurityCenter_v2/AzureSecurityCenter_v2.py | get_atp_command | jon-athon/content | 799 | python | def get_atp_command(client: MsClient, args: dict):
'Get given Advanced Threat Protection settings\n\n Args:\n client:\n args (dict): usually demisto.args()\n '
resource_group_name = args.get('resource_group_name')
setting_name = args.get('setting_name')
storage_account = args.get('st... | def get_atp_command(client: MsClient, args: dict):
'Get given Advanced Threat Protection settings\n\n Args:\n client:\n args (dict): usually demisto.args()\n '
resource_group_name = args.get('resource_group_name')
setting_name = args.get('setting_name')
storage_account = args.get('st... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.