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 |
|---|---|---|---|---|---|---|---|
def __init__(self, request, args=None, kwargs=None, progress=None):
'\n\n :param request: The WAMP request ID of the original call.\n :type request: int\n :param args: Positional values for application-defined event payload.\n Must be serializable using any serializers in use.\n :type ar... | -7,122,721,118,999,374,000 | :param request: The WAMP request ID of the original call.
:type request: int
:param args: Positional values for application-defined event payload.
Must be serializable using any serializers in use.
:type args: list or tuple or None
:param kwargs: Keyword values for application-defined event payload.
Must be seria... | ThirdParty/AutobahnPython/autobahn/wamp/message.py | __init__ | Crimson-MITK-ThirdParty/VTK-7.0.0 | python | def __init__(self, request, args=None, kwargs=None, progress=None):
'\n\n :param request: The WAMP request ID of the original call.\n :type request: int\n :param args: Positional values for application-defined event payload.\n Must be serializable using any serializers in use.\n :type ar... |
@staticmethod
def parse(wmsg):
'\n Verifies and parses an unserialized raw message into an actual WAMP message instance.\n\n :param wmsg: The unserialized raw message.\n :type wmsg: list\n\n :returns: An instance of this class.\n '
assert ((len(wmsg) > 0) and (wmsg[0] == Yield.MESSAGE_T... | -2,507,044,840,997,064,700 | Verifies and parses an unserialized raw message into an actual WAMP message instance.
:param wmsg: The unserialized raw message.
:type wmsg: list
:returns: An instance of this class. | ThirdParty/AutobahnPython/autobahn/wamp/message.py | parse | Crimson-MITK-ThirdParty/VTK-7.0.0 | python | @staticmethod
def parse(wmsg):
'\n Verifies and parses an unserialized raw message into an actual WAMP message instance.\n\n :param wmsg: The unserialized raw message.\n :type wmsg: list\n\n :returns: An instance of this class.\n '
assert ((len(wmsg) > 0) and (wmsg[0] == Yield.MESSAGE_T... |
def marshal(self):
'\n Implements :func:`autobahn.wamp.interfaces.IMessage.marshal`\n '
options = {}
if (self.progress is not None):
options[u'progress'] = self.progress
if self.kwargs:
return [Yield.MESSAGE_TYPE, self.request, options, self.args, self.kwargs]
elif self.arg... | 7,874,992,123,354,696,000 | Implements :func:`autobahn.wamp.interfaces.IMessage.marshal` | ThirdParty/AutobahnPython/autobahn/wamp/message.py | marshal | Crimson-MITK-ThirdParty/VTK-7.0.0 | python | def marshal(self):
'\n \n '
options = {}
if (self.progress is not None):
options[u'progress'] = self.progress
if self.kwargs:
return [Yield.MESSAGE_TYPE, self.request, options, self.args, self.kwargs]
elif self.args:
return [Yield.MESSAGE_TYPE, self.request, options... |
def __str__(self):
'\n Implements :func:`autobahn.wamp.interfaces.IMessage.__str__`\n '
return 'WAMP YIELD Message (request = {0}, args = {1}, kwargs = {2}, progress = {3})'.format(self.request, self.args, self.kwargs, self.progress) | -8,893,411,419,016,217,000 | Implements :func:`autobahn.wamp.interfaces.IMessage.__str__` | ThirdParty/AutobahnPython/autobahn/wamp/message.py | __str__ | Crimson-MITK-ThirdParty/VTK-7.0.0 | python | def __str__(self):
'\n \n '
return 'WAMP YIELD Message (request = {0}, args = {1}, kwargs = {2}, progress = {3})'.format(self.request, self.args, self.kwargs, self.progress) |
def __init__(self, reason=ErrorReason.NO_ERROR, error_code=None, error_detail=''):
' Constructs a DISCONNECT-State with given reason (``ErrorReason``\n enum), error id and additional information provided as string.\n\n '
self._error_code = error_code
self._error_detail = error_detail
self.... | -836,847,888,539,756,000 | Constructs a DISCONNECT-State with given reason (``ErrorReason``
enum), error id and additional information provided as string. | bokeh/client/states.py | __init__ | lvcarlosja/bokeh | python | def __init__(self, reason=ErrorReason.NO_ERROR, error_code=None, error_detail=):
' Constructs a DISCONNECT-State with given reason (``ErrorReason``\n enum), error id and additional information provided as string.\n\n '
self._error_code = error_code
self._error_detail = error_detail
self._e... |
@property
def error_reason(self):
' The reason for the error encoded as an enumeration value.\n\n '
return self._error_reason | -655,606,898,689,896,000 | The reason for the error encoded as an enumeration value. | bokeh/client/states.py | error_reason | lvcarlosja/bokeh | python | @property
def error_reason(self):
' \n\n '
return self._error_reason |
@property
def error_code(self):
' Holds the error code, if any. None otherwise.\n\n '
return self._error_code | -963,558,839,673,669,000 | Holds the error code, if any. None otherwise. | bokeh/client/states.py | error_code | lvcarlosja/bokeh | python | @property
def error_code(self):
' \n\n '
return self._error_code |
@property
def error_detail(self):
' Holds the error message, if any. Empty string otherwise.\n\n '
return self._error_detail | -3,810,004,267,138,733,000 | Holds the error message, if any. Empty string otherwise. | bokeh/client/states.py | error_detail | lvcarlosja/bokeh | python | @property
def error_detail(self):
' \n\n '
return self._error_detail |
@property
def reply(self):
' The reply from the server. (``None`` until the reply arrives) '
return self._reply | -7,536,372,399,029,573,000 | The reply from the server. (``None`` until the reply arrives) | bokeh/client/states.py | reply | lvcarlosja/bokeh | python | @property
def reply(self):
' '
return self._reply |
@property
def reqid(self):
' The request ID of the originating message. '
return self._reqid | 2,244,517,005,024,000,300 | The request ID of the originating message. | bokeh/client/states.py | reqid | lvcarlosja/bokeh | python | @property
def reqid(self):
' '
return self._reqid |
@nb.njit(parallel=True)
def _snn_imp(ind, ref_set_):
'Internal function for fast snn calculation\n\n Parameters\n ----------\n ind : int\n Indices return by kNN.\n\n ref_set_ : int, optional (default=10)\n specifies the number of shared nearest neighbors to create the\n reference se... | 3,596,093,814,803,237,000 | Internal function for fast snn calculation
Parameters
----------
ind : int
Indices return by kNN.
ref_set_ : int, optional (default=10)
specifies the number of shared nearest neighbors to create the
reference set. Note that ref_set must be smaller than n_neighbors. | pyod/models/sod.py | _snn_imp | BillyGareth/pyod | python | @nb.njit(parallel=True)
def _snn_imp(ind, ref_set_):
'Internal function for fast snn calculation\n\n Parameters\n ----------\n ind : int\n Indices return by kNN.\n\n ref_set_ : int, optional (default=10)\n specifies the number of shared nearest neighbors to create the\n reference se... |
def fit(self, X, y=None):
'Fit detector. y is ignored in unsupervised methods.\n\n Parameters\n ----------\n X : numpy array of shape (n_samples, n_features)\n The input samples.\n\n y : Ignored\n Not used, present for API consistency by convention.\n\n Retur... | 4,795,284,134,973,060,000 | Fit detector. y is ignored in unsupervised methods.
Parameters
----------
X : numpy array of shape (n_samples, n_features)
The input samples.
y : Ignored
Not used, present for API consistency by convention.
Returns
-------
self : object
Fitted estimator. | pyod/models/sod.py | fit | BillyGareth/pyod | python | def fit(self, X, y=None):
'Fit detector. y is ignored in unsupervised methods.\n\n Parameters\n ----------\n X : numpy array of shape (n_samples, n_features)\n The input samples.\n\n y : Ignored\n Not used, present for API consistency by convention.\n\n Retur... |
def decision_function(self, X):
'Predict raw anomaly score of X using the fitted detector.\n The anomaly score of an input sample is computed based on different\n detector algorithms. For consistency, outliers are assigned with\n larger anomaly scores.\n\n Parameters\n ----------\... | -6,096,792,183,057,632,000 | Predict raw anomaly score of X using the fitted detector.
The anomaly score of an input sample is computed based on different
detector algorithms. For consistency, outliers are assigned with
larger anomaly scores.
Parameters
----------
X : numpy array of shape (n_samples, n_features)
The training input samples. Sp... | pyod/models/sod.py | decision_function | BillyGareth/pyod | python | def decision_function(self, X):
'Predict raw anomaly score of X using the fitted detector.\n The anomaly score of an input sample is computed based on different\n detector algorithms. For consistency, outliers are assigned with\n larger anomaly scores.\n\n Parameters\n ----------\... |
def _snn(self, X):
'This function is called internally to calculate the shared nearest\n neighbors (SNN). SNN is reported to be more robust than k nearest\n neighbors.\n\n Returns\n -------\n snn_indices : numpy array of shape (n_shared_nearest_neighbors,)\n The indices... | -7,087,107,546,413,116,000 | This function is called internally to calculate the shared nearest
neighbors (SNN). SNN is reported to be more robust than k nearest
neighbors.
Returns
-------
snn_indices : numpy array of shape (n_shared_nearest_neighbors,)
The indices of top k shared nearest neighbors for each observation. | pyod/models/sod.py | _snn | BillyGareth/pyod | python | def _snn(self, X):
'This function is called internally to calculate the shared nearest\n neighbors (SNN). SNN is reported to be more robust than k nearest\n neighbors.\n\n Returns\n -------\n snn_indices : numpy array of shape (n_shared_nearest_neighbors,)\n The indices... |
def _sod(self, X):
'This function is called internally to perform subspace outlier \n detection algorithm.\n \n Returns\n -------\n anomaly_scores : numpy array of shape (n_samples,)\n The anomaly score of the input samples.\n '
ref_inds = self._snn(X)
an... | 1,585,102,162,273,630,700 | This function is called internally to perform subspace outlier
detection algorithm.
Returns
-------
anomaly_scores : numpy array of shape (n_samples,)
The anomaly score of the input samples. | pyod/models/sod.py | _sod | BillyGareth/pyod | python | def _sod(self, X):
'This function is called internally to perform subspace outlier \n detection algorithm.\n \n Returns\n -------\n anomaly_scores : numpy array of shape (n_samples,)\n The anomaly score of the input samples.\n '
ref_inds = self._snn(X)
an... |
@pytest.mark.nondestructive
def test_feedback_can_be_filtered_by_all_products_and_versions(self, mozwebqa):
"Tests product filtering in dashboard\n\n 1. Verify that at least one product exists\n 2. Verify that filtering by product returns results\n 3. Verify that versions show up when you choos... | -7,117,533,594,935,297,000 | Tests product filtering in dashboard
1. Verify that at least one product exists
2. Verify that filtering by product returns results
3. Verify that versions show up when you choose a product
4. Verify that the state of the filters are correct after being applied
5. Verify product and version values in the URL
NB: We d... | smoketests/tests/dashboard/test_product_filter.py | test_feedback_can_be_filtered_by_all_products_and_versions | ANKIT-KS/fjord | python | @pytest.mark.nondestructive
def test_feedback_can_be_filtered_by_all_products_and_versions(self, mozwebqa):
"Tests product filtering in dashboard\n\n 1. Verify that at least one product exists\n 2. Verify that filtering by product returns results\n 3. Verify that versions show up when you choos... |
def make_instance(self, include_optional):
'Test RequestMethodConfig\n include_option is a boolean, when False only required\n params are included, when True both required and\n optional params are included '
if include_optional:
return RequestMethodConfig(action='0', er... | -448,022,077,382,581,440 | Test RequestMethodConfig
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included | clients/kratos/python/test/test_request_method_config.py | make_instance | Marcuzz/sdk | python | def make_instance(self, include_optional):
'Test RequestMethodConfig\n include_option is a boolean, when False only required\n params are included, when True both required and\n optional params are included '
if include_optional:
return RequestMethodConfig(action='0', er... |
def testRequestMethodConfig(self):
'Test RequestMethodConfig'
inst_req_only = self.make_instance(include_optional=False)
inst_req_and_optional = self.make_instance(include_optional=True) | -378,840,182,432,186,400 | Test RequestMethodConfig | clients/kratos/python/test/test_request_method_config.py | testRequestMethodConfig | Marcuzz/sdk | python | def testRequestMethodConfig(self):
inst_req_only = self.make_instance(include_optional=False)
inst_req_and_optional = self.make_instance(include_optional=True) |
def testV2beta1HorizontalPodAutoscaler(self):
'\n Test V2beta1HorizontalPodAutoscaler\n '
pass | 2,167,114,869,670,492,000 | Test V2beta1HorizontalPodAutoscaler | kubernetes/test/test_v2beta1_horizontal_pod_autoscaler.py | testV2beta1HorizontalPodAutoscaler | TokkoLabs/client-python | python | def testV2beta1HorizontalPodAutoscaler(self):
'\n \n '
pass |
def powerset(iterable):
'powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)'
s = list(iterable)
return chain.from_iterable((combinations(s, r) for r in range((len(s) + 1)))) | 4,877,089,489,311,841,000 | powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3) | DiffractionClassifierCombinatorial2.0.py | powerset | MatthewGong/DiffractionClassification | python | def powerset(iterable):
s = list(iterable)
return chain.from_iterable((combinations(s, r) for r in range((len(s) + 1)))) |
@pytest.mark.usefixtures('hass_history')
def test_setup():
'Test setup method of history.'
pass | 8,167,136,447,770,618,000 | Test setup method of history. | tests/components/history/test_init.py | test_setup | 0xFEEDC0DE64/homeassistant-core | python | @pytest.mark.usefixtures('hass_history')
def test_setup():
pass |
def test_get_significant_states(hass_history):
'Test that only significant states are returned.\n\n We should get back every thermostat change that\n includes an attribute change, but only the state updates for\n media player (attribute changes are not significant and not returned).\n '
hass = hass_... | 67,503,898,248,999,780 | Test that only significant states are returned.
We should get back every thermostat change that
includes an attribute change, but only the state updates for
media player (attribute changes are not significant and not returned). | tests/components/history/test_init.py | test_get_significant_states | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states(hass_history):
'Test that only significant states are returned.\n\n We should get back every thermostat change that\n includes an attribute change, but only the state updates for\n media player (attribute changes are not significant and not returned).\n '
hass = hass_... |
def test_get_significant_states_minimal_response(hass_history):
'Test that only significant states are returned.\n\n When minimal responses is set only the first and\n last states return a complete state.\n\n We should get back every thermostat change that\n includes an attribute change, but only the st... | 3,880,872,984,299,671,600 | Test that only significant states are returned.
When minimal responses is set only the first and
last states return a complete state.
We should get back every thermostat change that
includes an attribute change, but only the state updates for
media player (attribute changes are not significant and not returned). | tests/components/history/test_init.py | test_get_significant_states_minimal_response | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_minimal_response(hass_history):
'Test that only significant states are returned.\n\n When minimal responses is set only the first and\n last states return a complete state.\n\n We should get back every thermostat change that\n includes an attribute change, but only the st... |
def test_get_significant_states_with_initial(hass_history):
'Test that only significant states are returned.\n\n We should get back every thermostat change that\n includes an attribute change, but only the state updates for\n media player (attribute changes are not significant and not returned).\n '
... | -51,942,831,712,115,750 | Test that only significant states are returned.
We should get back every thermostat change that
includes an attribute change, but only the state updates for
media player (attribute changes are not significant and not returned). | tests/components/history/test_init.py | test_get_significant_states_with_initial | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_with_initial(hass_history):
'Test that only significant states are returned.\n\n We should get back every thermostat change that\n includes an attribute change, but only the state updates for\n media player (attribute changes are not significant and not returned).\n '
... |
def test_get_significant_states_without_initial(hass_history):
'Test that only significant states are returned.\n\n We should get back every thermostat change that\n includes an attribute change, but only the state updates for\n media player (attribute changes are not significant and not returned).\n '
... | -2,799,910,346,006,164,500 | Test that only significant states are returned.
We should get back every thermostat change that
includes an attribute change, but only the state updates for
media player (attribute changes are not significant and not returned). | tests/components/history/test_init.py | test_get_significant_states_without_initial | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_without_initial(hass_history):
'Test that only significant states are returned.\n\n We should get back every thermostat change that\n includes an attribute change, but only the state updates for\n media player (attribute changes are not significant and not returned).\n '
... |
def test_get_significant_states_entity_id(hass_history):
'Test that only significant states are returned for one entity.'
hass = hass_history
(zero, four, states) = record_states(hass)
del states['media_player.test2']
del states['media_player.test3']
del states['thermostat.test']
del states[... | -4,269,895,489,921,417,000 | Test that only significant states are returned for one entity. | tests/components/history/test_init.py | test_get_significant_states_entity_id | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_entity_id(hass_history):
hass = hass_history
(zero, four, states) = record_states(hass)
del states['media_player.test2']
del states['media_player.test3']
del states['thermostat.test']
del states['thermostat.test2']
del states['script.can_cancel_this_one']... |
def test_get_significant_states_multiple_entity_ids(hass_history):
'Test that only significant states are returned for one entity.'
hass = hass_history
(zero, four, states) = record_states(hass)
del states['media_player.test2']
del states['media_player.test3']
del states['thermostat.test2']
... | -3,067,380,156,919,801,300 | Test that only significant states are returned for one entity. | tests/components/history/test_init.py | test_get_significant_states_multiple_entity_ids | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_multiple_entity_ids(hass_history):
hass = hass_history
(zero, four, states) = record_states(hass)
del states['media_player.test2']
del states['media_player.test3']
del states['thermostat.test2']
del states['script.can_cancel_this_one']
hist = get_signific... |
def test_get_significant_states_exclude_domain(hass_history):
'Test if significant states are returned when excluding domains.\n\n We should get back every thermostat change that includes an attribute\n change, but no media player changes.\n '
hass = hass_history
(zero, four, states) = record_state... | -3,757,802,504,288,435,000 | Test if significant states are returned when excluding domains.
We should get back every thermostat change that includes an attribute
change, but no media player changes. | tests/components/history/test_init.py | test_get_significant_states_exclude_domain | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_exclude_domain(hass_history):
'Test if significant states are returned when excluding domains.\n\n We should get back every thermostat change that includes an attribute\n change, but no media player changes.\n '
hass = hass_history
(zero, four, states) = record_state... |
def test_get_significant_states_exclude_entity(hass_history):
'Test if significant states are returned when excluding entities.\n\n We should get back every thermostat and script changes, but no media\n player changes.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del state... | 3,971,508,263,900,700,000 | Test if significant states are returned when excluding entities.
We should get back every thermostat and script changes, but no media
player changes. | tests/components/history/test_init.py | test_get_significant_states_exclude_entity | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_exclude_entity(hass_history):
'Test if significant states are returned when excluding entities.\n\n We should get back every thermostat and script changes, but no media\n player changes.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del state... |
def test_get_significant_states_exclude(hass_history):
'Test significant states when excluding entities and domains.\n\n We should not get back every thermostat and media player test changes.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del states['media_player.test']
del... | 3,192,773,205,326,326,300 | Test significant states when excluding entities and domains.
We should not get back every thermostat and media player test changes. | tests/components/history/test_init.py | test_get_significant_states_exclude | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_exclude(hass_history):
'Test significant states when excluding entities and domains.\n\n We should not get back every thermostat and media player test changes.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del states['media_player.test']
del... |
def test_get_significant_states_exclude_include_entity(hass_history):
'Test significant states when excluding domains and include entities.\n\n We should not get back every thermostat and media player test changes.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del states['medi... | 7,050,712,471,915,617,000 | Test significant states when excluding domains and include entities.
We should not get back every thermostat and media player test changes. | tests/components/history/test_init.py | test_get_significant_states_exclude_include_entity | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_exclude_include_entity(hass_history):
'Test significant states when excluding domains and include entities.\n\n We should not get back every thermostat and media player test changes.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del states['medi... |
def test_get_significant_states_include_domain(hass_history):
'Test if significant states are returned when including domains.\n\n We should get back every thermostat and script changes, but no media\n player changes.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del states... | 9,085,175,532,555,936,000 | Test if significant states are returned when including domains.
We should get back every thermostat and script changes, but no media
player changes. | tests/components/history/test_init.py | test_get_significant_states_include_domain | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_include_domain(hass_history):
'Test if significant states are returned when including domains.\n\n We should get back every thermostat and script changes, but no media\n player changes.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del states... |
def test_get_significant_states_include_entity(hass_history):
'Test if significant states are returned when including entities.\n\n We should only get back changes of the media_player.test entity.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del states['media_player.test2']
... | -5,447,694,962,693,634,000 | Test if significant states are returned when including entities.
We should only get back changes of the media_player.test entity. | tests/components/history/test_init.py | test_get_significant_states_include_entity | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_include_entity(hass_history):
'Test if significant states are returned when including entities.\n\n We should only get back changes of the media_player.test entity.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del states['media_player.test2']
... |
def test_get_significant_states_include(hass_history):
'Test significant states when including domains and entities.\n\n We should only get back changes of the media_player.test entity and the\n thermostat domain.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del states['me... | -141,893,945,454,664,540 | Test significant states when including domains and entities.
We should only get back changes of the media_player.test entity and the
thermostat domain. | tests/components/history/test_init.py | test_get_significant_states_include | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_include(hass_history):
'Test significant states when including domains and entities.\n\n We should only get back changes of the media_player.test entity and the\n thermostat domain.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del states['me... |
def test_get_significant_states_include_exclude_domain(hass_history):
'Test if significant states when excluding and including domains.\n\n We should not get back any changes since we include only the\n media_player domain but also exclude it.\n '
hass = hass_history
(zero, four, states) = record_s... | 7,043,021,192,306,241,000 | Test if significant states when excluding and including domains.
We should not get back any changes since we include only the
media_player domain but also exclude it. | tests/components/history/test_init.py | test_get_significant_states_include_exclude_domain | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_include_exclude_domain(hass_history):
'Test if significant states when excluding and including domains.\n\n We should not get back any changes since we include only the\n media_player domain but also exclude it.\n '
hass = hass_history
(zero, four, states) = record_s... |
def test_get_significant_states_include_exclude_entity(hass_history):
'Test if significant states when excluding and including domains.\n\n We should not get back any changes since we include only\n media_player.test but also exclude it.\n '
hass = hass_history
(zero, four, states) = record_states(... | -5,239,096,581,611,082,000 | Test if significant states when excluding and including domains.
We should not get back any changes since we include only
media_player.test but also exclude it. | tests/components/history/test_init.py | test_get_significant_states_include_exclude_entity | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_include_exclude_entity(hass_history):
'Test if significant states when excluding and including domains.\n\n We should not get back any changes since we include only\n media_player.test but also exclude it.\n '
hass = hass_history
(zero, four, states) = record_states(... |
def test_get_significant_states_include_exclude(hass_history):
'Test if significant states when in/excluding domains and entities.\n\n We should only get back changes of the media_player.test2 entity.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del states['media_player.test'... | 8,020,534,561,754,422,000 | Test if significant states when in/excluding domains and entities.
We should only get back changes of the media_player.test2 entity. | tests/components/history/test_init.py | test_get_significant_states_include_exclude | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_include_exclude(hass_history):
'Test if significant states when in/excluding domains and entities.\n\n We should only get back changes of the media_player.test2 entity.\n '
hass = hass_history
(zero, four, states) = record_states(hass)
del states['media_player.test'... |
def test_get_significant_states_are_ordered(hass_history):
'Test order of results from get_significant_states.\n\n When entity ids are given, the results should be returned with the data\n in the same order.\n '
hass = hass_history
(zero, four, _states) = record_states(hass)
entity_ids = ['medi... | 3,752,378,976,877,303,000 | Test order of results from get_significant_states.
When entity ids are given, the results should be returned with the data
in the same order. | tests/components/history/test_init.py | test_get_significant_states_are_ordered | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_are_ordered(hass_history):
'Test order of results from get_significant_states.\n\n When entity ids are given, the results should be returned with the data\n in the same order.\n '
hass = hass_history
(zero, four, _states) = record_states(hass)
entity_ids = ['medi... |
def test_get_significant_states_only(hass_history):
'Test significant states when significant_states_only is set.'
hass = hass_history
entity_id = 'sensor.test'
def set_state(state, **kwargs):
'Set the state.'
hass.states.set(entity_id, state, **kwargs)
wait_recording_done(hass)... | -7,254,696,558,611,209,000 | Test significant states when significant_states_only is set. | tests/components/history/test_init.py | test_get_significant_states_only | 0xFEEDC0DE64/homeassistant-core | python | def test_get_significant_states_only(hass_history):
hass = hass_history
entity_id = 'sensor.test'
def set_state(state, **kwargs):
'Set the state.'
hass.states.set(entity_id, state, **kwargs)
wait_recording_done(hass)
return hass.states.get(entity_id)
start = (dt_uti... |
def check_significant_states(hass, zero, four, states, config):
'Check if significant states are retrieved.'
filters = history.Filters()
exclude = config[history.DOMAIN].get(history.CONF_EXCLUDE)
if exclude:
filters.excluded_entities = exclude.get(history.CONF_ENTITIES, [])
filters.exclu... | -1,065,899,980,731,391,900 | Check if significant states are retrieved. | tests/components/history/test_init.py | check_significant_states | 0xFEEDC0DE64/homeassistant-core | python | def check_significant_states(hass, zero, four, states, config):
filters = history.Filters()
exclude = config[history.DOMAIN].get(history.CONF_EXCLUDE)
if exclude:
filters.excluded_entities = exclude.get(history.CONF_ENTITIES, [])
filters.excluded_domains = exclude.get(history.CONF_DOMAI... |
def record_states(hass):
'Record some test states.\n\n We inject a bunch of state updates from media player, zone and\n thermostat.\n '
mp = 'media_player.test'
mp2 = 'media_player.test2'
mp3 = 'media_player.test3'
therm = 'thermostat.test'
therm2 = 'thermostat.test2'
zone = 'zone.h... | -3,874,515,981,259,733,500 | Record some test states.
We inject a bunch of state updates from media player, zone and
thermostat. | tests/components/history/test_init.py | record_states | 0xFEEDC0DE64/homeassistant-core | python | def record_states(hass):
'Record some test states.\n\n We inject a bunch of state updates from media player, zone and\n thermostat.\n '
mp = 'media_player.test'
mp2 = 'media_player.test2'
mp3 = 'media_player.test3'
therm = 'thermostat.test'
therm2 = 'thermostat.test2'
zone = 'zone.h... |
async def test_fetch_period_api(hass, hass_client):
'Test the fetch period view for history.'
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {}))
(await hass.async_add_executor_job(hass.data[recorder.DATA_INSTANCE].block_till_done))
c... | 6,506,475,214,613,486,000 | Test the fetch period view for history. | tests/components/history/test_init.py | test_fetch_period_api | 0xFEEDC0DE64/homeassistant-core | python | async def test_fetch_period_api(hass, hass_client):
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {}))
(await hass.async_add_executor_job(hass.data[recorder.DATA_INSTANCE].block_till_done))
client = (await hass_client())
respons... |
async def test_fetch_period_api_with_use_include_order(hass, hass_client):
'Test the fetch period view for history with include order.'
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {history.DOMAIN: {history.CONF_ORDER: True}}))
(await h... | -6,330,643,641,254,782,000 | Test the fetch period view for history with include order. | tests/components/history/test_init.py | test_fetch_period_api_with_use_include_order | 0xFEEDC0DE64/homeassistant-core | python | async def test_fetch_period_api_with_use_include_order(hass, hass_client):
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {history.DOMAIN: {history.CONF_ORDER: True}}))
(await hass.async_add_executor_job(hass.data[recorder.DATA_INSTANCE]... |
async def test_fetch_period_api_with_minimal_response(hass, hass_client):
'Test the fetch period view for history with minimal_response.'
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {}))
(await hass.async_add_executor_job(hass.data[rec... | 8,299,730,011,576,794,000 | Test the fetch period view for history with minimal_response. | tests/components/history/test_init.py | test_fetch_period_api_with_minimal_response | 0xFEEDC0DE64/homeassistant-core | python | async def test_fetch_period_api_with_minimal_response(hass, hass_client):
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {}))
(await hass.async_add_executor_job(hass.data[recorder.DATA_INSTANCE].block_till_done))
client = (await hass... |
async def test_fetch_period_api_with_no_timestamp(hass, hass_client):
'Test the fetch period view for history with no timestamp.'
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {}))
(await hass.async_add_executor_job(hass.data[recorder.DA... | 4,203,735,023,861,239,000 | Test the fetch period view for history with no timestamp. | tests/components/history/test_init.py | test_fetch_period_api_with_no_timestamp | 0xFEEDC0DE64/homeassistant-core | python | async def test_fetch_period_api_with_no_timestamp(hass, hass_client):
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {}))
(await hass.async_add_executor_job(hass.data[recorder.DATA_INSTANCE].block_till_done))
client = (await hass_cli... |
async def test_fetch_period_api_with_include_order(hass, hass_client):
'Test the fetch period view for history.'
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {'use_include_order': True, 'include': {'entities': ['light.kitchen']}... | 736,123,220,836,228,400 | Test the fetch period view for history. | tests/components/history/test_init.py | test_fetch_period_api_with_include_order | 0xFEEDC0DE64/homeassistant-core | python | async def test_fetch_period_api_with_include_order(hass, hass_client):
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {'use_include_order': True, 'include': {'entities': ['light.kitchen']}}}))
(await hass.async_add_executor_j... |
async def test_fetch_period_api_with_entity_glob_include(hass, hass_client):
'Test the fetch period view for history.'
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {'include': {'entity_globs': ['light.k*']}}}))
(await hass.a... | -7,447,962,861,008,547,000 | Test the fetch period view for history. | tests/components/history/test_init.py | test_fetch_period_api_with_entity_glob_include | 0xFEEDC0DE64/homeassistant-core | python | async def test_fetch_period_api_with_entity_glob_include(hass, hass_client):
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {'include': {'entity_globs': ['light.k*']}}}))
(await hass.async_add_executor_job(hass.data[recorder.... |
async def test_fetch_period_api_with_entity_glob_exclude(hass, hass_client):
'Test the fetch period view for history.'
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {'exclude': {'entity_globs': ['light.k*'], 'domains': 'switch', ... | 135,551,110,886,820,420 | Test the fetch period view for history. | tests/components/history/test_init.py | test_fetch_period_api_with_entity_glob_exclude | 0xFEEDC0DE64/homeassistant-core | python | async def test_fetch_period_api_with_entity_glob_exclude(hass, hass_client):
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {'exclude': {'entity_globs': ['light.k*'], 'domains': 'switch', 'entities': 'media_player.test'}}}))
... |
async def test_fetch_period_api_with_entity_glob_include_and_exclude(hass, hass_client):
'Test the fetch period view for history.'
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {'exclude': {'entity_globs': ['light.many*']}, 'incl... | -8,475,201,651,002,755,000 | Test the fetch period view for history. | tests/components/history/test_init.py | test_fetch_period_api_with_entity_glob_include_and_exclude | 0xFEEDC0DE64/homeassistant-core | python | async def test_fetch_period_api_with_entity_glob_include_and_exclude(hass, hass_client):
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {'exclude': {'entity_globs': ['light.many*']}, 'include': {'entity_globs': ['light.m*'], 'dom... |
async def test_entity_ids_limit_via_api(hass, hass_client):
'Test limiting history to entity_ids.'
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {}}))
(await hass.async_add_executor_job(hass.data[recorder.DATA_INSTANCE].block... | -7,036,330,779,186,314,000 | Test limiting history to entity_ids. | tests/components/history/test_init.py | test_entity_ids_limit_via_api | 0xFEEDC0DE64/homeassistant-core | python | async def test_entity_ids_limit_via_api(hass, hass_client):
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {}}))
(await hass.async_add_executor_job(hass.data[recorder.DATA_INSTANCE].block_till_done))
hass.states.async_set... |
async def test_entity_ids_limit_via_api_with_skip_initial_state(hass, hass_client):
'Test limiting history to entity_ids with skip_initial_state.'
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {}}))
(await hass.async_add_exec... | 503,860,346,723,174,000 | Test limiting history to entity_ids with skip_initial_state. | tests/components/history/test_init.py | test_entity_ids_limit_via_api_with_skip_initial_state | 0xFEEDC0DE64/homeassistant-core | python | async def test_entity_ids_limit_via_api_with_skip_initial_state(hass, hass_client):
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {}}))
(await hass.async_add_executor_job(hass.data[recorder.DATA_INSTANCE].block_till_done))
... |
@pytest.mark.parametrize('units, attributes, state, value', [(IMPERIAL_SYSTEM, POWER_SENSOR_ATTRIBUTES, 10, 10000), (METRIC_SYSTEM, POWER_SENSOR_ATTRIBUTES, 10, 10000), (IMPERIAL_SYSTEM, TEMPERATURE_SENSOR_ATTRIBUTES, 10, 50), (METRIC_SYSTEM, TEMPERATURE_SENSOR_ATTRIBUTES, 10, 10), (IMPERIAL_SYSTEM, PRESSURE_SENSOR_ATT... | -1,807,136,049,217,268,700 | Test statistics_during_period. | tests/components/history/test_init.py | test_statistics_during_period | 0xFEEDC0DE64/homeassistant-core | python | @pytest.mark.parametrize('units, attributes, state, value', [(IMPERIAL_SYSTEM, POWER_SENSOR_ATTRIBUTES, 10, 10000), (METRIC_SYSTEM, POWER_SENSOR_ATTRIBUTES, 10, 10000), (IMPERIAL_SYSTEM, TEMPERATURE_SENSOR_ATTRIBUTES, 10, 50), (METRIC_SYSTEM, TEMPERATURE_SENSOR_ATTRIBUTES, 10, 10), (IMPERIAL_SYSTEM, PRESSURE_SENSOR_ATT... |
async def test_statistics_during_period_bad_start_time(hass, hass_ws_client):
'Test statistics_during_period.'
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {}}))
(await hass.async_add_executor_job(hass.data[recorder.DATA_INS... | -1,543,574,318,116,338,400 | Test statistics_during_period. | tests/components/history/test_init.py | test_statistics_during_period_bad_start_time | 0xFEEDC0DE64/homeassistant-core | python | async def test_statistics_during_period_bad_start_time(hass, hass_ws_client):
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {}}))
(await hass.async_add_executor_job(hass.data[recorder.DATA_INSTANCE].block_till_done))
cli... |
async def test_statistics_during_period_bad_end_time(hass, hass_ws_client):
'Test statistics_during_period.'
now = dt_util.utcnow()
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {}}))
(await hass.async_add_executor_job(ha... | -7,029,948,967,809,684,000 | Test statistics_during_period. | tests/components/history/test_init.py | test_statistics_during_period_bad_end_time | 0xFEEDC0DE64/homeassistant-core | python | async def test_statistics_during_period_bad_end_time(hass, hass_ws_client):
now = dt_util.utcnow()
(await hass.async_add_executor_job(init_recorder_component, hass))
(await async_setup_component(hass, 'history', {'history': {}}))
(await hass.async_add_executor_job(hass.data[recorder.DATA_INSTANCE].... |
@pytest.mark.parametrize('units, attributes, unit', [(IMPERIAL_SYSTEM, POWER_SENSOR_ATTRIBUTES, 'W'), (METRIC_SYSTEM, POWER_SENSOR_ATTRIBUTES, 'W'), (IMPERIAL_SYSTEM, TEMPERATURE_SENSOR_ATTRIBUTES, '°F'), (METRIC_SYSTEM, TEMPERATURE_SENSOR_ATTRIBUTES, '°C'), (IMPERIAL_SYSTEM, PRESSURE_SENSOR_ATTRIBUTES, 'psi'), (METRIC... | -4,831,477,666,152,909,000 | Test list_statistic_ids. | tests/components/history/test_init.py | test_list_statistic_ids | 0xFEEDC0DE64/homeassistant-core | python | @pytest.mark.parametrize('units, attributes, unit', [(IMPERIAL_SYSTEM, POWER_SENSOR_ATTRIBUTES, 'W'), (METRIC_SYSTEM, POWER_SENSOR_ATTRIBUTES, 'W'), (IMPERIAL_SYSTEM, TEMPERATURE_SENSOR_ATTRIBUTES, '°F'), (METRIC_SYSTEM, TEMPERATURE_SENSOR_ATTRIBUTES, '°C'), (IMPERIAL_SYSTEM, PRESSURE_SENSOR_ATTRIBUTES, 'psi'), (METRIC... |
def set_state(state, **kwargs):
'Set the state.'
hass.states.set(entity_id, state, **kwargs)
wait_recording_done(hass)
return hass.states.get(entity_id) | 8,959,891,338,023,652,000 | Set the state. | tests/components/history/test_init.py | set_state | 0xFEEDC0DE64/homeassistant-core | python | def set_state(state, **kwargs):
hass.states.set(entity_id, state, **kwargs)
wait_recording_done(hass)
return hass.states.get(entity_id) |
def set_state(entity_id, state, **kwargs):
'Set the state.'
hass.states.set(entity_id, state, **kwargs)
wait_recording_done(hass)
return hass.states.get(entity_id) | 960,452,124,161,646,300 | Set the state. | tests/components/history/test_init.py | set_state | 0xFEEDC0DE64/homeassistant-core | python | def set_state(entity_id, state, **kwargs):
hass.states.set(entity_id, state, **kwargs)
wait_recording_done(hass)
return hass.states.get(entity_id) |
def test_xml_conversion(self):
"\n Test that converted XML hasn't changed from saved version.\n "
tree_string = StringIO.StringIO()
self.pdf.tree.write(tree_string, pretty_print=True, encoding='utf-8')
tree_string = tree_string.getvalue()
comparison_file = ('tests/saved_output/IRS_... | 8,067,755,005,227,209,000 | Test that converted XML hasn't changed from saved version. | tests/tests.py | test_xml_conversion | leeoniya/pdfquery | python | def test_xml_conversion(self):
"\n \n "
tree_string = StringIO.StringIO()
self.pdf.tree.write(tree_string, pretty_print=True, encoding='utf-8')
tree_string = tree_string.getvalue()
comparison_file = ('tests/saved_output/IRS_1040A_output%s.xml' % ('_python_2.6' if ((sys.version_info... |
def test_selectors(self):
'\n Test the :contains and :in_bbox selectors.\n '
label = self.pdf.pq('LTTextLineHorizontal:contains("Your first name and initial")')
self.assertEqual(len(label), 1)
left_corner = float(label.attr('x0'))
self.assertEqual(left_corner, 143.651)
bottom_c... | -5,185,528,845,370,750,000 | Test the :contains and :in_bbox selectors. | tests/tests.py | test_selectors | leeoniya/pdfquery | python | def test_selectors(self):
'\n \n '
label = self.pdf.pq('LTTextLineHorizontal:contains("Your first name and initial")')
self.assertEqual(len(label), 1)
left_corner = float(label.attr('x0'))
self.assertEqual(left_corner, 143.651)
bottom_corner = float(label.attr('y0'))
self.a... |
def test_extract(self):
'\n Test the extract() function.\n '
values = self.pdf.extract([('with_parent', 'LTPage[pageid="1"]'), ('with_formatter', 'text'), ('last_name', 'LTTextLineHorizontal:in_bbox("315,680,395,700")'), ('spouse', 'LTTextLineHorizontal:in_bbox("170,650,220,680")'), ('with_par... | 7,389,041,808,124,743,000 | Test the extract() function. | tests/tests.py | test_extract | leeoniya/pdfquery | python | def test_extract(self):
'\n \n '
values = self.pdf.extract([('with_parent', 'LTPage[pageid="1"]'), ('with_formatter', 'text'), ('last_name', 'LTTextLineHorizontal:in_bbox("315,680,395,700")'), ('spouse', 'LTTextLineHorizontal:in_bbox("170,650,220,680")'), ('with_parent', 'LTPage[pageid="2"]'),... |
def test_xml_conversion(self):
"\n Test that converted XML hasn't changed from saved version.\n "
tree_string = StringIO.StringIO()
self.pdf.tree.write(tree_string, pretty_print=True, encoding='utf-8')
tree_string = tree_string.getvalue()
comparison_file = 'tests/saved_output/bug28... | -5,659,162,527,995,697,000 | Test that converted XML hasn't changed from saved version. | tests/tests.py | test_xml_conversion | leeoniya/pdfquery | python | def test_xml_conversion(self):
"\n \n "
tree_string = StringIO.StringIO()
self.pdf.tree.write(tree_string, pretty_print=True, encoding='utf-8')
tree_string = tree_string.getvalue()
comparison_file = 'tests/saved_output/bug28.xml'
with open(comparison_file, 'rb') as f:
s... |
def run_episode(batch, agent_models, batch_size, testing, render=False, initial_agent=0):
'\n turning testing on means, we disable stochasticity: always pick the argmax\n '
s = State(**batch)
sieve = AliveSieve(batch_size=batch_size)
actions_by_timestep = []
alive_masks = []
rewards = torc... | 458,638,067,147,089,600 | turning testing on means, we disable stochasticity: always pick the argmax | src/ecn.py | run_episode | mnoukhov/ecn | python | def run_episode(batch, agent_models, batch_size, testing, render=False, initial_agent=0):
'\n \n '
s = State(**batch)
sieve = AliveSieve(batch_size=batch_size)
actions_by_timestep = []
alive_masks = []
rewards = torch.zeros(batch_size, 3, device=FLAGS.device)
num_steps = torch.full((ba... |
def safe_div(a, b):
'\n returns a / b, unless b is zero, in which case returns 0\n this is primarily for usage in cases where b might be systemtically zero, eg because comms are disabled or similar\n also accounts for a or b being tensors\n '
if isinstance(a, torch.Tensor):
a = a.item()
... | 3,609,836,066,754,855,400 | returns a / b, unless b is zero, in which case returns 0
this is primarily for usage in cases where b might be systemtically zero, eg because comms are disabled or similar
also accounts for a or b being tensors | src/ecn.py | safe_div | mnoukhov/ecn | python | def safe_div(a, b):
'\n returns a / b, unless b is zero, in which case returns 0\n this is primarily for usage in cases where b might be systemtically zero, eg because comms are disabled or similar\n also accounts for a or b being tensors\n '
if isinstance(a, torch.Tensor):
a = a.item()
... |
def run(args):
'\n testing option will:\n - use argmax, ie disable stochastic draws\n - not run optimizers\n - not save model\n '
if args.wandb:
if args.wandb_offline:
os.environ['WANDB_MODE'] = 'dryrun'
wandb.init(project='ecn', name=args.name, dir=f'{args.savedir}', ... | -173,498,744,607,043,500 | testing option will:
- use argmax, ie disable stochastic draws
- not run optimizers
- not save model | src/ecn.py | run | mnoukhov/ecn | python | def run(args):
'\n testing option will:\n - use argmax, ie disable stochastic draws\n - not run optimizers\n - not save model\n '
if args.wandb:
if args.wandb_offline:
os.environ['WANDB_MODE'] = 'dryrun'
wandb.init(project='ecn', name=args.name, dir=f'{args.savedir}', ... |
@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 ... | 6,119,635,577,640,988,000 | 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. | src/datadog_api_client/v2/model/security_filter_exclusion_filter.py | openapi_types | rchenzheng/datadog-api-client-python | 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, name, query, *args, **kwargs):
'SecurityFilterExclusionFilter - a model defined in OpenAPI\n\n Args:\n name (str): Exclusion filter name.\n query (str): Exclusion filter query. Logs that match this query are excluded from the security f... | 412,282,417,252,474,600 | SecurityFilterExclusionFilter - a model defined in OpenAPI
Args:
name (str): Exclusion filter name.
query (str): Exclusion filter query. Logs that match this query are excluded from the security filter.
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
... | src/datadog_api_client/v2/model/security_filter_exclusion_filter.py | __init__ | rchenzheng/datadog-api-client-python | python | @convert_js_args_to_python_args
def __init__(self, name, query, *args, **kwargs):
'SecurityFilterExclusionFilter - a model defined in OpenAPI\n\n Args:\n name (str): Exclusion filter name.\n query (str): Exclusion filter query. Logs that match this query are excluded from the security f... |
@property
def name(self):
'Plugin name\n \n Single word string describing the image format.\n Typical names: file, dicom, xnat\n '
return self.__name | -2,094,496,552,525,548,800 | Plugin name
Single word string describing the image format.
Typical names: file, dicom, xnat | src/imagedata/transports/abstracttransport.py | name | erling6232/imagedata | python | @property
def name(self):
'Plugin name\n \n Single word string describing the image format.\n Typical names: file, dicom, xnat\n '
return self.__name |
@property
def description(self):
'Plugin description\n \n Single line string describing the transport method.\n '
return self.__description | -8,066,041,259,654,710,000 | Plugin description
Single line string describing the transport method. | src/imagedata/transports/abstracttransport.py | description | erling6232/imagedata | python | @property
def description(self):
'Plugin description\n \n Single line string describing the transport method.\n '
return self.__description |
@property
def authors(self):
'Plugin authors\n \n Multi-line string naming the author(s) of the plugin.\n '
return self.__authors | 95,379,626,103,641,780 | Plugin authors
Multi-line string naming the author(s) of the plugin. | src/imagedata/transports/abstracttransport.py | authors | erling6232/imagedata | python | @property
def authors(self):
'Plugin authors\n \n Multi-line string naming the author(s) of the plugin.\n '
return self.__authors |
@property
def version(self):
'Plugin version\n \n String giving the plugin version.\n Version scheme: 1.0.0\n '
return self.__version | 1,751,831,071,949,942,000 | Plugin version
String giving the plugin version.
Version scheme: 1.0.0 | src/imagedata/transports/abstracttransport.py | version | erling6232/imagedata | python | @property
def version(self):
'Plugin version\n \n String giving the plugin version.\n Version scheme: 1.0.0\n '
return self.__version |
@property
def url(self):
'Plugin URL\n \n URL string to the site of the plugin or the author(s).\n '
return self.__url | -8,174,879,225,647,273,000 | Plugin URL
URL string to the site of the plugin or the author(s). | src/imagedata/transports/abstracttransport.py | url | erling6232/imagedata | python | @property
def url(self):
'Plugin URL\n \n URL string to the site of the plugin or the author(s).\n '
return self.__url |
@property
def schemes(self):
'List of transport schemes supported by this plugin.\n \n List of strings.\n '
return self.__schemes | 5,426,225,605,520,074,000 | List of transport schemes supported by this plugin.
List of strings. | src/imagedata/transports/abstracttransport.py | schemes | erling6232/imagedata | python | @property
def schemes(self):
'List of transport schemes supported by this plugin.\n \n List of strings.\n '
return self.__schemes |
@abstractmethod
def walk(self, top):
'Generate the file names in a directory tree by walking the tree.\n Input:\n - top: starting point for walk (str)\n Return:\n - tuples of (root, dirs, files) \n '
pass | -4,428,548,912,652,581,400 | Generate the file names in a directory tree by walking the tree.
Input:
- top: starting point for walk (str)
Return:
- tuples of (root, dirs, files) | src/imagedata/transports/abstracttransport.py | walk | erling6232/imagedata | python | @abstractmethod
def walk(self, top):
'Generate the file names in a directory tree by walking the tree.\n Input:\n - top: starting point for walk (str)\n Return:\n - tuples of (root, dirs, files) \n '
pass |
@abstractmethod
def isfile(self, path):
'Return True if path is an existing regular file.\n '
pass | -6,828,466,188,773,404,000 | Return True if path is an existing regular file. | src/imagedata/transports/abstracttransport.py | isfile | erling6232/imagedata | python | @abstractmethod
def isfile(self, path):
'\n '
pass |
@abstractmethod
def open(self, path, mode='r'):
'Extract a member from the archive as a file-like object.\n '
pass | 7,691,118,222,133,349,000 | Extract a member from the archive as a file-like object. | src/imagedata/transports/abstracttransport.py | open | erling6232/imagedata | python | @abstractmethod
def open(self, path, mode='r'):
'\n '
pass |
@abstractmethod
def close(self):
'Close the transport\n '
pass | 190,842,864,219,467,870 | Close the transport | src/imagedata/transports/abstracttransport.py | close | erling6232/imagedata | python | @abstractmethod
def close(self):
'\n '
pass |
@abstractmethod
def info(self, path) -> str:
'Return info describing the object\n\n Args:\n path (str): object path\n\n Returns:\n description (str): Preferably a one-line string describing the object\n '
pass | -3,224,270,684,163,788,300 | Return info describing the object
Args:
path (str): object path
Returns:
description (str): Preferably a one-line string describing the object | src/imagedata/transports/abstracttransport.py | info | erling6232/imagedata | python | @abstractmethod
def info(self, path) -> str:
'Return info describing the object\n\n Args:\n path (str): object path\n\n Returns:\n description (str): Preferably a one-line string describing the object\n '
pass |
def __init__(self, repository_structure=None, last_updated=None):
'TWCRepositoryInfoResponse - a model defined in OpenAPI'
self._repository_structure = None
self._last_updated = None
self.discriminator = None
self.repository_structure = repository_structure
self.last_updated = last_updated | 8,527,874,243,199,928,000 | TWCRepositoryInfoResponse - a model defined in OpenAPI | iqs_client/models/twc_repository_info_response.py | __init__ | thomas-bc/mms-autocref | python | def __init__(self, repository_structure=None, last_updated=None):
self._repository_structure = None
self._last_updated = None
self.discriminator = None
self.repository_structure = repository_structure
self.last_updated = last_updated |
@property
def repository_structure(self):
'Gets the repository_structure of this TWCRepositoryInfoResponse. # noqa: E501\n\n\n :return: The repository_structure of this TWCRepositoryInfoResponse. # noqa: E501\n :rtype: TWCRepositoryStructure\n '
return self._repository_structure | 7,800,254,736,595,410,000 | Gets the repository_structure of this TWCRepositoryInfoResponse. # noqa: E501
:return: The repository_structure of this TWCRepositoryInfoResponse. # noqa: E501
:rtype: TWCRepositoryStructure | iqs_client/models/twc_repository_info_response.py | repository_structure | thomas-bc/mms-autocref | python | @property
def repository_structure(self):
'Gets the repository_structure of this TWCRepositoryInfoResponse. # noqa: E501\n\n\n :return: The repository_structure of this TWCRepositoryInfoResponse. # noqa: E501\n :rtype: TWCRepositoryStructure\n '
return self._repository_structure |
@repository_structure.setter
def repository_structure(self, repository_structure):
'Sets the repository_structure of this TWCRepositoryInfoResponse.\n\n\n :param repository_structure: The repository_structure of this TWCRepositoryInfoResponse. # noqa: E501\n :type: TWCRepositoryStructure\n '
... | -1,284,167,347,242,605,600 | Sets the repository_structure of this TWCRepositoryInfoResponse.
:param repository_structure: The repository_structure of this TWCRepositoryInfoResponse. # noqa: E501
:type: TWCRepositoryStructure | iqs_client/models/twc_repository_info_response.py | repository_structure | thomas-bc/mms-autocref | python | @repository_structure.setter
def repository_structure(self, repository_structure):
'Sets the repository_structure of this TWCRepositoryInfoResponse.\n\n\n :param repository_structure: The repository_structure of this TWCRepositoryInfoResponse. # noqa: E501\n :type: TWCRepositoryStructure\n '
... |
@property
def last_updated(self):
'Gets the last_updated of this TWCRepositoryInfoResponse. # noqa: E501\n\n\n :return: The last_updated of this TWCRepositoryInfoResponse. # noqa: E501\n :rtype: str\n '
return self._last_updated | 5,827,634,590,501,253,000 | Gets the last_updated of this TWCRepositoryInfoResponse. # noqa: E501
:return: The last_updated of this TWCRepositoryInfoResponse. # noqa: E501
:rtype: str | iqs_client/models/twc_repository_info_response.py | last_updated | thomas-bc/mms-autocref | python | @property
def last_updated(self):
'Gets the last_updated of this TWCRepositoryInfoResponse. # noqa: E501\n\n\n :return: The last_updated of this TWCRepositoryInfoResponse. # noqa: E501\n :rtype: str\n '
return self._last_updated |
@last_updated.setter
def last_updated(self, last_updated):
'Sets the last_updated of this TWCRepositoryInfoResponse.\n\n\n :param last_updated: The last_updated of this TWCRepositoryInfoResponse. # noqa: E501\n :type: str\n '
if (last_updated is None):
raise ValueError('Invalid val... | -2,645,519,415,813,660,000 | Sets the last_updated of this TWCRepositoryInfoResponse.
:param last_updated: The last_updated of this TWCRepositoryInfoResponse. # noqa: E501
:type: str | iqs_client/models/twc_repository_info_response.py | last_updated | thomas-bc/mms-autocref | python | @last_updated.setter
def last_updated(self, last_updated):
'Sets the last_updated of this TWCRepositoryInfoResponse.\n\n\n :param last_updated: The last_updated of this TWCRepositoryInfoResponse. # noqa: E501\n :type: str\n '
if (last_updated is None):
raise ValueError('Invalid val... |
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 | iqs_client/models/twc_repository_info_response.py | to_dict | thomas-bc/mms-autocref | 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 | iqs_client/models/twc_repository_info_response.py | to_str | thomas-bc/mms-autocref | 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` | iqs_client/models/twc_repository_info_response.py | __repr__ | thomas-bc/mms-autocref | python | def __repr__(self):
return self.to_str() |
def __eq__(self, other):
'Returns true if both objects are equal'
if (not isinstance(other, TWCRepositoryInfoResponse)):
return False
return (self.__dict__ == other.__dict__) | -3,533,175,412,495,738,400 | Returns true if both objects are equal | iqs_client/models/twc_repository_info_response.py | __eq__ | thomas-bc/mms-autocref | python | def __eq__(self, other):
if (not isinstance(other, TWCRepositoryInfoResponse)):
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 | iqs_client/models/twc_repository_info_response.py | __ne__ | thomas-bc/mms-autocref | python | def __ne__(self, other):
return (not (self == other)) |
def visualize_scenario(scenario, cps=None):
'\n Creates an HTML visualization of the given scenario. Starts a simple web server at localhost:8000 (blocking).\n :param scenario: Either a list of worlds, each world representing a single scene or a single world representing a\n whole scenario\n :param cps:... | 3,352,478,717,109,895,000 | Creates an HTML visualization of the given scenario. Starts a simple web server at localhost:8000 (blocking).
:param scenario: Either a list of worlds, each world representing a single scene or a single world representing a
whole scenario
:param cps: A list of criticality phenomena which optionally to visualize as well... | auto/auto_visualizer/auto_visualizer.py | visualize_scenario | lu-w/criticality-recognition | python | def visualize_scenario(scenario, cps=None):
'\n Creates an HTML visualization of the given scenario. Starts a simple web server at localhost:8000 (blocking).\n :param scenario: Either a list of worlds, each world representing a single scene or a single world representing a\n whole scenario\n :param cps:... |
def _describe_entity(entity):
'\n Describes the given traffic entity as an HTML list.\n :param entity: An object of an owlready2 class.\n :return: The HTML-representation of entity.\n '
cls = phenomena_extraction.get_most_specific_classes([entity])
label = ('<table class="m-2"><thead><tr><th>Ind... | -1,019,858,865,922,286,700 | Describes the given traffic entity as an HTML list.
:param entity: An object of an owlready2 class.
:return: The HTML-representation of entity. | auto/auto_visualizer/auto_visualizer.py | _describe_entity | lu-w/criticality-recognition | python | def _describe_entity(entity):
'\n Describes the given traffic entity as an HTML list.\n :param entity: An object of an owlready2 class.\n :return: The HTML-representation of entity.\n '
cls = phenomena_extraction.get_most_specific_classes([entity])
label = ('<table class="m-2"><thead><tr><th>Ind... |
def _has_collision_with_bbs(existing_bbs, new_bb):
'\n Checks if the new rectangle (new_bb) collides with some existing rectangles.\n '
a_left = min([x[0] for x in new_bb])
a_right = max([x[0] for x in new_bb])
a_bottom = min([x[1] for x in new_bb])
a_top = max([x[1] for x in new_bb])
for ... | -1,134,844,941,343,210,500 | Checks if the new rectangle (new_bb) collides with some existing rectangles. | auto/auto_visualizer/auto_visualizer.py | _has_collision_with_bbs | lu-w/criticality-recognition | python | def _has_collision_with_bbs(existing_bbs, new_bb):
'\n \n '
a_left = min([x[0] for x in new_bb])
a_right = max([x[0] for x in new_bb])
a_bottom = min([x[1] for x in new_bb])
a_top = max([x[1] for x in new_bb])
for bb in existing_bbs:
b_left = min([x[0] for x in bb])
b_right... |
def testGetExtendedContactDetailsStatistics(self):
'Test GetExtendedContactDetailsStatistics'
pass | 5,856,506,985,205,901,000 | Test GetExtendedContactDetailsStatistics | test/test_get_extended_contact_details_statistics.py | testGetExtendedContactDetailsStatistics | Danilka/APIv3-python-library | python | def testGetExtendedContactDetailsStatistics(self):
pass |
def validate_method(self, method: Callable, params: Optional[Union[(list, dict)]], exclude: Iterable[str]=(), **kwargs: Any) -> Dict[(str, Any)]:
'\n Validates params against method using ``pydantic`` validator.\n\n :param method: method to validate parameters against\n :param params: parameter... | 1,600,686,918,532,966,700 | Validates params against method using ``pydantic`` validator.
:param method: method to validate parameters against
:param params: parameters to be validated
:param exclude: parameter names to be excluded from validation
:returns: coerced parameters if `coerce` flag is ``True`` otherwise parameters as is
:raises: Vali... | xjsonrpc/server/validators/pydantic.py | validate_method | bernhardkaindl/pjrpc | python | def validate_method(self, method: Callable, params: Optional[Union[(list, dict)]], exclude: Iterable[str]=(), **kwargs: Any) -> Dict[(str, Any)]:
'\n Validates params against method using ``pydantic`` validator.\n\n :param method: method to validate parameters against\n :param params: parameter... |
@ft.lru_cache(maxsize=None)
def build_validation_schema(self, signature: inspect.Signature) -> Dict[(str, Any)]:
'\n Builds pydantic model based validation schema from method signature.\n\n :param signature: method signature to build schema for\n :returns: validation schema\n '
field... | 773,218,417,402,197,600 | Builds pydantic model based validation schema from method signature.
:param signature: method signature to build schema for
:returns: validation schema | xjsonrpc/server/validators/pydantic.py | build_validation_schema | bernhardkaindl/pjrpc | python | @ft.lru_cache(maxsize=None)
def build_validation_schema(self, signature: inspect.Signature) -> Dict[(str, Any)]:
'\n Builds pydantic model based validation schema from method signature.\n\n :param signature: method signature to build schema for\n :returns: validation schema\n '
field... |
def enum_lookup(enum_type_name: str, value: int) -> str:
'return a string which is the short name of the enum value\n (truncating off the common prefix) '
fields = sdb.get_type(enum_type_name).type.enumerators
enum_string: str = fields[value].name
prefix = os.path.commonprefix([f[0] for f in fields])... | 3,412,445,798,018,359,300 | return a string which is the short name of the enum value
(truncating off the common prefix) | sdb/commands/zfs/internal/__init__.py | enum_lookup | PaulZ-98/sdb | python | def enum_lookup(enum_type_name: str, value: int) -> str:
'return a string which is the short name of the enum value\n (truncating off the common prefix) '
fields = sdb.get_type(enum_type_name).type.enumerators
enum_string: str = fields[value].name
prefix = os.path.commonprefix([f[0] for f in fields])... |
def __iter__(cls):
'Getting subclasses which usually represent resolutions'
for attr in vars(cls):
if (not attr.startswith('_')):
(yield cls[attr]) | -6,765,760,589,805,338,000 | Getting subclasses which usually represent resolutions | wetterdienst/util/parameter.py | __iter__ | earthobservations/python_dwd | python | def __iter__(cls):
for attr in vars(cls):
if (not attr.startswith('_')):
(yield cls[attr]) |
def notas(*n, sit=False):
'\n Função para analisar notas e situação de varios alunos.\n :param n: Uma ou mais notas dos alunos (aceita varias)\n :param sit: Valor opcional, indicando se deve ou não adicionar a situação.\n :return: Dicionario com varias informações sobre a situação da turma.\n '
d... | 575,371,391,845,530,560 | Função para analisar notas e situação de varios alunos.
:param n: Uma ou mais notas dos alunos (aceita varias)
:param sit: Valor opcional, indicando se deve ou não adicionar a situação.
:return: Dicionario com varias informações sobre a situação da turma. | Modulo-03/ex105/ex105.py | notas | Matheus-Henrique-Burey/Curso-de-Python | python | def notas(*n, sit=False):
'\n Função para analisar notas e situação de varios alunos.\n :param n: Uma ou mais notas dos alunos (aceita varias)\n :param sit: Valor opcional, indicando se deve ou não adicionar a situação.\n :return: Dicionario com varias informações sobre a situação da turma.\n '
d... |
def main():
'\n ----------\n Author: Damon Gwinn\n ----------\n Entry point. Trains a model specified by command line arguments\n ----------\n '
args = parse_train_args()
print_train_args(args)
if args.force_cpu:
use_cuda(False)
print('WARNING: Forced CPU usage, expect ... | 3,237,435,461,219,423,700 | ----------
Author: Damon Gwinn
----------
Entry point. Trains a model specified by command line arguments
---------- | train.py | main | yeong35/MusicTransformer-Pytorch | python | def main():
'\n ----------\n Author: Damon Gwinn\n ----------\n Entry point. Trains a model specified by command line arguments\n ----------\n '
args = parse_train_args()
print_train_args(args)
if args.force_cpu:
use_cuda(False)
print('WARNING: Forced CPU usage, expect ... |
def recreation_check(self, metadata):
'Check that compileall recreates bytecode when the new metadata is\n used.'
if os.environ.get('SOURCE_DATE_EPOCH'):
raise unittest.SkipTest('SOURCE_DATE_EPOCH is set')
py_compile.compile(self.source_path)
self.assertEqual(*self.timestamp_metadata())
... | -8,420,914,637,662,615,000 | Check that compileall recreates bytecode when the new metadata is
used. | python/Lib/test/test_compileall.py | recreation_check | jasam/ciclo_vida_datos_scraping | python | def recreation_check(self, metadata):
'Check that compileall recreates bytecode when the new metadata is\n used.'
if os.environ.get('SOURCE_DATE_EPOCH'):
raise unittest.SkipTest('SOURCE_DATE_EPOCH is set')
py_compile.compile(self.source_path)
self.assertEqual(*self.timestamp_metadata())
... |
def resample(df, rule, on=None, groupby=(), aggregation='mean', reset_index=True, time_index=None):
'pd.DataFrame.resample adapter.\n\n Call the `df.resample` method on the given time_index\n and afterwards call the indicated aggregation.\n\n Optionally group the dataframe by the indicated columns before\n... | -5,069,791,470,592,100,000 | pd.DataFrame.resample adapter.
Call the `df.resample` method on the given time_index
and afterwards call the indicated aggregation.
Optionally group the dataframe by the indicated columns before
performing the resampling.
If groupby option is used, the result is a multi-index datagrame.
Args:
df (pandas.DataFra... | mlprimitives/adapters/pandas.py | resample | AlexanderGeiger/MLPrimitives | python | def resample(df, rule, on=None, groupby=(), aggregation='mean', reset_index=True, time_index=None):
'pd.DataFrame.resample adapter.\n\n Call the `df.resample` method on the given time_index\n and afterwards call the indicated aggregation.\n\n Optionally group the dataframe by the indicated columns before\n... |
def _join_names(names):
'Join the names of a multi-level index with an underscore.'
levels = (str(name) for name in names if (name != ''))
return '_'.join(levels) | -7,429,011,445,859,655,000 | Join the names of a multi-level index with an underscore. | mlprimitives/adapters/pandas.py | _join_names | AlexanderGeiger/MLPrimitives | python | def _join_names(names):
levels = (str(name) for name in names if (name != ))
return '_'.join(levels) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.