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 |
|---|---|---|---|---|---|---|---|---|---|
4e0c1b5a8046000c11867e7d8cb36485265a1d48bb922bba7efece4ac898766c | def _calc_d(aod700, p):
'Calculate the d coefficient.'
p0 = 101325.0
dp = (1 / (18 + (152 * aod700)))
d = (((((- 0.337) * (aod700 ** 2)) + (0.63 * aod700)) + 0.116) + (dp * np.log((p / p0))))
return d | Calculate the d coefficient. | pvlib/clearsky.py | _calc_d | Antoine-0/pvlib-python | 695 | python | def _calc_d(aod700, p):
p0 = 101325.0
dp = (1 / (18 + (152 * aod700)))
d = (((((- 0.337) * (aod700 ** 2)) + (0.63 * aod700)) + 0.116) + (dp * np.log((p / p0))))
return d | def _calc_d(aod700, p):
p0 = 101325.0
dp = (1 / (18 + (152 * aod700)))
d = (((((- 0.337) * (aod700 ** 2)) + (0.63 * aod700)) + 0.116) + (dp * np.log((p / p0))))
return d<|docstring|>Calculate the d coefficient.<|endoftext|> |
5f1575b66f00f0bf9083ae53cf35bbd0f19a97eae4f969a0b32d891a426e4fb6 | def _calc_stats(data, samples_per_window, sample_interval, H):
' Calculates statistics for each window, used by Reno-style clear\n sky detection functions. Does not return the line length statistic\n which is provided by _calc_windowed_stat and _line_length.\n\n Calculations are done on a sliding window de... | Calculates statistics for each window, used by Reno-style clear
sky detection functions. Does not return the line length statistic
which is provided by _calc_windowed_stat and _line_length.
Calculations are done on a sliding window defined by the Hankel matrix H.
Columns in H define the indices for each window. Each w... | pvlib/clearsky.py | _calc_stats | Antoine-0/pvlib-python | 695 | python | def _calc_stats(data, samples_per_window, sample_interval, H):
' Calculates statistics for each window, used by Reno-style clear\n sky detection functions. Does not return the line length statistic\n which is provided by _calc_windowed_stat and _line_length.\n\n Calculations are done on a sliding window de... | def _calc_stats(data, samples_per_window, sample_interval, H):
' Calculates statistics for each window, used by Reno-style clear\n sky detection functions. Does not return the line length statistic\n which is provided by _calc_windowed_stat and _line_length.\n\n Calculations are done on a sliding window de... |
ac19757181e5432eb7b7e147683e42b285c0c68e0d598bd654eb1090fa19d2cc | def _get_sample_intervals(times, win_length):
' Calculates time interval and samples per window for Reno-style clear\n sky detection functions\n '
deltas = (np.diff(times.values) / np.timedelta64(1, '60s'))
if (times.inferred_freq and (len(np.unique(deltas)) == 1)):
sample_interval = (times[1]... | Calculates time interval and samples per window for Reno-style clear
sky detection functions | pvlib/clearsky.py | _get_sample_intervals | Antoine-0/pvlib-python | 695 | python | def _get_sample_intervals(times, win_length):
' Calculates time interval and samples per window for Reno-style clear\n sky detection functions\n '
deltas = (np.diff(times.values) / np.timedelta64(1, '60s'))
if (times.inferred_freq and (len(np.unique(deltas)) == 1)):
sample_interval = (times[1]... | def _get_sample_intervals(times, win_length):
' Calculates time interval and samples per window for Reno-style clear\n sky detection functions\n '
deltas = (np.diff(times.values) / np.timedelta64(1, '60s'))
if (times.inferred_freq and (len(np.unique(deltas)) == 1)):
sample_interval = (times[1]... |
1b86657666db99419d1e6a9d164738d0786ba29e321aa9634e1cbc4f74bb316e | def _clear_sample_index(clear_windows, samples_per_window, align, H):
'\n Returns indices of clear samples in clear windows\n '
shift = (- (samples_per_window // 2))
idx = clear_windows.shift(shift)
idx = idx.drop(clear_windows.index[(1 - samples_per_window):])
idx = idx.astype(bool)
clear... | Returns indices of clear samples in clear windows | pvlib/clearsky.py | _clear_sample_index | Antoine-0/pvlib-python | 695 | python | def _clear_sample_index(clear_windows, samples_per_window, align, H):
'\n \n '
shift = (- (samples_per_window // 2))
idx = clear_windows.shift(shift)
idx = idx.drop(clear_windows.index[(1 - samples_per_window):])
idx = idx.astype(bool)
clear_samples = np.unique(H[(:, idx)])
return clea... | def _clear_sample_index(clear_windows, samples_per_window, align, H):
'\n \n '
shift = (- (samples_per_window // 2))
idx = clear_windows.shift(shift)
idx = idx.drop(clear_windows.index[(1 - samples_per_window):])
idx = idx.astype(bool)
clear_samples = np.unique(H[(:, idx)])
return clea... |
ece46bdeb4ddf6d4e8745ae9756bf9b15c6d78345520311c48a26b55ba5b3540 | def detect_clearsky(measured, clearsky, times=None, window_length=10, mean_diff=75, max_diff=75, lower_line_length=(- 5), upper_line_length=10, var_diff=0.005, slope_dev=8, max_iterations=20, return_components=False):
'\n Detects clear sky times according to the algorithm developed by Reno\n and Hansen for GH... | Detects clear sky times according to the algorithm developed by Reno
and Hansen for GHI measurements. The algorithm [1]_ was designed and
validated for analyzing GHI time series only. Users may attempt to
apply it to other types of time series data using different filter
settings, but should be skeptical of the results... | pvlib/clearsky.py | detect_clearsky | Antoine-0/pvlib-python | 695 | python | def detect_clearsky(measured, clearsky, times=None, window_length=10, mean_diff=75, max_diff=75, lower_line_length=(- 5), upper_line_length=10, var_diff=0.005, slope_dev=8, max_iterations=20, return_components=False):
'\n Detects clear sky times according to the algorithm developed by Reno\n and Hansen for GH... | def detect_clearsky(measured, clearsky, times=None, window_length=10, mean_diff=75, max_diff=75, lower_line_length=(- 5), upper_line_length=10, var_diff=0.005, slope_dev=8, max_iterations=20, return_components=False):
'\n Detects clear sky times according to the algorithm developed by Reno\n and Hansen for GH... |
fb2869211dc276024f260700c7d829098577060329a4448a0f4e374950dce20e | def bird(zenith, airmass_relative, aod380, aod500, precipitable_water, ozone=0.3, pressure=101325.0, dni_extra=1364.0, asymmetry=0.85, albedo=0.2):
'\n Bird Simple Clear Sky Broadband Solar Radiation Model\n\n Based on NREL Excel implementation by Daryl R. Myers [1, 2].\n\n Bird and Hulstrom define the zen... | Bird Simple Clear Sky Broadband Solar Radiation Model
Based on NREL Excel implementation by Daryl R. Myers [1, 2].
Bird and Hulstrom define the zenith as the "angle between a line to
the sun and the local zenith". There is no distinction in the paper
between solar zenith and apparent (or refracted) zenith, but the
re... | pvlib/clearsky.py | bird | Antoine-0/pvlib-python | 695 | python | def bird(zenith, airmass_relative, aod380, aod500, precipitable_water, ozone=0.3, pressure=101325.0, dni_extra=1364.0, asymmetry=0.85, albedo=0.2):
'\n Bird Simple Clear Sky Broadband Solar Radiation Model\n\n Based on NREL Excel implementation by Daryl R. Myers [1, 2].\n\n Bird and Hulstrom define the zen... | def bird(zenith, airmass_relative, aod380, aod500, precipitable_water, ozone=0.3, pressure=101325.0, dni_extra=1364.0, asymmetry=0.85, albedo=0.2):
'\n Bird Simple Clear Sky Broadband Solar Radiation Model\n\n Based on NREL Excel implementation by Daryl R. Myers [1, 2].\n\n Bird and Hulstrom define the zen... |
2e701e7223c16ad1d447fa7cbb92eb89f81d09fab510382181aa638d81392a02 | def get_lock(self, path: Optional[str]=None) -> filelock.FileLock:
'\n Retrieve the appropriate `FileLock` backend for this storage plugin\n\n :param str path: The path to use for locking\n :return: A `FileLock` backend for obtaining locks\n :rtype: SwiftFileLock\n '
if (path ... | Retrieve the appropriate `FileLock` backend for this storage plugin
:param str path: The path to use for locking
:return: A `FileLock` backend for obtaining locks
:rtype: SwiftFileLock | src/bandersnatch_storage_plugins/filesystem.py | get_lock | terrorizer1980/bandersnatch | 310 | python | def get_lock(self, path: Optional[str]=None) -> filelock.FileLock:
'\n Retrieve the appropriate `FileLock` backend for this storage plugin\n\n :param str path: The path to use for locking\n :return: A `FileLock` backend for obtaining locks\n :rtype: SwiftFileLock\n '
if (path ... | def get_lock(self, path: Optional[str]=None) -> filelock.FileLock:
'\n Retrieve the appropriate `FileLock` backend for this storage plugin\n\n :param str path: The path to use for locking\n :return: A `FileLock` backend for obtaining locks\n :rtype: SwiftFileLock\n '
if (path ... |
b871a306f347cfeda2d08f99956413d66142971a84c47f8e9f23b1d27df51c8b | def find(self, root: PATH_TYPES, dirs: bool=True) -> str:
"A test helper simulating 'find'.\n\n Iterates over directories and filenames, given as relative paths to the\n root.\n\n "
results = self.walk(root, dirs=dirs)
results.sort()
return '\n'.join((str(result.relative_to(root)) f... | A test helper simulating 'find'.
Iterates over directories and filenames, given as relative paths to the
root. | src/bandersnatch_storage_plugins/filesystem.py | find | terrorizer1980/bandersnatch | 310 | python | def find(self, root: PATH_TYPES, dirs: bool=True) -> str:
"A test helper simulating 'find'.\n\n Iterates over directories and filenames, given as relative paths to the\n root.\n\n "
results = self.walk(root, dirs=dirs)
results.sort()
return '\n'.join((str(result.relative_to(root)) f... | def find(self, root: PATH_TYPES, dirs: bool=True) -> str:
"A test helper simulating 'find'.\n\n Iterates over directories and filenames, given as relative paths to the\n root.\n\n "
results = self.walk(root, dirs=dirs)
results.sort()
return '\n'.join((str(result.relative_to(root)) f... |
707a770099d53e619be2219547594d9a3c037c79d9ed8a6527450ac5001e3ec2 | @contextlib.contextmanager
def rewrite(self, filepath: PATH_TYPES, mode: str='w', **kw: Any) -> Generator[(IO, None, None)]:
'Rewrite an existing file atomically to avoid programs running in\n parallel to have race conditions while reading.'
if isinstance(filepath, str):
base_dir = os.path.dirnam... | Rewrite an existing file atomically to avoid programs running in
parallel to have race conditions while reading. | src/bandersnatch_storage_plugins/filesystem.py | rewrite | terrorizer1980/bandersnatch | 310 | python | @contextlib.contextmanager
def rewrite(self, filepath: PATH_TYPES, mode: str='w', **kw: Any) -> Generator[(IO, None, None)]:
'Rewrite an existing file atomically to avoid programs running in\n parallel to have race conditions while reading.'
if isinstance(filepath, str):
base_dir = os.path.dirnam... | @contextlib.contextmanager
def rewrite(self, filepath: PATH_TYPES, mode: str='w', **kw: Any) -> Generator[(IO, None, None)]:
'Rewrite an existing file atomically to avoid programs running in\n parallel to have race conditions while reading.'
if isinstance(filepath, str):
base_dir = os.path.dirnam... |
a08eed8f7ae075619f519d7e0b3157bdf50c38b91ba57cfc75507e8fd9dede09 | @contextlib.contextmanager
def update_safe(self, filename: PATH_TYPES, **kw: Any) -> Generator[(IO, None, None)]:
"Rewrite a file atomically.\n\n Clients are allowed to delete the tmpfile to signal that they don't\n want to have it updated.\n\n "
with tempfile.NamedTemporaryFile(dir=os.path... | Rewrite a file atomically.
Clients are allowed to delete the tmpfile to signal that they don't
want to have it updated. | src/bandersnatch_storage_plugins/filesystem.py | update_safe | terrorizer1980/bandersnatch | 310 | python | @contextlib.contextmanager
def update_safe(self, filename: PATH_TYPES, **kw: Any) -> Generator[(IO, None, None)]:
"Rewrite a file atomically.\n\n Clients are allowed to delete the tmpfile to signal that they don't\n want to have it updated.\n\n "
with tempfile.NamedTemporaryFile(dir=os.path... | @contextlib.contextmanager
def update_safe(self, filename: PATH_TYPES, **kw: Any) -> Generator[(IO, None, None)]:
"Rewrite a file atomically.\n\n Clients are allowed to delete the tmpfile to signal that they don't\n want to have it updated.\n\n "
with tempfile.NamedTemporaryFile(dir=os.path... |
3777269bbcd76a7c10df628e0b2158cc859547cfc308e4834af124d52f6d9a5d | def compare_files(self, file1: PATH_TYPES, file2: PATH_TYPES) -> bool:
'Compare two files, returning true if they are the same and False if not.'
return filecmp.cmp(str(file1), str(file2), shallow=False) | Compare two files, returning true if they are the same and False if not. | src/bandersnatch_storage_plugins/filesystem.py | compare_files | terrorizer1980/bandersnatch | 310 | python | def compare_files(self, file1: PATH_TYPES, file2: PATH_TYPES) -> bool:
return filecmp.cmp(str(file1), str(file2), shallow=False) | def compare_files(self, file1: PATH_TYPES, file2: PATH_TYPES) -> bool:
return filecmp.cmp(str(file1), str(file2), shallow=False)<|docstring|>Compare two files, returning true if they are the same and False if not.<|endoftext|> |
225a161626b3f4a0e16f4864a75ef725c0e95461e916313616ce781d45c88386 | def copy_file(self, source: PATH_TYPES, dest: PATH_TYPES) -> None:
'Copy a file from **source** to **dest**'
if (not self.exists(source)):
raise FileNotFoundError(source)
shutil.copy(source, dest)
return | Copy a file from **source** to **dest** | src/bandersnatch_storage_plugins/filesystem.py | copy_file | terrorizer1980/bandersnatch | 310 | python | def copy_file(self, source: PATH_TYPES, dest: PATH_TYPES) -> None:
if (not self.exists(source)):
raise FileNotFoundError(source)
shutil.copy(source, dest)
return | def copy_file(self, source: PATH_TYPES, dest: PATH_TYPES) -> None:
if (not self.exists(source)):
raise FileNotFoundError(source)
shutil.copy(source, dest)
return<|docstring|>Copy a file from **source** to **dest**<|endoftext|> |
b1532eaad85aad98d434b994ae93a9171e3a766b413ccef11e69a7b41319addb | def move_file(self, source: PATH_TYPES, dest: PATH_TYPES) -> None:
'Move a file from **source** to **dest**'
if (not self.exists(source)):
raise FileNotFoundError(source)
shutil.move(str(source), dest)
return | Move a file from **source** to **dest** | src/bandersnatch_storage_plugins/filesystem.py | move_file | terrorizer1980/bandersnatch | 310 | python | def move_file(self, source: PATH_TYPES, dest: PATH_TYPES) -> None:
if (not self.exists(source)):
raise FileNotFoundError(source)
shutil.move(str(source), dest)
return | def move_file(self, source: PATH_TYPES, dest: PATH_TYPES) -> None:
if (not self.exists(source)):
raise FileNotFoundError(source)
shutil.move(str(source), dest)
return<|docstring|>Move a file from **source** to **dest**<|endoftext|> |
b4d12d3790c6d57f2b4b4fc540781c29d0cf0f9a2048e20a807e4f85f7f081a3 | def write_file(self, path: PATH_TYPES, contents: Union[(str, bytes)]) -> None:
'Write data to the provided path. If **contents** is a string, the file will\n be opened and written in "r" + "utf-8" mode, if bytes are supplied it will be\n accessed using "rb" mode (i.e. binary write).'
if (not isin... | Write data to the provided path. If **contents** is a string, the file will
be opened and written in "r" + "utf-8" mode, if bytes are supplied it will be
accessed using "rb" mode (i.e. binary write). | src/bandersnatch_storage_plugins/filesystem.py | write_file | terrorizer1980/bandersnatch | 310 | python | def write_file(self, path: PATH_TYPES, contents: Union[(str, bytes)]) -> None:
'Write data to the provided path. If **contents** is a string, the file will\n be opened and written in "r" + "utf-8" mode, if bytes are supplied it will be\n accessed using "rb" mode (i.e. binary write).'
if (not isin... | def write_file(self, path: PATH_TYPES, contents: Union[(str, bytes)]) -> None:
'Write data to the provided path. If **contents** is a string, the file will\n be opened and written in "r" + "utf-8" mode, if bytes are supplied it will be\n accessed using "rb" mode (i.e. binary write).'
if (not isin... |
7a95bdaf778963b1d397b3a15d7a05bc84d729631f5c72c1c265ae92cc33fced | @contextlib.contextmanager
def open_file(self, path: PATH_TYPES, text: bool=True, encoding: str='utf-8') -> Generator[(IO, None, None)]:
"Yield a file context to iterate over. If text is true, open the file with\n 'rb' mode specified."
mode = ('r' if text else 'rb')
kwargs: Dict[(str, str)] = {}
... | Yield a file context to iterate over. If text is true, open the file with
'rb' mode specified. | src/bandersnatch_storage_plugins/filesystem.py | open_file | terrorizer1980/bandersnatch | 310 | python | @contextlib.contextmanager
def open_file(self, path: PATH_TYPES, text: bool=True, encoding: str='utf-8') -> Generator[(IO, None, None)]:
"Yield a file context to iterate over. If text is true, open the file with\n 'rb' mode specified."
mode = ('r' if text else 'rb')
kwargs: Dict[(str, str)] = {}
... | @contextlib.contextmanager
def open_file(self, path: PATH_TYPES, text: bool=True, encoding: str='utf-8') -> Generator[(IO, None, None)]:
"Yield a file context to iterate over. If text is true, open the file with\n 'rb' mode specified."
mode = ('r' if text else 'rb')
kwargs: Dict[(str, str)] = {}
... |
d1a96cc3e66bbcb250a63dccf67bde3db8000d29e1445a6f6d706bed1c90e612 | def read_file(self, path: PATH_TYPES, text: bool=True, encoding: str='utf-8', errors: Optional[str]=None) -> Union[(str, bytes)]:
'Return the contents of the requested file, either a bytestring or a unicode\n string depending on whether **text** is True'
with self.open_file(path, text=text, encoding=enco... | Return the contents of the requested file, either a bytestring or a unicode
string depending on whether **text** is True | src/bandersnatch_storage_plugins/filesystem.py | read_file | terrorizer1980/bandersnatch | 310 | python | def read_file(self, path: PATH_TYPES, text: bool=True, encoding: str='utf-8', errors: Optional[str]=None) -> Union[(str, bytes)]:
'Return the contents of the requested file, either a bytestring or a unicode\n string depending on whether **text** is True'
with self.open_file(path, text=text, encoding=enco... | def read_file(self, path: PATH_TYPES, text: bool=True, encoding: str='utf-8', errors: Optional[str]=None) -> Union[(str, bytes)]:
'Return the contents of the requested file, either a bytestring or a unicode\n string depending on whether **text** is True'
with self.open_file(path, text=text, encoding=enco... |
b7e15320a66b9e6cf9627b64daaf39975dab16444aa8c0290f1b22f6bf3e4419 | def delete_file(self, path: PATH_TYPES, dry_run: bool=False) -> int:
'Delete the provided path, recursively if necessary.'
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
log_prefix = ('[DRY RUN] ' if dry_run else '')
logger.info(f'{log_prefix}Removing file: {path!s}')
if ... | Delete the provided path, recursively if necessary. | src/bandersnatch_storage_plugins/filesystem.py | delete_file | terrorizer1980/bandersnatch | 310 | python | def delete_file(self, path: PATH_TYPES, dry_run: bool=False) -> int:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
log_prefix = ('[DRY RUN] ' if dry_run else )
logger.info(f'{log_prefix}Removing file: {path!s}')
if (not dry_run):
path.unlink()
return 0 | def delete_file(self, path: PATH_TYPES, dry_run: bool=False) -> int:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
log_prefix = ('[DRY RUN] ' if dry_run else )
logger.info(f'{log_prefix}Removing file: {path!s}')
if (not dry_run):
path.unlink()
return 0<|docs... |
a256342245ab01fbcbe1fe9fea821fcf10b7bcbfd315cee37225cdbbca2d71c6 | def mkdir(self, path: PATH_TYPES, exist_ok: bool=False, parents: bool=False) -> None:
'Create the provided directory'
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.mkdir(exist_ok=exist_ok, parents=parents) | Create the provided directory | src/bandersnatch_storage_plugins/filesystem.py | mkdir | terrorizer1980/bandersnatch | 310 | python | def mkdir(self, path: PATH_TYPES, exist_ok: bool=False, parents: bool=False) -> None:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.mkdir(exist_ok=exist_ok, parents=parents) | def mkdir(self, path: PATH_TYPES, exist_ok: bool=False, parents: bool=False) -> None:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.mkdir(exist_ok=exist_ok, parents=parents)<|docstring|>Create the provided directory<|endoftext|> |
e9c808b459a8d343e8a963c05e6ed53a02e8c2dab9811c10b702911506698a7b | def rmdir(self, path: PATH_TYPES, recurse: bool=False, force: bool=False, ignore_errors: bool=False, dry_run: bool=False) -> int:
'Remove the directory. If recurse is True, allow removing empty children.\n If force is true, remove contents destructively.'
if (not isinstance(path, pathlib.Path)):
... | Remove the directory. If recurse is True, allow removing empty children.
If force is true, remove contents destructively. | src/bandersnatch_storage_plugins/filesystem.py | rmdir | terrorizer1980/bandersnatch | 310 | python | def rmdir(self, path: PATH_TYPES, recurse: bool=False, force: bool=False, ignore_errors: bool=False, dry_run: bool=False) -> int:
'Remove the directory. If recurse is True, allow removing empty children.\n If force is true, remove contents destructively.'
if (not isinstance(path, pathlib.Path)):
... | def rmdir(self, path: PATH_TYPES, recurse: bool=False, force: bool=False, ignore_errors: bool=False, dry_run: bool=False) -> int:
'Remove the directory. If recurse is True, allow removing empty children.\n If force is true, remove contents destructively.'
if (not isinstance(path, pathlib.Path)):
... |
cf2cef59ffb0e1781b1331f6c37e2169ded2011dc4b0d607e90b7b551c965ffa | def exists(self, path: PATH_TYPES) -> bool:
'Check whether the provided path exists'
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.exists() | Check whether the provided path exists | src/bandersnatch_storage_plugins/filesystem.py | exists | terrorizer1980/bandersnatch | 310 | python | def exists(self, path: PATH_TYPES) -> bool:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.exists() | def exists(self, path: PATH_TYPES) -> bool:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.exists()<|docstring|>Check whether the provided path exists<|endoftext|> |
2cade71a2a11bdfb404e51e044c06eb05b1333ae789b481075e648871230c7b6 | def is_dir(self, path: PATH_TYPES) -> bool:
'Check whether the provided path is a directory.'
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.is_dir() | Check whether the provided path is a directory. | src/bandersnatch_storage_plugins/filesystem.py | is_dir | terrorizer1980/bandersnatch | 310 | python | def is_dir(self, path: PATH_TYPES) -> bool:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.is_dir() | def is_dir(self, path: PATH_TYPES) -> bool:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.is_dir()<|docstring|>Check whether the provided path is a directory.<|endoftext|> |
5491bf2a81365d1b221660096c8015a19a44935842d3cddd61a9535b242144cc | def is_file(self, path: PATH_TYPES) -> bool:
'Check whether the provided path is a file.'
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.is_file() | Check whether the provided path is a file. | src/bandersnatch_storage_plugins/filesystem.py | is_file | terrorizer1980/bandersnatch | 310 | python | def is_file(self, path: PATH_TYPES) -> bool:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.is_file() | def is_file(self, path: PATH_TYPES) -> bool:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.is_file()<|docstring|>Check whether the provided path is a file.<|endoftext|> |
142093f44b5dbbb3a6646e3073a57201e1519b9ad1272b566bb349e5950b4728 | def get_file_size(self, path: PATH_TYPES) -> int:
'Return the file size of provided path.'
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.stat().st_size | Return the file size of provided path. | src/bandersnatch_storage_plugins/filesystem.py | get_file_size | terrorizer1980/bandersnatch | 310 | python | def get_file_size(self, path: PATH_TYPES) -> int:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.stat().st_size | def get_file_size(self, path: PATH_TYPES) -> int:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
return path.stat().st_size<|docstring|>Return the file size of provided path.<|endoftext|> |
10d466d24577ab06ec33d1eff78f0f76c777d7faaf80d126521c94097c731d6c | def set_upload_time(self, path: PATH_TYPES, time: datetime.datetime) -> None:
'Set the upload time of a given **path**'
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
ts = time.timestamp()
os.utime(path, (ts, ts)) | Set the upload time of a given **path** | src/bandersnatch_storage_plugins/filesystem.py | set_upload_time | terrorizer1980/bandersnatch | 310 | python | def set_upload_time(self, path: PATH_TYPES, time: datetime.datetime) -> None:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
ts = time.timestamp()
os.utime(path, (ts, ts)) | def set_upload_time(self, path: PATH_TYPES, time: datetime.datetime) -> None:
if (not isinstance(path, pathlib.Path)):
path = pathlib.Path(path)
ts = time.timestamp()
os.utime(path, (ts, ts))<|docstring|>Set the upload time of a given **path**<|endoftext|> |
56b2d01be53df4b8c4edbda719d9c6258ce41557c717c832e42b8eb311b4a91b | def setup(hass, base_config):
'Setup the Lutron component.'
from pylutron import Lutron
hass.data[LUTRON_CONTROLLER] = None
hass.data[LUTRON_DEVICES] = {'light': []}
hass.data[LUTRON_GROUPS] = {}
config = base_config.get(DOMAIN)
hass.data[LUTRON_CONTROLLER] = Lutron(config['lutron_host'], co... | Setup the Lutron component. | homeassistant/components/lutron.py | setup | loraxx753/skynet | 2 | python | def setup(hass, base_config):
from pylutron import Lutron
hass.data[LUTRON_CONTROLLER] = None
hass.data[LUTRON_DEVICES] = {'light': []}
hass.data[LUTRON_GROUPS] = {}
config = base_config.get(DOMAIN)
hass.data[LUTRON_CONTROLLER] = Lutron(config['lutron_host'], config['lutron_user'], config['... | def setup(hass, base_config):
from pylutron import Lutron
hass.data[LUTRON_CONTROLLER] = None
hass.data[LUTRON_DEVICES] = {'light': []}
hass.data[LUTRON_GROUPS] = {}
config = base_config.get(DOMAIN)
hass.data[LUTRON_CONTROLLER] = Lutron(config['lutron_host'], config['lutron_user'], config['... |
ce3a36179e4b12786b1b6e4eb39c25b89de819ce9ff9a39560d9a216bfa238aa | def __init__(self, hass, domain, area_name, lutron_device, controller):
'Initialize the device.'
self._lutron_device = lutron_device
self._controller = controller
self._area_name = area_name
self.hass = hass
object_id = '{} {}'.format(area_name, lutron_device.name)
self.entity_id = generate_... | Initialize the device. | homeassistant/components/lutron.py | __init__ | loraxx753/skynet | 2 | python | def __init__(self, hass, domain, area_name, lutron_device, controller):
self._lutron_device = lutron_device
self._controller = controller
self._area_name = area_name
self.hass = hass
object_id = '{} {}'.format(area_name, lutron_device.name)
self.entity_id = generate_entity_id((domain + '.{}... | def __init__(self, hass, domain, area_name, lutron_device, controller):
self._lutron_device = lutron_device
self._controller = controller
self._area_name = area_name
self.hass = hass
object_id = '{} {}'.format(area_name, lutron_device.name)
self.entity_id = generate_entity_id((domain + '.{}... |
82f5bb6e516fe265161aaa7b9e743ffbbe67b6c2eb88f8ba247099c434b58af0 | def _update_callback(self, _device):
'Callback invoked by pylutron when the device state changes.'
self.schedule_update_ha_state() | Callback invoked by pylutron when the device state changes. | homeassistant/components/lutron.py | _update_callback | loraxx753/skynet | 2 | python | def _update_callback(self, _device):
self.schedule_update_ha_state() | def _update_callback(self, _device):
self.schedule_update_ha_state()<|docstring|>Callback invoked by pylutron when the device state changes.<|endoftext|> |
d2fa5ef853544a33241f5a41f0b6f30e5ab3168f053a76324b2d814e7e13c6ce | @property
def name(self):
'Return the name of the device.'
return self._lutron_device.name | Return the name of the device. | homeassistant/components/lutron.py | name | loraxx753/skynet | 2 | python | @property
def name(self):
return self._lutron_device.name | @property
def name(self):
return self._lutron_device.name<|docstring|>Return the name of the device.<|endoftext|> |
53669033a44cc2b7f0c0eb1c203b1e7a7c81e72e96769d5c38bc62208b72137f | @property
def should_poll(self):
'No polling needed.'
return False | No polling needed. | homeassistant/components/lutron.py | should_poll | loraxx753/skynet | 2 | python | @property
def should_poll(self):
return False | @property
def should_poll(self):
return False<|docstring|>No polling needed.<|endoftext|> |
8e65e1fef013a9f10868ac58160266b69b27c971ad46940268afcb7afee4b19f | def get_memories(tree):
'Given a Devicetree, get the list of memories to describe in the\n linker script'
regions = get_chosen_regions(tree)
compute_address_ranges(regions)
memories = invert_regions_to_memories(regions)
compute_attributes(memories)
format_hex(memories)
return memories | Given a Devicetree, get the list of memories to describe in the
linker script | memory_map.py | get_memories | sifive/metal-depend | 0 | python | def get_memories(tree):
'Given a Devicetree, get the list of memories to describe in the\n linker script'
regions = get_chosen_regions(tree)
compute_address_ranges(regions)
memories = invert_regions_to_memories(regions)
compute_attributes(memories)
format_hex(memories)
return memories | def get_memories(tree):
'Given a Devicetree, get the list of memories to describe in the\n linker script'
regions = get_chosen_regions(tree)
compute_address_ranges(regions)
memories = invert_regions_to_memories(regions)
compute_attributes(memories)
format_hex(memories)
return memories<... |
65b5d14a6abfdc0410e775fa2e7bec67e41f5ecee25c82616ad36f1f44d224e4 | def get_load_map(memories, scratchpad):
'Given the list of memories in the linker script, get the lma/vma\n pairs for each of the regions in the linker script'
ram = dict()
rom = dict()
itim = dict()
if ('testram' in memories):
rom['vma'] = 'testram'
ram['lma'] = 'testram'
... | Given the list of memories in the linker script, get the lma/vma
pairs for each of the regions in the linker script | memory_map.py | get_load_map | sifive/metal-depend | 0 | python | def get_load_map(memories, scratchpad):
'Given the list of memories in the linker script, get the lma/vma\n pairs for each of the regions in the linker script'
ram = dict()
rom = dict()
itim = dict()
if ('testram' in memories):
rom['vma'] = 'testram'
ram['lma'] = 'testram'
... | def get_load_map(memories, scratchpad):
'Given the list of memories in the linker script, get the lma/vma\n pairs for each of the regions in the linker script'
ram = dict()
rom = dict()
itim = dict()
if ('testram' in memories):
rom['vma'] = 'testram'
ram['lma'] = 'testram'
... |
413cae28c4d3ab8e46c6405873ac76cda9c6d74e7504af25c23210e23f452896 | def get_chosen_region(dts, chosen_property_name):
'Extract the requested address region from the chosen property'
chosen_property = dts.chosen(chosen_property_name)
if chosen_property:
chosen_node = dts.get_by_reference(chosen_property[0])
chosen_region = chosen_property[1]
chosen_of... | Extract the requested address region from the chosen property | memory_map.py | get_chosen_region | sifive/metal-depend | 0 | python | def get_chosen_region(dts, chosen_property_name):
chosen_property = dts.chosen(chosen_property_name)
if chosen_property:
chosen_node = dts.get_by_reference(chosen_property[0])
chosen_region = chosen_property[1]
chosen_offset = chosen_property[2]
return {'node': chosen_node, ... | def get_chosen_region(dts, chosen_property_name):
chosen_property = dts.chosen(chosen_property_name)
if chosen_property:
chosen_node = dts.get_by_reference(chosen_property[0])
chosen_region = chosen_property[1]
chosen_offset = chosen_property[2]
return {'node': chosen_node, ... |
5ba6f8f0082ed609d5fd930e97fa4d4e8dbdc36958798992a754de8ac875291a | def get_chosen_regions(tree):
'Given the tree, get the regions requested by chosen properties.\n Exits with an error if required properties are missing or the\n parameters are invalid'
regions = {'entry': get_chosen_region(tree, 'metal,entry'), 'ram': get_chosen_region(tree, 'metal,ram'), 'itim': ge... | Given the tree, get the regions requested by chosen properties.
Exits with an error if required properties are missing or the
parameters are invalid | memory_map.py | get_chosen_regions | sifive/metal-depend | 0 | python | def get_chosen_regions(tree):
'Given the tree, get the regions requested by chosen properties.\n Exits with an error if required properties are missing or the\n parameters are invalid'
regions = {'entry': get_chosen_region(tree, 'metal,entry'), 'ram': get_chosen_region(tree, 'metal,ram'), 'itim': ge... | def get_chosen_regions(tree):
'Given the tree, get the regions requested by chosen properties.\n Exits with an error if required properties are missing or the\n parameters are invalid'
regions = {'entry': get_chosen_region(tree, 'metal,entry'), 'ram': get_chosen_region(tree, 'metal,ram'), 'itim': ge... |
f9750ad1c9ca47b1a2b07ebd1212aea712f2f57262c1cd051b65411d37a623fb | def compute_address_range(region):
'Extract the address range from the reg of the Node'
reg = region['node'].get_reg()
base = (reg[region['region']][0] + region['offset'])
length = (reg[region['region']][1] - region['offset'])
region['base'] = base
region['length'] = length | Extract the address range from the reg of the Node | memory_map.py | compute_address_range | sifive/metal-depend | 0 | python | def compute_address_range(region):
reg = region['node'].get_reg()
base = (reg[region['region']][0] + region['offset'])
length = (reg[region['region']][1] - region['offset'])
region['base'] = base
region['length'] = length | def compute_address_range(region):
reg = region['node'].get_reg()
base = (reg[region['region']][0] + region['offset'])
length = (reg[region['region']][1] - region['offset'])
region['base'] = base
region['length'] = length<|docstring|>Extract the address range from the reg of the Node<|endoftext... |
3ccece3618de3c6ba04c65e93cd86186d75c6b5025f794b51f175769aa80ddc9 | def compute_address_ranges(regions):
'Given the requested regions, compute the effective address ranges\n to use for each'
for (_, region) in regions.items():
if (region is not None):
compute_address_range(region)
region_values = [r for r in regions.values() if (r is not None)]
... | Given the requested regions, compute the effective address ranges
to use for each | memory_map.py | compute_address_ranges | sifive/metal-depend | 0 | python | def compute_address_ranges(regions):
'Given the requested regions, compute the effective address ranges\n to use for each'
for (_, region) in regions.items():
if (region is not None):
compute_address_range(region)
region_values = [r for r in regions.values() if (r is not None)]
... | def compute_address_ranges(regions):
'Given the requested regions, compute the effective address ranges\n to use for each'
for (_, region) in regions.items():
if (region is not None):
compute_address_range(region)
region_values = [r for r in regions.values() if (r is not None)]
... |
3bf0a3aafe169deb43803ec5c244d46b143b0ec2944a1a64a6327ae260eaae16 | def regions_overlap(region_a, region_b):
'Test if regions are identical'
if ((region_a is None) or (region_b is None)):
return False
return ((region_a['base'] == region_b['base']) and (region_a['length'] == region_b['length'])) | Test if regions are identical | memory_map.py | regions_overlap | sifive/metal-depend | 0 | python | def regions_overlap(region_a, region_b):
if ((region_a is None) or (region_b is None)):
return False
return ((region_a['base'] == region_b['base']) and (region_a['length'] == region_b['length'])) | def regions_overlap(region_a, region_b):
if ((region_a is None) or (region_b is None)):
return False
return ((region_a['base'] == region_b['base']) and (region_a['length'] == region_b['length']))<|docstring|>Test if regions are identical<|endoftext|> |
027f623bb8301b7c28cd16578a6708a239da19e7e16179ad03ea9ea5be116d32 | def invert_regions_to_memories(regions):
'Given the requested regions with computed effective address ranges,\n invert the data structure to get the list of memories for the\n linker script'
memories = dict()
if regions_overlap(regions['ram'], regions['entry']):
memories['testram'] = {'n... | Given the requested regions with computed effective address ranges,
invert the data structure to get the list of memories for the
linker script | memory_map.py | invert_regions_to_memories | sifive/metal-depend | 0 | python | def invert_regions_to_memories(regions):
'Given the requested regions with computed effective address ranges,\n invert the data structure to get the list of memories for the\n linker script'
memories = dict()
if regions_overlap(regions['ram'], regions['entry']):
memories['testram'] = {'n... | def invert_regions_to_memories(regions):
'Given the requested regions with computed effective address ranges,\n invert the data structure to get the list of memories for the\n linker script'
memories = dict()
if regions_overlap(regions['ram'], regions['entry']):
memories['testram'] = {'n... |
caacf878db8004eb5ee6804ca378e860c4035acf77cd28973f8fd3ab6e5d0b95 | def attributes_from_contents(contents):
'Get the attributes from the contents of the memory'
attributes = ''
if ('entry' in contents):
attributes += 'rxi'
if ('ram' in contents):
attributes += 'rwa'
if ('itim' in contents):
attributes += 'rwxai'
attributes = ''.join(sorte... | Get the attributes from the contents of the memory | memory_map.py | attributes_from_contents | sifive/metal-depend | 0 | python | def attributes_from_contents(contents):
attributes =
if ('entry' in contents):
attributes += 'rxi'
if ('ram' in contents):
attributes += 'rwa'
if ('itim' in contents):
attributes += 'rwxai'
attributes = .join(sorted(list(set(attributes))))
antiattributes =
for ... | def attributes_from_contents(contents):
attributes =
if ('entry' in contents):
attributes += 'rxi'
if ('ram' in contents):
attributes += 'rwa'
if ('itim' in contents):
attributes += 'rwxai'
attributes = .join(sorted(list(set(attributes))))
antiattributes =
for ... |
962f0d094412dd1d9b64fca9693c81e7a3bbd09b690f488a2dded71106f8e034 | def compute_attributes(memories):
'Given the list of memories and their contents, compute the linker\n script attributes'
for (_, memory) in memories.items():
memory['attributes'] = attributes_from_contents(memory['contents']) | Given the list of memories and their contents, compute the linker
script attributes | memory_map.py | compute_attributes | sifive/metal-depend | 0 | python | def compute_attributes(memories):
'Given the list of memories and their contents, compute the linker\n script attributes'
for (_, memory) in memories.items():
memory['attributes'] = attributes_from_contents(memory['contents']) | def compute_attributes(memories):
'Given the list of memories and their contents, compute the linker\n script attributes'
for (_, memory) in memories.items():
memory['attributes'] = attributes_from_contents(memory['contents'])<|docstring|>Given the list of memories and their contents, compute the ... |
c9c0f58f4b129acde5f778a4fa9215ac8706b4d26d05657c0ea38d090ce677e0 | def format_hex(memories):
'Provide hex-formatted base and length for parameterizing template'
for (_, memory) in memories.items():
memory['base_hex'] = ('0x%x' % memory['base'])
memory['length_hex'] = ('0x%x' % memory['length']) | Provide hex-formatted base and length for parameterizing template | memory_map.py | format_hex | sifive/metal-depend | 0 | python | def format_hex(memories):
for (_, memory) in memories.items():
memory['base_hex'] = ('0x%x' % memory['base'])
memory['length_hex'] = ('0x%x' % memory['length']) | def format_hex(memories):
for (_, memory) in memories.items():
memory['base_hex'] = ('0x%x' % memory['base'])
memory['length_hex'] = ('0x%x' % memory['length'])<|docstring|>Provide hex-formatted base and length for parameterizing template<|endoftext|> |
327e4948fa96c47e8ffd9bcf8085b055bf4d49546bff39b0c8811c2cad680cb2 | def pad_to_max_length(self, max_seq_length, pad_token_id):
'Pad the feature vectors so that they all have max_seq_length.\n\n Args:\n max_seq_length: The length that features will have after padding.\n pad_token_id: input_ids feature is padded with this ID, other features\n with ID 0.\n '
... | Pad the feature vectors so that they all have max_seq_length.
Args:
max_seq_length: The length that features will have after padding.
pad_token_id: input_ids feature is padded with this ID, other features
with ID 0. | bert_example.py | pad_to_max_length | tejvi-m/lasertagger | 592 | python | def pad_to_max_length(self, max_seq_length, pad_token_id):
'Pad the feature vectors so that they all have max_seq_length.\n\n Args:\n max_seq_length: The length that features will have after padding.\n pad_token_id: input_ids feature is padded with this ID, other features\n with ID 0.\n '
... | def pad_to_max_length(self, max_seq_length, pad_token_id):
'Pad the feature vectors so that they all have max_seq_length.\n\n Args:\n max_seq_length: The length that features will have after padding.\n pad_token_id: input_ids feature is padded with this ID, other features\n with ID 0.\n '
... |
fefb2768e027bdbbedf596e729a12f813a82de16c9b22f6d2f3f597986c97691 | def to_tf_example(self):
'Returns this object as a tf.Example.'
def int_feature(values):
return tf.train.Feature(int64_list=tf.train.Int64List(value=list(values)))
tf_features = collections.OrderedDict([(key, int_feature(val)) for (key, val) in self.features.items()])
return tf.train.Example(fe... | Returns this object as a tf.Example. | bert_example.py | to_tf_example | tejvi-m/lasertagger | 592 | python | def to_tf_example(self):
def int_feature(values):
return tf.train.Feature(int64_list=tf.train.Int64List(value=list(values)))
tf_features = collections.OrderedDict([(key, int_feature(val)) for (key, val) in self.features.items()])
return tf.train.Example(features=tf.train.Features(feature=tf_fe... | def to_tf_example(self):
def int_feature(values):
return tf.train.Feature(int64_list=tf.train.Int64List(value=list(values)))
tf_features = collections.OrderedDict([(key, int_feature(val)) for (key, val) in self.features.items()])
return tf.train.Example(features=tf.train.Features(feature=tf_fe... |
bb5a66e9ecbb1bc97bbccbe9c3e117acf55a31370d540cd3f8ab7ada34d22d51 | def get_token_labels(self):
'Returns labels/tags for the original tokens, not for wordpieces.'
labels = []
for idx in self._token_start_indices:
if ((idx < len(self.features['labels'])) and self.features['labels_mask'][idx]):
labels.append(self.features['labels'][idx])
else:
... | Returns labels/tags for the original tokens, not for wordpieces. | bert_example.py | get_token_labels | tejvi-m/lasertagger | 592 | python | def get_token_labels(self):
labels = []
for idx in self._token_start_indices:
if ((idx < len(self.features['labels'])) and self.features['labels_mask'][idx]):
labels.append(self.features['labels'][idx])
else:
labels.append(self._default_label)
return labels | def get_token_labels(self):
labels = []
for idx in self._token_start_indices:
if ((idx < len(self.features['labels'])) and self.features['labels_mask'][idx]):
labels.append(self.features['labels'][idx])
else:
labels.append(self._default_label)
return labels<|docs... |
1f4da86fc21653febf16d7682abb18127212074cc03d2a8b0bca629c37ad1b84 | def __init__(self, label_map, vocab_file, max_seq_length, do_lower_case, converter):
'Initializes an instance of BertExampleBuilder.\n\n Args:\n label_map: Mapping from tags to tag IDs.\n vocab_file: Path to BERT vocabulary file.\n max_seq_length: Maximum sequence length.\n do_lower_case: Whe... | Initializes an instance of BertExampleBuilder.
Args:
label_map: Mapping from tags to tag IDs.
vocab_file: Path to BERT vocabulary file.
max_seq_length: Maximum sequence length.
do_lower_case: Whether to lower case the input text. Should be True for
uncased models and False for cased models.
converter: Co... | bert_example.py | __init__ | tejvi-m/lasertagger | 592 | python | def __init__(self, label_map, vocab_file, max_seq_length, do_lower_case, converter):
'Initializes an instance of BertExampleBuilder.\n\n Args:\n label_map: Mapping from tags to tag IDs.\n vocab_file: Path to BERT vocabulary file.\n max_seq_length: Maximum sequence length.\n do_lower_case: Whe... | def __init__(self, label_map, vocab_file, max_seq_length, do_lower_case, converter):
'Initializes an instance of BertExampleBuilder.\n\n Args:\n label_map: Mapping from tags to tag IDs.\n vocab_file: Path to BERT vocabulary file.\n max_seq_length: Maximum sequence length.\n do_lower_case: Whe... |
cc6c7559993523fdcbc4c3d3d041bb837598235d88b0844a972c2e36085ea3cb | def build_bert_example(self, sources, target=None, use_arbitrary_target_ids_for_infeasible_examples=False):
"Constructs a BERT Example.\n\n Args:\n sources: List of source texts.\n target: Target text or None when building an example during inference.\n use_arbitrary_target_ids_for_infeasible_exam... | Constructs a BERT Example.
Args:
sources: List of source texts.
target: Target text or None when building an example during inference.
use_arbitrary_target_ids_for_infeasible_examples: Whether to build an
example with arbitrary target ids even if the target can't be obtained
via tagging.
Returns:
Bert... | bert_example.py | build_bert_example | tejvi-m/lasertagger | 592 | python | def build_bert_example(self, sources, target=None, use_arbitrary_target_ids_for_infeasible_examples=False):
"Constructs a BERT Example.\n\n Args:\n sources: List of source texts.\n target: Target text or None when building an example during inference.\n use_arbitrary_target_ids_for_infeasible_exam... | def build_bert_example(self, sources, target=None, use_arbitrary_target_ids_for_infeasible_examples=False):
"Constructs a BERT Example.\n\n Args:\n sources: List of source texts.\n target: Target text or None when building an example during inference.\n use_arbitrary_target_ids_for_infeasible_exam... |
1b2444e98cb3dd59d47b2f5a2808f8f57e4ac7d35a5248ec2124fd9150813479 | def _split_to_wordpieces(self, tokens, labels):
'Splits tokens (and the labels accordingly) to WordPieces.\n\n Args:\n tokens: Tokens to be split.\n labels: Labels (one per token) to be split.\n\n Returns:\n 3-tuple with the split tokens, split labels, and the indices of the\n WordPieces t... | Splits tokens (and the labels accordingly) to WordPieces.
Args:
tokens: Tokens to be split.
labels: Labels (one per token) to be split.
Returns:
3-tuple with the split tokens, split labels, and the indices of the
WordPieces that start a token. | bert_example.py | _split_to_wordpieces | tejvi-m/lasertagger | 592 | python | def _split_to_wordpieces(self, tokens, labels):
'Splits tokens (and the labels accordingly) to WordPieces.\n\n Args:\n tokens: Tokens to be split.\n labels: Labels (one per token) to be split.\n\n Returns:\n 3-tuple with the split tokens, split labels, and the indices of the\n WordPieces t... | def _split_to_wordpieces(self, tokens, labels):
'Splits tokens (and the labels accordingly) to WordPieces.\n\n Args:\n tokens: Tokens to be split.\n labels: Labels (one per token) to be split.\n\n Returns:\n 3-tuple with the split tokens, split labels, and the indices of the\n WordPieces t... |
8d1626a694af7a2dd38de405c38b5141531ff249893a478fd0c610062f2da0ab | def _truncate_list(self, x):
'Returns truncated version of x according to the self._max_seq_length.'
return x[:(self._max_seq_length - 2)] | Returns truncated version of x according to the self._max_seq_length. | bert_example.py | _truncate_list | tejvi-m/lasertagger | 592 | python | def _truncate_list(self, x):
return x[:(self._max_seq_length - 2)] | def _truncate_list(self, x):
return x[:(self._max_seq_length - 2)]<|docstring|>Returns truncated version of x according to the self._max_seq_length.<|endoftext|> |
8cdaec4ed04916ed63252ff26939995e849b5508ecaaea453c233006a4cfed25 | def _get_pad_id(self):
"Returns the ID of the [PAD] token (or 0 if it's not in the vocab)."
try:
return self._tokenizer.convert_tokens_to_ids(['[PAD]'])[0]
except KeyError:
return 0 | Returns the ID of the [PAD] token (or 0 if it's not in the vocab). | bert_example.py | _get_pad_id | tejvi-m/lasertagger | 592 | python | def _get_pad_id(self):
try:
return self._tokenizer.convert_tokens_to_ids(['[PAD]'])[0]
except KeyError:
return 0 | def _get_pad_id(self):
try:
return self._tokenizer.convert_tokens_to_ids(['[PAD]'])[0]
except KeyError:
return 0<|docstring|>Returns the ID of the [PAD] token (or 0 if it's not in the vocab).<|endoftext|> |
631590e318a7d96aa37f016598d8f0f1bd742aedec8e94c011b2407cc2c5c8c0 | def load(file, *, bitmap=None, palette=None):
'Loads a bmp image from the open ``file``.\n\n Returns tuple of bitmap object and palette object.\n\n :param object bitmap: Type to store bitmap data. Must have API similar to `displayio.Bitmap`.\n Will be skipped if None\n :param object palette: Type to s... | Loads a bmp image from the open ``file``.
Returns tuple of bitmap object and palette object.
:param object bitmap: Type to store bitmap data. Must have API similar to `displayio.Bitmap`.
Will be skipped if None
:param object palette: Type to store the palette. Must have API similar to
`displayio.Palette`. Will be... | lib/adafruit_imageload/bmp/__init__.py | load | jacoblb64/pico_rgb_keypad_hid | 47 | python | def load(file, *, bitmap=None, palette=None):
'Loads a bmp image from the open ``file``.\n\n Returns tuple of bitmap object and palette object.\n\n :param object bitmap: Type to store bitmap data. Must have API similar to `displayio.Bitmap`.\n Will be skipped if None\n :param object palette: Type to s... | def load(file, *, bitmap=None, palette=None):
'Loads a bmp image from the open ``file``.\n\n Returns tuple of bitmap object and palette object.\n\n :param object bitmap: Type to store bitmap data. Must have API similar to `displayio.Bitmap`.\n Will be skipped if None\n :param object palette: Type to s... |
fbe77fbd5b9481e699ab291da9f23c1393c0a45ca7031f1953381f4b6e896110 | def recupdate(d, u):
'TODO\n\t'
for (k, v) in u.iteritems():
if isinstance(v, collections.Mapping):
r = recupdate(d.get(k, {}), v)
d[k] = r
else:
d[k] = u[k]
return d | TODO | test/test.py | recupdate | aidanhs/shutit | 2 | python | def recupdate(d, u):
'\n\t'
for (k, v) in u.iteritems():
if isinstance(v, collections.Mapping):
r = recupdate(d.get(k, {}), v)
d[k] = r
else:
d[k] = u[k]
return d | def recupdate(d, u):
'\n\t'
for (k, v) in u.iteritems():
if isinstance(v, collections.Mapping):
r = recupdate(d.get(k, {}), v)
d[k] = r
else:
d[k] = u[k]
return d<|docstring|>TODO<|endoftext|> |
f2183b1db34714dc1464a91c64bc409c66adbceb0f1e8ad59dd1f9de56e41128 | def setUp(self):
'TODO\n\t\t'
self.shutit = shutit_global.init()
def noop(*args, **kwargs):
pass
def fail(*args, **kwargs):
raise ShutItTestException('failed')
self.shutit.log = noop
self.shutit.fail = fail
self.shutit.get_default_child = noop
recupdate(self.shutit.cfg,... | TODO | test/test.py | setUp | aidanhs/shutit | 2 | python | def setUp(self):
'\n\t\t'
self.shutit = shutit_global.init()
def noop(*args, **kwargs):
pass
def fail(*args, **kwargs):
raise ShutItTestException('failed')
self.shutit.log = noop
self.shutit.fail = fail
self.shutit.get_default_child = noop
recupdate(self.shutit.cfg, {'b... | def setUp(self):
'\n\t\t'
self.shutit = shutit_global.init()
def noop(*args, **kwargs):
pass
def fail(*args, **kwargs):
raise ShutItTestException('failed')
self.shutit.log = noop
self.shutit.fail = fail
self.shutit.get_default_child = noop
recupdate(self.shutit.cfg, {'b... |
bdf1f6088e059c26d402314dc4290ba8f9afd49b29ede94e752feee6acab889f | def test_dep_exists_err(self):
'TODO\n\t\t'
self.shutit.cfg.update({'tk.shutit.test1': {'build': True, 'remove': False}})
self.shutit.shutit_map = {'tk.shutit.test1': Bunch(module_id='tk.shutit.test1', run_order=1.1, depends_on=['tk.shutit.test0'])}
errs = shutit_main.check_deps(self.shutit)
self.as... | TODO | test/test.py | test_dep_exists_err | aidanhs/shutit | 2 | python | def test_dep_exists_err(self):
'\n\t\t'
self.shutit.cfg.update({'tk.shutit.test1': {'build': True, 'remove': False}})
self.shutit.shutit_map = {'tk.shutit.test1': Bunch(module_id='tk.shutit.test1', run_order=1.1, depends_on=['tk.shutit.test0'])}
errs = shutit_main.check_deps(self.shutit)
self.assert... | def test_dep_exists_err(self):
'\n\t\t'
self.shutit.cfg.update({'tk.shutit.test1': {'build': True, 'remove': False}})
self.shutit.shutit_map = {'tk.shutit.test1': Bunch(module_id='tk.shutit.test1', run_order=1.1, depends_on=['tk.shutit.test0'])}
errs = shutit_main.check_deps(self.shutit)
self.assert... |
47387bf3d4c03a5c51b1573ada9ac122d8b7e058a6e53b954365725d9393f790 | def test_dep_build_err(self):
'TODO\n\t\t'
self.shutit.cfg.update({'tk.shutit.test1': {'build': False, 'shutit.core.module.build_ifneeded': False, 'remove': False}, 'tk.shutit.test2': {'build': True, 'remove': False}})
self.shutit.shutit_map = {'tk.shutit.test2': Bunch(module_id='tk.shutit.test2', run_order... | TODO | test/test.py | test_dep_build_err | aidanhs/shutit | 2 | python | def test_dep_build_err(self):
'\n\t\t'
self.shutit.cfg.update({'tk.shutit.test1': {'build': False, 'shutit.core.module.build_ifneeded': False, 'remove': False}, 'tk.shutit.test2': {'build': True, 'remove': False}})
self.shutit.shutit_map = {'tk.shutit.test2': Bunch(module_id='tk.shutit.test2', run_order=1.2... | def test_dep_build_err(self):
'\n\t\t'
self.shutit.cfg.update({'tk.shutit.test1': {'build': False, 'shutit.core.module.build_ifneeded': False, 'remove': False}, 'tk.shutit.test2': {'build': True, 'remove': False}})
self.shutit.shutit_map = {'tk.shutit.test2': Bunch(module_id='tk.shutit.test2', run_order=1.2... |
81857805f73c2f9e6c4c7d6102cd4f952443c3ef22ee57a8d227b22e1a9ba710 | def test_dep_order_err(self):
'TODO\n\t\t'
self.shutit.cfg.update({'tk.shutit.test1': {'build': True, 'remove': False}, 'tk.shutit.test2': {'build': True, 'remove': False}})
self.shutit.shutit_map = {'tk.shutit.test2': Bunch(module_id='tk.shutit.test2', run_order=1.2, depends_on=['tk.shutit.test1']), 'tk.sh... | TODO | test/test.py | test_dep_order_err | aidanhs/shutit | 2 | python | def test_dep_order_err(self):
'\n\t\t'
self.shutit.cfg.update({'tk.shutit.test1': {'build': True, 'remove': False}, 'tk.shutit.test2': {'build': True, 'remove': False}})
self.shutit.shutit_map = {'tk.shutit.test2': Bunch(module_id='tk.shutit.test2', run_order=1.2, depends_on=['tk.shutit.test1']), 'tk.shutit... | def test_dep_order_err(self):
'\n\t\t'
self.shutit.cfg.update({'tk.shutit.test1': {'build': True, 'remove': False}, 'tk.shutit.test2': {'build': True, 'remove': False}})
self.shutit.shutit_map = {'tk.shutit.test2': Bunch(module_id='tk.shutit.test2', run_order=1.2, depends_on=['tk.shutit.test1']), 'tk.shutit... |
b9d8e0a49ab6497f97c9241c05ec711b3a6e767cbfceaa5f9a28bf7c16118011 | def test_dep_resolution(self):
'TODO\n\t\t'
self.shutit.cfg.update({'tk.shutit.test1': {'build': False, 'shutit.core.module.build_ifneeded': True, 'remove': False}, 'tk.shutit.test2': {'build': False, 'shutit.core.module.build_ifneeded': True, 'remove': False}, 'tk.shutit.test3': {'build': True, 'remove': False... | TODO | test/test.py | test_dep_resolution | aidanhs/shutit | 2 | python | def test_dep_resolution(self):
'\n\t\t'
self.shutit.cfg.update({'tk.shutit.test1': {'build': False, 'shutit.core.module.build_ifneeded': True, 'remove': False}, 'tk.shutit.test2': {'build': False, 'shutit.core.module.build_ifneeded': True, 'remove': False}, 'tk.shutit.test3': {'build': True, 'remove': False}})
... | def test_dep_resolution(self):
'\n\t\t'
self.shutit.cfg.update({'tk.shutit.test1': {'build': False, 'shutit.core.module.build_ifneeded': True, 'remove': False}, 'tk.shutit.test2': {'build': False, 'shutit.core.module.build_ifneeded': True, 'remove': False}, 'tk.shutit.test3': {'build': True, 'remove': False}})
... |
0951ad837b7c470c2c2dde69485c296f231c4364816b9587eab80a7befa8176b | def deleteNode(self, node):
'\n :type node: ListNode\n :rtype: void Do not return anything, modify node in-place instead.\n '
'\n Method 1:\n\n * Traverse through the LinkedList, by constantly\n checking the value of the next element.\n * If the next element is e... | :type node: ListNode
:rtype: void Do not return anything, modify node in-place instead. | 00_Code/01_LeetCode/237_DeleteNodeinaLinkedList.py | deleteNode | KartikKannapur/Data_Structures_and_Algorithms_Python | 1 | python | def deleteNode(self, node):
'\n :type node: ListNode\n :rtype: void Do not return anything, modify node in-place instead.\n '
'\n Method 1:\n\n * Traverse through the LinkedList, by constantly\n checking the value of the next element.\n * If the next element is e... | def deleteNode(self, node):
'\n :type node: ListNode\n :rtype: void Do not return anything, modify node in-place instead.\n '
'\n Method 1:\n\n * Traverse through the LinkedList, by constantly\n checking the value of the next element.\n * If the next element is e... |
42a013d2d5ff1b8c8ffb9aa2605cc134e9950dfdbd6cea2da57f5986a11c5982 | async def async_setup_platform(hass: HomeAssistant, config: ConfigType, async_add_entities: AddEntitiesCallback, discovery_info: (DiscoveryInfoType | None)=None) -> None:
'Old way of setting up the platform.\n\n Can only be called when a user accidentally mentions the platform in their\n config. But even in t... | Old way of setting up the platform.
Can only be called when a user accidentally mentions the platform in their
config. But even in that case it would have been ignored. | homeassistant/components/daikin/switch.py | async_setup_platform | GrandMoff100/homeassistant-core | 30,023 | python | async def async_setup_platform(hass: HomeAssistant, config: ConfigType, async_add_entities: AddEntitiesCallback, discovery_info: (DiscoveryInfoType | None)=None) -> None:
'Old way of setting up the platform.\n\n Can only be called when a user accidentally mentions the platform in their\n config. But even in t... | async def async_setup_platform(hass: HomeAssistant, config: ConfigType, async_add_entities: AddEntitiesCallback, discovery_info: (DiscoveryInfoType | None)=None) -> None:
'Old way of setting up the platform.\n\n Can only be called when a user accidentally mentions the platform in their\n config. But even in t... |
2bdb20805a3cb5e8f1c63d0e6cb4c9eff3e37f7c0cba6cd94db3a3e023eb1d0d | async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback) -> None:
'Set up Daikin climate based on config_entry.'
daikin_api = hass.data[DAIKIN_DOMAIN][entry.entry_id]
switches: list[(DaikinZoneSwitch | DaikinStreamerSwitch)] = []
if (zones := daikin_a... | Set up Daikin climate based on config_entry. | homeassistant/components/daikin/switch.py | async_setup_entry | GrandMoff100/homeassistant-core | 30,023 | python | async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback) -> None:
daikin_api = hass.data[DAIKIN_DOMAIN][entry.entry_id]
switches: list[(DaikinZoneSwitch | DaikinStreamerSwitch)] = []
if (zones := daikin_api.device.zones):
switches.extend([Dai... | async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback) -> None:
daikin_api = hass.data[DAIKIN_DOMAIN][entry.entry_id]
switches: list[(DaikinZoneSwitch | DaikinStreamerSwitch)] = []
if (zones := daikin_api.device.zones):
switches.extend([Dai... |
786dc7c94b9f1d717fada956a97088cde84725bc1ff0f8072b650d67c1d7372d | def __init__(self, daikin_api, zone_id):
'Initialize the zone.'
self._api = daikin_api
self._zone_id = zone_id | Initialize the zone. | homeassistant/components/daikin/switch.py | __init__ | GrandMoff100/homeassistant-core | 30,023 | python | def __init__(self, daikin_api, zone_id):
self._api = daikin_api
self._zone_id = zone_id | def __init__(self, daikin_api, zone_id):
self._api = daikin_api
self._zone_id = zone_id<|docstring|>Initialize the zone.<|endoftext|> |
1c9b21f9231725ef7c9555c4b203aa0327c74f03c6acbfd7535dc1d0b55304ad | @property
def unique_id(self):
'Return a unique ID.'
return f'{self._api.device.mac}-zone{self._zone_id}' | Return a unique ID. | homeassistant/components/daikin/switch.py | unique_id | GrandMoff100/homeassistant-core | 30,023 | python | @property
def unique_id(self):
return f'{self._api.device.mac}-zone{self._zone_id}' | @property
def unique_id(self):
return f'{self._api.device.mac}-zone{self._zone_id}'<|docstring|>Return a unique ID.<|endoftext|> |
2f82babec3baa535cf43f3c926105ae380a378109c41e572c25f757d242eae46 | @property
def icon(self):
'Icon to use in the frontend, if any.'
return ZONE_ICON | Icon to use in the frontend, if any. | homeassistant/components/daikin/switch.py | icon | GrandMoff100/homeassistant-core | 30,023 | python | @property
def icon(self):
return ZONE_ICON | @property
def icon(self):
return ZONE_ICON<|docstring|>Icon to use in the frontend, if any.<|endoftext|> |
f6067532d5c3e40f9877674f0272f696c57f9c28fd6fc7a4a41a33495df8a5c0 | @property
def name(self):
'Return the name of the sensor.'
return f'{self._api.name} {self._api.device.zones[self._zone_id][0]}' | Return the name of the sensor. | homeassistant/components/daikin/switch.py | name | GrandMoff100/homeassistant-core | 30,023 | python | @property
def name(self):
return f'{self._api.name} {self._api.device.zones[self._zone_id][0]}' | @property
def name(self):
return f'{self._api.name} {self._api.device.zones[self._zone_id][0]}'<|docstring|>Return the name of the sensor.<|endoftext|> |
667d640d49feaa1ee56d0b55478135813ff286697a903185c60e0dc4b636c8a3 | @property
def is_on(self):
'Return the state of the sensor.'
return (self._api.device.zones[self._zone_id][1] == '1') | Return the state of the sensor. | homeassistant/components/daikin/switch.py | is_on | GrandMoff100/homeassistant-core | 30,023 | python | @property
def is_on(self):
return (self._api.device.zones[self._zone_id][1] == '1') | @property
def is_on(self):
return (self._api.device.zones[self._zone_id][1] == '1')<|docstring|>Return the state of the sensor.<|endoftext|> |
9a38b60885e1d5262da764bc73cf881f0640eaac9b157b80fc7b01581d455164 | @property
def device_info(self):
'Return a device description for device registry.'
return self._api.device_info | Return a device description for device registry. | homeassistant/components/daikin/switch.py | device_info | GrandMoff100/homeassistant-core | 30,023 | python | @property
def device_info(self):
return self._api.device_info | @property
def device_info(self):
return self._api.device_info<|docstring|>Return a device description for device registry.<|endoftext|> |
b1a89076e5c34df8d4b99e7e415c8c643851f299207e2f8918c4b2ad6c5e9ee1 | async def async_update(self):
'Retrieve latest state.'
(await self._api.async_update()) | Retrieve latest state. | homeassistant/components/daikin/switch.py | async_update | GrandMoff100/homeassistant-core | 30,023 | python | async def async_update(self):
(await self._api.async_update()) | async def async_update(self):
(await self._api.async_update())<|docstring|>Retrieve latest state.<|endoftext|> |
9cb85054cc65d04da535a3ae767d3d4af5e9f25154af6f962466b0962c536d95 | async def async_turn_on(self, **kwargs):
'Turn the zone on.'
(await self._api.device.set_zone(self._zone_id, '1')) | Turn the zone on. | homeassistant/components/daikin/switch.py | async_turn_on | GrandMoff100/homeassistant-core | 30,023 | python | async def async_turn_on(self, **kwargs):
(await self._api.device.set_zone(self._zone_id, '1')) | async def async_turn_on(self, **kwargs):
(await self._api.device.set_zone(self._zone_id, '1'))<|docstring|>Turn the zone on.<|endoftext|> |
366db0483bb8036b950b385f64c6c138f0a4ca759472e738d0ae3a6fa2d5bb3c | async def async_turn_off(self, **kwargs):
'Turn the zone off.'
(await self._api.device.set_zone(self._zone_id, '0')) | Turn the zone off. | homeassistant/components/daikin/switch.py | async_turn_off | GrandMoff100/homeassistant-core | 30,023 | python | async def async_turn_off(self, **kwargs):
(await self._api.device.set_zone(self._zone_id, '0')) | async def async_turn_off(self, **kwargs):
(await self._api.device.set_zone(self._zone_id, '0'))<|docstring|>Turn the zone off.<|endoftext|> |
c3f48bd6f8be9efb100264671d62b467f59d8af3cc11163c7440bde781cdbd1c | def __init__(self, daikin_api):
'Initialize streamer switch.'
self._api = daikin_api | Initialize streamer switch. | homeassistant/components/daikin/switch.py | __init__ | GrandMoff100/homeassistant-core | 30,023 | python | def __init__(self, daikin_api):
self._api = daikin_api | def __init__(self, daikin_api):
self._api = daikin_api<|docstring|>Initialize streamer switch.<|endoftext|> |
657b8fbabc1f8f2a97c84b99baf38b6cfe68651dc1b42279910a925eab45f7c8 | @property
def unique_id(self):
'Return a unique ID.'
return f'{self._api.device.mac}-streamer' | Return a unique ID. | homeassistant/components/daikin/switch.py | unique_id | GrandMoff100/homeassistant-core | 30,023 | python | @property
def unique_id(self):
return f'{self._api.device.mac}-streamer' | @property
def unique_id(self):
return f'{self._api.device.mac}-streamer'<|docstring|>Return a unique ID.<|endoftext|> |
c8862940163a2824a7f30b1fcdd19642ba0690344ea5cd5405d456a15b129166 | @property
def icon(self):
'Icon to use in the frontend, if any.'
return STREAMER_ICON | Icon to use in the frontend, if any. | homeassistant/components/daikin/switch.py | icon | GrandMoff100/homeassistant-core | 30,023 | python | @property
def icon(self):
return STREAMER_ICON | @property
def icon(self):
return STREAMER_ICON<|docstring|>Icon to use in the frontend, if any.<|endoftext|> |
ff58d7873d842f285c164f79a518b7667b1ef446043eddec5100953c80d4dae6 | @property
def name(self):
'Return the name of the sensor.'
return f'{self._api.name} streamer' | Return the name of the sensor. | homeassistant/components/daikin/switch.py | name | GrandMoff100/homeassistant-core | 30,023 | python | @property
def name(self):
return f'{self._api.name} streamer' | @property
def name(self):
return f'{self._api.name} streamer'<|docstring|>Return the name of the sensor.<|endoftext|> |
e214d188d0769fd6c6cc114700c8e05dc9e4f4e482cf8525681fd06d6b46c31a | @property
def is_on(self):
'Return the state of the sensor.'
return (DAIKIN_ATTR_STREAMER in self._api.device.represent(DAIKIN_ATTR_ADVANCED)[1]) | Return the state of the sensor. | homeassistant/components/daikin/switch.py | is_on | GrandMoff100/homeassistant-core | 30,023 | python | @property
def is_on(self):
return (DAIKIN_ATTR_STREAMER in self._api.device.represent(DAIKIN_ATTR_ADVANCED)[1]) | @property
def is_on(self):
return (DAIKIN_ATTR_STREAMER in self._api.device.represent(DAIKIN_ATTR_ADVANCED)[1])<|docstring|>Return the state of the sensor.<|endoftext|> |
9a38b60885e1d5262da764bc73cf881f0640eaac9b157b80fc7b01581d455164 | @property
def device_info(self):
'Return a device description for device registry.'
return self._api.device_info | Return a device description for device registry. | homeassistant/components/daikin/switch.py | device_info | GrandMoff100/homeassistant-core | 30,023 | python | @property
def device_info(self):
return self._api.device_info | @property
def device_info(self):
return self._api.device_info<|docstring|>Return a device description for device registry.<|endoftext|> |
b1a89076e5c34df8d4b99e7e415c8c643851f299207e2f8918c4b2ad6c5e9ee1 | async def async_update(self):
'Retrieve latest state.'
(await self._api.async_update()) | Retrieve latest state. | homeassistant/components/daikin/switch.py | async_update | GrandMoff100/homeassistant-core | 30,023 | python | async def async_update(self):
(await self._api.async_update()) | async def async_update(self):
(await self._api.async_update())<|docstring|>Retrieve latest state.<|endoftext|> |
5b1b3b72d21e699138519a932602fa0efc31dff9c97aa5faf083b04122cbcae7 | async def async_turn_on(self, **kwargs):
'Turn the zone on.'
(await self._api.device.set_streamer('on')) | Turn the zone on. | homeassistant/components/daikin/switch.py | async_turn_on | GrandMoff100/homeassistant-core | 30,023 | python | async def async_turn_on(self, **kwargs):
(await self._api.device.set_streamer('on')) | async def async_turn_on(self, **kwargs):
(await self._api.device.set_streamer('on'))<|docstring|>Turn the zone on.<|endoftext|> |
fec191dbd7a2ad63d880eace887d85dcd014f173c2ca77a7bd8a3825628edccf | async def async_turn_off(self, **kwargs):
'Turn the zone off.'
(await self._api.device.set_streamer('off')) | Turn the zone off. | homeassistant/components/daikin/switch.py | async_turn_off | GrandMoff100/homeassistant-core | 30,023 | python | async def async_turn_off(self, **kwargs):
(await self._api.device.set_streamer('off')) | async def async_turn_off(self, **kwargs):
(await self._api.device.set_streamer('off'))<|docstring|>Turn the zone off.<|endoftext|> |
728e445a0f05a898af22921096c517e3e34a262c40be0e151ad56567def0f63c | @classmethod
def delete_stale(cls):
'Delete stale tokens, ie tokens that are more than TOKEN_DURATION seconds older.'
cls.objects.filter(timestamp__lt=(now() - timedelta(seconds=3600))).delete() | Delete stale tokens, ie tokens that are more than TOKEN_DURATION seconds older. | sandbox/clientaddress/models.py | delete_stale | Bastilla123/shop2 | 0 | python | @classmethod
def delete_stale(cls):
cls.objects.filter(timestamp__lt=(now() - timedelta(seconds=3600))).delete() | @classmethod
def delete_stale(cls):
cls.objects.filter(timestamp__lt=(now() - timedelta(seconds=3600))).delete()<|docstring|>Delete stale tokens, ie tokens that are more than TOKEN_DURATION seconds older.<|endoftext|> |
e4eca10db8d47835f47b7e2426e10abc1eaf81b678938be288f47ebd7211ad40 | def find_colocated_sections(self, courses):
' Return colocated/cross-listed sections\n\n Parameters\n ----------\n courses : list of courses\n Set of courses to check for colocated ones\n\n Returns\n -------\n list of courses\n All colocated sections.\... | Return colocated/cross-listed sections
Parameters
----------
courses : list of courses
Set of courses to check for colocated ones
Returns
-------
list of courses
All colocated sections. | lib/course.py | find_colocated_sections | cca/libraries_course_lists2 | 0 | python | def find_colocated_sections(self, courses):
' Return colocated/cross-listed sections\n\n Parameters\n ----------\n courses : list of courses\n Set of courses to check for colocated ones\n\n Returns\n -------\n list of courses\n All colocated sections.\... | def find_colocated_sections(self, courses):
' Return colocated/cross-listed sections\n\n Parameters\n ----------\n courses : list of courses\n Set of courses to check for colocated ones\n\n Returns\n -------\n list of courses\n All colocated sections.\... |
9bcf4a4ba2bf5a9fee82a185611c016deda00749d71d3dbfde61802dd57a1749 | @property
def on_portal(self):
' boolean for whether a course is included in Portal course catalog '
if ((self.hidden != '1') and (self.status in PORTAL_STATUSES) and (self.owner != 'EXTED')):
return True
return False | boolean for whether a course is included in Portal course catalog | lib/course.py | on_portal | cca/libraries_course_lists2 | 0 | python | @property
def on_portal(self):
' '
if ((self.hidden != '1') and (self.status in PORTAL_STATUSES) and (self.owner != 'EXTED')):
return True
return False | @property
def on_portal(self):
' '
if ((self.hidden != '1') and (self.status in PORTAL_STATUSES) and (self.owner != 'EXTED')):
return True
return False<|docstring|>boolean for whether a course is included in Portal course catalog<|endoftext|> |
963fde7230c9187ff36f03fd4aa246aa7f793ac88d089a4c6716b978c1403c7c | def list(self):
'Get all available facilities.\n\n \x0c\n :returns: a list of all Pureport facilities\n :rtype: list\n '
return self.client.find_facilities() | Get all available facilities.
:returns: a list of all Pureport facilities
:rtype: list | pureport_client/commands/facilities/__init__.py | list | pureport/pureport-python-client | 4 | python | def list(self):
'Get all available facilities.\n\n \x0c\n :returns: a list of all Pureport facilities\n :rtype: list\n '
return self.client.find_facilities() | def list(self):
'Get all available facilities.\n\n \x0c\n :returns: a list of all Pureport facilities\n :rtype: list\n '
return self.client.find_facilities()<|docstring|>Get all available facilities.
:returns: a list of all Pureport facilities
:rtype: list<|endoftext|> |
6a5c7eeab69339722ce168277b2ecb5d8fe20de2a0d7dafd3a986b4abd912153 | @argument('facility_id')
def get(self, facility_id):
'Get a facility with the provided facility id.\n\n \x0c\n :param facility_id: the id of the facility to retrieve\n :type facility_id: str\n\n :returns: a facility object\n :rtype: Facility\n '
return self.client.get_f... | Get a facility with the provided facility id.
:param facility_id: the id of the facility to retrieve
:type facility_id: str
:returns: a facility object
:rtype: Facility | pureport_client/commands/facilities/__init__.py | get | pureport/pureport-python-client | 4 | python | @argument('facility_id')
def get(self, facility_id):
'Get a facility with the provided facility id.\n\n \x0c\n :param facility_id: the id of the facility to retrieve\n :type facility_id: str\n\n :returns: a facility object\n :rtype: Facility\n '
return self.client.get_f... | @argument('facility_id')
def get(self, facility_id):
'Get a facility with the provided facility id.\n\n \x0c\n :param facility_id: the id of the facility to retrieve\n :type facility_id: str\n\n :returns: a facility object\n :rtype: Facility\n '
return self.client.get_f... |
7621d5cf0a896edf8d0f7a104b2fc3abfe6ce61a8fc58f35afe69433a1a44bd3 | def test_get_about_key():
'Get a key from the about dictionary.'
key = about.get_about_key('Python')
assert (key == platform.python_version()) | Get a key from the about dictionary. | {{cookiecutter.project_slug}}/tests/test_about_widget.py | test_get_about_key | sisoe24/nuke-pyside-template | 0 | python | def test_get_about_key():
key = about.get_about_key('Python')
assert (key == platform.python_version()) | def test_get_about_key():
key = about.get_about_key('Python')
assert (key == platform.python_version())<|docstring|>Get a key from the about dictionary.<|endoftext|> |
eb2e06053d44c09f58f73f2abfd802100fa34f276ba9f38eb6fb591d937571f3 | def test_about_python_version():
'Python version should be 3.7.7 for nuke 13'
version = about.get_about_key('Python')
assert (version <= '3.7.7') | Python version should be 3.7.7 for nuke 13 | {{cookiecutter.project_slug}}/tests/test_about_widget.py | test_about_python_version | sisoe24/nuke-pyside-template | 0 | python | def test_about_python_version():
version = about.get_about_key('Python')
assert (version <= '3.7.7') | def test_about_python_version():
version = about.get_about_key('Python')
assert (version <= '3.7.7')<|docstring|>Python version should be 3.7.7 for nuke 13<|endoftext|> |
c5073db307825cb8a0822ba82a1828b36b49e2a6cbbf42be9a4bda8005e7e803 | def test_get_about_missing_key():
'Get a key that is not present in about dictionary.'
key = about.get_about_key('Maya')
assert (key == '') | Get a key that is not present in about dictionary. | {{cookiecutter.project_slug}}/tests/test_about_widget.py | test_get_about_missing_key | sisoe24/nuke-pyside-template | 0 | python | def test_get_about_missing_key():
key = about.get_about_key('Maya')
assert (key == ) | def test_get_about_missing_key():
key = about.get_about_key('Maya')
assert (key == )<|docstring|>Get a key that is not present in about dictionary.<|endoftext|> |
16a852b44f5bc19622b995690acdeacaa0e6ce4bc8bc2b6d2f0b5ca794c06302 | def test_about_to_string_exclude_key():
'Get the about data in string format and exclude one key.'
keys = about.about_to_string(exclude=['Python'])
assert ('Python' not in keys) | Get the about data in string format and exclude one key. | {{cookiecutter.project_slug}}/tests/test_about_widget.py | test_about_to_string_exclude_key | sisoe24/nuke-pyside-template | 0 | python | def test_about_to_string_exclude_key():
keys = about.about_to_string(exclude=['Python'])
assert ('Python' not in keys) | def test_about_to_string_exclude_key():
keys = about.about_to_string(exclude=['Python'])
assert ('Python' not in keys)<|docstring|>Get the about data in string format and exclude one key.<|endoftext|> |
7884ce897942604be905d54a8540c624981e02877b778fad9ecb05f7d49792af | @pytest.fixture()
def _about_widget(qtbot):
'Initiate about widget class.'
widget = about_widget.AboutWidget()
qtbot.addWidget(widget)
(yield widget) | Initiate about widget class. | {{cookiecutter.project_slug}}/tests/test_about_widget.py | _about_widget | sisoe24/nuke-pyside-template | 0 | python | @pytest.fixture()
def _about_widget(qtbot):
widget = about_widget.AboutWidget()
qtbot.addWidget(widget)
(yield widget) | @pytest.fixture()
def _about_widget(qtbot):
widget = about_widget.AboutWidget()
qtbot.addWidget(widget)
(yield widget)<|docstring|>Initiate about widget class.<|endoftext|> |
9ebc169bd252edb32c516b5ab386ce4bd2e7bc8d2dfd8d1f0c77e057bb234dae | def test_about_form(_about_widget):
'Test if the form layout has the proper about information.'
about_list = []
for label in about.about():
about_list.append(label.label)
about_list.append(label.repr)
for (index, item) in enumerate(about_list):
_widget = _about_widget._form_layou... | Test if the form layout has the proper about information. | {{cookiecutter.project_slug}}/tests/test_about_widget.py | test_about_form | sisoe24/nuke-pyside-template | 0 | python | def test_about_form(_about_widget):
about_list = []
for label in about.about():
about_list.append(label.label)
about_list.append(label.repr)
for (index, item) in enumerate(about_list):
_widget = _about_widget._form_layout.itemAt(index).widget()
assert (item == _widget.te... | def test_about_form(_about_widget):
about_list = []
for label in about.about():
about_list.append(label.label)
about_list.append(label.repr)
for (index, item) in enumerate(about_list):
_widget = _about_widget._form_layout.itemAt(index).widget()
assert (item == _widget.te... |
c6d9be21fc51c4ae13744a962c46e8e706e51d9c91d7706701fe6cd27b1e6add | def test_about_grid(_about_widget):
'Test if grid layout has the proper about information.'
for (index, link) in enumerate(LINKS):
_widget = _about_widget._grid_layout.itemAt(index).widget()
assert (_widget.text() == link.label)
assert (_widget.property('link') == link.repr) | Test if grid layout has the proper about information. | {{cookiecutter.project_slug}}/tests/test_about_widget.py | test_about_grid | sisoe24/nuke-pyside-template | 0 | python | def test_about_grid(_about_widget):
for (index, link) in enumerate(LINKS):
_widget = _about_widget._grid_layout.itemAt(index).widget()
assert (_widget.text() == link.label)
assert (_widget.property('link') == link.repr) | def test_about_grid(_about_widget):
for (index, link) in enumerate(LINKS):
_widget = _about_widget._grid_layout.itemAt(index).widget()
assert (_widget.text() == link.label)
assert (_widget.property('link') == link.repr)<|docstring|>Test if grid layout has the proper about information.<|... |
f908986589572cc2a5832af878fa394c89bf853d93753c28e58544a910c4f201 | def test_about_buttons(_about_widget):
'Test if about buttons are enabled.'
for (index, _) in enumerate(LINKS):
_widget = _about_widget._grid_layout.itemAt(index).widget()
assert _widget.isEnabled() | Test if about buttons are enabled. | {{cookiecutter.project_slug}}/tests/test_about_widget.py | test_about_buttons | sisoe24/nuke-pyside-template | 0 | python | def test_about_buttons(_about_widget):
for (index, _) in enumerate(LINKS):
_widget = _about_widget._grid_layout.itemAt(index).widget()
assert _widget.isEnabled() | def test_about_buttons(_about_widget):
for (index, _) in enumerate(LINKS):
_widget = _about_widget._grid_layout.itemAt(index).widget()
assert _widget.isEnabled()<|docstring|>Test if about buttons are enabled.<|endoftext|> |
ac4e828db20f40ba69caf551a9f85c5603e623f8704da6bb73c319f5bc54d120 | @pytest.mark.web
@pytest.mark.parametrize('link', LINKS, ids=[i.label for i in LINKS])
def test_about_links(link):
'Test if about link are reachable.'
if (link.label == 'Logs'):
assert os.path.exists(link.repr.replace('file:///', ''))
else:
assert (requests.get(link.repr, allow_redirects=Tru... | Test if about link are reachable. | {{cookiecutter.project_slug}}/tests/test_about_widget.py | test_about_links | sisoe24/nuke-pyside-template | 0 | python | @pytest.mark.web
@pytest.mark.parametrize('link', LINKS, ids=[i.label for i in LINKS])
def test_about_links(link):
if (link.label == 'Logs'):
assert os.path.exists(link.repr.replace('file:///', ))
else:
assert (requests.get(link.repr, allow_redirects=True).status_code == 200) | @pytest.mark.web
@pytest.mark.parametrize('link', LINKS, ids=[i.label for i in LINKS])
def test_about_links(link):
if (link.label == 'Logs'):
assert os.path.exists(link.repr.replace('file:///', ))
else:
assert (requests.get(link.repr, allow_redirects=True).status_code == 200)<|docstring|>Te... |
ff11a583c076fe868348ffa8a954405bb60743ded8df6790002e99028f025295 | def get_gms_internet_policy_services(self) -> dict:
"Get configured services used in Overlay editor's Internet Policy\n section.\n\n .. list-table::\n :header-rows: 1\n\n * - Swagger Section\n - Method\n - Endpoint\n * - services\n - GET\n - /gms/servic... | Get configured services used in Overlay editor's Internet Policy
section.
.. list-table::
:header-rows: 1
* - Swagger Section
- Method
- Endpoint
* - services
- GET
- /gms/services
For every service, a 'Send to ' option will be shown in the
available options list. The service name... | pyedgeconnect/orch/_services.py | get_gms_internet_policy_services | SPOpenSource/edgeconnect-python | 15 | python | def get_gms_internet_policy_services(self) -> dict:
"Get configured services used in Overlay editor's Internet Policy\n section.\n\n .. list-table::\n :header-rows: 1\n\n * - Swagger Section\n - Method\n - Endpoint\n * - services\n - GET\n - /gms/servic... | def get_gms_internet_policy_services(self) -> dict:
"Get configured services used in Overlay editor's Internet Policy\n section.\n\n .. list-table::\n :header-rows: 1\n\n * - Swagger Section\n - Method\n - Endpoint\n * - services\n - GET\n - /gms/servic... |
27784eff53441e82fb8f82b103429a138acafd7ec6139707e3b9b6d150f54641 | def update_gms_internet_policy_services(self, services: dict) -> bool:
'Set a new service list used in Overlay editor\'s Internet Policy\n section.\n\n .. list-table::\n :header-rows: 1\n\n * - Swagger Section\n - Method\n - Endpoint\n * - services\n - POST\n ... | Set a new service list used in Overlay editor's Internet Policy
section.
.. list-table::
:header-rows: 1
* - Swagger Section
- Method
- Endpoint
* - services
- POST
- /gms/services
Saving a new service list will completely replace the current
implementation. Any service IDs that w... | pyedgeconnect/orch/_services.py | update_gms_internet_policy_services | SPOpenSource/edgeconnect-python | 15 | python | def update_gms_internet_policy_services(self, services: dict) -> bool:
'Set a new service list used in Overlay editor\'s Internet Policy\n section.\n\n .. list-table::\n :header-rows: 1\n\n * - Swagger Section\n - Method\n - Endpoint\n * - services\n - POST\n ... | def update_gms_internet_policy_services(self, services: dict) -> bool:
'Set a new service list used in Overlay editor\'s Internet Policy\n section.\n\n .. list-table::\n :header-rows: 1\n\n * - Swagger Section\n - Method\n - Endpoint\n * - services\n - POST\n ... |
bbd50850b04b4865c327752737ee796d9c82b6a1f8156834a387cd73f66f3c35 | def get_gms_third_party_services(self) -> dict:
"Get configured services used in Overlay editor's Internet Policy\n section.\n\n .. list-table::\n :header-rows: 1\n\n * - Swagger Section\n - Method\n - Endpoint\n * - services\n - GET\n - /gms/thirdParty... | Get configured services used in Overlay editor's Internet Policy
section.
.. list-table::
:header-rows: 1
* - Swagger Section
- Method
- Endpoint
* - services
- GET
- /gms/thirdPartyServices
The list of services is used to provide options in the Overlay
editor's Internet Policy se... | pyedgeconnect/orch/_services.py | get_gms_third_party_services | SPOpenSource/edgeconnect-python | 15 | python | def get_gms_third_party_services(self) -> dict:
"Get configured services used in Overlay editor's Internet Policy\n section.\n\n .. list-table::\n :header-rows: 1\n\n * - Swagger Section\n - Method\n - Endpoint\n * - services\n - GET\n - /gms/thirdParty... | def get_gms_third_party_services(self) -> dict:
"Get configured services used in Overlay editor's Internet Policy\n section.\n\n .. list-table::\n :header-rows: 1\n\n * - Swagger Section\n - Method\n - Endpoint\n * - services\n - GET\n - /gms/thirdParty... |
bb6c39fcab7725efbd7c4648c3b11b651ae7c762a057d1bbf13b42be81edf306 | async def prepare_table(self, cursor: Cursor=None) -> None:
'テーブルの準備をします。クラスのインスタンス化時に自動で実行されます。\n また、クラスにキャッシュを作成します。'
(await cursor.execute(f'''CREATE TABLE IF NOT EXISTS {self.TABLE} (
GuildID BIGINT, Mode TEXT, Targets JSON
);'''))
(await self.update_cache(cursor=curso... | テーブルの準備をします。クラスのインスタンス化時に自動で実行されます。
また、クラスにキャッシュを作成します。 | cogs/blocker.py | prepare_table | RT-Team/rt-bot | 26 | python | async def prepare_table(self, cursor: Cursor=None) -> None:
'テーブルの準備をします。クラスのインスタンス化時に自動で実行されます。\n また、クラスにキャッシュを作成します。'
(await cursor.execute(f'CREATE TABLE IF NOT EXISTS {self.TABLE} (
GuildID BIGINT, Mode TEXT, Targets JSON
);'))
(await self.update_cache(cursor=cursor)) | async def prepare_table(self, cursor: Cursor=None) -> None:
'テーブルの準備をします。クラスのインスタンス化時に自動で実行されます。\n また、クラスにキャッシュを作成します。'
(await cursor.execute(f'CREATE TABLE IF NOT EXISTS {self.TABLE} (
GuildID BIGINT, Mode TEXT, Targets JSON
);'))
(await self.update_cache(cursor=cursor))<... |
2c8db64f3ec5427997b143ae81c602641c9af22cae8e18fd1a157d8bacdca57c | async def update_cache(self, cursor: Cursor=None) -> None:
'キャッシュをアップデートします。'
self.cache = defaultdict((lambda : defaultdict(list)))
(await cursor.execute(f'SELECT * FROM {self.TABLE};'))
for row in (await cursor.fetchall()):
if row:
self.cache[row[0]][row[1]] = loads(row[2]) | キャッシュをアップデートします。 | cogs/blocker.py | update_cache | RT-Team/rt-bot | 26 | python | async def update_cache(self, cursor: Cursor=None) -> None:
self.cache = defaultdict((lambda : defaultdict(list)))
(await cursor.execute(f'SELECT * FROM {self.TABLE};'))
for row in (await cursor.fetchall()):
if row:
self.cache[row[0]][row[1]] = loads(row[2]) | async def update_cache(self, cursor: Cursor=None) -> None:
self.cache = defaultdict((lambda : defaultdict(list)))
(await cursor.execute(f'SELECT * FROM {self.TABLE};'))
for row in (await cursor.fetchall()):
if row:
self.cache[row[0]][row[1]] = loads(row[2])<|docstring|>キャッシュをアップデートし... |
7d07e757e820645ba98ae1a490db4f42a3fdd19c148a0fecf9fbdf691f3c6179 | async def write(self, guild_id: int, mode: Mode, cursor: Cursor=None) -> bool:
'設定をします。'
if ((guild_id in self.cache) and (mode in self.cache[guild_id])):
(await cursor.execute(f'DELETE FROM {self.TABLE} WHERE GuildID = %s AND Mode = %s;', (guild_id, mode)))
del self.cache[guild_id][mode]
... | 設定をします。 | cogs/blocker.py | write | RT-Team/rt-bot | 26 | python | async def write(self, guild_id: int, mode: Mode, cursor: Cursor=None) -> bool:
if ((guild_id in self.cache) and (mode in self.cache[guild_id])):
(await cursor.execute(f'DELETE FROM {self.TABLE} WHERE GuildID = %s AND Mode = %s;', (guild_id, mode)))
del self.cache[guild_id][mode]
return ... | async def write(self, guild_id: int, mode: Mode, cursor: Cursor=None) -> bool:
if ((guild_id in self.cache) and (mode in self.cache[guild_id])):
(await cursor.execute(f'DELETE FROM {self.TABLE} WHERE GuildID = %s AND Mode = %s;', (guild_id, mode)))
del self.cache[guild_id][mode]
return ... |
32bd3cc2e55f4becf2b5222cdcfd9d049448b8c425ae244d29d84132679e6181 | def assert_blocker(self, guild_id: int, mode: Mode) -> None:
'設定がされているかどうかのAssertionを行います。'
assert ((guild_id in self.cache) and (mode in self.cache[guild_id])), 'まだ設定がされていません。' | 設定がされているかどうかのAssertionを行います。 | cogs/blocker.py | assert_blocker | RT-Team/rt-bot | 26 | python | def assert_blocker(self, guild_id: int, mode: Mode) -> None:
assert ((guild_id in self.cache) and (mode in self.cache[guild_id])), 'まだ設定がされていません。' | def assert_blocker(self, guild_id: int, mode: Mode) -> None:
assert ((guild_id in self.cache) and (mode in self.cache[guild_id])), 'まだ設定がされていません。'<|docstring|>設定がされているかどうかのAssertionを行います。<|endoftext|> |
a2699518871253ca9dc058dab02796b70c3f01fe3ea7ef2dac5e128e5b10bbda | async def add_role(self, guild_id: int, mode: Mode, role: int, cursor: Cursor=None) -> None:
'ブロック対象のロールを追加します。'
self.assert_blocker(guild_id, mode)
self.cache[guild_id][mode].append(role)
(await self._update(cursor, guild_id, mode, self.cache[guild_id][mode])) | ブロック対象のロールを追加します。 | cogs/blocker.py | add_role | RT-Team/rt-bot | 26 | python | async def add_role(self, guild_id: int, mode: Mode, role: int, cursor: Cursor=None) -> None:
self.assert_blocker(guild_id, mode)
self.cache[guild_id][mode].append(role)
(await self._update(cursor, guild_id, mode, self.cache[guild_id][mode])) | async def add_role(self, guild_id: int, mode: Mode, role: int, cursor: Cursor=None) -> None:
self.assert_blocker(guild_id, mode)
self.cache[guild_id][mode].append(role)
(await self._update(cursor, guild_id, mode, self.cache[guild_id][mode]))<|docstring|>ブロック対象のロールを追加します。<|endoftext|> |
fbaab22e029bb1510eed145545a253273de2daf414ecf8e18e89d1fce08b56a3 | async def remove_role(self, guild_id: int, mode: Mode, role: int, cursor: Cursor=None) -> None:
'ブロック対象のロールを削除します。'
self.assert_blocker(guild_id, mode)
assert (len(self.cache[guild_id][mode]) < self.MAX_ROLES), '登録しすぎです。'
self.cache[guild_id][mode].remove(role)
(await self._update(cursor, guild_id, ... | ブロック対象のロールを削除します。 | cogs/blocker.py | remove_role | RT-Team/rt-bot | 26 | python | async def remove_role(self, guild_id: int, mode: Mode, role: int, cursor: Cursor=None) -> None:
self.assert_blocker(guild_id, mode)
assert (len(self.cache[guild_id][mode]) < self.MAX_ROLES), '登録しすぎです。'
self.cache[guild_id][mode].remove(role)
(await self._update(cursor, guild_id, mode, [])) | async def remove_role(self, guild_id: int, mode: Mode, role: int, cursor: Cursor=None) -> None:
self.assert_blocker(guild_id, mode)
assert (len(self.cache[guild_id][mode]) < self.MAX_ROLES), '登録しすぎです。'
self.cache[guild_id][mode].remove(role)
(await self._update(cursor, guild_id, mode, []))<|docstri... |
ce70a5b4267903da23acb4364d6c994d2adeb476736bad8ea09d745b455cc3fe | @commands.group('blocker', aliases=['b', 'ブロッカー'], extras={'headding': {'ja': '絵文字,スタンプブロッカー', 'en': 'Emoji,Stamp blocker'}, 'parent': 'ServerSafety'})
async def blocker(self, ctx: commands.Context):
'!lang ja\n --------\n 特定のロールを持ってる人は絵文字またはスタンプを送信できないようにする機能です。\n\n Aliases\n -------\n ... | !lang ja
--------
特定のロールを持ってる人は絵文字またはスタンプを送信できないようにする機能です。
Aliases
-------
b, ブロッカー
!lang en
--------
This feature prevents people with a specific role from sending emoji or stamps.
Aliases
-------
b | cogs/blocker.py | blocker | RT-Team/rt-bot | 26 | python | @commands.group('blocker', aliases=['b', 'ブロッカー'], extras={'headding': {'ja': '絵文字,スタンプブロッカー', 'en': 'Emoji,Stamp blocker'}, 'parent': 'ServerSafety'})
async def blocker(self, ctx: commands.Context):
'!lang ja\n --------\n 特定のロールを持ってる人は絵文字またはスタンプを送信できないようにする機能です。\n\n Aliases\n -------\n ... | @commands.group('blocker', aliases=['b', 'ブロッカー'], extras={'headding': {'ja': '絵文字,スタンプブロッカー', 'en': 'Emoji,Stamp blocker'}, 'parent': 'ServerSafety'})
async def blocker(self, ctx: commands.Context):
'!lang ja\n --------\n 特定のロールを持ってる人は絵文字またはスタンプを送信できないようにする機能です。\n\n Aliases\n -------\n ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.