body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
@reject_on_error.setter
def reject_on_error(self, reject_on_error):
'Sets the reject_on_error of this ExtendedBoolValueTest.\n\n\n :param reject_on_error: The reject_on_error of this ExtendedBoolValueTest. # noqa: E501\n :type: bool\n '
self._reject_on_error = reject_on_error | 6,733,980,712,168,993,000 | Sets the reject_on_error of this ExtendedBoolValueTest.
:param reject_on_error: The reject_on_error of this ExtendedBoolValueTest. # noqa: E501
:type: bool | telestream_cloud_qc_sdk/telestream_cloud_qc/models/extended_bool_value_test.py | reject_on_error | Telestream/telestream-cloud-python-sdk | python | @reject_on_error.setter
def reject_on_error(self, reject_on_error):
'Sets the reject_on_error of this ExtendedBoolValueTest.\n\n\n :param reject_on_error: The reject_on_error of this ExtendedBoolValueTest. # noqa: E501\n :type: bool\n '
self._reject_on_error = reject_on_error |
@property
def checked(self):
'Gets the checked of this ExtendedBoolValueTest. # noqa: E501\n\n\n :return: The checked of this ExtendedBoolValueTest. # noqa: E501\n :rtype: bool\n '
return self._checked | -3,276,358,111,662,453,000 | Gets the checked of this ExtendedBoolValueTest. # noqa: E501
:return: The checked of this ExtendedBoolValueTest. # noqa: E501
:rtype: bool | telestream_cloud_qc_sdk/telestream_cloud_qc/models/extended_bool_value_test.py | checked | Telestream/telestream-cloud-python-sdk | python | @property
def checked(self):
'Gets the checked of this ExtendedBoolValueTest. # noqa: E501\n\n\n :return: The checked of this ExtendedBoolValueTest. # noqa: E501\n :rtype: bool\n '
return self._checked |
@checked.setter
def checked(self, checked):
'Sets the checked of this ExtendedBoolValueTest.\n\n\n :param checked: The checked of this ExtendedBoolValueTest. # noqa: E501\n :type: bool\n '
self._checked = checked | -5,146,549,918,617,549,000 | Sets the checked of this ExtendedBoolValueTest.
:param checked: The checked of this ExtendedBoolValueTest. # noqa: E501
:type: bool | telestream_cloud_qc_sdk/telestream_cloud_qc/models/extended_bool_value_test.py | checked | Telestream/telestream-cloud-python-sdk | python | @checked.setter
def checked(self, checked):
'Sets the checked of this ExtendedBoolValueTest.\n\n\n :param checked: The checked of this ExtendedBoolValueTest. # noqa: E501\n :type: bool\n '
self._checked = checked |
def to_dict(self):
'Returns the model properties as a dict'
result = {}
for (attr, _) in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
e... | 8,442,519,487,048,767,000 | Returns the model properties as a dict | telestream_cloud_qc_sdk/telestream_cloud_qc/models/extended_bool_value_test.py | to_dict | Telestream/telestream-cloud-python-sdk | python | def to_dict(self):
result = {}
for (attr, _) in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
elif hasattr(value, 'to_dict'):
... |
def to_str(self):
'Returns the string representation of the model'
return pprint.pformat(self.to_dict()) | 5,849,158,643,760,736,000 | Returns the string representation of the model | telestream_cloud_qc_sdk/telestream_cloud_qc/models/extended_bool_value_test.py | to_str | Telestream/telestream-cloud-python-sdk | python | def to_str(self):
return pprint.pformat(self.to_dict()) |
def __repr__(self):
'For `print` and `pprint`'
return self.to_str() | -8,960,031,694,814,905,000 | For `print` and `pprint` | telestream_cloud_qc_sdk/telestream_cloud_qc/models/extended_bool_value_test.py | __repr__ | Telestream/telestream-cloud-python-sdk | python | def __repr__(self):
return self.to_str() |
def __eq__(self, other):
'Returns true if both objects are equal'
if (not isinstance(other, ExtendedBoolValueTest)):
return False
return (self.to_dict() == other.to_dict()) | 487,001,221,569,480,700 | Returns true if both objects are equal | telestream_cloud_qc_sdk/telestream_cloud_qc/models/extended_bool_value_test.py | __eq__ | Telestream/telestream-cloud-python-sdk | python | def __eq__(self, other):
if (not isinstance(other, ExtendedBoolValueTest)):
return False
return (self.to_dict() == other.to_dict()) |
def __ne__(self, other):
'Returns true if both objects are not equal'
if (not isinstance(other, ExtendedBoolValueTest)):
return True
return (self.to_dict() != other.to_dict()) | 3,255,979,270,629,175,000 | Returns true if both objects are not equal | telestream_cloud_qc_sdk/telestream_cloud_qc/models/extended_bool_value_test.py | __ne__ | Telestream/telestream-cloud-python-sdk | python | def __ne__(self, other):
if (not isinstance(other, ExtendedBoolValueTest)):
return True
return (self.to_dict() != other.to_dict()) |
def train(data: Dict[(str, np.ndarray)], model_name: str, dest_path: str, sample_size: int, n_classes: int, lr: float, batch_size: int, epochs: int, verbose: int, shuffle: bool, patience: int, seed: int):
'\n Function for running experiments on various unmixing models,\n given a set of hyper parameters.\n\n ... | -1,414,845,563,647,005,400 | Function for running experiments on various unmixing models,
given a set of hyper parameters.
:param data: The data dictionary containing
the subsets for training and validation.
First dimension of the datasets should be the number of samples.
:param model_name: Name of the model, it serves as a key in the
... | src/model/train_unmixing.py | train | laugh12321/DACN | python | def train(data: Dict[(str, np.ndarray)], model_name: str, dest_path: str, sample_size: int, n_classes: int, lr: float, batch_size: int, epochs: int, verbose: int, shuffle: bool, patience: int, seed: int):
'\n Function for running experiments on various unmixing models,\n given a set of hyper parameters.\n\n ... |
def _style(message: str, **kwargs: Any) -> str:
'Wrapper around mypy.util for fancy formatting.'
kwargs.setdefault('color', 'none')
return _formatter.style(message, **kwargs) | 7,824,578,596,113,823,000 | Wrapper around mypy.util for fancy formatting. | venv/Lib/site-packages/mypy/stubtest.py | _style | HarisHijazi/mojarnik-server | python | def _style(message: str, **kwargs: Any) -> str:
kwargs.setdefault('color', 'none')
return _formatter.style(message, **kwargs) |
def test_module(module_name: str) -> Iterator[Error]:
"Tests a given module's stub against introspecting it at runtime.\n\n Requires the stub to have been built already, accomplished by a call to ``build_stubs``.\n\n :param module_name: The module to test\n\n "
stub = get_stub(module_name)
if (stub... | 4,199,037,603,568,104,000 | Tests a given module's stub against introspecting it at runtime.
Requires the stub to have been built already, accomplished by a call to ``build_stubs``.
:param module_name: The module to test | venv/Lib/site-packages/mypy/stubtest.py | test_module | HarisHijazi/mojarnik-server | python | def test_module(module_name: str) -> Iterator[Error]:
"Tests a given module's stub against introspecting it at runtime.\n\n Requires the stub to have been built already, accomplished by a call to ``build_stubs``.\n\n :param module_name: The module to test\n\n "
stub = get_stub(module_name)
if (stub... |
@singledispatch
def verify(stub: nodes.Node, runtime: MaybeMissing[Any], object_path: List[str]) -> Iterator[Error]:
'Entry point for comparing a stub to a runtime object.\n\n We use single dispatch based on the type of ``stub``.\n\n :param stub: The mypy node representing a part of the stub\n :param runti... | -1,455,489,771,263,504,100 | Entry point for comparing a stub to a runtime object.
We use single dispatch based on the type of ``stub``.
:param stub: The mypy node representing a part of the stub
:param runtime: The runtime object corresponding to ``stub`` | venv/Lib/site-packages/mypy/stubtest.py | verify | HarisHijazi/mojarnik-server | python | @singledispatch
def verify(stub: nodes.Node, runtime: MaybeMissing[Any], object_path: List[str]) -> Iterator[Error]:
'Entry point for comparing a stub to a runtime object.\n\n We use single dispatch based on the type of ``stub``.\n\n :param stub: The mypy node representing a part of the stub\n :param runti... |
def _verify_arg_name(stub_arg: nodes.Argument, runtime_arg: inspect.Parameter, function_name: str) -> Iterator[str]:
'Checks whether argument names match.'
if is_dunder(function_name, exclude_special=True):
return
def strip_prefix(s: str, prefix: str) -> str:
return (s[len(prefix):] if s.st... | 1,372,644,029,172,474,400 | Checks whether argument names match. | venv/Lib/site-packages/mypy/stubtest.py | _verify_arg_name | HarisHijazi/mojarnik-server | python | def _verify_arg_name(stub_arg: nodes.Argument, runtime_arg: inspect.Parameter, function_name: str) -> Iterator[str]:
if is_dunder(function_name, exclude_special=True):
return
def strip_prefix(s: str, prefix: str) -> str:
return (s[len(prefix):] if s.startswith(prefix) else s)
if (strip... |
def _verify_arg_default_value(stub_arg: nodes.Argument, runtime_arg: inspect.Parameter) -> Iterator[str]:
'Checks whether argument default values are compatible.'
if (runtime_arg.default != inspect.Parameter.empty):
if (stub_arg.kind not in (nodes.ARG_OPT, nodes.ARG_NAMED_OPT)):
(yield 'runt... | 7,913,220,526,749,710,000 | Checks whether argument default values are compatible. | venv/Lib/site-packages/mypy/stubtest.py | _verify_arg_default_value | HarisHijazi/mojarnik-server | python | def _verify_arg_default_value(stub_arg: nodes.Argument, runtime_arg: inspect.Parameter) -> Iterator[str]:
if (runtime_arg.default != inspect.Parameter.empty):
if (stub_arg.kind not in (nodes.ARG_OPT, nodes.ARG_NAMED_OPT)):
(yield 'runtime argument "{}" has a default value but stub argument ... |
def _resolve_funcitem_from_decorator(dec: nodes.OverloadPart) -> Optional[nodes.FuncItem]:
"Returns a FuncItem that corresponds to the output of the decorator.\n\n Returns None if we can't figure out what that would be. For convenience, this function also\n accepts FuncItems.\n\n "
if isinstance(dec, n... | -1,845,176,756,709,411,300 | Returns a FuncItem that corresponds to the output of the decorator.
Returns None if we can't figure out what that would be. For convenience, this function also
accepts FuncItems. | venv/Lib/site-packages/mypy/stubtest.py | _resolve_funcitem_from_decorator | HarisHijazi/mojarnik-server | python | def _resolve_funcitem_from_decorator(dec: nodes.OverloadPart) -> Optional[nodes.FuncItem]:
"Returns a FuncItem that corresponds to the output of the decorator.\n\n Returns None if we can't figure out what that would be. For convenience, this function also\n accepts FuncItems.\n\n "
if isinstance(dec, n... |
def is_dunder(name: str, exclude_special: bool=False) -> bool:
'Returns whether name is a dunder name.\n\n :param exclude_special: Whether to return False for a couple special dunder methods.\n\n '
if (exclude_special and (name in SPECIAL_DUNDERS)):
return False
return (name.startswith('__') a... | 8,043,481,766,942,279,000 | Returns whether name is a dunder name.
:param exclude_special: Whether to return False for a couple special dunder methods. | venv/Lib/site-packages/mypy/stubtest.py | is_dunder | HarisHijazi/mojarnik-server | python | def is_dunder(name: str, exclude_special: bool=False) -> bool:
'Returns whether name is a dunder name.\n\n :param exclude_special: Whether to return False for a couple special dunder methods.\n\n '
if (exclude_special and (name in SPECIAL_DUNDERS)):
return False
return (name.startswith('__') a... |
def is_subtype_helper(left: mypy.types.Type, right: mypy.types.Type) -> bool:
'Checks whether ``left`` is a subtype of ``right``.'
left = mypy.types.get_proper_type(left)
right = mypy.types.get_proper_type(right)
if (isinstance(left, mypy.types.LiteralType) and isinstance(left.value, int) and (left.valu... | -4,968,396,397,563,760,000 | Checks whether ``left`` is a subtype of ``right``. | venv/Lib/site-packages/mypy/stubtest.py | is_subtype_helper | HarisHijazi/mojarnik-server | python | def is_subtype_helper(left: mypy.types.Type, right: mypy.types.Type) -> bool:
left = mypy.types.get_proper_type(left)
right = mypy.types.get_proper_type(right)
if (isinstance(left, mypy.types.LiteralType) and isinstance(left.value, int) and (left.value in (0, 1)) and isinstance(right, mypy.types.Instan... |
def get_mypy_type_of_runtime_value(runtime: Any) -> Optional[mypy.types.Type]:
"Returns a mypy type object representing the type of ``runtime``.\n\n Returns None if we can't find something that works.\n\n "
if (runtime is None):
return mypy.types.NoneType()
if isinstance(runtime, property):
... | 2,015,463,356,520,767,200 | Returns a mypy type object representing the type of ``runtime``.
Returns None if we can't find something that works. | venv/Lib/site-packages/mypy/stubtest.py | get_mypy_type_of_runtime_value | HarisHijazi/mojarnik-server | python | def get_mypy_type_of_runtime_value(runtime: Any) -> Optional[mypy.types.Type]:
"Returns a mypy type object representing the type of ``runtime``.\n\n Returns None if we can't find something that works.\n\n "
if (runtime is None):
return mypy.types.NoneType()
if isinstance(runtime, property):
... |
def build_stubs(modules: List[str], options: Options, find_submodules: bool=False) -> List[str]:
'Uses mypy to construct stub objects for the given modules.\n\n This sets global state that ``get_stub`` can access.\n\n Returns all modules we might want to check. If ``find_submodules`` is False, this is equal\n... | 379,680,852,265,002,900 | Uses mypy to construct stub objects for the given modules.
This sets global state that ``get_stub`` can access.
Returns all modules we might want to check. If ``find_submodules`` is False, this is equal
to ``modules``.
:param modules: List of modules to build stubs for.
:param options: Mypy options for finding and b... | venv/Lib/site-packages/mypy/stubtest.py | build_stubs | HarisHijazi/mojarnik-server | python | def build_stubs(modules: List[str], options: Options, find_submodules: bool=False) -> List[str]:
'Uses mypy to construct stub objects for the given modules.\n\n This sets global state that ``get_stub`` can access.\n\n Returns all modules we might want to check. If ``find_submodules`` is False, this is equal\n... |
def get_stub(module: str) -> Optional[nodes.MypyFile]:
"Returns a stub object for the given module, if we've built one."
return _all_stubs.get(module) | 718,094,875,160,185,500 | Returns a stub object for the given module, if we've built one. | venv/Lib/site-packages/mypy/stubtest.py | get_stub | HarisHijazi/mojarnik-server | python | def get_stub(module: str) -> Optional[nodes.MypyFile]:
return _all_stubs.get(module) |
def get_typeshed_stdlib_modules(custom_typeshed_dir: Optional[str]) -> List[str]:
'Returns a list of stdlib modules in typeshed (for current Python version).'
stdlib_py_versions = mypy.modulefinder.load_stdlib_py_versions(custom_typeshed_dir)
packages = set()
if (sys.version_info < (3, 6)):
vers... | -7,716,510,822,172,239,000 | Returns a list of stdlib modules in typeshed (for current Python version). | venv/Lib/site-packages/mypy/stubtest.py | get_typeshed_stdlib_modules | HarisHijazi/mojarnik-server | python | def get_typeshed_stdlib_modules(custom_typeshed_dir: Optional[str]) -> List[str]:
stdlib_py_versions = mypy.modulefinder.load_stdlib_py_versions(custom_typeshed_dir)
packages = set()
if (sys.version_info < (3, 6)):
version_info = (3, 6)
else:
version_info = sys.version_info[0:2]
... |
def test_stubs(args: argparse.Namespace, use_builtins_fixtures: bool=False) -> int:
"This is stubtest! It's time to test the stubs!"
allowlist = {entry: False for allowlist_file in args.allowlist for entry in get_allowlist_entries(allowlist_file)}
allowlist_regexes = {entry: re.compile(entry) for entry in a... | 8,016,859,559,546,443,000 | This is stubtest! It's time to test the stubs! | venv/Lib/site-packages/mypy/stubtest.py | test_stubs | HarisHijazi/mojarnik-server | python | def test_stubs(args: argparse.Namespace, use_builtins_fixtures: bool=False) -> int:
allowlist = {entry: False for allowlist_file in args.allowlist for entry in get_allowlist_entries(allowlist_file)}
allowlist_regexes = {entry: re.compile(entry) for entry in allowlist}
generated_allowlist = set()
mo... |
def __init__(self, object_path: List[str], message: str, stub_object: MaybeMissing[nodes.Node], runtime_object: MaybeMissing[Any], *, stub_desc: Optional[str]=None, runtime_desc: Optional[str]=None) -> None:
'Represents an error found by stubtest.\n\n :param object_path: Location of the object with the error... | -7,149,678,860,484,340,000 | Represents an error found by stubtest.
:param object_path: Location of the object with the error,
e.g. ``["module", "Class", "method"]``
:param message: Error message
:param stub_object: The mypy node representing the stub
:param runtime_object: Actual object obtained from the runtime
:param stub_desc: Specialised... | venv/Lib/site-packages/mypy/stubtest.py | __init__ | HarisHijazi/mojarnik-server | python | def __init__(self, object_path: List[str], message: str, stub_object: MaybeMissing[nodes.Node], runtime_object: MaybeMissing[Any], *, stub_desc: Optional[str]=None, runtime_desc: Optional[str]=None) -> None:
'Represents an error found by stubtest.\n\n :param object_path: Location of the object with the error... |
def is_missing_stub(self) -> bool:
'Whether or not the error is for something missing from the stub.'
return isinstance(self.stub_object, Missing) | 5,390,748,104,280,314,000 | Whether or not the error is for something missing from the stub. | venv/Lib/site-packages/mypy/stubtest.py | is_missing_stub | HarisHijazi/mojarnik-server | python | def is_missing_stub(self) -> bool:
return isinstance(self.stub_object, Missing) |
def is_positional_only_related(self) -> bool:
'Whether or not the error is for something being (or not being) positional-only.'
return ('leading double underscore' in self.message) | -4,917,370,307,703,007,000 | Whether or not the error is for something being (or not being) positional-only. | venv/Lib/site-packages/mypy/stubtest.py | is_positional_only_related | HarisHijazi/mojarnik-server | python | def is_positional_only_related(self) -> bool:
return ('leading double underscore' in self.message) |
def get_description(self, concise: bool=False) -> str:
'Returns a description of the error.\n\n :param concise: Whether to return a concise, one-line description\n\n '
if concise:
return ((_style(self.object_desc, bold=True) + ' ') + self.message)
stub_line = None
stub_file = None
... | 7,574,251,078,733,622,000 | Returns a description of the error.
:param concise: Whether to return a concise, one-line description | venv/Lib/site-packages/mypy/stubtest.py | get_description | HarisHijazi/mojarnik-server | python | def get_description(self, concise: bool=False) -> str:
'Returns a description of the error.\n\n :param concise: Whether to return a concise, one-line description\n\n '
if concise:
return ((_style(self.object_desc, bold=True) + ' ') + self.message)
stub_line = None
stub_file = None
... |
@staticmethod
def from_overloadedfuncdef(stub: nodes.OverloadedFuncDef) -> 'Signature[nodes.Argument]':
"Returns a Signature from an OverloadedFuncDef.\n\n If life were simple, to verify_overloadedfuncdef, we'd just verify_funcitem for each of its\n items. Unfortunately, life isn't simple and overload... | 1,645,200,278,387,473,000 | Returns a Signature from an OverloadedFuncDef.
If life were simple, to verify_overloadedfuncdef, we'd just verify_funcitem for each of its
items. Unfortunately, life isn't simple and overloads are pretty deceitful. So instead, we
try and combine the overload's items into a single signature that is compatible with any
... | venv/Lib/site-packages/mypy/stubtest.py | from_overloadedfuncdef | HarisHijazi/mojarnik-server | python | @staticmethod
def from_overloadedfuncdef(stub: nodes.OverloadedFuncDef) -> 'Signature[nodes.Argument]':
"Returns a Signature from an OverloadedFuncDef.\n\n If life were simple, to verify_overloadedfuncdef, we'd just verify_funcitem for each of its\n items. Unfortunately, life isn't simple and overload... |
def period_range(start=None, end=None, periods: (int | None)=None, freq=None, name=None) -> PeriodIndex:
'\n Return a fixed frequency PeriodIndex.\n\n The day (calendar) is the default frequency.\n\n Parameters\n ----------\n start : str or period-like, default None\n Left bound for generating... | -1,241,766,003,733,699,300 | Return a fixed frequency PeriodIndex.
The day (calendar) is the default frequency.
Parameters
----------
start : str or period-like, default None
Left bound for generating periods.
end : str or period-like, default None
Right bound for generating periods.
periods : int, default None
Number of periods to g... | env/Lib/site-packages/pandas/core/indexes/period.py | period_range | ATJWen/weather-app | python | def period_range(start=None, end=None, periods: (int | None)=None, freq=None, name=None) -> PeriodIndex:
'\n Return a fixed frequency PeriodIndex.\n\n The day (calendar) is the default frequency.\n\n Parameters\n ----------\n start : str or period-like, default None\n Left bound for generating... |
def _maybe_convert_timedelta(self, other):
'\n Convert timedelta-like input to an integer multiple of self.freq\n\n Parameters\n ----------\n other : timedelta, np.timedelta64, DateOffset, int, np.ndarray\n\n Returns\n -------\n converted : int, np.ndarray[int64]\n\n... | -2,410,665,731,165,831,700 | Convert timedelta-like input to an integer multiple of self.freq
Parameters
----------
other : timedelta, np.timedelta64, DateOffset, int, np.ndarray
Returns
-------
converted : int, np.ndarray[int64]
Raises
------
IncompatibleFrequency : if the input cannot be written as a multiple
of self.freq. Note Incompati... | env/Lib/site-packages/pandas/core/indexes/period.py | _maybe_convert_timedelta | ATJWen/weather-app | python | def _maybe_convert_timedelta(self, other):
'\n Convert timedelta-like input to an integer multiple of self.freq\n\n Parameters\n ----------\n other : timedelta, np.timedelta64, DateOffset, int, np.ndarray\n\n Returns\n -------\n converted : int, np.ndarray[int64]\n\n... |
def _is_comparable_dtype(self, dtype: DtypeObj) -> bool:
'\n Can we compare values of the given dtype to our own?\n '
if (not isinstance(dtype, PeriodDtype)):
return False
return (dtype.freq == self.freq) | 2,929,216,423,391,983,600 | Can we compare values of the given dtype to our own? | env/Lib/site-packages/pandas/core/indexes/period.py | _is_comparable_dtype | ATJWen/weather-app | python | def _is_comparable_dtype(self, dtype: DtypeObj) -> bool:
'\n \n '
if (not isinstance(dtype, PeriodDtype)):
return False
return (dtype.freq == self.freq) |
def asof_locs(self, where: Index, mask: np.ndarray) -> np.ndarray:
'\n where : array of timestamps\n mask : np.ndarray[bool]\n Array of booleans where data is not NA.\n '
if isinstance(where, DatetimeIndex):
where = PeriodIndex(where._values, freq=self.freq)
elif (not... | -2,531,526,199,883,752,400 | where : array of timestamps
mask : np.ndarray[bool]
Array of booleans where data is not NA. | env/Lib/site-packages/pandas/core/indexes/period.py | asof_locs | ATJWen/weather-app | python | def asof_locs(self, where: Index, mask: np.ndarray) -> np.ndarray:
'\n where : array of timestamps\n mask : np.ndarray[bool]\n Array of booleans where data is not NA.\n '
if isinstance(where, DatetimeIndex):
where = PeriodIndex(where._values, freq=self.freq)
elif (not... |
@property
def is_full(self) -> bool:
'\n Returns True if this PeriodIndex is range-like in that all Periods\n between start and end are present, in order.\n '
if (len(self) == 0):
return True
if (not self.is_monotonic_increasing):
raise ValueError('Index is not monotonic... | -6,990,255,511,362,442,000 | Returns True if this PeriodIndex is range-like in that all Periods
between start and end are present, in order. | env/Lib/site-packages/pandas/core/indexes/period.py | is_full | ATJWen/weather-app | python | @property
def is_full(self) -> bool:
'\n Returns True if this PeriodIndex is range-like in that all Periods\n between start and end are present, in order.\n '
if (len(self) == 0):
return True
if (not self.is_monotonic_increasing):
raise ValueError('Index is not monotonic... |
def get_loc(self, key, method=None, tolerance=None):
'\n Get integer location for requested label.\n\n Parameters\n ----------\n key : Period, NaT, str, or datetime\n String or datetime key must be parsable as Period.\n\n Returns\n -------\n loc : int or n... | -5,329,255,313,596,644,000 | Get integer location for requested label.
Parameters
----------
key : Period, NaT, str, or datetime
String or datetime key must be parsable as Period.
Returns
-------
loc : int or ndarray[int64]
Raises
------
KeyError
Key is not present in the index.
TypeError
If key is listlike or otherwise not hashable... | env/Lib/site-packages/pandas/core/indexes/period.py | get_loc | ATJWen/weather-app | python | def get_loc(self, key, method=None, tolerance=None):
'\n Get integer location for requested label.\n\n Parameters\n ----------\n key : Period, NaT, str, or datetime\n String or datetime key must be parsable as Period.\n\n Returns\n -------\n loc : int or n... |
def _maybe_cast_slice_bound(self, label, side: str, kind=lib.no_default):
"\n If label is a string or a datetime, cast it to Period.ordinal according\n to resolution.\n\n Parameters\n ----------\n label : object\n side : {'left', 'right'}\n kind : {'loc', 'getitem'},... | -8,794,501,317,859,449,000 | If label is a string or a datetime, cast it to Period.ordinal according
to resolution.
Parameters
----------
label : object
side : {'left', 'right'}
kind : {'loc', 'getitem'}, or None
Returns
-------
bound : Period or object
Notes
-----
Value of `side` parameter should be validated in caller. | env/Lib/site-packages/pandas/core/indexes/period.py | _maybe_cast_slice_bound | ATJWen/weather-app | python | def _maybe_cast_slice_bound(self, label, side: str, kind=lib.no_default):
"\n If label is a string or a datetime, cast it to Period.ordinal according\n to resolution.\n\n Parameters\n ----------\n label : object\n side : {'left', 'right'}\n kind : {'loc', 'getitem'},... |
def fill(self):
'Intelligently sets any non-specific parameters.'
_ = getattr(self, 'num_classes')
_ = getattr(self, 'num_features')
self.bagged_num_features = int((self.feature_bagging_fraction * self.num_features))
self.bagged_features = None
if (self.feature_bagging_fraction < 1.0):
s... | 3,822,639,199,110,041,600 | Intelligently sets any non-specific parameters. | tensorflow/contrib/tensor_forest/python/tensor_forest.py | fill | AdityaPai2398/tensorflow | python | def fill(self):
_ = getattr(self, 'num_classes')
_ = getattr(self, 'num_features')
self.bagged_num_features = int((self.feature_bagging_fraction * self.num_features))
self.bagged_features = None
if (self.feature_bagging_fraction < 1.0):
self.bagged_features = [random.sample(range(self.n... |
def __init__(self, tree_stats, params):
'A simple container for stats about a forest.'
self.tree_stats = tree_stats
self.params = params | 3,002,426,196,251,461,600 | A simple container for stats about a forest. | tensorflow/contrib/tensor_forest/python/tensor_forest.py | __init__ | AdityaPai2398/tensorflow | python | def __init__(self, tree_stats, params):
self.tree_stats = tree_stats
self.params = params |
def training_graph(self, input_data, input_labels, data_spec=None, epoch=None, **tree_kwargs):
"Constructs a TF graph for training a random forest.\n\n Args:\n input_data: A tensor or SparseTensor or placeholder for input data.\n input_labels: A tensor or placeholder for labels associated with\n ... | -2,788,288,756,385,881,600 | Constructs a TF graph for training a random forest.
Args:
input_data: A tensor or SparseTensor or placeholder for input data.
input_labels: A tensor or placeholder for labels associated with
input_data.
data_spec: A list of tf.dtype values specifying the original types of
each column.
epoch: A tensor o... | tensorflow/contrib/tensor_forest/python/tensor_forest.py | training_graph | AdityaPai2398/tensorflow | python | def training_graph(self, input_data, input_labels, data_spec=None, epoch=None, **tree_kwargs):
"Constructs a TF graph for training a random forest.\n\n Args:\n input_data: A tensor or SparseTensor or placeholder for input data.\n input_labels: A tensor or placeholder for labels associated with\n ... |
def inference_graph(self, input_data, data_spec=None):
'Constructs a TF graph for evaluating a random forest.\n\n Args:\n input_data: A tensor or SparseTensor or placeholder for input data.\n data_spec: A list of tf.dtype values specifying the original types of\n each column.\n\n Returns:\n ... | 7,747,370,123,409,987,000 | Constructs a TF graph for evaluating a random forest.
Args:
input_data: A tensor or SparseTensor or placeholder for input data.
data_spec: A list of tf.dtype values specifying the original types of
each column.
Returns:
The last op in the random forest inference graph. | tensorflow/contrib/tensor_forest/python/tensor_forest.py | inference_graph | AdityaPai2398/tensorflow | python | def inference_graph(self, input_data, data_spec=None):
'Constructs a TF graph for evaluating a random forest.\n\n Args:\n input_data: A tensor or SparseTensor or placeholder for input data.\n data_spec: A list of tf.dtype values specifying the original types of\n each column.\n\n Returns:\n ... |
def average_size(self):
'Constructs a TF graph for evaluating the average size of a forest.\n\n Returns:\n The average number of nodes over the trees.\n '
sizes = []
for i in range(self.params.num_trees):
with ops.device(self.device_assigner.get_device(i)):
sizes.append(self.t... | 5,671,812,050,120,021,000 | Constructs a TF graph for evaluating the average size of a forest.
Returns:
The average number of nodes over the trees. | tensorflow/contrib/tensor_forest/python/tensor_forest.py | average_size | AdityaPai2398/tensorflow | python | def average_size(self):
'Constructs a TF graph for evaluating the average size of a forest.\n\n Returns:\n The average number of nodes over the trees.\n '
sizes = []
for i in range(self.params.num_trees):
with ops.device(self.device_assigner.get_device(i)):
sizes.append(self.t... |
def average_impurity(self):
'Constructs a TF graph for evaluating the leaf impurity of a forest.\n\n Returns:\n The last op in the graph.\n '
impurities = []
for i in range(self.params.num_trees):
with ops.device(self.device_assigner.get_device(i)):
impurities.append(self.tree... | -7,324,765,734,865,910,000 | Constructs a TF graph for evaluating the leaf impurity of a forest.
Returns:
The last op in the graph. | tensorflow/contrib/tensor_forest/python/tensor_forest.py | average_impurity | AdityaPai2398/tensorflow | python | def average_impurity(self):
'Constructs a TF graph for evaluating the leaf impurity of a forest.\n\n Returns:\n The last op in the graph.\n '
impurities = []
for i in range(self.params.num_trees):
with ops.device(self.device_assigner.get_device(i)):
impurities.append(self.tree... |
def _gini(self, class_counts):
'Calculate the Gini impurity.\n\n If c(i) denotes the i-th class count and c = sum_i c(i) then\n score = 1 - sum_i ( c(i) / c )^2\n\n Args:\n class_counts: A 2-D tensor of per-class counts, usually a slice or\n gather from variables.node_sums.\n\n Returns:\n ... | 7,108,791,516,632,742,000 | Calculate the Gini impurity.
If c(i) denotes the i-th class count and c = sum_i c(i) then
score = 1 - sum_i ( c(i) / c )^2
Args:
class_counts: A 2-D tensor of per-class counts, usually a slice or
gather from variables.node_sums.
Returns:
A 1-D tensor of the Gini impurities for each row in the input. | tensorflow/contrib/tensor_forest/python/tensor_forest.py | _gini | AdityaPai2398/tensorflow | python | def _gini(self, class_counts):
'Calculate the Gini impurity.\n\n If c(i) denotes the i-th class count and c = sum_i c(i) then\n score = 1 - sum_i ( c(i) / c )^2\n\n Args:\n class_counts: A 2-D tensor of per-class counts, usually a slice or\n gather from variables.node_sums.\n\n Returns:\n ... |
def _weighted_gini(self, class_counts):
'Our split score is the Gini impurity times the number of examples.\n\n If c(i) denotes the i-th class count and c = sum_i c(i) then\n score = c * (1 - sum_i ( c(i) / c )^2 )\n = c - sum_i c(i)^2 / c\n Args:\n class_counts: A 2-D tensor of per-class... | 6,267,550,326,469,067,000 | Our split score is the Gini impurity times the number of examples.
If c(i) denotes the i-th class count and c = sum_i c(i) then
score = c * (1 - sum_i ( c(i) / c )^2 )
= c - sum_i c(i)^2 / c
Args:
class_counts: A 2-D tensor of per-class counts, usually a slice or
gather from variables.node_sums.
Retur... | tensorflow/contrib/tensor_forest/python/tensor_forest.py | _weighted_gini | AdityaPai2398/tensorflow | python | def _weighted_gini(self, class_counts):
'Our split score is the Gini impurity times the number of examples.\n\n If c(i) denotes the i-th class count and c = sum_i c(i) then\n score = c * (1 - sum_i ( c(i) / c )^2 )\n = c - sum_i c(i)^2 / c\n Args:\n class_counts: A 2-D tensor of per-class... |
def _variance(self, sums, squares):
'Calculate the variance for each row of the input tensors.\n\n Variance is V = E[x^2] - (E[x])^2.\n\n Args:\n sums: A tensor containing output sums, usually a slice from\n variables.node_sums. Should contain the number of examples seen\n in index 0 so we... | -4,835,720,901,682,458,000 | Calculate the variance for each row of the input tensors.
Variance is V = E[x^2] - (E[x])^2.
Args:
sums: A tensor containing output sums, usually a slice from
variables.node_sums. Should contain the number of examples seen
in index 0 so we can calculate expected value.
squares: Same as sums, but sums of ... | tensorflow/contrib/tensor_forest/python/tensor_forest.py | _variance | AdityaPai2398/tensorflow | python | def _variance(self, sums, squares):
'Calculate the variance for each row of the input tensors.\n\n Variance is V = E[x^2] - (E[x])^2.\n\n Args:\n sums: A tensor containing output sums, usually a slice from\n variables.node_sums. Should contain the number of examples seen\n in index 0 so we... |
def training_graph(self, input_data, input_labels, random_seed, data_spec, epoch=None):
'Constructs a TF graph for training a random tree.\n\n Args:\n input_data: A tensor or SparseTensor or placeholder for input data.\n input_labels: A tensor or placeholder for labels associated with\n input_da... | -5,841,729,855,553,593,000 | Constructs a TF graph for training a random tree.
Args:
input_data: A tensor or SparseTensor or placeholder for input data.
input_labels: A tensor or placeholder for labels associated with
input_data.
random_seed: The random number generator seed to use for this tree. 0
means use the current time as the... | tensorflow/contrib/tensor_forest/python/tensor_forest.py | training_graph | AdityaPai2398/tensorflow | python | def training_graph(self, input_data, input_labels, random_seed, data_spec, epoch=None):
'Constructs a TF graph for training a random tree.\n\n Args:\n input_data: A tensor or SparseTensor or placeholder for input data.\n input_labels: A tensor or placeholder for labels associated with\n input_da... |
def finish_iteration(self):
'Perform any operations that should be done at the end of an iteration.\n\n This is mostly useful for subclasses that need to reset variables after\n an iteration, such as ones that are used to finish nodes.\n\n Returns:\n A list of operations.\n '
return [] | -114,024,798,016,085,220 | Perform any operations that should be done at the end of an iteration.
This is mostly useful for subclasses that need to reset variables after
an iteration, such as ones that are used to finish nodes.
Returns:
A list of operations. | tensorflow/contrib/tensor_forest/python/tensor_forest.py | finish_iteration | AdityaPai2398/tensorflow | python | def finish_iteration(self):
'Perform any operations that should be done at the end of an iteration.\n\n This is mostly useful for subclasses that need to reset variables after\n an iteration, such as ones that are used to finish nodes.\n\n Returns:\n A list of operations.\n '
return [] |
def inference_graph(self, input_data, data_spec):
'Constructs a TF graph for evaluating a random tree.\n\n Args:\n input_data: A tensor or SparseTensor or placeholder for input data.\n data_spec: A list of tf.dtype values specifying the original types of\n each column.\n\n Returns:\n The... | -1,317,678,232,807,222,500 | Constructs a TF graph for evaluating a random tree.
Args:
input_data: A tensor or SparseTensor or placeholder for input data.
data_spec: A list of tf.dtype values specifying the original types of
each column.
Returns:
The last op in the random tree inference graph. | tensorflow/contrib/tensor_forest/python/tensor_forest.py | inference_graph | AdityaPai2398/tensorflow | python | def inference_graph(self, input_data, data_spec):
'Constructs a TF graph for evaluating a random tree.\n\n Args:\n input_data: A tensor or SparseTensor or placeholder for input data.\n data_spec: A list of tf.dtype values specifying the original types of\n each column.\n\n Returns:\n The... |
def average_impurity(self):
'Constructs a TF graph for evaluating the average leaf impurity of a tree.\n\n If in regression mode, this is the leaf variance. If in classification mode,\n this is the gini impurity.\n\n Returns:\n The last op in the graph.\n '
children = array_ops.squeeze(array_op... | 2,271,007,417,708,949,200 | Constructs a TF graph for evaluating the average leaf impurity of a tree.
If in regression mode, this is the leaf variance. If in classification mode,
this is the gini impurity.
Returns:
The last op in the graph. | tensorflow/contrib/tensor_forest/python/tensor_forest.py | average_impurity | AdityaPai2398/tensorflow | python | def average_impurity(self):
'Constructs a TF graph for evaluating the average leaf impurity of a tree.\n\n If in regression mode, this is the leaf variance. If in classification mode,\n this is the gini impurity.\n\n Returns:\n The last op in the graph.\n '
children = array_ops.squeeze(array_op... |
def size(self):
'Constructs a TF graph for evaluating the current number of nodes.\n\n Returns:\n The current number of nodes in the tree.\n '
return (self.variables.end_of_tree - 1) | 4,745,050,360,644,350,000 | Constructs a TF graph for evaluating the current number of nodes.
Returns:
The current number of nodes in the tree. | tensorflow/contrib/tensor_forest/python/tensor_forest.py | size | AdityaPai2398/tensorflow | python | def size(self):
'Constructs a TF graph for evaluating the current number of nodes.\n\n Returns:\n The current number of nodes in the tree.\n '
return (self.variables.end_of_tree - 1) |
def __init__(self, floatingip=None):
'NeutronCreateFloatingIpRequestBody - a model defined in huaweicloud sdk'
self._floatingip = None
self.discriminator = None
self.floatingip = floatingip | -8,986,675,368,031,841,000 | NeutronCreateFloatingIpRequestBody - a model defined in huaweicloud sdk | huaweicloud-sdk-eip/huaweicloudsdkeip/v2/model/neutron_create_floating_ip_request_body.py | __init__ | huaweicloud/huaweicloud-sdk-python-v3 | python | def __init__(self, floatingip=None):
self._floatingip = None
self.discriminator = None
self.floatingip = floatingip |
@property
def floatingip(self):
'Gets the floatingip of this NeutronCreateFloatingIpRequestBody.\n\n\n :return: The floatingip of this NeutronCreateFloatingIpRequestBody.\n :rtype: CreateFloatingIpOption\n '
return self._floatingip | 1,985,792,057,117,326,000 | Gets the floatingip of this NeutronCreateFloatingIpRequestBody.
:return: The floatingip of this NeutronCreateFloatingIpRequestBody.
:rtype: CreateFloatingIpOption | huaweicloud-sdk-eip/huaweicloudsdkeip/v2/model/neutron_create_floating_ip_request_body.py | floatingip | huaweicloud/huaweicloud-sdk-python-v3 | python | @property
def floatingip(self):
'Gets the floatingip of this NeutronCreateFloatingIpRequestBody.\n\n\n :return: The floatingip of this NeutronCreateFloatingIpRequestBody.\n :rtype: CreateFloatingIpOption\n '
return self._floatingip |
@floatingip.setter
def floatingip(self, floatingip):
'Sets the floatingip of this NeutronCreateFloatingIpRequestBody.\n\n\n :param floatingip: The floatingip of this NeutronCreateFloatingIpRequestBody.\n :type: CreateFloatingIpOption\n '
self._floatingip = floatingip | -5,082,099,477,760,268,000 | Sets the floatingip of this NeutronCreateFloatingIpRequestBody.
:param floatingip: The floatingip of this NeutronCreateFloatingIpRequestBody.
:type: CreateFloatingIpOption | huaweicloud-sdk-eip/huaweicloudsdkeip/v2/model/neutron_create_floating_ip_request_body.py | floatingip | huaweicloud/huaweicloud-sdk-python-v3 | python | @floatingip.setter
def floatingip(self, floatingip):
'Sets the floatingip of this NeutronCreateFloatingIpRequestBody.\n\n\n :param floatingip: The floatingip of this NeutronCreateFloatingIpRequestBody.\n :type: CreateFloatingIpOption\n '
self._floatingip = floatingip |
def to_dict(self):
'Returns the model properties as a dict'
result = {}
for (attr, _) in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
e... | 2,594,216,033,120,720,000 | Returns the model properties as a dict | huaweicloud-sdk-eip/huaweicloudsdkeip/v2/model/neutron_create_floating_ip_request_body.py | to_dict | huaweicloud/huaweicloud-sdk-python-v3 | python | def to_dict(self):
result = {}
for (attr, _) in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
elif hasattr(value, 'to_dict'):
... |
def to_str(self):
'Returns the string representation of the model'
import simplejson as json
if six.PY2:
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False) | -6,095,553,759,700,562,000 | Returns the string representation of the model | huaweicloud-sdk-eip/huaweicloudsdkeip/v2/model/neutron_create_floating_ip_request_body.py | to_str | huaweicloud/huaweicloud-sdk-python-v3 | python | def to_str(self):
import simplejson as json
if six.PY2:
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False) |
def __repr__(self):
'For `print`'
return self.to_str() | -1,581,176,371,750,213,000 | For `print` | huaweicloud-sdk-eip/huaweicloudsdkeip/v2/model/neutron_create_floating_ip_request_body.py | __repr__ | huaweicloud/huaweicloud-sdk-python-v3 | python | def __repr__(self):
return self.to_str() |
def __eq__(self, other):
'Returns true if both objects are equal'
if (not isinstance(other, NeutronCreateFloatingIpRequestBody)):
return False
return (self.__dict__ == other.__dict__) | 1,684,303,059,840,454,000 | Returns true if both objects are equal | huaweicloud-sdk-eip/huaweicloudsdkeip/v2/model/neutron_create_floating_ip_request_body.py | __eq__ | huaweicloud/huaweicloud-sdk-python-v3 | python | def __eq__(self, other):
if (not isinstance(other, NeutronCreateFloatingIpRequestBody)):
return False
return (self.__dict__ == other.__dict__) |
def __ne__(self, other):
'Returns true if both objects are not equal'
return (not (self == other)) | 7,764,124,047,908,058,000 | Returns true if both objects are not equal | huaweicloud-sdk-eip/huaweicloudsdkeip/v2/model/neutron_create_floating_ip_request_body.py | __ne__ | huaweicloud/huaweicloud-sdk-python-v3 | python | def __ne__(self, other):
return (not (self == other)) |
@pytest.mark.parametrize('SearchCV', [HalvingRandomSearchCV, HalvingGridSearchCV])
def test_min_resources_null(SearchCV):
'Check that we raise an error if the minimum resources is set to 0.'
base_estimator = FastClassifier()
param_grid = {'a': [1]}
X = np.empty(0).reshape(0, 3)
search = SearchCV(bas... | -706,482,965,388,153,000 | Check that we raise an error if the minimum resources is set to 0. | sklearn/model_selection/tests/test_successive_halving.py | test_min_resources_null | 3021104750/scikit-learn | python | @pytest.mark.parametrize('SearchCV', [HalvingRandomSearchCV, HalvingGridSearchCV])
def test_min_resources_null(SearchCV):
base_estimator = FastClassifier()
param_grid = {'a': [1]}
X = np.empty(0).reshape(0, 3)
search = SearchCV(base_estimator, param_grid, min_resources='smallest')
err_msg = 'mi... |
@pytest.mark.parametrize('SearchCV', [HalvingGridSearchCV, HalvingRandomSearchCV])
def test_select_best_index(SearchCV):
'Check the selection strategy of the halving search.'
results = {'iter': np.array([0, 0, 0, 0, 1, 1, 2, 2, 2]), 'mean_test_score': np.array([4, 3, 5, 1, 11, 10, 5, 6, 9]), 'params': np.array(... | -8,218,927,456,292,474,000 | Check the selection strategy of the halving search. | sklearn/model_selection/tests/test_successive_halving.py | test_select_best_index | 3021104750/scikit-learn | python | @pytest.mark.parametrize('SearchCV', [HalvingGridSearchCV, HalvingRandomSearchCV])
def test_select_best_index(SearchCV):
results = {'iter': np.array([0, 0, 0, 0, 1, 1, 2, 2, 2]), 'mean_test_score': np.array([4, 3, 5, 1, 11, 10, 5, 6, 9]), 'params': np.array(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'])}
b... |
def drawline():
"Tracé d'une ligne dans le canevas can1"
global x1, y1, x2, y2, coul
can1.create_line(x1, y1, x2, y2, width=2, fill=coul)
(y2, y1) = ((y2 + 10), (y1 - 10)) | 3,233,638,542,157,701,600 | Tracé d'une ligne dans le canevas can1 | Exemples cours 4/TK_Line.py | drawline | geocot/coursPython | python | def drawline():
global x1, y1, x2, y2, coul
can1.create_line(x1, y1, x2, y2, width=2, fill=coul)
(y2, y1) = ((y2 + 10), (y1 - 10)) |
def changecolor():
'Changement aléatoire de la couleur du tracé'
global coul
pal = ['purple', 'cyan', 'maroon', 'green', 'red', 'blue', 'orange', 'yellow']
c = randrange(8)
coul = pal[c] | -6,397,451,742,445,943,000 | Changement aléatoire de la couleur du tracé | Exemples cours 4/TK_Line.py | changecolor | geocot/coursPython | python | def changecolor():
global coul
pal = ['purple', 'cyan', 'maroon', 'green', 'red', 'blue', 'orange', 'yellow']
c = randrange(8)
coul = pal[c] |
@tf.function
def mse_loss(static, moving):
'Computes the mean squared error (MSE) loss.\n\n Currently, only 4-D inputs are supported.\n\n Parameters\n ----------\n static : tf.Tensor, shape (N, H, W, C)\n The static image to which the moving image is aligned.\n moving : tf.Tensor, shape (N, H,... | -8,802,986,864,010,985,000 | Computes the mean squared error (MSE) loss.
Currently, only 4-D inputs are supported.
Parameters
----------
static : tf.Tensor, shape (N, H, W, C)
The static image to which the moving image is aligned.
moving : tf.Tensor, shape (N, H, W, C)
The moving image, the same shape as the static image.
Returns
------... | register_basics.py | mse_loss | jerinka/voxelmorph_demo | python | @tf.function
def mse_loss(static, moving):
'Computes the mean squared error (MSE) loss.\n\n Currently, only 4-D inputs are supported.\n\n Parameters\n ----------\n static : tf.Tensor, shape (N, H, W, C)\n The static image to which the moving image is aligned.\n moving : tf.Tensor, shape (N, H,... |
@tf.function
def ncc_loss(static, moving):
'Computes the normalized cross-correlation (NCC) loss.\n\n Currently, only 4-D inputs are supported.\n\n Parameters\n ----------\n static : tf.Tensor, shape (N, H, W, C)\n The static image to which the moving image is aligned.\n moving : tf.Tensor, sh... | -1,974,962,980,259,870,200 | Computes the normalized cross-correlation (NCC) loss.
Currently, only 4-D inputs are supported.
Parameters
----------
static : tf.Tensor, shape (N, H, W, C)
The static image to which the moving image is aligned.
moving : tf.Tensor, shape (N, H, W, C)
The moving image, the same shape as the static image.
Retu... | register_basics.py | ncc_loss | jerinka/voxelmorph_demo | python | @tf.function
def ncc_loss(static, moving):
'Computes the normalized cross-correlation (NCC) loss.\n\n Currently, only 4-D inputs are supported.\n\n Parameters\n ----------\n static : tf.Tensor, shape (N, H, W, C)\n The static image to which the moving image is aligned.\n moving : tf.Tensor, sh... |
def simple_cnn(input_shape=(32, 32, 2)):
"Creates a 2-D convolutional encoder-decoder network.\n\n Parameters\n ----------\n input_shape : sequence of ints, optional\n Input data shape of the form (H, W, C). Default is (32, 32, 2).\n\n Returns\n -------\n model\n An instance of Keras... | 4,992,043,161,819,919,000 | Creates a 2-D convolutional encoder-decoder network.
Parameters
----------
input_shape : sequence of ints, optional
Input data shape of the form (H, W, C). Default is (32, 32, 2).
Returns
-------
model
An instance of Keras' Model class.
Notes
-----
Given a concatenated pair of static and moving images as inp... | register_basics.py | simple_cnn | jerinka/voxelmorph_demo | python | def simple_cnn(input_shape=(32, 32, 2)):
"Creates a 2-D convolutional encoder-decoder network.\n\n Parameters\n ----------\n input_shape : sequence of ints, optional\n Input data shape of the form (H, W, C). Default is (32, 32, 2).\n\n Returns\n -------\n model\n An instance of Keras... |
@tf.function
def grid_sample(moving, grid):
'Given a moving image and a sampling grid as input, computes the\n transformed image by sampling the moving image at locations given by\n the grid.\n\n Currently, only 2-D images, i.e., 4-D inputs are supported.\n\n Parameters\n ----------\n moving : tf.... | -8,025,276,344,341,063,000 | Given a moving image and a sampling grid as input, computes the
transformed image by sampling the moving image at locations given by
the grid.
Currently, only 2-D images, i.e., 4-D inputs are supported.
Parameters
----------
moving : tf.Tensor, shape (N, H, W, C)
The moving image.
grid : tf.Tensor, shape (N, H, W... | register_basics.py | grid_sample | jerinka/voxelmorph_demo | python | @tf.function
def grid_sample(moving, grid):
'Given a moving image and a sampling grid as input, computes the\n transformed image by sampling the moving image at locations given by\n the grid.\n\n Currently, only 2-D images, i.e., 4-D inputs are supported.\n\n Parameters\n ----------\n moving : tf.... |
@tf.function
def regular_grid(shape):
'Returns a batch of 2-D regular grids.\n\n Currently, only 2-D regular grids are supported.\n\n Parameters\n ----------\n shape : sequence of ints, shape (3, )\n The desired regular grid shape of the form (N, H, W).\n\n Returns\n -------\n grid : tf.... | -4,218,321,770,434,875,400 | Returns a batch of 2-D regular grids.
Currently, only 2-D regular grids are supported.
Parameters
----------
shape : sequence of ints, shape (3, )
The desired regular grid shape of the form (N, H, W).
Returns
-------
grid : tf.Tensor, shape (N, H, W, 2)
A batch of 2-D regular grids, values normalized to [-1.... | register_basics.py | regular_grid | jerinka/voxelmorph_demo | python | @tf.function
def regular_grid(shape):
'Returns a batch of 2-D regular grids.\n\n Currently, only 2-D regular grids are supported.\n\n Parameters\n ----------\n shape : sequence of ints, shape (3, )\n The desired regular grid shape of the form (N, H, W).\n\n Returns\n -------\n grid : tf.... |
@tf.function
def train_step(model, moving, static, criterion, optimizer):
'A generic training procedure for one iteration.\n\n Parameters\n ----------\n model\n A convolutional encoder-decoder network.\n moving : tf.Tensor, shape (N, H, W, C)\n A batch of moving images.\n static : tf.Te... | -1,444,017,728,608,054,500 | A generic training procedure for one iteration.
Parameters
----------
model
A convolutional encoder-decoder network.
moving : tf.Tensor, shape (N, H, W, C)
A batch of moving images.
static : tf.Tensor, shape (1, H, W, C)
The static image.
criterion
The loss function.
optimizer
An optimzer.
Returns... | register_basics.py | train_step | jerinka/voxelmorph_demo | python | @tf.function
def train_step(model, moving, static, criterion, optimizer):
'A generic training procedure for one iteration.\n\n Parameters\n ----------\n model\n A convolutional encoder-decoder network.\n moving : tf.Tensor, shape (N, H, W, C)\n A batch of moving images.\n static : tf.Te... |
@tf.function
def test_step(model, moving, static, criterion):
'A generic testing procedure.\n\n Parameters\n ----------\n model\n A convolutional encoder-decoder network.\n moving : tf.Tensor, shape (N, H, W, C)\n A batch of moving images.\n static : tf.Tensor, shape (1, H, W, C)\n ... | -7,464,719,366,714,921,000 | A generic testing procedure.
Parameters
----------
model
A convolutional encoder-decoder network.
moving : tf.Tensor, shape (N, H, W, C)
A batch of moving images.
static : tf.Tensor, shape (1, H, W, C)
The static image.
criterion
The loss function.
Returns
-------
loss : tf.Tensor, shape ()
The av... | register_basics.py | test_step | jerinka/voxelmorph_demo | python | @tf.function
def test_step(model, moving, static, criterion):
'A generic testing procedure.\n\n Parameters\n ----------\n model\n A convolutional encoder-decoder network.\n moving : tf.Tensor, shape (N, H, W, C)\n A batch of moving images.\n static : tf.Tensor, shape (1, H, W, C)\n ... |
def load_data(label=2):
'Loads the MNIST dataset and preprocesses it: scales to [0.0, 1.0]\n range, resizes the images from (28, 28) to (32, 32) and filters the\n dataset to keep images of just one class.\n\n Parameters\n ----------\n label : {2, 0, 1, 3, 4, 5, 6, 7, 8, 9}, default 2\n The cla... | 7,456,557,386,423,309,000 | Loads the MNIST dataset and preprocesses it: scales to [0.0, 1.0]
range, resizes the images from (28, 28) to (32, 32) and filters the
dataset to keep images of just one class.
Parameters
----------
label : {2, 0, 1, 3, 4, 5, 6, 7, 8, 9}, default 2
The class of images to train and test on.
Returns
-------
(x_train... | register_basics.py | load_data | jerinka/voxelmorph_demo | python | def load_data(label=2):
'Loads the MNIST dataset and preprocesses it: scales to [0.0, 1.0]\n range, resizes the images from (28, 28) to (32, 32) and filters the\n dataset to keep images of just one class.\n\n Parameters\n ----------\n label : {2, 0, 1, 3, 4, 5, 6, 7, 8, 9}, default 2\n The cla... |
def plot_images(model, moving, static):
'Visualize some images after training.\n\n Parameters\n ----------\n model\n The trained model.\n moving : tf.Tensor, shape (N, H, W, C)\n A batch of moving images.\n static : tf.Tensor, shape (1, H, W, C)\n The static image.\n '
(nb... | -2,103,651,409,913,373,200 | Visualize some images after training.
Parameters
----------
model
The trained model.
moving : tf.Tensor, shape (N, H, W, C)
A batch of moving images.
static : tf.Tensor, shape (1, H, W, C)
The static image. | register_basics.py | plot_images | jerinka/voxelmorph_demo | python | def plot_images(model, moving, static):
'Visualize some images after training.\n\n Parameters\n ----------\n model\n The trained model.\n moving : tf.Tensor, shape (N, H, W, C)\n A batch of moving images.\n static : tf.Tensor, shape (1, H, W, C)\n The static image.\n '
(nb... |
def egg(num_eggs: int) -> None:
'prints the number of eggs.\n\n Arguments:\n num_eggs {int} -- The number of eggs\n\n Returns:\n None.\n '
print(f'We have {num_eggs} eggs') | -3,256,755,077,250,168,300 | prints the number of eggs.
Arguments:
num_eggs {int} -- The number of eggs
Returns:
None. | src/moonshine/__main__.py | egg | CatchemAl/moonshine | python | def egg(num_eggs: int) -> None:
'prints the number of eggs.\n\n Arguments:\n num_eggs {int} -- The number of eggs\n\n Returns:\n None.\n '
print(f'We have {num_eggs} eggs') |
def get(self, request):
'提供订单结算页面'
user = request.user
try:
addresses = Address.objects.filter(user=user, is_deleted=False)
except Address.DoesNotExist:
addresses = None
redis_conn = get_redis_connection('carts')
item_dict = redis_conn.hgetall(('carts_%s' % user.id))
cart_sel... | 221,095,081,085,981,470 | 提供订单结算页面 | meiduo_mall/meiduo_mall/apps/orders/views.py | get | Gdavid123/md_project | python | def get(self, request):
user = request.user
try:
addresses = Address.objects.filter(user=user, is_deleted=False)
except Address.DoesNotExist:
addresses = None
redis_conn = get_redis_connection('carts')
item_dict = redis_conn.hgetall(('carts_%s' % user.id))
cart_selected = re... |
def post(self, request):
'保存订单信息和订单商品信息'
json_dict = json.loads(request.body)
address_id = json_dict.get('address_id')
pay_method = json_dict.get('pay_method')
if (not all([address_id, pay_method])):
return HttpResponseForbidden('缺少必传参数')
try:
address = Address.objects.get(id=add... | 6,315,316,786,832,754,000 | 保存订单信息和订单商品信息 | meiduo_mall/meiduo_mall/apps/orders/views.py | post | Gdavid123/md_project | python | def post(self, request):
json_dict = json.loads(request.body)
address_id = json_dict.get('address_id')
pay_method = json_dict.get('pay_method')
if (not all([address_id, pay_method])):
return HttpResponseForbidden('缺少必传参数')
try:
address = Address.objects.get(id=address_id)
ex... |
@commands.command()
@commands.guild_only()
@commands.has_permissions(kick_members=True)
async def kick(self, ctx, user: discord.Member, *, reason: str=None):
'Kicks a user from the server.'
if (user == ctx.author):
return (await ctx.send('Kicking yourself? smh.'))
if (user == self.bot.user):
... | 3,890,303,692,033,552,400 | Kicks a user from the server. | cogs/mod.py | kick | bananaboy21/LadyBug-Bot | python | @commands.command()
@commands.guild_only()
@commands.has_permissions(kick_members=True)
async def kick(self, ctx, user: discord.Member, *, reason: str=None):
if (user == ctx.author):
return (await ctx.send('Kicking yourself? smh.'))
if (user == self.bot.user):
return (await ctx.send("I can'... |
@commands.command()
@comnands.guild_only()
@commands.has_permissions(manage_messages=True)
async def purge(self, ctx, amount):
'Purges X amount of messages from a channel'
try:
amount = int(amount)
except ValueError:
return (await ctx.send('Enter a number only!'))
try:
(await ctx... | -5,009,195,797,135,292,000 | Purges X amount of messages from a channel | cogs/mod.py | purge | bananaboy21/LadyBug-Bot | python | @commands.command()
@comnands.guild_only()
@commands.has_permissions(manage_messages=True)
async def purge(self, ctx, amount):
try:
amount = int(amount)
except ValueError:
return (await ctx.send('Enter a number only!'))
try:
(await ctx.channel.purge(limit=(amount + 1)))
... |
def _fill_buffer(self, in_data, frame_count, time_info, status_flags):
'Continuously collect data from the audio stream, into the buffer.'
self._buff.put(in_data)
return (None, paContinue) | 8,279,764,556,543,421,000 | Continuously collect data from the audio stream, into the buffer. | googlesr.py | _fill_buffer | kwea123/Unity_live_caption | python | def _fill_buffer(self, in_data, frame_count, time_info, status_flags):
self._buff.put(in_data)
return (None, paContinue) |
def create_process_chain_entry(input_name):
'Create a Actinia process description that uses t.rast.series to create the minimum\n value of the time series.\n\n :param input_time_series: The input time series name\n :param output_map: The name of the output map\n :return: A Actinia process chain descript... | -4,390,559,835,525,533,000 | Create a Actinia process description that uses t.rast.series to create the minimum
value of the time series.
:param input_time_series: The input time series name
:param output_map: The name of the output map
:return: A Actinia process chain description | src/openeo_grass_gis_driver/actinia_processing/get_data_process.py | create_process_chain_entry | AnikaBettge/openeo-grassgis-driver | python | def create_process_chain_entry(input_name):
'Create a Actinia process description that uses t.rast.series to create the minimum\n value of the time series.\n\n :param input_time_series: The input time series name\n :param output_map: The name of the output map\n :return: A Actinia process chain descript... |
def get_process_list(process):
'Analyse the process description and return the Actinia process chain and the name of the processing result\n\n :param process: The process description\n :return: (output_names, actinia_process_list)\n '
(input_names, process_list) = analyse_process_graph(process)
out... | -8,158,080,401,428,951,000 | Analyse the process description and return the Actinia process chain and the name of the processing result
:param process: The process description
:return: (output_names, actinia_process_list) | src/openeo_grass_gis_driver/actinia_processing/get_data_process.py | get_process_list | AnikaBettge/openeo-grassgis-driver | python | def get_process_list(process):
'Analyse the process description and return the Actinia process chain and the name of the processing result\n\n :param process: The process description\n :return: (output_names, actinia_process_list)\n '
(input_names, process_list) = analyse_process_graph(process)
out... |
def test_ooo_ns(self):
' Check that ooo exists in namespace declarations '
calcdoc = OpenDocumentSpreadsheet()
table = odf.table.Table(name='Costs')
forms = odf.office.Forms()
form = odf.form.Form(controlimplementation='ooo:com.sun.star.form.component.Form')
lb = odf.form.Listbox(controlimplemen... | -4,638,254,260,209,595,000 | Check that ooo exists in namespace declarations | desktop/core/ext-py/odfpy-1.4.1/tests/testform.py | test_ooo_ns | 10088/hue | python | def test_ooo_ns(self):
' '
calcdoc = OpenDocumentSpreadsheet()
table = odf.table.Table(name='Costs')
forms = odf.office.Forms()
form = odf.form.Form(controlimplementation='ooo:com.sun.star.form.component.Form')
lb = odf.form.Listbox(controlimplementation='ooo:com.sun.star.form.component.ListBox... |
def acked(err, msg):
'Delivery report callback called (from flush()) on successful or failed delivery of the message.'
if (err is not None):
print('failed to deliver message: {0}'.format(err.str()))
else:
print('produced to: {0} [{1}] @ {2}'.format(msg.topic(), msg.partition(), msg.offset())... | -5,767,730,579,330,683,000 | Delivery report callback called (from flush()) on successful or failed delivery of the message. | examples/confluent_cloud.py | acked | RasmusWL/confluent-kafka-python | python | def acked(err, msg):
if (err is not None):
print('failed to deliver message: {0}'.format(err.str()))
else:
print('produced to: {0} [{1}] @ {2}'.format(msg.topic(), msg.partition(), msg.offset())) |
@cached_property
def openapi_types():
'\n This must be a method because a model may have properties that are\n of type self, this must run after the class is loaded\n\n Returns\n openapi_types (dict): The key is attribute name\n and the value is attribute type.\n ... | -2,487,247,778,736,868,400 | This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type. | api/client/src/pcluster_client/model/delete_cluster_response_content.py | openapi_types | Chen188/aws-parallelcluster | python | @cached_property
def openapi_types():
'\n This must be a method because a model may have properties that are\n of type self, this must run after the class is loaded\n\n Returns\n openapi_types (dict): The key is attribute name\n and the value is attribute type.\n ... |
@convert_js_args_to_python_args
def __init__(self, cluster, *args, **kwargs):
'DeleteClusterResponseContent - a model defined in OpenAPI\n\n Args:\n cluster (ClusterInfoSummary):\n\n Keyword Args:\n _check_type (bool): if True, values for parameters in openapi_types\n ... | 560,588,246,799,685,570 | DeleteClusterResponseContent - a model defined in OpenAPI
Args:
cluster (ClusterInfoSummary):
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
... | api/client/src/pcluster_client/model/delete_cluster_response_content.py | __init__ | Chen188/aws-parallelcluster | python | @convert_js_args_to_python_args
def __init__(self, cluster, *args, **kwargs):
'DeleteClusterResponseContent - a model defined in OpenAPI\n\n Args:\n cluster (ClusterInfoSummary):\n\n Keyword Args:\n _check_type (bool): if True, values for parameters in openapi_types\n ... |
def on_status_update(self, channel, callback):
'\n Callback to execute on status of update of channel\n '
if (not (channel in self._callbacks)):
self._callbacks[channel] = []
self._callbacks[channel].append(callback) | -786,942,491,258,360,300 | Callback to execute on status of update of channel | velbus/modules/vmbbl.py | on_status_update | ddanssaert/python-velbus | python | def on_status_update(self, channel, callback):
'\n \n '
if (not (channel in self._callbacks)):
self._callbacks[channel] = []
self._callbacks[channel].append(callback) |
def clean_path(self, path):
'\n Helper to clean issues path from remote tasks\n '
if path.startswith(WORKER_CHECKOUT):
path = path[len(WORKER_CHECKOUT):]
if path.startswith('/'):
path = path[1:]
return path | 77,414,928,993,778,610 | Helper to clean issues path from remote tasks | src/staticanalysis/bot/static_analysis_bot/task.py | clean_path | Mozilla-GitHub-Standards/7a0517c85b685752ad36ce0e8246040e3de8d842fb0f2696540dfc0c54da847b | python | def clean_path(self, path):
'\n \n '
if path.startswith(WORKER_CHECKOUT):
path = path[len(WORKER_CHECKOUT):]
if path.startswith('/'):
path = path[1:]
return path |
def __init__(self, model_dir, every_n_steps=1):
'Create a FeatureImportanceSummarySaver Hook.\n\n This hook creates scalar summaries representing feature importance\n for each feature column during training.\n\n Args:\n model_dir: model base output directory.\n every_n_steps: frequency, in number... | -6,315,023,366,711,679,000 | Create a FeatureImportanceSummarySaver Hook.
This hook creates scalar summaries representing feature importance
for each feature column during training.
Args:
model_dir: model base output directory.
every_n_steps: frequency, in number of steps, for logging summaries.
Raises:
ValueError: If one of the arguments... | tensorflow/contrib/boosted_trees/estimator_batch/trainer_hooks.py | __init__ | 252125889/tensorflow | python | def __init__(self, model_dir, every_n_steps=1):
'Create a FeatureImportanceSummarySaver Hook.\n\n This hook creates scalar summaries representing feature importance\n for each feature column during training.\n\n Args:\n model_dir: model base output directory.\n every_n_steps: frequency, in number... |
def __init__(self, rolling_update=None, type=None, local_vars_configuration=None):
'V1beta2DeploymentStrategy - a model defined in OpenAPI'
if (local_vars_configuration is None):
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._rolling_upd... | 1,758,358,165,594,836,200 | V1beta2DeploymentStrategy - a model defined in OpenAPI | kubernetes_asyncio/client/models/v1beta2_deployment_strategy.py | __init__ | playground-julia/kubernetes_asyncio | python | def __init__(self, rolling_update=None, type=None, local_vars_configuration=None):
if (local_vars_configuration is None):
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._rolling_update = None
self._type = None
self.discriminator ... |
@property
def rolling_update(self):
'Gets the rolling_update of this V1beta2DeploymentStrategy. # noqa: E501\n\n\n :return: The rolling_update of this V1beta2DeploymentStrategy. # noqa: E501\n :rtype: V1beta2RollingUpdateDeployment\n '
return self._rolling_update | 2,836,691,819,272,422,400 | Gets the rolling_update of this V1beta2DeploymentStrategy. # noqa: E501
:return: The rolling_update of this V1beta2DeploymentStrategy. # noqa: E501
:rtype: V1beta2RollingUpdateDeployment | kubernetes_asyncio/client/models/v1beta2_deployment_strategy.py | rolling_update | playground-julia/kubernetes_asyncio | python | @property
def rolling_update(self):
'Gets the rolling_update of this V1beta2DeploymentStrategy. # noqa: E501\n\n\n :return: The rolling_update of this V1beta2DeploymentStrategy. # noqa: E501\n :rtype: V1beta2RollingUpdateDeployment\n '
return self._rolling_update |
@rolling_update.setter
def rolling_update(self, rolling_update):
'Sets the rolling_update of this V1beta2DeploymentStrategy.\n\n\n :param rolling_update: The rolling_update of this V1beta2DeploymentStrategy. # noqa: E501\n :type: V1beta2RollingUpdateDeployment\n '
self._rolling_update = ro... | -6,238,375,914,927,697,000 | Sets the rolling_update of this V1beta2DeploymentStrategy.
:param rolling_update: The rolling_update of this V1beta2DeploymentStrategy. # noqa: E501
:type: V1beta2RollingUpdateDeployment | kubernetes_asyncio/client/models/v1beta2_deployment_strategy.py | rolling_update | playground-julia/kubernetes_asyncio | python | @rolling_update.setter
def rolling_update(self, rolling_update):
'Sets the rolling_update of this V1beta2DeploymentStrategy.\n\n\n :param rolling_update: The rolling_update of this V1beta2DeploymentStrategy. # noqa: E501\n :type: V1beta2RollingUpdateDeployment\n '
self._rolling_update = ro... |
@property
def type(self):
'Gets the type of this V1beta2DeploymentStrategy. # noqa: E501\n\n Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. # noqa: E501\n\n :return: The type of this V1beta2DeploymentStrategy. # noqa: E501\n :rtype: str\n '
ret... | -5,930,811,531,650,901,000 | Gets the type of this V1beta2DeploymentStrategy. # noqa: E501
Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. # noqa: E501
:return: The type of this V1beta2DeploymentStrategy. # noqa: E501
:rtype: str | kubernetes_asyncio/client/models/v1beta2_deployment_strategy.py | type | playground-julia/kubernetes_asyncio | python | @property
def type(self):
'Gets the type of this V1beta2DeploymentStrategy. # noqa: E501\n\n Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. # noqa: E501\n\n :return: The type of this V1beta2DeploymentStrategy. # noqa: E501\n :rtype: str\n '
ret... |
@type.setter
def type(self, type):
'Sets the type of this V1beta2DeploymentStrategy.\n\n Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. # noqa: E501\n\n :param type: The type of this V1beta2DeploymentStrategy. # noqa: E501\n :type: str\n '
self.... | -6,357,622,358,049,090,000 | Sets the type of this V1beta2DeploymentStrategy.
Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. # noqa: E501
:param type: The type of this V1beta2DeploymentStrategy. # noqa: E501
:type: str | kubernetes_asyncio/client/models/v1beta2_deployment_strategy.py | type | playground-julia/kubernetes_asyncio | python | @type.setter
def type(self, type):
'Sets the type of this V1beta2DeploymentStrategy.\n\n Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. # noqa: E501\n\n :param type: The type of this V1beta2DeploymentStrategy. # noqa: E501\n :type: str\n '
self.... |
def to_dict(self):
'Returns the model properties as a dict'
result = {}
for (attr, _) in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
e... | 8,442,519,487,048,767,000 | Returns the model properties as a dict | kubernetes_asyncio/client/models/v1beta2_deployment_strategy.py | to_dict | playground-julia/kubernetes_asyncio | python | def to_dict(self):
result = {}
for (attr, _) in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
elif hasattr(value, 'to_dict'):
... |
def to_str(self):
'Returns the string representation of the model'
return pprint.pformat(self.to_dict()) | 5,849,158,643,760,736,000 | Returns the string representation of the model | kubernetes_asyncio/client/models/v1beta2_deployment_strategy.py | to_str | playground-julia/kubernetes_asyncio | python | def to_str(self):
return pprint.pformat(self.to_dict()) |
def __repr__(self):
'For `print` and `pprint`'
return self.to_str() | -8,960,031,694,814,905,000 | For `print` and `pprint` | kubernetes_asyncio/client/models/v1beta2_deployment_strategy.py | __repr__ | playground-julia/kubernetes_asyncio | python | def __repr__(self):
return self.to_str() |
def __eq__(self, other):
'Returns true if both objects are equal'
if (not isinstance(other, V1beta2DeploymentStrategy)):
return False
return (self.to_dict() == other.to_dict()) | 6,809,897,058,905,253,000 | Returns true if both objects are equal | kubernetes_asyncio/client/models/v1beta2_deployment_strategy.py | __eq__ | playground-julia/kubernetes_asyncio | python | def __eq__(self, other):
if (not isinstance(other, V1beta2DeploymentStrategy)):
return False
return (self.to_dict() == other.to_dict()) |
def __ne__(self, other):
'Returns true if both objects are not equal'
if (not isinstance(other, V1beta2DeploymentStrategy)):
return True
return (self.to_dict() != other.to_dict()) | 4,985,561,881,093,274,000 | Returns true if both objects are not equal | kubernetes_asyncio/client/models/v1beta2_deployment_strategy.py | __ne__ | playground-julia/kubernetes_asyncio | python | def __ne__(self, other):
if (not isinstance(other, V1beta2DeploymentStrategy)):
return True
return (self.to_dict() != other.to_dict()) |
@register_make_test_function()
def make_transpose_conv_tests(options):
'Make a set of tests to do transpose_conv.'
test_parameters = [{'input_shape': [[1, 3, 4, 1], [1, 10, 10, 3], [3, 20, 20, 1]], 'filter_size': [[1, 1], [1, 2], [3, 3]], 'strides': [[1, 1, 1, 1], [1, 3, 3, 1]], 'padding': ['SAME', 'VALID'], 'd... | 6,016,943,675,267,754,000 | Make a set of tests to do transpose_conv. | tensorflow/lite/testing/op_tests/transpose_conv.py | make_transpose_conv_tests | 1250281649/tensorflow | python | @register_make_test_function()
def make_transpose_conv_tests(options):
test_parameters = [{'input_shape': [[1, 3, 4, 1], [1, 10, 10, 3], [3, 20, 20, 1]], 'filter_size': [[1, 1], [1, 2], [3, 3]], 'strides': [[1, 1, 1, 1], [1, 3, 3, 1]], 'padding': ['SAME', 'VALID'], 'data_format': ['NHWC'], 'channel_multiplier'... |
def build_graph(parameters):
'Build a transpose_conv graph given `parameters`.'
(input_shape, filter_shape) = get_tensor_shapes(parameters)
input_tensor = tf.compat.v1.placeholder(dtype=tf.float32, name='input', shape=input_shape)
filter_input = tf.compat.v1.placeholder(dtype=tf.float32, name='filter', ... | -8,626,366,598,057,815,000 | Build a transpose_conv graph given `parameters`. | tensorflow/lite/testing/op_tests/transpose_conv.py | build_graph | 1250281649/tensorflow | python | def build_graph(parameters):
(input_shape, filter_shape) = get_tensor_shapes(parameters)
input_tensor = tf.compat.v1.placeholder(dtype=tf.float32, name='input', shape=input_shape)
filter_input = tf.compat.v1.placeholder(dtype=tf.float32, name='filter', shape=filter_shape)
if (not parameters['fully_... |
def _adapt_clause(self, clause, as_filter, orm_only):
'Adapt incoming clauses to transformations which\n have been applied within this query.'
adapters = []
orm_only = getattr(self, '_orm_only_adapt', orm_only)
if (as_filter and self._filter_aliases):
for fa in self._filter_aliases._visit... | 179,562,849,315,056,350 | Adapt incoming clauses to transformations which
have been applied within this query. | lib/sqlalchemy/orm/query.py | _adapt_clause | slafs/sqlalchemy | python | def _adapt_clause(self, clause, as_filter, orm_only):
'Adapt incoming clauses to transformations which\n have been applied within this query.'
adapters = []
orm_only = getattr(self, '_orm_only_adapt', orm_only)
if (as_filter and self._filter_aliases):
for fa in self._filter_aliases._visit... |
@property
def statement(self):
'The full SELECT statement represented by this Query.\n\n The statement by default will not have disambiguating labels\n applied to the construct unless with_labels(True) is called\n first.\n\n '
stmt = self._compile_context(labels=self._with_labels).st... | 8,025,505,478,787,422,000 | The full SELECT statement represented by this Query.
The statement by default will not have disambiguating labels
applied to the construct unless with_labels(True) is called
first. | lib/sqlalchemy/orm/query.py | statement | slafs/sqlalchemy | python | @property
def statement(self):
'The full SELECT statement represented by this Query.\n\n The statement by default will not have disambiguating labels\n applied to the construct unless with_labels(True) is called\n first.\n\n '
stmt = self._compile_context(labels=self._with_labels).st... |
def subquery(self, name=None, with_labels=False, reduce_columns=False):
'return the full SELECT statement represented by\n this :class:`.Query`, embedded within an :class:`.Alias`.\n\n Eager JOIN generation within the query is disabled.\n\n :param name: string name to be assigned as the alias;\... | 9,211,129,501,899,320,000 | return the full SELECT statement represented by
this :class:`.Query`, embedded within an :class:`.Alias`.
Eager JOIN generation within the query is disabled.
:param name: string name to be assigned as the alias;
this is passed through to :meth:`.FromClause.alias`.
If ``None``, a name will be deterministically... | lib/sqlalchemy/orm/query.py | subquery | slafs/sqlalchemy | python | def subquery(self, name=None, with_labels=False, reduce_columns=False):
'return the full SELECT statement represented by\n this :class:`.Query`, embedded within an :class:`.Alias`.\n\n Eager JOIN generation within the query is disabled.\n\n :param name: string name to be assigned as the alias;\... |
def cte(self, name=None, recursive=False):
'Return the full SELECT statement represented by this\n :class:`.Query` represented as a common table expression (CTE).\n\n .. versionadded:: 0.7.6\n\n Parameters and usage are the same as those of the\n :meth:`.SelectBase.cte` method; see that ... | 6,680,600,726,794,780,000 | Return the full SELECT statement represented by this
:class:`.Query` represented as a common table expression (CTE).
.. versionadded:: 0.7.6
Parameters and usage are the same as those of the
:meth:`.SelectBase.cte` method; see that method for
further details.
Here is the `Postgresql WITH
RECURSIVE example
<http://ww... | lib/sqlalchemy/orm/query.py | cte | slafs/sqlalchemy | python | def cte(self, name=None, recursive=False):
'Return the full SELECT statement represented by this\n :class:`.Query` represented as a common table expression (CTE).\n\n .. versionadded:: 0.7.6\n\n Parameters and usage are the same as those of the\n :meth:`.SelectBase.cte` method; see that ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.