body_hash
stringlengths
64
64
body
stringlengths
23
109k
docstring
stringlengths
1
57k
path
stringlengths
4
198
name
stringlengths
1
115
repository_name
stringlengths
7
111
repository_stars
float64
0
191k
lang
stringclasses
1 value
body_without_docstring
stringlengths
14
108k
unified
stringlengths
45
133k
2d8c41dbc0cbc69b779a06f6461365bed9cb17da24ae9968d09554c800db975d
@property @pulumi.getter def accepter(self) -> Optional[pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs']]: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n ' return pulumi.get(self, 'accepter')
A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
accepter
rapzo/pulumi-aws
260
python
@property @pulumi.getter def accepter(self) -> Optional[pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs']]: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n ' return pulumi.get(self, 'accepter')
@property @pulumi.getter def accepter(self) -> Optional[pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs']]: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n ' return pulumi.get(self, 'accepter')<|docstring|>A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.<|endoftext|>
377c9393170863f11aed4a65688e92457ae945c982310260aa3514386add23f9
@property @pulumi.getter(name='autoAccept') def auto_accept(self) -> Optional[pulumi.Input[bool]]: '\n Whether or not to accept the peering request. Defaults to `false`.\n ' return pulumi.get(self, 'auto_accept')
Whether or not to accept the peering request. Defaults to `false`.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
auto_accept
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='autoAccept') def auto_accept(self) -> Optional[pulumi.Input[bool]]: '\n \n ' return pulumi.get(self, 'auto_accept')
@property @pulumi.getter(name='autoAccept') def auto_accept(self) -> Optional[pulumi.Input[bool]]: '\n \n ' return pulumi.get(self, 'auto_accept')<|docstring|>Whether or not to accept the peering request. Defaults to `false`.<|endoftext|>
42f59d8efc4217baaff6442be878214d9e444d01feeddb7c1a7640dea313767e
@property @pulumi.getter def requester(self) -> Optional[pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs']]: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n ' return pulumi.get(self, 'requester')
A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
requester
rapzo/pulumi-aws
260
python
@property @pulumi.getter def requester(self) -> Optional[pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs']]: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n ' return pulumi.get(self, 'requester')
@property @pulumi.getter def requester(self) -> Optional[pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs']]: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n ' return pulumi.get(self, 'requester')<|docstring|>A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.<|endoftext|>
8d2717789d774b16c160ccdb444f04531f8ff6c2fec4e9f5c82e51b273ab2da7
@property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.\n ' return pulumi.get(self, 'tags')
A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
tags
rapzo/pulumi-aws
260
python
@property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n \n ' return pulumi.get(self, 'tags')
@property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n \n ' return pulumi.get(self, 'tags')<|docstring|>A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.<|endoftext|>
a44c367f9f2bf7320a71acffa452b362e75c36fa1f2a32a8df1b3e62d8a12db7
@property @pulumi.getter(name='tagsAll') def tags_all(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n A map of tags assigned to the resource, including those inherited from the provider .\n ' return pulumi.get(self, 'tags_all')
A map of tags assigned to the resource, including those inherited from the provider .
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
tags_all
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='tagsAll') def tags_all(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n \n ' return pulumi.get(self, 'tags_all')
@property @pulumi.getter(name='tagsAll') def tags_all(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n \n ' return pulumi.get(self, 'tags_all')<|docstring|>A map of tags assigned to the resource, including those inherited from the provider .<|endoftext|>
a645a7f366c9df27c0e80d77add8e84318127ea60ed509ffa13330e48ad2575a
def __init__(__self__, *, accept_status: Optional[pulumi.Input[str]]=None, accepter: Optional[pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs']]=None, auto_accept: Optional[pulumi.Input[bool]]=None, peer_owner_id: Optional[pulumi.Input[str]]=None, peer_region: Optional[pulumi.Input[str]]=None, peer_vpc_id: Optional[pulumi.Input[str]]=None, requester: Optional[pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs']]=None, tags: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, tags_all: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, vpc_id: Optional[pulumi.Input[str]]=None, vpc_peering_connection_id: Optional[pulumi.Input[str]]=None): "\n Input properties used for looking up and filtering VpcPeeringConnectionAccepter resources.\n :param pulumi.Input[str] accept_status: The status of the VPC Peering Connection request.\n :param pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs'] accepter: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`.\n :param pulumi.Input[str] peer_owner_id: The AWS account ID of the owner of the requester VPC.\n :param pulumi.Input[str] peer_region: The region of the accepter VPC.\n :param pulumi.Input[str] peer_vpc_id: The ID of the requester VPC.\n :param pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs'] requester: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider .\n :param pulumi.Input[str] vpc_id: The ID of the accepter VPC.\n :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.\n " if (accept_status is not None): pulumi.set(__self__, 'accept_status', accept_status) if (accepter is not None): pulumi.set(__self__, 'accepter', accepter) if (auto_accept is not None): pulumi.set(__self__, 'auto_accept', auto_accept) if (peer_owner_id is not None): pulumi.set(__self__, 'peer_owner_id', peer_owner_id) if (peer_region is not None): pulumi.set(__self__, 'peer_region', peer_region) if (peer_vpc_id is not None): pulumi.set(__self__, 'peer_vpc_id', peer_vpc_id) if (requester is not None): pulumi.set(__self__, 'requester', requester) if (tags is not None): pulumi.set(__self__, 'tags', tags) if (tags_all is not None): pulumi.set(__self__, 'tags_all', tags_all) if (vpc_id is not None): pulumi.set(__self__, 'vpc_id', vpc_id) if (vpc_peering_connection_id is not None): pulumi.set(__self__, 'vpc_peering_connection_id', vpc_peering_connection_id)
Input properties used for looking up and filtering VpcPeeringConnectionAccepter resources. :param pulumi.Input[str] accept_status: The status of the VPC Peering Connection request. :param pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs'] accepter: A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC. :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`. :param pulumi.Input[str] peer_owner_id: The AWS account ID of the owner of the requester VPC. :param pulumi.Input[str] peer_region: The region of the accepter VPC. :param pulumi.Input[str] peer_vpc_id: The ID of the requester VPC. :param pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs'] requester: A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider . :param pulumi.Input[str] vpc_id: The ID of the accepter VPC. :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
__init__
rapzo/pulumi-aws
260
python
def __init__(__self__, *, accept_status: Optional[pulumi.Input[str]]=None, accepter: Optional[pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs']]=None, auto_accept: Optional[pulumi.Input[bool]]=None, peer_owner_id: Optional[pulumi.Input[str]]=None, peer_region: Optional[pulumi.Input[str]]=None, peer_vpc_id: Optional[pulumi.Input[str]]=None, requester: Optional[pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs']]=None, tags: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, tags_all: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, vpc_id: Optional[pulumi.Input[str]]=None, vpc_peering_connection_id: Optional[pulumi.Input[str]]=None): "\n Input properties used for looking up and filtering VpcPeeringConnectionAccepter resources.\n :param pulumi.Input[str] accept_status: The status of the VPC Peering Connection request.\n :param pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs'] accepter: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`.\n :param pulumi.Input[str] peer_owner_id: The AWS account ID of the owner of the requester VPC.\n :param pulumi.Input[str] peer_region: The region of the accepter VPC.\n :param pulumi.Input[str] peer_vpc_id: The ID of the requester VPC.\n :param pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs'] requester: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider .\n :param pulumi.Input[str] vpc_id: The ID of the accepter VPC.\n :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.\n " if (accept_status is not None): pulumi.set(__self__, 'accept_status', accept_status) if (accepter is not None): pulumi.set(__self__, 'accepter', accepter) if (auto_accept is not None): pulumi.set(__self__, 'auto_accept', auto_accept) if (peer_owner_id is not None): pulumi.set(__self__, 'peer_owner_id', peer_owner_id) if (peer_region is not None): pulumi.set(__self__, 'peer_region', peer_region) if (peer_vpc_id is not None): pulumi.set(__self__, 'peer_vpc_id', peer_vpc_id) if (requester is not None): pulumi.set(__self__, 'requester', requester) if (tags is not None): pulumi.set(__self__, 'tags', tags) if (tags_all is not None): pulumi.set(__self__, 'tags_all', tags_all) if (vpc_id is not None): pulumi.set(__self__, 'vpc_id', vpc_id) if (vpc_peering_connection_id is not None): pulumi.set(__self__, 'vpc_peering_connection_id', vpc_peering_connection_id)
def __init__(__self__, *, accept_status: Optional[pulumi.Input[str]]=None, accepter: Optional[pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs']]=None, auto_accept: Optional[pulumi.Input[bool]]=None, peer_owner_id: Optional[pulumi.Input[str]]=None, peer_region: Optional[pulumi.Input[str]]=None, peer_vpc_id: Optional[pulumi.Input[str]]=None, requester: Optional[pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs']]=None, tags: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, tags_all: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, vpc_id: Optional[pulumi.Input[str]]=None, vpc_peering_connection_id: Optional[pulumi.Input[str]]=None): "\n Input properties used for looking up and filtering VpcPeeringConnectionAccepter resources.\n :param pulumi.Input[str] accept_status: The status of the VPC Peering Connection request.\n :param pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs'] accepter: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`.\n :param pulumi.Input[str] peer_owner_id: The AWS account ID of the owner of the requester VPC.\n :param pulumi.Input[str] peer_region: The region of the accepter VPC.\n :param pulumi.Input[str] peer_vpc_id: The ID of the requester VPC.\n :param pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs'] requester: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider .\n :param pulumi.Input[str] vpc_id: The ID of the accepter VPC.\n :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.\n " if (accept_status is not None): pulumi.set(__self__, 'accept_status', accept_status) if (accepter is not None): pulumi.set(__self__, 'accepter', accepter) if (auto_accept is not None): pulumi.set(__self__, 'auto_accept', auto_accept) if (peer_owner_id is not None): pulumi.set(__self__, 'peer_owner_id', peer_owner_id) if (peer_region is not None): pulumi.set(__self__, 'peer_region', peer_region) if (peer_vpc_id is not None): pulumi.set(__self__, 'peer_vpc_id', peer_vpc_id) if (requester is not None): pulumi.set(__self__, 'requester', requester) if (tags is not None): pulumi.set(__self__, 'tags', tags) if (tags_all is not None): pulumi.set(__self__, 'tags_all', tags_all) if (vpc_id is not None): pulumi.set(__self__, 'vpc_id', vpc_id) if (vpc_peering_connection_id is not None): pulumi.set(__self__, 'vpc_peering_connection_id', vpc_peering_connection_id)<|docstring|>Input properties used for looking up and filtering VpcPeeringConnectionAccepter resources. :param pulumi.Input[str] accept_status: The status of the VPC Peering Connection request. :param pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs'] accepter: A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC. :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`. :param pulumi.Input[str] peer_owner_id: The AWS account ID of the owner of the requester VPC. :param pulumi.Input[str] peer_region: The region of the accepter VPC. :param pulumi.Input[str] peer_vpc_id: The ID of the requester VPC. :param pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs'] requester: A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider . :param pulumi.Input[str] vpc_id: The ID of the accepter VPC. :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.<|endoftext|>
c8f07a044eb45791af3e5d22b589a8265a5e54e201f4ff726413d88feb65c165
@property @pulumi.getter(name='acceptStatus') def accept_status(self) -> Optional[pulumi.Input[str]]: '\n The status of the VPC Peering Connection request.\n ' return pulumi.get(self, 'accept_status')
The status of the VPC Peering Connection request.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
accept_status
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='acceptStatus') def accept_status(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'accept_status')
@property @pulumi.getter(name='acceptStatus') def accept_status(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'accept_status')<|docstring|>The status of the VPC Peering Connection request.<|endoftext|>
2d8c41dbc0cbc69b779a06f6461365bed9cb17da24ae9968d09554c800db975d
@property @pulumi.getter def accepter(self) -> Optional[pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs']]: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n ' return pulumi.get(self, 'accepter')
A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
accepter
rapzo/pulumi-aws
260
python
@property @pulumi.getter def accepter(self) -> Optional[pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs']]: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n ' return pulumi.get(self, 'accepter')
@property @pulumi.getter def accepter(self) -> Optional[pulumi.Input['VpcPeeringConnectionAccepterAccepterArgs']]: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n ' return pulumi.get(self, 'accepter')<|docstring|>A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.<|endoftext|>
377c9393170863f11aed4a65688e92457ae945c982310260aa3514386add23f9
@property @pulumi.getter(name='autoAccept') def auto_accept(self) -> Optional[pulumi.Input[bool]]: '\n Whether or not to accept the peering request. Defaults to `false`.\n ' return pulumi.get(self, 'auto_accept')
Whether or not to accept the peering request. Defaults to `false`.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
auto_accept
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='autoAccept') def auto_accept(self) -> Optional[pulumi.Input[bool]]: '\n \n ' return pulumi.get(self, 'auto_accept')
@property @pulumi.getter(name='autoAccept') def auto_accept(self) -> Optional[pulumi.Input[bool]]: '\n \n ' return pulumi.get(self, 'auto_accept')<|docstring|>Whether or not to accept the peering request. Defaults to `false`.<|endoftext|>
4022e2621c89063228e37176c38d15b87f3f3110ed84ca5a19d19f2894f04f51
@property @pulumi.getter(name='peerOwnerId') def peer_owner_id(self) -> Optional[pulumi.Input[str]]: '\n The AWS account ID of the owner of the requester VPC.\n ' return pulumi.get(self, 'peer_owner_id')
The AWS account ID of the owner of the requester VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
peer_owner_id
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='peerOwnerId') def peer_owner_id(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'peer_owner_id')
@property @pulumi.getter(name='peerOwnerId') def peer_owner_id(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'peer_owner_id')<|docstring|>The AWS account ID of the owner of the requester VPC.<|endoftext|>
91d9043a7c9c02f29114bca624cac76abf24dca817b999a93e3642dfcaa990de
@property @pulumi.getter(name='peerRegion') def peer_region(self) -> Optional[pulumi.Input[str]]: '\n The region of the accepter VPC.\n ' return pulumi.get(self, 'peer_region')
The region of the accepter VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
peer_region
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='peerRegion') def peer_region(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'peer_region')
@property @pulumi.getter(name='peerRegion') def peer_region(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'peer_region')<|docstring|>The region of the accepter VPC.<|endoftext|>
a4cdd237eb9162e59010ff400d6af8713df911387845d89834bde5e27c437e59
@property @pulumi.getter(name='peerVpcId') def peer_vpc_id(self) -> Optional[pulumi.Input[str]]: '\n The ID of the requester VPC.\n ' return pulumi.get(self, 'peer_vpc_id')
The ID of the requester VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
peer_vpc_id
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='peerVpcId') def peer_vpc_id(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'peer_vpc_id')
@property @pulumi.getter(name='peerVpcId') def peer_vpc_id(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'peer_vpc_id')<|docstring|>The ID of the requester VPC.<|endoftext|>
42f59d8efc4217baaff6442be878214d9e444d01feeddb7c1a7640dea313767e
@property @pulumi.getter def requester(self) -> Optional[pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs']]: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n ' return pulumi.get(self, 'requester')
A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
requester
rapzo/pulumi-aws
260
python
@property @pulumi.getter def requester(self) -> Optional[pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs']]: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n ' return pulumi.get(self, 'requester')
@property @pulumi.getter def requester(self) -> Optional[pulumi.Input['VpcPeeringConnectionAccepterRequesterArgs']]: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n ' return pulumi.get(self, 'requester')<|docstring|>A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.<|endoftext|>
8d2717789d774b16c160ccdb444f04531f8ff6c2fec4e9f5c82e51b273ab2da7
@property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.\n ' return pulumi.get(self, 'tags')
A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
tags
rapzo/pulumi-aws
260
python
@property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n \n ' return pulumi.get(self, 'tags')
@property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n \n ' return pulumi.get(self, 'tags')<|docstring|>A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.<|endoftext|>
a44c367f9f2bf7320a71acffa452b362e75c36fa1f2a32a8df1b3e62d8a12db7
@property @pulumi.getter(name='tagsAll') def tags_all(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n A map of tags assigned to the resource, including those inherited from the provider .\n ' return pulumi.get(self, 'tags_all')
A map of tags assigned to the resource, including those inherited from the provider .
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
tags_all
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='tagsAll') def tags_all(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n \n ' return pulumi.get(self, 'tags_all')
@property @pulumi.getter(name='tagsAll') def tags_all(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n \n ' return pulumi.get(self, 'tags_all')<|docstring|>A map of tags assigned to the resource, including those inherited from the provider .<|endoftext|>
72e2a955a1889e881e6b58118120eb03db63e2ad3b4a7c41812c9466350d4f6a
@property @pulumi.getter(name='vpcId') def vpc_id(self) -> Optional[pulumi.Input[str]]: '\n The ID of the accepter VPC.\n ' return pulumi.get(self, 'vpc_id')
The ID of the accepter VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
vpc_id
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='vpcId') def vpc_id(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'vpc_id')
@property @pulumi.getter(name='vpcId') def vpc_id(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'vpc_id')<|docstring|>The ID of the accepter VPC.<|endoftext|>
63e1864178dbed16d9fd181e9630a5d42e79cb6bad7264e086b96dc51d9e0878
@property @pulumi.getter(name='vpcPeeringConnectionId') def vpc_peering_connection_id(self) -> Optional[pulumi.Input[str]]: '\n The VPC Peering Connection ID to manage.\n ' return pulumi.get(self, 'vpc_peering_connection_id')
The VPC Peering Connection ID to manage.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
vpc_peering_connection_id
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='vpcPeeringConnectionId') def vpc_peering_connection_id(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'vpc_peering_connection_id')
@property @pulumi.getter(name='vpcPeeringConnectionId') def vpc_peering_connection_id(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'vpc_peering_connection_id')<|docstring|>The VPC Peering Connection ID to manage.<|endoftext|>
f84a809d46b65d61948d32aa9dc8224d44d6a234407495e7008c7836482cf589
@overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, accepter: Optional[pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']]]=None, auto_accept: Optional[pulumi.Input[bool]]=None, requester: Optional[pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']]]=None, tags: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, tags_all: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, vpc_peering_connection_id: Optional[pulumi.Input[str]]=None, __props__=None): '\n Provides a resource to manage the accepter\'s side of a VPC Peering Connection.\n\n When a cross-account (requester\'s AWS account differs from the accepter\'s AWS account) or an inter-region\n VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the\n accepter\'s account.\n The requester can use the `ec2.VpcPeeringConnection` resource to manage its side of the connection\n and the accepter can use the `ec2.VpcPeeringConnectionAccepter` resource to "adopt" its side of the\n connection into management.\n\n ## Example Usage\n\n ```python\n import pulumi\n import pulumi_aws as aws\n import pulumi_pulumi as pulumi\n\n peer = pulumi.providers.Aws("peer", region="us-west-2")\n # Accepter\'s credentials.\n main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16")\n peer_vpc = aws.ec2.Vpc("peerVpc", cidr_block="10.1.0.0/16",\n opts=pulumi.ResourceOptions(provider=aws["peer"]))\n peer_caller_identity = aws.get_caller_identity()\n # Requester\'s side of the connection.\n peer_vpc_peering_connection = aws.ec2.VpcPeeringConnection("peerVpcPeeringConnection",\n vpc_id=main.id,\n peer_vpc_id=peer_vpc.id,\n peer_owner_id=peer_caller_identity.account_id,\n peer_region="us-west-2",\n auto_accept=False,\n tags={\n "Side": "Requester",\n })\n # Accepter\'s side of the connection.\n peer_vpc_peering_connection_accepter = aws.ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter",\n vpc_peering_connection_id=peer_vpc_peering_connection.id,\n auto_accept=True,\n tags={\n "Side": "Accepter",\n },\n opts=pulumi.ResourceOptions(provider=aws["peer"]))\n ```\n\n ## Import\n\n VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g.\n\n ```sh\n $ pulumi import aws:ec2/vpcPeeringConnectionAccepter:VpcPeeringConnectionAccepter example pcx-12345678\n ```\n\n Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the provider configuration on an imported resource, this provder will always show a difference. To workaround this behavior, either omit the argument from the configuration or use [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to hide the difference, e.g. terraform resource "aws_vpc_peering_connection_accepter" "example" {\n\n # ... other configuration ...\n\n # There is no AWS EC2 API for reading auto_accept\n\n lifecycle {\n\n ignore_changes = [auto_accept]\n\n } }\n\n :param str resource_name: The name of the resource.\n :param pulumi.ResourceOptions opts: Options for the resource.\n :param pulumi.Input[pulumi.InputType[\'VpcPeeringConnectionAccepterAccepterArgs\']] accepter: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`.\n :param pulumi.Input[pulumi.InputType[\'VpcPeeringConnectionAccepterRequesterArgs\']] requester: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider .\n :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.\n ' ...
Provides a resource to manage the accepter's side of a VPC Peering Connection. When a cross-account (requester's AWS account differs from the accepter's AWS account) or an inter-region VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the accepter's account. The requester can use the `ec2.VpcPeeringConnection` resource to manage its side of the connection and the accepter can use the `ec2.VpcPeeringConnectionAccepter` resource to "adopt" its side of the connection into management. ## Example Usage ```python import pulumi import pulumi_aws as aws import pulumi_pulumi as pulumi peer = pulumi.providers.Aws("peer", region="us-west-2") # Accepter's credentials. main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16") peer_vpc = aws.ec2.Vpc("peerVpc", cidr_block="10.1.0.0/16", opts=pulumi.ResourceOptions(provider=aws["peer"])) peer_caller_identity = aws.get_caller_identity() # Requester's side of the connection. peer_vpc_peering_connection = aws.ec2.VpcPeeringConnection("peerVpcPeeringConnection", vpc_id=main.id, peer_vpc_id=peer_vpc.id, peer_owner_id=peer_caller_identity.account_id, peer_region="us-west-2", auto_accept=False, tags={ "Side": "Requester", }) # Accepter's side of the connection. peer_vpc_peering_connection_accepter = aws.ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter", vpc_peering_connection_id=peer_vpc_peering_connection.id, auto_accept=True, tags={ "Side": "Accepter", }, opts=pulumi.ResourceOptions(provider=aws["peer"])) ``` ## Import VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g. ```sh $ pulumi import aws:ec2/vpcPeeringConnectionAccepter:VpcPeeringConnectionAccepter example pcx-12345678 ``` Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the provider configuration on an imported resource, this provder will always show a difference. To workaround this behavior, either omit the argument from the configuration or use [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to hide the difference, e.g. terraform resource "aws_vpc_peering_connection_accepter" "example" { # ... other configuration ... # There is no AWS EC2 API for reading auto_accept lifecycle { ignore_changes = [auto_accept] } } :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']] accepter: A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC. :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`. :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']] requester: A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider . :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
__init__
rapzo/pulumi-aws
260
python
@overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, accepter: Optional[pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']]]=None, auto_accept: Optional[pulumi.Input[bool]]=None, requester: Optional[pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']]]=None, tags: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, tags_all: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, vpc_peering_connection_id: Optional[pulumi.Input[str]]=None, __props__=None): '\n Provides a resource to manage the accepter\'s side of a VPC Peering Connection.\n\n When a cross-account (requester\'s AWS account differs from the accepter\'s AWS account) or an inter-region\n VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the\n accepter\'s account.\n The requester can use the `ec2.VpcPeeringConnection` resource to manage its side of the connection\n and the accepter can use the `ec2.VpcPeeringConnectionAccepter` resource to "adopt" its side of the\n connection into management.\n\n ## Example Usage\n\n ```python\n import pulumi\n import pulumi_aws as aws\n import pulumi_pulumi as pulumi\n\n peer = pulumi.providers.Aws("peer", region="us-west-2")\n # Accepter\'s credentials.\n main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16")\n peer_vpc = aws.ec2.Vpc("peerVpc", cidr_block="10.1.0.0/16",\n opts=pulumi.ResourceOptions(provider=aws["peer"]))\n peer_caller_identity = aws.get_caller_identity()\n # Requester\'s side of the connection.\n peer_vpc_peering_connection = aws.ec2.VpcPeeringConnection("peerVpcPeeringConnection",\n vpc_id=main.id,\n peer_vpc_id=peer_vpc.id,\n peer_owner_id=peer_caller_identity.account_id,\n peer_region="us-west-2",\n auto_accept=False,\n tags={\n "Side": "Requester",\n })\n # Accepter\'s side of the connection.\n peer_vpc_peering_connection_accepter = aws.ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter",\n vpc_peering_connection_id=peer_vpc_peering_connection.id,\n auto_accept=True,\n tags={\n "Side": "Accepter",\n },\n opts=pulumi.ResourceOptions(provider=aws["peer"]))\n ```\n\n ## Import\n\n VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g.\n\n ```sh\n $ pulumi import aws:ec2/vpcPeeringConnectionAccepter:VpcPeeringConnectionAccepter example pcx-12345678\n ```\n\n Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the provider configuration on an imported resource, this provder will always show a difference. To workaround this behavior, either omit the argument from the configuration or use [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to hide the difference, e.g. terraform resource "aws_vpc_peering_connection_accepter" "example" {\n\n # ... other configuration ...\n\n # There is no AWS EC2 API for reading auto_accept\n\n lifecycle {\n\n ignore_changes = [auto_accept]\n\n } }\n\n :param str resource_name: The name of the resource.\n :param pulumi.ResourceOptions opts: Options for the resource.\n :param pulumi.Input[pulumi.InputType[\'VpcPeeringConnectionAccepterAccepterArgs\']] accepter: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`.\n :param pulumi.Input[pulumi.InputType[\'VpcPeeringConnectionAccepterRequesterArgs\']] requester: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider .\n :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.\n ' ...
@overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, accepter: Optional[pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']]]=None, auto_accept: Optional[pulumi.Input[bool]]=None, requester: Optional[pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']]]=None, tags: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, tags_all: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, vpc_peering_connection_id: Optional[pulumi.Input[str]]=None, __props__=None): '\n Provides a resource to manage the accepter\'s side of a VPC Peering Connection.\n\n When a cross-account (requester\'s AWS account differs from the accepter\'s AWS account) or an inter-region\n VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the\n accepter\'s account.\n The requester can use the `ec2.VpcPeeringConnection` resource to manage its side of the connection\n and the accepter can use the `ec2.VpcPeeringConnectionAccepter` resource to "adopt" its side of the\n connection into management.\n\n ## Example Usage\n\n ```python\n import pulumi\n import pulumi_aws as aws\n import pulumi_pulumi as pulumi\n\n peer = pulumi.providers.Aws("peer", region="us-west-2")\n # Accepter\'s credentials.\n main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16")\n peer_vpc = aws.ec2.Vpc("peerVpc", cidr_block="10.1.0.0/16",\n opts=pulumi.ResourceOptions(provider=aws["peer"]))\n peer_caller_identity = aws.get_caller_identity()\n # Requester\'s side of the connection.\n peer_vpc_peering_connection = aws.ec2.VpcPeeringConnection("peerVpcPeeringConnection",\n vpc_id=main.id,\n peer_vpc_id=peer_vpc.id,\n peer_owner_id=peer_caller_identity.account_id,\n peer_region="us-west-2",\n auto_accept=False,\n tags={\n "Side": "Requester",\n })\n # Accepter\'s side of the connection.\n peer_vpc_peering_connection_accepter = aws.ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter",\n vpc_peering_connection_id=peer_vpc_peering_connection.id,\n auto_accept=True,\n tags={\n "Side": "Accepter",\n },\n opts=pulumi.ResourceOptions(provider=aws["peer"]))\n ```\n\n ## Import\n\n VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g.\n\n ```sh\n $ pulumi import aws:ec2/vpcPeeringConnectionAccepter:VpcPeeringConnectionAccepter example pcx-12345678\n ```\n\n Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the provider configuration on an imported resource, this provder will always show a difference. To workaround this behavior, either omit the argument from the configuration or use [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to hide the difference, e.g. terraform resource "aws_vpc_peering_connection_accepter" "example" {\n\n # ... other configuration ...\n\n # There is no AWS EC2 API for reading auto_accept\n\n lifecycle {\n\n ignore_changes = [auto_accept]\n\n } }\n\n :param str resource_name: The name of the resource.\n :param pulumi.ResourceOptions opts: Options for the resource.\n :param pulumi.Input[pulumi.InputType[\'VpcPeeringConnectionAccepterAccepterArgs\']] accepter: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`.\n :param pulumi.Input[pulumi.InputType[\'VpcPeeringConnectionAccepterRequesterArgs\']] requester: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider .\n :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.\n ' ...<|docstring|>Provides a resource to manage the accepter's side of a VPC Peering Connection. When a cross-account (requester's AWS account differs from the accepter's AWS account) or an inter-region VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the accepter's account. The requester can use the `ec2.VpcPeeringConnection` resource to manage its side of the connection and the accepter can use the `ec2.VpcPeeringConnectionAccepter` resource to "adopt" its side of the connection into management. ## Example Usage ```python import pulumi import pulumi_aws as aws import pulumi_pulumi as pulumi peer = pulumi.providers.Aws("peer", region="us-west-2") # Accepter's credentials. main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16") peer_vpc = aws.ec2.Vpc("peerVpc", cidr_block="10.1.0.0/16", opts=pulumi.ResourceOptions(provider=aws["peer"])) peer_caller_identity = aws.get_caller_identity() # Requester's side of the connection. peer_vpc_peering_connection = aws.ec2.VpcPeeringConnection("peerVpcPeeringConnection", vpc_id=main.id, peer_vpc_id=peer_vpc.id, peer_owner_id=peer_caller_identity.account_id, peer_region="us-west-2", auto_accept=False, tags={ "Side": "Requester", }) # Accepter's side of the connection. peer_vpc_peering_connection_accepter = aws.ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter", vpc_peering_connection_id=peer_vpc_peering_connection.id, auto_accept=True, tags={ "Side": "Accepter", }, opts=pulumi.ResourceOptions(provider=aws["peer"])) ``` ## Import VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g. ```sh $ pulumi import aws:ec2/vpcPeeringConnectionAccepter:VpcPeeringConnectionAccepter example pcx-12345678 ``` Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the provider configuration on an imported resource, this provder will always show a difference. To workaround this behavior, either omit the argument from the configuration or use [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to hide the difference, e.g. terraform resource "aws_vpc_peering_connection_accepter" "example" { # ... other configuration ... # There is no AWS EC2 API for reading auto_accept lifecycle { ignore_changes = [auto_accept] } } :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']] accepter: A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC. :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`. :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']] requester: A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider . :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.<|endoftext|>
c3484ad0f3615315475d82d764a1caf4aa6ed17ab1b7e121613118dc0beee7cd
@overload def __init__(__self__, resource_name: str, args: VpcPeeringConnectionAccepterInitArgs, opts: Optional[pulumi.ResourceOptions]=None): '\n Provides a resource to manage the accepter\'s side of a VPC Peering Connection.\n\n When a cross-account (requester\'s AWS account differs from the accepter\'s AWS account) or an inter-region\n VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the\n accepter\'s account.\n The requester can use the `ec2.VpcPeeringConnection` resource to manage its side of the connection\n and the accepter can use the `ec2.VpcPeeringConnectionAccepter` resource to "adopt" its side of the\n connection into management.\n\n ## Example Usage\n\n ```python\n import pulumi\n import pulumi_aws as aws\n import pulumi_pulumi as pulumi\n\n peer = pulumi.providers.Aws("peer", region="us-west-2")\n # Accepter\'s credentials.\n main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16")\n peer_vpc = aws.ec2.Vpc("peerVpc", cidr_block="10.1.0.0/16",\n opts=pulumi.ResourceOptions(provider=aws["peer"]))\n peer_caller_identity = aws.get_caller_identity()\n # Requester\'s side of the connection.\n peer_vpc_peering_connection = aws.ec2.VpcPeeringConnection("peerVpcPeeringConnection",\n vpc_id=main.id,\n peer_vpc_id=peer_vpc.id,\n peer_owner_id=peer_caller_identity.account_id,\n peer_region="us-west-2",\n auto_accept=False,\n tags={\n "Side": "Requester",\n })\n # Accepter\'s side of the connection.\n peer_vpc_peering_connection_accepter = aws.ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter",\n vpc_peering_connection_id=peer_vpc_peering_connection.id,\n auto_accept=True,\n tags={\n "Side": "Accepter",\n },\n opts=pulumi.ResourceOptions(provider=aws["peer"]))\n ```\n\n ## Import\n\n VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g.\n\n ```sh\n $ pulumi import aws:ec2/vpcPeeringConnectionAccepter:VpcPeeringConnectionAccepter example pcx-12345678\n ```\n\n Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the provider configuration on an imported resource, this provder will always show a difference. To workaround this behavior, either omit the argument from the configuration or use [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to hide the difference, e.g. terraform resource "aws_vpc_peering_connection_accepter" "example" {\n\n # ... other configuration ...\n\n # There is no AWS EC2 API for reading auto_accept\n\n lifecycle {\n\n ignore_changes = [auto_accept]\n\n } }\n\n :param str resource_name: The name of the resource.\n :param VpcPeeringConnectionAccepterInitArgs args: The arguments to use to populate this resource\'s properties.\n :param pulumi.ResourceOptions opts: Options for the resource.\n ' ...
Provides a resource to manage the accepter's side of a VPC Peering Connection. When a cross-account (requester's AWS account differs from the accepter's AWS account) or an inter-region VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the accepter's account. The requester can use the `ec2.VpcPeeringConnection` resource to manage its side of the connection and the accepter can use the `ec2.VpcPeeringConnectionAccepter` resource to "adopt" its side of the connection into management. ## Example Usage ```python import pulumi import pulumi_aws as aws import pulumi_pulumi as pulumi peer = pulumi.providers.Aws("peer", region="us-west-2") # Accepter's credentials. main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16") peer_vpc = aws.ec2.Vpc("peerVpc", cidr_block="10.1.0.0/16", opts=pulumi.ResourceOptions(provider=aws["peer"])) peer_caller_identity = aws.get_caller_identity() # Requester's side of the connection. peer_vpc_peering_connection = aws.ec2.VpcPeeringConnection("peerVpcPeeringConnection", vpc_id=main.id, peer_vpc_id=peer_vpc.id, peer_owner_id=peer_caller_identity.account_id, peer_region="us-west-2", auto_accept=False, tags={ "Side": "Requester", }) # Accepter's side of the connection. peer_vpc_peering_connection_accepter = aws.ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter", vpc_peering_connection_id=peer_vpc_peering_connection.id, auto_accept=True, tags={ "Side": "Accepter", }, opts=pulumi.ResourceOptions(provider=aws["peer"])) ``` ## Import VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g. ```sh $ pulumi import aws:ec2/vpcPeeringConnectionAccepter:VpcPeeringConnectionAccepter example pcx-12345678 ``` Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the provider configuration on an imported resource, this provder will always show a difference. To workaround this behavior, either omit the argument from the configuration or use [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to hide the difference, e.g. terraform resource "aws_vpc_peering_connection_accepter" "example" { # ... other configuration ... # There is no AWS EC2 API for reading auto_accept lifecycle { ignore_changes = [auto_accept] } } :param str resource_name: The name of the resource. :param VpcPeeringConnectionAccepterInitArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
__init__
rapzo/pulumi-aws
260
python
@overload def __init__(__self__, resource_name: str, args: VpcPeeringConnectionAccepterInitArgs, opts: Optional[pulumi.ResourceOptions]=None): '\n Provides a resource to manage the accepter\'s side of a VPC Peering Connection.\n\n When a cross-account (requester\'s AWS account differs from the accepter\'s AWS account) or an inter-region\n VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the\n accepter\'s account.\n The requester can use the `ec2.VpcPeeringConnection` resource to manage its side of the connection\n and the accepter can use the `ec2.VpcPeeringConnectionAccepter` resource to "adopt" its side of the\n connection into management.\n\n ## Example Usage\n\n ```python\n import pulumi\n import pulumi_aws as aws\n import pulumi_pulumi as pulumi\n\n peer = pulumi.providers.Aws("peer", region="us-west-2")\n # Accepter\'s credentials.\n main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16")\n peer_vpc = aws.ec2.Vpc("peerVpc", cidr_block="10.1.0.0/16",\n opts=pulumi.ResourceOptions(provider=aws["peer"]))\n peer_caller_identity = aws.get_caller_identity()\n # Requester\'s side of the connection.\n peer_vpc_peering_connection = aws.ec2.VpcPeeringConnection("peerVpcPeeringConnection",\n vpc_id=main.id,\n peer_vpc_id=peer_vpc.id,\n peer_owner_id=peer_caller_identity.account_id,\n peer_region="us-west-2",\n auto_accept=False,\n tags={\n "Side": "Requester",\n })\n # Accepter\'s side of the connection.\n peer_vpc_peering_connection_accepter = aws.ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter",\n vpc_peering_connection_id=peer_vpc_peering_connection.id,\n auto_accept=True,\n tags={\n "Side": "Accepter",\n },\n opts=pulumi.ResourceOptions(provider=aws["peer"]))\n ```\n\n ## Import\n\n VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g.\n\n ```sh\n $ pulumi import aws:ec2/vpcPeeringConnectionAccepter:VpcPeeringConnectionAccepter example pcx-12345678\n ```\n\n Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the provider configuration on an imported resource, this provder will always show a difference. To workaround this behavior, either omit the argument from the configuration or use [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to hide the difference, e.g. terraform resource "aws_vpc_peering_connection_accepter" "example" {\n\n # ... other configuration ...\n\n # There is no AWS EC2 API for reading auto_accept\n\n lifecycle {\n\n ignore_changes = [auto_accept]\n\n } }\n\n :param str resource_name: The name of the resource.\n :param VpcPeeringConnectionAccepterInitArgs args: The arguments to use to populate this resource\'s properties.\n :param pulumi.ResourceOptions opts: Options for the resource.\n ' ...
@overload def __init__(__self__, resource_name: str, args: VpcPeeringConnectionAccepterInitArgs, opts: Optional[pulumi.ResourceOptions]=None): '\n Provides a resource to manage the accepter\'s side of a VPC Peering Connection.\n\n When a cross-account (requester\'s AWS account differs from the accepter\'s AWS account) or an inter-region\n VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the\n accepter\'s account.\n The requester can use the `ec2.VpcPeeringConnection` resource to manage its side of the connection\n and the accepter can use the `ec2.VpcPeeringConnectionAccepter` resource to "adopt" its side of the\n connection into management.\n\n ## Example Usage\n\n ```python\n import pulumi\n import pulumi_aws as aws\n import pulumi_pulumi as pulumi\n\n peer = pulumi.providers.Aws("peer", region="us-west-2")\n # Accepter\'s credentials.\n main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16")\n peer_vpc = aws.ec2.Vpc("peerVpc", cidr_block="10.1.0.0/16",\n opts=pulumi.ResourceOptions(provider=aws["peer"]))\n peer_caller_identity = aws.get_caller_identity()\n # Requester\'s side of the connection.\n peer_vpc_peering_connection = aws.ec2.VpcPeeringConnection("peerVpcPeeringConnection",\n vpc_id=main.id,\n peer_vpc_id=peer_vpc.id,\n peer_owner_id=peer_caller_identity.account_id,\n peer_region="us-west-2",\n auto_accept=False,\n tags={\n "Side": "Requester",\n })\n # Accepter\'s side of the connection.\n peer_vpc_peering_connection_accepter = aws.ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter",\n vpc_peering_connection_id=peer_vpc_peering_connection.id,\n auto_accept=True,\n tags={\n "Side": "Accepter",\n },\n opts=pulumi.ResourceOptions(provider=aws["peer"]))\n ```\n\n ## Import\n\n VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g.\n\n ```sh\n $ pulumi import aws:ec2/vpcPeeringConnectionAccepter:VpcPeeringConnectionAccepter example pcx-12345678\n ```\n\n Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the provider configuration on an imported resource, this provder will always show a difference. To workaround this behavior, either omit the argument from the configuration or use [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to hide the difference, e.g. terraform resource "aws_vpc_peering_connection_accepter" "example" {\n\n # ... other configuration ...\n\n # There is no AWS EC2 API for reading auto_accept\n\n lifecycle {\n\n ignore_changes = [auto_accept]\n\n } }\n\n :param str resource_name: The name of the resource.\n :param VpcPeeringConnectionAccepterInitArgs args: The arguments to use to populate this resource\'s properties.\n :param pulumi.ResourceOptions opts: Options for the resource.\n ' ...<|docstring|>Provides a resource to manage the accepter's side of a VPC Peering Connection. When a cross-account (requester's AWS account differs from the accepter's AWS account) or an inter-region VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the accepter's account. The requester can use the `ec2.VpcPeeringConnection` resource to manage its side of the connection and the accepter can use the `ec2.VpcPeeringConnectionAccepter` resource to "adopt" its side of the connection into management. ## Example Usage ```python import pulumi import pulumi_aws as aws import pulumi_pulumi as pulumi peer = pulumi.providers.Aws("peer", region="us-west-2") # Accepter's credentials. main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16") peer_vpc = aws.ec2.Vpc("peerVpc", cidr_block="10.1.0.0/16", opts=pulumi.ResourceOptions(provider=aws["peer"])) peer_caller_identity = aws.get_caller_identity() # Requester's side of the connection. peer_vpc_peering_connection = aws.ec2.VpcPeeringConnection("peerVpcPeeringConnection", vpc_id=main.id, peer_vpc_id=peer_vpc.id, peer_owner_id=peer_caller_identity.account_id, peer_region="us-west-2", auto_accept=False, tags={ "Side": "Requester", }) # Accepter's side of the connection. peer_vpc_peering_connection_accepter = aws.ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter", vpc_peering_connection_id=peer_vpc_peering_connection.id, auto_accept=True, tags={ "Side": "Accepter", }, opts=pulumi.ResourceOptions(provider=aws["peer"])) ``` ## Import VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g. ```sh $ pulumi import aws:ec2/vpcPeeringConnectionAccepter:VpcPeeringConnectionAccepter example pcx-12345678 ``` Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the provider configuration on an imported resource, this provder will always show a difference. To workaround this behavior, either omit the argument from the configuration or use [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to hide the difference, e.g. terraform resource "aws_vpc_peering_connection_accepter" "example" { # ... other configuration ... # There is no AWS EC2 API for reading auto_accept lifecycle { ignore_changes = [auto_accept] } } :param str resource_name: The name of the resource. :param VpcPeeringConnectionAccepterInitArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource.<|endoftext|>
2fa5afc8139facbe6909fc24d59b01dbe9986a59d98a5ed7f9e621b47722a1d4
@staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None, accept_status: Optional[pulumi.Input[str]]=None, accepter: Optional[pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']]]=None, auto_accept: Optional[pulumi.Input[bool]]=None, peer_owner_id: Optional[pulumi.Input[str]]=None, peer_region: Optional[pulumi.Input[str]]=None, peer_vpc_id: Optional[pulumi.Input[str]]=None, requester: Optional[pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']]]=None, tags: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, tags_all: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, vpc_id: Optional[pulumi.Input[str]]=None, vpc_peering_connection_id: Optional[pulumi.Input[str]]=None) -> 'VpcPeeringConnectionAccepter': "\n Get an existing VpcPeeringConnectionAccepter resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str resource_name: The unique name of the resulting resource.\n :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.\n :param pulumi.ResourceOptions opts: Options for the resource.\n :param pulumi.Input[str] accept_status: The status of the VPC Peering Connection request.\n :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']] accepter: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`.\n :param pulumi.Input[str] peer_owner_id: The AWS account ID of the owner of the requester VPC.\n :param pulumi.Input[str] peer_region: The region of the accepter VPC.\n :param pulumi.Input[str] peer_vpc_id: The ID of the requester VPC.\n :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']] requester: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider .\n :param pulumi.Input[str] vpc_id: The ID of the accepter VPC.\n :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.\n " opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _VpcPeeringConnectionAccepterState.__new__(_VpcPeeringConnectionAccepterState) __props__.__dict__['accept_status'] = accept_status __props__.__dict__['accepter'] = accepter __props__.__dict__['auto_accept'] = auto_accept __props__.__dict__['peer_owner_id'] = peer_owner_id __props__.__dict__['peer_region'] = peer_region __props__.__dict__['peer_vpc_id'] = peer_vpc_id __props__.__dict__['requester'] = requester __props__.__dict__['tags'] = tags __props__.__dict__['tags_all'] = tags_all __props__.__dict__['vpc_id'] = vpc_id __props__.__dict__['vpc_peering_connection_id'] = vpc_peering_connection_id return VpcPeeringConnectionAccepter(resource_name, opts=opts, __props__=__props__)
Get an existing VpcPeeringConnectionAccepter 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: Options for the resource. :param pulumi.Input[str] accept_status: The status of the VPC Peering Connection request. :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']] accepter: A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC. :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`. :param pulumi.Input[str] peer_owner_id: The AWS account ID of the owner of the requester VPC. :param pulumi.Input[str] peer_region: The region of the accepter VPC. :param pulumi.Input[str] peer_vpc_id: The ID of the requester VPC. :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']] requester: A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider . :param pulumi.Input[str] vpc_id: The ID of the accepter VPC. :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
get
rapzo/pulumi-aws
260
python
@staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None, accept_status: Optional[pulumi.Input[str]]=None, accepter: Optional[pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']]]=None, auto_accept: Optional[pulumi.Input[bool]]=None, peer_owner_id: Optional[pulumi.Input[str]]=None, peer_region: Optional[pulumi.Input[str]]=None, peer_vpc_id: Optional[pulumi.Input[str]]=None, requester: Optional[pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']]]=None, tags: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, tags_all: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, vpc_id: Optional[pulumi.Input[str]]=None, vpc_peering_connection_id: Optional[pulumi.Input[str]]=None) -> 'VpcPeeringConnectionAccepter': "\n Get an existing VpcPeeringConnectionAccepter resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str resource_name: The unique name of the resulting resource.\n :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.\n :param pulumi.ResourceOptions opts: Options for the resource.\n :param pulumi.Input[str] accept_status: The status of the VPC Peering Connection request.\n :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']] accepter: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`.\n :param pulumi.Input[str] peer_owner_id: The AWS account ID of the owner of the requester VPC.\n :param pulumi.Input[str] peer_region: The region of the accepter VPC.\n :param pulumi.Input[str] peer_vpc_id: The ID of the requester VPC.\n :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']] requester: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider .\n :param pulumi.Input[str] vpc_id: The ID of the accepter VPC.\n :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.\n " opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _VpcPeeringConnectionAccepterState.__new__(_VpcPeeringConnectionAccepterState) __props__.__dict__['accept_status'] = accept_status __props__.__dict__['accepter'] = accepter __props__.__dict__['auto_accept'] = auto_accept __props__.__dict__['peer_owner_id'] = peer_owner_id __props__.__dict__['peer_region'] = peer_region __props__.__dict__['peer_vpc_id'] = peer_vpc_id __props__.__dict__['requester'] = requester __props__.__dict__['tags'] = tags __props__.__dict__['tags_all'] = tags_all __props__.__dict__['vpc_id'] = vpc_id __props__.__dict__['vpc_peering_connection_id'] = vpc_peering_connection_id return VpcPeeringConnectionAccepter(resource_name, opts=opts, __props__=__props__)
@staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None, accept_status: Optional[pulumi.Input[str]]=None, accepter: Optional[pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']]]=None, auto_accept: Optional[pulumi.Input[bool]]=None, peer_owner_id: Optional[pulumi.Input[str]]=None, peer_region: Optional[pulumi.Input[str]]=None, peer_vpc_id: Optional[pulumi.Input[str]]=None, requester: Optional[pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']]]=None, tags: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, tags_all: Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]=None, vpc_id: Optional[pulumi.Input[str]]=None, vpc_peering_connection_id: Optional[pulumi.Input[str]]=None) -> 'VpcPeeringConnectionAccepter': "\n Get an existing VpcPeeringConnectionAccepter resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str resource_name: The unique name of the resulting resource.\n :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.\n :param pulumi.ResourceOptions opts: Options for the resource.\n :param pulumi.Input[str] accept_status: The status of the VPC Peering Connection request.\n :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']] accepter: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`.\n :param pulumi.Input[str] peer_owner_id: The AWS account ID of the owner of the requester VPC.\n :param pulumi.Input[str] peer_region: The region of the accepter VPC.\n :param pulumi.Input[str] peer_vpc_id: The ID of the requester VPC.\n :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']] requester: A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.\n :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider .\n :param pulumi.Input[str] vpc_id: The ID of the accepter VPC.\n :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.\n " opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _VpcPeeringConnectionAccepterState.__new__(_VpcPeeringConnectionAccepterState) __props__.__dict__['accept_status'] = accept_status __props__.__dict__['accepter'] = accepter __props__.__dict__['auto_accept'] = auto_accept __props__.__dict__['peer_owner_id'] = peer_owner_id __props__.__dict__['peer_region'] = peer_region __props__.__dict__['peer_vpc_id'] = peer_vpc_id __props__.__dict__['requester'] = requester __props__.__dict__['tags'] = tags __props__.__dict__['tags_all'] = tags_all __props__.__dict__['vpc_id'] = vpc_id __props__.__dict__['vpc_peering_connection_id'] = vpc_peering_connection_id return VpcPeeringConnectionAccepter(resource_name, opts=opts, __props__=__props__)<|docstring|>Get an existing VpcPeeringConnectionAccepter 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: Options for the resource. :param pulumi.Input[str] accept_status: The status of the VPC Peering Connection request. :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterAccepterArgs']] accepter: A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC. :param pulumi.Input[bool] auto_accept: Whether or not to accept the peering request. Defaults to `false`. :param pulumi.Input[str] peer_owner_id: The AWS account ID of the owner of the requester VPC. :param pulumi.Input[str] peer_region: The region of the accepter VPC. :param pulumi.Input[str] peer_vpc_id: The ID of the requester VPC. :param pulumi.Input[pulumi.InputType['VpcPeeringConnectionAccepterRequesterArgs']] requester: A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider . :param pulumi.Input[str] vpc_id: The ID of the accepter VPC. :param pulumi.Input[str] vpc_peering_connection_id: The VPC Peering Connection ID to manage.<|endoftext|>
66c6759f379b4111962092ea6ab88b0271cd8f4633eff29fc4c9a2a1ba9bc893
@property @pulumi.getter(name='acceptStatus') def accept_status(self) -> pulumi.Output[str]: '\n The status of the VPC Peering Connection request.\n ' return pulumi.get(self, 'accept_status')
The status of the VPC Peering Connection request.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
accept_status
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='acceptStatus') def accept_status(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'accept_status')
@property @pulumi.getter(name='acceptStatus') def accept_status(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'accept_status')<|docstring|>The status of the VPC Peering Connection request.<|endoftext|>
3a202af2636bd4bc0104bb71466a583b7ff1a66ceaea6646fb2bc54abb2fd2fe
@property @pulumi.getter def accepter(self) -> pulumi.Output['outputs.VpcPeeringConnectionAccepterAccepter']: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n ' return pulumi.get(self, 'accepter')
A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
accepter
rapzo/pulumi-aws
260
python
@property @pulumi.getter def accepter(self) -> pulumi.Output['outputs.VpcPeeringConnectionAccepterAccepter']: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n ' return pulumi.get(self, 'accepter')
@property @pulumi.getter def accepter(self) -> pulumi.Output['outputs.VpcPeeringConnectionAccepterAccepter']: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.\n ' return pulumi.get(self, 'accepter')<|docstring|>A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.<|endoftext|>
ffeab07df417898d22e6acd1166b0c6fc2929177ba4fb00c277b326c2e26e047
@property @pulumi.getter(name='autoAccept') def auto_accept(self) -> pulumi.Output[Optional[bool]]: '\n Whether or not to accept the peering request. Defaults to `false`.\n ' return pulumi.get(self, 'auto_accept')
Whether or not to accept the peering request. Defaults to `false`.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
auto_accept
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='autoAccept') def auto_accept(self) -> pulumi.Output[Optional[bool]]: '\n \n ' return pulumi.get(self, 'auto_accept')
@property @pulumi.getter(name='autoAccept') def auto_accept(self) -> pulumi.Output[Optional[bool]]: '\n \n ' return pulumi.get(self, 'auto_accept')<|docstring|>Whether or not to accept the peering request. Defaults to `false`.<|endoftext|>
2955f200196a3df8fad9d79b282771dbdf88669a47650ecdf7d58741c328d352
@property @pulumi.getter(name='peerOwnerId') def peer_owner_id(self) -> pulumi.Output[str]: '\n The AWS account ID of the owner of the requester VPC.\n ' return pulumi.get(self, 'peer_owner_id')
The AWS account ID of the owner of the requester VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
peer_owner_id
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='peerOwnerId') def peer_owner_id(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'peer_owner_id')
@property @pulumi.getter(name='peerOwnerId') def peer_owner_id(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'peer_owner_id')<|docstring|>The AWS account ID of the owner of the requester VPC.<|endoftext|>
22963e86693706a5488358a1727cabb87054a5b4ee6969a620c1114e06ba0aa0
@property @pulumi.getter(name='peerRegion') def peer_region(self) -> pulumi.Output[str]: '\n The region of the accepter VPC.\n ' return pulumi.get(self, 'peer_region')
The region of the accepter VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
peer_region
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='peerRegion') def peer_region(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'peer_region')
@property @pulumi.getter(name='peerRegion') def peer_region(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'peer_region')<|docstring|>The region of the accepter VPC.<|endoftext|>
d76e0cbcd8ac2d9fd79bfff9fc1287bb600f64218224a44eaaa87632a967395e
@property @pulumi.getter(name='peerVpcId') def peer_vpc_id(self) -> pulumi.Output[str]: '\n The ID of the requester VPC.\n ' return pulumi.get(self, 'peer_vpc_id')
The ID of the requester VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
peer_vpc_id
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='peerVpcId') def peer_vpc_id(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'peer_vpc_id')
@property @pulumi.getter(name='peerVpcId') def peer_vpc_id(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'peer_vpc_id')<|docstring|>The ID of the requester VPC.<|endoftext|>
849b27ab483067e76a840e76afb0a949096074ff3886090c0d30672fac525e11
@property @pulumi.getter def requester(self) -> pulumi.Output['outputs.VpcPeeringConnectionAccepterRequester']: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n ' return pulumi.get(self, 'requester')
A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
requester
rapzo/pulumi-aws
260
python
@property @pulumi.getter def requester(self) -> pulumi.Output['outputs.VpcPeeringConnectionAccepterRequester']: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n ' return pulumi.get(self, 'requester')
@property @pulumi.getter def requester(self) -> pulumi.Output['outputs.VpcPeeringConnectionAccepterRequester']: '\n A configuration block that describes [VPC Peering Connection]\n (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.\n ' return pulumi.get(self, 'requester')<|docstring|>A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.<|endoftext|>
33cabd36fcddef6c93bded6ec2d6e9ccf9e98f9cf6ac3cc0709c76bb46b0d971
@property @pulumi.getter def tags(self) -> pulumi.Output[Optional[Mapping[(str, str)]]]: '\n A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.\n ' return pulumi.get(self, 'tags')
A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
tags
rapzo/pulumi-aws
260
python
@property @pulumi.getter def tags(self) -> pulumi.Output[Optional[Mapping[(str, str)]]]: '\n \n ' return pulumi.get(self, 'tags')
@property @pulumi.getter def tags(self) -> pulumi.Output[Optional[Mapping[(str, str)]]]: '\n \n ' return pulumi.get(self, 'tags')<|docstring|>A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.<|endoftext|>
6827347e8e858b9a851af515438c931f6824d5803b68c74c4bf62dd519037439
@property @pulumi.getter(name='tagsAll') def tags_all(self) -> pulumi.Output[Mapping[(str, str)]]: '\n A map of tags assigned to the resource, including those inherited from the provider .\n ' return pulumi.get(self, 'tags_all')
A map of tags assigned to the resource, including those inherited from the provider .
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
tags_all
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='tagsAll') def tags_all(self) -> pulumi.Output[Mapping[(str, str)]]: '\n \n ' return pulumi.get(self, 'tags_all')
@property @pulumi.getter(name='tagsAll') def tags_all(self) -> pulumi.Output[Mapping[(str, str)]]: '\n \n ' return pulumi.get(self, 'tags_all')<|docstring|>A map of tags assigned to the resource, including those inherited from the provider .<|endoftext|>
a2b78c66005276dbb062461386435648cc1758ce635c4b18efd7e77d06060126
@property @pulumi.getter(name='vpcId') def vpc_id(self) -> pulumi.Output[str]: '\n The ID of the accepter VPC.\n ' return pulumi.get(self, 'vpc_id')
The ID of the accepter VPC.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
vpc_id
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='vpcId') def vpc_id(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'vpc_id')
@property @pulumi.getter(name='vpcId') def vpc_id(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'vpc_id')<|docstring|>The ID of the accepter VPC.<|endoftext|>
578ea699516745f8e82d28d3429910046dc0c47572c73466bb0356b81addd462
@property @pulumi.getter(name='vpcPeeringConnectionId') def vpc_peering_connection_id(self) -> pulumi.Output[str]: '\n The VPC Peering Connection ID to manage.\n ' return pulumi.get(self, 'vpc_peering_connection_id')
The VPC Peering Connection ID to manage.
sdk/python/pulumi_aws/ec2/vpc_peering_connection_accepter.py
vpc_peering_connection_id
rapzo/pulumi-aws
260
python
@property @pulumi.getter(name='vpcPeeringConnectionId') def vpc_peering_connection_id(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'vpc_peering_connection_id')
@property @pulumi.getter(name='vpcPeeringConnectionId') def vpc_peering_connection_id(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'vpc_peering_connection_id')<|docstring|>The VPC Peering Connection ID to manage.<|endoftext|>
94e95c8fe83ae0401824f607e935f82a4dbe58d015770b4446827c0e6f7f39ea
def update_mdit(mdit: MarkdownIt) -> None: 'Update the parser, adding the footnote plugin.' mdit.use(footnote_plugin) mdit.disable('footnote_inline')
Update the parser, adding the footnote plugin.
mdformat_footnote/plugin.py
update_mdit
executablebooks/mdformat-footnote
0
python
def update_mdit(mdit: MarkdownIt) -> None: mdit.use(footnote_plugin) mdit.disable('footnote_inline')
def update_mdit(mdit: MarkdownIt) -> None: mdit.use(footnote_plugin) mdit.disable('footnote_inline')<|docstring|>Update the parser, adding the footnote plugin.<|endoftext|>
4db97264d33d44d8834992e36a7ecb3fab0ffe61196c8872de327ff3deb99f58
def tink_javascript_deps(): 'Load dependencies of TypeScript/JavaScript Tink.' if (not native.existing_rule('build_bazel_rules_nodejs')): http_archive(name='build_bazel_rules_nodejs', urls=['https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.0/rules_nodejs-4.4.0.tar.gz'], sha256='c9c5d60d6234d65b06f86abd5edc60cadd1699f739ee49d33a099d2d67eb1ae8') if (not native.existing_rule('io_bazel_rules_closure')): http_archive(name='io_bazel_rules_closure', strip_prefix='rules_closure-0.12.0', urls=['https://github.com/bazelbuild/rules_closure/archive/0.12.0.tar.gz'], sha256='9498e57368efb82b985db1ed426a767cbf1ba0398fd7aed632fc3908654e1b1e') if (not native.existing_rule('io_bazel_rules_webtesting')): http_archive(name='io_bazel_rules_webtesting', urls=['https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.5/rules_webtesting.tar.gz'], sha256='e9abb7658b6a129740c0b3ef6f5a2370864e102a5ba5ffca2cea565829ed825a') if (not native.existing_rule('bazel_skylib')): http_archive(name='bazel_skylib', urls=['https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz', 'https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz'], sha256='c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d')
Load dependencies of TypeScript/JavaScript Tink.
javascript/tink_javascript_deps.bzl
tink_javascript_deps
BrightMilk/tink
1
python
def tink_javascript_deps(): if (not native.existing_rule('build_bazel_rules_nodejs')): http_archive(name='build_bazel_rules_nodejs', urls=['https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.0/rules_nodejs-4.4.0.tar.gz'], sha256='c9c5d60d6234d65b06f86abd5edc60cadd1699f739ee49d33a099d2d67eb1ae8') if (not native.existing_rule('io_bazel_rules_closure')): http_archive(name='io_bazel_rules_closure', strip_prefix='rules_closure-0.12.0', urls=['https://github.com/bazelbuild/rules_closure/archive/0.12.0.tar.gz'], sha256='9498e57368efb82b985db1ed426a767cbf1ba0398fd7aed632fc3908654e1b1e') if (not native.existing_rule('io_bazel_rules_webtesting')): http_archive(name='io_bazel_rules_webtesting', urls=['https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.5/rules_webtesting.tar.gz'], sha256='e9abb7658b6a129740c0b3ef6f5a2370864e102a5ba5ffca2cea565829ed825a') if (not native.existing_rule('bazel_skylib')): http_archive(name='bazel_skylib', urls=['https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz', 'https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz'], sha256='c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d')
def tink_javascript_deps(): if (not native.existing_rule('build_bazel_rules_nodejs')): http_archive(name='build_bazel_rules_nodejs', urls=['https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.0/rules_nodejs-4.4.0.tar.gz'], sha256='c9c5d60d6234d65b06f86abd5edc60cadd1699f739ee49d33a099d2d67eb1ae8') if (not native.existing_rule('io_bazel_rules_closure')): http_archive(name='io_bazel_rules_closure', strip_prefix='rules_closure-0.12.0', urls=['https://github.com/bazelbuild/rules_closure/archive/0.12.0.tar.gz'], sha256='9498e57368efb82b985db1ed426a767cbf1ba0398fd7aed632fc3908654e1b1e') if (not native.existing_rule('io_bazel_rules_webtesting')): http_archive(name='io_bazel_rules_webtesting', urls=['https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.5/rules_webtesting.tar.gz'], sha256='e9abb7658b6a129740c0b3ef6f5a2370864e102a5ba5ffca2cea565829ed825a') if (not native.existing_rule('bazel_skylib')): http_archive(name='bazel_skylib', urls=['https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz', 'https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz'], sha256='c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d')<|docstring|>Load dependencies of TypeScript/JavaScript Tink.<|endoftext|>
3c11624ca9cd0eec066fdf081a71bc5b64b464ff1e68a2d59c41717553a39e5f
def test_compare_to_map_rv(): 'Ensure we get the same result by calling `map.rv()` and `sys.rv()`.' map = starry.Map(ydeg=1, udeg=2, rv=True, amp=1, veq=1, alpha=0, lazy=True) map[(1, 0)] = 0.5 A = starry.Primary(map, r=1.0, m=1.0, prot=0, length_unit=u.Rsun, mass_unit=u.Msun, lazy=True) b = starry.Secondary(starry.Map(rv=True, amp=1, veq=0, lazy=True), r=0.1, porb=1.0, m=0.01, t0=0.0, inc=86.0, ecc=0.3, w=60, length_unit=u.Rsun, mass_unit=u.Msun, angle_unit=u.degree, time_unit=u.day) sys = starry.System(A, b) time = np.linspace((- 0.05), 0.05, 1000) (x, y, z) = sys.position(time) xo = (x[1] - x[0]) yo = (y[1] - y[0]) zo = (z[1] - z[0]) ro = (b.r / A.r) rv1 = map.rv(xo=xo, yo=yo, ro=ro).eval() rv2 = sys.rv(time, keplerian=False).eval() assert np.allclose(rv1, rv2)
Ensure we get the same result by calling `map.rv()` and `sys.rv()`.
tests/greedy/test_system_rv_greedy.py
test_compare_to_map_rv
rodluger/starry
116
python
def test_compare_to_map_rv(): map = starry.Map(ydeg=1, udeg=2, rv=True, amp=1, veq=1, alpha=0, lazy=True) map[(1, 0)] = 0.5 A = starry.Primary(map, r=1.0, m=1.0, prot=0, length_unit=u.Rsun, mass_unit=u.Msun, lazy=True) b = starry.Secondary(starry.Map(rv=True, amp=1, veq=0, lazy=True), r=0.1, porb=1.0, m=0.01, t0=0.0, inc=86.0, ecc=0.3, w=60, length_unit=u.Rsun, mass_unit=u.Msun, angle_unit=u.degree, time_unit=u.day) sys = starry.System(A, b) time = np.linspace((- 0.05), 0.05, 1000) (x, y, z) = sys.position(time) xo = (x[1] - x[0]) yo = (y[1] - y[0]) zo = (z[1] - z[0]) ro = (b.r / A.r) rv1 = map.rv(xo=xo, yo=yo, ro=ro).eval() rv2 = sys.rv(time, keplerian=False).eval() assert np.allclose(rv1, rv2)
def test_compare_to_map_rv(): map = starry.Map(ydeg=1, udeg=2, rv=True, amp=1, veq=1, alpha=0, lazy=True) map[(1, 0)] = 0.5 A = starry.Primary(map, r=1.0, m=1.0, prot=0, length_unit=u.Rsun, mass_unit=u.Msun, lazy=True) b = starry.Secondary(starry.Map(rv=True, amp=1, veq=0, lazy=True), r=0.1, porb=1.0, m=0.01, t0=0.0, inc=86.0, ecc=0.3, w=60, length_unit=u.Rsun, mass_unit=u.Msun, angle_unit=u.degree, time_unit=u.day) sys = starry.System(A, b) time = np.linspace((- 0.05), 0.05, 1000) (x, y, z) = sys.position(time) xo = (x[1] - x[0]) yo = (y[1] - y[0]) zo = (z[1] - z[0]) ro = (b.r / A.r) rv1 = map.rv(xo=xo, yo=yo, ro=ro).eval() rv2 = sys.rv(time, keplerian=False).eval() assert np.allclose(rv1, rv2)<|docstring|>Ensure we get the same result by calling `map.rv()` and `sys.rv()`.<|endoftext|>
22150456a299948286c4987f08212f7d5c3cde089bba21c1afd72f5ff93cefb8
def test_compare_to_exoplanet(): 'Ensure we get the same result with `starry` and `exoplanet`.' A = starry.Primary(starry.Map(rv=True, veq=0), r=1.0, m=1.0, prot=0, length_unit=u.Rsun, mass_unit=u.Msun) b = starry.Secondary(starry.Map(rv=True, veq=0), r=0.1, porb=1.0, m=0.01, t0=0.0, inc=86.0, ecc=0.3, w=60, length_unit=u.Rsun, mass_unit=u.Msun, angle_unit=u.degree, time_unit=u.day) c = starry.Secondary(starry.Map(rv=True, veq=0), r=0.1, porb=1.7, m=0.02, t0=0.3, inc=87.0, ecc=0.2, w=70, length_unit=u.Rsun, mass_unit=u.Msun, angle_unit=u.degree, time_unit=u.day) sys = starry.System(A, b, c) time = np.linspace((- 0.5), 0.5, 1000) rv1 = sys.rv(time, keplerian=True, total=True) orbit = exoplanet.orbits.KeplerianOrbit(period=[1.0, 1.7], t0=[0.0, 0.3], incl=[((86.0 * np.pi) / 180), ((87.0 * np.pi) / 180)], ecc=[0.3, 0.2], omega=[((60 * np.pi) / 180), ((70 * np.pi) / 180)], m_planet=[0.01, 0.02], m_star=1.0, r_star=1.0) rv2 = orbit.get_radial_velocity(time).eval().sum(axis=1) assert np.allclose(rv1, rv2)
Ensure we get the same result with `starry` and `exoplanet`.
tests/greedy/test_system_rv_greedy.py
test_compare_to_exoplanet
rodluger/starry
116
python
def test_compare_to_exoplanet(): A = starry.Primary(starry.Map(rv=True, veq=0), r=1.0, m=1.0, prot=0, length_unit=u.Rsun, mass_unit=u.Msun) b = starry.Secondary(starry.Map(rv=True, veq=0), r=0.1, porb=1.0, m=0.01, t0=0.0, inc=86.0, ecc=0.3, w=60, length_unit=u.Rsun, mass_unit=u.Msun, angle_unit=u.degree, time_unit=u.day) c = starry.Secondary(starry.Map(rv=True, veq=0), r=0.1, porb=1.7, m=0.02, t0=0.3, inc=87.0, ecc=0.2, w=70, length_unit=u.Rsun, mass_unit=u.Msun, angle_unit=u.degree, time_unit=u.day) sys = starry.System(A, b, c) time = np.linspace((- 0.5), 0.5, 1000) rv1 = sys.rv(time, keplerian=True, total=True) orbit = exoplanet.orbits.KeplerianOrbit(period=[1.0, 1.7], t0=[0.0, 0.3], incl=[((86.0 * np.pi) / 180), ((87.0 * np.pi) / 180)], ecc=[0.3, 0.2], omega=[((60 * np.pi) / 180), ((70 * np.pi) / 180)], m_planet=[0.01, 0.02], m_star=1.0, r_star=1.0) rv2 = orbit.get_radial_velocity(time).eval().sum(axis=1) assert np.allclose(rv1, rv2)
def test_compare_to_exoplanet(): A = starry.Primary(starry.Map(rv=True, veq=0), r=1.0, m=1.0, prot=0, length_unit=u.Rsun, mass_unit=u.Msun) b = starry.Secondary(starry.Map(rv=True, veq=0), r=0.1, porb=1.0, m=0.01, t0=0.0, inc=86.0, ecc=0.3, w=60, length_unit=u.Rsun, mass_unit=u.Msun, angle_unit=u.degree, time_unit=u.day) c = starry.Secondary(starry.Map(rv=True, veq=0), r=0.1, porb=1.7, m=0.02, t0=0.3, inc=87.0, ecc=0.2, w=70, length_unit=u.Rsun, mass_unit=u.Msun, angle_unit=u.degree, time_unit=u.day) sys = starry.System(A, b, c) time = np.linspace((- 0.5), 0.5, 1000) rv1 = sys.rv(time, keplerian=True, total=True) orbit = exoplanet.orbits.KeplerianOrbit(period=[1.0, 1.7], t0=[0.0, 0.3], incl=[((86.0 * np.pi) / 180), ((87.0 * np.pi) / 180)], ecc=[0.3, 0.2], omega=[((60 * np.pi) / 180), ((70 * np.pi) / 180)], m_planet=[0.01, 0.02], m_star=1.0, r_star=1.0) rv2 = orbit.get_radial_velocity(time).eval().sum(axis=1) assert np.allclose(rv1, rv2)<|docstring|>Ensure we get the same result with `starry` and `exoplanet`.<|endoftext|>
f2f7e32f82a4f7ae42e5f44f859c54b1fa9c7a87e7565c8198cf4dc9eaf0952b
@restriction_v1.route('/restrictions', methods=['GET']) @produces('application/json') def get_restrictions(): 'Get a list of all Restrictions.' current_app.logger.info('Starting get_restrictions method') results = [] restriction_type = request.args.get('type') query = Restriction.query if restriction_type: query = query.filter_by(restriction_type=restriction_type) query_result = query.all() for item in query_result: results.append(item.as_dict()) return Response(response=json.dumps(results, sort_keys=True, separators=(',', ':')), mimetype='application/json', status=200)
Get a list of all Restrictions.
case_management_api/views/restriction_v1.py
get_restrictions
LandRegistry/digital-street-case-management-api
0
python
@restriction_v1.route('/restrictions', methods=['GET']) @produces('application/json') def get_restrictions(): current_app.logger.info('Starting get_restrictions method') results = [] restriction_type = request.args.get('type') query = Restriction.query if restriction_type: query = query.filter_by(restriction_type=restriction_type) query_result = query.all() for item in query_result: results.append(item.as_dict()) return Response(response=json.dumps(results, sort_keys=True, separators=(',', ':')), mimetype='application/json', status=200)
@restriction_v1.route('/restrictions', methods=['GET']) @produces('application/json') def get_restrictions(): current_app.logger.info('Starting get_restrictions method') results = [] restriction_type = request.args.get('type') query = Restriction.query if restriction_type: query = query.filter_by(restriction_type=restriction_type) query_result = query.all() for item in query_result: results.append(item.as_dict()) return Response(response=json.dumps(results, sort_keys=True, separators=(',', ':')), mimetype='application/json', status=200)<|docstring|>Get a list of all Restrictions.<|endoftext|>
c4d4dc0b93616bbdf99f29ed02670e63b112f2e394a7f9e558705b82f06777ce
@restriction_v1.route('/restrictions/<restriction_id>', methods=['GET']) @produces('application/json') def get_restriction(restriction_id): 'Get a specific Case.' current_app.logger.info('Starting get_restriction method') query_result = Restriction.query.get(restriction_id) if (not query_result): raise ApplicationError('Restriction not found', 'E404', 404) result = query_result.as_dict() return Response(response=json.dumps(result, sort_keys=True, separators=(',', ':')), mimetype='application/json', status=200)
Get a specific Case.
case_management_api/views/restriction_v1.py
get_restriction
LandRegistry/digital-street-case-management-api
0
python
@restriction_v1.route('/restrictions/<restriction_id>', methods=['GET']) @produces('application/json') def get_restriction(restriction_id): current_app.logger.info('Starting get_restriction method') query_result = Restriction.query.get(restriction_id) if (not query_result): raise ApplicationError('Restriction not found', 'E404', 404) result = query_result.as_dict() return Response(response=json.dumps(result, sort_keys=True, separators=(',', ':')), mimetype='application/json', status=200)
@restriction_v1.route('/restrictions/<restriction_id>', methods=['GET']) @produces('application/json') def get_restriction(restriction_id): current_app.logger.info('Starting get_restriction method') query_result = Restriction.query.get(restriction_id) if (not query_result): raise ApplicationError('Restriction not found', 'E404', 404) result = query_result.as_dict() return Response(response=json.dumps(result, sort_keys=True, separators=(',', ':')), mimetype='application/json', status=200)<|docstring|>Get a specific Case.<|endoftext|>
6f65c9c9ccb28fafaf30cd8d3199762b77769ea277af2328dce5a835690998fa
def get_random_digits(num): '\n parameters: Number of random digits to be generated\n return: (string)random_number\n ' digits = '' for i in range(num): digit = chr(random.randrange(ord('0'), (ord('9') + 1))) digits += digit return digits
parameters: Number of random digits to be generated return: (string)random_number
login/des_3.py
get_random_digits
StarsbySea/17wanxiaoCheckin-Actions
0
python
def get_random_digits(num): '\n parameters: Number of random digits to be generated\n return: (string)random_number\n ' digits = for i in range(num): digit = chr(random.randrange(ord('0'), (ord('9') + 1))) digits += digit return digits
def get_random_digits(num): '\n parameters: Number of random digits to be generated\n return: (string)random_number\n ' digits = for i in range(num): digit = chr(random.randrange(ord('0'), (ord('9') + 1))) digits += digit return digits<|docstring|>parameters: Number of random digits to be generated return: (string)random_number<|endoftext|>
7bc397870b717a30d306e545d3fa6f36ce0d3e5a81ce927141c73462f9116afe
def des_3_encrypt(text, key, iv): '\n Parameters:\n text (string)\n key (byte string) - The secret key used in symmetric ciphers.\n It must be 16 or 24 bytes long. The parity bit is ignored.\n iv (byte string) - The initialization vector to be used for encryption or decryption.\n Return:\n ciphertext (byte string)\n ' cipher = DES3.new(key, DES3.MODE_CBC, iv.encode('utf-8')) ct_bytes = cipher.encrypt(pad(text.encode('utf8'), DES3.block_size)) ciphertext = base64.b64encode(ct_bytes).decode('utf8') return ciphertext
Parameters: text (string) key (byte string) - The secret key used in symmetric ciphers. It must be 16 or 24 bytes long. The parity bit is ignored. iv (byte string) - The initialization vector to be used for encryption or decryption. Return: ciphertext (byte string)
login/des_3.py
des_3_encrypt
StarsbySea/17wanxiaoCheckin-Actions
0
python
def des_3_encrypt(text, key, iv): '\n Parameters:\n text (string)\n key (byte string) - The secret key used in symmetric ciphers.\n It must be 16 or 24 bytes long. The parity bit is ignored.\n iv (byte string) - The initialization vector to be used for encryption or decryption.\n Return:\n ciphertext (byte string)\n ' cipher = DES3.new(key, DES3.MODE_CBC, iv.encode('utf-8')) ct_bytes = cipher.encrypt(pad(text.encode('utf8'), DES3.block_size)) ciphertext = base64.b64encode(ct_bytes).decode('utf8') return ciphertext
def des_3_encrypt(text, key, iv): '\n Parameters:\n text (string)\n key (byte string) - The secret key used in symmetric ciphers.\n It must be 16 or 24 bytes long. The parity bit is ignored.\n iv (byte string) - The initialization vector to be used for encryption or decryption.\n Return:\n ciphertext (byte string)\n ' cipher = DES3.new(key, DES3.MODE_CBC, iv.encode('utf-8')) ct_bytes = cipher.encrypt(pad(text.encode('utf8'), DES3.block_size)) ciphertext = base64.b64encode(ct_bytes).decode('utf8') return ciphertext<|docstring|>Parameters: text (string) key (byte string) - The secret key used in symmetric ciphers. It must be 16 or 24 bytes long. The parity bit is ignored. iv (byte string) - The initialization vector to be used for encryption or decryption. Return: ciphertext (byte string)<|endoftext|>
1ec78eb24bc4cf10f70609cf4593e5dbe09bc4a5167b7fcc91983f43891cfa8d
def des_3_decode(text, key, iv): '\n Parameters:\n text (string)\n key (byte string)\n iv (byte string)\n Return:\n plaintext (byte string)\n ' ciphertext = base64.b64decode(text) cipher = DES3.new(key.encode('utf-8'), DES3.MODE_CBC, iv.encode('utf-8')) plaintext = unpad(cipher.decrypt(ciphertext), DES3.block_size) return plaintext
Parameters: text (string) key (byte string) iv (byte string) Return: plaintext (byte string)
login/des_3.py
des_3_decode
StarsbySea/17wanxiaoCheckin-Actions
0
python
def des_3_decode(text, key, iv): '\n Parameters:\n text (string)\n key (byte string)\n iv (byte string)\n Return:\n plaintext (byte string)\n ' ciphertext = base64.b64decode(text) cipher = DES3.new(key.encode('utf-8'), DES3.MODE_CBC, iv.encode('utf-8')) plaintext = unpad(cipher.decrypt(ciphertext), DES3.block_size) return plaintext
def des_3_decode(text, key, iv): '\n Parameters:\n text (string)\n key (byte string)\n iv (byte string)\n Return:\n plaintext (byte string)\n ' ciphertext = base64.b64decode(text) cipher = DES3.new(key.encode('utf-8'), DES3.MODE_CBC, iv.encode('utf-8')) plaintext = unpad(cipher.decrypt(ciphertext), DES3.block_size) return plaintext<|docstring|>Parameters: text (string) key (byte string) iv (byte string) Return: plaintext (byte string)<|endoftext|>
04d1a91e6e8e8a8cb52bce041c6dd57eb60240361d44703d17c13abc712fb7dc
def object_encrypt(dict_to_encrypt, key, iv): '\n Parameters:\n dict_to_encrypt (dict)\n key (byte string)\n iv (byte string) - 8 bits.\n Return:\n ciphertext (byte string)\n ' return des_3_encrypt(json.dumps(dict_to_encrypt), key, iv)
Parameters: dict_to_encrypt (dict) key (byte string) iv (byte string) - 8 bits. Return: ciphertext (byte string)
login/des_3.py
object_encrypt
StarsbySea/17wanxiaoCheckin-Actions
0
python
def object_encrypt(dict_to_encrypt, key, iv): '\n Parameters:\n dict_to_encrypt (dict)\n key (byte string)\n iv (byte string) - 8 bits.\n Return:\n ciphertext (byte string)\n ' return des_3_encrypt(json.dumps(dict_to_encrypt), key, iv)
def object_encrypt(dict_to_encrypt, key, iv): '\n Parameters:\n dict_to_encrypt (dict)\n key (byte string)\n iv (byte string) - 8 bits.\n Return:\n ciphertext (byte string)\n ' return des_3_encrypt(json.dumps(dict_to_encrypt), key, iv)<|docstring|>Parameters: dict_to_encrypt (dict) key (byte string) iv (byte string) - 8 bits. Return: ciphertext (byte string)<|endoftext|>
5e24882a1e4f1161d5967f3117bb10c7b0cc7843d13ce650c539534392676320
def object_decrypt(string_to_decrypt, key, iv): '\n Parameters:\n string_to_decrypt (string)\n key (byte string)\n iv (byte string) - 8 bits.\n Return:\n plaintext (byte string)\n ' string_to_decrypt = string_to_decrypt.replace('\n', '') return json.loads(des_3_decode(string_to_decrypt, key, iv))
Parameters: string_to_decrypt (string) key (byte string) iv (byte string) - 8 bits. Return: plaintext (byte string)
login/des_3.py
object_decrypt
StarsbySea/17wanxiaoCheckin-Actions
0
python
def object_decrypt(string_to_decrypt, key, iv): '\n Parameters:\n string_to_decrypt (string)\n key (byte string)\n iv (byte string) - 8 bits.\n Return:\n plaintext (byte string)\n ' string_to_decrypt = string_to_decrypt.replace('\n', ) return json.loads(des_3_decode(string_to_decrypt, key, iv))
def object_decrypt(string_to_decrypt, key, iv): '\n Parameters:\n string_to_decrypt (string)\n key (byte string)\n iv (byte string) - 8 bits.\n Return:\n plaintext (byte string)\n ' string_to_decrypt = string_to_decrypt.replace('\n', ) return json.loads(des_3_decode(string_to_decrypt, key, iv))<|docstring|>Parameters: string_to_decrypt (string) key (byte string) iv (byte string) - 8 bits. Return: plaintext (byte string)<|endoftext|>
bd4f94c152ffed55cb7954b93022e7dd0c3186aa622ca8e02356d2a22b3cab14
def verify_message(self, msg_list, schema_list, from_file=False): 'This function verifies the message generated when an order is created.\n\n Parameters\n ----------\n msg_list : List[dict]\n - This is a list of the json dicts that has to be sent as messages. \n \n schema_list : List[dict]\n - This is a list of json schemas that correspond to the msg_list. These are used to verify the message is setup correctly.\n\n Returns\n -------\n is_valid : bool\n - If true, the message is the correct format and the entries are of the right types. If not it will return false.\n ' if (type(msg_list) != list): msg_list = [msg_list] if (type(schema_list) != list): schema_list = [schema_list] if (from_file == True): for (msg, schema) in zip(msg_list, schema_list): with open(('/home/robotlab/turtlebot_ws/src/VDA5050_to_ROS//messages/' + msg), 'r', encoding='utf8') as file: msg_data = json.load(file) file.close() with open(('/home/robotlab/turtlebot_ws/src/VDA5050_to_ROS/schemas/' + schema), 'r', encoding='utf8') as file: schema = json.load(file) file.close() is_valid = jsonschema.Draft3Validator(schema=schema).is_valid(msg_data) return is_valid else: for (msg, schema) in zip(msg_list, schema_list): with open(('/home/robotlab/turtlebot_ws/src/VDA5050_to_ROS/schemas/' + schema), 'r', encoding='utf8') as file: schema = json.load(file) file.close() is_valid = jsonschema.Draft3Validator(schema=schema).is_valid(msg) return is_valid
This function verifies the message generated when an order is created. Parameters ---------- msg_list : List[dict] - This is a list of the json dicts that has to be sent as messages. schema_list : List[dict] - This is a list of json schemas that correspond to the msg_list. These are used to verify the message is setup correctly. Returns ------- is_valid : bool - If true, the message is the correct format and the entries are of the right types. If not it will return false.
taskmanager_ws/scripts/task_manager.py
verify_message
AAUSmartProductionLab/VDA5050-to-ROS
0
python
def verify_message(self, msg_list, schema_list, from_file=False): 'This function verifies the message generated when an order is created.\n\n Parameters\n ----------\n msg_list : List[dict]\n - This is a list of the json dicts that has to be sent as messages. \n \n schema_list : List[dict]\n - This is a list of json schemas that correspond to the msg_list. These are used to verify the message is setup correctly.\n\n Returns\n -------\n is_valid : bool\n - If true, the message is the correct format and the entries are of the right types. If not it will return false.\n ' if (type(msg_list) != list): msg_list = [msg_list] if (type(schema_list) != list): schema_list = [schema_list] if (from_file == True): for (msg, schema) in zip(msg_list, schema_list): with open(('/home/robotlab/turtlebot_ws/src/VDA5050_to_ROS//messages/' + msg), 'r', encoding='utf8') as file: msg_data = json.load(file) file.close() with open(('/home/robotlab/turtlebot_ws/src/VDA5050_to_ROS/schemas/' + schema), 'r', encoding='utf8') as file: schema = json.load(file) file.close() is_valid = jsonschema.Draft3Validator(schema=schema).is_valid(msg_data) return is_valid else: for (msg, schema) in zip(msg_list, schema_list): with open(('/home/robotlab/turtlebot_ws/src/VDA5050_to_ROS/schemas/' + schema), 'r', encoding='utf8') as file: schema = json.load(file) file.close() is_valid = jsonschema.Draft3Validator(schema=schema).is_valid(msg) return is_valid
def verify_message(self, msg_list, schema_list, from_file=False): 'This function verifies the message generated when an order is created.\n\n Parameters\n ----------\n msg_list : List[dict]\n - This is a list of the json dicts that has to be sent as messages. \n \n schema_list : List[dict]\n - This is a list of json schemas that correspond to the msg_list. These are used to verify the message is setup correctly.\n\n Returns\n -------\n is_valid : bool\n - If true, the message is the correct format and the entries are of the right types. If not it will return false.\n ' if (type(msg_list) != list): msg_list = [msg_list] if (type(schema_list) != list): schema_list = [schema_list] if (from_file == True): for (msg, schema) in zip(msg_list, schema_list): with open(('/home/robotlab/turtlebot_ws/src/VDA5050_to_ROS//messages/' + msg), 'r', encoding='utf8') as file: msg_data = json.load(file) file.close() with open(('/home/robotlab/turtlebot_ws/src/VDA5050_to_ROS/schemas/' + schema), 'r', encoding='utf8') as file: schema = json.load(file) file.close() is_valid = jsonschema.Draft3Validator(schema=schema).is_valid(msg_data) return is_valid else: for (msg, schema) in zip(msg_list, schema_list): with open(('/home/robotlab/turtlebot_ws/src/VDA5050_to_ROS/schemas/' + schema), 'r', encoding='utf8') as file: schema = json.load(file) file.close() is_valid = jsonschema.Draft3Validator(schema=schema).is_valid(msg) return is_valid<|docstring|>This function verifies the message generated when an order is created. Parameters ---------- msg_list : List[dict] - This is a list of the json dicts that has to be sent as messages. schema_list : List[dict] - This is a list of json schemas that correspond to the msg_list. These are used to verify the message is setup correctly. Returns ------- is_valid : bool - If true, the message is the correct format and the entries are of the right types. If not it will return false.<|endoftext|>
675c122fe8f386d5c3d5cf6022f788803498128fab0fc2c0cd11acefa9672158
@click.command(short_help='Uninstall an integration') @click.pass_context @click.option('-y', '--yes', is_flag=True, default=False, help="Don't ask for confirmation of uninstall deletions.") @click.argument('integrations', nargs=(- 1)) def uninstall(ctx, yes, integrations): 'Uninstall a integration.' logger.debug('running command %s (%s)', ctx.command.name, ctx.params, extra={'command': ctx.command.name, 'params': ctx.params}) home = ctx.obj['HOME'] for integration in integrations: integration_path = plugin_utils.get_plugin_path(home, INTEGRATIONS, integration) plugin_utils.uninstall_plugin(integration_path, yes)
Uninstall a integration.
honeycomb/commands/integration/uninstall.py
uninstall
omercnet/honeycomb
81
python
@click.command(short_help='Uninstall an integration') @click.pass_context @click.option('-y', '--yes', is_flag=True, default=False, help="Don't ask for confirmation of uninstall deletions.") @click.argument('integrations', nargs=(- 1)) def uninstall(ctx, yes, integrations): logger.debug('running command %s (%s)', ctx.command.name, ctx.params, extra={'command': ctx.command.name, 'params': ctx.params}) home = ctx.obj['HOME'] for integration in integrations: integration_path = plugin_utils.get_plugin_path(home, INTEGRATIONS, integration) plugin_utils.uninstall_plugin(integration_path, yes)
@click.command(short_help='Uninstall an integration') @click.pass_context @click.option('-y', '--yes', is_flag=True, default=False, help="Don't ask for confirmation of uninstall deletions.") @click.argument('integrations', nargs=(- 1)) def uninstall(ctx, yes, integrations): logger.debug('running command %s (%s)', ctx.command.name, ctx.params, extra={'command': ctx.command.name, 'params': ctx.params}) home = ctx.obj['HOME'] for integration in integrations: integration_path = plugin_utils.get_plugin_path(home, INTEGRATIONS, integration) plugin_utils.uninstall_plugin(integration_path, yes)<|docstring|>Uninstall a integration.<|endoftext|>
efe1a041acb5463ea463de29769fdff06f8c142ca48f6d4b2dd613f0de85dcfe
@asyncio.coroutine def async_setup_platform(hass, config, async_add_devices, discovery_info=None): 'Set up the light from config.' from miio import Device, DeviceException host = config.get(CONF_HOST) name = config.get(CONF_NAME) token = config.get(CONF_TOKEN) _LOGGER.info('Initializing with host %s (token %s...)', host, token[:5]) devices = [] try: light = Device(host, token) device_info = light.info() _LOGGER.info('%s %s %s initialized', device_info.model, device_info.firmware_version, device_info.hardware_version) if (device_info.model == 'philips.light.sread1'): from miio import PhilipsEyecare light = PhilipsEyecare(host, token) device = XiaomiPhilipsEyecareLamp(name, light, device_info) devices.append(device) elif (device_info.model == 'philips.light.ceiling'): from miio import Ceil light = Ceil(host, token) device = XiaomiPhilipsCeilingLamp(name, light, device_info) devices.append(device) elif (device_info.model == 'philips.light.bulb'): from miio import PhilipsBulb light = PhilipsBulb(host, token) device = XiaomiPhilipsLightBall(name, light, device_info) devices.append(device) else: _LOGGER.error('Unsupported device found! Please create an issue at https://github.com/rytilahti/python-miio/issues and provide the following data: %s', device_info.model) except DeviceException: raise PlatformNotReady async_add_devices(devices, update_before_add=True)
Set up the light from config.
homeassistant/components/light/xiaomi_miio.py
async_setup_platform
maihde/home-assistant
2
python
@asyncio.coroutine def async_setup_platform(hass, config, async_add_devices, discovery_info=None): from miio import Device, DeviceException host = config.get(CONF_HOST) name = config.get(CONF_NAME) token = config.get(CONF_TOKEN) _LOGGER.info('Initializing with host %s (token %s...)', host, token[:5]) devices = [] try: light = Device(host, token) device_info = light.info() _LOGGER.info('%s %s %s initialized', device_info.model, device_info.firmware_version, device_info.hardware_version) if (device_info.model == 'philips.light.sread1'): from miio import PhilipsEyecare light = PhilipsEyecare(host, token) device = XiaomiPhilipsEyecareLamp(name, light, device_info) devices.append(device) elif (device_info.model == 'philips.light.ceiling'): from miio import Ceil light = Ceil(host, token) device = XiaomiPhilipsCeilingLamp(name, light, device_info) devices.append(device) elif (device_info.model == 'philips.light.bulb'): from miio import PhilipsBulb light = PhilipsBulb(host, token) device = XiaomiPhilipsLightBall(name, light, device_info) devices.append(device) else: _LOGGER.error('Unsupported device found! Please create an issue at https://github.com/rytilahti/python-miio/issues and provide the following data: %s', device_info.model) except DeviceException: raise PlatformNotReady async_add_devices(devices, update_before_add=True)
@asyncio.coroutine def async_setup_platform(hass, config, async_add_devices, discovery_info=None): from miio import Device, DeviceException host = config.get(CONF_HOST) name = config.get(CONF_NAME) token = config.get(CONF_TOKEN) _LOGGER.info('Initializing with host %s (token %s...)', host, token[:5]) devices = [] try: light = Device(host, token) device_info = light.info() _LOGGER.info('%s %s %s initialized', device_info.model, device_info.firmware_version, device_info.hardware_version) if (device_info.model == 'philips.light.sread1'): from miio import PhilipsEyecare light = PhilipsEyecare(host, token) device = XiaomiPhilipsEyecareLamp(name, light, device_info) devices.append(device) elif (device_info.model == 'philips.light.ceiling'): from miio import Ceil light = Ceil(host, token) device = XiaomiPhilipsCeilingLamp(name, light, device_info) devices.append(device) elif (device_info.model == 'philips.light.bulb'): from miio import PhilipsBulb light = PhilipsBulb(host, token) device = XiaomiPhilipsLightBall(name, light, device_info) devices.append(device) else: _LOGGER.error('Unsupported device found! Please create an issue at https://github.com/rytilahti/python-miio/issues and provide the following data: %s', device_info.model) except DeviceException: raise PlatformNotReady async_add_devices(devices, update_before_add=True)<|docstring|>Set up the light from config.<|endoftext|>
4962abccdf7fff72c67301d40c4c15b09d23fa719fedb151261aa5c7cd8ab753
def __init__(self, name, light, device_info): 'Initialize the light device.' self._name = name self._device_info = device_info self._brightness = None self._color_temp = None self._light = light self._state = None self._state_attrs = {ATTR_MODEL: self._device_info.model}
Initialize the light device.
homeassistant/components/light/xiaomi_miio.py
__init__
maihde/home-assistant
2
python
def __init__(self, name, light, device_info): self._name = name self._device_info = device_info self._brightness = None self._color_temp = None self._light = light self._state = None self._state_attrs = {ATTR_MODEL: self._device_info.model}
def __init__(self, name, light, device_info): self._name = name self._device_info = device_info self._brightness = None self._color_temp = None self._light = light self._state = None self._state_attrs = {ATTR_MODEL: self._device_info.model}<|docstring|>Initialize the light device.<|endoftext|>
17f5d352402d7df20fad28cac66d02dc7ead78a38ea9359020a6cd76d03cff0f
@property def should_poll(self): 'Poll the light.' return True
Poll the light.
homeassistant/components/light/xiaomi_miio.py
should_poll
maihde/home-assistant
2
python
@property def should_poll(self): return True
@property def should_poll(self): return True<|docstring|>Poll the light.<|endoftext|>
3ed9a10c115a72fb9bef0c45907c95f20ee8a368bc1d112dcdda587da804811b
@property def name(self): 'Return the name of the device if any.' return self._name
Return the name of the device if any.
homeassistant/components/light/xiaomi_miio.py
name
maihde/home-assistant
2
python
@property def name(self): return self._name
@property def name(self): return self._name<|docstring|>Return the name of the device if any.<|endoftext|>
d231b28c841f14d36b16dcd56544fa42253e0a9534ec6a44959d430759a1ccf3
@property def available(self): 'Return true when state is known.' return (self._state is not None)
Return true when state is known.
homeassistant/components/light/xiaomi_miio.py
available
maihde/home-assistant
2
python
@property def available(self): return (self._state is not None)
@property def available(self): return (self._state is not None)<|docstring|>Return true when state is known.<|endoftext|>
7a095c02d5803dde5444c26a2629f884f6ccb63639188b9af4879afbb89be03a
@property def device_state_attributes(self): 'Return the state attributes of the device.' return self._state_attrs
Return the state attributes of the device.
homeassistant/components/light/xiaomi_miio.py
device_state_attributes
maihde/home-assistant
2
python
@property def device_state_attributes(self): return self._state_attrs
@property def device_state_attributes(self): return self._state_attrs<|docstring|>Return the state attributes of the device.<|endoftext|>
af2dbc2f5ea35df80b28d86350f7a4cfd30e4a575dc14652f39ca78df214e5ef
@property def is_on(self): 'Return true if light is on.' return self._state
Return true if light is on.
homeassistant/components/light/xiaomi_miio.py
is_on
maihde/home-assistant
2
python
@property def is_on(self): return self._state
@property def is_on(self): return self._state<|docstring|>Return true if light is on.<|endoftext|>
a537b1e54fd4ce800d8aff2b26cba2d2460d98deda35179bb89ce6745c5e5b44
@property def brightness(self): 'Return the brightness of this light between 0..255.' return self._brightness
Return the brightness of this light between 0..255.
homeassistant/components/light/xiaomi_miio.py
brightness
maihde/home-assistant
2
python
@property def brightness(self): return self._brightness
@property def brightness(self): return self._brightness<|docstring|>Return the brightness of this light between 0..255.<|endoftext|>
67a6ada77e0f1ba47b82db4bb75b3a5a539f0d54b97b996e5de285d5226c734d
@property def supported_features(self): 'Return the supported features.' return SUPPORT_BRIGHTNESS
Return the supported features.
homeassistant/components/light/xiaomi_miio.py
supported_features
maihde/home-assistant
2
python
@property def supported_features(self): return SUPPORT_BRIGHTNESS
@property def supported_features(self): return SUPPORT_BRIGHTNESS<|docstring|>Return the supported features.<|endoftext|>
2f6e4fabb6d75ff0c9b51009d35b583670be0237e58b17794eff699b0aa89dcf
@asyncio.coroutine def _try_command(self, mask_error, func, *args, **kwargs): 'Call a light command handling error messages.' from miio import DeviceException try: result = (yield from self.hass.async_add_job(partial(func, *args, **kwargs))) _LOGGER.debug('Response received from light: %s', result) return (result == SUCCESS) except DeviceException as exc: _LOGGER.error(mask_error, exc) return False
Call a light command handling error messages.
homeassistant/components/light/xiaomi_miio.py
_try_command
maihde/home-assistant
2
python
@asyncio.coroutine def _try_command(self, mask_error, func, *args, **kwargs): from miio import DeviceException try: result = (yield from self.hass.async_add_job(partial(func, *args, **kwargs))) _LOGGER.debug('Response received from light: %s', result) return (result == SUCCESS) except DeviceException as exc: _LOGGER.error(mask_error, exc) return False
@asyncio.coroutine def _try_command(self, mask_error, func, *args, **kwargs): from miio import DeviceException try: result = (yield from self.hass.async_add_job(partial(func, *args, **kwargs))) _LOGGER.debug('Response received from light: %s', result) return (result == SUCCESS) except DeviceException as exc: _LOGGER.error(mask_error, exc) return False<|docstring|>Call a light command handling error messages.<|endoftext|>
763265cf3a162e2335e19651c6da762e4eade45b27cb28c910f0eb26f30af746
@asyncio.coroutine def async_turn_on(self, **kwargs): 'Turn the light on.' if (ATTR_BRIGHTNESS in kwargs): brightness = kwargs[ATTR_BRIGHTNESS] percent_brightness = int(((100 * brightness) / 255)) _LOGGER.debug('Setting brightness: %s %s%%', self.brightness, percent_brightness) result = (yield from self._try_command('Setting brightness failed: %s', self._light.set_brightness, percent_brightness)) if result: self._brightness = brightness self._state = (yield from self._try_command('Turning the light on failed.', self._light.on))
Turn the light on.
homeassistant/components/light/xiaomi_miio.py
async_turn_on
maihde/home-assistant
2
python
@asyncio.coroutine def async_turn_on(self, **kwargs): if (ATTR_BRIGHTNESS in kwargs): brightness = kwargs[ATTR_BRIGHTNESS] percent_brightness = int(((100 * brightness) / 255)) _LOGGER.debug('Setting brightness: %s %s%%', self.brightness, percent_brightness) result = (yield from self._try_command('Setting brightness failed: %s', self._light.set_brightness, percent_brightness)) if result: self._brightness = brightness self._state = (yield from self._try_command('Turning the light on failed.', self._light.on))
@asyncio.coroutine def async_turn_on(self, **kwargs): if (ATTR_BRIGHTNESS in kwargs): brightness = kwargs[ATTR_BRIGHTNESS] percent_brightness = int(((100 * brightness) / 255)) _LOGGER.debug('Setting brightness: %s %s%%', self.brightness, percent_brightness) result = (yield from self._try_command('Setting brightness failed: %s', self._light.set_brightness, percent_brightness)) if result: self._brightness = brightness self._state = (yield from self._try_command('Turning the light on failed.', self._light.on))<|docstring|>Turn the light on.<|endoftext|>
b17c7656ccc49c27c94675d90a021812df91ab213cca3782d43404544e88795d
@asyncio.coroutine def async_turn_off(self, **kwargs): 'Turn the light off.' self._state = (yield from self._try_command('Turning the light off failed.', self._light.off))
Turn the light off.
homeassistant/components/light/xiaomi_miio.py
async_turn_off
maihde/home-assistant
2
python
@asyncio.coroutine def async_turn_off(self, **kwargs): self._state = (yield from self._try_command('Turning the light off failed.', self._light.off))
@asyncio.coroutine def async_turn_off(self, **kwargs): self._state = (yield from self._try_command('Turning the light off failed.', self._light.off))<|docstring|>Turn the light off.<|endoftext|>
dbafd3f5e31bf684613909b21044cb39e7541d76f4a2b28c04b80b0fe50a4708
@asyncio.coroutine def async_update(self): 'Fetch state from the device.' from miio import DeviceException try: state = (yield from self.hass.async_add_job(self._light.status)) _LOGGER.debug('Got new state: %s', state) self._state = state.is_on self._brightness = int(((255 * 0.01) * state.brightness)) except DeviceException as ex: _LOGGER.error('Got exception while fetching the state: %s', ex)
Fetch state from the device.
homeassistant/components/light/xiaomi_miio.py
async_update
maihde/home-assistant
2
python
@asyncio.coroutine def async_update(self): from miio import DeviceException try: state = (yield from self.hass.async_add_job(self._light.status)) _LOGGER.debug('Got new state: %s', state) self._state = state.is_on self._brightness = int(((255 * 0.01) * state.brightness)) except DeviceException as ex: _LOGGER.error('Got exception while fetching the state: %s', ex)
@asyncio.coroutine def async_update(self): from miio import DeviceException try: state = (yield from self.hass.async_add_job(self._light.status)) _LOGGER.debug('Got new state: %s', state) self._state = state.is_on self._brightness = int(((255 * 0.01) * state.brightness)) except DeviceException as ex: _LOGGER.error('Got exception while fetching the state: %s', ex)<|docstring|>Fetch state from the device.<|endoftext|>
99f3381fee518a78546316b30caf094feadf40ef3dfa4dd0e744d58fc0a5e97e
@staticmethod def translate(value, left_min, left_max, right_min, right_max): 'Map a value from left span to right span.' left_span = (left_max - left_min) right_span = (right_max - right_min) value_scaled = (float((value - left_min)) / float(left_span)) return int((right_min + (value_scaled * right_span)))
Map a value from left span to right span.
homeassistant/components/light/xiaomi_miio.py
translate
maihde/home-assistant
2
python
@staticmethod def translate(value, left_min, left_max, right_min, right_max): left_span = (left_max - left_min) right_span = (right_max - right_min) value_scaled = (float((value - left_min)) / float(left_span)) return int((right_min + (value_scaled * right_span)))
@staticmethod def translate(value, left_min, left_max, right_min, right_max): left_span = (left_max - left_min) right_span = (right_max - right_min) value_scaled = (float((value - left_min)) / float(left_span)) return int((right_min + (value_scaled * right_span)))<|docstring|>Map a value from left span to right span.<|endoftext|>
b735917e52fd6370688703ba07b6670b7346b1e8406b8ab36f10bb05d0baa315
def __init__(self, name, light, device_info): 'Initialize the light device.' super().__init__(name, light, device_info)
Initialize the light device.
homeassistant/components/light/xiaomi_miio.py
__init__
maihde/home-assistant
2
python
def __init__(self, name, light, device_info): super().__init__(name, light, device_info)
def __init__(self, name, light, device_info): super().__init__(name, light, device_info)<|docstring|>Initialize the light device.<|endoftext|>
af81e6aa904acc48648d8c968d9e1ea1048976f9b19e7d281623a5b334375a05
@property def color_temp(self): 'Return the color temperature.' return self._color_temp
Return the color temperature.
homeassistant/components/light/xiaomi_miio.py
color_temp
maihde/home-assistant
2
python
@property def color_temp(self): return self._color_temp
@property def color_temp(self): return self._color_temp<|docstring|>Return the color temperature.<|endoftext|>
00cf6510ebc4314efe963ea8e9c7ecd18d9786d6376ce2200eab4e80ec8a4638
@property def min_mireds(self): 'Return the coldest color_temp that this light supports.' return 175
Return the coldest color_temp that this light supports.
homeassistant/components/light/xiaomi_miio.py
min_mireds
maihde/home-assistant
2
python
@property def min_mireds(self): return 175
@property def min_mireds(self): return 175<|docstring|>Return the coldest color_temp that this light supports.<|endoftext|>
e93ba745ed250a1942828e380a1b8662231016b718c9f2ca32ec39e629b1c82b
@property def max_mireds(self): 'Return the warmest color_temp that this light supports.' return 333
Return the warmest color_temp that this light supports.
homeassistant/components/light/xiaomi_miio.py
max_mireds
maihde/home-assistant
2
python
@property def max_mireds(self): return 333
@property def max_mireds(self): return 333<|docstring|>Return the warmest color_temp that this light supports.<|endoftext|>
1473df06ed0c10fb2063bcfcb17d4775261af518a4306b9aaee0ceffc3e15b99
@property def supported_features(self): 'Return the supported features.' return (SUPPORT_BRIGHTNESS | SUPPORT_COLOR_TEMP)
Return the supported features.
homeassistant/components/light/xiaomi_miio.py
supported_features
maihde/home-assistant
2
python
@property def supported_features(self): return (SUPPORT_BRIGHTNESS | SUPPORT_COLOR_TEMP)
@property def supported_features(self): return (SUPPORT_BRIGHTNESS | SUPPORT_COLOR_TEMP)<|docstring|>Return the supported features.<|endoftext|>
917c3d848f52bdde8b0d3a52fc445ef2203ab4c708ec5b9b4c881f0d72be36bc
@asyncio.coroutine def async_turn_on(self, **kwargs): 'Turn the light on.' if (ATTR_COLOR_TEMP in kwargs): color_temp = kwargs[ATTR_COLOR_TEMP] percent_color_temp = self.translate(color_temp, self.max_mireds, self.min_mireds, CCT_MIN, CCT_MAX) _LOGGER.debug('Setting color temperature: %s mireds, %s%% cct', color_temp, percent_color_temp) result = (yield from self._try_command('Setting color temperature failed: %s cct', self._light.set_color_temperature, percent_color_temp)) if result: self._color_temp = color_temp if (ATTR_BRIGHTNESS in kwargs): brightness = kwargs[ATTR_BRIGHTNESS] percent_brightness = int(((100 * brightness) / 255)) _LOGGER.debug('Setting brightness: %s %s%%', self.brightness, percent_brightness) result = (yield from self._try_command('Setting brightness failed: %s', self._light.set_brightness, percent_brightness)) if result: self._brightness = brightness self._state = (yield from self._try_command('Turning the light on failed.', self._light.on))
Turn the light on.
homeassistant/components/light/xiaomi_miio.py
async_turn_on
maihde/home-assistant
2
python
@asyncio.coroutine def async_turn_on(self, **kwargs): if (ATTR_COLOR_TEMP in kwargs): color_temp = kwargs[ATTR_COLOR_TEMP] percent_color_temp = self.translate(color_temp, self.max_mireds, self.min_mireds, CCT_MIN, CCT_MAX) _LOGGER.debug('Setting color temperature: %s mireds, %s%% cct', color_temp, percent_color_temp) result = (yield from self._try_command('Setting color temperature failed: %s cct', self._light.set_color_temperature, percent_color_temp)) if result: self._color_temp = color_temp if (ATTR_BRIGHTNESS in kwargs): brightness = kwargs[ATTR_BRIGHTNESS] percent_brightness = int(((100 * brightness) / 255)) _LOGGER.debug('Setting brightness: %s %s%%', self.brightness, percent_brightness) result = (yield from self._try_command('Setting brightness failed: %s', self._light.set_brightness, percent_brightness)) if result: self._brightness = brightness self._state = (yield from self._try_command('Turning the light on failed.', self._light.on))
@asyncio.coroutine def async_turn_on(self, **kwargs): if (ATTR_COLOR_TEMP in kwargs): color_temp = kwargs[ATTR_COLOR_TEMP] percent_color_temp = self.translate(color_temp, self.max_mireds, self.min_mireds, CCT_MIN, CCT_MAX) _LOGGER.debug('Setting color temperature: %s mireds, %s%% cct', color_temp, percent_color_temp) result = (yield from self._try_command('Setting color temperature failed: %s cct', self._light.set_color_temperature, percent_color_temp)) if result: self._color_temp = color_temp if (ATTR_BRIGHTNESS in kwargs): brightness = kwargs[ATTR_BRIGHTNESS] percent_brightness = int(((100 * brightness) / 255)) _LOGGER.debug('Setting brightness: %s %s%%', self.brightness, percent_brightness) result = (yield from self._try_command('Setting brightness failed: %s', self._light.set_brightness, percent_brightness)) if result: self._brightness = brightness self._state = (yield from self._try_command('Turning the light on failed.', self._light.on))<|docstring|>Turn the light on.<|endoftext|>
93d8cae92de561d19d5143adcb310392382bf5b5ee723911d5b6ec9e1977c0ad
@asyncio.coroutine def async_update(self): 'Fetch state from the device.' from miio import DeviceException try: state = (yield from self.hass.async_add_job(self._light.status)) _LOGGER.debug('Got new state: %s', state) self._state = state.is_on self._brightness = int(((255 * 0.01) * state.brightness)) self._color_temp = self.translate(state.color_temperature, CCT_MIN, CCT_MAX, self.max_mireds, self.min_mireds) except DeviceException as ex: _LOGGER.error('Got exception while fetching the state: %s', ex)
Fetch state from the device.
homeassistant/components/light/xiaomi_miio.py
async_update
maihde/home-assistant
2
python
@asyncio.coroutine def async_update(self): from miio import DeviceException try: state = (yield from self.hass.async_add_job(self._light.status)) _LOGGER.debug('Got new state: %s', state) self._state = state.is_on self._brightness = int(((255 * 0.01) * state.brightness)) self._color_temp = self.translate(state.color_temperature, CCT_MIN, CCT_MAX, self.max_mireds, self.min_mireds) except DeviceException as ex: _LOGGER.error('Got exception while fetching the state: %s', ex)
@asyncio.coroutine def async_update(self): from miio import DeviceException try: state = (yield from self.hass.async_add_job(self._light.status)) _LOGGER.debug('Got new state: %s', state) self._state = state.is_on self._brightness = int(((255 * 0.01) * state.brightness)) self._color_temp = self.translate(state.color_temperature, CCT_MIN, CCT_MAX, self.max_mireds, self.min_mireds) except DeviceException as ex: _LOGGER.error('Got exception while fetching the state: %s', ex)<|docstring|>Fetch state from the device.<|endoftext|>
b735917e52fd6370688703ba07b6670b7346b1e8406b8ab36f10bb05d0baa315
def __init__(self, name, light, device_info): 'Initialize the light device.' super().__init__(name, light, device_info)
Initialize the light device.
homeassistant/components/light/xiaomi_miio.py
__init__
maihde/home-assistant
2
python
def __init__(self, name, light, device_info): super().__init__(name, light, device_info)
def __init__(self, name, light, device_info): super().__init__(name, light, device_info)<|docstring|>Initialize the light device.<|endoftext|>
00cf6510ebc4314efe963ea8e9c7ecd18d9786d6376ce2200eab4e80ec8a4638
@property def min_mireds(self): 'Return the coldest color_temp that this light supports.' return 175
Return the coldest color_temp that this light supports.
homeassistant/components/light/xiaomi_miio.py
min_mireds
maihde/home-assistant
2
python
@property def min_mireds(self): return 175
@property def min_mireds(self): return 175<|docstring|>Return the coldest color_temp that this light supports.<|endoftext|>
bac34508bcaefa03eb2ad36e98407563c8da5de654de09f1bba37d39b3eeeeed
@property def max_mireds(self): 'Return the warmest color_temp that this light supports.' return 370
Return the warmest color_temp that this light supports.
homeassistant/components/light/xiaomi_miio.py
max_mireds
maihde/home-assistant
2
python
@property def max_mireds(self): return 370
@property def max_mireds(self): return 370<|docstring|>Return the warmest color_temp that this light supports.<|endoftext|>
b735917e52fd6370688703ba07b6670b7346b1e8406b8ab36f10bb05d0baa315
def __init__(self, name, light, device_info): 'Initialize the light device.' super().__init__(name, light, device_info)
Initialize the light device.
homeassistant/components/light/xiaomi_miio.py
__init__
maihde/home-assistant
2
python
def __init__(self, name, light, device_info): super().__init__(name, light, device_info)
def __init__(self, name, light, device_info): super().__init__(name, light, device_info)<|docstring|>Initialize the light device.<|endoftext|>
ad1233e06805729bfce8cd3dae988fc258c26301485c81a456f23b39f2fb112d
def __init__(self): ' Initialize object ' self.clear_console() print(weather_utils.title("Welcome to Bill's NWS Weather App!")) self.__decorator_width = 75
Initialize object
nws_class.py
__init__
itinstructor/NationalWeatherServicePythonConsoleApp
0
python
def __init__(self): ' ' self.clear_console() print(weather_utils.title("Welcome to Bill's NWS Weather App!")) self.__decorator_width = 75
def __init__(self): ' ' self.clear_console() print(weather_utils.title("Welcome to Bill's NWS Weather App!")) self.__decorator_width = 75<|docstring|>Initialize object<|endoftext|>
8efc9b667444a1536cc681eb1cdf3106fda70efd2c61e024023d1c91c0d2df2d
def get_location(self): '\n Get weather location and weather information\n ' PAUSE = 1 try: city = input('Enter city: ') state = input('Enter state: ') country = input('Enter country: ') (lat, lng, self.__address) = geocode_geopy.geocode(city, state, country) print(self.__address) points_url = ((((weather_utils.NWS_ENDPOINT + '/points/') + str(lat)) + ',') + str(lng)) response = requests.get(points_url, timeout=1) if (response.status_code == 200): print('[+] The connection to the National Weather Service was successful.') grid_points_dict = response.json() print(f''' [+] Loading weather data [## ]''', end='') forecast_url = grid_points_dict.get('properties').get('forecast') response = requests.get(forecast_url, timeout=1) sleep(PAUSE) else: print('[-] Did not get NWS Gridpoints') if (response.status_code == 200): forecast_dict = response.json() print(f''' [+] Loading weather data [#### ]''', end='') self.forecast_list = forecast_dict.get('properties').get('periods') forecast_hourly_url = grid_points_dict.get('properties').get('forecastHourly') response = requests.get(forecast_hourly_url, timeout=1) sleep(PAUSE) else: print(f'[-] Did not get NWS 7 Day Forecast - Response: {response.status_code}') if (response.status_code == 200): forecast_hourly_dict = response.json() print(f''' [+] Loading weather data [###### ]''', end='') self.forecast_hourly_list = forecast_hourly_dict.get('properties').get('periods') stations_url = grid_points_dict.get('properties').get('observationStations') response = requests.get(stations_url, timeout=1) sleep(PAUSE) else: print(f'[-] Did not get NWS Hourly Forecast - Response: {response.status_code}') if (response.status_code == 200): self.station_dict = response.json() print(f''' [+] Loading weather data [######## ]''', end='') self.station_id = self.station_dict.get('features')[0].get('properties').get('stationIdentifier') observations_url = (((weather_utils.NWS_ENDPOINT + 'stations/') + self.station_id) + '/observations/latest') response = requests.get(observations_url, timeout=1) sleep(PAUSE) else: print(f'[-] Did not get Station ID - - Response: {response.status_code}') if (response.status_code == 200): self.weather_dict = response.json() print(f''' [+] Loading weather data [########## ]''', end='') sleep(PAUSE) else: print(f'[-] Did not get NWS latest weather observation - Response: {response.status_code}') if (response.status_code == 200): alerts_url = f'https://api.weather.gov/alerts?point={lat},{lng}' response = requests.get(alerts_url) print(f''' [+] Loading weather data [############ ]''', end='') self.alert_dict = response.json() sleep(PAUSE) active_alerts_url = f'https://api.weather.gov/alerts/active?point={lat},{lng}' response = requests.get(active_alerts_url, timeout=1) print(f''' [+] Loading weather data [##############]''') self.active_alert_dict = response.json() sleep(PAUSE) else: print(f'[-] Did not get NWS Weather Alerts - Response: {response.status_code}') except Exception as e: print("Something went wrong. Let's try again") print(e) self.get_location()
Get weather location and weather information
nws_class.py
get_location
itinstructor/NationalWeatherServicePythonConsoleApp
0
python
def get_location(self): '\n \n ' PAUSE = 1 try: city = input('Enter city: ') state = input('Enter state: ') country = input('Enter country: ') (lat, lng, self.__address) = geocode_geopy.geocode(city, state, country) print(self.__address) points_url = ((((weather_utils.NWS_ENDPOINT + '/points/') + str(lat)) + ',') + str(lng)) response = requests.get(points_url, timeout=1) if (response.status_code == 200): print('[+] The connection to the National Weather Service was successful.') grid_points_dict = response.json() print(f' [+] Loading weather data [## ]', end=) forecast_url = grid_points_dict.get('properties').get('forecast') response = requests.get(forecast_url, timeout=1) sleep(PAUSE) else: print('[-] Did not get NWS Gridpoints') if (response.status_code == 200): forecast_dict = response.json() print(f' [+] Loading weather data [#### ]', end=) self.forecast_list = forecast_dict.get('properties').get('periods') forecast_hourly_url = grid_points_dict.get('properties').get('forecastHourly') response = requests.get(forecast_hourly_url, timeout=1) sleep(PAUSE) else: print(f'[-] Did not get NWS 7 Day Forecast - Response: {response.status_code}') if (response.status_code == 200): forecast_hourly_dict = response.json() print(f' [+] Loading weather data [###### ]', end=) self.forecast_hourly_list = forecast_hourly_dict.get('properties').get('periods') stations_url = grid_points_dict.get('properties').get('observationStations') response = requests.get(stations_url, timeout=1) sleep(PAUSE) else: print(f'[-] Did not get NWS Hourly Forecast - Response: {response.status_code}') if (response.status_code == 200): self.station_dict = response.json() print(f' [+] Loading weather data [######## ]', end=) self.station_id = self.station_dict.get('features')[0].get('properties').get('stationIdentifier') observations_url = (((weather_utils.NWS_ENDPOINT + 'stations/') + self.station_id) + '/observations/latest') response = requests.get(observations_url, timeout=1) sleep(PAUSE) else: print(f'[-] Did not get Station ID - - Response: {response.status_code}') if (response.status_code == 200): self.weather_dict = response.json() print(f' [+] Loading weather data [########## ]', end=) sleep(PAUSE) else: print(f'[-] Did not get NWS latest weather observation - Response: {response.status_code}') if (response.status_code == 200): alerts_url = f'https://api.weather.gov/alerts?point={lat},{lng}' response = requests.get(alerts_url) print(f' [+] Loading weather data [############ ]', end=) self.alert_dict = response.json() sleep(PAUSE) active_alerts_url = f'https://api.weather.gov/alerts/active?point={lat},{lng}' response = requests.get(active_alerts_url, timeout=1) print(f' [+] Loading weather data [##############]') self.active_alert_dict = response.json() sleep(PAUSE) else: print(f'[-] Did not get NWS Weather Alerts - Response: {response.status_code}') except Exception as e: print("Something went wrong. Let's try again") print(e) self.get_location()
def get_location(self): '\n \n ' PAUSE = 1 try: city = input('Enter city: ') state = input('Enter state: ') country = input('Enter country: ') (lat, lng, self.__address) = geocode_geopy.geocode(city, state, country) print(self.__address) points_url = ((((weather_utils.NWS_ENDPOINT + '/points/') + str(lat)) + ',') + str(lng)) response = requests.get(points_url, timeout=1) if (response.status_code == 200): print('[+] The connection to the National Weather Service was successful.') grid_points_dict = response.json() print(f' [+] Loading weather data [## ]', end=) forecast_url = grid_points_dict.get('properties').get('forecast') response = requests.get(forecast_url, timeout=1) sleep(PAUSE) else: print('[-] Did not get NWS Gridpoints') if (response.status_code == 200): forecast_dict = response.json() print(f' [+] Loading weather data [#### ]', end=) self.forecast_list = forecast_dict.get('properties').get('periods') forecast_hourly_url = grid_points_dict.get('properties').get('forecastHourly') response = requests.get(forecast_hourly_url, timeout=1) sleep(PAUSE) else: print(f'[-] Did not get NWS 7 Day Forecast - Response: {response.status_code}') if (response.status_code == 200): forecast_hourly_dict = response.json() print(f' [+] Loading weather data [###### ]', end=) self.forecast_hourly_list = forecast_hourly_dict.get('properties').get('periods') stations_url = grid_points_dict.get('properties').get('observationStations') response = requests.get(stations_url, timeout=1) sleep(PAUSE) else: print(f'[-] Did not get NWS Hourly Forecast - Response: {response.status_code}') if (response.status_code == 200): self.station_dict = response.json() print(f' [+] Loading weather data [######## ]', end=) self.station_id = self.station_dict.get('features')[0].get('properties').get('stationIdentifier') observations_url = (((weather_utils.NWS_ENDPOINT + 'stations/') + self.station_id) + '/observations/latest') response = requests.get(observations_url, timeout=1) sleep(PAUSE) else: print(f'[-] Did not get Station ID - - Response: {response.status_code}') if (response.status_code == 200): self.weather_dict = response.json() print(f' [+] Loading weather data [########## ]', end=) sleep(PAUSE) else: print(f'[-] Did not get NWS latest weather observation - Response: {response.status_code}') if (response.status_code == 200): alerts_url = f'https://api.weather.gov/alerts?point={lat},{lng}' response = requests.get(alerts_url) print(f' [+] Loading weather data [############ ]', end=) self.alert_dict = response.json() sleep(PAUSE) active_alerts_url = f'https://api.weather.gov/alerts/active?point={lat},{lng}' response = requests.get(active_alerts_url, timeout=1) print(f' [+] Loading weather data [##############]') self.active_alert_dict = response.json() sleep(PAUSE) else: print(f'[-] Did not get NWS Weather Alerts - Response: {response.status_code}') except Exception as e: print("Something went wrong. Let's try again") print(e) self.get_location()<|docstring|>Get weather location and weather information<|endoftext|>
3302b0fca5c4b5798ad48418d818d0e12bcc7a17d2daec47901aaf57057ea2b3
def get_active_weather_alerts(self): ' Get weather alerts ' print(('=' * self.__decorator_width)) print(f'National Weather Service Active Weather Alerts') print(f'{self.__address}') print(('=' * self.__decorator_width)) active_alert_list = self.active_alert_dict.get('features')[:] if (active_alert_list != []): for alert in active_alert_list: area = alert.get('properties').get('areaDesc') headline = alert.get('properties').get('headline') description = alert.get('properties').get('description') effective = alert.get('properties').get('effective') effective = datetime.fromisoformat(effective) effective = effective.strftime('%m/%d/%Y, %I:%M %p') expires = alert.get('properties').get('expires') expires = datetime.fromisoformat(expires) expires = expires.strftime('%m/%d/%Y, %I:%M %p') wrapper = textwrap.TextWrapper(width=70) area = wrapper.fill(text=area) headline = wrapper.fill(text=headline) description = wrapper.fill(text=description) print(('*' * 70)) print(f'Effective: {effective}') print(f'Expires: {expires}') print(f'{area}') print(f'{headline}') print(f'{description}') input('Press the enter key for the next alert') else: print('No active weather alerts at this time.')
Get weather alerts
nws_class.py
get_active_weather_alerts
itinstructor/NationalWeatherServicePythonConsoleApp
0
python
def get_active_weather_alerts(self): ' ' print(('=' * self.__decorator_width)) print(f'National Weather Service Active Weather Alerts') print(f'{self.__address}') print(('=' * self.__decorator_width)) active_alert_list = self.active_alert_dict.get('features')[:] if (active_alert_list != []): for alert in active_alert_list: area = alert.get('properties').get('areaDesc') headline = alert.get('properties').get('headline') description = alert.get('properties').get('description') effective = alert.get('properties').get('effective') effective = datetime.fromisoformat(effective) effective = effective.strftime('%m/%d/%Y, %I:%M %p') expires = alert.get('properties').get('expires') expires = datetime.fromisoformat(expires) expires = expires.strftime('%m/%d/%Y, %I:%M %p') wrapper = textwrap.TextWrapper(width=70) area = wrapper.fill(text=area) headline = wrapper.fill(text=headline) description = wrapper.fill(text=description) print(('*' * 70)) print(f'Effective: {effective}') print(f'Expires: {expires}') print(f'{area}') print(f'{headline}') print(f'{description}') input('Press the enter key for the next alert') else: print('No active weather alerts at this time.')
def get_active_weather_alerts(self): ' ' print(('=' * self.__decorator_width)) print(f'National Weather Service Active Weather Alerts') print(f'{self.__address}') print(('=' * self.__decorator_width)) active_alert_list = self.active_alert_dict.get('features')[:] if (active_alert_list != []): for alert in active_alert_list: area = alert.get('properties').get('areaDesc') headline = alert.get('properties').get('headline') description = alert.get('properties').get('description') effective = alert.get('properties').get('effective') effective = datetime.fromisoformat(effective) effective = effective.strftime('%m/%d/%Y, %I:%M %p') expires = alert.get('properties').get('expires') expires = datetime.fromisoformat(expires) expires = expires.strftime('%m/%d/%Y, %I:%M %p') wrapper = textwrap.TextWrapper(width=70) area = wrapper.fill(text=area) headline = wrapper.fill(text=headline) description = wrapper.fill(text=description) print(('*' * 70)) print(f'Effective: {effective}') print(f'Expires: {expires}') print(f'{area}') print(f'{headline}') print(f'{description}') input('Press the enter key for the next alert') else: print('No active weather alerts at this time.')<|docstring|>Get weather alerts<|endoftext|>
e6868c415dee75bc2bc2b4e53ce124ac6049a87ce2e2608530904fb743a7f57f
def get_weather_alerts(self): ' Get weather alerts ' print(('=' * self.__decorator_width)) print(f'National Weather Service Weather Alerts') print(f'{self.__address}') print(('=' * self.__decorator_width)) alert_list = self.alert_dict.get('features')[:] if (alert_list != []): for alert in alert_list: area = alert.get('properties').get('areaDesc') headline = alert.get('properties').get('headline') description = alert.get('properties').get('description') effective = alert.get('properties').get('effective') effective = datetime.fromisoformat(effective) effective = effective.strftime('%m/%d/%Y, %I:%M %p') expires = alert.get('properties').get('expires') expires = datetime.fromisoformat(expires) expires = expires.strftime('%m/%d/%Y, %I:%M %p') wrapper = textwrap.TextWrapper(width=70) area = wrapper.fill(text=area) headline = wrapper.fill(text=headline) description = wrapper.fill(text=description) print(('*' * 70)) print(f'Effective: {effective}') print(f'Expires: {expires}') print(f'{area}') print(f'{headline}') print(f'{description}') input('Press the enter key for the next alert') else: print('No weather alerts at this time.')
Get weather alerts
nws_class.py
get_weather_alerts
itinstructor/NationalWeatherServicePythonConsoleApp
0
python
def get_weather_alerts(self): ' ' print(('=' * self.__decorator_width)) print(f'National Weather Service Weather Alerts') print(f'{self.__address}') print(('=' * self.__decorator_width)) alert_list = self.alert_dict.get('features')[:] if (alert_list != []): for alert in alert_list: area = alert.get('properties').get('areaDesc') headline = alert.get('properties').get('headline') description = alert.get('properties').get('description') effective = alert.get('properties').get('effective') effective = datetime.fromisoformat(effective) effective = effective.strftime('%m/%d/%Y, %I:%M %p') expires = alert.get('properties').get('expires') expires = datetime.fromisoformat(expires) expires = expires.strftime('%m/%d/%Y, %I:%M %p') wrapper = textwrap.TextWrapper(width=70) area = wrapper.fill(text=area) headline = wrapper.fill(text=headline) description = wrapper.fill(text=description) print(('*' * 70)) print(f'Effective: {effective}') print(f'Expires: {expires}') print(f'{area}') print(f'{headline}') print(f'{description}') input('Press the enter key for the next alert') else: print('No weather alerts at this time.')
def get_weather_alerts(self): ' ' print(('=' * self.__decorator_width)) print(f'National Weather Service Weather Alerts') print(f'{self.__address}') print(('=' * self.__decorator_width)) alert_list = self.alert_dict.get('features')[:] if (alert_list != []): for alert in alert_list: area = alert.get('properties').get('areaDesc') headline = alert.get('properties').get('headline') description = alert.get('properties').get('description') effective = alert.get('properties').get('effective') effective = datetime.fromisoformat(effective) effective = effective.strftime('%m/%d/%Y, %I:%M %p') expires = alert.get('properties').get('expires') expires = datetime.fromisoformat(expires) expires = expires.strftime('%m/%d/%Y, %I:%M %p') wrapper = textwrap.TextWrapper(width=70) area = wrapper.fill(text=area) headline = wrapper.fill(text=headline) description = wrapper.fill(text=description) print(('*' * 70)) print(f'Effective: {effective}') print(f'Expires: {expires}') print(f'{area}') print(f'{headline}') print(f'{description}') input('Press the enter key for the next alert') else: print('No weather alerts at this time.')<|docstring|>Get weather alerts<|endoftext|>
7ed769df263b89910df5ea4f3ba8828db6f660d11040d504d58301d76cea4708
def get_twelve_hour_forecast(self): ' Get hourly forecast ' print(('=' * self.__decorator_width)) print(f'National Weather Service 12 Hour Weather Forecast') print(f'{self.__address}') print(('=' * self.__decorator_width)) hourly_slice = self.forecast_hourly_list[:12] for forecast_item in hourly_slice: start_time = forecast_item.get('startTime') temperature = forecast_item.get('temperature') wind_speed = forecast_item.get('windSpeed') wind_direction = forecast_item.get('windDirection') short_forecast = forecast_item.get('shortForecast') time = datetime.fromisoformat(start_time) time = time.strftime('%I:%M %p') print(f'{time:>8}: {temperature:>5.1f}°F | {wind_speed:>8} | {wind_direction:>5} | {short_forecast}')
Get hourly forecast
nws_class.py
get_twelve_hour_forecast
itinstructor/NationalWeatherServicePythonConsoleApp
0
python
def get_twelve_hour_forecast(self): ' ' print(('=' * self.__decorator_width)) print(f'National Weather Service 12 Hour Weather Forecast') print(f'{self.__address}') print(('=' * self.__decorator_width)) hourly_slice = self.forecast_hourly_list[:12] for forecast_item in hourly_slice: start_time = forecast_item.get('startTime') temperature = forecast_item.get('temperature') wind_speed = forecast_item.get('windSpeed') wind_direction = forecast_item.get('windDirection') short_forecast = forecast_item.get('shortForecast') time = datetime.fromisoformat(start_time) time = time.strftime('%I:%M %p') print(f'{time:>8}: {temperature:>5.1f}°F | {wind_speed:>8} | {wind_direction:>5} | {short_forecast}')
def get_twelve_hour_forecast(self): ' ' print(('=' * self.__decorator_width)) print(f'National Weather Service 12 Hour Weather Forecast') print(f'{self.__address}') print(('=' * self.__decorator_width)) hourly_slice = self.forecast_hourly_list[:12] for forecast_item in hourly_slice: start_time = forecast_item.get('startTime') temperature = forecast_item.get('temperature') wind_speed = forecast_item.get('windSpeed') wind_direction = forecast_item.get('windDirection') short_forecast = forecast_item.get('shortForecast') time = datetime.fromisoformat(start_time) time = time.strftime('%I:%M %p') print(f'{time:>8}: {temperature:>5.1f}°F | {wind_speed:>8} | {wind_direction:>5} | {short_forecast}')<|docstring|>Get hourly forecast<|endoftext|>
dd9ff2423a67ae2b5a9126ae42b8dad2ac2f6ee9b062fdb22456302a9a3b4b5f
def get_weather(self): ' Get latest observation from the closest NWS station ' self.station_name = self.station_dict.get('features')[0].get('properties').get('name') weather_obs = self.weather_dict.get('properties') timestamp = weather_obs.get('timestamp') timestamp = datetime.fromisoformat(timestamp) self.__timestamp = timestamp.strftime('%m/%d/%Y, %I:%M %p') self.__description = weather_obs.get('textDescription') temperature = weather_obs.get('temperature').get('value') self.__temperature = weather_utils.celsius_to_fahrenheit(temperature) dewpoint = weather_obs.get('dewpoint').get('value') if (not (dewpoint is None)): self.__dewpoint = round(dewpoint, 1) else: self.__dewpoint = 'NA' humidity = weather_obs.get('relativeHumidity').get('value') if (not (humidity is None)): self.__humidity = round(humidity) else: self.__humidity = 'NA' wind_speed = weather_obs.get('windSpeed').get('value') if (not (wind_speed is None)): self.__wind__speed = round((wind_speed * 0.62137), 1) else: self.__wind__speed = 'NA' wind_direction = weather_obs.get('windDirection').get('value') if (not (wind_direction is None)): self.__degree = wind_direction self.__wind_cardinal = weather_utils.degrees_to_cardinal(wind_direction) else: self.__degree = 'NA' self.__wind_cardinal = 'NA' pressure = weather_obs.get('barometricPressure').get('value') if (not (pressure is None)): self.__pressure = round((pressure / 3386), 2) else: self.__pressure = 'NA' visibility = weather_obs.get('visibility').get('value') if (not (visibility is None)): self.__visibility = round(((visibility * 3.28084) / 5280)) else: self.__visibility = 'NA' windchill = weather_obs.get('windChill').get('value') if (not (windchill is None)): self.__windchill = weather_utils.celsius_to_fahrenheit(windchill) else: self.__windchill = 'NA' heatindex = weather_obs.get('visibility').get('value') if (not (pressure is None)): self.__heatindex = round((heatindex * 0.000621371)) else: self.__heatindex = 'NA' elevation = weather_obs.get('elevation').get('value') if (not (elevation is None)): self.__elevation = round((elevation * 3.28084)) else: self.__elevation = 'NA'
Get latest observation from the closest NWS station
nws_class.py
get_weather
itinstructor/NationalWeatherServicePythonConsoleApp
0
python
def get_weather(self): ' ' self.station_name = self.station_dict.get('features')[0].get('properties').get('name') weather_obs = self.weather_dict.get('properties') timestamp = weather_obs.get('timestamp') timestamp = datetime.fromisoformat(timestamp) self.__timestamp = timestamp.strftime('%m/%d/%Y, %I:%M %p') self.__description = weather_obs.get('textDescription') temperature = weather_obs.get('temperature').get('value') self.__temperature = weather_utils.celsius_to_fahrenheit(temperature) dewpoint = weather_obs.get('dewpoint').get('value') if (not (dewpoint is None)): self.__dewpoint = round(dewpoint, 1) else: self.__dewpoint = 'NA' humidity = weather_obs.get('relativeHumidity').get('value') if (not (humidity is None)): self.__humidity = round(humidity) else: self.__humidity = 'NA' wind_speed = weather_obs.get('windSpeed').get('value') if (not (wind_speed is None)): self.__wind__speed = round((wind_speed * 0.62137), 1) else: self.__wind__speed = 'NA' wind_direction = weather_obs.get('windDirection').get('value') if (not (wind_direction is None)): self.__degree = wind_direction self.__wind_cardinal = weather_utils.degrees_to_cardinal(wind_direction) else: self.__degree = 'NA' self.__wind_cardinal = 'NA' pressure = weather_obs.get('barometricPressure').get('value') if (not (pressure is None)): self.__pressure = round((pressure / 3386), 2) else: self.__pressure = 'NA' visibility = weather_obs.get('visibility').get('value') if (not (visibility is None)): self.__visibility = round(((visibility * 3.28084) / 5280)) else: self.__visibility = 'NA' windchill = weather_obs.get('windChill').get('value') if (not (windchill is None)): self.__windchill = weather_utils.celsius_to_fahrenheit(windchill) else: self.__windchill = 'NA' heatindex = weather_obs.get('visibility').get('value') if (not (pressure is None)): self.__heatindex = round((heatindex * 0.000621371)) else: self.__heatindex = 'NA' elevation = weather_obs.get('elevation').get('value') if (not (elevation is None)): self.__elevation = round((elevation * 3.28084)) else: self.__elevation = 'NA'
def get_weather(self): ' ' self.station_name = self.station_dict.get('features')[0].get('properties').get('name') weather_obs = self.weather_dict.get('properties') timestamp = weather_obs.get('timestamp') timestamp = datetime.fromisoformat(timestamp) self.__timestamp = timestamp.strftime('%m/%d/%Y, %I:%M %p') self.__description = weather_obs.get('textDescription') temperature = weather_obs.get('temperature').get('value') self.__temperature = weather_utils.celsius_to_fahrenheit(temperature) dewpoint = weather_obs.get('dewpoint').get('value') if (not (dewpoint is None)): self.__dewpoint = round(dewpoint, 1) else: self.__dewpoint = 'NA' humidity = weather_obs.get('relativeHumidity').get('value') if (not (humidity is None)): self.__humidity = round(humidity) else: self.__humidity = 'NA' wind_speed = weather_obs.get('windSpeed').get('value') if (not (wind_speed is None)): self.__wind__speed = round((wind_speed * 0.62137), 1) else: self.__wind__speed = 'NA' wind_direction = weather_obs.get('windDirection').get('value') if (not (wind_direction is None)): self.__degree = wind_direction self.__wind_cardinal = weather_utils.degrees_to_cardinal(wind_direction) else: self.__degree = 'NA' self.__wind_cardinal = 'NA' pressure = weather_obs.get('barometricPressure').get('value') if (not (pressure is None)): self.__pressure = round((pressure / 3386), 2) else: self.__pressure = 'NA' visibility = weather_obs.get('visibility').get('value') if (not (visibility is None)): self.__visibility = round(((visibility * 3.28084) / 5280)) else: self.__visibility = 'NA' windchill = weather_obs.get('windChill').get('value') if (not (windchill is None)): self.__windchill = weather_utils.celsius_to_fahrenheit(windchill) else: self.__windchill = 'NA' heatindex = weather_obs.get('visibility').get('value') if (not (pressure is None)): self.__heatindex = round((heatindex * 0.000621371)) else: self.__heatindex = 'NA' elevation = weather_obs.get('elevation').get('value') if (not (elevation is None)): self.__elevation = round((elevation * 3.28084)) else: self.__elevation = 'NA'<|docstring|>Get latest observation from the closest NWS station<|endoftext|>
17e5007cb828bcb36338cb0c77c35b59a21da6a50bdef9598c47e7bef13aa23a
def get_key(self, node): ' Generates a unique key for a node. ' return self._get_hash_value(node.obj)
Generates a unique key for a node.
Latest/venv/Lib/site-packages/apptools/naming/ui/naming_node_manager.py
get_key
adamcvj/SatelliteTracker
1
python
def get_key(self, node): ' ' return self._get_hash_value(node.obj)
def get_key(self, node): ' ' return self._get_hash_value(node.obj)<|docstring|>Generates a unique key for a node.<|endoftext|>
565a894d86fa3ed26aa5019a59919adb1e2ed82e19345df13a89af0650c63cf9
def _get_hash_value(self, obj): ' Returns a hash value for an object. ' try: hash_value = hash(obj) except: hash_value = id(obj) return hash_value
Returns a hash value for an object.
Latest/venv/Lib/site-packages/apptools/naming/ui/naming_node_manager.py
_get_hash_value
adamcvj/SatelliteTracker
1
python
def _get_hash_value(self, obj): ' ' try: hash_value = hash(obj) except: hash_value = id(obj) return hash_value
def _get_hash_value(self, obj): ' ' try: hash_value = hash(obj) except: hash_value = id(obj) return hash_value<|docstring|>Returns a hash value for an object.<|endoftext|>
973c596df0aa25d52baad9770a7e7ae0f1cc59b1948461582c088883161b468b
def __init__(self, embedding_dim, hidden_dim, vocab_size): '\n Initialize the model by settingg up the various layers.\n ' super(LSTMClassifier, self).__init__() self.embedding = nn.Embedding(vocab_size, embedding_dim, padding_idx=0) self.lstm = nn.LSTM(embedding_dim, hidden_dim) self.dense = nn.Linear(in_features=hidden_dim, out_features=1) self.sig = nn.Sigmoid() self.word_dict = None
Initialize the model by settingg up the various layers.
serve/models.py
__init__
hnguyen1174/sagemaker-movie-reviews
0
python
def __init__(self, embedding_dim, hidden_dim, vocab_size): '\n \n ' super(LSTMClassifier, self).__init__() self.embedding = nn.Embedding(vocab_size, embedding_dim, padding_idx=0) self.lstm = nn.LSTM(embedding_dim, hidden_dim) self.dense = nn.Linear(in_features=hidden_dim, out_features=1) self.sig = nn.Sigmoid() self.word_dict = None
def __init__(self, embedding_dim, hidden_dim, vocab_size): '\n \n ' super(LSTMClassifier, self).__init__() self.embedding = nn.Embedding(vocab_size, embedding_dim, padding_idx=0) self.lstm = nn.LSTM(embedding_dim, hidden_dim) self.dense = nn.Linear(in_features=hidden_dim, out_features=1) self.sig = nn.Sigmoid() self.word_dict = None<|docstring|>Initialize the model by settingg up the various layers.<|endoftext|>
babb14abf986830412b5dbe5eb160ff9a476acf390fd6279699942ecc1ee9815
def forward(self, x): '\n Perform a forward pass of our model on some input.\n ' x = x.t() lengths = x[(0, :)] reviews = x[(1:, :)] embeds = self.embedding(reviews) (lstm_out, _) = self.lstm(embeds) out = self.dense(lstm_out) out = out[((lengths - 1), range(len(lengths)))] return self.sig(out.squeeze())
Perform a forward pass of our model on some input.
serve/models.py
forward
hnguyen1174/sagemaker-movie-reviews
0
python
def forward(self, x): '\n \n ' x = x.t() lengths = x[(0, :)] reviews = x[(1:, :)] embeds = self.embedding(reviews) (lstm_out, _) = self.lstm(embeds) out = self.dense(lstm_out) out = out[((lengths - 1), range(len(lengths)))] return self.sig(out.squeeze())
def forward(self, x): '\n \n ' x = x.t() lengths = x[(0, :)] reviews = x[(1:, :)] embeds = self.embedding(reviews) (lstm_out, _) = self.lstm(embeds) out = self.dense(lstm_out) out = out[((lengths - 1), range(len(lengths)))] return self.sig(out.squeeze())<|docstring|>Perform a forward pass of our model on some input.<|endoftext|>
53ab4c79fa8a39efab645e22dccd7d9acfe50fec501479171683c82ef6265bc5
@property def posttime_datetime(self) -> datetime.datetime: '用于计算推文时间范围 datetime 类型' return self._posttime_datetime
用于计算推文时间范围 datetime 类型
savecode/threeyears/idownclient/clientdatafeedback/scoutdatafeedback/networkiddata/networkpost.py
posttime_datetime
Octoberr/swm0920
2
python
@property def posttime_datetime(self) -> datetime.datetime: return self._posttime_datetime
@property def posttime_datetime(self) -> datetime.datetime: return self._posttime_datetime<|docstring|>用于计算推文时间范围 datetime 类型<|endoftext|>
7edd098f38d416320f18c054efd21c5f03aaef3019daffe75628a97ee70e1551
@posttime_datetime.setter def posttime_datetime(self, value: datetime.datetime): '用于计算推文时间范围 datetime 类型' if (not isinstance(value, datetime.datetime)): raise Exception('Invalid datetime for posttime_datetime') self._posttime_datetime = value
用于计算推文时间范围 datetime 类型
savecode/threeyears/idownclient/clientdatafeedback/scoutdatafeedback/networkiddata/networkpost.py
posttime_datetime
Octoberr/swm0920
2
python
@posttime_datetime.setter def posttime_datetime(self, value: datetime.datetime): if (not isinstance(value, datetime.datetime)): raise Exception('Invalid datetime for posttime_datetime') self._posttime_datetime = value
@posttime_datetime.setter def posttime_datetime(self, value: datetime.datetime): if (not isinstance(value, datetime.datetime)): raise Exception('Invalid datetime for posttime_datetime') self._posttime_datetime = value<|docstring|>用于计算推文时间范围 datetime 类型<|endoftext|>
1318f93f5aea78ed1049235b90758a16a096348ef74d3c88ebdf0d92e18977e2
@property def postid(self) -> str: '开一个可以访问postid的接口' return self._postid
开一个可以访问postid的接口
savecode/threeyears/idownclient/clientdatafeedback/scoutdatafeedback/networkiddata/networkpost.py
postid
Octoberr/swm0920
2
python
@property def postid(self) -> str: return self._postid
@property def postid(self) -> str: return self._postid<|docstring|>开一个可以访问postid的接口<|endoftext|>
1026134f61f7559f54f5978febd20675fe6a757ae6885f1688249a1938ef2a82
@postid.setter def postid(self, value): '开一个可以访问postid的接口' if (value is None): raise Exception('Invalid postid') self._postid = value
开一个可以访问postid的接口
savecode/threeyears/idownclient/clientdatafeedback/scoutdatafeedback/networkiddata/networkpost.py
postid
Octoberr/swm0920
2
python
@postid.setter def postid(self, value): if (value is None): raise Exception('Invalid postid') self._postid = value
@postid.setter def postid(self, value): if (value is None): raise Exception('Invalid postid') self._postid = value<|docstring|>开一个可以访问postid的接口<|endoftext|>
cd862abc480180f253f408c47aaf918d48675921624818ea5972df9dc214ad63
def set_likes(self, profile: NetworkProfile): '设置点赞人' if (not isinstance(profile, NetworkProfile)): raise Exception('Invalid NetworkProfile') if self._likes.__contains__((profile._userid + profile._source)): return with self._likes_locker: if self._likes.__contains__((profile._userid + profile._source)): return self._likes[(profile._userid, profile._source)] = profile
设置点赞人
savecode/threeyears/idownclient/clientdatafeedback/scoutdatafeedback/networkiddata/networkpost.py
set_likes
Octoberr/swm0920
2
python
def set_likes(self, profile: NetworkProfile): if (not isinstance(profile, NetworkProfile)): raise Exception('Invalid NetworkProfile') if self._likes.__contains__((profile._userid + profile._source)): return with self._likes_locker: if self._likes.__contains__((profile._userid + profile._source)): return self._likes[(profile._userid, profile._source)] = profile
def set_likes(self, profile: NetworkProfile): if (not isinstance(profile, NetworkProfile)): raise Exception('Invalid NetworkProfile') if self._likes.__contains__((profile._userid + profile._source)): return with self._likes_locker: if self._likes.__contains__((profile._userid + profile._source)): return self._likes[(profile._userid, profile._source)] = profile<|docstring|>设置点赞人<|endoftext|>
9d83277ee8e21018a246fdc4432e700a47a3b0a81ce2c6ca1156e56aa176fff7
def set_resource(self, *rsc: NetworkResource): '设置关联资源数据' if ((rsc is None) or (len(rsc) < 1)): return with self._resources_locker: for r in rsc: if self._resources.__contains__((r._url + r._source)): continue self._resources[(r._url + r._source)] = r
设置关联资源数据
savecode/threeyears/idownclient/clientdatafeedback/scoutdatafeedback/networkiddata/networkpost.py
set_resource
Octoberr/swm0920
2
python
def set_resource(self, *rsc: NetworkResource): if ((rsc is None) or (len(rsc) < 1)): return with self._resources_locker: for r in rsc: if self._resources.__contains__((r._url + r._source)): continue self._resources[(r._url + r._source)] = r
def set_resource(self, *rsc: NetworkResource): if ((rsc is None) or (len(rsc) < 1)): return with self._resources_locker: for r in rsc: if self._resources.__contains__((r._url + r._source)): continue self._resources[(r._url + r._source)] = r<|docstring|>设置关联资源数据<|endoftext|>
7a30284cf070011cfd3995b3d7861c41e487f3b1ca7c9934f699d67322e28660
@classmethod def generate_from_tuple(cls, t): '\n Same as generate, but takes all parameters as one tuple\n ' cls.generate(*t)
Same as generate, but takes all parameters as one tuple
trdg/data_generator.py
generate_from_tuple
Kankroc/TextRecognitionDataGenerator
1
python
@classmethod def generate_from_tuple(cls, t): '\n \n ' cls.generate(*t)
@classmethod def generate_from_tuple(cls, t): '\n \n ' cls.generate(*t)<|docstring|>Same as generate, but takes all parameters as one tuple<|endoftext|>
fdb561a1603bab68f949022b2c24b235f5bdfba39e7091f7808f9ab9f336c524
def load_frozen_model(pb_path, prefix='', print_nodes=False): "Load frozen model (.pb file) for testing.\n After restoring the model, operators can be accessed by\n graph.get_tensor_by_name('<prefix>/<op_name>')\n Args:\n pb_path: the path of frozen model.\n prefix: prefix added to the operator name.\n print_nodes: whether to print node names.\n Returns:\n graph: tensorflow graph definition.\n " if os.path.exists(pb_path): with tf.io.gfile.GFile(pb_path, 'rb') as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) with tf.Graph().as_default() as graph: tf.import_graph_def(graph_def, name=prefix) if print_nodes: for op in graph.get_operations(): print(op.name) return graph else: print('Model file does not exist', pb_path) exit((- 1))
Load frozen model (.pb file) for testing. After restoring the model, operators can be accessed by graph.get_tensor_by_name('<prefix>/<op_name>') Args: pb_path: the path of frozen model. prefix: prefix added to the operator name. print_nodes: whether to print node names. Returns: graph: tensorflow graph definition.
pyslam/utils_tf.py
load_frozen_model
velvetThunder25/Feature-based-Monocular-Visual-Odometry
7
python
def load_frozen_model(pb_path, prefix=, print_nodes=False): "Load frozen model (.pb file) for testing.\n After restoring the model, operators can be accessed by\n graph.get_tensor_by_name('<prefix>/<op_name>')\n Args:\n pb_path: the path of frozen model.\n prefix: prefix added to the operator name.\n print_nodes: whether to print node names.\n Returns:\n graph: tensorflow graph definition.\n " if os.path.exists(pb_path): with tf.io.gfile.GFile(pb_path, 'rb') as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) with tf.Graph().as_default() as graph: tf.import_graph_def(graph_def, name=prefix) if print_nodes: for op in graph.get_operations(): print(op.name) return graph else: print('Model file does not exist', pb_path) exit((- 1))
def load_frozen_model(pb_path, prefix=, print_nodes=False): "Load frozen model (.pb file) for testing.\n After restoring the model, operators can be accessed by\n graph.get_tensor_by_name('<prefix>/<op_name>')\n Args:\n pb_path: the path of frozen model.\n prefix: prefix added to the operator name.\n print_nodes: whether to print node names.\n Returns:\n graph: tensorflow graph definition.\n " if os.path.exists(pb_path): with tf.io.gfile.GFile(pb_path, 'rb') as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) with tf.Graph().as_default() as graph: tf.import_graph_def(graph_def, name=prefix) if print_nodes: for op in graph.get_operations(): print(op.name) return graph else: print('Model file does not exist', pb_path) exit((- 1))<|docstring|>Load frozen model (.pb file) for testing. After restoring the model, operators can be accessed by graph.get_tensor_by_name('<prefix>/<op_name>') Args: pb_path: the path of frozen model. prefix: prefix added to the operator name. print_nodes: whether to print node names. Returns: graph: tensorflow graph definition.<|endoftext|>
5de20af22b7c6c2286965480b6c8e1035d97849d28b321482555d16de996ddc7
def recoverer(sess, model_path, meta_graph_path=None): '\n Recovery parameters from a pretrained model.\n Args:\n sess: The tensorflow session instance.\n model_path: Checkpoint file path.\n Returns:\n Nothing\n ' if (meta_graph_path is None): restore_var = tf.global_variables() restorer = tf.train.Saver(restore_var) else: restorer = tf.train.import_meta_graph(meta_graph_path) restorer.restore(sess, model_path)
Recovery parameters from a pretrained model. Args: sess: The tensorflow session instance. model_path: Checkpoint file path. Returns: Nothing
pyslam/utils_tf.py
recoverer
velvetThunder25/Feature-based-Monocular-Visual-Odometry
7
python
def recoverer(sess, model_path, meta_graph_path=None): '\n Recovery parameters from a pretrained model.\n Args:\n sess: The tensorflow session instance.\n model_path: Checkpoint file path.\n Returns:\n Nothing\n ' if (meta_graph_path is None): restore_var = tf.global_variables() restorer = tf.train.Saver(restore_var) else: restorer = tf.train.import_meta_graph(meta_graph_path) restorer.restore(sess, model_path)
def recoverer(sess, model_path, meta_graph_path=None): '\n Recovery parameters from a pretrained model.\n Args:\n sess: The tensorflow session instance.\n model_path: Checkpoint file path.\n Returns:\n Nothing\n ' if (meta_graph_path is None): restore_var = tf.global_variables() restorer = tf.train.Saver(restore_var) else: restorer = tf.train.import_meta_graph(meta_graph_path) restorer.restore(sess, model_path)<|docstring|>Recovery parameters from a pretrained model. Args: sess: The tensorflow session instance. model_path: Checkpoint file path. Returns: Nothing<|endoftext|>
19b439973cfc796263acae61c2bd890f8a4f7992faa4f6ef60f353c6c2f11a17
def parse_sku_id(sku_ids): "将商品id字符串解析为字典\n\n 商品id字符串采用英文逗号进行分割。\n 可以在每个id后面用冒号加上数字,代表该商品的数量,如果不加数量则默认为1。\n\n 例如:\n 输入 --> 解析结果\n '123456' --> {'123456': '1'}\n '123456,123789' --> {'123456': '1', '123789': '1'}\n '123456:1,123789:3' --> {'123456': '1', '123789': '3'}\n '123456:2,123789' --> {'123456': '2', '123789': '1'}\n\n :param sku_ids: 商品id字符串\n :return: dict\n " if isinstance(sku_ids, dict): return sku_ids sku_id_list = list(filter(bool, map((lambda x: x.strip()), sku_ids.split(',')))) result = dict() for item in sku_id_list: if (':' in item): (sku_id, count) = map((lambda x: x.strip()), item.split(':')) result[sku_id] = count else: result[item] = '1' return result
将商品id字符串解析为字典 商品id字符串采用英文逗号进行分割。 可以在每个id后面用冒号加上数字,代表该商品的数量,如果不加数量则默认为1。 例如: 输入 --> 解析结果 '123456' --> {'123456': '1'} '123456,123789' --> {'123456': '1', '123789': '1'} '123456:1,123789:3' --> {'123456': '1', '123789': '3'} '123456:2,123789' --> {'123456': '2', '123789': '1'} :param sku_ids: 商品id字符串 :return: dict
util.py
parse_sku_id
ansemz/jd-assistant
5,161
python
def parse_sku_id(sku_ids): "将商品id字符串解析为字典\n\n 商品id字符串采用英文逗号进行分割。\n 可以在每个id后面用冒号加上数字,代表该商品的数量,如果不加数量则默认为1。\n\n 例如:\n 输入 --> 解析结果\n '123456' --> {'123456': '1'}\n '123456,123789' --> {'123456': '1', '123789': '1'}\n '123456:1,123789:3' --> {'123456': '1', '123789': '3'}\n '123456:2,123789' --> {'123456': '2', '123789': '1'}\n\n :param sku_ids: 商品id字符串\n :return: dict\n " if isinstance(sku_ids, dict): return sku_ids sku_id_list = list(filter(bool, map((lambda x: x.strip()), sku_ids.split(',')))) result = dict() for item in sku_id_list: if (':' in item): (sku_id, count) = map((lambda x: x.strip()), item.split(':')) result[sku_id] = count else: result[item] = '1' return result
def parse_sku_id(sku_ids): "将商品id字符串解析为字典\n\n 商品id字符串采用英文逗号进行分割。\n 可以在每个id后面用冒号加上数字,代表该商品的数量,如果不加数量则默认为1。\n\n 例如:\n 输入 --> 解析结果\n '123456' --> {'123456': '1'}\n '123456,123789' --> {'123456': '1', '123789': '1'}\n '123456:1,123789:3' --> {'123456': '1', '123789': '3'}\n '123456:2,123789' --> {'123456': '2', '123789': '1'}\n\n :param sku_ids: 商品id字符串\n :return: dict\n " if isinstance(sku_ids, dict): return sku_ids sku_id_list = list(filter(bool, map((lambda x: x.strip()), sku_ids.split(',')))) result = dict() for item in sku_id_list: if (':' in item): (sku_id, count) = map((lambda x: x.strip()), item.split(':')) result[sku_id] = count else: result[item] = '1' return result<|docstring|>将商品id字符串解析为字典 商品id字符串采用英文逗号进行分割。 可以在每个id后面用冒号加上数字,代表该商品的数量,如果不加数量则默认为1。 例如: 输入 --> 解析结果 '123456' --> {'123456': '1'} '123456,123789' --> {'123456': '1', '123789': '1'} '123456:1,123789:3' --> {'123456': '1', '123789': '3'} '123456:2,123789' --> {'123456': '2', '123789': '1'} :param sku_ids: 商品id字符串 :return: dict<|endoftext|>
7e3c157c8311504c5dd013d514494fa5f8fa8c8853081b7355b5a0658eb71233
def parse_area_id(area): '解析地区id字符串:将分隔符替换为下划线 _\n :param area: 地区id字符串(使用 _ 或 - 进行分割),如 12_904_3375 或 12-904-3375\n :return: 解析后字符串\n ' area_id_list = list(map((lambda x: x.strip()), re.split('_|-', area))) area_id_list.extend(((4 - len(area_id_list)) * ['0'])) return '_'.join(area_id_list)
解析地区id字符串:将分隔符替换为下划线 _ :param area: 地区id字符串(使用 _ 或 - 进行分割),如 12_904_3375 或 12-904-3375 :return: 解析后字符串
util.py
parse_area_id
ansemz/jd-assistant
5,161
python
def parse_area_id(area): '解析地区id字符串:将分隔符替换为下划线 _\n :param area: 地区id字符串(使用 _ 或 - 进行分割),如 12_904_3375 或 12-904-3375\n :return: 解析后字符串\n ' area_id_list = list(map((lambda x: x.strip()), re.split('_|-', area))) area_id_list.extend(((4 - len(area_id_list)) * ['0'])) return '_'.join(area_id_list)
def parse_area_id(area): '解析地区id字符串:将分隔符替换为下划线 _\n :param area: 地区id字符串(使用 _ 或 - 进行分割),如 12_904_3375 或 12-904-3375\n :return: 解析后字符串\n ' area_id_list = list(map((lambda x: x.strip()), re.split('_|-', area))) area_id_list.extend(((4 - len(area_id_list)) * ['0'])) return '_'.join(area_id_list)<|docstring|>解析地区id字符串:将分隔符替换为下划线 _ :param area: 地区id字符串(使用 _ 或 - 进行分割),如 12_904_3375 或 12-904-3375 :return: 解析后字符串<|endoftext|>
035c7fba052adf0902d0fd7ba6b066692598199cef5f4496fd79a0ade31c3244
def split_area_id(area): "将地区id字符串按照下划线进行切割,构成数组。数组长度不满4位则用'0'进行填充。\n :param area: 地区id字符串(使用 _ 或 - 进行分割),如 12_904_3375 或 12-904-3375\n :return: list\n " area_id_list = list(map((lambda x: x.strip()), re.split('_|-', area))) area_id_list.extend(((4 - len(area_id_list)) * ['0'])) return area_id_list
将地区id字符串按照下划线进行切割,构成数组。数组长度不满4位则用'0'进行填充。 :param area: 地区id字符串(使用 _ 或 - 进行分割),如 12_904_3375 或 12-904-3375 :return: list
util.py
split_area_id
ansemz/jd-assistant
5,161
python
def split_area_id(area): "将地区id字符串按照下划线进行切割,构成数组。数组长度不满4位则用'0'进行填充。\n :param area: 地区id字符串(使用 _ 或 - 进行分割),如 12_904_3375 或 12-904-3375\n :return: list\n " area_id_list = list(map((lambda x: x.strip()), re.split('_|-', area))) area_id_list.extend(((4 - len(area_id_list)) * ['0'])) return area_id_list
def split_area_id(area): "将地区id字符串按照下划线进行切割,构成数组。数组长度不满4位则用'0'进行填充。\n :param area: 地区id字符串(使用 _ 或 - 进行分割),如 12_904_3375 或 12-904-3375\n :return: list\n " area_id_list = list(map((lambda x: x.strip()), re.split('_|-', area))) area_id_list.extend(((4 - len(area_id_list)) * ['0'])) return area_id_list<|docstring|>将地区id字符串按照下划线进行切割,构成数组。数组长度不满4位则用'0'进行填充。 :param area: 地区id字符串(使用 _ 或 - 进行分割),如 12_904_3375 或 12-904-3375 :return: list<|endoftext|>
b72a79d2156fcea53178aeb797f7c7decf865edf5e863262aa74a6ab0e8d7112
def deprecated(func): 'This decorator is used to mark functions as deprecated.\n It will result in a warning being emitted when the function is used.\n ' @functools.wraps(func) def new_func(*args, **kwargs): warnings.simplefilter('always', DeprecationWarning) warnings.warn('Call to deprecated function {}.'.format(func.__name__), category=DeprecationWarning, stacklevel=2) warnings.simplefilter('default', DeprecationWarning) return func(*args, **kwargs) return new_func
This decorator is used to mark functions as deprecated. It will result in a warning being emitted when the function is used.
util.py
deprecated
ansemz/jd-assistant
5,161
python
def deprecated(func): 'This decorator is used to mark functions as deprecated.\n It will result in a warning being emitted when the function is used.\n ' @functools.wraps(func) def new_func(*args, **kwargs): warnings.simplefilter('always', DeprecationWarning) warnings.warn('Call to deprecated function {}.'.format(func.__name__), category=DeprecationWarning, stacklevel=2) warnings.simplefilter('default', DeprecationWarning) return func(*args, **kwargs) return new_func
def deprecated(func): 'This decorator is used to mark functions as deprecated.\n It will result in a warning being emitted when the function is used.\n ' @functools.wraps(func) def new_func(*args, **kwargs): warnings.simplefilter('always', DeprecationWarning) warnings.warn('Call to deprecated function {}.'.format(func.__name__), category=DeprecationWarning, stacklevel=2) warnings.simplefilter('default', DeprecationWarning) return func(*args, **kwargs) return new_func<|docstring|>This decorator is used to mark functions as deprecated. It will result in a warning being emitted when the function is used.<|endoftext|>
c387ba6a80cc2e556a3bef8240b350488f1b28f5f1da657d9719fa2b0e867f16
def check_login(func): '用户登陆态校验装饰器。若用户未登陆,则调用扫码登陆' @functools.wraps(func) def new_func(self, *args, **kwargs): if (not self.is_login): logger.info('{0} 需登陆后调用,开始扫码登陆'.format(func.__name__)) self.login_by_QRcode() return func(self, *args, **kwargs) return new_func
用户登陆态校验装饰器。若用户未登陆,则调用扫码登陆
util.py
check_login
ansemz/jd-assistant
5,161
python
def check_login(func): @functools.wraps(func) def new_func(self, *args, **kwargs): if (not self.is_login): logger.info('{0} 需登陆后调用,开始扫码登陆'.format(func.__name__)) self.login_by_QRcode() return func(self, *args, **kwargs) return new_func
def check_login(func): @functools.wraps(func) def new_func(self, *args, **kwargs): if (not self.is_login): logger.info('{0} 需登陆后调用,开始扫码登陆'.format(func.__name__)) self.login_by_QRcode() return func(self, *args, **kwargs) return new_func<|docstring|>用户登陆态校验装饰器。若用户未登陆,则调用扫码登陆<|endoftext|>
acf1beabcc4a266e5c4d2010f1c5a79f5788f0f0ca1df94152e33229d4aee3f6
def get_random_useragent(): '生成随机的UserAgent\n :return: UserAgent字符串\n ' return random.choice(USER_AGENTS)
生成随机的UserAgent :return: UserAgent字符串
util.py
get_random_useragent
ansemz/jd-assistant
5,161
python
def get_random_useragent(): '生成随机的UserAgent\n :return: UserAgent字符串\n ' return random.choice(USER_AGENTS)
def get_random_useragent(): '生成随机的UserAgent\n :return: UserAgent字符串\n ' return random.choice(USER_AGENTS)<|docstring|>生成随机的UserAgent :return: UserAgent字符串<|endoftext|>
d7e54a74b9728583b605cd6dd38516894085f4f011cdb9d1c01f77ce51a1189d
def on_quit(self): 'ask for confirmation if application should be closed and delete advanced.log file on_quit click' log_message('Fehlerspeicher wird gelöscht\n - Fortfahren ? -', 'warning') if self.parent.controller.get_unsaved_handlers(): answer = AskDialog(self.parent, self.parent.controller, 'Änderungen noch nicht gespeichert!\nTrotzdem beenden?').show() if (not answer): return else: answer = AskDialog(self.parent, self.parent.controller, 'Möchten Sie wirklich beenden?').show() if (not answer): return log_message('close logging', 'delete') advanced_log_path = resource_path('Core\\advanced.log') os.remove(advanced_log_path) self.parent.destroy()
ask for confirmation if application should be closed and delete advanced.log file on_quit click
Core/View/menu.py
on_quit
UpBeatMan/Abschlussarbeit
0
python
def on_quit(self): log_message('Fehlerspeicher wird gelöscht\n - Fortfahren ? -', 'warning') if self.parent.controller.get_unsaved_handlers(): answer = AskDialog(self.parent, self.parent.controller, 'Änderungen noch nicht gespeichert!\nTrotzdem beenden?').show() if (not answer): return else: answer = AskDialog(self.parent, self.parent.controller, 'Möchten Sie wirklich beenden?').show() if (not answer): return log_message('close logging', 'delete') advanced_log_path = resource_path('Core\\advanced.log') os.remove(advanced_log_path) self.parent.destroy()
def on_quit(self): log_message('Fehlerspeicher wird gelöscht\n - Fortfahren ? -', 'warning') if self.parent.controller.get_unsaved_handlers(): answer = AskDialog(self.parent, self.parent.controller, 'Änderungen noch nicht gespeichert!\nTrotzdem beenden?').show() if (not answer): return else: answer = AskDialog(self.parent, self.parent.controller, 'Möchten Sie wirklich beenden?').show() if (not answer): return log_message('close logging', 'delete') advanced_log_path = resource_path('Core\\advanced.log') os.remove(advanced_log_path) self.parent.destroy()<|docstring|>ask for confirmation if application should be closed and delete advanced.log file on_quit click<|endoftext|>
80c5cf51f3856ffe7445ef210da5e0aa7bae08e398cec7c1c14a28560fbc23a2
def assert_is_utc_datetime(date_in): 'Assert that date_in is an UTC datetime.' ras(isinstance(date_in, datetime.datetime)) if (not ((date_in.tzinfo == pytz.utc) or (date_in.tzinfo == datetime.timezone.utc))): raise Exception('not utc!') if (date_in.tzinfo == pytz.utc): print('prefer using datetime.timezone.utc to pytz.utc')
Assert that date_in is an UTC datetime.
kartverket_stormsurge/helper/datetimes.py
assert_is_utc_datetime
jerabaul29/kartverket_storm_surge_data
0
python
def assert_is_utc_datetime(date_in): ras(isinstance(date_in, datetime.datetime)) if (not ((date_in.tzinfo == pytz.utc) or (date_in.tzinfo == datetime.timezone.utc))): raise Exception('not utc!') if (date_in.tzinfo == pytz.utc): print('prefer using datetime.timezone.utc to pytz.utc')
def assert_is_utc_datetime(date_in): ras(isinstance(date_in, datetime.datetime)) if (not ((date_in.tzinfo == pytz.utc) or (date_in.tzinfo == datetime.timezone.utc))): raise Exception('not utc!') if (date_in.tzinfo == pytz.utc): print('prefer using datetime.timezone.utc to pytz.utc')<|docstring|>Assert that date_in is an UTC datetime.<|endoftext|>
b280e1068c24ebfc3a9a2e4b232eacdc089a07745b9db495691f6415100d5ee0
def assert_10min_multiple(date_in): 'Assert that date_in is a datetime that is a\n multiple of 10 minutes.\n ' ras(isinstance(date_in, datetime.datetime)) ras((date_in.second == 0)) ras(((date_in.minute % 10) == 0)) ras((date_in.microsecond == 0))
Assert that date_in is a datetime that is a multiple of 10 minutes.
kartverket_stormsurge/helper/datetimes.py
assert_10min_multiple
jerabaul29/kartverket_storm_surge_data
0
python
def assert_10min_multiple(date_in): 'Assert that date_in is a datetime that is a\n multiple of 10 minutes.\n ' ras(isinstance(date_in, datetime.datetime)) ras((date_in.second == 0)) ras(((date_in.minute % 10) == 0)) ras((date_in.microsecond == 0))
def assert_10min_multiple(date_in): 'Assert that date_in is a datetime that is a\n multiple of 10 minutes.\n ' ras(isinstance(date_in, datetime.datetime)) ras((date_in.second == 0)) ras(((date_in.minute % 10) == 0)) ras((date_in.microsecond == 0))<|docstring|>Assert that date_in is a datetime that is a multiple of 10 minutes.<|endoftext|>
44bad6281e1ce1bfdc232c433703cd2a7b833a470fd4cdbb4c6bbbaac887f9d3
def datetime_range(datetime_start, datetime_end, step_timedelta): 'Yield a datetime range, in the range [datetime_start; datetime_end[,\n with step step_timedelta.' assert_is_utc_datetime(datetime_start) assert_is_utc_datetime(datetime_end) ras(isinstance(step_timedelta, datetime.timedelta)) ras((datetime_start < datetime_end)) ras((step_timedelta > datetime.timedelta(0))) crrt_time = datetime_start (yield crrt_time) while True: crrt_time += step_timedelta if (crrt_time < datetime_end): (yield crrt_time) else: break
Yield a datetime range, in the range [datetime_start; datetime_end[, with step step_timedelta.
kartverket_stormsurge/helper/datetimes.py
datetime_range
jerabaul29/kartverket_storm_surge_data
0
python
def datetime_range(datetime_start, datetime_end, step_timedelta): 'Yield a datetime range, in the range [datetime_start; datetime_end[,\n with step step_timedelta.' assert_is_utc_datetime(datetime_start) assert_is_utc_datetime(datetime_end) ras(isinstance(step_timedelta, datetime.timedelta)) ras((datetime_start < datetime_end)) ras((step_timedelta > datetime.timedelta(0))) crrt_time = datetime_start (yield crrt_time) while True: crrt_time += step_timedelta if (crrt_time < datetime_end): (yield crrt_time) else: break
def datetime_range(datetime_start, datetime_end, step_timedelta): 'Yield a datetime range, in the range [datetime_start; datetime_end[,\n with step step_timedelta.' assert_is_utc_datetime(datetime_start) assert_is_utc_datetime(datetime_end) ras(isinstance(step_timedelta, datetime.timedelta)) ras((datetime_start < datetime_end)) ras((step_timedelta > datetime.timedelta(0))) crrt_time = datetime_start (yield crrt_time) while True: crrt_time += step_timedelta if (crrt_time < datetime_end): (yield crrt_time) else: break<|docstring|>Yield a datetime range, in the range [datetime_start; datetime_end[, with step step_timedelta.<|endoftext|>
eaa16159d45a2cb5b68915692fa114ae9700939c7ba15c49cb05488a9f0cba50
def datetime_segments(datetime_start, datetime_end, step_timedelta): 'Generate a succession of segments, that cover [datetime_start; datetime_end].\n The segments will have length step_timedelta, except possibly the last segment\n that may be shorter.' assert_is_utc_datetime(datetime_start) assert_is_utc_datetime(datetime_end) ras(isinstance(step_timedelta, datetime.timedelta)) ras((datetime_start < datetime_end)) ras((step_timedelta > datetime.timedelta(0))) crrt_segment_start = datetime_start crrt_segment_end = (crrt_segment_start + step_timedelta) while True: if (crrt_segment_end >= datetime_end): (yield (crrt_segment_start, datetime_end)) break else: (yield (crrt_segment_start, crrt_segment_end)) crrt_segment_start += step_timedelta crrt_segment_end += step_timedelta
Generate a succession of segments, that cover [datetime_start; datetime_end]. The segments will have length step_timedelta, except possibly the last segment that may be shorter.
kartverket_stormsurge/helper/datetimes.py
datetime_segments
jerabaul29/kartverket_storm_surge_data
0
python
def datetime_segments(datetime_start, datetime_end, step_timedelta): 'Generate a succession of segments, that cover [datetime_start; datetime_end].\n The segments will have length step_timedelta, except possibly the last segment\n that may be shorter.' assert_is_utc_datetime(datetime_start) assert_is_utc_datetime(datetime_end) ras(isinstance(step_timedelta, datetime.timedelta)) ras((datetime_start < datetime_end)) ras((step_timedelta > datetime.timedelta(0))) crrt_segment_start = datetime_start crrt_segment_end = (crrt_segment_start + step_timedelta) while True: if (crrt_segment_end >= datetime_end): (yield (crrt_segment_start, datetime_end)) break else: (yield (crrt_segment_start, crrt_segment_end)) crrt_segment_start += step_timedelta crrt_segment_end += step_timedelta
def datetime_segments(datetime_start, datetime_end, step_timedelta): 'Generate a succession of segments, that cover [datetime_start; datetime_end].\n The segments will have length step_timedelta, except possibly the last segment\n that may be shorter.' assert_is_utc_datetime(datetime_start) assert_is_utc_datetime(datetime_end) ras(isinstance(step_timedelta, datetime.timedelta)) ras((datetime_start < datetime_end)) ras((step_timedelta > datetime.timedelta(0))) crrt_segment_start = datetime_start crrt_segment_end = (crrt_segment_start + step_timedelta) while True: if (crrt_segment_end >= datetime_end): (yield (crrt_segment_start, datetime_end)) break else: (yield (crrt_segment_start, crrt_segment_end)) crrt_segment_start += step_timedelta crrt_segment_end += step_timedelta<|docstring|>Generate a succession of segments, that cover [datetime_start; datetime_end]. The segments will have length step_timedelta, except possibly the last segment that may be shorter.<|endoftext|>
e8b4b18423e5d8b31446a733696b7b2c16eab6970b328273c3bae89621e41c82
def test_diff(self): 'Test that expr.diff returns an object of type devito.Derivative.' u = Function(name='u', grid=self.grid) du = u.diff(x(self.grid)) assert isinstance(du, Derivative)
Test that expr.diff returns an object of type devito.Derivative.
tests/test_derivatives.py
test_diff
felipeaugustogudes/devito
204
python
def test_diff(self): u = Function(name='u', grid=self.grid) du = u.diff(x(self.grid)) assert isinstance(du, Derivative)
def test_diff(self): u = Function(name='u', grid=self.grid) du = u.diff(x(self.grid)) assert isinstance(du, Derivative)<|docstring|>Test that expr.diff returns an object of type devito.Derivative.<|endoftext|>