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 |
|---|---|---|---|---|---|---|---|
@message.setter
def message(self, message):
'Sets the message of this WikiCommit.\n\n\n :param message: The message of this WikiCommit. # noqa: E501\n :type: str\n '
self._message = message | -7,870,938,731,241,469,000 | Sets the message of this WikiCommit.
:param message: The message of this WikiCommit. # noqa: E501
:type: str | gitea_api/models/wiki_commit.py | message | r7l/python-gitea-api | python | @message.setter
def message(self, message):
'Sets the message of this WikiCommit.\n\n\n :param message: The message of this WikiCommit. # noqa: E501\n :type: str\n '
self._message = message |
@property
def sha(self):
'Gets the sha of this WikiCommit. # noqa: E501\n\n\n :return: The sha of this WikiCommit. # noqa: E501\n :rtype: str\n '
return self._sha | 2,141,027,612,509,132,000 | Gets the sha of this WikiCommit. # noqa: E501
:return: The sha of this WikiCommit. # noqa: E501
:rtype: str | gitea_api/models/wiki_commit.py | sha | r7l/python-gitea-api | python | @property
def sha(self):
'Gets the sha of this WikiCommit. # noqa: E501\n\n\n :return: The sha of this WikiCommit. # noqa: E501\n :rtype: str\n '
return self._sha |
@sha.setter
def sha(self, sha):
'Sets the sha of this WikiCommit.\n\n\n :param sha: The sha of this WikiCommit. # noqa: E501\n :type: str\n '
self._sha = sha | 6,294,440,623,741,654,000 | Sets the sha of this WikiCommit.
:param sha: The sha of this WikiCommit. # noqa: E501
:type: str | gitea_api/models/wiki_commit.py | sha | r7l/python-gitea-api | python | @sha.setter
def sha(self, sha):
'Sets the sha of this WikiCommit.\n\n\n :param sha: The sha of this WikiCommit. # noqa: E501\n :type: str\n '
self._sha = sha |
def to_dict(self):
'Returns the model properties as a dict'
result = {}
for (attr, _) in six.iteritems(self.swagger_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... | -3,813,903,353,230,840,000 | Returns the model properties as a dict | gitea_api/models/wiki_commit.py | to_dict | r7l/python-gitea-api | python | def to_dict(self):
result = {}
for (attr, _) in six.iteritems(self.swagger_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 | gitea_api/models/wiki_commit.py | to_str | r7l/python-gitea-api | 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` | gitea_api/models/wiki_commit.py | __repr__ | r7l/python-gitea-api | python | def __repr__(self):
return self.to_str() |
def __eq__(self, other):
'Returns true if both objects are equal'
if (not isinstance(other, WikiCommit)):
return False
return (self.__dict__ == other.__dict__) | 7,727,040,178,788,317,000 | Returns true if both objects are equal | gitea_api/models/wiki_commit.py | __eq__ | r7l/python-gitea-api | python | def __eq__(self, other):
if (not isinstance(other, WikiCommit)):
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 | gitea_api/models/wiki_commit.py | __ne__ | r7l/python-gitea-api | python | def __ne__(self, other):
return (not (self == other)) |
def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, data_collection_rule_name: Optional[pulumi.Input[str]]=None, data_flows: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['DataFlowArgs']]]]]=None, data_sources: Optional[pulumi.Input[pulumi.InputType['DataCollectionRule... | -8,366,357,137,412,955,000 | Definition of ARM tracked top level resource.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] data_collection_rule_name: The name of the data collection rule. The name is case insensitive.
:param pulumi.Input[Sequence[pulumi.Inp... | sdk/python/pulumi_azure_native/insights/v20191101preview/data_collection_rule.py | __init__ | pulumi-bot/pulumi-azure-native | python | def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, data_collection_rule_name: Optional[pulumi.Input[str]]=None, data_flows: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['DataFlowArgs']]]]]=None, data_sources: Optional[pulumi.Input[pulumi.InputType['DataCollectionRule... |
@staticmethod
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None) -> 'DataCollectionRule':
"\n Get an existing DataCollectionRule resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str reso... | -3,088,457,438,230,935,600 | Get an existing DataCollectionRule 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: ... | sdk/python/pulumi_azure_native/insights/v20191101preview/data_collection_rule.py | get | pulumi-bot/pulumi-azure-native | python | @staticmethod
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None) -> 'DataCollectionRule':
"\n Get an existing DataCollectionRule resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str reso... |
@property
@pulumi.getter(name='dataFlows')
def data_flows(self) -> pulumi.Output[Sequence['outputs.DataFlowResponse']]:
'\n The specification of data flows.\n '
return pulumi.get(self, 'data_flows') | 998,013,760,708,920,400 | The specification of data flows. | sdk/python/pulumi_azure_native/insights/v20191101preview/data_collection_rule.py | data_flows | pulumi-bot/pulumi-azure-native | python | @property
@pulumi.getter(name='dataFlows')
def data_flows(self) -> pulumi.Output[Sequence['outputs.DataFlowResponse']]:
'\n \n '
return pulumi.get(self, 'data_flows') |
@property
@pulumi.getter(name='dataSources')
def data_sources(self) -> pulumi.Output[Optional['outputs.DataCollectionRuleResponseDataSources']]:
'\n The specification of data sources. \n This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned en... | 6,409,329,648,646,107,000 | The specification of data sources.
This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. | sdk/python/pulumi_azure_native/insights/v20191101preview/data_collection_rule.py | data_sources | pulumi-bot/pulumi-azure-native | python | @property
@pulumi.getter(name='dataSources')
def data_sources(self) -> pulumi.Output[Optional['outputs.DataCollectionRuleResponseDataSources']]:
'\n The specification of data sources. \n This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned en... |
@property
@pulumi.getter
def description(self) -> pulumi.Output[Optional[str]]:
'\n Description of the data collection rule.\n '
return pulumi.get(self, 'description') | -765,155,414,852,401,200 | Description of the data collection rule. | sdk/python/pulumi_azure_native/insights/v20191101preview/data_collection_rule.py | description | pulumi-bot/pulumi-azure-native | python | @property
@pulumi.getter
def description(self) -> pulumi.Output[Optional[str]]:
'\n \n '
return pulumi.get(self, 'description') |
@property
@pulumi.getter
def destinations(self) -> pulumi.Output['outputs.DataCollectionRuleResponseDestinations']:
'\n The specification of destinations.\n '
return pulumi.get(self, 'destinations') | 2,759,344,770,410,032,600 | The specification of destinations. | sdk/python/pulumi_azure_native/insights/v20191101preview/data_collection_rule.py | destinations | pulumi-bot/pulumi-azure-native | python | @property
@pulumi.getter
def destinations(self) -> pulumi.Output['outputs.DataCollectionRuleResponseDestinations']:
'\n \n '
return pulumi.get(self, 'destinations') |
@property
@pulumi.getter
def etag(self) -> pulumi.Output[str]:
'\n Resource entity tag (ETag).\n '
return pulumi.get(self, 'etag') | 1,359,688,913,322,792,700 | Resource entity tag (ETag). | sdk/python/pulumi_azure_native/insights/v20191101preview/data_collection_rule.py | etag | pulumi-bot/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[str]:
'\n The geo-location where the resource lives.\n '
return pulumi.get(self, 'location') | 7,682,718,716,494,702,000 | The geo-location where the resource lives. | sdk/python/pulumi_azure_native/insights/v20191101preview/data_collection_rule.py | location | pulumi-bot/pulumi-azure-native | python | @property
@pulumi.getter
def location(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'location') |
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
'\n The name of the resource.\n '
return pulumi.get(self, 'name') | 7,945,008,266,317,837,000 | The name of the resource. | sdk/python/pulumi_azure_native/insights/v20191101preview/data_collection_rule.py | name | pulumi-bot/pulumi-azure-native | python | @property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'name') |
@property
@pulumi.getter(name='provisioningState')
def provisioning_state(self) -> pulumi.Output[str]:
'\n The resource provisioning state.\n '
return pulumi.get(self, 'provisioning_state') | -3,707,423,413,488,761,300 | The resource provisioning state. | sdk/python/pulumi_azure_native/insights/v20191101preview/data_collection_rule.py | provisioning_state | pulumi-bot/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 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/insights/v20191101preview/data_collection_rule.py | tags | pulumi-bot/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 The type of the resource.\n '
return pulumi.get(self, 'type') | 3,589,901,220,239,403,500 | The type of the resource. | sdk/python/pulumi_azure_native/insights/v20191101preview/data_collection_rule.py | type | pulumi-bot/pulumi-azure-native | python | @property
@pulumi.getter
def type(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'type') |
def test_corner_case_for_power_at_1(metric_class=TweedieDevianceScore):
'Test that corner case for power=1.0 produce valid result.'
metric = TweedieDevianceScore()
targets = torch.tensor([0, 1, 0, 1])
preds = torch.tensor([0.1, 0.1, 0.1, 0.1])
val = metric(preds, targets)
assert (val != 0.0)
... | -4,181,891,001,919,652,000 | Test that corner case for power=1.0 produce valid result. | tests/regression/test_tweedie_deviance.py | test_corner_case_for_power_at_1 | Abdelrhman-Hosny/metrics | python | def test_corner_case_for_power_at_1(metric_class=TweedieDevianceScore):
metric = TweedieDevianceScore()
targets = torch.tensor([0, 1, 0, 1])
preds = torch.tensor([0.1, 0.1, 0.1, 0.1])
val = metric(preds, targets)
assert (val != 0.0)
assert (not torch.isnan(val)) |
@beam.ptransform_fn
@beam.typehints.with_input_types(Union[(_INPUT_TYPE, Tuple[(_K, _INPUT_TYPE)])])
@beam.typehints.with_output_types(Union[(_OUTPUT_TYPE, Tuple[(_K, _OUTPUT_TYPE)])])
def RunInference(examples: beam.pvalue.PCollection, inference_spec_type: model_spec_pb2.InferenceSpecType) -> beam.pvalue.PCollection:
... | 2,901,633,151,631,102,000 | Run inference with a model.
There are two types of inference you can perform using this PTransform:
1. In-process inference from a SavedModel instance. Used when
`saved_model_spec` field is set in `inference_spec_type`.
2. Remote inference by using a service endpoint. Used when
`ai_platform_prediction_mode... | tfx_bsl/public/beam/run_inference.py | RunInference | RossKohler/tfx-bsl | python | @beam.ptransform_fn
@beam.typehints.with_input_types(Union[(_INPUT_TYPE, Tuple[(_K, _INPUT_TYPE)])])
@beam.typehints.with_output_types(Union[(_OUTPUT_TYPE, Tuple[(_K, _OUTPUT_TYPE)])])
def RunInference(examples: beam.pvalue.PCollection, inference_spec_type: model_spec_pb2.InferenceSpecType) -> beam.pvalue.PCollection:
... |
def hapi(trange=None, server=None, dataset=None, parameters='', suffix='', catalog=False):
"\n Loads data from a HAPI server into pytplot variables\n\n Parameters\n -----------\n trange: list of str or list of float\n Time range to load the data for\n\n server: str\n HAP... | -1,940,759,919,022,476,800 | Loads data from a HAPI server into pytplot variables
Parameters
-----------
trange: list of str or list of float
Time range to load the data for
server: str
HAPI server to load the data from
dataset: str
HAPI dataset to load
parameters: str or list of str
Parameters i... | pyspedas/hapi/hapi.py | hapi | pulupa/pyspedas | python | def hapi(trange=None, server=None, dataset=None, parameters=, suffix=, catalog=False):
"\n Loads data from a HAPI server into pytplot variables\n\n Parameters\n -----------\n trange: list of str or list of float\n Time range to load the data for\n\n server: str\n HAPI se... |
def wrap_socket(sock, server_hostname, ssl_context=None, force_proto=None):
"\n A vastly simplified SSL wrapping function. We'll probably extend this to\n do more things later.\n "
global _context
if ssl_context:
_ssl_context = ssl_context
else:
if (_context is None):
... | -732,052,899,502,781,700 | A vastly simplified SSL wrapping function. We'll probably extend this to
do more things later. | hyper/tls.py | wrap_socket | qtacore/hyper | python | def wrap_socket(sock, server_hostname, ssl_context=None, force_proto=None):
"\n A vastly simplified SSL wrapping function. We'll probably extend this to\n do more things later.\n "
global _context
if ssl_context:
_ssl_context = ssl_context
else:
if (_context is None):
... |
def init_context(cert_path=None, cert=None, cert_password=None):
"\n Create a new ``SSLContext`` that is correctly set up for an HTTP/2\n connection. This SSL context object can be customized and passed as a\n parameter to the :class:`HTTPConnection <hyper.HTTPConnection>` class.\n Provide your own cert... | -1,115,899,053,343,230,600 | Create a new ``SSLContext`` that is correctly set up for an HTTP/2
connection. This SSL context object can be customized and passed as a
parameter to the :class:`HTTPConnection <hyper.HTTPConnection>` class.
Provide your own certificate file in case you don’t want to use hyper’s
default certificate. The path to the cer... | hyper/tls.py | init_context | qtacore/hyper | python | def init_context(cert_path=None, cert=None, cert_password=None):
"\n Create a new ``SSLContext`` that is correctly set up for an HTTP/2\n connection. This SSL context object can be customized and passed as a\n parameter to the :class:`HTTPConnection <hyper.HTTPConnection>` class.\n Provide your own cert... |
def _configure_randomizer(self):
'configure domain randomizer\n '
for obstacle_names in self.obstacle_names:
RandomizerManager.get_instance().add(ModelVisualRandomizer(model_name=obstacle_names, model_randomizer_type=ModelRandomizerType.MODEL)) | 6,835,405,223,600,537,000 | configure domain randomizer | reinforcement_learning/rl_deepracer_robomaker_coach_gazebo/src/markov/agent_ctrl/obstacles_agent_ctrl.py | _configure_randomizer | LastRemote/amazon-sagemaker-examples | python | def _configure_randomizer(self):
'\n '
for obstacle_names in self.obstacle_names:
RandomizerManager.get_instance().add(ModelVisualRandomizer(model_name=obstacle_names, model_randomizer_type=ModelRandomizerType.MODEL)) |
def aws_exception_handler(e):
'AWS specific exception handler.\n Args:\n e: the exception that was raised by the underlying API call that just failed.\n Returns:\n True if this exception can be retried, False otherwise.\n '
return ('Request limit exceeded' in str(e)) | -6,550,005,376,189,701,000 | AWS specific exception handler.
Args:
e: the exception that was raised by the underlying API call that just failed.
Returns:
True if this exception can be retried, False otherwise. | managed/devops/opscli/ybops/cloud/aws/utils.py | aws_exception_handler | bhavin192/yugabyte-db | python | def aws_exception_handler(e):
'AWS specific exception handler.\n Args:\n e: the exception that was raised by the underlying API call that just failed.\n Returns:\n True if this exception can be retried, False otherwise.\n '
return ('Request limit exceeded' in str(e)) |
def aws_request_limit_retry(fn):
'A decorator for retrying an AWS operation after exceeding request limit. Does retries with\n randomized jitter. Ideally, we should reconfigure boto3 to do the right kind of retries\n internally, but as of May 2017 there does not seem to be a good way of doing that.\n\n Ini... | -5,006,045,213,595,636,000 | A decorator for retrying an AWS operation after exceeding request limit. Does retries with
randomized jitter. Ideally, we should reconfigure boto3 to do the right kind of retries
internally, but as of May 2017 there does not seem to be a good way of doing that.
Initially not adding this decorator to all functions in t... | managed/devops/opscli/ybops/cloud/aws/utils.py | aws_request_limit_retry | bhavin192/yugabyte-db | python | def aws_request_limit_retry(fn):
'A decorator for retrying an AWS operation after exceeding request limit. Does retries with\n randomized jitter. Ideally, we should reconfigure boto3 to do the right kind of retries\n internally, but as of May 2017 there does not seem to be a good way of doing that.\n\n Ini... |
def get_client(region):
'Method to get boto3 ec2 resource for given region\n Args:\n region (str): Region name\n Returns:\n boto3 resource\n '
return boto3.resource('ec2', region_name=region) | 5,647,238,591,775,809,000 | Method to get boto3 ec2 resource for given region
Args:
region (str): Region name
Returns:
boto3 resource | managed/devops/opscli/ybops/cloud/aws/utils.py | get_client | bhavin192/yugabyte-db | python | def get_client(region):
'Method to get boto3 ec2 resource for given region\n Args:\n region (str): Region name\n Returns:\n boto3 resource\n '
return boto3.resource('ec2', region_name=region) |
def get_clients(regions):
'Method to get boto3 clients for given region or all the regions if none specified.\n Args:\n regions (list): List of regions to return clients for\n Returns:\n clients(obj): Map of region to boto3 resource\n '
return {region: get_client(region) for region in reg... | -2,862,654,079,155,418,600 | Method to get boto3 clients for given region or all the regions if none specified.
Args:
regions (list): List of regions to return clients for
Returns:
clients(obj): Map of region to boto3 resource | managed/devops/opscli/ybops/cloud/aws/utils.py | get_clients | bhavin192/yugabyte-db | python | def get_clients(regions):
'Method to get boto3 clients for given region or all the regions if none specified.\n Args:\n regions (list): List of regions to return clients for\n Returns:\n clients(obj): Map of region to boto3 resource\n '
return {region: get_client(region) for region in reg... |
def get_zones(region, dest_vpc_id=None):
'Method to fetch zones for given region or all the regions if none specified.\n Args:\n region (str): Name of region to get zones of.\n Returns:\n zones (obj): Map of zone -> subnet\n '
result = {}
filters = get_filters('state', 'available')
... | 4,495,920,307,806,312,400 | Method to fetch zones for given region or all the regions if none specified.
Args:
region (str): Name of region to get zones of.
Returns:
zones (obj): Map of zone -> subnet | managed/devops/opscli/ybops/cloud/aws/utils.py | get_zones | bhavin192/yugabyte-db | python | def get_zones(region, dest_vpc_id=None):
'Method to fetch zones for given region or all the regions if none specified.\n Args:\n region (str): Name of region to get zones of.\n Returns:\n zones (obj): Map of zone -> subnet\n '
result = {}
filters = get_filters('state', 'available')
... |
def get_vpc(client, tag_name, **kwargs):
'Method to fetch vpc based on the tag_name.\n Args:\n client (boto client): Boto Client for the region to query.\n tag_name (str): VPC tag name.\n Returns:\n VPC obj: VPC object or None.\n '
filters = get_tag_filter(tag_name)
return next... | 3,140,496,971,922,859,000 | Method to fetch vpc based on the tag_name.
Args:
client (boto client): Boto Client for the region to query.
tag_name (str): VPC tag name.
Returns:
VPC obj: VPC object or None. | managed/devops/opscli/ybops/cloud/aws/utils.py | get_vpc | bhavin192/yugabyte-db | python | def get_vpc(client, tag_name, **kwargs):
'Method to fetch vpc based on the tag_name.\n Args:\n client (boto client): Boto Client for the region to query.\n tag_name (str): VPC tag name.\n Returns:\n VPC obj: VPC object or None.\n '
filters = get_tag_filter(tag_name)
return next... |
def fetch_subnets(vpc, tag_name):
'Method to fetch subnets based on the tag_name.\n Args:\n vpc (vpc obj): VPC object to search for subnets\n tag_name (str): subnet tag name.\n Returns:\n subnets (list): list of aws subnets for given vpc.\n '
filters = get_tag_filter(tag_name)
... | 7,710,063,374,320,810,000 | Method to fetch subnets based on the tag_name.
Args:
vpc (vpc obj): VPC object to search for subnets
tag_name (str): subnet tag name.
Returns:
subnets (list): list of aws subnets for given vpc. | managed/devops/opscli/ybops/cloud/aws/utils.py | fetch_subnets | bhavin192/yugabyte-db | python | def fetch_subnets(vpc, tag_name):
'Method to fetch subnets based on the tag_name.\n Args:\n vpc (vpc obj): VPC object to search for subnets\n tag_name (str): subnet tag name.\n Returns:\n subnets (list): list of aws subnets for given vpc.\n '
filters = get_tag_filter(tag_name)
... |
def create_subnet(client, vpc, zone, cidr, tag_name):
'Method to create subnet based on cidr and tag name.\n Args:\n client (boto client): Region specific boto client\n vpc (VPC object): VPC object to create subnet.\n zone (str): Availability zone name\n cidr (str): CIDR string\n ... | -29,046,076,793,090,160 | Method to create subnet based on cidr and tag name.
Args:
client (boto client): Region specific boto client
vpc (VPC object): VPC object to create subnet.
zone (str): Availability zone name
cidr (str): CIDR string
tag_name (str): Tag name for subnet.
Returns:
subnet: Newly created subnet object. | managed/devops/opscli/ybops/cloud/aws/utils.py | create_subnet | bhavin192/yugabyte-db | python | def create_subnet(client, vpc, zone, cidr, tag_name):
'Method to create subnet based on cidr and tag name.\n Args:\n client (boto client): Region specific boto client\n vpc (VPC object): VPC object to create subnet.\n zone (str): Availability zone name\n cidr (str): CIDR string\n ... |
def get_security_group(client, group_name, vpc, **kwargs):
'Method to fetch security group based on the group_name.\n Args:\n client (boto client): Region specific boto client\n group_name (str): Security Group name\n vpc (VPC object): The VPC in which to check for the SG\n Returns:\n ... | -2,037,505,821,622,541,000 | Method to fetch security group based on the group_name.
Args:
client (boto client): Region specific boto client
group_name (str): Security Group name
vpc (VPC object): The VPC in which to check for the SG
Returns:
SecurityGroup: Matching security group. | managed/devops/opscli/ybops/cloud/aws/utils.py | get_security_group | bhavin192/yugabyte-db | python | def get_security_group(client, group_name, vpc, **kwargs):
'Method to fetch security group based on the group_name.\n Args:\n client (boto client): Region specific boto client\n group_name (str): Security Group name\n vpc (VPC object): The VPC in which to check for the SG\n Returns:\n ... |
@get_or_create(get_security_group)
def create_security_group(client, group_name, vpc, description, rules):
'Method to create a security group based on the group_name and authorize ingress with\n the rules provided.\n Args:\n client (boto client): Region specific boto client\n group_name (str): s... | -3,877,660,530,089,913,000 | Method to create a security group based on the group_name and authorize ingress with
the rules provided.
Args:
client (boto client): Region specific boto client
group_name (str): security group name
description (str): description of the security group
vpc (VPC Object): VPC object to create the security ... | managed/devops/opscli/ybops/cloud/aws/utils.py | create_security_group | bhavin192/yugabyte-db | python | @get_or_create(get_security_group)
def create_security_group(client, group_name, vpc, description, rules):
'Method to create a security group based on the group_name and authorize ingress with\n the rules provided.\n Args:\n client (boto client): Region specific boto client\n group_name (str): s... |
def get_igw(client, tag_name, **kwargs):
'Method to fetch Internet Gateway based on tag_name.\n Args:\n client (boto client): Region specific boto client\n tag_name (str): Internet Gateway tag name.\n Returns:\n internet_gateway: internet gateway object.\n '
filters = get_tag_filte... | 5,410,119,642,960,169,000 | Method to fetch Internet Gateway based on tag_name.
Args:
client (boto client): Region specific boto client
tag_name (str): Internet Gateway tag name.
Returns:
internet_gateway: internet gateway object. | managed/devops/opscli/ybops/cloud/aws/utils.py | get_igw | bhavin192/yugabyte-db | python | def get_igw(client, tag_name, **kwargs):
'Method to fetch Internet Gateway based on tag_name.\n Args:\n client (boto client): Region specific boto client\n tag_name (str): Internet Gateway tag name.\n Returns:\n internet_gateway: internet gateway object.\n '
filters = get_tag_filte... |
@get_or_create(get_igw)
def create_igw(client, tag_name, vpc):
"Method to create Internet Gateway based on tag_name in given VPC. If the gateway\n already exists, it would return that object. If the object doesn't have a tag, we\n would tag it accordingly.\n Args:\n client (boto client): Region spec... | 2,810,598,964,722,193,000 | Method to create Internet Gateway based on tag_name in given VPC. If the gateway
already exists, it would return that object. If the object doesn't have a tag, we
would tag it accordingly.
Args:
client (boto client): Region specific boto client
tag_name (str): Tag name for internet gateway.
vpc (VPC object)... | managed/devops/opscli/ybops/cloud/aws/utils.py | create_igw | bhavin192/yugabyte-db | python | @get_or_create(get_igw)
def create_igw(client, tag_name, vpc):
"Method to create Internet Gateway based on tag_name in given VPC. If the gateway\n already exists, it would return that object. If the object doesn't have a tag, we\n would tag it accordingly.\n Args:\n client (boto client): Region spec... |
def get_route_table(client, tag_name, **kwargs):
'Method to fetch route table based on tag_name\n Args:\n client (boto client): Region specific boto client\n tag_name (str): Route table tag name to search for.\n Returns:\n RouteTable (obj): Matching route table object or None.\n '
... | 1,407,385,284,823,409,400 | Method to fetch route table based on tag_name
Args:
client (boto client): Region specific boto client
tag_name (str): Route table tag name to search for.
Returns:
RouteTable (obj): Matching route table object or None. | managed/devops/opscli/ybops/cloud/aws/utils.py | get_route_table | bhavin192/yugabyte-db | python | def get_route_table(client, tag_name, **kwargs):
'Method to fetch route table based on tag_name\n Args:\n client (boto client): Region specific boto client\n tag_name (str): Route table tag name to search for.\n Returns:\n RouteTable (obj): Matching route table object or None.\n '
... |
@get_or_create(get_route_table)
def create_route_table(client, tag_name, vpc):
'Method to create route table based on tag_name in given VPC. It will first\n query for the tag name to see if the route table already exists or if one is already\n attached to the VPC, if so it will return that route table.\n A... | -9,139,993,306,136,857,000 | Method to create route table based on tag_name in given VPC. It will first
query for the tag name to see if the route table already exists or if one is already
attached to the VPC, if so it will return that route table.
Args:
client (boto client): Region specific boto client
tag_name (str): Route table tag name... | managed/devops/opscli/ybops/cloud/aws/utils.py | create_route_table | bhavin192/yugabyte-db | python | @get_or_create(get_route_table)
def create_route_table(client, tag_name, vpc):
'Method to create route table based on tag_name in given VPC. It will first\n query for the tag name to see if the route table already exists or if one is already\n attached to the VPC, if so it will return that route table.\n A... |
@get_and_cleanup(get_security_group)
def cleanup_security_group(sg, **kwargs):
'Method to cleanup security group for the matching group_name.\n Args:\n sg: Instance of security group matching the group_name.\n '
sg.delete() | 4,922,713,416,734,661,000 | Method to cleanup security group for the matching group_name.
Args:
sg: Instance of security group matching the group_name. | managed/devops/opscli/ybops/cloud/aws/utils.py | cleanup_security_group | bhavin192/yugabyte-db | python | @get_and_cleanup(get_security_group)
def cleanup_security_group(sg, **kwargs):
'Method to cleanup security group for the matching group_name.\n Args:\n sg: Instance of security group matching the group_name.\n '
sg.delete() |
@get_and_cleanup(get_igw)
def cleanup_igw(igw, **kwargs):
'Method to cleanup Internet Gateway matching the tag name. And also remove any vpc\n that is attached to the Internet Gateway.\n Args:\n igw: Instance of Internet Gateway matching tag_name.\n '
for vpc in igw.attachments:
igw.deta... | -7,607,356,858,449,717,000 | Method to cleanup Internet Gateway matching the tag name. And also remove any vpc
that is attached to the Internet Gateway.
Args:
igw: Instance of Internet Gateway matching tag_name. | managed/devops/opscli/ybops/cloud/aws/utils.py | cleanup_igw | bhavin192/yugabyte-db | python | @get_and_cleanup(get_igw)
def cleanup_igw(igw, **kwargs):
'Method to cleanup Internet Gateway matching the tag name. And also remove any vpc\n that is attached to the Internet Gateway.\n Args:\n igw: Instance of Internet Gateway matching tag_name.\n '
for vpc in igw.attachments:
igw.deta... |
@get_and_cleanup(get_route_table)
def cleanup_route_table(rt, **kwargs):
'Method to cleanup the Route Table matching the tag name.\n Args:\n rt: Instance of Route Table matching tag_name.\n '
rt.delete() | 6,731,431,572,599,774,000 | Method to cleanup the Route Table matching the tag name.
Args:
rt: Instance of Route Table matching tag_name. | managed/devops/opscli/ybops/cloud/aws/utils.py | cleanup_route_table | bhavin192/yugabyte-db | python | @get_and_cleanup(get_route_table)
def cleanup_route_table(rt, **kwargs):
'Method to cleanup the Route Table matching the tag name.\n Args:\n rt: Instance of Route Table matching tag_name.\n '
rt.delete() |
def get_route_by_cidr(route_table, cidr):
'Method to check if given CIDR already attached to route table.\n Args:\n RouteTable (obj): Route Table object.\n cidr (str): CIDR string to check in route table.\n Returns:\n Route: the route for this CIDR or None if not found\n '
return d... | -4,798,626,644,708,583,000 | Method to check if given CIDR already attached to route table.
Args:
RouteTable (obj): Route Table object.
cidr (str): CIDR string to check in route table.
Returns:
Route: the route for this CIDR or None if not found | managed/devops/opscli/ybops/cloud/aws/utils.py | get_route_by_cidr | bhavin192/yugabyte-db | python | def get_route_by_cidr(route_table, cidr):
'Method to check if given CIDR already attached to route table.\n Args:\n RouteTable (obj): Route Table object.\n cidr (str): CIDR string to check in route table.\n Returns:\n Route: the route for this CIDR or None if not found\n '
return d... |
@get_or_create(get_vpc)
def create_vpc(client, tag_name, cidr):
'Method to create vpc based on the cidr and tag with tag_name.\n Args:\n client (boto client): Region specific boto client\n tag_name (str): VPC tag name\n cidr (str): CIDR string.\n Returns:\n VPC(Object): Newly creat... | 5,086,123,577,382,439,000 | Method to create vpc based on the cidr and tag with tag_name.
Args:
client (boto client): Region specific boto client
tag_name (str): VPC tag name
cidr (str): CIDR string.
Returns:
VPC(Object): Newly created VPC object. | managed/devops/opscli/ybops/cloud/aws/utils.py | create_vpc | bhavin192/yugabyte-db | python | @get_or_create(get_vpc)
def create_vpc(client, tag_name, cidr):
'Method to create vpc based on the cidr and tag with tag_name.\n Args:\n client (boto client): Region specific boto client\n tag_name (str): VPC tag name\n cidr (str): CIDR string.\n Returns:\n VPC(Object): Newly creat... |
def set_yb_sg_and_fetch_vpc(metadata, region, dest_vpc_id):
'Method to bootstrap vpc and security group, and enable vpc peering\n with the host_instance vpc.\n Args:\n metadata (obj): Cloud metadata object with cidr prefix and other metadata.\n region (str): Region name to create the vpc in.\n ... | 6,087,758,651,699,521,000 | Method to bootstrap vpc and security group, and enable vpc peering
with the host_instance vpc.
Args:
metadata (obj): Cloud metadata object with cidr prefix and other metadata.
region (str): Region name to create the vpc in.
dest_vpc_id (str): Id of the VPC that yugabyte machines will reside in.
Returns:
... | managed/devops/opscli/ybops/cloud/aws/utils.py | set_yb_sg_and_fetch_vpc | bhavin192/yugabyte-db | python | def set_yb_sg_and_fetch_vpc(metadata, region, dest_vpc_id):
'Method to bootstrap vpc and security group, and enable vpc peering\n with the host_instance vpc.\n Args:\n metadata (obj): Cloud metadata object with cidr prefix and other metadata.\n region (str): Region name to create the vpc in.\n ... |
def query_vpc(region):
'Method to query VPC against given region and respective subnets.\n Args:\n region (str): Region name to query the VPC.\n Returns:\n vpc and subnet info (obj): Object with region and zone subnet id.\n '
per_vpc_info = {}
raw_client = boto3.client('ec2', region_n... | 1,682,906,710,431,175,700 | Method to query VPC against given region and respective subnets.
Args:
region (str): Region name to query the VPC.
Returns:
vpc and subnet info (obj): Object with region and zone subnet id. | managed/devops/opscli/ybops/cloud/aws/utils.py | query_vpc | bhavin192/yugabyte-db | python | def query_vpc(region):
'Method to query VPC against given region and respective subnets.\n Args:\n region (str): Region name to query the VPC.\n Returns:\n vpc and subnet info (obj): Object with region and zone subnet id.\n '
per_vpc_info = {}
raw_client = boto3.client('ec2', region_n... |
def vpc_components_as_json(vpc, sgs, subnets):
'Method takes VPC, Security Group and Subnets and returns a json data format with ids.\n Args:\n vpc (VPC Object): Region specific VPC object\n sgs (List of Security Group Object): Region specific Security Group object\n subnets (subnet object m... | 3,918,596,843,332,259,300 | Method takes VPC, Security Group and Subnets and returns a json data format with ids.
Args:
vpc (VPC Object): Region specific VPC object
sgs (List of Security Group Object): Region specific Security Group object
subnets (subnet object map): Map of Subnet objects keyed of zone.
Retuns:
json (str): A Json... | managed/devops/opscli/ybops/cloud/aws/utils.py | vpc_components_as_json | bhavin192/yugabyte-db | python | def vpc_components_as_json(vpc, sgs, subnets):
'Method takes VPC, Security Group and Subnets and returns a json data format with ids.\n Args:\n vpc (VPC Object): Region specific VPC object\n sgs (List of Security Group Object): Region specific Security Group object\n subnets (subnet object m... |
def delete_vpc(region, host_vpc_id=None, host_vpc_region=None):
'Method to delete VPC, Subnet, Internet Gateway, Route Table and VPC peering.\n Args:\n region (str): Region name to query the VPC.\n '
vpc_region_tag = RESOURCE_PREFIX_FORMAT.format(region)
client = get_client(region)
region_v... | 4,416,998,199,135,841,300 | Method to delete VPC, Subnet, Internet Gateway, Route Table and VPC peering.
Args:
region (str): Region name to query the VPC. | managed/devops/opscli/ybops/cloud/aws/utils.py | delete_vpc | bhavin192/yugabyte-db | python | def delete_vpc(region, host_vpc_id=None, host_vpc_region=None):
'Method to delete VPC, Subnet, Internet Gateway, Route Table and VPC peering.\n Args:\n region (str): Region name to query the VPC.\n '
vpc_region_tag = RESOURCE_PREFIX_FORMAT.format(region)
client = get_client(region)
region_v... |
def tag_resource_name(client, resource_id, tag_name):
'Method to create name tag for given resource.\n Args:\n client (boto3 client): Region specific boto client\n resource_id (str): EC2 resource id to tag\n tag_name (str): Tag name.\n '
tag_resource(client, resource_id, 'Name', tag_n... | 1,643,940,847,136,764,200 | Method to create name tag for given resource.
Args:
client (boto3 client): Region specific boto client
resource_id (str): EC2 resource id to tag
tag_name (str): Tag name. | managed/devops/opscli/ybops/cloud/aws/utils.py | tag_resource_name | bhavin192/yugabyte-db | python | def tag_resource_name(client, resource_id, tag_name):
'Method to create name tag for given resource.\n Args:\n client (boto3 client): Region specific boto client\n resource_id (str): EC2 resource id to tag\n tag_name (str): Tag name.\n '
tag_resource(client, resource_id, 'Name', tag_n... |
def tag_resource(client, resource_id, tag_key, tag_value):
'Method to attach arbitrary key-value tags to resources.\n Args:\n client (boto3 client): Region specific boto client\n resource_id (str): EC2 resource id to tag\n tag_key: Tag key\n tag_value: Tag value\n '
tags = [{'K... | -7,063,555,688,052,461,000 | Method to attach arbitrary key-value tags to resources.
Args:
client (boto3 client): Region specific boto client
resource_id (str): EC2 resource id to tag
tag_key: Tag key
tag_value: Tag value | managed/devops/opscli/ybops/cloud/aws/utils.py | tag_resource | bhavin192/yugabyte-db | python | def tag_resource(client, resource_id, tag_key, tag_value):
'Method to attach arbitrary key-value tags to resources.\n Args:\n client (boto3 client): Region specific boto client\n resource_id (str): EC2 resource id to tag\n tag_key: Tag key\n tag_value: Tag value\n '
tags = [{'K... |
def get_vpc_peerings(vpc, host_vpc, **kwargs):
'Method to fetch all the VPC peerings against given VPC. If host_vpc is provided\n it will check if there is a peering against that vpc.\n Args:\n vpc(VPC object): VPC Object to search for peerings\n host_vpc (Host VPC object): Can be Null as well, ... | 6,595,738,698,098,746,000 | Method to fetch all the VPC peerings against given VPC. If host_vpc is provided
it will check if there is a peering against that vpc.
Args:
vpc(VPC object): VPC Object to search for peerings
host_vpc (Host VPC object): Can be Null as well, to check if specific host_vpc
peering is... | managed/devops/opscli/ybops/cloud/aws/utils.py | get_vpc_peerings | bhavin192/yugabyte-db | python | def get_vpc_peerings(vpc, host_vpc, **kwargs):
'Method to fetch all the VPC peerings against given VPC. If host_vpc is provided\n it will check if there is a peering against that vpc.\n Args:\n vpc(VPC object): VPC Object to search for peerings\n host_vpc (Host VPC object): Can be Null as well, ... |
@get_or_create(get_vpc_peerings)
def create_vpc_peering(client, vpc, host_vpc, target_region):
"Method would create a vpc peering between the newly created VPC and caller's VPC\n Also makes sure, if they aren't the same, then there is no need for vpc peering.\n Args:\n client (boto client): Region spec... | -4,914,788,249,579,337,000 | Method would create a vpc peering between the newly created VPC and caller's VPC
Also makes sure, if they aren't the same, then there is no need for vpc peering.
Args:
client (boto client): Region specific boto client
vpc (VPC object): Newly created VPC object
host_vpc(Host VPC object): Host VPC to peer wit... | managed/devops/opscli/ybops/cloud/aws/utils.py | create_vpc_peering | bhavin192/yugabyte-db | python | @get_or_create(get_vpc_peerings)
def create_vpc_peering(client, vpc, host_vpc, target_region):
"Method would create a vpc peering between the newly created VPC and caller's VPC\n Also makes sure, if they aren't the same, then there is no need for vpc peering.\n Args:\n client (boto client): Region spec... |
def init(name):
'\n ## Init\n\n [ID]\n Init adalah perintah inisiasi oleh metric untuk membuat sebuah project dengan pondasi yang telah di setup, cara\n penggunaan ini bisa dengan 2 cara, membuat project dari direktori saat ini (CWD) atau dengan direktori baru.\n [EN]\n Init is the com... | 4,756,611,065,565,339,000 | ## Init
[ID]
Init adalah perintah inisiasi oleh metric untuk membuat sebuah project dengan pondasi yang telah di setup, cara
penggunaan ini bisa dengan 2 cara, membuat project dari direktori saat ini (CWD) atau dengan direktori baru.
[EN]
Init is the command initiation by metric to create a project with th... | metric/cli/__init__.py | init | kzulfazriawan/metric | python | def init(name):
'\n ## Init\n\n [ID]\n Init adalah perintah inisiasi oleh metric untuk membuat sebuah project dengan pondasi yang telah di setup, cara\n penggunaan ini bisa dengan 2 cara, membuat project dari direktori saat ini (CWD) atau dengan direktori baru.\n [EN]\n Init is the com... |
def make_resource(name):
'\n ## Make resource\n\n [ID]\n Perintah ini adalah suatu perintah yang digunakan untuk membuat "resource" baru dari "script" yang telah di\n sediakan.\n [EN]\n This is a command that used to create new "resource" based from the existing "script" provided.\n\n ... | 5,630,455,689,173,030,000 | ## Make resource
[ID]
Perintah ini adalah suatu perintah yang digunakan untuk membuat "resource" baru dari "script" yang telah di
sediakan.
[EN]
This is a command that used to create new "resource" based from the existing "script" provided.
@param name: resource name | metric/cli/__init__.py | make_resource | kzulfazriawan/metric | python | def make_resource(name):
'\n ## Make resource\n\n [ID]\n Perintah ini adalah suatu perintah yang digunakan untuk membuat "resource" baru dari "script" yang telah di\n sediakan.\n [EN]\n This is a command that used to create new "resource" based from the existing "script" provided.\n\n ... |
def __init__(self, transmitted_bytes_per_sec=None, received_bytes_per_sec=None):
'\n Keyword args:\n transmitted_bytes_per_sec (float): Total bytes transmitted per second.\n received_bytes_per_sec (float): Total bytes received per second.\n '
if (transmitted_bytes_per_sec is ... | 6,875,175,826,083,959,000 | Keyword args:
transmitted_bytes_per_sec (float): Total bytes transmitted per second.
received_bytes_per_sec (float): Total bytes received per second. | pypureclient/flashblade/FB_2_3/models/replication_performance.py | __init__ | Flav-STOR-WL/py-pure-client | python | def __init__(self, transmitted_bytes_per_sec=None, received_bytes_per_sec=None):
'\n Keyword args:\n transmitted_bytes_per_sec (float): Total bytes transmitted per second.\n received_bytes_per_sec (float): Total bytes received per second.\n '
if (transmitted_bytes_per_sec is ... |
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... | 3,724,535,437,965,489,000 | Returns the model properties as a dict | pypureclient/flashblade/FB_2_3/models/replication_performance.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/flashblade/FB_2_3/models/replication_performance.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/flashblade/FB_2_3/models/replication_performance.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, ReplicationPerformance)):
return False
return (self.__dict__ == other.__dict__) | 6,495,413,359,304,010,000 | Returns true if both objects are equal | pypureclient/flashblade/FB_2_3/models/replication_performance.py | __eq__ | Flav-STOR-WL/py-pure-client | python | def __eq__(self, other):
if (not isinstance(other, ReplicationPerformance)):
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/flashblade/FB_2_3/models/replication_performance.py | __ne__ | Flav-STOR-WL/py-pure-client | python | def __ne__(self, other):
return (not (self == other)) |
def home(request):
'\n View function for simply rendering the Ionic Angular\n index.html\n '
return render(request, 'www/index.html') | 5,884,574,123,324,748,000 | View function for simply rendering the Ionic Angular
index.html | practicality/frontend/views.py | home | broden-wanner/practicality | python | def home(request):
'\n View function for simply rendering the Ionic Angular\n index.html\n '
return render(request, 'www/index.html') |
def main():
'The entry point for this script.'
usage = 'usage: %prog [dir] [-b basedir] [-o jsfile]\n example:\n %prog\n %prog assets -o js/jsfy_res.js\n '
parser = optparse.OptionParser(usage)
parser.add_option('-b', '--base', dest='basedir', help='base dir')
parser.add_... | -8,927,664,434,250,232,000 | The entry point for this script. | tools/jsfy.py | main | floatinghotpot/ajax-local | python | def main():
usage = 'usage: %prog [dir] [-b basedir] [-o jsfile]\n example:\n %prog\n %prog assets -o js/jsfy_res.js\n '
parser = optparse.OptionParser(usage)
parser.add_option('-b', '--base', dest='basedir', help='base dir')
parser.add_option('-o', '--output', dest='out... |
def to_representation(self, instance):
'Return an ordered dictionary of HAL-style links.'
request = self.context.get('request')
ret = OrderedDict()
for link in self.links:
name = link[0]
ret[name] = self.to_link(request, instance, *link[1:])
return ret | 3,141,942,805,471,202,300 | Return an ordered dictionary of HAL-style links. | django_hal/fields.py | to_representation | jacktrades/django-hal | python | def to_representation(self, instance):
request = self.context.get('request')
ret = OrderedDict()
for link in self.links:
name = link[0]
ret[name] = self.to_link(request, instance, *link[1:])
return ret |
def get_attribute(self, instance, *args, **kwargs):
'Return the whole instance, instead of looking up an attribute value.\n\n Implementation note: We do this because `Serializer.to_representation`\n builds the list of serializer fields with something like:\n\n for field in serializer_fields... | 3,648,155,090,417,222,000 | Return the whole instance, instead of looking up an attribute value.
Implementation note: We do this because `Serializer.to_representation`
builds the list of serializer fields with something like:
for field in serializer_fields:
field.to_representation(field.get_attribute(instance))
Since we need the inst... | django_hal/fields.py | get_attribute | jacktrades/django-hal | python | def get_attribute(self, instance, *args, **kwargs):
'Return the whole instance, instead of looking up an attribute value.\n\n Implementation note: We do this because `Serializer.to_representation`\n builds the list of serializer fields with something like:\n\n for field in serializer_fields... |
def to_link(self, request, instance, urlpattern, kwargs=None, query_kwargs=None):
'Return an absolute url for the given urlpattern.'
if query_kwargs:
query_kwargs = {k: getattr(instance, v) for (k, v) in query_kwargs.items()}
if (not kwargs):
url = reverse(urlpattern, request=request)
... | 3,290,308,599,027,952,600 | Return an absolute url for the given urlpattern. | django_hal/fields.py | to_link | jacktrades/django-hal | python | def to_link(self, request, instance, urlpattern, kwargs=None, query_kwargs=None):
if query_kwargs:
query_kwargs = {k: getattr(instance, v) for (k, v) in query_kwargs.items()}
if (not kwargs):
url = reverse(urlpattern, request=request)
if (not query_kwargs):
return {'href... |
@staticmethod
def parse_input_params(size=None, error=None):
'\n Check if input params are valid and return sample size.\n\n :param size: an int not smaller than 16, which we would use to estimate\n number of unique values.\n :param error: max estimation error, which is a float between 0.01 and 0.50.\... | -8,460,358,820,266,177,000 | Check if input params are valid and return sample size.
:param size: an int not smaller than 16, which we would use to estimate
number of unique values.
:param error: max estimation error, which is a float between 0.01 and 0.50.
If error is given, sample size will be calculated from error with
_get_sample_size_f... | sdks/python/apache_beam/transforms/stats.py | parse_input_params | TimvdLippe/beam | python | @staticmethod
def parse_input_params(size=None, error=None):
'\n Check if input params are valid and return sample size.\n\n :param size: an int not smaller than 16, which we would use to estimate\n number of unique values.\n :param error: max estimation error, which is a float between 0.01 and 0.50.\... |
@staticmethod
def _get_sample_size_from_est_error(est_err):
'\n :return: sample size\n\n Calculate sample size from estimation error\n '
return int(math.ceil((4.0 / math.pow(est_err, 2.0)))) | -1,706,389,842,662,100,500 | :return: sample size
Calculate sample size from estimation error | sdks/python/apache_beam/transforms/stats.py | _get_sample_size_from_est_error | TimvdLippe/beam | python | @staticmethod
def _get_sample_size_from_est_error(est_err):
'\n :return: sample size\n\n Calculate sample size from estimation error\n '
return int(math.ceil((4.0 / math.pow(est_err, 2.0)))) |
def add(self, element):
'\n :param an element from pcoll.\n :return: boolean type whether the value is in the heap\n\n Adds a value to the heap, returning whether the value is (large enough to\n be) in the heap.\n '
if ((len(self._sample_heap) >= self._sample_size) and (element < self._min_hash))... | 2,688,914,121,887,976,000 | :param an element from pcoll.
:return: boolean type whether the value is in the heap
Adds a value to the heap, returning whether the value is (large enough to
be) in the heap. | sdks/python/apache_beam/transforms/stats.py | add | TimvdLippe/beam | python | def add(self, element):
'\n :param an element from pcoll.\n :return: boolean type whether the value is in the heap\n\n Adds a value to the heap, returning whether the value is (large enough to\n be) in the heap.\n '
if ((len(self._sample_heap) >= self._sample_size) and (element < self._min_hash))... |
def get_estimate(self):
'\n :return: estimation count of unique values\n\n If heap size is smaller than sample size, just return heap size.\n Otherwise, takes into account the possibility of hash collisions,\n which become more likely than not for 2^32 distinct elements.\n Note that log(1+x) ~ x for ... | -6,950,131,626,907,893,000 | :return: estimation count of unique values
If heap size is smaller than sample size, just return heap size.
Otherwise, takes into account the possibility of hash collisions,
which become more likely than not for 2^32 distinct elements.
Note that log(1+x) ~ x for small x, so for sampleSize << maxHash
log(1 - sample_siz... | sdks/python/apache_beam/transforms/stats.py | get_estimate | TimvdLippe/beam | python | def get_estimate(self):
'\n :return: estimation count of unique values\n\n If heap size is smaller than sample size, just return heap size.\n Otherwise, takes into account the possibility of hash collisions,\n which become more likely than not for 2^32 distinct elements.\n Note that log(1+x) ~ x for ... |
def build_graph(self):
'\n Creates the computation graph\n '
' Create Variables '
with tf.variable_scope(self.name):
self.step_sizes = self._create_step_size_vars()
' --- Build inner update graph for adapting the policy and sampling trajectories --- '
(self.adapted_poli... | -1,550,013,902,086,852,400 | Creates the computation graph | meta_policy_search/meta_algos/trpo_maml.py | build_graph | Manifold-Computing/MMAML-rl | python | def build_graph(self):
'\n \n '
' Create Variables '
with tf.variable_scope(self.name):
self.step_sizes = self._create_step_size_vars()
' --- Build inner update graph for adapting the policy and sampling trajectories --- '
(self.adapted_policies_params, self.adapt_input... |
def optimize_policy(self, all_samples_data, log=True):
'\n Performs MAML outer step\n\n Args:\n all_samples_data (list) : list of lists of lists of samples (each is a dict) split by gradient update and\n meta task\n log (bool) : whether to log statistics\n\n Re... | 7,132,963,398,032,266,000 | Performs MAML outer step
Args:
all_samples_data (list) : list of lists of lists of samples (each is a dict) split by gradient update and
meta task
log (bool) : whether to log statistics
Returns:
None | meta_policy_search/meta_algos/trpo_maml.py | optimize_policy | Manifold-Computing/MMAML-rl | python | def optimize_policy(self, all_samples_data, log=True):
'\n Performs MAML outer step\n\n Args:\n all_samples_data (list) : list of lists of lists of samples (each is a dict) split by gradient update and\n meta task\n log (bool) : whether to log statistics\n\n Re... |
def __init__(self, filename):
'\n\t\tClass initialization.\n\t\t:param filename: name of the file to store the data, str\n\t\t'
self.filename = filename
self.content = {} | 5,144,989,418,529,070,000 | Class initialization.
:param filename: name of the file to store the data, str | scripts/writer.py | __init__ | STASYA00/CityMorph | python | def __init__(self, filename):
'\n\t\tClass initialization.\n\t\t:param filename: name of the file to store the data, str\n\t\t'
self.filename = filename
self.content = {} |
def add(self, instance, result):
'\n\t\tFunction that adds an instance with its smart labels to the collection\n\t\t:param instance: name of instance, str\n\t\t:param result: smart labels, dict {label_name: label_value}\n\t\t:return:\n\t\t'
self.content[instance] = result | 1,213,584,165,480,076,500 | Function that adds an instance with its smart labels to the collection
:param instance: name of instance, str
:param result: smart labels, dict {label_name: label_value}
:return: | scripts/writer.py | add | STASYA00/CityMorph | python | def add(self, instance, result):
'\n\t\tFunction that adds an instance with its smart labels to the collection\n\t\t:param instance: name of instance, str\n\t\t:param result: smart labels, dict {label_name: label_value}\n\t\t:return:\n\t\t'
self.content[instance] = result |
def get_instances(self) -> list:
'\n\t\tFunction that gets the instances that already exist in the file\n\t\t:return: existing instances, list\n\t\t'
return list(self.content.keys()) | -477,849,477,581,249,000 | Function that gets the instances that already exist in the file
:return: existing instances, list | scripts/writer.py | get_instances | STASYA00/CityMorph | python | def get_instances(self) -> list:
'\n\t\tFunction that gets the instances that already exist in the file\n\t\t:return: existing instances, list\n\t\t'
return list(self.content.keys()) |
def reset(self):
'\n\t\tFunction that resets the file to an empty state.\n\t\t:return:\n\t\t'
del self.content
self.content = {} | -6,866,196,078,460,596,000 | Function that resets the file to an empty state.
:return: | scripts/writer.py | reset | STASYA00/CityMorph | python | def reset(self):
'\n\t\tFunction that resets the file to an empty state.\n\t\t:return:\n\t\t'
del self.content
self.content = {} |
def save(self):
'\n\t\tFunction that saves all the smart labels in the class to a local file\n\t\tTODO: add saving to AWS based on AWS_SAVE in config\n\t\t:return:\n\t\t'
with open(self.filename, 'w') as f:
json.dump(self.content, f) | -2,173,692,445,259,486,500 | Function that saves all the smart labels in the class to a local file
TODO: add saving to AWS based on AWS_SAVE in config
:return: | scripts/writer.py | save | STASYA00/CityMorph | python | def save(self):
'\n\t\tFunction that saves all the smart labels in the class to a local file\n\t\tTODO: add saving to AWS based on AWS_SAVE in config\n\t\t:return:\n\t\t'
with open(self.filename, 'w') as f:
json.dump(self.content, f) |
def save(self):
"\n\t\tFunction that saves the writer's content to local system in json format.\n\t\t:return:\n\t\t"
with open(self.filename, 'a') as json_file:
json.dump(self.content, json_file) | 466,244,485,614,108,900 | Function that saves the writer's content to local system in json format.
:return: | scripts/writer.py | save | STASYA00/CityMorph | python | def save(self):
"\n\t\tFunction that saves the writer's content to local system in json format.\n\t\t:return:\n\t\t"
with open(self.filename, 'a') as json_file:
json.dump(self.content, json_file) |
@tf_export('copy')
def copy(input, tensor_name='', debug_ops_spec=[], name=None):
'Copy Op.\n\n Performs CPU-to-CPU or GPU-to-GPU deep-copying of tensor, depending on the\n device on which the tensor is allocated.\n N.B.: If the all downstream attached debug ops are disabled given the current\n gRPC gating stat... | 500,006,722,487,040,260 | Copy Op.
Performs CPU-to-CPU or GPU-to-GPU deep-copying of tensor, depending on the
device on which the tensor is allocated.
N.B.: If the all downstream attached debug ops are disabled given the current
gRPC gating status, the output will simply forward the input tensor without
deep-copying. See the documentation of D... | venv1/Lib/site-packages/tensorflow/python/debug/ops/gen_debug_ops.py | copy | Soum-Soum/Tensorflow_Face_Finder | python | @tf_export('copy')
def copy(input, tensor_name=, debug_ops_spec=[], name=None):
'Copy Op.\n\n Performs CPU-to-CPU or GPU-to-GPU deep-copying of tensor, depending on the\n device on which the tensor is allocated.\n N.B.: If the all downstream attached debug ops are disabled given the current\n gRPC gating status... |
def copy_eager_fallback(input, tensor_name='', debug_ops_spec=[], name=None):
'This is the slowpath function for Eager mode.\n This is for function copy\n '
_ctx = _context.context()
if (tensor_name is None):
tensor_name = ''
tensor_name = _execute.make_str(tensor_name, 'tensor_name')
if (... | -8,941,354,909,665,893,000 | This is the slowpath function for Eager mode.
This is for function copy | venv1/Lib/site-packages/tensorflow/python/debug/ops/gen_debug_ops.py | copy_eager_fallback | Soum-Soum/Tensorflow_Face_Finder | python | def copy_eager_fallback(input, tensor_name=, debug_ops_spec=[], name=None):
'This is the slowpath function for Eager mode.\n This is for function copy\n '
_ctx = _context.context()
if (tensor_name is None):
tensor_name =
tensor_name = _execute.make_str(tensor_name, 'tensor_name')
if (debu... |
@tf_export('copy_host')
def copy_host(input, tensor_name='', debug_ops_spec=[], name=None):
'Copy Host Op.\n\n Performs CPU-to-CPU deep-copying of tensor.\n N.B.: If the all downstream attached debug ops are disabled given the current\n gRPC gating status, the output will simply forward the input tensor without\... | 8,536,506,984,682,582,000 | Copy Host Op.
Performs CPU-to-CPU deep-copying of tensor.
N.B.: If the all downstream attached debug ops are disabled given the current
gRPC gating status, the output will simply forward the input tensor without
deep-copying. See the documentation of Debug* ops for more details.
Unlike the Copy Op, this op has HostMe... | venv1/Lib/site-packages/tensorflow/python/debug/ops/gen_debug_ops.py | copy_host | Soum-Soum/Tensorflow_Face_Finder | python | @tf_export('copy_host')
def copy_host(input, tensor_name=, debug_ops_spec=[], name=None):
'Copy Host Op.\n\n Performs CPU-to-CPU deep-copying of tensor.\n N.B.: If the all downstream attached debug ops are disabled given the current\n gRPC gating status, the output will simply forward the input tensor without\n ... |
def copy_host_eager_fallback(input, tensor_name='', debug_ops_spec=[], name=None):
'This is the slowpath function for Eager mode.\n This is for function copy_host\n '
_ctx = _context.context()
if (tensor_name is None):
tensor_name = ''
tensor_name = _execute.make_str(tensor_name, 'tensor_name'... | -8,671,730,748,628,526,000 | This is the slowpath function for Eager mode.
This is for function copy_host | venv1/Lib/site-packages/tensorflow/python/debug/ops/gen_debug_ops.py | copy_host_eager_fallback | Soum-Soum/Tensorflow_Face_Finder | python | def copy_host_eager_fallback(input, tensor_name=, debug_ops_spec=[], name=None):
'This is the slowpath function for Eager mode.\n This is for function copy_host\n '
_ctx = _context.context()
if (tensor_name is None):
tensor_name =
tensor_name = _execute.make_str(tensor_name, 'tensor_name')
... |
@tf_export('debug_identity')
def debug_identity(input, device_name='', tensor_name='', debug_urls=[], gated_grpc=False, name=None):
'Debug Identity Op.\n\n Provides an identity mapping of the non-Ref type input tensor for debugging.\n\n Args:\n input: A `Tensor`. Input tensor, non-Reference type.\n device_n... | -7,136,687,543,313,901,000 | Debug Identity Op.
Provides an identity mapping of the non-Ref type input tensor for debugging.
Args:
input: A `Tensor`. Input tensor, non-Reference type.
device_name: An optional `string`. Defaults to `""`.
tensor_name: An optional `string`. Defaults to `""`.
Name of the input tensor.
debug_urls: An opti... | venv1/Lib/site-packages/tensorflow/python/debug/ops/gen_debug_ops.py | debug_identity | Soum-Soum/Tensorflow_Face_Finder | python | @tf_export('debug_identity')
def debug_identity(input, device_name=, tensor_name=, debug_urls=[], gated_grpc=False, name=None):
'Debug Identity Op.\n\n Provides an identity mapping of the non-Ref type input tensor for debugging.\n\n Args:\n input: A `Tensor`. Input tensor, non-Reference type.\n device_name:... |
def debug_identity_eager_fallback(input, device_name='', tensor_name='', debug_urls=[], gated_grpc=False, name=None):
'This is the slowpath function for Eager mode.\n This is for function debug_identity\n '
_ctx = _context.context()
if (device_name is None):
device_name = ''
device_name = _exe... | -1,054,784,189,007,809,000 | This is the slowpath function for Eager mode.
This is for function debug_identity | venv1/Lib/site-packages/tensorflow/python/debug/ops/gen_debug_ops.py | debug_identity_eager_fallback | Soum-Soum/Tensorflow_Face_Finder | python | def debug_identity_eager_fallback(input, device_name=, tensor_name=, debug_urls=[], gated_grpc=False, name=None):
'This is the slowpath function for Eager mode.\n This is for function debug_identity\n '
_ctx = _context.context()
if (device_name is None):
device_name =
device_name = _execute.m... |
@tf_export('debug_nan_count')
def debug_nan_count(input, device_name='', tensor_name='', debug_urls=[], gated_grpc=False, name=None):
'Debug NaN Value Counter Op\n\n Counts number of NaNs in the input tensor, for debugging.\n\n Args:\n input: A `Tensor`. Input tensor, non-Reference type.\n device_name: An o... | 6,683,522,879,572,854,000 | Debug NaN Value Counter Op
Counts number of NaNs in the input tensor, for debugging.
Args:
input: A `Tensor`. Input tensor, non-Reference type.
device_name: An optional `string`. Defaults to `""`.
tensor_name: An optional `string`. Defaults to `""`.
Name of the input tensor.
debug_urls: An optional list o... | venv1/Lib/site-packages/tensorflow/python/debug/ops/gen_debug_ops.py | debug_nan_count | Soum-Soum/Tensorflow_Face_Finder | python | @tf_export('debug_nan_count')
def debug_nan_count(input, device_name=, tensor_name=, debug_urls=[], gated_grpc=False, name=None):
'Debug NaN Value Counter Op\n\n Counts number of NaNs in the input tensor, for debugging.\n\n Args:\n input: A `Tensor`. Input tensor, non-Reference type.\n device_name: An optio... |
def debug_nan_count_eager_fallback(input, device_name='', tensor_name='', debug_urls=[], gated_grpc=False, name=None):
'This is the slowpath function for Eager mode.\n This is for function debug_nan_count\n '
_ctx = _context.context()
if (device_name is None):
device_name = ''
device_name = _e... | 5,057,920,901,955,037,000 | This is the slowpath function for Eager mode.
This is for function debug_nan_count | venv1/Lib/site-packages/tensorflow/python/debug/ops/gen_debug_ops.py | debug_nan_count_eager_fallback | Soum-Soum/Tensorflow_Face_Finder | python | def debug_nan_count_eager_fallback(input, device_name=, tensor_name=, debug_urls=[], gated_grpc=False, name=None):
'This is the slowpath function for Eager mode.\n This is for function debug_nan_count\n '
_ctx = _context.context()
if (device_name is None):
device_name =
device_name = _execute... |
@tf_export('debug_numeric_summary')
def debug_numeric_summary(input, device_name='', tensor_name='', debug_urls=[], lower_bound=float('-inf'), upper_bound=float('inf'), mute_if_healthy=False, gated_grpc=False, name=None):
'Debug Numeric Summary Op.\n\n Provide a basic summary of numeric value types, range and dist... | -8,895,079,336,447,695,000 | Debug Numeric Summary Op.
Provide a basic summary of numeric value types, range and distribution.
Args:
input: A `Tensor`. Input tensor, non-Reference type, float or double.
device_name: An optional `string`. Defaults to `""`.
tensor_name: An optional `string`. Defaults to `""`.
Name of the input tensor.
... | venv1/Lib/site-packages/tensorflow/python/debug/ops/gen_debug_ops.py | debug_numeric_summary | Soum-Soum/Tensorflow_Face_Finder | python | @tf_export('debug_numeric_summary')
def debug_numeric_summary(input, device_name=, tensor_name=, debug_urls=[], lower_bound=float('-inf'), upper_bound=float('inf'), mute_if_healthy=False, gated_grpc=False, name=None):
'Debug Numeric Summary Op.\n\n Provide a basic summary of numeric value types, range and distribu... |
def debug_numeric_summary_eager_fallback(input, device_name='', tensor_name='', debug_urls=[], lower_bound=float('-inf'), upper_bound=float('inf'), mute_if_healthy=False, gated_grpc=False, name=None):
'This is the slowpath function for Eager mode.\n This is for function debug_numeric_summary\n '
_ctx = _conte... | 2,770,299,211,202,803,700 | This is the slowpath function for Eager mode.
This is for function debug_numeric_summary | venv1/Lib/site-packages/tensorflow/python/debug/ops/gen_debug_ops.py | debug_numeric_summary_eager_fallback | Soum-Soum/Tensorflow_Face_Finder | python | def debug_numeric_summary_eager_fallback(input, device_name=, tensor_name=, debug_urls=[], lower_bound=float('-inf'), upper_bound=float('inf'), mute_if_healthy=False, gated_grpc=False, name=None):
'This is the slowpath function for Eager mode.\n This is for function debug_numeric_summary\n '
_ctx = _context.c... |
@click.command('exons', short_help='Load exons')
@click.option('-e', '--exons-file', type=click.Path(exists=True), help='Path to file with ensembl exons')
@click.option('-b', '--build', type=click.Choice(['37', '38']), default='37', show_default=True)
@with_appcontext
def exons(build, exons_file):
'Load exons into ... | -8,420,868,486,457,255,000 | Load exons into the scout database. If no file, fetch exons from ensembl biomart | scout/commands/load/exons.py | exons | Clinical-Genomics/scout | python | @click.command('exons', short_help='Load exons')
@click.option('-e', '--exons-file', type=click.Path(exists=True), help='Path to file with ensembl exons')
@click.option('-b', '--build', type=click.Choice(['37', '38']), default='37', show_default=True)
@with_appcontext
def exons(build, exons_file):
adapter = st... |
def dictkeys(dct):
'\n Returns a list of keys of dictionary\n\n dict.keys returns a view that works like .keys in Python 2\n *except* any modifications in the dictionary will be visible\n (and will cause errors if the view is being iterated over while\n it is modified).\n '... | -3,805,923,842,563,118,600 | Returns a list of keys of dictionary
dict.keys returns a view that works like .keys in Python 2
*except* any modifications in the dictionary will be visible
(and will cause errors if the view is being iterated over while
it is modified). | pika/compat.py | dictkeys | EnjoyLifeFund/macHighSierra-py36-pkgs | python | def dictkeys(dct):
'\n Returns a list of keys of dictionary\n\n dict.keys returns a view that works like .keys in Python 2\n *except* any modifications in the dictionary will be visible\n (and will cause errors if the view is being iterated over while\n it is modified).\n '... |
def dictvalues(dct):
'\n Returns a list of values of a dictionary\n\n dict.values returns a view that works like .values in Python 2\n *except* any modifications in the dictionary will be visible\n (and will cause errors if the view is being iterated over while\n it is modified).\... | 2,355,709,757,336,019,500 | Returns a list of values of a dictionary
dict.values returns a view that works like .values in Python 2
*except* any modifications in the dictionary will be visible
(and will cause errors if the view is being iterated over while
it is modified). | pika/compat.py | dictvalues | EnjoyLifeFund/macHighSierra-py36-pkgs | python | def dictvalues(dct):
'\n Returns a list of values of a dictionary\n\n dict.values returns a view that works like .values in Python 2\n *except* any modifications in the dictionary will be visible\n (and will cause errors if the view is being iterated over while\n it is modified).\... |
def dict_iteritems(dct):
'\n Returns an iterator of items (key/value pairs) of a dictionary\n\n dict.items returns a view that works like .items in Python 2\n *except* any modifications in the dictionary will be visible\n (and will cause errors if the view is being iterated over while\n ... | -837,165,073,974,448,100 | Returns an iterator of items (key/value pairs) of a dictionary
dict.items returns a view that works like .items in Python 2
*except* any modifications in the dictionary will be visible
(and will cause errors if the view is being iterated over while
it is modified). | pika/compat.py | dict_iteritems | EnjoyLifeFund/macHighSierra-py36-pkgs | python | def dict_iteritems(dct):
'\n Returns an iterator of items (key/value pairs) of a dictionary\n\n dict.items returns a view that works like .items in Python 2\n *except* any modifications in the dictionary will be visible\n (and will cause errors if the view is being iterated over while\n ... |
def dict_itervalues(dct):
'\n :param dict dct:\n :returns: an iterator of the values of a dictionary\n '
return dct.values() | 5,895,645,862,643,673,000 | :param dict dct:
:returns: an iterator of the values of a dictionary | pika/compat.py | dict_itervalues | EnjoyLifeFund/macHighSierra-py36-pkgs | python | def dict_itervalues(dct):
'\n :param dict dct:\n :returns: an iterator of the values of a dictionary\n '
return dct.values() |
def byte(*args):
'\n This is the same as Python 2 `chr(n)` for bytes in Python 3\n\n Returns a single byte `bytes` for the given int argument (we\n optimize it a bit here by passing the positional argument tuple\n directly to the bytes constructor.\n '
return bytes(args) | -8,906,836,667,376,551,000 | This is the same as Python 2 `chr(n)` for bytes in Python 3
Returns a single byte `bytes` for the given int argument (we
optimize it a bit here by passing the positional argument tuple
directly to the bytes constructor. | pika/compat.py | byte | EnjoyLifeFund/macHighSierra-py36-pkgs | python | def byte(*args):
'\n This is the same as Python 2 `chr(n)` for bytes in Python 3\n\n Returns a single byte `bytes` for the given int argument (we\n optimize it a bit here by passing the positional argument tuple\n directly to the bytes constructor.\n '
return bytes(args) |
def canonical_str(value):
'\n Return the canonical str value for the string.\n In both Python 3 and Python 2 this is str.\n '
return str(value) | -6,477,917,416,949,840,000 | Return the canonical str value for the string.
In both Python 3 and Python 2 this is str. | pika/compat.py | canonical_str | EnjoyLifeFund/macHighSierra-py36-pkgs | python | def canonical_str(value):
'\n Return the canonical str value for the string.\n In both Python 3 and Python 2 this is str.\n '
return str(value) |
def canonical_str(value):
'\n Returns the canonical string value of the given string.\n In Python 2 this is the value unchanged if it is an str, otherwise\n it is the unicode value encoded as UTF-8.\n '
try:
return str(value)
except UnicodeEncodeError:
return str(... | -7,015,359,506,289,830,000 | Returns the canonical string value of the given string.
In Python 2 this is the value unchanged if it is an str, otherwise
it is the unicode value encoded as UTF-8. | pika/compat.py | canonical_str | EnjoyLifeFund/macHighSierra-py36-pkgs | python | def canonical_str(value):
'\n Returns the canonical string value of the given string.\n In Python 2 this is the value unchanged if it is an str, otherwise\n it is the unicode value encoded as UTF-8.\n '
try:
return str(value)
except UnicodeEncodeError:
return str(... |
def __init__(self, value=None, reject_on_error=None, checked=None, local_vars_configuration=None):
'ExtendedBoolValueTest - a model defined in OpenAPI'
if (local_vars_configuration is None):
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self.... | 5,704,099,914,382,409,000 | ExtendedBoolValueTest - a model defined in OpenAPI | telestream_cloud_qc_sdk/telestream_cloud_qc/models/extended_bool_value_test.py | __init__ | Telestream/telestream-cloud-python-sdk | python | def __init__(self, value=None, reject_on_error=None, checked=None, local_vars_configuration=None):
if (local_vars_configuration is None):
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._value = None
self._reject_on_error = None
s... |
@property
def value(self):
'Gets the value of this ExtendedBoolValueTest. # noqa: E501\n\n\n :return: The value of this ExtendedBoolValueTest. # noqa: E501\n :rtype: ExtendedBool\n '
return self._value | -7,428,640,341,322,616,000 | Gets the value of this ExtendedBoolValueTest. # noqa: E501
:return: The value of this ExtendedBoolValueTest. # noqa: E501
:rtype: ExtendedBool | telestream_cloud_qc_sdk/telestream_cloud_qc/models/extended_bool_value_test.py | value | Telestream/telestream-cloud-python-sdk | python | @property
def value(self):
'Gets the value of this ExtendedBoolValueTest. # noqa: E501\n\n\n :return: The value of this ExtendedBoolValueTest. # noqa: E501\n :rtype: ExtendedBool\n '
return self._value |
@value.setter
def value(self, value):
'Sets the value of this ExtendedBoolValueTest.\n\n\n :param value: The value of this ExtendedBoolValueTest. # noqa: E501\n :type: ExtendedBool\n '
self._value = value | -8,696,274,499,143,007,000 | Sets the value of this ExtendedBoolValueTest.
:param value: The value of this ExtendedBoolValueTest. # noqa: E501
:type: ExtendedBool | telestream_cloud_qc_sdk/telestream_cloud_qc/models/extended_bool_value_test.py | value | Telestream/telestream-cloud-python-sdk | python | @value.setter
def value(self, value):
'Sets the value of this ExtendedBoolValueTest.\n\n\n :param value: The value of this ExtendedBoolValueTest. # noqa: E501\n :type: ExtendedBool\n '
self._value = value |
@property
def reject_on_error(self):
'Gets the reject_on_error of this ExtendedBoolValueTest. # noqa: E501\n\n\n :return: The reject_on_error of this ExtendedBoolValueTest. # noqa: E501\n :rtype: bool\n '
return self._reject_on_error | 5,830,948,398,873,198,000 | Gets the reject_on_error of this ExtendedBoolValueTest. # noqa: E501
:return: The reject_on_error of this ExtendedBoolValueTest. # noqa: E501
:rtype: bool | telestream_cloud_qc_sdk/telestream_cloud_qc/models/extended_bool_value_test.py | reject_on_error | Telestream/telestream-cloud-python-sdk | python | @property
def reject_on_error(self):
'Gets the reject_on_error of this ExtendedBoolValueTest. # noqa: E501\n\n\n :return: The reject_on_error of this ExtendedBoolValueTest. # noqa: E501\n :rtype: bool\n '
return self._reject_on_error |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.