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 test_resized_viewbox_no_width_height(self): 'Truncate decimals' svg = ElementTree.fromstring((XML_HEADER + b'<svg viewBox="-10.23 32.18 75.876 75.956"></svg>')) result = ElementTree.tostring(svg_util.make_square(svg)) self.assertTrue((b'width="80"' in result)) self.assertTrue((b'height="80"' in ...
-8,967,835,290,666,746,000
Truncate decimals
peacecorps/peacecorps/tests/test_util_svg.py
test_resized_viewbox_no_width_height
18F/peacecorps-site
python
def test_resized_viewbox_no_width_height(self): svg = ElementTree.fromstring((XML_HEADER + b'<svg viewBox="-10.23 32.18 75.876 75.956"></svg>')) result = ElementTree.tostring(svg_util.make_square(svg)) self.assertTrue((b'width="80"' in result)) self.assertTrue((b'height="80"' in result)) self.a...
def GetChromeProxyRequestHeaderValue(self, key): 'Get a specific Chrome-Proxy request header value.\n\n Returns:\n The value for a specific Chrome-Proxy request header value for a\n given key. Returns None if no such key is present.\n ' if ('Chrome-Proxy' not in self.response.request_headers...
-2,043,771,418,356,114,200
Get a specific Chrome-Proxy request header value. Returns: The value for a specific Chrome-Proxy request header value for a given key. Returns None if no such key is present.
third_party/webrtc/src/chromium/src/tools/chrome_proxy/common/chrome_proxy_metrics.py
GetChromeProxyRequestHeaderValue
Teamxrtc/webrtc-streaming-node
python
def GetChromeProxyRequestHeaderValue(self, key): 'Get a specific Chrome-Proxy request header value.\n\n Returns:\n The value for a specific Chrome-Proxy request header value for a\n given key. Returns None if no such key is present.\n ' if ('Chrome-Proxy' not in self.response.request_headers...
def GetChromeProxyClientType(self): 'Get the client type directive from the Chrome-Proxy request header.\n\n Returns:\n The client type directive from the Chrome-Proxy request header for the\n request that lead to this response. For example, if the request header\n "Chrome-Proxy: c=android" ...
7,091,982,491,205,581,000
Get the client type directive from the Chrome-Proxy request header. Returns: The client type directive from the Chrome-Proxy request header for the request that lead to this response. For example, if the request header "Chrome-Proxy: c=android" is present, then this method would return "android". Retur...
third_party/webrtc/src/chromium/src/tools/chrome_proxy/common/chrome_proxy_metrics.py
GetChromeProxyClientType
Teamxrtc/webrtc-streaming-node
python
def GetChromeProxyClientType(self): 'Get the client type directive from the Chrome-Proxy request header.\n\n Returns:\n The client type directive from the Chrome-Proxy request header for the\n request that lead to this response. For example, if the request header\n "Chrome-Proxy: c=android" ...
def matched_sample_distribution(floats_arr: np.array, samples_no: int, granularity: int=100, logmode: bool=False) -> np.array: '\n Tries to guess a distribution of floats and sample from it.\n uses np.histogram with the number of bins equal to the granularity parameter. For each\n sample, selects which bin...
7,744,731,314,882,504,000
Tries to guess a distribution of floats and sample from it. uses np.histogram with the number of bins equal to the granularity parameter. For each sample, selects which bin to sample and then picks from the bin a float according to a uniform distribution. if logmode is enabled, histogram will be in the log-space, as we...
bioflow/algorithms_bank/sampling_policies.py
matched_sample_distribution
chiffa/BioFlow
python
def matched_sample_distribution(floats_arr: np.array, samples_no: int, granularity: int=100, logmode: bool=False) -> np.array: '\n Tries to guess a distribution of floats and sample from it.\n uses np.histogram with the number of bins equal to the granularity parameter. For each\n sample, selects which bin...
def _reduce_distribution(floats_arr: np.array): '\n Basically gets a distribution in the [0, 1] in 100 bins, rounds to the nearest 0.01. Used for\n hashing and distribution matching\n\n :param floats_arr: floats for which to calculate the rounded distribution\n :return: rounded distribution\n ' n...
-7,937,689,576,270,980,000
Basically gets a distribution in the [0, 1] in 100 bins, rounds to the nearest 0.01. Used for hashing and distribution matching :param floats_arr: floats for which to calculate the rounded distribution :return: rounded distribution
bioflow/algorithms_bank/sampling_policies.py
_reduce_distribution
chiffa/BioFlow
python
def _reduce_distribution(floats_arr: np.array): '\n Basically gets a distribution in the [0, 1] in 100 bins, rounds to the nearest 0.01. Used for\n hashing and distribution matching\n\n :param floats_arr: floats for which to calculate the rounded distribution\n :return: rounded distribution\n ' n...
def _characterize_set(sample: Union[(List[int], List[Tuple[(int, float)]])]): '\n None-robust helper function to characterize a sample set by its length, nature of items in\n teh sample and eventual distribution of weights within the sample.\n\n :param sample: sample to characterize\n :return: set lengt...
5,761,955,160,226,254,000
None-robust helper function to characterize a sample set by its length, nature of items in teh sample and eventual distribution of weights within the sample. :param sample: sample to characterize :return: set length (0 if None), 1 if items are ids, 2 if ids and weights (0 if None), rounded distribution ([] if None or ...
bioflow/algorithms_bank/sampling_policies.py
_characterize_set
chiffa/BioFlow
python
def _characterize_set(sample: Union[(List[int], List[Tuple[(int, float)]])]): '\n None-robust helper function to characterize a sample set by its length, nature of items in\n teh sample and eventual distribution of weights within the sample.\n\n :param sample: sample to characterize\n :return: set lengt...
def characterize_flow_parameters(sample: Union[(List[int], List[Tuple[(int, float)]])], secondary_sample: Union[(List[int], List[Tuple[(int, float)]], None)], sparse_rounds: int): '\n Characterizes the primary and secondary sets and computes their hash, that can be used ot\n match similar samples for random s...
7,264,387,114,084,906,000
Characterizes the primary and secondary sets and computes their hash, that can be used ot match similar samples for random sampling. :param sample: primary set :param secondary_sample: secondary set :param sparse_rounds: if sparse rounds are to be performed :return: first set length, shape, hist, second set length, sh...
bioflow/algorithms_bank/sampling_policies.py
characterize_flow_parameters
chiffa/BioFlow
python
def characterize_flow_parameters(sample: Union[(List[int], List[Tuple[(int, float)]])], secondary_sample: Union[(List[int], List[Tuple[(int, float)]], None)], sparse_rounds: int): '\n Characterizes the primary and secondary sets and computes their hash, that can be used ot\n match similar samples for random s...
def _sample_floats(floats, float_sampling_method='exact', matched_distro_precision: int=100): '\n A wrapper methods to sample a float distribution according to a method\n\n :param floats:\n :param float_sampling_method: exact (permutation of weights) | distro (trying to match the\n empirical distrib...
47,125,547,739,960,570
A wrapper methods to sample a float distribution according to a method :param floats: :param float_sampling_method: exact (permutation of weights) | distro (trying to match the empirical distribution) | logdistro (trying to match the empirical distribution in the log space) :param matched_distro_precision: how...
bioflow/algorithms_bank/sampling_policies.py
_sample_floats
chiffa/BioFlow
python
def _sample_floats(floats, float_sampling_method='exact', matched_distro_precision: int=100): '\n A wrapper methods to sample a float distribution according to a method\n\n :param floats:\n :param float_sampling_method: exact (permutation of weights) | distro (trying to match the\n empirical distrib...
def matched_sampling(sample, secondary_sample, background, samples, float_sampling_method='exact'): '\n The general random sampling strategy that sample sets of the same size and shape as primary\n and secondary sample set and, if they are weighted, try to match the random sample weights\n according to the...
703,084,849,194,356,000
The general random sampling strategy that sample sets of the same size and shape as primary and secondary sample set and, if they are weighted, try to match the random sample weights according to the :param sample: primary sample set :param secondary_sample: secondary sample_set :param background: background of ids (...
bioflow/algorithms_bank/sampling_policies.py
matched_sampling
chiffa/BioFlow
python
def matched_sampling(sample, secondary_sample, background, samples, float_sampling_method='exact'): '\n The general random sampling strategy that sample sets of the same size and shape as primary\n and secondary sample set and, if they are weighted, try to match the random sample weights\n according to the...
def __init__(__self__, *, resource_group_name: pulumi.Input[str], id: Optional[pulumi.Input[str]]=None, location: Optional[pulumi.Input[str]]=None, manual_private_link_service_connections: Optional[pulumi.Input[Sequence[pulumi.Input['PrivateLinkServiceConnectionArgs']]]]=None, private_endpoint_name: Optional[pulumi.Inp...
5,233,328,910,972,875,000
The set of arguments for constructing a PrivateEndpoint resource. :param pulumi.Input[str] resource_group_name: The name of the resource group. :param pulumi.Input[str] id: Resource ID. :param pulumi.Input[str] location: Resource location. :param pulumi.Input[Sequence[pulumi.Input['PrivateLinkServiceConnectionArgs']]] ...
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
__init__
polivbr/pulumi-azure-native
python
def __init__(__self__, *, resource_group_name: pulumi.Input[str], id: Optional[pulumi.Input[str]]=None, location: Optional[pulumi.Input[str]]=None, manual_private_link_service_connections: Optional[pulumi.Input[Sequence[pulumi.Input['PrivateLinkServiceConnectionArgs']]]]=None, private_endpoint_name: Optional[pulumi.Inp...
@property @pulumi.getter(name='resourceGroupName') def resource_group_name(self) -> pulumi.Input[str]: '\n The name of the resource group.\n ' return pulumi.get(self, 'resource_group_name')
5,898,586,357,340,442,000
The name of the resource group.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
resource_group_name
polivbr/pulumi-azure-native
python
@property @pulumi.getter(name='resourceGroupName') def resource_group_name(self) -> pulumi.Input[str]: '\n \n ' return pulumi.get(self, 'resource_group_name')
@property @pulumi.getter def id(self) -> Optional[pulumi.Input[str]]: '\n Resource ID.\n ' return pulumi.get(self, 'id')
4,003,078,074,025,280,500
Resource ID.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
id
polivbr/pulumi-azure-native
python
@property @pulumi.getter def id(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'id')
@property @pulumi.getter def location(self) -> Optional[pulumi.Input[str]]: '\n Resource location.\n ' return pulumi.get(self, 'location')
5,685,883,695,381,965,000
Resource location.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
location
polivbr/pulumi-azure-native
python
@property @pulumi.getter def location(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'location')
@property @pulumi.getter(name='manualPrivateLinkServiceConnections') def manual_private_link_service_connections(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['PrivateLinkServiceConnectionArgs']]]]: '\n A grouping of information about the connection to the remote resource. Used when the network admin ...
-6,351,649,816,882,946,000
A grouping of information about the connection to the remote resource. Used when the network admin does not have access to approve connections to the remote resource.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
manual_private_link_service_connections
polivbr/pulumi-azure-native
python
@property @pulumi.getter(name='manualPrivateLinkServiceConnections') def manual_private_link_service_connections(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['PrivateLinkServiceConnectionArgs']]]]: '\n \n ' return pulumi.get(self, 'manual_private_link_service_connections')
@property @pulumi.getter(name='privateEndpointName') def private_endpoint_name(self) -> Optional[pulumi.Input[str]]: '\n The name of the private endpoint.\n ' return pulumi.get(self, 'private_endpoint_name')
-8,703,745,273,820,877,000
The name of the private endpoint.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
private_endpoint_name
polivbr/pulumi-azure-native
python
@property @pulumi.getter(name='privateEndpointName') def private_endpoint_name(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'private_endpoint_name')
@property @pulumi.getter(name='privateLinkServiceConnections') def private_link_service_connections(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['PrivateLinkServiceConnectionArgs']]]]: '\n A grouping of information about the connection to the remote resource.\n ' return pulumi.get(self, 'p...
-5,282,137,409,068,493,000
A grouping of information about the connection to the remote resource.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
private_link_service_connections
polivbr/pulumi-azure-native
python
@property @pulumi.getter(name='privateLinkServiceConnections') def private_link_service_connections(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['PrivateLinkServiceConnectionArgs']]]]: '\n \n ' return pulumi.get(self, 'private_link_service_connections')
@property @pulumi.getter def subnet(self) -> Optional[pulumi.Input['SubnetArgs']]: '\n The ID of the subnet from which the private IP will be allocated.\n ' return pulumi.get(self, 'subnet')
-2,245,546,924,618,331,100
The ID of the subnet from which the private IP will be allocated.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
subnet
polivbr/pulumi-azure-native
python
@property @pulumi.getter def subnet(self) -> Optional[pulumi.Input['SubnetArgs']]: '\n \n ' return pulumi.get(self, 'subnet')
@property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n Resource tags.\n ' return pulumi.get(self, 'tags')
-2,047,115,851,061,118,500
Resource tags.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
tags
polivbr/pulumi-azure-native
python
@property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n \n ' return pulumi.get(self, 'tags')
@overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, id: Optional[pulumi.Input[str]]=None, location: Optional[pulumi.Input[str]]=None, manual_private_link_service_connections: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['PrivateLinkServiceConnectionArgs']]]]...
-4,391,438,611,083,021,300
Private endpoint resource. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] id: Resource ID. :param pulumi.Input[str] location: Resource location. :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['PrivateLinkServiceConn...
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
__init__
polivbr/pulumi-azure-native
python
@overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, id: Optional[pulumi.Input[str]]=None, location: Optional[pulumi.Input[str]]=None, manual_private_link_service_connections: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['PrivateLinkServiceConnectionArgs']]]]...
@overload def __init__(__self__, resource_name: str, args: PrivateEndpointArgs, opts: Optional[pulumi.ResourceOptions]=None): "\n Private endpoint resource.\n\n :param str resource_name: The name of the resource.\n :param PrivateEndpointArgs args: The arguments to use to populate this resource'...
5,082,290,568,587,639,000
Private endpoint resource. :param str resource_name: The name of the resource. :param PrivateEndpointArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
__init__
polivbr/pulumi-azure-native
python
@overload def __init__(__self__, resource_name: str, args: PrivateEndpointArgs, opts: Optional[pulumi.ResourceOptions]=None): "\n Private endpoint resource.\n\n :param str resource_name: The name of the resource.\n :param PrivateEndpointArgs args: The arguments to use to populate this resource'...
@staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None) -> 'PrivateEndpoint': "\n Get an existing PrivateEndpoint resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str resource_n...
3,226,211,340,263,033,000
Get an existing PrivateEndpoint resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Opt...
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
get
polivbr/pulumi-azure-native
python
@staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None) -> 'PrivateEndpoint': "\n Get an existing PrivateEndpoint resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str resource_n...
@property @pulumi.getter def etag(self) -> pulumi.Output[str]: '\n A unique read-only string that changes whenever the resource is updated.\n ' return pulumi.get(self, 'etag')
5,960,741,373,667,297,000
A unique read-only string that changes whenever the resource is updated.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
etag
polivbr/pulumi-azure-native
python
@property @pulumi.getter def etag(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'etag')
@property @pulumi.getter def location(self) -> pulumi.Output[Optional[str]]: '\n Resource location.\n ' return pulumi.get(self, 'location')
-6,585,394,763,848,456,000
Resource location.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
location
polivbr/pulumi-azure-native
python
@property @pulumi.getter def location(self) -> pulumi.Output[Optional[str]]: '\n \n ' return pulumi.get(self, 'location')
@property @pulumi.getter(name='manualPrivateLinkServiceConnections') def manual_private_link_service_connections(self) -> pulumi.Output[Optional[Sequence['outputs.PrivateLinkServiceConnectionResponse']]]: '\n A grouping of information about the connection to the remote resource. Used when the network admin d...
7,044,445,811,079,634,000
A grouping of information about the connection to the remote resource. Used when the network admin does not have access to approve connections to the remote resource.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
manual_private_link_service_connections
polivbr/pulumi-azure-native
python
@property @pulumi.getter(name='manualPrivateLinkServiceConnections') def manual_private_link_service_connections(self) -> pulumi.Output[Optional[Sequence['outputs.PrivateLinkServiceConnectionResponse']]]: '\n \n ' return pulumi.get(self, 'manual_private_link_service_connections')
@property @pulumi.getter def name(self) -> pulumi.Output[str]: '\n Resource name.\n ' return pulumi.get(self, 'name')
4,695,236,134,441,039,000
Resource name.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
name
polivbr/pulumi-azure-native
python
@property @pulumi.getter def name(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'name')
@property @pulumi.getter(name='networkInterfaces') def network_interfaces(self) -> pulumi.Output[Sequence['outputs.NetworkInterfaceResponse']]: '\n An array of references to the network interfaces created for this private endpoint.\n ' return pulumi.get(self, 'network_interfaces')
-2,116,992,413,112,385,500
An array of references to the network interfaces created for this private endpoint.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
network_interfaces
polivbr/pulumi-azure-native
python
@property @pulumi.getter(name='networkInterfaces') def network_interfaces(self) -> pulumi.Output[Sequence['outputs.NetworkInterfaceResponse']]: '\n \n ' return pulumi.get(self, 'network_interfaces')
@property @pulumi.getter(name='privateLinkServiceConnections') def private_link_service_connections(self) -> pulumi.Output[Optional[Sequence['outputs.PrivateLinkServiceConnectionResponse']]]: '\n A grouping of information about the connection to the remote resource.\n ' return pulumi.get(self, 'pr...
3,713,283,600,789,212,000
A grouping of information about the connection to the remote resource.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
private_link_service_connections
polivbr/pulumi-azure-native
python
@property @pulumi.getter(name='privateLinkServiceConnections') def private_link_service_connections(self) -> pulumi.Output[Optional[Sequence['outputs.PrivateLinkServiceConnectionResponse']]]: '\n \n ' return pulumi.get(self, 'private_link_service_connections')
@property @pulumi.getter(name='provisioningState') def provisioning_state(self) -> pulumi.Output[str]: '\n The provisioning state of the private endpoint resource.\n ' return pulumi.get(self, 'provisioning_state')
-3,047,066,359,649,695,000
The provisioning state of the private endpoint resource.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
provisioning_state
polivbr/pulumi-azure-native
python
@property @pulumi.getter(name='provisioningState') def provisioning_state(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'provisioning_state')
@property @pulumi.getter def subnet(self) -> pulumi.Output[Optional['outputs.SubnetResponse']]: '\n The ID of the subnet from which the private IP will be allocated.\n ' return pulumi.get(self, 'subnet')
3,362,244,572,786,356,700
The ID of the subnet from which the private IP will be allocated.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
subnet
polivbr/pulumi-azure-native
python
@property @pulumi.getter def subnet(self) -> pulumi.Output[Optional['outputs.SubnetResponse']]: '\n \n ' return pulumi.get(self, 'subnet')
@property @pulumi.getter def tags(self) -> pulumi.Output[Optional[Mapping[(str, str)]]]: '\n Resource tags.\n ' return pulumi.get(self, 'tags')
-2,929,197,049,816,896,000
Resource tags.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
tags
polivbr/pulumi-azure-native
python
@property @pulumi.getter def tags(self) -> pulumi.Output[Optional[Mapping[(str, str)]]]: '\n \n ' return pulumi.get(self, 'tags')
@property @pulumi.getter def type(self) -> pulumi.Output[str]: '\n Resource type.\n ' return pulumi.get(self, 'type')
2,132,950,812,122,862,800
Resource type.
sdk/python/pulumi_azure_native/network/v20190901/private_endpoint.py
type
polivbr/pulumi-azure-native
python
@property @pulumi.getter def type(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'type')
def concat(xs, axis=1): 'Concatenates given variables along an axis.\n\n Args:\n xs (tuple of Variables): Variables to be concatenated.\n axis (int): Axis that the input arrays are concatenated along.\n\n Returns:\n ~chainer.Variable: Output variable.\n\n ' return Concat(axis=axis)...
3,311,227,305,912,610,300
Concatenates given variables along an axis. Args: xs (tuple of Variables): Variables to be concatenated. axis (int): Axis that the input arrays are concatenated along. Returns: ~chainer.Variable: Output variable.
chainer/functions/concat.py
concat
umitanuki/chainer
python
def concat(xs, axis=1): 'Concatenates given variables along an axis.\n\n Args:\n xs (tuple of Variables): Variables to be concatenated.\n axis (int): Axis that the input arrays are concatenated along.\n\n Returns:\n ~chainer.Variable: Output variable.\n\n ' return Concat(axis=axis)...
def encoder_from_encoder_spec(encoder_spec, chosen_locations, num_known_timesteps, forecast_window_size, output_window_size, static_features=None, static_overrides=None, covariates=None, forecasted_covariates=None, covariate_overrides=None, ts_categorical_features=None, random_seed=0, static_scalers=None, ts_scalers=No...
-6,044,850,341,288,337,000
Returns a `FeatureEncoder` built as specified in the `encoder_spec`.
covid_epidemiology/src/models/encoders/variable_encoder_builder.py
encoder_from_encoder_spec
04mayukh/google-research
python
def encoder_from_encoder_spec(encoder_spec, chosen_locations, num_known_timesteps, forecast_window_size, output_window_size, static_features=None, static_overrides=None, covariates=None, forecasted_covariates=None, covariate_overrides=None, ts_categorical_features=None, random_seed=0, static_scalers=None, ts_scalers=No...
def generate_caseRunConfigurations(self, library): ' Generates caseRunConfigurations for testcases in library relevant to this event\n\n :param library: Library\n :type library: tplib.Library\n :return: CaseRunConfigurations\n :rtype: CaseRunConfigurationsList\n ' caseruns = C...
-6,780,673,543,612,013,000
Generates caseRunConfigurations for testcases in library relevant to this event :param library: Library :type library: tplib.Library :return: CaseRunConfigurations :rtype: CaseRunConfigurationsList
libpermian/events/base.py
generate_caseRunConfigurations
rhinstaller/permian
python
def generate_caseRunConfigurations(self, library): ' Generates caseRunConfigurations for testcases in library relevant to this event\n\n :param library: Library\n :type library: tplib.Library\n :return: CaseRunConfigurations\n :rtype: CaseRunConfigurationsList\n ' caseruns = C...
def handles_testplan_artifact_type(self, artifact_type): '\n Decide if this event is relevant to the provided artifact_type (which\n is found in test plan).\n ' return dotted_startswith(self.type, artifact_type)
2,603,444,795,506,606,600
Decide if this event is relevant to the provided artifact_type (which is found in test plan).
libpermian/events/base.py
handles_testplan_artifact_type
rhinstaller/permian
python
def handles_testplan_artifact_type(self, artifact_type): '\n Decide if this event is relevant to the provided artifact_type (which\n is found in test plan).\n ' return dotted_startswith(self.type, artifact_type)
def filter_testPlans(self, library): ' Filters testplan from library based on:\n - event type and testplan.artifact_type\n - testplan execute_on filter\n\n :param library: pipeline library\n :type library: tplib.Library\n :return: Filtered testplans\n :rtype: list of tplib....
39,500,111,890,816,350
Filters testplan from library based on: - event type and testplan.artifact_type - testplan execute_on filter :param library: pipeline library :type library: tplib.Library :return: Filtered testplans :rtype: list of tplib.TestPlan
libpermian/events/base.py
filter_testPlans
rhinstaller/permian
python
def filter_testPlans(self, library): ' Filters testplan from library based on:\n - event type and testplan.artifact_type\n - testplan execute_on filter\n\n :param library: pipeline library\n :type library: tplib.Library\n :return: Filtered testplans\n :rtype: list of tplib....
@property def additional_testplans_data(self): ' Event can provide additional testplans. Returns python\n dicts, as if they were tplib files read by yaml.safe_load.\n\n :return: list of testplan data\n :rtype: tuple\n ' return None
-4,555,565,715,031,543,000
Event can provide additional testplans. Returns python dicts, as if they were tplib files read by yaml.safe_load. :return: list of testplan data :rtype: tuple
libpermian/events/base.py
additional_testplans_data
rhinstaller/permian
python
@property def additional_testplans_data(self): ' Event can provide additional testplans. Returns python\n dicts, as if they were tplib files read by yaml.safe_load.\n\n :return: list of testplan data\n :rtype: tuple\n ' return None
@property def additional_requrements_data(self): ' Event can provide additional requrements. Returns python\n dicts, as if they were tplib files read by yaml.safe_load.\n\n :return: list of requrements data\n :rtype: tuple\n ' return None
5,101,496,771,720,215,000
Event can provide additional requrements. Returns python dicts, as if they were tplib files read by yaml.safe_load. :return: list of requrements data :rtype: tuple
libpermian/events/base.py
additional_requrements_data
rhinstaller/permian
python
@property def additional_requrements_data(self): ' Event can provide additional requrements. Returns python\n dicts, as if they were tplib files read by yaml.safe_load.\n\n :return: list of requrements data\n :rtype: tuple\n ' return None
@property def additional_testcases_data(self): ' Event can provide additional testcases. Returns python\n dicts, as if they were tplib files read by yaml.safe_load.\n\n :return: list of testcases data\n :rtype: tuple\n ' return None
-3,993,988,197,691,913,000
Event can provide additional testcases. Returns python dicts, as if they were tplib files read by yaml.safe_load. :return: list of testcases data :rtype: tuple
libpermian/events/base.py
additional_testcases_data
rhinstaller/permian
python
@property def additional_testcases_data(self): ' Event can provide additional testcases. Returns python\n dicts, as if they were tplib files read by yaml.safe_load.\n\n :return: list of testcases data\n :rtype: tuple\n ' return None
def __init__(self, all_for_sec=None, days=None, per_day=None): '\n Keyword args:\n all_for_sec (int): The length of time to keep the specified snapshots. Measured in seconds.\n days (int): The number of days to keep the snapshots after the `all_for_sec` period has passed.\n p...
5,860,685,410,813,140,000
Keyword args: all_for_sec (int): The length of time to keep the specified snapshots. Measured in seconds. days (int): The number of days to keep the snapshots after the `all_for_sec` period has passed. per_day (int): The number of snapshots to keep per day after the `all_for_sec` period has passed.
pypureclient/flasharray/FA_2_1/models/retention_policy.py
__init__
Flav-STOR-WL/py-pure-client
python
def __init__(self, all_for_sec=None, days=None, per_day=None): '\n Keyword args:\n all_for_sec (int): The length of time to keep the specified snapshots. Measured in seconds.\n days (int): The number of days to keep the snapshots after the `all_for_sec` period has passed.\n p...
def to_dict(self): 'Returns the model properties as a dict' result = {} for (attr, _) in six.iteritems(self.swagger_types): if hasattr(self, attr): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map((lambda x: (x.to_dict() if hasat...
7,346,697,134,304,610,000
Returns the model properties as a dict
pypureclient/flasharray/FA_2_1/models/retention_policy.py
to_dict
Flav-STOR-WL/py-pure-client
python
def to_dict(self): result = {} for (attr, _) in six.iteritems(self.swagger_types): if hasattr(self, attr): 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)) ...
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
pypureclient/flasharray/FA_2_1/models/retention_policy.py
to_str
Flav-STOR-WL/py-pure-client
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`
pypureclient/flasharray/FA_2_1/models/retention_policy.py
__repr__
Flav-STOR-WL/py-pure-client
python
def __repr__(self): return self.to_str()
def __eq__(self, other): 'Returns true if both objects are equal' if (not isinstance(other, RetentionPolicy)): return False return (self.__dict__ == other.__dict__)
-5,835,544,153,022,462,000
Returns true if both objects are equal
pypureclient/flasharray/FA_2_1/models/retention_policy.py
__eq__
Flav-STOR-WL/py-pure-client
python
def __eq__(self, other): if (not isinstance(other, RetentionPolicy)): 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
pypureclient/flasharray/FA_2_1/models/retention_policy.py
__ne__
Flav-STOR-WL/py-pure-client
python
def __ne__(self, other): return (not (self == other))
def list(self, group_name: str, service_name: str, project_name: str, task_type: Optional[str]=None, **kwargs) -> AsyncIterable['models.TaskList']: 'Get tasks in a service.\n\n The services resource is the top-level resource that represents the Database Migration Service.\n This method returns a list ...
245,612,584,995,217,300
Get tasks in a service. The services resource is the top-level resource that represents the Database Migration Service. This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. :param group_...
src/datamigration/azext_datamigration/vendored_sdks/datamigration/aio/operations/_tasks_operations.py
list
Hamster-Huey/azure-cli-extensions
python
def list(self, group_name: str, service_name: str, project_name: str, task_type: Optional[str]=None, **kwargs) -> AsyncIterable['models.TaskList']: 'Get tasks in a service.\n\n The services resource is the top-level resource that represents the Database Migration Service.\n This method returns a list ...
async def create_or_update(self, group_name: str, service_name: str, project_name: str, task_name: str, parameters: 'models.ProjectTask', **kwargs) -> 'models.ProjectTask': 'Create or update task.\n\n The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n instance. ...
-2,965,820,772,915,707,000
Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an existing one. :param group_name: Name of t...
src/datamigration/azext_datamigration/vendored_sdks/datamigration/aio/operations/_tasks_operations.py
create_or_update
Hamster-Huey/azure-cli-extensions
python
async def create_or_update(self, group_name: str, service_name: str, project_name: str, task_name: str, parameters: 'models.ProjectTask', **kwargs) -> 'models.ProjectTask': 'Create or update task.\n\n The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n instance. ...
async def get(self, group_name: str, service_name: str, project_name: str, task_name: str, expand: Optional[str]=None, **kwargs) -> 'models.ProjectTask': 'Get task information.\n\n The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n instance. The GET method retri...
4,512,955,439,058,534,000
Get task information. The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method retrieves information about a task. :param group_name: Name of the resource group. :type group_name: str :param service_name: Name of the service. :type service_name: str :param proj...
src/datamigration/azext_datamigration/vendored_sdks/datamigration/aio/operations/_tasks_operations.py
get
Hamster-Huey/azure-cli-extensions
python
async def get(self, group_name: str, service_name: str, project_name: str, task_name: str, expand: Optional[str]=None, **kwargs) -> 'models.ProjectTask': 'Get task information.\n\n The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n instance. The GET method retri...
async def delete(self, group_name: str, service_name: str, project_name: str, task_name: str, delete_running_tasks: Optional[bool]=None, **kwargs) -> None: "Delete task.\n\n The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n instance. The DELETE method deletes a...
4,686,494,169,580,922,000
Delete task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE method deletes a task, canceling it first if it's running. :param group_name: Name of the resource group. :type group_name: str :param service_name: Name of the service. :type service_name: str :...
src/datamigration/azext_datamigration/vendored_sdks/datamigration/aio/operations/_tasks_operations.py
delete
Hamster-Huey/azure-cli-extensions
python
async def delete(self, group_name: str, service_name: str, project_name: str, task_name: str, delete_running_tasks: Optional[bool]=None, **kwargs) -> None: "Delete task.\n\n The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n instance. The DELETE method deletes a...
async def update(self, group_name: str, service_name: str, project_name: str, task_name: str, parameters: 'models.ProjectTask', **kwargs) -> 'models.ProjectTask': 'Create or update task.\n\n The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n instance. The PATCH ...
-7,988,383,540,604,401,000
Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. :param group_name: Name of the resource group. :type group_name: str ...
src/datamigration/azext_datamigration/vendored_sdks/datamigration/aio/operations/_tasks_operations.py
update
Hamster-Huey/azure-cli-extensions
python
async def update(self, group_name: str, service_name: str, project_name: str, task_name: str, parameters: 'models.ProjectTask', **kwargs) -> 'models.ProjectTask': 'Create or update task.\n\n The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n instance. The PATCH ...
async def cancel(self, group_name: str, service_name: str, project_name: str, task_name: str, **kwargs) -> 'models.ProjectTask': "Cancel a task.\n\n The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n instance. This method cancels a task if it's currently queued ...
9,121,790,174,815,307,000
Cancel a task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running. :param group_name: Name of the resource group. :type group_name: str :param service_name: Name of the service. :type service_name: str :para...
src/datamigration/azext_datamigration/vendored_sdks/datamigration/aio/operations/_tasks_operations.py
cancel
Hamster-Huey/azure-cli-extensions
python
async def cancel(self, group_name: str, service_name: str, project_name: str, task_name: str, **kwargs) -> 'models.ProjectTask': "Cancel a task.\n\n The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n instance. This method cancels a task if it's currently queued ...
async def command(self, group_name: str, service_name: str, project_name: str, task_name: str, parameters: 'models.CommandProperties', **kwargs) -> 'models.CommandProperties': 'Execute a command on a task.\n\n The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n i...
6,424,933,398,628,367,000
Execute a command on a task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method executes a command on a running task. :param group_name: Name of the resource group. :type group_name: str :param service_name: Name of the service. :type service_name: str :para...
src/datamigration/azext_datamigration/vendored_sdks/datamigration/aio/operations/_tasks_operations.py
command
Hamster-Huey/azure-cli-extensions
python
async def command(self, group_name: str, service_name: str, project_name: str, task_name: str, parameters: 'models.CommandProperties', **kwargs) -> 'models.CommandProperties': 'Execute a command on a task.\n\n The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n i...
def _maybe_create_dir(path): "Create directory (and parents) if they don't exist." try: os.makedirs(path) except OSError: if (not os.path.isdir(path)): raise
6,105,453,633,667,462,000
Create directory (and parents) if they don't exist.
parcels/scripts/get_examples.py
_maybe_create_dir
becgorton/parcels
python
def _maybe_create_dir(path): try: os.makedirs(path) except OSError: if (not os.path.isdir(path)): raise
def copy_data_and_examples_from_package_to(target_path): 'Copy example data from Parcels directory.\n\n Return thos parths of the list `file_names` that were not found in the\n package.\n\n ' examples_in_package = pkg_resources.resource_filename('parcels', 'examples') try: shutil.copytree(e...
7,610,559,079,219,055,000
Copy example data from Parcels directory. Return thos parths of the list `file_names` that were not found in the package.
parcels/scripts/get_examples.py
copy_data_and_examples_from_package_to
becgorton/parcels
python
def copy_data_and_examples_from_package_to(target_path): 'Copy example data from Parcels directory.\n\n Return thos parths of the list `file_names` that were not found in the\n package.\n\n ' examples_in_package = pkg_resources.resource_filename('parcels', 'examples') try: shutil.copytree(e...
def set_jupyter_kernel_to_python_version(path, python_version=2): 'Set notebook kernelspec to desired python version.\n\n This also drops all other meta data from the notebook.\n ' for file_name in glob(os.path.join(path, '*.ipynb')): with open(file_name, 'r') as f: notebook_data = jso...
1,613,269,214,994,440,000
Set notebook kernelspec to desired python version. This also drops all other meta data from the notebook.
parcels/scripts/get_examples.py
set_jupyter_kernel_to_python_version
becgorton/parcels
python
def set_jupyter_kernel_to_python_version(path, python_version=2): 'Set notebook kernelspec to desired python version.\n\n This also drops all other meta data from the notebook.\n ' for file_name in glob(os.path.join(path, '*.ipynb')): with open(file_name, 'r') as f: notebook_data = jso...
def _still_to_download(file_names, target_path): 'Only return the files that are not yet present on disk.' for fn in list(file_names): if os.path.exists(os.path.join(target_path, fn)): file_names.remove(fn) return file_names
8,455,357,851,695,611,000
Only return the files that are not yet present on disk.
parcels/scripts/get_examples.py
_still_to_download
becgorton/parcels
python
def _still_to_download(file_names, target_path): for fn in list(file_names): if os.path.exists(os.path.join(target_path, fn)): file_names.remove(fn) return file_names
def download_files(source_url, file_names, target_path): 'Mirror file_names from source_url to target_path.' _maybe_create_dir(target_path) pbar = ProgressBar() print(('Downloading %s ...' % source_url.split('/')[(- 1)])) for filename in pbar(file_names): _maybe_create_dir(os.path.join(targe...
-9,082,911,184,324,230,000
Mirror file_names from source_url to target_path.
parcels/scripts/get_examples.py
download_files
becgorton/parcels
python
def download_files(source_url, file_names, target_path): _maybe_create_dir(target_path) pbar = ProgressBar() print(('Downloading %s ...' % source_url.split('/')[(- 1)])) for filename in pbar(file_names): _maybe_create_dir(os.path.join(target_path, os.path.dirname(filename))) if (not...
def main(target_path=None): 'Get example scripts, example notebooks, and example data.\n\n Copy the examples from the package directory and get the example data either\n from the package directory or from the Parcels website.\n ' if (target_path is None): parser = argparse.ArgumentParser(descri...
37,062,962,504,163,710
Get example scripts, example notebooks, and example data. Copy the examples from the package directory and get the example data either from the package directory or from the Parcels website.
parcels/scripts/get_examples.py
main
becgorton/parcels
python
def main(target_path=None): 'Get example scripts, example notebooks, and example data.\n\n Copy the examples from the package directory and get the example data either\n from the package directory or from the Parcels website.\n ' if (target_path is None): parser = argparse.ArgumentParser(descri...
def _WatchBucket(self): 'Creates a watch on a bucket given in self.args.' self.CheckArguments() identifier = None client_token = None if self.sub_opts: for (o, a) in self.sub_opts: if (o == '-i'): identifier = a if (o == '-t'): client_t...
-8,251,014,348,727,324,000
Creates a watch on a bucket given in self.args.
gslib/commands/notification.py
_WatchBucket
BobiGilburd/gsutil
python
def _WatchBucket(self): self.CheckArguments() identifier = None client_token = None if self.sub_opts: for (o, a) in self.sub_opts: if (o == '-i'): identifier = a if (o == '-t'): client_token = a identifier = (identifier or str(uuid...
def _ListChannels(self, bucket_arg): 'Lists active channel watches on a bucket given in self.args.' bucket_url = StorageUrlFromString(bucket_arg) if (not (bucket_url.IsBucket() and (bucket_url.scheme == 'gs'))): raise CommandException(('The %s command can only be used with gs:// bucket URLs.' % self...
6,163,886,225,114,070,000
Lists active channel watches on a bucket given in self.args.
gslib/commands/notification.py
_ListChannels
BobiGilburd/gsutil
python
def _ListChannels(self, bucket_arg): bucket_url = StorageUrlFromString(bucket_arg) if (not (bucket_url.IsBucket() and (bucket_url.scheme == 'gs'))): raise CommandException(('The %s command can only be used with gs:// bucket URLs.' % self.command_name)) if (not bucket_url.IsBucket()): ra...
def _CreateTopic(self, pubsub_topic, service_account): 'Assures that a topic exists, creating it if necessary.\n\n Also adds GCS as a publisher on that bucket, if necessary.\n\n Args:\n pubsub_topic: name of the Cloud Pub/Sub topic to use/create.\n service_account: the GCS service account that needs...
-5,651,226,351,373,527,000
Assures that a topic exists, creating it if necessary. Also adds GCS as a publisher on that bucket, if necessary. Args: pubsub_topic: name of the Cloud Pub/Sub topic to use/create. service_account: the GCS service account that needs publish permission. Returns: true if we modified IAM permissions, otherwise fa...
gslib/commands/notification.py
_CreateTopic
BobiGilburd/gsutil
python
def _CreateTopic(self, pubsub_topic, service_account): 'Assures that a topic exists, creating it if necessary.\n\n Also adds GCS as a publisher on that bucket, if necessary.\n\n Args:\n pubsub_topic: name of the Cloud Pub/Sub topic to use/create.\n service_account: the GCS service account that needs...
def _EnumerateNotificationsFromArgs(self, accept_notification_configs=True): 'Yields bucket/notification tuples from command-line args.\n\n Given a list of strings that are bucket names (gs://foo) or notification\n config IDs, yield tuples of bucket names and their associated notifications.\n\n Args:\n ...
-556,215,268,115,043,140
Yields bucket/notification tuples from command-line args. Given a list of strings that are bucket names (gs://foo) or notification config IDs, yield tuples of bucket names and their associated notifications. Args: accept_notification_configs: whether notification configs are valid args. Yields: Tuples of the form...
gslib/commands/notification.py
_EnumerateNotificationsFromArgs
BobiGilburd/gsutil
python
def _EnumerateNotificationsFromArgs(self, accept_notification_configs=True): 'Yields bucket/notification tuples from command-line args.\n\n Given a list of strings that are bucket names (gs://foo) or notification\n config IDs, yield tuples of bucket names and their associated notifications.\n\n Args:\n ...
def RunCommand(self): 'Command entry point for the notification command.' self.subcommand_name = self.args.pop(0) if (self.subcommand_name in NotificationCommand.SUBCOMMANDS): metrics.LogCommandParams(subcommands=[self.subcommand_name]) return self._RunSubCommand(NotificationCommand.SUBCOMMA...
5,564,108,628,043,477,000
Command entry point for the notification command.
gslib/commands/notification.py
RunCommand
BobiGilburd/gsutil
python
def RunCommand(self): self.subcommand_name = self.args.pop(0) if (self.subcommand_name in NotificationCommand.SUBCOMMANDS): metrics.LogCommandParams(subcommands=[self.subcommand_name]) return self._RunSubCommand(NotificationCommand.SUBCOMMANDS[self.subcommand_name]) else: raise ...
def plot_plane(ax, distances: list, z_coords: list, label: str=None, decorate: bool=True, show_half: bool=False, **kwargs): '\n Plot plane.\n\n Args:\n ax: matplotlib ax.\n distances (list): List of plane intervals.\n z_coords (list): List of z coordinate of each plane.\n label (st...
4,762,202,496,574,044,000
Plot plane. Args: ax: matplotlib ax. distances (list): List of plane intervals. z_coords (list): List of z coordinate of each plane. label (str): Plot label. decorate (bool): If True, ax is decorated. show_half: If True, atom planes which are periodically equivalent are not showe...
twinpy/plot/twinboundary.py
plot_plane
kei0822kei/twinpy
python
def plot_plane(ax, distances: list, z_coords: list, label: str=None, decorate: bool=True, show_half: bool=False, **kwargs): '\n Plot plane.\n\n Args:\n ax: matplotlib ax.\n distances (list): List of plane intervals.\n z_coords (list): List of z coordinate of each plane.\n label (st...
def plot_angle(ax, angles: list, z_coords: list, label: str=None, decorate: bool=True): '\n Plot angle.\n\n Args:\n ax: matplotlib ax.\n z_coords (list): List of z coordinate of each plane.\n label (str): Plot label.\n decorate (bool): If True, ax is decorated.\n ' if decora...
8,997,156,145,619,759,000
Plot angle. Args: ax: matplotlib ax. z_coords (list): List of z coordinate of each plane. label (str): Plot label. decorate (bool): If True, ax is decorated.
twinpy/plot/twinboundary.py
plot_angle
kei0822kei/twinpy
python
def plot_angle(ax, angles: list, z_coords: list, label: str=None, decorate: bool=True): '\n Plot angle.\n\n Args:\n ax: matplotlib ax.\n z_coords (list): List of z coordinate of each plane.\n label (str): Plot label.\n decorate (bool): If True, ax is decorated.\n ' if decora...
def plot_pair_distance(ax, pair_distances: list, z_coords: list, label: str=None, decorate: bool=True): '\n Plot angle.\n\n Args:\n ax: matplotlib ax.\n pair_distances (list): List of A-B pair distances, which is originally\n primitive pair in HCP structure.\n ...
999,060,658,695,816,800
Plot angle. Args: ax: matplotlib ax. pair_distances (list): List of A-B pair distances, which is originally primitive pair in HCP structure. z_coords (list): List of z coordinate of each plane. label (str): Plot label. decorate (bool): If True, ax is decorated.
twinpy/plot/twinboundary.py
plot_pair_distance
kei0822kei/twinpy
python
def plot_pair_distance(ax, pair_distances: list, z_coords: list, label: str=None, decorate: bool=True): '\n Plot angle.\n\n Args:\n ax: matplotlib ax.\n pair_distances (list): List of A-B pair distances, which is originally\n primitive pair in HCP structure.\n ...
def single_gpu_test(model, data_loader): ' Test model with single GPU, used for visualization.\n\n Args:\n model (nn.Module): Model to be tested.\n data_loader (nn.Dataloader): Pytorch data loader.\n\n Returns:\n dict: test results\n ' model.eval() results = dict() results[...
-7,651,348,466,465,535,000
Test model with single GPU, used for visualization. Args: model (nn.Module): Model to be tested. data_loader (nn.Dataloader): Pytorch data loader. Returns: dict: test results
davarocr/davarocr/davar_videotext/apis/test.py
single_gpu_test
hikopensource/DAVAR-Lab-OCR
python
def single_gpu_test(model, data_loader): ' Test model with single GPU, used for visualization.\n\n Args:\n model (nn.Module): Model to be tested.\n data_loader (nn.Dataloader): Pytorch data loader.\n\n Returns:\n dict: test results\n ' model.eval() results = dict() results[...
def mms_load_fpi_calc_pad(probe='1', level='sitl', datatype='', data_rate='', suffix='', autoscale=True): "\n Calculates the omni-directional pitch angle distribution (summed and averaged)\n from the individual tplot variables\n \n Parameters:\n probe: str \n probe, valid values for MM...
-5,691,318,386,164,602,000
Calculates the omni-directional pitch angle distribution (summed and averaged) from the individual tplot variables Parameters: probe: str probe, valid values for MMS probes are ['1','2','3','4']. level: str indicates level of data processing. the default if no level is specified is 'sitl' ...
pyspedas/mms/fpi/mms_load_fpi_calc_pad.py
mms_load_fpi_calc_pad
shihikoo/pyspedas
python
def mms_load_fpi_calc_pad(probe='1', level='sitl', datatype=, data_rate=, suffix=, autoscale=True): "\n Calculates the omni-directional pitch angle distribution (summed and averaged)\n from the individual tplot variables\n \n Parameters:\n probe: str \n probe, valid values for MMS prob...
def read_text_file(filename, encoding='utf-8'): '\n Reads a file under python3 with encoding (default UTF-8).\n Also works under python2, without encoding.\n Uses the EAFP (https://docs.python.org/2/glossary.html#term-eafp)\n principle.\n ' try: with open(filename, 'r', encoding) as f: ...
6,698,377,301,607,065,000
Reads a file under python3 with encoding (default UTF-8). Also works under python2, without encoding. Uses the EAFP (https://docs.python.org/2/glossary.html#term-eafp) principle.
Corrfunc/__init__.py
read_text_file
dfm/suave
python
def read_text_file(filename, encoding='utf-8'): '\n Reads a file under python3 with encoding (default UTF-8).\n Also works under python2, without encoding.\n Uses the EAFP (https://docs.python.org/2/glossary.html#term-eafp)\n principle.\n ' try: with open(filename, 'r', encoding) as f: ...
def write_text_file(filename, contents, encoding='utf-8'): '\n Writes a file under python3 with encoding (default UTF-8).\n Also works under python2, without encoding.\n Uses the EAFP (https://docs.python.org/2/glossary.html#term-eafp)\n principle.\n ' try: with open(filename, 'w', encodi...
-7,734,683,783,031,064,000
Writes a file under python3 with encoding (default UTF-8). Also works under python2, without encoding. Uses the EAFP (https://docs.python.org/2/glossary.html#term-eafp) principle.
Corrfunc/__init__.py
write_text_file
dfm/suave
python
def write_text_file(filename, contents, encoding='utf-8'): '\n Writes a file under python3 with encoding (default UTF-8).\n Also works under python2, without encoding.\n Uses the EAFP (https://docs.python.org/2/glossary.html#term-eafp)\n principle.\n ' try: with open(filename, 'w', encodi...
def which(program, mode=(os.F_OK | os.X_OK), path=None): '\n Mimics the Unix utility which.\n For python3.3+, shutil.which provides all of the required functionality.\n An implementation is provided in case shutil.which does\n not exist.\n\n :param program: (required) string\n Name of progr...
5,508,605,140,352,203,000
Mimics the Unix utility which. For python3.3+, shutil.which provides all of the required functionality. An implementation is provided in case shutil.which does not exist. :param program: (required) string Name of program (can be fully-qualified path as well) :param mode: (optional) integer flag bits Perm...
Corrfunc/__init__.py
which
dfm/suave
python
def which(program, mode=(os.F_OK | os.X_OK), path=None): '\n Mimics the Unix utility which.\n For python3.3+, shutil.which provides all of the required functionality.\n An implementation is provided in case shutil.which does\n not exist.\n\n :param program: (required) string\n Name of progr...
def removeElements(self, head, val): '\n :type head: ListNode\n :type val: int\n :rtype: ListNode\n ' while head: if (head.val == val): head = head.next else: break if (not head): return head cur = head pre = cur while c...
-4,401,839,335,475,699,000
:type head: ListNode :type val: int :rtype: ListNode
src/main/python/leetcode-python/easy/203.Remove Linked List Elements.py
removeElements
sonymoon/algorithm
python
def removeElements(self, head, val): '\n :type head: ListNode\n :type val: int\n :rtype: ListNode\n ' while head: if (head.val == val): head = head.next else: break if (not head): return head cur = head pre = cur while c...
@property def ConfigFlags(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['ConfigFlags'])
1,462,245,169,808,264,000
Returns ------- - str: NOT DEFINED
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
ConfigFlags
Vibaswan/ixnetwork_restpy
python
@property def ConfigFlags(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['ConfigFlags'])
@property def DataPathId(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['DataPathId'])
8,598,606,963,486,531,000
Returns ------- - str: NOT DEFINED
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
DataPathId
Vibaswan/ixnetwork_restpy
python
@property def DataPathId(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['DataPathId'])
@property def DataPathIdAsHex(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['DataPathIdAsHex'])
804,803,447,564,948,000
Returns ------- - str: NOT DEFINED
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
DataPathIdAsHex
Vibaswan/ixnetwork_restpy
python
@property def DataPathIdAsHex(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['DataPathIdAsHex'])
@property def ErrorCode(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['ErrorCode'])
5,799,400,849,845,319,000
Returns ------- - str: NOT DEFINED
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
ErrorCode
Vibaswan/ixnetwork_restpy
python
@property def ErrorCode(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['ErrorCode'])
@property def ErrorType(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['ErrorType'])
-7,110,418,267,919,914,000
Returns ------- - str: NOT DEFINED
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
ErrorType
Vibaswan/ixnetwork_restpy
python
@property def ErrorType(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['ErrorType'])
@property def Latency(self): '\n Returns\n -------\n - number: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['Latency'])
-4,419,917,132,471,396,000
Returns ------- - number: NOT DEFINED
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
Latency
Vibaswan/ixnetwork_restpy
python
@property def Latency(self): '\n Returns\n -------\n - number: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['Latency'])
@property def LocalIp(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['LocalIp'])
-5,974,784,433,635,664,000
Returns ------- - str: NOT DEFINED
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
LocalIp
Vibaswan/ixnetwork_restpy
python
@property def LocalIp(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['LocalIp'])
@property def MissSendLength(self): '\n Returns\n -------\n - number: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['MissSendLength'])
1,972,557,766,165,532,200
Returns ------- - number: NOT DEFINED
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
MissSendLength
Vibaswan/ixnetwork_restpy
python
@property def MissSendLength(self): '\n Returns\n -------\n - number: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['MissSendLength'])
@property def NegotiatedVersion(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['NegotiatedVersion'])
-1,810,185,652,348,757,800
Returns ------- - str: NOT DEFINED
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
NegotiatedVersion
Vibaswan/ixnetwork_restpy
python
@property def NegotiatedVersion(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['NegotiatedVersion'])
@property def RemoteIp(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['RemoteIp'])
-8,948,208,293,276,165,000
Returns ------- - str: NOT DEFINED
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
RemoteIp
Vibaswan/ixnetwork_restpy
python
@property def RemoteIp(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['RemoteIp'])
@property def ReplyState(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['ReplyState'])
-4,484,793,304,505,861,000
Returns ------- - str: NOT DEFINED
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
ReplyState
Vibaswan/ixnetwork_restpy
python
@property def ReplyState(self): '\n Returns\n -------\n - str: NOT DEFINED\n ' return self._get_attribute(self._SDM_ATT_MAP['ReplyState'])
def find(self, ConfigFlags=None, DataPathId=None, DataPathIdAsHex=None, ErrorCode=None, ErrorType=None, Latency=None, LocalIp=None, MissSendLength=None, NegotiatedVersion=None, RemoteIp=None, ReplyState=None): 'Finds and retrieves switchConfigLearnedInformation resources from the server.\n\n All named parame...
2,930,267,066,556,517,400
Finds and retrieves switchConfigLearnedInformation resources from the server. All named parameters are evaluated on the server using regex. The named parameters can be used to selectively retrieve switchConfigLearnedInformation resources from the server. To retrieve an exact match ensure the parameter value starts wit...
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
find
Vibaswan/ixnetwork_restpy
python
def find(self, ConfigFlags=None, DataPathId=None, DataPathIdAsHex=None, ErrorCode=None, ErrorType=None, Latency=None, LocalIp=None, MissSendLength=None, NegotiatedVersion=None, RemoteIp=None, ReplyState=None): 'Finds and retrieves switchConfigLearnedInformation resources from the server.\n\n All named parame...
def read(self, href): 'Retrieves a single instance of switchConfigLearnedInformation data from the server.\n\n Args\n ----\n - href (str): An href to the instance to be retrieved\n\n Returns\n -------\n - self: This instance with the switchConfigLearnedInformation resources...
469,075,206,055,040,000
Retrieves a single instance of switchConfigLearnedInformation data from the server. Args ---- - href (str): An href to the instance to be retrieved Returns ------- - self: This instance with the switchConfigLearnedInformation resources from the server available through an iterator or index Raises ------ - NotFoundEr...
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/switchconfiglearnedinformation_e983ca5da0eadbba93d1ce1d2903a5b7.py
read
Vibaswan/ixnetwork_restpy
python
def read(self, href): 'Retrieves a single instance of switchConfigLearnedInformation data from the server.\n\n Args\n ----\n - href (str): An href to the instance to be retrieved\n\n Returns\n -------\n - self: This instance with the switchConfigLearnedInformation resources...
@pytest.fixture(name='light') async def light_fixture(hass: HomeAssistant, mock_entry: MockEntityFixture, mock_light: Light): 'Fixture for a single light for testing the switch platform.' Light.__config__.validate_assignment = False light_obj = mock_light.copy(deep=True) light_obj._api = mock_entry.api ...
8,335,336,190,965,998,000
Fixture for a single light for testing the switch platform.
tests/components/unifiprotect/test_switch.py
light_fixture
LW-Ho/home-assistant
python
@pytest.fixture(name='light') async def light_fixture(hass: HomeAssistant, mock_entry: MockEntityFixture, mock_light: Light): Light.__config__.validate_assignment = False light_obj = mock_light.copy(deep=True) light_obj._api = mock_entry.api light_obj.name = 'Test Light' light_obj.is_ssh_enable...
@pytest.fixture(name='camera') async def camera_fixture(hass: HomeAssistant, mock_entry: MockEntityFixture, mock_camera: Camera): 'Fixture for a single camera for testing the switch platform.' Camera.__config__.validate_assignment = False camera_obj = mock_camera.copy(deep=True) camera_obj._api = mock_e...
-5,056,614,102,248,992,000
Fixture for a single camera for testing the switch platform.
tests/components/unifiprotect/test_switch.py
camera_fixture
LW-Ho/home-assistant
python
@pytest.fixture(name='camera') async def camera_fixture(hass: HomeAssistant, mock_entry: MockEntityFixture, mock_camera: Camera): Camera.__config__.validate_assignment = False camera_obj = mock_camera.copy(deep=True) camera_obj._api = mock_entry.api camera_obj.channels[0]._api = mock_entry.api ...
@pytest.fixture(name='camera_none') async def camera_none_fixture(hass: HomeAssistant, mock_entry: MockEntityFixture, mock_camera: Camera): 'Fixture for a single camera for testing the switch platform.' Camera.__config__.validate_assignment = False camera_obj = mock_camera.copy(deep=True) camera_obj._ap...
-4,512,770,344,431,090,000
Fixture for a single camera for testing the switch platform.
tests/components/unifiprotect/test_switch.py
camera_none_fixture
LW-Ho/home-assistant
python
@pytest.fixture(name='camera_none') async def camera_none_fixture(hass: HomeAssistant, mock_entry: MockEntityFixture, mock_camera: Camera): Camera.__config__.validate_assignment = False camera_obj = mock_camera.copy(deep=True) camera_obj._api = mock_entry.api camera_obj.channels[0]._api = mock_entr...
@pytest.fixture(name='camera_privacy') async def camera_privacy_fixture(hass: HomeAssistant, mock_entry: MockEntityFixture, mock_camera: Camera): 'Fixture for a single camera for testing the switch platform.' Camera.__config__.validate_assignment = False camera_obj = mock_camera.copy(deep=True) camera_o...
-6,874,387,683,140,718,000
Fixture for a single camera for testing the switch platform.
tests/components/unifiprotect/test_switch.py
camera_privacy_fixture
LW-Ho/home-assistant
python
@pytest.fixture(name='camera_privacy') async def camera_privacy_fixture(hass: HomeAssistant, mock_entry: MockEntityFixture, mock_camera: Camera): Camera.__config__.validate_assignment = False camera_obj = mock_camera.copy(deep=True) camera_obj._api = mock_entry.api camera_obj.channels[0]._api = moc...
async def test_switch_setup_light(hass: HomeAssistant, mock_entry: MockEntityFixture, light: Light): 'Test switch entity setup for light devices.' entity_registry = er.async_get(hass) description = LIGHT_SWITCHES[1] (unique_id, entity_id) = ids_from_device_description(Platform.SWITCH, light, description...
745,013,318,945,976,300
Test switch entity setup for light devices.
tests/components/unifiprotect/test_switch.py
test_switch_setup_light
LW-Ho/home-assistant
python
async def test_switch_setup_light(hass: HomeAssistant, mock_entry: MockEntityFixture, light: Light): entity_registry = er.async_get(hass) description = LIGHT_SWITCHES[1] (unique_id, entity_id) = ids_from_device_description(Platform.SWITCH, light, description) entity = entity_registry.async_get(enti...
async def test_switch_setup_camera_all(hass: HomeAssistant, mock_entry: MockEntityFixture, camera: Camera): 'Test switch entity setup for camera devices (all enabled feature flags).' entity_registry = er.async_get(hass) for description in CAMERA_SWITCHES_BASIC: (unique_id, entity_id) = ids_from_devi...
-5,643,885,727,098,207,000
Test switch entity setup for camera devices (all enabled feature flags).
tests/components/unifiprotect/test_switch.py
test_switch_setup_camera_all
LW-Ho/home-assistant
python
async def test_switch_setup_camera_all(hass: HomeAssistant, mock_entry: MockEntityFixture, camera: Camera): entity_registry = er.async_get(hass) for description in CAMERA_SWITCHES_BASIC: (unique_id, entity_id) = ids_from_device_description(Platform.SWITCH, camera, description) entity = enti...
async def test_switch_setup_camera_none(hass: HomeAssistant, mock_entry: MockEntityFixture, camera_none: Camera): 'Test switch entity setup for camera devices (no enabled feature flags).' entity_registry = er.async_get(hass) for description in CAMERA_SWITCHES_BASIC: if (description.ufp_required_fiel...
2,929,762,239,909,379,600
Test switch entity setup for camera devices (no enabled feature flags).
tests/components/unifiprotect/test_switch.py
test_switch_setup_camera_none
LW-Ho/home-assistant
python
async def test_switch_setup_camera_none(hass: HomeAssistant, mock_entry: MockEntityFixture, camera_none: Camera): entity_registry = er.async_get(hass) for description in CAMERA_SWITCHES_BASIC: if (description.ufp_required_field is not None): continue (unique_id, entity_id) = ids...
async def test_switch_light_status(hass: HomeAssistant, light: Light): 'Tests status light switch for lights.' description = LIGHT_SWITCHES[1] light.__fields__['set_status_light'] = Mock() light.set_status_light = AsyncMock() (_, entity_id) = ids_from_device_description(Platform.SWITCH, light, descr...
-7,921,302,965,398,987,000
Tests status light switch for lights.
tests/components/unifiprotect/test_switch.py
test_switch_light_status
LW-Ho/home-assistant
python
async def test_switch_light_status(hass: HomeAssistant, light: Light): description = LIGHT_SWITCHES[1] light.__fields__['set_status_light'] = Mock() light.set_status_light = AsyncMock() (_, entity_id) = ids_from_device_description(Platform.SWITCH, light, description) (await hass.services.async_...
async def test_switch_camera_ssh(hass: HomeAssistant, camera: Camera, mock_entry: MockEntityFixture): 'Tests SSH switch for cameras.' description = CAMERA_SWITCHES[0] camera.__fields__['set_ssh'] = Mock() camera.set_ssh = AsyncMock() (_, entity_id) = ids_from_device_description(Platform.SWITCH, came...
-5,878,164,364,571,807,000
Tests SSH switch for cameras.
tests/components/unifiprotect/test_switch.py
test_switch_camera_ssh
LW-Ho/home-assistant
python
async def test_switch_camera_ssh(hass: HomeAssistant, camera: Camera, mock_entry: MockEntityFixture): description = CAMERA_SWITCHES[0] camera.__fields__['set_ssh'] = Mock() camera.set_ssh = AsyncMock() (_, entity_id) = ids_from_device_description(Platform.SWITCH, camera, description) (await ena...
@pytest.mark.parametrize('description', CAMERA_SWITCHES_NO_EXTRA) async def test_switch_camera_simple(hass: HomeAssistant, camera: Camera, description: ProtectSwitchEntityDescription): 'Tests all simple switches for cameras.' assert (description.ufp_set_method is not None) camera.__fields__[description.ufp_...
-7,129,835,431,222,116,000
Tests all simple switches for cameras.
tests/components/unifiprotect/test_switch.py
test_switch_camera_simple
LW-Ho/home-assistant
python
@pytest.mark.parametrize('description', CAMERA_SWITCHES_NO_EXTRA) async def test_switch_camera_simple(hass: HomeAssistant, camera: Camera, description: ProtectSwitchEntityDescription): assert (description.ufp_set_method is not None) camera.__fields__[description.ufp_set_method] = Mock() setattr(camera,...
async def test_switch_camera_highfps(hass: HomeAssistant, camera: Camera): 'Tests High FPS switch for cameras.' description = CAMERA_SWITCHES[3] camera.__fields__['set_video_mode'] = Mock() camera.set_video_mode = AsyncMock() (_, entity_id) = ids_from_device_description(Platform.SWITCH, camera, desc...
-8,116,559,982,682,837,000
Tests High FPS switch for cameras.
tests/components/unifiprotect/test_switch.py
test_switch_camera_highfps
LW-Ho/home-assistant
python
async def test_switch_camera_highfps(hass: HomeAssistant, camera: Camera): description = CAMERA_SWITCHES[3] camera.__fields__['set_video_mode'] = Mock() camera.set_video_mode = AsyncMock() (_, entity_id) = ids_from_device_description(Platform.SWITCH, camera, description) (await hass.services.as...
async def test_switch_camera_privacy(hass: HomeAssistant, camera: Camera): 'Tests Privacy Mode switch for cameras.' description = CAMERA_SWITCHES[4] camera.__fields__['set_privacy'] = Mock() camera.set_privacy = AsyncMock() (_, entity_id) = ids_from_device_description(Platform.SWITCH, camera, descri...
-806,886,069,751,213,200
Tests Privacy Mode switch for cameras.
tests/components/unifiprotect/test_switch.py
test_switch_camera_privacy
LW-Ho/home-assistant
python
async def test_switch_camera_privacy(hass: HomeAssistant, camera: Camera): description = CAMERA_SWITCHES[4] camera.__fields__['set_privacy'] = Mock() camera.set_privacy = AsyncMock() (_, entity_id) = ids_from_device_description(Platform.SWITCH, camera, description) (await hass.services.async_ca...
async def test_switch_camera_privacy_already_on(hass: HomeAssistant, camera_privacy: Camera): 'Tests Privacy Mode switch for cameras with privacy mode defaulted on.' description = CAMERA_SWITCHES[4] camera_privacy.__fields__['set_privacy'] = Mock() camera_privacy.set_privacy = AsyncMock() (_, entity...
150,585,740,807,563,780
Tests Privacy Mode switch for cameras with privacy mode defaulted on.
tests/components/unifiprotect/test_switch.py
test_switch_camera_privacy_already_on
LW-Ho/home-assistant
python
async def test_switch_camera_privacy_already_on(hass: HomeAssistant, camera_privacy: Camera): description = CAMERA_SWITCHES[4] camera_privacy.__fields__['set_privacy'] = Mock() camera_privacy.set_privacy = AsyncMock() (_, entity_id) = ids_from_device_description(Platform.SWITCH, camera_privacy, des...
def __init__(self, svm_kernel='linear', svm_c=0.1, fs=250, bands=None, time_windows=None, riem_opt='Riemann', rho=0.1, filter_type='butter', filter_order=2, random_state=None): ' Constructor\n\n Args:\n\n Parameters\n ----------\n\n svm_kernel: str {\'linear\', \'sigmoid\', \'rbf\'}\n ...
985,681,782,856,049,500
Constructor Args: Parameters ---------- svm_kernel: str {'linear', 'sigmoid', 'rbf'} kernel used for classifier svm_c: float regularization parameter for the classifier fs: int sampling rate of the data bands: list of int bandwidths used in filterbanks (default: [2, 4, 8, 16, 32]) ...
multiscale_bci_python/riemannian_model.py
__init__
pulp-platform/multispectral-riemannian
python
def __init__(self, svm_kernel='linear', svm_c=0.1, fs=250, bands=None, time_windows=None, riem_opt='Riemann', rho=0.1, filter_type='butter', filter_order=2, random_state=None): ' Constructor\n\n Args:\n\n Parameters\n ----------\n\n svm_kernel: str {\'linear\', \'sigmoid\', \'rbf\'}\n ...
def fit(self, samples, labels): ' Training\n\n Parameters\n ----------\n\n samples: np.array, size=(N, C, T)\n training samples\n\n labels: np.array, size=(N)\n training labels\n ' assert (len(samples.shape) == 3) no_channels = samples.shape[...
-7,846,581,110,877,279,000
Training Parameters ---------- samples: np.array, size=(N, C, T) training samples labels: np.array, size=(N) training labels
multiscale_bci_python/riemannian_model.py
fit
pulp-platform/multispectral-riemannian
python
def fit(self, samples, labels): ' Training\n\n Parameters\n ----------\n\n samples: np.array, size=(N, C, T)\n training samples\n\n labels: np.array, size=(N)\n training labels\n ' assert (len(samples.shape) == 3) no_channels = samples.shape[...