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 |
|---|---|---|---|---|---|---|---|---|---|
eafbe70606b96dde0ab7004d8c99f701608e0f13a1ed233bf91f13fe2ca9d6cd | def fetch_remote_table(name, resource):
'\n uses pooch to cache files\n '
return resource.fetch(name) | uses pooch to cache files | pyremo/tables/_resources.py | fetch_remote_table | remo-rcm/pyremo2 | 0 | python | def fetch_remote_table(name, resource):
'\n \n '
return resource.fetch(name) | def fetch_remote_table(name, resource):
'\n \n '
return resource.fetch(name)<|docstring|>uses pooch to cache files<|endoftext|> |
5f2c532ef07e976de92a22ae67b5a4448ef91d721d893a3ce2c002a6257c5829 | def recv(self, message, ref, pos):
'\n Called when a message is received with decoded JSON content\n '
action = message.get('action', None)
if (action != 'pingdog'):
self.debug('{} - Receive: {} (ref:{}) - {}'.format(pos.name.encode('ascii', 'ignore'), message, ref, pos.uuid), color='c... | Called when a message is received with decoded JSON content | codenerix_pos/consumers.py | recv | centrologic/django-codenerix-pos | 3 | python | def recv(self, message, ref, pos):
'\n \n '
action = message.get('action', None)
if (action != 'pingdog'):
self.debug('{} - Receive: {} (ref:{}) - {}'.format(pos.name.encode('ascii', 'ignore'), message, ref, pos.uuid), color='cyan')
if (action == 'get_config'):
answer = {}
... | def recv(self, message, ref, pos):
'\n \n '
action = message.get('action', None)
if (action != 'pingdog'):
self.debug('{} - Receive: {} (ref:{}) - {}'.format(pos.name.encode('ascii', 'ignore'), message, ref, pos.uuid), color='cyan')
if (action == 'get_config'):
answer = {}
... |
1ae79a4b2abb3f0ae393be6249dab6855b53c1d187442604d854e9e127b7731b | def step_fn(step_dict):
'\n Create a step function from a dictionary.\n\n Parameters\n ----------\n step_dict : dict\n Dictionary of cut-offs and weight values.\n\n Returns\n -------\n\n weight_function : function\n Function return... | Create a step function from a dictionary.
Parameters
----------
step_dict : dict
Dictionary of cut-offs and weight values.
Returns
-------
weight_function : function
Function returning weight, for input distance or time, *x*.
Values beyo... | access/weights.py | step_fn | GeoDaCenter/submodule_template | 13 | python | def step_fn(step_dict):
'\n Create a step function from a dictionary.\n\n Parameters\n ----------\n step_dict : dict\n Dictionary of cut-offs and weight values.\n\n Returns\n -------\n\n weight_function : function\n Function return... | def step_fn(step_dict):
'\n Create a step function from a dictionary.\n\n Parameters\n ----------\n step_dict : dict\n Dictionary of cut-offs and weight values.\n\n Returns\n -------\n\n weight_function : function\n Function return... |
3816093058315500de8cd34fdb61327dc4190d76727b0364391ee557edc2f9c5 | def gaussian(sigma):
'\n Create a gaussian weight function, for a specified width, :math:`\\sigma`.\n The mean / location parameter is assumed to be 0.\n Note that the standard normalization of the Gaussian, :math:`1 / \\sqrt{2\\pi\\sigma^2}`,\n is *not* applied, so :math:`f(0) = 1` regardless of the va... | Create a gaussian weight function, for a specified width, :math:`\sigma`.
The mean / location parameter is assumed to be 0.
Note that the standard normalization of the Gaussian, :math:`1 / \sqrt{2\pi\sigma^2}`,
is *not* applied, so :math:`f(0) = 1` regardless of the value of :math:`\sigma`.
Of course, this is irrelevan... | access/weights.py | gaussian | GeoDaCenter/submodule_template | 13 | python | def gaussian(sigma):
'\n Create a gaussian weight function, for a specified width, :math:`\\sigma`.\n The mean / location parameter is assumed to be 0.\n Note that the standard normalization of the Gaussian, :math:`1 / \\sqrt{2\\pi\\sigma^2}`,\n is *not* applied, so :math:`f(0) = 1` regardless of the va... | def gaussian(sigma):
'\n Create a gaussian weight function, for a specified width, :math:`\\sigma`.\n The mean / location parameter is assumed to be 0.\n Note that the standard normalization of the Gaussian, :math:`1 / \\sqrt{2\\pi\\sigma^2}`,\n is *not* applied, so :math:`f(0) = 1` regardless of the va... |
2a1597ed0098ff497dfe20e8b674d01e4cac64b8d2171825de36fb8427318731 | def gravity(scale, alpha, min_dist=0):
"\n Create a gravity function from a scale :math:`s` and :math:`\\alpha` parameters\n as well as an optional minimum distance :math:`x_\\text{min}`.\n The function is of the form :math:`f(x) = (\\text{max}(x, x_\\text{min})/s)^\\alpha`.\n Note that there is no over... | Create a gravity function from a scale :math:`s` and :math:`\alpha` parameters
as well as an optional minimum distance :math:`x_\text{min}`.
The function is of the form :math:`f(x) = (\text{max}(x, x_\text{min})/s)^\alpha`.
Note that there is no overall normalization.
Parameters
----------
scale : float
... | access/weights.py | gravity | GeoDaCenter/submodule_template | 13 | python | def gravity(scale, alpha, min_dist=0):
"\n Create a gravity function from a scale :math:`s` and :math:`\\alpha` parameters\n as well as an optional minimum distance :math:`x_\\text{min}`.\n The function is of the form :math:`f(x) = (\\text{max}(x, x_\\text{min})/s)^\\alpha`.\n Note that there is no over... | def gravity(scale, alpha, min_dist=0):
"\n Create a gravity function from a scale :math:`s` and :math:`\\alpha` parameters\n as well as an optional minimum distance :math:`x_\\text{min}`.\n The function is of the form :math:`f(x) = (\\text{max}(x, x_\\text{min})/s)^\\alpha`.\n Note that there is no over... |
27b0d18305255685ddbf3e2a6a8195ec4bfb2798cd5c4cae6180bbf48775e32c | @property
def readable_key(self):
'Returns the key to readable values for this vocabulary.'
return 'role_name' | Returns the key to readable values for this vocabulary. | invenio_rdm_records/vocabularies/contributor_role.py | readable_key | slint/invenio-rdm-records | 0 | python | @property
def readable_key(self):
return 'role_name' | @property
def readable_key(self):
return 'role_name'<|docstring|>Returns the key to readable values for this vocabulary.<|endoftext|> |
1a223f713c64355cd53b9e0920ebfa4cf76c4d900fdc3f36cd81d9c568c5b632 | @property
def vocabulary_name(self):
'Returns the human readable name for this vocabulary.'
return 'role' | Returns the human readable name for this vocabulary. | invenio_rdm_records/vocabularies/contributor_role.py | vocabulary_name | slint/invenio-rdm-records | 0 | python | @property
def vocabulary_name(self):
return 'role' | @property
def vocabulary_name(self):
return 'role'<|docstring|>Returns the human readable name for this vocabulary.<|endoftext|> |
c07896a737d70aed129ea1e987ad83d4ad4b90b2e5cf7f64e67cf1b952ab74f4 | def format_convers_metadata(convers, participants):
'Format conversations metadata.\n\n Parameters\n ----------\n convers : array_like\n Array of `dict` conversations to format.\n\n Returns\n -------\n str\n Return the formatted metadata string.\n\n '
metadata_fmt = "[+] - ID:... | Format conversations metadata.
Parameters
----------
convers : array_like
Array of `dict` conversations to format.
Returns
-------
str
Return the formatted metadata string. | fbscraper/lib.py | format_convers_metadata | elcoc0/fbscraper | 8 | python | def format_convers_metadata(convers, participants):
'Format conversations metadata.\n\n Parameters\n ----------\n convers : array_like\n Array of `dict` conversations to format.\n\n Returns\n -------\n str\n Return the formatted metadata string.\n\n '
metadata_fmt = "[+] - ID:... | def format_convers_metadata(convers, participants):
'Format conversations metadata.\n\n Parameters\n ----------\n convers : array_like\n Array of `dict` conversations to format.\n\n Returns\n -------\n str\n Return the formatted metadata string.\n\n '
metadata_fmt = "[+] - ID:... |
3be5c157796026459e56337b4d290d6a018dcb28f8e0497602eed199fe61b954 | def build_fmt_str_from_enum(enums):
'Build formatted string from enum list.\n\n Parameters\n ----------\n enums: array_like\n Array of enums.\n\n Returns\n -------\n str\n Return the formatted string.\n\n '
formatted = '['
for e in enums:
formatted += (("'" + e.val... | Build formatted string from enum list.
Parameters
----------
enums: array_like
Array of enums.
Returns
-------
str
Return the formatted string. | fbscraper/lib.py | build_fmt_str_from_enum | elcoc0/fbscraper | 8 | python | def build_fmt_str_from_enum(enums):
'Build formatted string from enum list.\n\n Parameters\n ----------\n enums: array_like\n Array of enums.\n\n Returns\n -------\n str\n Return the formatted string.\n\n '
formatted = '['
for e in enums:
formatted += (("'" + e.val... | def build_fmt_str_from_enum(enums):
'Build formatted string from enum list.\n\n Parameters\n ----------\n enums: array_like\n Array of enums.\n\n Returns\n -------\n str\n Return the formatted string.\n\n '
formatted = '['
for e in enums:
formatted += (("'" + e.val... |
558a3ddac447f413b296fb1e08351b90fd177256ffcd9d3c6966b3f419fc90eb | def __init__(self, cnt):
'__init___ method.\n\n Parameters\n ----------\n cnt : int\n First value of the counter to print\n\n Attributes\n ----------\n run_flag : bool\n The thread will be running only if the run_flag is True.\n '
Thread.__i... | __init___ method.
Parameters
----------
cnt : int
First value of the counter to print
Attributes
----------
run_flag : bool
The thread will be running only if the run_flag is True. | fbscraper/lib.py | __init__ | elcoc0/fbscraper | 8 | python | def __init__(self, cnt):
'__init___ method.\n\n Parameters\n ----------\n cnt : int\n First value of the counter to print\n\n Attributes\n ----------\n run_flag : bool\n The thread will be running only if the run_flag is True.\n '
Thread.__i... | def __init__(self, cnt):
'__init___ method.\n\n Parameters\n ----------\n cnt : int\n First value of the counter to print\n\n Attributes\n ----------\n run_flag : bool\n The thread will be running only if the run_flag is True.\n '
Thread.__i... |
6120b0c013c13a6dbf8fd6acb872ca4ca2fec1c80edd565e1b5b49bfb41b4a2e | def run(self):
'Run method.'
notification_fmt = '{} - Remaining downloads : {} '
max_len_printed = (len((('[-]' + notification_fmt) + str(self.cnt))) - 4)
while self.run_flag:
print(((' ' * (max_len_printed + 1)) + '\r'), end='')
print(notification_fmt.format(next(self.loading_list),... | Run method. | fbscraper/lib.py | run | elcoc0/fbscraper | 8 | python | def run(self):
notification_fmt = '{} - Remaining downloads : {} '
max_len_printed = (len((('[-]' + notification_fmt) + str(self.cnt))) - 4)
while self.run_flag:
print(((' ' * (max_len_printed + 1)) + '\r'), end=)
print(notification_fmt.format(next(self.loading_list), self.cnt), end... | def run(self):
notification_fmt = '{} - Remaining downloads : {} '
max_len_printed = (len((('[-]' + notification_fmt) + str(self.cnt))) - 4)
while self.run_flag:
print(((' ' * (max_len_printed + 1)) + '\r'), end=)
print(notification_fmt.format(next(self.loading_list), self.cnt), end... |
c6faa2a491d5f07f605b44c9f07d2183ef6c1d71594c75acbb76e4fe90d0d40f | @magic_factory(call_button='Split', viewer={'visible': False}, ndim={'min': 2, 'max': 3})
def watershed_split(viewer: 'napari.viewer.Viewer', labels: 'napari.layers.Labels', points: 'napari.layers.Points', ndim: int=3):
'Execute watershed to split labels based on provided points.\n\n Only labels containing point... | Execute watershed to split labels based on provided points.
Only labels containing points will be modified. The operation will be
performed in-place on the input Labels layer.
Parameters
----------
viewer : napari.Viewer
The current viewer displaying the data.
labels : napari Labels layer
The layer containing... | zarpaint/_watershed.py | watershed_split | noisysky/zarpaint | 9 | python | @magic_factory(call_button='Split', viewer={'visible': False}, ndim={'min': 2, 'max': 3})
def watershed_split(viewer: 'napari.viewer.Viewer', labels: 'napari.layers.Labels', points: 'napari.layers.Points', ndim: int=3):
'Execute watershed to split labels based on provided points.\n\n Only labels containing point... | @magic_factory(call_button='Split', viewer={'visible': False}, ndim={'min': 2, 'max': 3})
def watershed_split(viewer: 'napari.viewer.Viewer', labels: 'napari.layers.Labels', points: 'napari.layers.Points', ndim: int=3):
'Execute watershed to split labels based on provided points.\n\n Only labels containing point... |
57801b029f08ee4bc0b5da58a61855e48eb00dc3f512450e242619b30032e2b1 | def _watershed_split(image, labels, points, compactness=200, connectivity_octahedron=7):
'\n Split labels with using points as markers for watershed\n '
connectivity = octahedron(connectivity_octahedron)
points = np.round(points).astype(int)
coords = tuple([points[(:, i)] for i in range(points.sha... | Split labels with using points as markers for watershed | zarpaint/_watershed.py | _watershed_split | noisysky/zarpaint | 9 | python | def _watershed_split(image, labels, points, compactness=200, connectivity_octahedron=7):
'\n \n '
connectivity = octahedron(connectivity_octahedron)
points = np.round(points).astype(int)
coords = tuple([points[(:, i)] for i in range(points.shape[1])])
p_lab = labels[coords]
p_lab = np.uniq... | def _watershed_split(image, labels, points, compactness=200, connectivity_octahedron=7):
'\n \n '
connectivity = octahedron(connectivity_octahedron)
points = np.round(points).astype(int)
coords = tuple([points[(:, i)] for i in range(points.shape[1])])
p_lab = labels[coords]
p_lab = np.uniq... |
83da585e45d9c88c39e066e8df5d7de6f8135134a1ff6fb3bbe5822900e6a207 | def run_simulation(self, simulation_id, simulation_parameters, time_step, base_simulation_id=None):
' executes the simulation with given parameters and stores results under the given simulation-id\n Args:\n simulation_id (str): identifier of the requested simulation\n simulation_paramet... | executes the simulation with given parameters and stores results under the given simulation-id
Args:
simulation_id (str): identifier of the requested simulation
simulation_parameters (dict): named parameter-values for the parametric fem-simulation
base_simulation_id (str): identifier of the basis simulation... | gym_fem/fem_wrapper.py | run_simulation | johannes-dornheim/Reinforce-FE | 0 | python | def run_simulation(self, simulation_id, simulation_parameters, time_step, base_simulation_id=None):
' executes the simulation with given parameters and stores results under the given simulation-id\n Args:\n simulation_id (str): identifier of the requested simulation\n simulation_paramet... | def run_simulation(self, simulation_id, simulation_parameters, time_step, base_simulation_id=None):
' executes the simulation with given parameters and stores results under the given simulation-id\n Args:\n simulation_id (str): identifier of the requested simulation\n simulation_paramet... |
f54b14d1b6a60474d503c20cdff1afca6cf8b34c9edda9e00807f6646597e023 | def simulation_results_available(self, simulation_id):
' Returns true if given simulation has been calculated and results are available\n Args:\n simulation_id (str): identifier of the requested simulation\n Returns:\n results_available (bool): true if results are available, else... | Returns true if given simulation has been calculated and results are available
Args:
simulation_id (str): identifier of the requested simulation
Returns:
results_available (bool): true if results are available, else false | gym_fem/fem_wrapper.py | simulation_results_available | johannes-dornheim/Reinforce-FE | 0 | python | def simulation_results_available(self, simulation_id):
' Returns true if given simulation has been calculated and results are available\n Args:\n simulation_id (str): identifier of the requested simulation\n Returns:\n results_available (bool): true if results are available, else... | def simulation_results_available(self, simulation_id):
' Returns true if given simulation has been calculated and results are available\n Args:\n simulation_id (str): identifier of the requested simulation\n Returns:\n results_available (bool): true if results are available, else... |
40a6784b865b344360d80376e75c59937374a8e57b1496b3718b4e7915c08670 | def read_simulation_results(self, simulation_id, root_simulation_id=None):
' Reads out results from the given simulation\n Args:\n simulation_id (str): identifier of the requested simulation\n root_simulation_id (str): identifier of the root simulation (first time-step)\n Returns... | Reads out results from the given simulation
Args:
simulation_id (str): identifier of the requested simulation
root_simulation_id (str): identifier of the root simulation (first time-step)
Returns:
simulation_results (tuple): Tuple of two Pandas Dictionaries: (element-wise results, node-wise results) | gym_fem/fem_wrapper.py | read_simulation_results | johannes-dornheim/Reinforce-FE | 0 | python | def read_simulation_results(self, simulation_id, root_simulation_id=None):
' Reads out results from the given simulation\n Args:\n simulation_id (str): identifier of the requested simulation\n root_simulation_id (str): identifier of the root simulation (first time-step)\n Returns... | def read_simulation_results(self, simulation_id, root_simulation_id=None):
' Reads out results from the given simulation\n Args:\n simulation_id (str): identifier of the requested simulation\n root_simulation_id (str): identifier of the root simulation (first time-step)\n Returns... |
7c1a0fe16f6af7072e6409498226163d2aa6df0081f57aa10ecfd50c8c54fc1e | def request_lock(self, simulation_id, timeout_seconds):
' locks the given simulation (to enable parallel environments based on the same simulation-storage)\n Args:\n simulation_id (str): identifier of the simulation\n timeout_seconds (int): seconds from now until lock times out\n ... | locks the given simulation (to enable parallel environments based on the same simulation-storage)
Args:
simulation_id (str): identifier of the simulation
timeout_seconds (int): seconds from now until lock times out
Returns:
locked (bool): True if the lock has been successfully established, false if the lock... | gym_fem/fem_wrapper.py | request_lock | johannes-dornheim/Reinforce-FE | 0 | python | def request_lock(self, simulation_id, timeout_seconds):
' locks the given simulation (to enable parallel environments based on the same simulation-storage)\n Args:\n simulation_id (str): identifier of the simulation\n timeout_seconds (int): seconds from now until lock times out\n ... | def request_lock(self, simulation_id, timeout_seconds):
' locks the given simulation (to enable parallel environments based on the same simulation-storage)\n Args:\n simulation_id (str): identifier of the simulation\n timeout_seconds (int): seconds from now until lock times out\n ... |
5c3a8dd0bd138403a006d9861a5c2d9215479cf2ec9ec63dfd46a648062c484e | def release_lock(self, simulation_id):
' Releases the simulation-lock\n Args:\n simulation_id (str): identifier of the requested simulation\n '
job_directory = self.simulation_store_path.joinpath(simulation_id)
lock = job_directory.joinpath('.fem_wrapper_lock')
if lock.exists():... | Releases the simulation-lock
Args:
simulation_id (str): identifier of the requested simulation | gym_fem/fem_wrapper.py | release_lock | johannes-dornheim/Reinforce-FE | 0 | python | def release_lock(self, simulation_id):
' Releases the simulation-lock\n Args:\n simulation_id (str): identifier of the requested simulation\n '
job_directory = self.simulation_store_path.joinpath(simulation_id)
lock = job_directory.joinpath('.fem_wrapper_lock')
if lock.exists():... | def release_lock(self, simulation_id):
' Releases the simulation-lock\n Args:\n simulation_id (str): identifier of the requested simulation\n '
job_directory = self.simulation_store_path.joinpath(simulation_id)
lock = job_directory.joinpath('.fem_wrapper_lock')
if lock.exists():... |
4dff726fe5cf265f7b45bccf2d96d0334e52edd2f05e8556c6fe9880ae2afe5f | def __init__(__self__, resource_name, opts=None, keepers=None, length=None, lower=None, min_lower=None, min_numeric=None, min_special=None, min_upper=None, number=None, override_special=None, special=None, upper=None, __props__=None, __name__=None, __opts__=None):
'\n > **Note:** Requires random provider ver... | > **Note:** Requires random provider version >= 2.2.0
Identical to .RandomString with the exception that the
result is treated as sensitive and, thus, _not_ displayed in console output.
> **Note:** All attributes including the generated password will be stored in
the raw state as plain-text. [Read more about sensitiv... | sdk/python/pulumi_random/random_password.py | __init__ | pulumi-bot/pulumi-random | 0 | python | def __init__(__self__, resource_name, opts=None, keepers=None, length=None, lower=None, min_lower=None, min_numeric=None, min_special=None, min_upper=None, number=None, override_special=None, special=None, upper=None, __props__=None, __name__=None, __opts__=None):
'\n > **Note:** Requires random provider ver... | def __init__(__self__, resource_name, opts=None, keepers=None, length=None, lower=None, min_lower=None, min_numeric=None, min_special=None, min_upper=None, number=None, override_special=None, special=None, upper=None, __props__=None, __name__=None, __opts__=None):
'\n > **Note:** Requires random provider ver... |
6ddea0eafed2048a5c7af3a3dcfa7f2296b7174539b062eb6f2bf472d4b4db9b | @staticmethod
def get(resource_name, id, opts=None, keepers=None, length=None, lower=None, min_lower=None, min_numeric=None, min_special=None, min_upper=None, number=None, override_special=None, result=None, special=None, upper=None):
"\n Get an existing RandomPassword resource's state with the given name, i... | Get an existing RandomPassword resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param str id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the re... | sdk/python/pulumi_random/random_password.py | get | pulumi-bot/pulumi-random | 0 | python | @staticmethod
def get(resource_name, id, opts=None, keepers=None, length=None, lower=None, min_lower=None, min_numeric=None, min_special=None, min_upper=None, number=None, override_special=None, result=None, special=None, upper=None):
"\n Get an existing RandomPassword resource's state with the given name, i... | @staticmethod
def get(resource_name, id, opts=None, keepers=None, length=None, lower=None, min_lower=None, min_numeric=None, min_special=None, min_upper=None, number=None, override_special=None, result=None, special=None, upper=None):
"\n Get an existing RandomPassword resource's state with the given name, i... |
ac618cdf1b7220b7b5c0aadaddfa328263e7c0d793ae1f70942c4b01d4da75c9 | @requires_application()
def test_markers():
'Test basic marker / point-sprite support'
np.random.seed(57983)
data = np.random.normal(size=(30, 2), loc=50, scale=10)
with TestingCanvas() as c:
marker = Markers(parent=c.scene)
marker.set_data(data)
assert_image_approved(c.render(),... | Test basic marker / point-sprite support | vispy/visuals/tests/test_markers.py | test_markers | PydPiper/vispy | 0 | python | @requires_application()
def test_markers():
np.random.seed(57983)
data = np.random.normal(size=(30, 2), loc=50, scale=10)
with TestingCanvas() as c:
marker = Markers(parent=c.scene)
marker.set_data(data)
assert_image_approved(c.render(), 'visuals/markers.png')
with TestingCa... | @requires_application()
def test_markers():
np.random.seed(57983)
data = np.random.normal(size=(30, 2), loc=50, scale=10)
with TestingCanvas() as c:
marker = Markers(parent=c.scene)
marker.set_data(data)
assert_image_approved(c.render(), 'visuals/markers.png')
with TestingCa... |
ab604357d5cbb082476d859135816531952585b99305b280417b7da99a5340a5 | def _after_init(self, dt):
'\n Binds events.\n '
self.update_roll_list() | Binds events. | src/etheroll/roll_results.py | _after_init | sanjusci/EtherollApp | 0 | python | def _after_init(self, dt):
'\n \n '
self.update_roll_list() | def _after_init(self, dt):
'\n \n '
self.update_roll_list()<|docstring|>Binds events.<|endoftext|> |
bdb3c0ae2a1cf63fde77e28bab0755995faa5c8cf9e291d7237595733ff7bcee | def on_scroll_stop(self, scroll_y):
'\n Refreshs roll results on overscroll.\n '
if ((scroll_y == 0) or (scroll_y >= 1.03)):
if (not self._fetching_results):
self.get_last_results() | Refreshs roll results on overscroll. | src/etheroll/roll_results.py | on_scroll_stop | sanjusci/EtherollApp | 0 | python | def on_scroll_stop(self, scroll_y):
'\n \n '
if ((scroll_y == 0) or (scroll_y >= 1.03)):
if (not self._fetching_results):
self.get_last_results() | def on_scroll_stop(self, scroll_y):
'\n \n '
if ((scroll_y == 0) or (scroll_y >= 1.03)):
if (not self._fetching_results):
self.get_last_results()<|docstring|>Refreshs roll results on overscroll.<|endoftext|> |
aaa3858b6ba65bf9b720bfb7e66b51a9908a40b5ada7615bfecaf04d2e90e938 | @property
def pyetheroll(self):
'\n We want to make sure we go through the `Controller.pyetheroll` property\n each time, because it recreates the Etheroll object on chain_id\n changes.\n '
controller = App.get_running_app().root
return controller.pyetheroll | We want to make sure we go through the `Controller.pyetheroll` property
each time, because it recreates the Etheroll object on chain_id
changes. | src/etheroll/roll_results.py | pyetheroll | sanjusci/EtherollApp | 0 | python | @property
def pyetheroll(self):
'\n We want to make sure we go through the `Controller.pyetheroll` property\n each time, because it recreates the Etheroll object on chain_id\n changes.\n '
controller = App.get_running_app().root
return controller.pyetheroll | @property
def pyetheroll(self):
'\n We want to make sure we go through the `Controller.pyetheroll` property\n each time, because it recreates the Etheroll object on chain_id\n changes.\n '
controller = App.get_running_app().root
return controller.pyetheroll<|docstring|>We want to... |
58fc8d823e006a77466e72b561ae64824bfdb2f682f5fc2c81c2e83e38e050cf | @mainthread
def on_roll_logs(self, instance, value):
'\n Updates UI using roll results list.\n '
self.update_roll_list() | Updates UI using roll results list. | src/etheroll/roll_results.py | on_roll_logs | sanjusci/EtherollApp | 0 | python | @mainthread
def on_roll_logs(self, instance, value):
'\n \n '
self.update_roll_list() | @mainthread
def on_roll_logs(self, instance, value):
'\n \n '
self.update_roll_list()<|docstring|>Updates UI using roll results list.<|endoftext|> |
2b86c4dd5a352bc46cda710f41770ec1a3d63d53690aa8025682a9229b4753df | @run_in_thread
def get_last_results(self):
'\n Gets last rolls & results using pyetheroll lib and updates `roll_logs`\n list property.\n '
from etherscan.client import ConnectionRefused
controller = App.get_running_app().root
account = controller.current_account
if (not account)... | Gets last rolls & results using pyetheroll lib and updates `roll_logs`
list property. | src/etheroll/roll_results.py | get_last_results | sanjusci/EtherollApp | 0 | python | @run_in_thread
def get_last_results(self):
'\n Gets last rolls & results using pyetheroll lib and updates `roll_logs`\n list property.\n '
from etherscan.client import ConnectionRefused
controller = App.get_running_app().root
account = controller.current_account
if (not account)... | @run_in_thread
def get_last_results(self):
'\n Gets last rolls & results using pyetheroll lib and updates `roll_logs`\n list property.\n '
from etherscan.client import ConnectionRefused
controller = App.get_running_app().root
account = controller.current_account
if (not account)... |
74bcc41e680e6202a9ce88389e2d4d1455dd0fe34339f124d330492d2c4c10d7 | @staticmethod
def create_item_from_dict(roll_log):
'\n Creates a roll list item from a roll log dictionary.\n '
from pyetheroll.utils import EtherollUtils
bet_log = roll_log['bet_log']
bet_result = roll_log['bet_result']
bet_value_ether = bet_log['bet_value_ether']
roll_under = bet... | Creates a roll list item from a roll log dictionary. | src/etheroll/roll_results.py | create_item_from_dict | sanjusci/EtherollApp | 0 | python | @staticmethod
def create_item_from_dict(roll_log):
'\n \n '
from pyetheroll.utils import EtherollUtils
bet_log = roll_log['bet_log']
bet_result = roll_log['bet_result']
bet_value_ether = bet_log['bet_value_ether']
roll_under = bet_log['roll_under']
date_time = bet_log['datetime... | @staticmethod
def create_item_from_dict(roll_log):
'\n \n '
from pyetheroll.utils import EtherollUtils
bet_log = roll_log['bet_log']
bet_result = roll_log['bet_result']
bet_value_ether = bet_log['bet_value_ether']
roll_under = bet_log['roll_under']
date_time = bet_log['datetime... |
0190a1b127309430f5bd081d1f18b875b7e254678a21253b1790abea58b8265a | def update_roll_list(self):
'\n Updates the roll results list widget.\n '
roll_list = self.ids.roll_list_id
roll_list.clear_widgets()
roll_logs = reversed(self.roll_logs)
for roll_log in roll_logs:
list_item = self.create_item_from_dict(roll_log)
roll_list.add_widget(li... | Updates the roll results list widget. | src/etheroll/roll_results.py | update_roll_list | sanjusci/EtherollApp | 0 | python | def update_roll_list(self):
'\n \n '
roll_list = self.ids.roll_list_id
roll_list.clear_widgets()
roll_logs = reversed(self.roll_logs)
for roll_log in roll_logs:
list_item = self.create_item_from_dict(roll_log)
roll_list.add_widget(list_item) | def update_roll_list(self):
'\n \n '
roll_list = self.ids.roll_list_id
roll_list.clear_widgets()
roll_logs = reversed(self.roll_logs)
for roll_log in roll_logs:
list_item = self.create_item_from_dict(roll_log)
roll_list.add_widget(list_item)<|docstring|>Updates the roll... |
a51cad9b500606a4aede7463347da2724f0d417462feccb10c0b7fb135a46b4d | def get_sessionId():
' 获取sessionId '
jstext = ' \n function get_sessionId(){\n var t, o;\n var sessionId;\n o = +new Date,\n sessionId = "" + (t || "xm_") + o.toString(36) + Math.random().toString(36).substr(2, 6)\n return sessionId\n }\n '
ctx = execjs.compile(jstext)
sessionId ... | 获取sessionId | DecryptLogin/core/ximalaya.py | get_sessionId | skygongque/DecryptLogin | 0 | python | def get_sessionId():
' '
jstext = ' \n function get_sessionId(){\n var t, o;\n var sessionId;\n o = +new Date,\n sessionId = + (t || "xm_") + o.toString(36) + Math.random().toString(36).substr(2, 6)\n return sessionId\n }\n '
ctx = execjs.compile(jstext)
sessionId = ctx.call('g... | def get_sessionId():
' '
jstext = ' \n function get_sessionId(){\n var t, o;\n var sessionId;\n o = +new Date,\n sessionId = + (t || "xm_") + o.toString(36) + Math.random().toString(36).substr(2, 6)\n return sessionId\n }\n '
ctx = execjs.compile(jstext)
sessionId = ctx.call('g... |
a753dd49f2aa99b25243539406192e00dab4c051a60be5ee58543b301208989c | def get_pos(image):
' 获取距离 '
' \n 原识别腾讯滑块验证 https://github.com/wkunzhi/Python3-Spider/blob/master/%E6%BB%91%E5%8A%A8%E9%AA%8C%E8%AF%81%E7%A0%81/%E3%80%90%E8%85%BE%E8%AE%AF%E3%80%91%E6%BB%91%E5%9D%97%E9%AA%8C%E8%AF%81/discriminate.py\n 改写后识别喜马拉雅滑块验证的准确率在60-70%\n '
blurred = cv.GaussianBlur(image, (5... | 获取距离 | DecryptLogin/core/ximalaya.py | get_pos | skygongque/DecryptLogin | 0 | python | def get_pos(image):
' '
' \n 原识别腾讯滑块验证 https://github.com/wkunzhi/Python3-Spider/blob/master/%E6%BB%91%E5%8A%A8%E9%AA%8C%E8%AF%81%E7%A0%81/%E3%80%90%E8%85%BE%E8%AE%AF%E3%80%91%E6%BB%91%E5%9D%97%E9%AA%8C%E8%AF%81/discriminate.py\n 改写后识别喜马拉雅滑块验证的准确率在60-70%\n '
blurred = cv.GaussianBlur(image, (5, 5)... | def get_pos(image):
' '
' \n 原识别腾讯滑块验证 https://github.com/wkunzhi/Python3-Spider/blob/master/%E6%BB%91%E5%8A%A8%E9%AA%8C%E8%AF%81%E7%A0%81/%E3%80%90%E8%85%BE%E8%AE%AF%E3%80%91%E6%BB%91%E5%9D%97%E9%AA%8C%E8%AF%81/discriminate.py\n 改写后识别喜马拉雅滑块验证的准确率在60-70%\n '
blurred = cv.GaussianBlur(image, (5, 5)... |
5b85f80dfc741b7be74c9b693a8542c6dfb605174dfe86e9d0b61cc3c655e0e6 | def encrypt_password(self, password):
' rsa加密密码,并用base64编码 '
modules = '009585A4773ABEECB949701D49762F2DFAB9599BA19DFE1E1A2FA200E32E0444F426DA528912D9EA8669515F6F1014C454E1343B97ABF7C10FE49D520A6999C66B230E0730C3F802D136A892501FF2B13D699B5C7ECBBFEF428AC36D3D83A5BD627F18746A7FDC774C12A38DE2760A3B95C653C10D7EB7F8... | rsa加密密码,并用base64编码 | DecryptLogin/core/ximalaya.py | encrypt_password | skygongque/DecryptLogin | 0 | python | def encrypt_password(self, password):
' '
modules = '009585A4773ABEECB949701D49762F2DFAB9599BA19DFE1E1A2FA200E32E0444F426DA528912D9EA8669515F6F1014C454E1343B97ABF7C10FE49D520A6999C66B230E0730C3F802D136A892501FF2B13D699B5C7ECBBFEF428AC36D3D83A5BD627F18746A7FDC774C12A38DE2760A3B95C653C10D7EB7F84722976251F649556B... | def encrypt_password(self, password):
' '
modules = '009585A4773ABEECB949701D49762F2DFAB9599BA19DFE1E1A2FA200E32E0444F426DA528912D9EA8669515F6F1014C454E1343B97ABF7C10FE49D520A6999C66B230E0730C3F802D136A892501FF2B13D699B5C7ECBBFEF428AC36D3D83A5BD627F18746A7FDC774C12A38DE2760A3B95C653C10D7EB7F84722976251F649556B... |
ebe5135329018cdae8b834d89499da3c67114fc3899ae843a89edba0b9535b2c | def get_signature(self, account, nonce, password):
' sha1进行签名 '
raw = f'account={account}&nonce={nonce}&password={password}&WEB-V1-PRODUCT-E7768904917C4154A925FBE1A3848BC3E84E2C7770744E56AFBC9600C267891F'
return hashlib.sha1(raw.upper().encode()).hexdigest() | sha1进行签名 | DecryptLogin/core/ximalaya.py | get_signature | skygongque/DecryptLogin | 0 | python | def get_signature(self, account, nonce, password):
' '
raw = f'account={account}&nonce={nonce}&password={password}&WEB-V1-PRODUCT-E7768904917C4154A925FBE1A3848BC3E84E2C7770744E56AFBC9600C267891F'
return hashlib.sha1(raw.upper().encode()).hexdigest() | def get_signature(self, account, nonce, password):
' '
raw = f'account={account}&nonce={nonce}&password={password}&WEB-V1-PRODUCT-E7768904917C4154A925FBE1A3848BC3E84E2C7770744E56AFBC9600C267891F'
return hashlib.sha1(raw.upper().encode()).hexdigest()<|docstring|>sha1进行签名<|endoftext|> |
038b9f8c611c28538016f5f6650dccfefd95ef44cc48d48dc0c66c2f6e958761 | def get_captcha_url(self, sessionId):
' 获取captcha_url '
params = {'bpId': '139', 'sessionId': sessionId}
response = self.session.get(self.captcha_url, params=params, headers=self.captcha_headers)
if (response.status_code == 200):
return response.json() | 获取captcha_url | DecryptLogin/core/ximalaya.py | get_captcha_url | skygongque/DecryptLogin | 0 | python | def get_captcha_url(self, sessionId):
' '
params = {'bpId': '139', 'sessionId': sessionId}
response = self.session.get(self.captcha_url, params=params, headers=self.captcha_headers)
if (response.status_code == 200):
return response.json() | def get_captcha_url(self, sessionId):
' '
params = {'bpId': '139', 'sessionId': sessionId}
response = self.session.get(self.captcha_url, params=params, headers=self.captcha_headers)
if (response.status_code == 200):
return response.json()<|docstring|>获取captcha_url<|endoftext|> |
b638b3c193c8f97449d2a70e1b98cc7a3c1c4895fd8facb89ae6e0ba31a3ae42 | def calculate_captcha_text(self, distance):
' 计算缺口偏移后的值 '
d = float(distance)
captcha_text_x = ((((((0.8 * d) + 10) * 0.9247) - 9.6) / 0.8) + 44)
return captcha_text_x | 计算缺口偏移后的值 | DecryptLogin/core/ximalaya.py | calculate_captcha_text | skygongque/DecryptLogin | 0 | python | def calculate_captcha_text(self, distance):
' '
d = float(distance)
captcha_text_x = ((((((0.8 * d) + 10) * 0.9247) - 9.6) / 0.8) + 44)
return captcha_text_x | def calculate_captcha_text(self, distance):
' '
d = float(distance)
captcha_text_x = ((((((0.8 * d) + 10) * 0.9247) - 9.6) / 0.8) + 44)
return captcha_text_x<|docstring|>计算缺口偏移后的值<|endoftext|> |
1315b7b87b2442e615032e0b82b12b2813bee975dc0feec87fe1db6463105f40 | def captcha_verify(self):
' 获得滑动验证通过后的token,最后的登录post需要添加到cookie中 '
token = None
while (token == None):
token = self.check_captcha()
time.sleep(1)
return token | 获得滑动验证通过后的token,最后的登录post需要添加到cookie中 | DecryptLogin/core/ximalaya.py | captcha_verify | skygongque/DecryptLogin | 0 | python | def captcha_verify(self):
' '
token = None
while (token == None):
token = self.check_captcha()
time.sleep(1)
return token | def captcha_verify(self):
' '
token = None
while (token == None):
token = self.check_captcha()
time.sleep(1)
return token<|docstring|>获得滑动验证通过后的token,最后的登录post需要添加到cookie中<|endoftext|> |
c8e85c3552e26fd9d8442d74b128fa5e0828362b07fcea4935e5aca801908744 | def measure(dataframe, smaperiod, minmaxperiod):
'measure things on dataframe\n smaperiod\n period in minutes of moving average\n minmaxperiod\n period to calculate the minimum/maximum over, in minutes\n '
timeidx = list(dataframe.columns).index('time')
basic_clock = int(((dataframe.i... | measure things on dataframe
smaperiod
period in minutes of moving average
minmaxperiod
period to calculate the minimum/maximum over, in minutes | quickndirtybot/strategies/minmax.py | measure | Heerpa/quickndirtybot | 0 | python | def measure(dataframe, smaperiod, minmaxperiod):
'measure things on dataframe\n smaperiod\n period in minutes of moving average\n minmaxperiod\n period to calculate the minimum/maximum over, in minutes\n '
timeidx = list(dataframe.columns).index('time')
basic_clock = int(((dataframe.i... | def measure(dataframe, smaperiod, minmaxperiod):
'measure things on dataframe\n smaperiod\n period in minutes of moving average\n minmaxperiod\n period to calculate the minimum/maximum over, in minutes\n '
timeidx = list(dataframe.columns).index('time')
basic_clock = int(((dataframe.i... |
24da07a92507102161ad5a3e2624ceedabed7d6fb706f8f8745a1790302f8bd3 | def findbuy(dataframe, thresh_maxovermin=1.0075):
'find time points for buying'
dataframe.loc[((((dataframe['sma-hi-now'] > dataframe['sma-hi-prev']) & (dataframe['sma-hi-prev'] < dataframe['min-hi-prev'])) & (dataframe['max/min'] > thresh_maxovermin)), 'buy')] = 1 | find time points for buying | quickndirtybot/strategies/minmax.py | findbuy | Heerpa/quickndirtybot | 0 | python | def findbuy(dataframe, thresh_maxovermin=1.0075):
dataframe.loc[((((dataframe['sma-hi-now'] > dataframe['sma-hi-prev']) & (dataframe['sma-hi-prev'] < dataframe['min-hi-prev'])) & (dataframe['max/min'] > thresh_maxovermin)), 'buy')] = 1 | def findbuy(dataframe, thresh_maxovermin=1.0075):
dataframe.loc[((((dataframe['sma-hi-now'] > dataframe['sma-hi-prev']) & (dataframe['sma-hi-prev'] < dataframe['min-hi-prev'])) & (dataframe['max/min'] > thresh_maxovermin)), 'buy')] = 1<|docstring|>find time points for buying<|endoftext|> |
5f365f445321ca99c9277bf227949d1f65fb6700af7ed1a04c8f480d09f763d6 | def findsell(dataframe, thresh_maxovermin=1.0075):
'find time points for selling'
dataframe.loc[((((dataframe['sma-lo-now'] < dataframe['sma-lo-prev']) & (dataframe['sma-lo-prev'] > dataframe['max-lo-prev'])) & (dataframe['max/min'] > thresh_maxovermin)), 'sell')] = 1 | find time points for selling | quickndirtybot/strategies/minmax.py | findsell | Heerpa/quickndirtybot | 0 | python | def findsell(dataframe, thresh_maxovermin=1.0075):
dataframe.loc[((((dataframe['sma-lo-now'] < dataframe['sma-lo-prev']) & (dataframe['sma-lo-prev'] > dataframe['max-lo-prev'])) & (dataframe['max/min'] > thresh_maxovermin)), 'sell')] = 1 | def findsell(dataframe, thresh_maxovermin=1.0075):
dataframe.loc[((((dataframe['sma-lo-now'] < dataframe['sma-lo-prev']) & (dataframe['sma-lo-prev'] > dataframe['max-lo-prev'])) & (dataframe['max/min'] > thresh_maxovermin)), 'sell')] = 1<|docstring|>find time points for selling<|endoftext|> |
3d1d263196dd69b1f8c78c6ed2c1a203b0c84569cbfcf43b24b87b968c39eb3e | def __validate_project_parameters(ctx: tp.Optional[click.Context], param: tp.Optional[click.Parameter], value: tp.Tuple[(str, ...)]) -> tp.Tuple[(str, ...)]:
'\n Sanity-check project/version specification.\n\n Currently, we only support the ``<project>@<revision>`` syntax. Checks\n whether ``project`` and ... | Sanity-check project/version specification.
Currently, we only support the ``<project>@<revision>`` syntax. Checks
whether ``project`` and (if available) ``version`` is selected by one of the
case studies in the current paper config. | varats/varats/tools/driver_run.py | __validate_project_parameters | Kaufi-Jonas/VaRA-Tool-Suite | 8 | python | def __validate_project_parameters(ctx: tp.Optional[click.Context], param: tp.Optional[click.Parameter], value: tp.Tuple[(str, ...)]) -> tp.Tuple[(str, ...)]:
'\n Sanity-check project/version specification.\n\n Currently, we only support the ``<project>@<revision>`` syntax. Checks\n whether ``project`` and ... | def __validate_project_parameters(ctx: tp.Optional[click.Context], param: tp.Optional[click.Parameter], value: tp.Tuple[(str, ...)]) -> tp.Tuple[(str, ...)]:
'\n Sanity-check project/version specification.\n\n Currently, we only support the ``<project>@<revision>`` syntax. Checks\n whether ``project`` and ... |
cbd5976a26ae39553a0382fa048652daa466e1910d68b21905301b2093bc5da3 | @click.command(context_settings={'help_option_names': ['-h', '--help']})
@click.option('-v', '--verbose', count=True)
@click.option('--slurm', is_flag=True, help='Run experiments on slurm.')
@click.option('--submit', is_flag=True, help='Submit generated slurm script via sbatch.')
@click.option('--container', is_flag=Tr... | Run benchbuild experiments.
Runs on all projects in the current paper config by default. You can
restrict this to only certain projects or even revisions using BenchBuild-
style project selectors: <project>[@<revision>] | varats/varats/tools/driver_run.py | main | Kaufi-Jonas/VaRA-Tool-Suite | 8 | python | @click.command(context_settings={'help_option_names': ['-h', '--help']})
@click.option('-v', '--verbose', count=True)
@click.option('--slurm', is_flag=True, help='Run experiments on slurm.')
@click.option('--submit', is_flag=True, help='Submit generated slurm script via sbatch.')
@click.option('--container', is_flag=Tr... | @click.command(context_settings={'help_option_names': ['-h', '--help']})
@click.option('-v', '--verbose', count=True)
@click.option('--slurm', is_flag=True, help='Run experiments on slurm.')
@click.option('--submit', is_flag=True, help='Submit generated slurm script via sbatch.')
@click.option('--container', is_flag=Tr... |
56202c89bcd62dd7aaf8128c50fa5c332871c67de11319d9e72822bc484773b3 | def __is_slurm_prepared() -> bool:
'Check whether the slurm/container setup seems to be configured\n properly.'
if (not bb_cfg()['container']['root'].value):
return False
if (not Path(bb_cfg()['slurm']['template'].value).exists()):
return False
return True | Check whether the slurm/container setup seems to be configured
properly. | varats/varats/tools/driver_run.py | __is_slurm_prepared | Kaufi-Jonas/VaRA-Tool-Suite | 8 | python | def __is_slurm_prepared() -> bool:
'Check whether the slurm/container setup seems to be configured\n properly.'
if (not bb_cfg()['container']['root'].value):
return False
if (not Path(bb_cfg()['slurm']['template'].value).exists()):
return False
return True | def __is_slurm_prepared() -> bool:
'Check whether the slurm/container setup seems to be configured\n properly.'
if (not bb_cfg()['container']['root'].value):
return False
if (not Path(bb_cfg()['slurm']['template'].value).exists()):
return False
return True<|docstring|>Check whether th... |
65a15c5d6aca000d2cb695fb8f3245982fa69c3b826fe26f4453365f9327a215 | def __init__(self):
'\n This is the class constructor which will be executed once.\n '
pass | This is the class constructor which will be executed once. | py3status/modules/empty_class.py | __init__ | Lujeni/py3status | 0 | python | def __init__(self):
'\n \n '
pass | def __init__(self):
'\n \n '
pass<|docstring|>This is the class constructor which will be executed once.<|endoftext|> |
a811972e622bafd26f32a2561df97a2cb28b2c34b47e7a3103639843ee649722 | def kill(self, i3s_output_list, i3s_config):
'\n This method will be called upon py3status exit.\n '
pass | This method will be called upon py3status exit. | py3status/modules/empty_class.py | kill | Lujeni/py3status | 0 | python | def kill(self, i3s_output_list, i3s_config):
'\n \n '
pass | def kill(self, i3s_output_list, i3s_config):
'\n \n '
pass<|docstring|>This method will be called upon py3status exit.<|endoftext|> |
0abe6b466376849a65a58a0317b2aaf4ccfab937f168fb338284e377706347b2 | def on_click(self, i3s_output_list, i3s_config, event):
"\n This method should only be used for ADVANCED and very specific usages.\n\n Read the 'Handle click events directly from your i3status config'\n article from the py3status wiki:\n https://github.com/ultrabug/py3status/wiki/\n\... | This method should only be used for ADVANCED and very specific usages.
Read the 'Handle click events directly from your i3status config'
article from the py3status wiki:
https://github.com/ultrabug/py3status/wiki/
This method will be called when a click event occurs on this module's
output on the i3bar.
Example ... | py3status/modules/empty_class.py | on_click | Lujeni/py3status | 0 | python | def on_click(self, i3s_output_list, i3s_config, event):
"\n This method should only be used for ADVANCED and very specific usages.\n\n Read the 'Handle click events directly from your i3status config'\n article from the py3status wiki:\n https://github.com/ultrabug/py3status/wiki/\n\... | def on_click(self, i3s_output_list, i3s_config, event):
"\n This method should only be used for ADVANCED and very specific usages.\n\n Read the 'Handle click events directly from your i3status config'\n article from the py3status wiki:\n https://github.com/ultrabug/py3status/wiki/\n\... |
2f6b2497ce902eb93d0132fef105dbdcb59ecd12f8cc724ad6301aa8bd2bed56 | def empty(self, i3s_output_list, i3s_config):
"\n This method will return an empty text message\n so it will NOT be displayed on your i3bar.\n\n If you want something displayed you should write something\n in the 'full_text' key of your response.\n\n See the i3bar protocol spec fo... | This method will return an empty text message
so it will NOT be displayed on your i3bar.
If you want something displayed you should write something
in the 'full_text' key of your response.
See the i3bar protocol spec for more information:
http://i3wm.org/docs/i3bar-protocol.html | py3status/modules/empty_class.py | empty | Lujeni/py3status | 0 | python | def empty(self, i3s_output_list, i3s_config):
"\n This method will return an empty text message\n so it will NOT be displayed on your i3bar.\n\n If you want something displayed you should write something\n in the 'full_text' key of your response.\n\n See the i3bar protocol spec fo... | def empty(self, i3s_output_list, i3s_config):
"\n This method will return an empty text message\n so it will NOT be displayed on your i3bar.\n\n If you want something displayed you should write something\n in the 'full_text' key of your response.\n\n See the i3bar protocol spec fo... |
bab21d1f2149a6f16ff1d37c89d0137471291e51275e5112f680ea819ef59c84 | def __init__(__self__, *, ad: pulumi.Input[str], blockchain_platform_id: pulumi.Input[str], ocpu_allocation_param: Optional[pulumi.Input['OsnOcpuAllocationParamArgs']]=None):
"\n The set of arguments for constructing a Osn resource.\n :param pulumi.Input[str] ad: Availability Domain to place new OSN\n... | The set of arguments for constructing a Osn resource.
:param pulumi.Input[str] ad: Availability Domain to place new OSN
:param pulumi.Input[str] blockchain_platform_id: Unique service identifier.
:param pulumi.Input['OsnOcpuAllocationParamArgs'] ocpu_allocation_param: (Updatable) OCPU allocation parameter | sdk/python/pulumi_oci/blockchain/osn.py | __init__ | pellizzetti/pulumi-oci-dev | 5 | python | def __init__(__self__, *, ad: pulumi.Input[str], blockchain_platform_id: pulumi.Input[str], ocpu_allocation_param: Optional[pulumi.Input['OsnOcpuAllocationParamArgs']]=None):
"\n The set of arguments for constructing a Osn resource.\n :param pulumi.Input[str] ad: Availability Domain to place new OSN\n... | def __init__(__self__, *, ad: pulumi.Input[str], blockchain_platform_id: pulumi.Input[str], ocpu_allocation_param: Optional[pulumi.Input['OsnOcpuAllocationParamArgs']]=None):
"\n The set of arguments for constructing a Osn resource.\n :param pulumi.Input[str] ad: Availability Domain to place new OSN\n... |
711ecc626f5a611a7e7547d60fc16b6be6d4dadbb2fff8a70098770de552590c | @property
@pulumi.getter
def ad(self) -> pulumi.Input[str]:
'\n Availability Domain to place new OSN\n '
return pulumi.get(self, 'ad') | Availability Domain to place new OSN | sdk/python/pulumi_oci/blockchain/osn.py | ad | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter
def ad(self) -> pulumi.Input[str]:
'\n \n '
return pulumi.get(self, 'ad') | @property
@pulumi.getter
def ad(self) -> pulumi.Input[str]:
'\n \n '
return pulumi.get(self, 'ad')<|docstring|>Availability Domain to place new OSN<|endoftext|> |
5e76beb03e58c829dfb821c19971d6d6d6a9acde2246ce4e9038b32ae4df18dc | @property
@pulumi.getter(name='blockchainPlatformId')
def blockchain_platform_id(self) -> pulumi.Input[str]:
'\n Unique service identifier.\n '
return pulumi.get(self, 'blockchain_platform_id') | Unique service identifier. | sdk/python/pulumi_oci/blockchain/osn.py | blockchain_platform_id | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter(name='blockchainPlatformId')
def blockchain_platform_id(self) -> pulumi.Input[str]:
'\n \n '
return pulumi.get(self, 'blockchain_platform_id') | @property
@pulumi.getter(name='blockchainPlatformId')
def blockchain_platform_id(self) -> pulumi.Input[str]:
'\n \n '
return pulumi.get(self, 'blockchain_platform_id')<|docstring|>Unique service identifier.<|endoftext|> |
632e906104220a1f84e4e351e811d83f339a755c83033e4389678776303a989f | @property
@pulumi.getter(name='ocpuAllocationParam')
def ocpu_allocation_param(self) -> Optional[pulumi.Input['OsnOcpuAllocationParamArgs']]:
'\n (Updatable) OCPU allocation parameter\n '
return pulumi.get(self, 'ocpu_allocation_param') | (Updatable) OCPU allocation parameter | sdk/python/pulumi_oci/blockchain/osn.py | ocpu_allocation_param | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter(name='ocpuAllocationParam')
def ocpu_allocation_param(self) -> Optional[pulumi.Input['OsnOcpuAllocationParamArgs']]:
'\n \n '
return pulumi.get(self, 'ocpu_allocation_param') | @property
@pulumi.getter(name='ocpuAllocationParam')
def ocpu_allocation_param(self) -> Optional[pulumi.Input['OsnOcpuAllocationParamArgs']]:
'\n \n '
return pulumi.get(self, 'ocpu_allocation_param')<|docstring|>(Updatable) OCPU allocation parameter<|endoftext|> |
cbba86afe275eac682b27fd35e024a604589b7ad05c32dc451db309228259d19 | def __init__(__self__, *, ad: Optional[pulumi.Input[str]]=None, blockchain_platform_id: Optional[pulumi.Input[str]]=None, ocpu_allocation_param: Optional[pulumi.Input['OsnOcpuAllocationParamArgs']]=None, osn_key: Optional[pulumi.Input[str]]=None, state: Optional[pulumi.Input[str]]=None):
"\n Input properties... | Input properties used for looking up and filtering Osn resources.
:param pulumi.Input[str] ad: Availability Domain to place new OSN
:param pulumi.Input[str] blockchain_platform_id: Unique service identifier.
:param pulumi.Input['OsnOcpuAllocationParamArgs'] ocpu_allocation_param: (Updatable) OCPU allocation parameter
:... | sdk/python/pulumi_oci/blockchain/osn.py | __init__ | pellizzetti/pulumi-oci-dev | 5 | python | def __init__(__self__, *, ad: Optional[pulumi.Input[str]]=None, blockchain_platform_id: Optional[pulumi.Input[str]]=None, ocpu_allocation_param: Optional[pulumi.Input['OsnOcpuAllocationParamArgs']]=None, osn_key: Optional[pulumi.Input[str]]=None, state: Optional[pulumi.Input[str]]=None):
"\n Input properties... | def __init__(__self__, *, ad: Optional[pulumi.Input[str]]=None, blockchain_platform_id: Optional[pulumi.Input[str]]=None, ocpu_allocation_param: Optional[pulumi.Input['OsnOcpuAllocationParamArgs']]=None, osn_key: Optional[pulumi.Input[str]]=None, state: Optional[pulumi.Input[str]]=None):
"\n Input properties... |
1c021e60651a75bb488b08b789ae336efb75e7c047e311661cf4c1324edd7731 | @property
@pulumi.getter
def ad(self) -> Optional[pulumi.Input[str]]:
'\n Availability Domain to place new OSN\n '
return pulumi.get(self, 'ad') | Availability Domain to place new OSN | sdk/python/pulumi_oci/blockchain/osn.py | ad | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter
def ad(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'ad') | @property
@pulumi.getter
def ad(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'ad')<|docstring|>Availability Domain to place new OSN<|endoftext|> |
a4d1d0d6685e11843793332b3f1192933326cb39b0a02ca2573b6fe6eb9db850 | @property
@pulumi.getter(name='blockchainPlatformId')
def blockchain_platform_id(self) -> Optional[pulumi.Input[str]]:
'\n Unique service identifier.\n '
return pulumi.get(self, 'blockchain_platform_id') | Unique service identifier. | sdk/python/pulumi_oci/blockchain/osn.py | blockchain_platform_id | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter(name='blockchainPlatformId')
def blockchain_platform_id(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'blockchain_platform_id') | @property
@pulumi.getter(name='blockchainPlatformId')
def blockchain_platform_id(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'blockchain_platform_id')<|docstring|>Unique service identifier.<|endoftext|> |
632e906104220a1f84e4e351e811d83f339a755c83033e4389678776303a989f | @property
@pulumi.getter(name='ocpuAllocationParam')
def ocpu_allocation_param(self) -> Optional[pulumi.Input['OsnOcpuAllocationParamArgs']]:
'\n (Updatable) OCPU allocation parameter\n '
return pulumi.get(self, 'ocpu_allocation_param') | (Updatable) OCPU allocation parameter | sdk/python/pulumi_oci/blockchain/osn.py | ocpu_allocation_param | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter(name='ocpuAllocationParam')
def ocpu_allocation_param(self) -> Optional[pulumi.Input['OsnOcpuAllocationParamArgs']]:
'\n \n '
return pulumi.get(self, 'ocpu_allocation_param') | @property
@pulumi.getter(name='ocpuAllocationParam')
def ocpu_allocation_param(self) -> Optional[pulumi.Input['OsnOcpuAllocationParamArgs']]:
'\n \n '
return pulumi.get(self, 'ocpu_allocation_param')<|docstring|>(Updatable) OCPU allocation parameter<|endoftext|> |
2da576e2bce2669cd2c00dc2dfa0b61b3f25ffa4c5a30d00614410ef0d5a014b | @property
@pulumi.getter(name='osnKey')
def osn_key(self) -> Optional[pulumi.Input[str]]:
'\n OSN identifier\n '
return pulumi.get(self, 'osn_key') | OSN identifier | sdk/python/pulumi_oci/blockchain/osn.py | osn_key | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter(name='osnKey')
def osn_key(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'osn_key') | @property
@pulumi.getter(name='osnKey')
def osn_key(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'osn_key')<|docstring|>OSN identifier<|endoftext|> |
a396cb94f4d1f8e07062fdaad4669aab211bb6b62f4d5b0814ec307fb0308f09 | @property
@pulumi.getter
def state(self) -> Optional[pulumi.Input[str]]:
'\n The current state of the OSN.\n '
return pulumi.get(self, 'state') | The current state of the OSN. | sdk/python/pulumi_oci/blockchain/osn.py | state | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter
def state(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'state') | @property
@pulumi.getter
def state(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'state')<|docstring|>The current state of the OSN.<|endoftext|> |
3bd6098f34ec97429369edb68b4d37b215aa7274a2a529d825aa28a081ed47e5 | @overload
def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, ad: Optional[pulumi.Input[str]]=None, blockchain_platform_id: Optional[pulumi.Input[str]]=None, ocpu_allocation_param: Optional[pulumi.Input[pulumi.InputType['OsnOcpuAllocationParamArgs']]]=None, __props__=None):
'\n ... | This resource provides the Osn resource in Oracle Cloud Infrastructure Blockchain service.
Create Blockchain Platform Osn
## Example Usage
```python
import pulumi
import pulumi_oci as oci
test_osn = oci.blockchain.Osn("testOsn",
ad=var["osn_ad"],
blockchain_platform_id=oci_blockchain_blockchain_platform["te... | sdk/python/pulumi_oci/blockchain/osn.py | __init__ | pellizzetti/pulumi-oci-dev | 5 | python | @overload
def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, ad: Optional[pulumi.Input[str]]=None, blockchain_platform_id: Optional[pulumi.Input[str]]=None, ocpu_allocation_param: Optional[pulumi.Input[pulumi.InputType['OsnOcpuAllocationParamArgs']]]=None, __props__=None):
'\n ... | @overload
def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, ad: Optional[pulumi.Input[str]]=None, blockchain_platform_id: Optional[pulumi.Input[str]]=None, ocpu_allocation_param: Optional[pulumi.Input[pulumi.InputType['OsnOcpuAllocationParamArgs']]]=None, __props__=None):
'\n ... |
87159186c6f4d66ec19f90439140f32244cc4410e8d90742059ea26121c02fe2 | @overload
def __init__(__self__, resource_name: str, args: OsnArgs, opts: Optional[pulumi.ResourceOptions]=None):
'\n This resource provides the Osn resource in Oracle Cloud Infrastructure Blockchain service.\n\n Create Blockchain Platform Osn\n\n ## Example Usage\n\n ```python\n ... | This resource provides the Osn resource in Oracle Cloud Infrastructure Blockchain service.
Create Blockchain Platform Osn
## Example Usage
```python
import pulumi
import pulumi_oci as oci
test_osn = oci.blockchain.Osn("testOsn",
ad=var["osn_ad"],
blockchain_platform_id=oci_blockchain_blockchain_platform["te... | sdk/python/pulumi_oci/blockchain/osn.py | __init__ | pellizzetti/pulumi-oci-dev | 5 | python | @overload
def __init__(__self__, resource_name: str, args: OsnArgs, opts: Optional[pulumi.ResourceOptions]=None):
'\n This resource provides the Osn resource in Oracle Cloud Infrastructure Blockchain service.\n\n Create Blockchain Platform Osn\n\n ## Example Usage\n\n ```python\n ... | @overload
def __init__(__self__, resource_name: str, args: OsnArgs, opts: Optional[pulumi.ResourceOptions]=None):
'\n This resource provides the Osn resource in Oracle Cloud Infrastructure Blockchain service.\n\n Create Blockchain Platform Osn\n\n ## Example Usage\n\n ```python\n ... |
d562892551e6c92d6421327de7ae26aaca8bf438db81a3358373b8e863be2e08 | @staticmethod
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None, ad: Optional[pulumi.Input[str]]=None, blockchain_platform_id: Optional[pulumi.Input[str]]=None, ocpu_allocation_param: Optional[pulumi.Input[pulumi.InputType['OsnOcpuAllocationParamArgs']]]=None, osn_key: Optio... | Get an existing Osn resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the... | sdk/python/pulumi_oci/blockchain/osn.py | get | pellizzetti/pulumi-oci-dev | 5 | python | @staticmethod
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None, ad: Optional[pulumi.Input[str]]=None, blockchain_platform_id: Optional[pulumi.Input[str]]=None, ocpu_allocation_param: Optional[pulumi.Input[pulumi.InputType['OsnOcpuAllocationParamArgs']]]=None, osn_key: Optio... | @staticmethod
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None, ad: Optional[pulumi.Input[str]]=None, blockchain_platform_id: Optional[pulumi.Input[str]]=None, ocpu_allocation_param: Optional[pulumi.Input[pulumi.InputType['OsnOcpuAllocationParamArgs']]]=None, osn_key: Optio... |
0abf76d5824f733d1c15cda2a1ace6b7ee84c6d374e843a48bd0a3b18d85f6d4 | @property
@pulumi.getter
def ad(self) -> pulumi.Output[str]:
'\n Availability Domain to place new OSN\n '
return pulumi.get(self, 'ad') | Availability Domain to place new OSN | sdk/python/pulumi_oci/blockchain/osn.py | ad | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter
def ad(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'ad') | @property
@pulumi.getter
def ad(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'ad')<|docstring|>Availability Domain to place new OSN<|endoftext|> |
7564858ed587e32b6acd3a6cff8cc2ebf06bbebd38b72842449b5c00ca7afa80 | @property
@pulumi.getter(name='blockchainPlatformId')
def blockchain_platform_id(self) -> pulumi.Output[str]:
'\n Unique service identifier.\n '
return pulumi.get(self, 'blockchain_platform_id') | Unique service identifier. | sdk/python/pulumi_oci/blockchain/osn.py | blockchain_platform_id | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter(name='blockchainPlatformId')
def blockchain_platform_id(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'blockchain_platform_id') | @property
@pulumi.getter(name='blockchainPlatformId')
def blockchain_platform_id(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'blockchain_platform_id')<|docstring|>Unique service identifier.<|endoftext|> |
c62743e7123f69ad539505809ce3d069c8f472aa9c6a1d7468df43b6cc643b9f | @property
@pulumi.getter(name='ocpuAllocationParam')
def ocpu_allocation_param(self) -> pulumi.Output['outputs.OsnOcpuAllocationParam']:
'\n (Updatable) OCPU allocation parameter\n '
return pulumi.get(self, 'ocpu_allocation_param') | (Updatable) OCPU allocation parameter | sdk/python/pulumi_oci/blockchain/osn.py | ocpu_allocation_param | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter(name='ocpuAllocationParam')
def ocpu_allocation_param(self) -> pulumi.Output['outputs.OsnOcpuAllocationParam']:
'\n \n '
return pulumi.get(self, 'ocpu_allocation_param') | @property
@pulumi.getter(name='ocpuAllocationParam')
def ocpu_allocation_param(self) -> pulumi.Output['outputs.OsnOcpuAllocationParam']:
'\n \n '
return pulumi.get(self, 'ocpu_allocation_param')<|docstring|>(Updatable) OCPU allocation parameter<|endoftext|> |
7b661121b1bd01b9b0f0cc1892f29110f8eed61953946f88601e6227d12f0174 | @property
@pulumi.getter(name='osnKey')
def osn_key(self) -> pulumi.Output[str]:
'\n OSN identifier\n '
return pulumi.get(self, 'osn_key') | OSN identifier | sdk/python/pulumi_oci/blockchain/osn.py | osn_key | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter(name='osnKey')
def osn_key(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'osn_key') | @property
@pulumi.getter(name='osnKey')
def osn_key(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'osn_key')<|docstring|>OSN identifier<|endoftext|> |
eb1a37b14c13895552ca544c3f48d979c87201e4667e2dc802a6888c465de205 | @property
@pulumi.getter
def state(self) -> pulumi.Output[str]:
'\n The current state of the OSN.\n '
return pulumi.get(self, 'state') | The current state of the OSN. | sdk/python/pulumi_oci/blockchain/osn.py | state | pellizzetti/pulumi-oci-dev | 5 | python | @property
@pulumi.getter
def state(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'state') | @property
@pulumi.getter
def state(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'state')<|docstring|>The current state of the OSN.<|endoftext|> |
16318dda05d0cd8fdc496b97a4ca8f82ab53e70ae9c7d90ff42b5c95ee8c5399 | def main():
"\n Utility script used to read a png image and return the indices of the black\n pixels in that image.\n\n Output is written as indices to a file named 'out', and image is read from\n image path in variable 'logo'.\n\n "
out = 'logo.txt'
logo = 'logo.png'
im = Image.open(logo)
pix ... | Utility script used to read a png image and return the indices of the black
pixels in that image.
Output is written as indices to a file named 'out', and image is read from
image path in variable 'logo'. | frontend/examples/inconvergent/scripts/get_inds.py | main | FunctionReturn/Moon | 6,904 | python | def main():
"\n Utility script used to read a png image and return the indices of the black\n pixels in that image.\n\n Output is written as indices to a file named 'out', and image is read from\n image path in variable 'logo'.\n\n "
out = 'logo.txt'
logo = 'logo.png'
im = Image.open(logo)
pix ... | def main():
"\n Utility script used to read a png image and return the indices of the black\n pixels in that image.\n\n Output is written as indices to a file named 'out', and image is read from\n image path in variable 'logo'.\n\n "
out = 'logo.txt'
logo = 'logo.png'
im = Image.open(logo)
pix ... |
d7e1b446b035d2fd4dc75213dc8dd21fc42def83dd2893b888f83d44fab5a861 | async def flash(status, msg, template):
'Flashes a success/error message on a specified template.'
return (await render_template(f'{template}.html', flash=msg, status=status)) | Flashes a success/error message on a specified template. | objects/utils.py | flash | circles-fun/circles-web | 1 | python | async def flash(status, msg, template):
return (await render_template(f'{template}.html', flash=msg, status=status)) | async def flash(status, msg, template):
return (await render_template(f'{template}.html', flash=msg, status=status))<|docstring|>Flashes a success/error message on a specified template.<|endoftext|> |
146f8aab843d9364d6a7010b4e9cb231763f1243382526fecc9e50da7bc95702 | def mode_mods_to_int(mode: str) -> int:
'Converts mode_mods (str) to mode_mods (int).'
for (mode_num, mode_str) in enumerate(('vn_std', 'vn_taiko', 'vn_catch', 'vn_mania', 'rx_std', 'rx_taiko', 'rx_catch', 'ap_std')):
if (mode == mode_str):
return mode_num
else:
return 0 | Converts mode_mods (str) to mode_mods (int). | objects/utils.py | mode_mods_to_int | circles-fun/circles-web | 1 | python | def mode_mods_to_int(mode: str) -> int:
for (mode_num, mode_str) in enumerate(('vn_std', 'vn_taiko', 'vn_catch', 'vn_mania', 'rx_std', 'rx_taiko', 'rx_catch', 'ap_std')):
if (mode == mode_str):
return mode_num
else:
return 0 | def mode_mods_to_int(mode: str) -> int:
for (mode_num, mode_str) in enumerate(('vn_std', 'vn_taiko', 'vn_catch', 'vn_mania', 'rx_std', 'rx_taiko', 'rx_catch', 'ap_std')):
if (mode == mode_str):
return mode_num
else:
return 0<|docstring|>Converts mode_mods (str) to mode_mods (int... |
4156058009a3e26f5a6b731b75988c16b77df00ee7ffa6ff43b249857422a053 | async def flash(status: str, msg: str, template: str) -> str:
'Flashes a success/error message on a specified template.'
return (await render_template(f'{template}.html', flash=msg, status=status)) | Flashes a success/error message on a specified template. | objects/utils.py | flash | circles-fun/circles-web | 1 | python | async def flash(status: str, msg: str, template: str) -> str:
return (await render_template(f'{template}.html', flash=msg, status=status)) | async def flash(status: str, msg: str, template: str) -> str:
return (await render_template(f'{template}.html', flash=msg, status=status))<|docstring|>Flashes a success/error message on a specified template.<|endoftext|> |
4b8775325a2a351e18cbd276e9e795bd0d349716e6692f818f5fb81ac2851a57 | async def flash_with_customizations(status: str, msg: str, template: str) -> str:
'Flashes a success/error message on a specified template. (for customisation settings)'
profile_customizations = utils.has_profile_customizations(session['user_data']['id'])
return (await render_template(template_name_or_list=... | Flashes a success/error message on a specified template. (for customisation settings) | objects/utils.py | flash_with_customizations | circles-fun/circles-web | 1 | python | async def flash_with_customizations(status: str, msg: str, template: str) -> str:
profile_customizations = utils.has_profile_customizations(session['user_data']['id'])
return (await render_template(template_name_or_list=f'{template}.html', flash=msg, status=status, customizations=profile_customizations)) | async def flash_with_customizations(status: str, msg: str, template: str) -> str:
profile_customizations = utils.has_profile_customizations(session['user_data']['id'])
return (await render_template(template_name_or_list=f'{template}.html', flash=msg, status=status, customizations=profile_customizations))<|... |
d33b24f65e712f27384fa998bd2814eb00e0d26b6e7ca166ef04234494c4269e | def get_safe_name(name: str) -> str:
'Returns the safe version of a username.'
return name.lower().replace(' ', '_') | Returns the safe version of a username. | objects/utils.py | get_safe_name | circles-fun/circles-web | 1 | python | def get_safe_name(name: str) -> str:
return name.lower().replace(' ', '_') | def get_safe_name(name: str) -> str:
return name.lower().replace(' ', '_')<|docstring|>Returns the safe version of a username.<|endoftext|> |
2da3f4e3befe9a0afb3e1157506d4ec77a54429868b6069789cb1a1dbad1ce36 | def convert_mode_int(mode: str) -> Optional[int]:
'Converts mode (str) to mode (int).'
if (mode not in _str_mode_dict):
print('invalid mode passed into utils.convert_mode_int?')
return
return _str_mode_dict[mode] | Converts mode (str) to mode (int). | objects/utils.py | convert_mode_int | circles-fun/circles-web | 1 | python | def convert_mode_int(mode: str) -> Optional[int]:
if (mode not in _str_mode_dict):
print('invalid mode passed into utils.convert_mode_int?')
return
return _str_mode_dict[mode] | def convert_mode_int(mode: str) -> Optional[int]:
if (mode not in _str_mode_dict):
print('invalid mode passed into utils.convert_mode_int?')
return
return _str_mode_dict[mode]<|docstring|>Converts mode (str) to mode (int).<|endoftext|> |
ecc71f45d694e6331def56840d37c7c5e78db2cd6e53b9df3b2a3f3d5c0132d7 | def convert_mode_str(mode: int) -> Optional[str]:
'Converts mode (int) to mode (str).'
if (mode not in _mode_str_dict):
print('invalid mode passed into utils.convert_mode_str?')
return
return _mode_str_dict[mode] | Converts mode (int) to mode (str). | objects/utils.py | convert_mode_str | circles-fun/circles-web | 1 | python | def convert_mode_str(mode: int) -> Optional[str]:
if (mode not in _mode_str_dict):
print('invalid mode passed into utils.convert_mode_str?')
return
return _mode_str_dict[mode] | def convert_mode_str(mode: int) -> Optional[str]:
if (mode not in _mode_str_dict):
print('invalid mode passed into utils.convert_mode_str?')
return
return _mode_str_dict[mode]<|docstring|>Converts mode (int) to mode (str).<|endoftext|> |
43e83a293a0cd5bcafceab03313a33ddf80cb9f28b5947214b2290cca36c4c4d | async def fetch_geoloc(ip: str) -> str:
'Fetches the country code corresponding to an IP.'
url = f'http://ip-api.com/line/{ip}'
async with glob.http.get(url) as resp:
if ((not resp) or (resp.status != 200)):
if glob.config.debug:
log('Failed to get geoloc data: request fa... | Fetches the country code corresponding to an IP. | objects/utils.py | fetch_geoloc | circles-fun/circles-web | 1 | python | async def fetch_geoloc(ip: str) -> str:
url = f'http://ip-api.com/line/{ip}'
async with glob.http.get(url) as resp:
if ((not resp) or (resp.status != 200)):
if glob.config.debug:
log('Failed to get geoloc data: request failed.', Ansi.LRED)
return 'xx'
... | async def fetch_geoloc(ip: str) -> str:
url = f'http://ip-api.com/line/{ip}'
async with glob.http.get(url) as resp:
if ((not resp) or (resp.status != 200)):
if glob.config.debug:
log('Failed to get geoloc data: request failed.', Ansi.LRED)
return 'xx'
... |
647f0784ae216c9493605164a01ca60be35d75e81e8ce9503ad6885ecd9ce044 | async def validate_captcha(data: str) -> bool:
"Verify `data` with hcaptcha's API."
url = f'https://hcaptcha.com/siteverify'
data = {'secret': glob.config.hCaptcha_secret, 'response': data}
async with glob.http.post(url, data=data) as resp:
if ((not resp) or (resp.status != 200)):
if... | Verify `data` with hcaptcha's API. | objects/utils.py | validate_captcha | circles-fun/circles-web | 1 | python | async def validate_captcha(data: str) -> bool:
url = f'https://hcaptcha.com/siteverify'
data = {'secret': glob.config.hCaptcha_secret, 'response': data}
async with glob.http.post(url, data=data) as resp:
if ((not resp) or (resp.status != 200)):
if glob.config.debug:
... | async def validate_captcha(data: str) -> bool:
url = f'https://hcaptcha.com/siteverify'
data = {'secret': glob.config.hCaptcha_secret, 'response': data}
async with glob.http.post(url, data=data) as resp:
if ((not resp) or (resp.status != 200)):
if glob.config.debug:
... |
c706746a8c409f14639014949e1d18c6787ba540a16fbbd86e5fe8c410d933db | def remove_duplicates(lst):
"\n Emulate what a Python ``set()`` does, but keeping the element's order.\n "
dset = set()
return [l for l in lst if ((l not in dset) and (not dset.add(l)))] | Emulate what a Python ``set()`` does, but keeping the element's order. | cmsplugin_cascade/utils.py | remove_duplicates | aldryn/djangocms-cascade | 2 | python | def remove_duplicates(lst):
"\n \n "
dset = set()
return [l for l in lst if ((l not in dset) and (not dset.add(l)))] | def remove_duplicates(lst):
"\n \n "
dset = set()
return [l for l in lst if ((l not in dset) and (not dset.add(l)))]<|docstring|>Emulate what a Python ``set()`` does, but keeping the element's order.<|endoftext|> |
d3e403e1238b6bfb2ba659c228850a663b024973aef603cc35173c08d2cd8be1 | def resolve_dependencies(filenames):
'\n Given a filename literal or a list of filenames and a mapping of dependencies (use\n ``settings.CASCADE_PLUGIN_DEPENDENCIES`` to check for details), return a list of other files\n resolving the dependency. The returned list is ordered, so that files having no furthe... | Given a filename literal or a list of filenames and a mapping of dependencies (use
``settings.CASCADE_PLUGIN_DEPENDENCIES`` to check for details), return a list of other files
resolving the dependency. The returned list is ordered, so that files having no further
dependency come as first element and the passed in filen... | cmsplugin_cascade/utils.py | resolve_dependencies | aldryn/djangocms-cascade | 2 | python | def resolve_dependencies(filenames):
'\n Given a filename literal or a list of filenames and a mapping of dependencies (use\n ``settings.CASCADE_PLUGIN_DEPENDENCIES`` to check for details), return a list of other files\n resolving the dependency. The returned list is ordered, so that files having no furthe... | def resolve_dependencies(filenames):
'\n Given a filename literal or a list of filenames and a mapping of dependencies (use\n ``settings.CASCADE_PLUGIN_DEPENDENCIES`` to check for details), return a list of other files\n resolving the dependency. The returned list is ordered, so that files having no furthe... |
583c60c670ce9d35adf268324fd79cbc3338e7ca31fa75da8cdac61ee3305c12 | def rectify_partial_form_field(base_field, partial_form_fields):
'\n In base_field reset the attributes label and help_text, since they are overriden by the\n partial field. Additionally, from the list, or list of lists of partial_form_fields\n append the bound validator methods to the given base field.\n ... | In base_field reset the attributes label and help_text, since they are overriden by the
partial field. Additionally, from the list, or list of lists of partial_form_fields
append the bound validator methods to the given base field. | cmsplugin_cascade/utils.py | rectify_partial_form_field | aldryn/djangocms-cascade | 2 | python | def rectify_partial_form_field(base_field, partial_form_fields):
'\n In base_field reset the attributes label and help_text, since they are overriden by the\n partial field. Additionally, from the list, or list of lists of partial_form_fields\n append the bound validator methods to the given base field.\n ... | def rectify_partial_form_field(base_field, partial_form_fields):
'\n In base_field reset the attributes label and help_text, since they are overriden by the\n partial field. Additionally, from the list, or list of lists of partial_form_fields\n append the bound validator methods to the given base field.\n ... |
c222783d3402a257aae6e2995b8e4b5395985855f639adddd9f14ff3973b0487 | def play(self, task):
' activates the player and hides the splashscreen '
if (not self.vlc_player.is_playing()):
hide_splashscreen()
self.vlc_player.play()
if task:
self.get_status(task) | activates the player and hides the splashscreen | augenkrebs/GlobalPlayer/player.py | play | shackspace/augenkrebs | 3 | python | def play(self, task):
' '
if (not self.vlc_player.is_playing()):
hide_splashscreen()
self.vlc_player.play()
if task:
self.get_status(task) | def play(self, task):
' '
if (not self.vlc_player.is_playing()):
hide_splashscreen()
self.vlc_player.play()
if task:
self.get_status(task)<|docstring|>activates the player and hides the splashscreen<|endoftext|> |
3f0bc5fd566c2a1d703ed13352733dab9898161a7f7334c7d48f4718330919f8 | def pause(self, task):
' pauses the current playback '
if self.vlc_player.is_playing():
self.vlc_player.pause()
self.get_status(task) | pauses the current playback | augenkrebs/GlobalPlayer/player.py | pause | shackspace/augenkrebs | 3 | python | def pause(self, task):
' '
if self.vlc_player.is_playing():
self.vlc_player.pause()
self.get_status(task) | def pause(self, task):
' '
if self.vlc_player.is_playing():
self.vlc_player.pause()
self.get_status(task)<|docstring|>pauses the current playback<|endoftext|> |
cbfb08c22585d0eb158930550c3fe3d0109ade2e3ffb4a7194212f470bdbea9a | def stop(self, task):
' stops the current playback and shows the splashscreen '
if self.vlc_player.is_playing():
show_splashscreen()
self.vlc_player.stop()
self.get_status(task) | stops the current playback and shows the splashscreen | augenkrebs/GlobalPlayer/player.py | stop | shackspace/augenkrebs | 3 | python | def stop(self, task):
' '
if self.vlc_player.is_playing():
show_splashscreen()
self.vlc_player.stop()
self.get_status(task) | def stop(self, task):
' '
if self.vlc_player.is_playing():
show_splashscreen()
self.vlc_player.stop()
self.get_status(task)<|docstring|>stops the current playback and shows the splashscreen<|endoftext|> |
932af187e6e8d227c7971e4c818f820a33af68a388d54268fee3d50660e86944 | def open(self, task):
' opens a given URL and starts playback.\n in case the playlist exists already, insert at the beginning\n '
self.playlist = [task['url']]
self._open(task['response']) | opens a given URL and starts playback.
in case the playlist exists already, insert at the beginning | augenkrebs/GlobalPlayer/player.py | open | shackspace/augenkrebs | 3 | python | def open(self, task):
' opens a given URL and starts playback.\n in case the playlist exists already, insert at the beginning\n '
self.playlist = [task['url']]
self._open(task['response']) | def open(self, task):
' opens a given URL and starts playback.\n in case the playlist exists already, insert at the beginning\n '
self.playlist = [task['url']]
self._open(task['response'])<|docstring|>opens a given URL and starts playback.
in case the playlist exists already, insert at the... |
849d04937c07cad3b71e5ec1a9bd9fc9ee27981bb1f018159df83d6124445796 | def stream(self, task):
' plays a previously opened stream '
try:
for item in self.vlc_player.get_media().subitems():
self.vlc_player.set_media(item)
self.play(None)
except TypeError:
print('Whoops, no stream found!') | plays a previously opened stream | augenkrebs/GlobalPlayer/player.py | stream | shackspace/augenkrebs | 3 | python | def stream(self, task):
' '
try:
for item in self.vlc_player.get_media().subitems():
self.vlc_player.set_media(item)
self.play(None)
except TypeError:
print('Whoops, no stream found!') | def stream(self, task):
' '
try:
for item in self.vlc_player.get_media().subitems():
self.vlc_player.set_media(item)
self.play(None)
except TypeError:
print('Whoops, no stream found!')<|docstring|>plays a previously opened stream<|endoftext|> |
abca46df09af1b8ea097964c06696d2df770ad1364c3ad551e4fa8ea4971ad3d | def get_status(self, task):
' get_status sends a complete status dictionary to the\n response_queue\n '
response = {}
subtitle_dict = {}
audio_dict = {}
response['title'] = ''
response['play_status'] = str(self.vlc_player.get_state()).split('.')[1]
response['length'] = self... | get_status sends a complete status dictionary to the
response_queue | augenkrebs/GlobalPlayer/player.py | get_status | shackspace/augenkrebs | 3 | python | def get_status(self, task):
' get_status sends a complete status dictionary to the\n response_queue\n '
response = {}
subtitle_dict = {}
audio_dict = {}
response['title'] =
response['play_status'] = str(self.vlc_player.get_state()).split('.')[1]
response['length'] = self.v... | def get_status(self, task):
' get_status sends a complete status dictionary to the\n response_queue\n '
response = {}
subtitle_dict = {}
audio_dict = {}
response['title'] =
response['play_status'] = str(self.vlc_player.get_state()).split('.')[1]
response['length'] = self.v... |
b62b4b89082e922c2a6f63d70faf46a3151a53e05541aeafbd77538ffeebb89b | def change_status(self, task):
' change_status takes a request dictionary and will try to apply\n every requested status change contained\n '
request = task['request']
for element in request.keys():
if (element == 'position'):
self.vlc_player.set_time(int(request[elemen... | change_status takes a request dictionary and will try to apply
every requested status change contained | augenkrebs/GlobalPlayer/player.py | change_status | shackspace/augenkrebs | 3 | python | def change_status(self, task):
' change_status takes a request dictionary and will try to apply\n every requested status change contained\n '
request = task['request']
for element in request.keys():
if (element == 'position'):
self.vlc_player.set_time(int(request[elemen... | def change_status(self, task):
' change_status takes a request dictionary and will try to apply\n every requested status change contained\n '
request = task['request']
for element in request.keys():
if (element == 'position'):
self.vlc_player.set_time(int(request[elemen... |
f5cee3bcc7ab0010bcb1b47b11c58c08c9e442ce6430836af3e246a3ecf86bf5 | def delete(self, person_email):
'Allows for the deletion of scheduled surveys for the given email\n address.\n\n Note: The url for this endpoint is a little funky, but obviously\n belongs in the Person resource, hence the overwrite.\n '
url = ('%s%s/%s/survey_requests/... | Allows for the deletion of scheduled surveys for the given email
address.
Note: The url for this endpoint is a little funky, but obviously
belongs in the Person resource, hence the overwrite. | delighted/api.py | delete | testive/delighted-python | 0 | python | def delete(self, person_email):
'Allows for the deletion of scheduled surveys for the given email\n address.\n\n Note: The url for this endpoint is a little funky, but obviously\n belongs in the Person resource, hence the overwrite.\n '
url = ('%s%s/%s/survey_requests/... | def delete(self, person_email):
'Allows for the deletion of scheduled surveys for the given email\n address.\n\n Note: The url for this endpoint is a little funky, but obviously\n belongs in the Person resource, hence the overwrite.\n '
url = ('%s%s/%s/survey_requests/... |
70eab09a93eed45a189ef0f26b506f6eb7024c40d49e21b2e936c7a40a5c1599 | def split_video_into_frames(path, start):
'start - list of start seconds to cut video into subclips'
vid = imageio.get_reader(path, 'ffmpeg')
metadata = vid.get_meta_data()
fps = int(metadata['fps'])
w = metadata['source_size'][0]
h = metadata['source_size'][1]
if ((h < TARGET_VID_SIZE) or (... | start - list of start seconds to cut video into subclips | vid_dl/main.py | split_video_into_frames | ericguizzo/deep-landscape | 95 | python | def split_video_into_frames(path, start):
vid = imageio.get_reader(path, 'ffmpeg')
metadata = vid.get_meta_data()
fps = int(metadata['fps'])
w = metadata['source_size'][0]
h = metadata['source_size'][1]
if ((h < TARGET_VID_SIZE) or (w < TARGET_VID_SIZE)):
print(f'Low res video {os.p... | def split_video_into_frames(path, start):
vid = imageio.get_reader(path, 'ffmpeg')
metadata = vid.get_meta_data()
fps = int(metadata['fps'])
w = metadata['source_size'][0]
h = metadata['source_size'][1]
if ((h < TARGET_VID_SIZE) or (w < TARGET_VID_SIZE)):
print(f'Low res video {os.p... |
afa3bfd277ccf607c6c5be395695ec1654c6acd839381fd721da03ef6dbb44b0 | def set_formatter(formatter=None, background=None):
'Sets the default formatter. If no argument is given, a default\n formatter is used.\n '
settings.write(option='formatter', value=formatter)
if (background is not None):
settings.write(option='background', value=background)
if (formatter ... | Sets the default formatter. If no argument is given, a default
formatter is used. | friendly/mu/repl.py | set_formatter | friendly-traceback/friendly | 12 | python | def set_formatter(formatter=None, background=None):
'Sets the default formatter. If no argument is given, a default\n formatter is used.\n '
settings.write(option='formatter', value=formatter)
if (background is not None):
settings.write(option='background', value=background)
if (formatter ... | def set_formatter(formatter=None, background=None):
'Sets the default formatter. If no argument is given, a default\n formatter is used.\n '
settings.write(option='formatter', value=formatter)
if (background is not None):
settings.write(option='background', value=background)
if (formatter ... |
13ec58d35431edcc90dc78fb7beef0c1871b0a2f14b5e5520b2bea755ffd8630 | def set_width(width=80):
"Sets the width in a iPython/Jupyter session using 'light' or 'dark' mode"
if session.use_rich:
session.console._width = width
else:
print(_("set_width() is only available using 'day', 'night' or 'colourful' mode.")) | Sets the width in a iPython/Jupyter session using 'light' or 'dark' mode | friendly/mu/repl.py | set_width | friendly-traceback/friendly | 12 | python | def set_width(width=80):
if session.use_rich:
session.console._width = width
else:
print(_("set_width() is only available using 'day', 'night' or 'colourful' mode.")) | def set_width(width=80):
if session.use_rich:
session.console._width = width
else:
print(_("set_width() is only available using 'day', 'night' or 'colourful' mode."))<|docstring|>Sets the width in a iPython/Jupyter session using 'light' or 'dark' mode<|endoftext|> |
e5a72000267608476c76bf2c1657f34815bccb5c8a65b031d179f9a451caea00 | def day():
"Day theme for Mu's REPL"
set_formatter('day', background='#FEFEF7') | Day theme for Mu's REPL | friendly/mu/repl.py | day | friendly-traceback/friendly | 12 | python | def day():
set_formatter('day', background='#FEFEF7') | def day():
set_formatter('day', background='#FEFEF7')<|docstring|>Day theme for Mu's REPL<|endoftext|> |
43f4c5db5841afa01efeb326d6a396508c24814a341e970d74e7b45129fb1a47 | def night():
"Night theme for Mu's REPL"
set_formatter('night', background='#373737') | Night theme for Mu's REPL | friendly/mu/repl.py | night | friendly-traceback/friendly | 12 | python | def night():
set_formatter('night', background='#373737') | def night():
set_formatter('night', background='#373737')<|docstring|>Night theme for Mu's REPL<|endoftext|> |
5819df72b11aae02c4455c7079a1e5cbe55f3fd8ab92efdbff21557f70b890da | def colourful():
'Colourful theme with black background.'
set_formatter('colourful', background='#000000') | Colourful theme with black background. | friendly/mu/repl.py | colourful | friendly-traceback/friendly | 12 | python | def colourful():
set_formatter('colourful', background='#000000') | def colourful():
set_formatter('colourful', background='#000000')<|docstring|>Colourful theme with black background.<|endoftext|> |
49f2dab60f8ffaf7e7bcab2f57e16f2575009138245d748d099787bcf46fe318 | def contrast():
'White text on black background.'
set_formatter('repl', background='#000000') | White text on black background. | friendly/mu/repl.py | contrast | friendly-traceback/friendly | 12 | python | def contrast():
set_formatter('repl', background='#000000') | def contrast():
set_formatter('repl', background='#000000')<|docstring|>White text on black background.<|endoftext|> |
91814d4234e1dbf56d21d6eb2d0fd59527cb5eff209e767a62bcde99176d8e9d | def ids_tensor(self, shape, vocab_size, rng=None, name=None, dtype=None):
'Creates a random int32 tensor of the shape within the vocab size.'
if (rng is None):
rng = random.Random()
total_dims = 1
for dim in shape:
total_dims *= dim
values = []
for _ in range(total_dims):
... | Creates a random int32 tensor of the shape within the vocab size. | tests/test_modeling_bert.py | ids_tensor | mkavim/finetune_bert | 19 | python | def ids_tensor(self, shape, vocab_size, rng=None, name=None, dtype=None):
if (rng is None):
rng = random.Random()
total_dims = 1
for dim in shape:
total_dims *= dim
values = []
for _ in range(total_dims):
values.append(rng.randint(0, (vocab_size - 1)))
output = tf.co... | def ids_tensor(self, shape, vocab_size, rng=None, name=None, dtype=None):
if (rng is None):
rng = random.Random()
total_dims = 1
for dim in shape:
total_dims *= dim
values = []
for _ in range(total_dims):
values.append(rng.randint(0, (vocab_size - 1)))
output = tf.co... |
84e07f62d0f00f4252ac41b427c4c126b574704567982b154c3145b096982c14 | def __virtual__():
'\n Only load this module if neutron\n is installed on this minion.\n '
return HAS_NEUTRON | Only load this module if neutron
is installed on this minion. | salt/modules/neutron.py | __virtual__ | belvedere-trading/salt | 3 | python | def __virtual__():
'\n Only load this module if neutron\n is installed on this minion.\n '
return HAS_NEUTRON | def __virtual__():
'\n Only load this module if neutron\n is installed on this minion.\n '
return HAS_NEUTRON<|docstring|>Only load this module if neutron
is installed on this minion.<|endoftext|> |
b7a74c0a72e16f1de88b80f9efcae6f23664fb513396ca848f4af699db845434 | def _auth(profile=None):
'\n Set up neutron credentials\n '
if profile:
credentials = __salt__['config.option'](profile)
user = credentials['keystone.user']
password = credentials['keystone.password']
tenant = credentials['keystone.tenant']
auth_url = credentials['k... | Set up neutron credentials | salt/modules/neutron.py | _auth | belvedere-trading/salt | 3 | python | def _auth(profile=None):
'\n \n '
if profile:
credentials = __salt__['config.option'](profile)
user = credentials['keystone.user']
password = credentials['keystone.password']
tenant = credentials['keystone.tenant']
auth_url = credentials['keystone.auth_url']
... | def _auth(profile=None):
'\n \n '
if profile:
credentials = __salt__['config.option'](profile)
user = credentials['keystone.user']
password = credentials['keystone.password']
tenant = credentials['keystone.tenant']
auth_url = credentials['keystone.auth_url']
... |
fbe9e2275a92651de6d5d55dc579f2129b8bb3e3bcc8f475c111d92e3e0adb1c | def get_quotas_tenant(profile=None):
"\n Fetches tenant info in server's context for following quota operation\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.get_quotas_tenant\n salt '*' neutron.get_quotas_tenant profile=openstack1\n\n :param profile: Profile to build on (O... | Fetches tenant info in server's context for following quota operation
CLI Example:
.. code-block:: bash
salt '*' neutron.get_quotas_tenant
salt '*' neutron.get_quotas_tenant profile=openstack1
:param profile: Profile to build on (Optional)
:return: Quotas information | salt/modules/neutron.py | get_quotas_tenant | belvedere-trading/salt | 3 | python | def get_quotas_tenant(profile=None):
"\n Fetches tenant info in server's context for following quota operation\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.get_quotas_tenant\n salt '*' neutron.get_quotas_tenant profile=openstack1\n\n :param profile: Profile to build on (O... | def get_quotas_tenant(profile=None):
"\n Fetches tenant info in server's context for following quota operation\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.get_quotas_tenant\n salt '*' neutron.get_quotas_tenant profile=openstack1\n\n :param profile: Profile to build on (O... |
6dde97f72554d5b0c5ea6907aea7337201d63f3f5eb4b4d97ab0287ce2af68ab | def list_quotas(profile=None):
"\n Fetches all tenants quotas\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.list_quotas\n salt '*' neutron.list_quotas profile=openstack1\n\n :param profile: Profile to build on (Optional)\n :return: List of quotas\n "
conn = _auth... | Fetches all tenants quotas
CLI Example:
.. code-block:: bash
salt '*' neutron.list_quotas
salt '*' neutron.list_quotas profile=openstack1
:param profile: Profile to build on (Optional)
:return: List of quotas | salt/modules/neutron.py | list_quotas | belvedere-trading/salt | 3 | python | def list_quotas(profile=None):
"\n Fetches all tenants quotas\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.list_quotas\n salt '*' neutron.list_quotas profile=openstack1\n\n :param profile: Profile to build on (Optional)\n :return: List of quotas\n "
conn = _auth... | def list_quotas(profile=None):
"\n Fetches all tenants quotas\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.list_quotas\n salt '*' neutron.list_quotas profile=openstack1\n\n :param profile: Profile to build on (Optional)\n :return: List of quotas\n "
conn = _auth... |
2077bc739294d4021fdc163887ffa7227859fffaea6ef0aa786e66adbdfe3d1b | def show_quota(tenant_id, profile=None):
"\n Fetches information of a certain tenant's quotas\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.show_quota tenant-id\n salt '*' neutron.show_quota tenant-id profile=openstack1\n\n :param tenant_id: ID of tenant\n :param profil... | Fetches information of a certain tenant's quotas
CLI Example:
.. code-block:: bash
salt '*' neutron.show_quota tenant-id
salt '*' neutron.show_quota tenant-id profile=openstack1
:param tenant_id: ID of tenant
:param profile: Profile to build on (Optional)
:return: Quota information | salt/modules/neutron.py | show_quota | belvedere-trading/salt | 3 | python | def show_quota(tenant_id, profile=None):
"\n Fetches information of a certain tenant's quotas\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.show_quota tenant-id\n salt '*' neutron.show_quota tenant-id profile=openstack1\n\n :param tenant_id: ID of tenant\n :param profil... | def show_quota(tenant_id, profile=None):
"\n Fetches information of a certain tenant's quotas\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.show_quota tenant-id\n salt '*' neutron.show_quota tenant-id profile=openstack1\n\n :param tenant_id: ID of tenant\n :param profil... |
06e36e847ebf767be1232935982952ad788c1bb7a3da04c76abe3a98155a9061 | def update_quota(tenant_id, subnet=None, router=None, network=None, floatingip=None, port=None, security_group=None, security_group_rule=None, profile=None):
"\n Update a tenant's quota\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.update_quota tenant-id subnet=40 router=50\n ... | Update a tenant's quota
CLI Example:
.. code-block:: bash
salt '*' neutron.update_quota tenant-id subnet=40 router=50
network=10 floatingip=30 port=30
:param tenant_id: ID of tenant
:param subnet: Value of subnet quota (Optional)
:param router: Value of router quota (Optional)
:p... | salt/modules/neutron.py | update_quota | belvedere-trading/salt | 3 | python | def update_quota(tenant_id, subnet=None, router=None, network=None, floatingip=None, port=None, security_group=None, security_group_rule=None, profile=None):
"\n Update a tenant's quota\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.update_quota tenant-id subnet=40 router=50\n ... | def update_quota(tenant_id, subnet=None, router=None, network=None, floatingip=None, port=None, security_group=None, security_group_rule=None, profile=None):
"\n Update a tenant's quota\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.update_quota tenant-id subnet=40 router=50\n ... |
698c3fa789431194a545f185a82013d67bd6d4687bff99fd30222a364d53e5a0 | def delete_quota(tenant_id, profile=None):
"\n Delete the specified tenant's quota value\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.update_quota tenant-id\n salt '*' neutron.update_quota tenant-id profile=openstack1\n\n :param tenant_id: ID of tenant to quota delete\n ... | Delete the specified tenant's quota value
CLI Example:
.. code-block:: bash
salt '*' neutron.update_quota tenant-id
salt '*' neutron.update_quota tenant-id profile=openstack1
:param tenant_id: ID of tenant to quota delete
:param profile: Profile to build on (Optional)
:return: True(Delete succeed) or False(... | salt/modules/neutron.py | delete_quota | belvedere-trading/salt | 3 | python | def delete_quota(tenant_id, profile=None):
"\n Delete the specified tenant's quota value\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.update_quota tenant-id\n salt '*' neutron.update_quota tenant-id profile=openstack1\n\n :param tenant_id: ID of tenant to quota delete\n ... | def delete_quota(tenant_id, profile=None):
"\n Delete the specified tenant's quota value\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.update_quota tenant-id\n salt '*' neutron.update_quota tenant-id profile=openstack1\n\n :param tenant_id: ID of tenant to quota delete\n ... |
07f0471736b026abd8c6185671602ab9880f62499f71ca63b1162697f47938ef | def list_extensions(profile=None):
"\n Fetches a list of all extensions on server side\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.list_extensions\n salt '*' neutron.list_extensions profile=openstack1\n\n :param profile: Profile to build on (Optional)\n :return: List ... | Fetches a list of all extensions on server side
CLI Example:
.. code-block:: bash
salt '*' neutron.list_extensions
salt '*' neutron.list_extensions profile=openstack1
:param profile: Profile to build on (Optional)
:return: List of extensions | salt/modules/neutron.py | list_extensions | belvedere-trading/salt | 3 | python | def list_extensions(profile=None):
"\n Fetches a list of all extensions on server side\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.list_extensions\n salt '*' neutron.list_extensions profile=openstack1\n\n :param profile: Profile to build on (Optional)\n :return: List ... | def list_extensions(profile=None):
"\n Fetches a list of all extensions on server side\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' neutron.list_extensions\n salt '*' neutron.list_extensions profile=openstack1\n\n :param profile: Profile to build on (Optional)\n :return: List ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.