text:
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: route53resolver
using AWS.Compat
using AWS.UUIDs

"""
    associate_resolver_endpoint_ip_address(ip_address, resolver_endpoint_id)
    associate_resolver_endpoint_ip_address(ip_address, resolver_endpoint_id, params::Dict{String,<:Any})

Adds IP addresses to an inbound or an outbound Resolver endpoint. If you want to add more
than one IP address, submit one AssociateResolverEndpointIpAddress request for each IP
address. To remove an IP address from an endpoint, see
DisassociateResolverEndpointIpAddress.

# Arguments
- `ip_address`: Either the IPv4 address that you want to add to a Resolver endpoint or a
  subnet ID. If you specify a subnet ID, Resolver chooses an IP address for you from the
  available IPs in the specified subnet.
- `resolver_endpoint_id`: The ID of the Resolver endpoint that you want to associate IP
  addresses with.

"""
associate_resolver_endpoint_ip_address(IpAddress, ResolverEndpointId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("AssociateResolverEndpointIpAddress", Dict{String, Any}("IpAddress"=>IpAddress, "ResolverEndpointId"=>ResolverEndpointId); aws_config=aws_config)
associate_resolver_endpoint_ip_address(IpAddress, ResolverEndpointId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("AssociateResolverEndpointIpAddress", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("IpAddress"=>IpAddress, "ResolverEndpointId"=>ResolverEndpointId), params)); aws_config=aws_config)

"""
    associate_resolver_query_log_config(resolver_query_log_config_id, resource_id)
    associate_resolver_query_log_config(resolver_query_log_config_id, resource_id, params::Dict{String,<:Any})

Associates an Amazon VPC with a specified query logging configuration. Route 53 Resolver
logs DNS queries that originate in all of the Amazon VPCs that are associated with a
specified query logging configuration. To associate more than one VPC with a configuration,
submit one AssociateResolverQueryLogConfig request for each VPC.  The VPCs that you
associate with a query logging configuration must be in the same Region as the
configuration.  To remove a VPC from a query logging configuration, see
DisassociateResolverQueryLogConfig.

# Arguments
- `resolver_query_log_config_id`: The ID of the query logging configuration that you want
  to associate a VPC with.
- `resource_id`: The ID of an Amazon VPC that you want this query logging configuration to
  log queries for.  The VPCs and the query logging configuration must be in the same Region.

"""
associate_resolver_query_log_config(ResolverQueryLogConfigId, ResourceId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("AssociateResolverQueryLogConfig", Dict{String, Any}("ResolverQueryLogConfigId"=>ResolverQueryLogConfigId, "ResourceId"=>ResourceId); aws_config=aws_config)
associate_resolver_query_log_config(ResolverQueryLogConfigId, ResourceId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("AssociateResolverQueryLogConfig", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverQueryLogConfigId"=>ResolverQueryLogConfigId, "ResourceId"=>ResourceId), params)); aws_config=aws_config)

"""
    associate_resolver_rule(resolver_rule_id, vpcid)
    associate_resolver_rule(resolver_rule_id, vpcid, params::Dict{String,<:Any})

Associates a Resolver rule with a VPC. When you associate a rule with a VPC, Resolver
forwards all DNS queries for the domain name that is specified in the rule and that
originate in the VPC. The queries are forwarded to the IP addresses for the DNS resolvers
that are specified in the rule. For more information about rules, see CreateResolverRule.

# Arguments
- `resolver_rule_id`: The ID of the Resolver rule that you want to associate with the VPC.
  To list the existing Resolver rules, use ListResolverRules.
- `vpcid`: The ID of the VPC that you want to associate the Resolver rule with.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Name"`: A name for the association that you're creating between a Resolver rule and a
  VPC.
"""
associate_resolver_rule(ResolverRuleId, VPCId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("AssociateResolverRule", Dict{String, Any}("ResolverRuleId"=>ResolverRuleId, "VPCId"=>VPCId); aws_config=aws_config)
associate_resolver_rule(ResolverRuleId, VPCId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("AssociateResolverRule", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverRuleId"=>ResolverRuleId, "VPCId"=>VPCId), params)); aws_config=aws_config)

"""
    create_resolver_endpoint(creator_request_id, direction, ip_addresses, security_group_ids)
    create_resolver_endpoint(creator_request_id, direction, ip_addresses, security_group_ids, params::Dict{String,<:Any})

Creates a Resolver endpoint. There are two types of Resolver endpoints, inbound and
outbound:   An inbound Resolver endpoint forwards DNS queries to the DNS service for a VPC
from your network.   An outbound Resolver endpoint forwards DNS queries from the DNS
service for a VPC to your network.

# Arguments
- `creator_request_id`: A unique string that identifies the request and that allows failed
  requests to be retried without the risk of executing the operation twice. CreatorRequestId
  can be any unique string, for example, a date/time stamp.
- `direction`: Specify the applicable value:    INBOUND: Resolver forwards DNS queries to
  the DNS service for a VPC from your network    OUTBOUND: Resolver forwards DNS queries from
  the DNS service for a VPC to your network
- `ip_addresses`: The subnets and IP addresses in your VPC that DNS queries originate from
  (for outbound endpoints) or that you forward DNS queries to (for inbound endpoints). The
  subnet ID uniquely identifies a VPC.
- `security_group_ids`: The ID of one or more security groups that you want to use to
  control access to this VPC. The security group that you specify must include one or more
  inbound rules (for inbound Resolver endpoints) or outbound rules (for outbound Resolver
  endpoints). Inbound and outbound rules must allow TCP and UDP access. For inbound access,
  open port 53. For outbound access, open the port that you're using for DNS queries on your
  network.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Name"`: A friendly name that lets you easily find a configuration in the Resolver
  dashboard in the Route 53 console.
- `"Tags"`: A list of the tag keys and values that you want to associate with the endpoint.
"""
create_resolver_endpoint(CreatorRequestId, Direction, IpAddresses, SecurityGroupIds; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("CreateResolverEndpoint", Dict{String, Any}("CreatorRequestId"=>CreatorRequestId, "Direction"=>Direction, "IpAddresses"=>IpAddresses, "SecurityGroupIds"=>SecurityGroupIds); aws_config=aws_config)
create_resolver_endpoint(CreatorRequestId, Direction, IpAddresses, SecurityGroupIds, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("CreateResolverEndpoint", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("CreatorRequestId"=>CreatorRequestId, "Direction"=>Direction, "IpAddresses"=>IpAddresses, "SecurityGroupIds"=>SecurityGroupIds), params)); aws_config=aws_config)

"""
    create_resolver_query_log_config(creator_request_id, destination_arn, name)
    create_resolver_query_log_config(creator_request_id, destination_arn, name, params::Dict{String,<:Any})

Creates a Resolver query logging configuration, which defines where you want Resolver to
save DNS query logs that originate in your VPCs. Resolver can log queries only for VPCs
that are in the same Region as the query logging configuration. To specify which VPCs you
want to log queries for, you use AssociateResolverQueryLogConfig. For more information, see
AssociateResolverQueryLogConfig.  You can optionally use AWS Resource Access Manager (AWS
RAM) to share a query logging configuration with other AWS accounts. The other accounts can
then associate VPCs with the configuration. The query logs that Resolver creates for a
configuration include all DNS queries that originate in all VPCs that are associated with
the configuration.

# Arguments
- `creator_request_id`: A unique string that identifies the request and that allows failed
  requests to be retried without the risk of executing the operation twice. CreatorRequestId
  can be any unique string, for example, a date/time stamp.
- `destination_arn`: The ARN of the resource that you want Resolver to send query logs. You
  can send query logs to an S3 bucket, a CloudWatch Logs log group, or a Kinesis Data
  Firehose delivery stream. Examples of valid values include the following:    S3 bucket:
  arn:aws:s3:::examplebucket  You can optionally append a file prefix to the end of the ARN.
  arn:aws:s3:::examplebucket/development/     CloudWatch Logs log group:
  arn:aws:logs:us-west-1:123456789012:log-group:/mystack-testgroup-12ABC1AB12A1:*     Kinesis
  Data Firehose delivery stream:  arn:aws:kinesis:us-east-2:0123456789:stream/my_stream_name

- `name`: The name that you want to give the query logging configuration

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Tags"`: A list of the tag keys and values that you want to associate with the query
  logging configuration.
"""
create_resolver_query_log_config(CreatorRequestId, DestinationArn, Name; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("CreateResolverQueryLogConfig", Dict{String, Any}("CreatorRequestId"=>CreatorRequestId, "DestinationArn"=>DestinationArn, "Name"=>Name); aws_config=aws_config)
create_resolver_query_log_config(CreatorRequestId, DestinationArn, Name, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("CreateResolverQueryLogConfig", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("CreatorRequestId"=>CreatorRequestId, "DestinationArn"=>DestinationArn, "Name"=>Name), params)); aws_config=aws_config)

"""
    create_resolver_rule(creator_request_id, domain_name, rule_type)
    create_resolver_rule(creator_request_id, domain_name, rule_type, params::Dict{String,<:Any})

For DNS queries that originate in your VPCs, specifies which Resolver endpoint the queries
pass through, one domain name that you want to forward to your network, and the IP
addresses of the DNS resolvers in your network.

# Arguments
- `creator_request_id`: A unique string that identifies the request and that allows failed
  requests to be retried without the risk of executing the operation twice. CreatorRequestId
  can be any unique string, for example, a date/time stamp.
- `domain_name`: DNS queries for this domain name are forwarded to the IP addresses that
  you specify in TargetIps. If a query matches multiple Resolver rules (example.com and
  www.example.com), outbound DNS queries are routed using the Resolver rule that contains the
  most specific domain name (www.example.com).
- `rule_type`: When you want to forward DNS queries for specified domain name to resolvers
  on your network, specify FORWARD. When you have a forwarding rule to forward DNS queries
  for a domain to your network and you want Resolver to process queries for a subdomain of
  that domain, specify SYSTEM. For example, to forward DNS queries for example.com to
  resolvers on your network, you create a rule and specify FORWARD for RuleType. To then have
  Resolver process queries for apex.example.com, you create a rule and specify SYSTEM for
  RuleType. Currently, only Resolver can create rules that have a value of RECURSIVE for
  RuleType.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Name"`: A friendly name that lets you easily find a rule in the Resolver dashboard in
  the Route 53 console.
- `"ResolverEndpointId"`: The ID of the outbound Resolver endpoint that you want to use to
  route DNS queries to the IP addresses that you specify in TargetIps.
- `"Tags"`: A list of the tag keys and values that you want to associate with the endpoint.
- `"TargetIps"`: The IPs that you want Resolver to forward DNS queries to. You can specify
  only IPv4 addresses. Separate IP addresses with a comma.  TargetIps is available only when
  the value of Rule type is FORWARD.
"""
create_resolver_rule(CreatorRequestId, DomainName, RuleType; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("CreateResolverRule", Dict{String, Any}("CreatorRequestId"=>CreatorRequestId, "DomainName"=>DomainName, "RuleType"=>RuleType); aws_config=aws_config)
create_resolver_rule(CreatorRequestId, DomainName, RuleType, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("CreateResolverRule", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("CreatorRequestId"=>CreatorRequestId, "DomainName"=>DomainName, "RuleType"=>RuleType), params)); aws_config=aws_config)

"""
    delete_resolver_endpoint(resolver_endpoint_id)
    delete_resolver_endpoint(resolver_endpoint_id, params::Dict{String,<:Any})

Deletes a Resolver endpoint. The effect of deleting a Resolver endpoint depends on whether
it's an inbound or an outbound Resolver endpoint:    Inbound: DNS queries from your network
are no longer routed to the DNS service for the specified VPC.    Outbound: DNS queries
from a VPC are no longer routed to your network.

# Arguments
- `resolver_endpoint_id`: The ID of the Resolver endpoint that you want to delete.

"""
delete_resolver_endpoint(ResolverEndpointId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("DeleteResolverEndpoint", Dict{String, Any}("ResolverEndpointId"=>ResolverEndpointId); aws_config=aws_config)
delete_resolver_endpoint(ResolverEndpointId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("DeleteResolverEndpoint", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverEndpointId"=>ResolverEndpointId), params)); aws_config=aws_config)

"""
    delete_resolver_query_log_config(resolver_query_log_config_id)
    delete_resolver_query_log_config(resolver_query_log_config_id, params::Dict{String,<:Any})

Deletes a query logging configuration. When you delete a configuration, Resolver stops
logging DNS queries for all of the Amazon VPCs that are associated with the configuration.
This also applies if the query logging configuration is shared with other AWS accounts, and
the other accounts have associated VPCs with the shared configuration. Before you can
delete a query logging configuration, you must first disassociate all VPCs from the
configuration. See DisassociateResolverQueryLogConfig. If you used Resource Access Manager
(RAM) to share a query logging configuration with other accounts, you must stop sharing the
configuration before you can delete a configuration. The accounts that you shared the
configuration with can first disassociate VPCs that they associated with the configuration,
but that's not necessary. If you stop sharing the configuration, those VPCs are
automatically disassociated from the configuration.

# Arguments
- `resolver_query_log_config_id`: The ID of the query logging configuration that you want
  to delete.

"""
delete_resolver_query_log_config(ResolverQueryLogConfigId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("DeleteResolverQueryLogConfig", Dict{String, Any}("ResolverQueryLogConfigId"=>ResolverQueryLogConfigId); aws_config=aws_config)
delete_resolver_query_log_config(ResolverQueryLogConfigId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("DeleteResolverQueryLogConfig", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverQueryLogConfigId"=>ResolverQueryLogConfigId), params)); aws_config=aws_config)

"""
    delete_resolver_rule(resolver_rule_id)
    delete_resolver_rule(resolver_rule_id, params::Dict{String,<:Any})

Deletes a Resolver rule. Before you can delete a Resolver rule, you must disassociate it
from all the VPCs that you associated the Resolver rule with. For more information, see
DisassociateResolverRule.

# Arguments
- `resolver_rule_id`: The ID of the Resolver rule that you want to delete.

"""
delete_resolver_rule(ResolverRuleId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("DeleteResolverRule", Dict{String, Any}("ResolverRuleId"=>ResolverRuleId); aws_config=aws_config)
delete_resolver_rule(ResolverRuleId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("DeleteResolverRule", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverRuleId"=>ResolverRuleId), params)); aws_config=aws_config)

"""
    disassociate_resolver_endpoint_ip_address(ip_address, resolver_endpoint_id)
    disassociate_resolver_endpoint_ip_address(ip_address, resolver_endpoint_id, params::Dict{String,<:Any})

Removes IP addresses from an inbound or an outbound Resolver endpoint. If you want to
remove more than one IP address, submit one DisassociateResolverEndpointIpAddress request
for each IP address. To add an IP address to an endpoint, see
AssociateResolverEndpointIpAddress.

# Arguments
- `ip_address`: The IPv4 address that you want to remove from a Resolver endpoint.
- `resolver_endpoint_id`: The ID of the Resolver endpoint that you want to disassociate an
  IP address from.

"""
disassociate_resolver_endpoint_ip_address(IpAddress, ResolverEndpointId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("DisassociateResolverEndpointIpAddress", Dict{String, Any}("IpAddress"=>IpAddress, "ResolverEndpointId"=>ResolverEndpointId); aws_config=aws_config)
disassociate_resolver_endpoint_ip_address(IpAddress, ResolverEndpointId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("DisassociateResolverEndpointIpAddress", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("IpAddress"=>IpAddress, "ResolverEndpointId"=>ResolverEndpointId), params)); aws_config=aws_config)

"""
    disassociate_resolver_query_log_config(resolver_query_log_config_id, resource_id)
    disassociate_resolver_query_log_config(resolver_query_log_config_id, resource_id, params::Dict{String,<:Any})

Disassociates a VPC from a query logging configuration.  Before you can delete a query
logging configuration, you must first disassociate all VPCs from the configuration. If you
used Resource Access Manager (RAM) to share a query logging configuration with other
accounts, VPCs can be disassociated from the configuration in the following ways:   The
accounts that you shared the configuration with can disassociate VPCs from the
configuration.   You can stop sharing the configuration.

# Arguments
- `resolver_query_log_config_id`: The ID of the query logging configuration that you want
  to disassociate a specified VPC from.
- `resource_id`: The ID of the Amazon VPC that you want to disassociate from a specified
  query logging configuration.

"""
disassociate_resolver_query_log_config(ResolverQueryLogConfigId, ResourceId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("DisassociateResolverQueryLogConfig", Dict{String, Any}("ResolverQueryLogConfigId"=>ResolverQueryLogConfigId, "ResourceId"=>ResourceId); aws_config=aws_config)
disassociate_resolver_query_log_config(ResolverQueryLogConfigId, ResourceId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("DisassociateResolverQueryLogConfig", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverQueryLogConfigId"=>ResolverQueryLogConfigId, "ResourceId"=>ResourceId), params)); aws_config=aws_config)

"""
    disassociate_resolver_rule(resolver_rule_id, vpcid)
    disassociate_resolver_rule(resolver_rule_id, vpcid, params::Dict{String,<:Any})

Removes the association between a specified Resolver rule and a specified VPC.  If you
disassociate a Resolver rule from a VPC, Resolver stops forwarding DNS queries for the
domain name that you specified in the Resolver rule.

# Arguments
- `resolver_rule_id`: The ID of the Resolver rule that you want to disassociate from the
  specified VPC.
- `vpcid`: The ID of the VPC that you want to disassociate the Resolver rule from.

"""
disassociate_resolver_rule(ResolverRuleId, VPCId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("DisassociateResolverRule", Dict{String, Any}("ResolverRuleId"=>ResolverRuleId, "VPCId"=>VPCId); aws_config=aws_config)
disassociate_resolver_rule(ResolverRuleId, VPCId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("DisassociateResolverRule", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverRuleId"=>ResolverRuleId, "VPCId"=>VPCId), params)); aws_config=aws_config)

"""
    get_resolver_dnssec_config(resource_id)
    get_resolver_dnssec_config(resource_id, params::Dict{String,<:Any})

Gets DNSSEC validation information for a specified resource.

# Arguments
- `resource_id`: The ID of the virtual private cloud (VPC) for the DNSSEC validation status.

"""
get_resolver_dnssec_config(ResourceId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverDnssecConfig", Dict{String, Any}("ResourceId"=>ResourceId); aws_config=aws_config)
get_resolver_dnssec_config(ResourceId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverDnssecConfig", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceId"=>ResourceId), params)); aws_config=aws_config)

"""
    get_resolver_endpoint(resolver_endpoint_id)
    get_resolver_endpoint(resolver_endpoint_id, params::Dict{String,<:Any})

Gets information about a specified Resolver endpoint, such as whether it's an inbound or an
outbound Resolver endpoint, and the current status of the endpoint.

# Arguments
- `resolver_endpoint_id`: The ID of the Resolver endpoint that you want to get information
  about.

"""
get_resolver_endpoint(ResolverEndpointId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverEndpoint", Dict{String, Any}("ResolverEndpointId"=>ResolverEndpointId); aws_config=aws_config)
get_resolver_endpoint(ResolverEndpointId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverEndpoint", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverEndpointId"=>ResolverEndpointId), params)); aws_config=aws_config)

"""
    get_resolver_query_log_config(resolver_query_log_config_id)
    get_resolver_query_log_config(resolver_query_log_config_id, params::Dict{String,<:Any})

Gets information about a specified Resolver query logging configuration, such as the number
of VPCs that the configuration is logging queries for and the location that logs are sent
to.

# Arguments
- `resolver_query_log_config_id`: The ID of the Resolver query logging configuration that
  you want to get information about.

"""
get_resolver_query_log_config(ResolverQueryLogConfigId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverQueryLogConfig", Dict{String, Any}("ResolverQueryLogConfigId"=>ResolverQueryLogConfigId); aws_config=aws_config)
get_resolver_query_log_config(ResolverQueryLogConfigId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverQueryLogConfig", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverQueryLogConfigId"=>ResolverQueryLogConfigId), params)); aws_config=aws_config)

"""
    get_resolver_query_log_config_association(resolver_query_log_config_association_id)
    get_resolver_query_log_config_association(resolver_query_log_config_association_id, params::Dict{String,<:Any})

Gets information about a specified association between a Resolver query logging
configuration and an Amazon VPC. When you associate a VPC with a query logging
configuration, Resolver logs DNS queries that originate in that VPC.

# Arguments
- `resolver_query_log_config_association_id`: The ID of the Resolver query logging
  configuration association that you want to get information about.

"""
get_resolver_query_log_config_association(ResolverQueryLogConfigAssociationId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverQueryLogConfigAssociation", Dict{String, Any}("ResolverQueryLogConfigAssociationId"=>ResolverQueryLogConfigAssociationId); aws_config=aws_config)
get_resolver_query_log_config_association(ResolverQueryLogConfigAssociationId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverQueryLogConfigAssociation", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverQueryLogConfigAssociationId"=>ResolverQueryLogConfigAssociationId), params)); aws_config=aws_config)

"""
    get_resolver_query_log_config_policy(arn)
    get_resolver_query_log_config_policy(arn, params::Dict{String,<:Any})

Gets information about a query logging policy. A query logging policy specifies the
Resolver query logging operations and resources that you want to allow another AWS account
to be able to use.

# Arguments
- `arn`: The ARN of the query logging configuration that you want to get the query logging
  policy for.

"""
get_resolver_query_log_config_policy(Arn; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverQueryLogConfigPolicy", Dict{String, Any}("Arn"=>Arn); aws_config=aws_config)
get_resolver_query_log_config_policy(Arn, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverQueryLogConfigPolicy", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Arn"=>Arn), params)); aws_config=aws_config)

"""
    get_resolver_rule(resolver_rule_id)
    get_resolver_rule(resolver_rule_id, params::Dict{String,<:Any})

Gets information about a specified Resolver rule, such as the domain name that the rule
forwards DNS queries for and the ID of the outbound Resolver endpoint that the rule is
associated with.

# Arguments
- `resolver_rule_id`: The ID of the Resolver rule that you want to get information about.

"""
get_resolver_rule(ResolverRuleId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverRule", Dict{String, Any}("ResolverRuleId"=>ResolverRuleId); aws_config=aws_config)
get_resolver_rule(ResolverRuleId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverRule", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverRuleId"=>ResolverRuleId), params)); aws_config=aws_config)

"""
    get_resolver_rule_association(resolver_rule_association_id)
    get_resolver_rule_association(resolver_rule_association_id, params::Dict{String,<:Any})

Gets information about an association between a specified Resolver rule and a VPC. You
associate a Resolver rule and a VPC using AssociateResolverRule.

# Arguments
- `resolver_rule_association_id`: The ID of the Resolver rule association that you want to
  get information about.

"""
get_resolver_rule_association(ResolverRuleAssociationId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverRuleAssociation", Dict{String, Any}("ResolverRuleAssociationId"=>ResolverRuleAssociationId); aws_config=aws_config)
get_resolver_rule_association(ResolverRuleAssociationId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverRuleAssociation", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverRuleAssociationId"=>ResolverRuleAssociationId), params)); aws_config=aws_config)

"""
    get_resolver_rule_policy(arn)
    get_resolver_rule_policy(arn, params::Dict{String,<:Any})

Gets information about the Resolver rule policy for a specified rule. A Resolver rule
policy includes the rule that you want to share with another account, the account that you
want to share the rule with, and the Resolver operations that you want to allow the account
to use.

# Arguments
- `arn`: The ID of the Resolver rule that you want to get the Resolver rule policy for.

"""
get_resolver_rule_policy(Arn; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverRulePolicy", Dict{String, Any}("Arn"=>Arn); aws_config=aws_config)
get_resolver_rule_policy(Arn, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("GetResolverRulePolicy", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Arn"=>Arn), params)); aws_config=aws_config)

"""
    list_resolver_dnssec_configs()
    list_resolver_dnssec_configs(params::Dict{String,<:Any})

Lists the configurations for DNSSEC validation that are associated with the current AWS
account.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Filters"`: An optional specification to return a subset of objects.
- `"MaxResults"`:  Optional: An integer that specifies the maximum number of DNSSEC
  configuration results that you want Amazon Route 53 to return. If you don't specify a value
  for MaxResults, Route 53 returns up to 100 configuration per page.
- `"NextToken"`: (Optional) If the current AWS account has more than MaxResults DNSSEC
  configurations, use NextToken to get the second and subsequent pages of results. For the
  first ListResolverDnssecConfigs request, omit this value. For the second and subsequent
  requests, get the value of NextToken from the previous response and specify that value for
  NextToken in the request.
"""
list_resolver_dnssec_configs(; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverDnssecConfigs"; aws_config=aws_config)
list_resolver_dnssec_configs(params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverDnssecConfigs", params; aws_config=aws_config)

"""
    list_resolver_endpoint_ip_addresses(resolver_endpoint_id)
    list_resolver_endpoint_ip_addresses(resolver_endpoint_id, params::Dict{String,<:Any})

Gets the IP addresses for a specified Resolver endpoint.

# Arguments
- `resolver_endpoint_id`: The ID of the Resolver endpoint that you want to get IP addresses
  for.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"MaxResults"`: The maximum number of IP addresses that you want to return in the
  response to a ListResolverEndpointIpAddresses request. If you don't specify a value for
  MaxResults, Resolver returns up to 100 IP addresses.
- `"NextToken"`: For the first ListResolverEndpointIpAddresses request, omit this value. If
  the specified Resolver endpoint has more than MaxResults IP addresses, you can submit
  another ListResolverEndpointIpAddresses request to get the next group of IP addresses. In
  the next request, specify the value of NextToken from the previous response.
"""
list_resolver_endpoint_ip_addresses(ResolverEndpointId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverEndpointIpAddresses", Dict{String, Any}("ResolverEndpointId"=>ResolverEndpointId); aws_config=aws_config)
list_resolver_endpoint_ip_addresses(ResolverEndpointId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverEndpointIpAddresses", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverEndpointId"=>ResolverEndpointId), params)); aws_config=aws_config)

"""
    list_resolver_endpoints()
    list_resolver_endpoints(params::Dict{String,<:Any})

Lists all the Resolver endpoints that were created using the current AWS account.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Filters"`: An optional specification to return a subset of Resolver endpoints, such as
  all inbound Resolver endpoints.  If you submit a second or subsequent ListResolverEndpoints
  request and specify the NextToken parameter, you must use the same values for Filters, if
  any, as in the previous request.
- `"MaxResults"`: The maximum number of Resolver endpoints that you want to return in the
  response to a ListResolverEndpoints request. If you don't specify a value for MaxResults,
  Resolver returns up to 100 Resolver endpoints.
- `"NextToken"`: For the first ListResolverEndpoints request, omit this value. If you have
  more than MaxResults Resolver endpoints, you can submit another ListResolverEndpoints
  request to get the next group of Resolver endpoints. In the next request, specify the value
  of NextToken from the previous response.
"""
list_resolver_endpoints(; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverEndpoints"; aws_config=aws_config)
list_resolver_endpoints(params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverEndpoints", params; aws_config=aws_config)

"""
    list_resolver_query_log_config_associations()
    list_resolver_query_log_config_associations(params::Dict{String,<:Any})

Lists information about associations between Amazon VPCs and query logging configurations.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Filters"`: An optional specification to return a subset of query logging associations.
  If you submit a second or subsequent ListResolverQueryLogConfigAssociations request and
  specify the NextToken parameter, you must use the same values for Filters, if any, as in
  the previous request.
- `"MaxResults"`: The maximum number of query logging associations that you want to return
  in the response to a ListResolverQueryLogConfigAssociations request. If you don't specify a
  value for MaxResults, Resolver returns up to 100 query logging associations.
- `"NextToken"`: For the first ListResolverQueryLogConfigAssociations request, omit this
  value. If there are more than MaxResults query logging associations that match the values
  that you specify for Filters, you can submit another ListResolverQueryLogConfigAssociations
  request to get the next group of associations. In the next request, specify the value of
  NextToken from the previous response.
- `"SortBy"`: The element that you want Resolver to sort query logging associations by.
  If you submit a second or subsequent ListResolverQueryLogConfigAssociations request and
  specify the NextToken parameter, you must use the same value for SortBy, if any, as in the
  previous request.  Valid values include the following elements:    CreationTime: The ID of
  the query logging association.    Error: If the value of Status is FAILED, the value of
  Error indicates the cause:     DESTINATION_NOT_FOUND: The specified destination (for
  example, an Amazon S3 bucket) was deleted.    ACCESS_DENIED: Permissions don't allow
  sending logs to the destination.   If Status is a value other than FAILED, ERROR is null.
   Id: The ID of the query logging association    ResolverQueryLogConfigId: The ID of the
  query logging configuration    ResourceId: The ID of the VPC that is associated with the
  query logging configuration    Status: The current status of the configuration. Valid
  values include the following:    CREATING: Resolver is creating an association between an
  Amazon VPC and a query logging configuration.    CREATED: The association between an Amazon
  VPC and a query logging configuration was successfully created. Resolver is logging queries
  that originate in the specified VPC.    DELETING: Resolver is deleting this query logging
  association.    FAILED: Resolver either couldn't create or couldn't delete the query
  logging association. Here are two common causes:   The specified destination (for example,
  an Amazon S3 bucket) was deleted.   Permissions don't allow sending logs to the
  destination.
- `"SortOrder"`: If you specified a value for SortBy, the order that you want query logging
  associations to be listed in, ASCENDING or DESCENDING.  If you submit a second or
  subsequent ListResolverQueryLogConfigAssociations request and specify the NextToken
  parameter, you must use the same value for SortOrder, if any, as in the previous request.
"""
list_resolver_query_log_config_associations(; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverQueryLogConfigAssociations"; aws_config=aws_config)
list_resolver_query_log_config_associations(params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverQueryLogConfigAssociations", params; aws_config=aws_config)

"""
    list_resolver_query_log_configs()
    list_resolver_query_log_configs(params::Dict{String,<:Any})

Lists information about the specified query logging configurations. Each configuration
defines where you want Resolver to save DNS query logs and specifies the VPCs that you want
to log queries for.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Filters"`: An optional specification to return a subset of query logging
  configurations.  If you submit a second or subsequent ListResolverQueryLogConfigs request
  and specify the NextToken parameter, you must use the same values for Filters, if any, as
  in the previous request.
- `"MaxResults"`: The maximum number of query logging configurations that you want to
  return in the response to a ListResolverQueryLogConfigs request. If you don't specify a
  value for MaxResults, Resolver returns up to 100 query logging configurations.
- `"NextToken"`: For the first ListResolverQueryLogConfigs request, omit this value. If
  there are more than MaxResults query logging configurations that match the values that you
  specify for Filters, you can submit another ListResolverQueryLogConfigs request to get the
  next group of configurations. In the next request, specify the value of NextToken from the
  previous response.
- `"SortBy"`: The element that you want Resolver to sort query logging configurations by.
  If you submit a second or subsequent ListResolverQueryLogConfigs request and specify the
  NextToken parameter, you must use the same value for SortBy, if any, as in the previous
  request.  Valid values include the following elements:    Arn: The ARN of the query logging
  configuration    AssociationCount: The number of VPCs that are associated with the
  specified configuration     CreationTime: The date and time that Resolver returned when the
  configuration was created    CreatorRequestId: The value that was specified for
  CreatorRequestId when the configuration was created    DestinationArn: The location that
  logs are sent to    Id: The ID of the configuration    Name: The name of the configuration
    OwnerId: The AWS account number of the account that created the configuration
  ShareStatus: Whether the configuration is shared with other AWS accounts or shared with the
  current account by another AWS account. Sharing is configured through AWS Resource Access
  Manager (AWS RAM).    Status: The current status of the configuration. Valid values include
  the following:    CREATING: Resolver is creating the query logging configuration.
  CREATED: The query logging configuration was successfully created. Resolver is logging
  queries that originate in the specified VPC.    DELETING: Resolver is deleting this query
  logging configuration.    FAILED: Resolver either couldn't create or couldn't delete the
  query logging configuration. Here are two common causes:   The specified destination (for
  example, an Amazon S3 bucket) was deleted.   Permissions don't allow sending logs to the
  destination.
- `"SortOrder"`: If you specified a value for SortBy, the order that you want query logging
  configurations to be listed in, ASCENDING or DESCENDING.  If you submit a second or
  subsequent ListResolverQueryLogConfigs request and specify the NextToken parameter, you
  must use the same value for SortOrder, if any, as in the previous request.
"""
list_resolver_query_log_configs(; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverQueryLogConfigs"; aws_config=aws_config)
list_resolver_query_log_configs(params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverQueryLogConfigs", params; aws_config=aws_config)

"""
    list_resolver_rule_associations()
    list_resolver_rule_associations(params::Dict{String,<:Any})

Lists the associations that were created between Resolver rules and VPCs using the current
AWS account.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Filters"`: An optional specification to return a subset of Resolver rules, such as
  Resolver rules that are associated with the same VPC ID.  If you submit a second or
  subsequent ListResolverRuleAssociations request and specify the NextToken parameter, you
  must use the same values for Filters, if any, as in the previous request.
- `"MaxResults"`: The maximum number of rule associations that you want to return in the
  response to a ListResolverRuleAssociations request. If you don't specify a value for
  MaxResults, Resolver returns up to 100 rule associations.
- `"NextToken"`: For the first ListResolverRuleAssociation request, omit this value. If you
  have more than MaxResults rule associations, you can submit another
  ListResolverRuleAssociation request to get the next group of rule associations. In the next
  request, specify the value of NextToken from the previous response.
"""
list_resolver_rule_associations(; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverRuleAssociations"; aws_config=aws_config)
list_resolver_rule_associations(params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverRuleAssociations", params; aws_config=aws_config)

"""
    list_resolver_rules()
    list_resolver_rules(params::Dict{String,<:Any})

Lists the Resolver rules that were created using the current AWS account.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Filters"`: An optional specification to return a subset of Resolver rules, such as all
  Resolver rules that are associated with the same Resolver endpoint.  If you submit a second
  or subsequent ListResolverRules request and specify the NextToken parameter, you must use
  the same values for Filters, if any, as in the previous request.
- `"MaxResults"`: The maximum number of Resolver rules that you want to return in the
  response to a ListResolverRules request. If you don't specify a value for MaxResults,
  Resolver returns up to 100 Resolver rules.
- `"NextToken"`: For the first ListResolverRules request, omit this value. If you have more
  than MaxResults Resolver rules, you can submit another ListResolverRules request to get the
  next group of Resolver rules. In the next request, specify the value of NextToken from the
  previous response.
"""
list_resolver_rules(; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverRules"; aws_config=aws_config)
list_resolver_rules(params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListResolverRules", params; aws_config=aws_config)

"""
    list_tags_for_resource(resource_arn)
    list_tags_for_resource(resource_arn, params::Dict{String,<:Any})

Lists the tags that you associated with the specified resource.

# Arguments
- `resource_arn`: The Amazon Resource Name (ARN) for the resource that you want to list
  tags for.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"MaxResults"`: The maximum number of tags that you want to return in the response to a
  ListTagsForResource request. If you don't specify a value for MaxResults, Resolver returns
  up to 100 tags.
- `"NextToken"`: For the first ListTagsForResource request, omit this value. If you have
  more than MaxResults tags, you can submit another ListTagsForResource request to get the
  next group of tags for the resource. In the next request, specify the value of NextToken
  from the previous response.
"""
list_tags_for_resource(ResourceArn; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListTagsForResource", Dict{String, Any}("ResourceArn"=>ResourceArn); aws_config=aws_config)
list_tags_for_resource(ResourceArn, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("ListTagsForResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceArn"=>ResourceArn), params)); aws_config=aws_config)

"""
    put_resolver_query_log_config_policy(arn, resolver_query_log_config_policy)
    put_resolver_query_log_config_policy(arn, resolver_query_log_config_policy, params::Dict{String,<:Any})

Specifies an AWS account that you want to share a query logging configuration with, the
query logging configuration that you want to share, and the operations that you want the
account to be able to perform on the configuration.

# Arguments
- `arn`: The Amazon Resource Name (ARN) of the account that you want to share rules with.
- `resolver_query_log_config_policy`: An AWS Identity and Access Management policy
  statement that lists the query logging configurations that you want to share with another
  AWS account and the operations that you want the account to be able to perform. You can
  specify the following operations in the Actions section of the statement:
  route53resolver:AssociateResolverQueryLogConfig
  route53resolver:DisassociateResolverQueryLogConfig
  route53resolver:ListResolverQueryLogConfigAssociations
  route53resolver:ListResolverQueryLogConfigs    In the Resource section of the statement,
  you specify the ARNs for the query logging configurations that you want to share with the
  account that you specified in Arn.

"""
put_resolver_query_log_config_policy(Arn, ResolverQueryLogConfigPolicy; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("PutResolverQueryLogConfigPolicy", Dict{String, Any}("Arn"=>Arn, "ResolverQueryLogConfigPolicy"=>ResolverQueryLogConfigPolicy); aws_config=aws_config)
put_resolver_query_log_config_policy(Arn, ResolverQueryLogConfigPolicy, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("PutResolverQueryLogConfigPolicy", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Arn"=>Arn, "ResolverQueryLogConfigPolicy"=>ResolverQueryLogConfigPolicy), params)); aws_config=aws_config)

"""
    put_resolver_rule_policy(arn, resolver_rule_policy)
    put_resolver_rule_policy(arn, resolver_rule_policy, params::Dict{String,<:Any})

Specifies an AWS rule that you want to share with another account, the account that you
want to share the rule with, and the operations that you want the account to be able to
perform on the rule.

# Arguments
- `arn`: The Amazon Resource Name (ARN) of the rule that you want to share with another
  account.
- `resolver_rule_policy`: An AWS Identity and Access Management policy statement that lists
  the rules that you want to share with another AWS account and the operations that you want
  the account to be able to perform. You can specify the following operations in the Action
  section of the statement:    route53resolver:GetResolverRule
  route53resolver:AssociateResolverRule     route53resolver:DisassociateResolverRule
  route53resolver:ListResolverRules     route53resolver:ListResolverRuleAssociations    In
  the Resource section of the statement, specify the ARN for the rule that you want to share
  with another account. Specify the same ARN that you specified in Arn.

"""
put_resolver_rule_policy(Arn, ResolverRulePolicy; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("PutResolverRulePolicy", Dict{String, Any}("Arn"=>Arn, "ResolverRulePolicy"=>ResolverRulePolicy); aws_config=aws_config)
put_resolver_rule_policy(Arn, ResolverRulePolicy, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("PutResolverRulePolicy", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Arn"=>Arn, "ResolverRulePolicy"=>ResolverRulePolicy), params)); aws_config=aws_config)

"""
    tag_resource(resource_arn, tags)
    tag_resource(resource_arn, tags, params::Dict{String,<:Any})

Adds one or more tags to a specified resource.

# Arguments
- `resource_arn`: The Amazon Resource Name (ARN) for the resource that you want to add tags
  to. To get the ARN for a resource, use the applicable Get or List command:
  GetResolverEndpoint     GetResolverRule     GetResolverRuleAssociation
  ListResolverEndpoints     ListResolverRuleAssociations     ListResolverRules
- `tags`: The tags that you want to add to the specified resource.

"""
tag_resource(ResourceArn, Tags; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("TagResource", Dict{String, Any}("ResourceArn"=>ResourceArn, "Tags"=>Tags); aws_config=aws_config)
tag_resource(ResourceArn, Tags, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("TagResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceArn"=>ResourceArn, "Tags"=>Tags), params)); aws_config=aws_config)

"""
    untag_resource(resource_arn, tag_keys)
    untag_resource(resource_arn, tag_keys, params::Dict{String,<:Any})

Removes one or more tags from a specified resource.

# Arguments
- `resource_arn`: The Amazon Resource Name (ARN) for the resource that you want to remove
  tags from. To get the ARN for a resource, use the applicable Get or List command:
  GetResolverEndpoint     GetResolverRule     GetResolverRuleAssociation
  ListResolverEndpoints     ListResolverRuleAssociations     ListResolverRules
- `tag_keys`: The tags that you want to remove to the specified resource.

"""
untag_resource(ResourceArn, TagKeys; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("UntagResource", Dict{String, Any}("ResourceArn"=>ResourceArn, "TagKeys"=>TagKeys); aws_config=aws_config)
untag_resource(ResourceArn, TagKeys, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("UntagResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceArn"=>ResourceArn, "TagKeys"=>TagKeys), params)); aws_config=aws_config)

"""
    update_resolver_dnssec_config(resource_id, validation)
    update_resolver_dnssec_config(resource_id, validation, params::Dict{String,<:Any})

Updates an existing DNSSEC validation configuration. If there is no existing DNSSEC
validation configuration, one is created.

# Arguments
- `resource_id`: The ID of the virtual private cloud (VPC) that you're updating the DNSSEC
  validation status for.
- `validation`: The new value that you are specifying for DNSSEC validation for the VPC.
  The value can be ENABLE or DISABLE. Be aware that it can take time for a validation status
  change to be completed.

"""
update_resolver_dnssec_config(ResourceId, Validation; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("UpdateResolverDnssecConfig", Dict{String, Any}("ResourceId"=>ResourceId, "Validation"=>Validation); aws_config=aws_config)
update_resolver_dnssec_config(ResourceId, Validation, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("UpdateResolverDnssecConfig", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceId"=>ResourceId, "Validation"=>Validation), params)); aws_config=aws_config)

"""
    update_resolver_endpoint(resolver_endpoint_id)
    update_resolver_endpoint(resolver_endpoint_id, params::Dict{String,<:Any})

Updates the name of an inbound or an outbound Resolver endpoint.

# Arguments
- `resolver_endpoint_id`: The ID of the Resolver endpoint that you want to update.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"Name"`: The name of the Resolver endpoint that you want to update.
"""
update_resolver_endpoint(ResolverEndpointId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("UpdateResolverEndpoint", Dict{String, Any}("ResolverEndpointId"=>ResolverEndpointId); aws_config=aws_config)
update_resolver_endpoint(ResolverEndpointId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("UpdateResolverEndpoint", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResolverEndpointId"=>ResolverEndpointId), params)); aws_config=aws_config)

"""
    update_resolver_rule(config, resolver_rule_id)
    update_resolver_rule(config, resolver_rule_id, params::Dict{String,<:Any})

Updates settings for a specified Resolver rule. ResolverRuleId is required, and all other
parameters are optional. If you don't specify a parameter, it retains its current value.

# Arguments
- `config`: The new settings for the Resolver rule.
- `resolver_rule_id`: The ID of the Resolver rule that you want to update.

"""
update_resolver_rule(Config, ResolverRuleId; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("UpdateResolverRule", Dict{String, Any}("Config"=>Config, "ResolverRuleId"=>ResolverRuleId); aws_config=aws_config)
update_resolver_rule(Config, ResolverRuleId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = route53resolver("UpdateResolverRule", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Config"=>Config, "ResolverRuleId"=>ResolverRuleId), params)); aws_config=aws_config)


text:
# an example on mixed integer programming
#
#   maximize x + 2 y + 5 z
#
#   s.t.  x + y + z <= 10
#         x + 2 y + z <= 15
#
#         x is continuous: 0 <= x <= 5
#         y is integer: 0 <= y <= 10
#         z is binary
#

using Gurobi
using Base.Test

env = Gurobi.Env()

model = Gurobi.Model(env, "mip_01", :maximize)

add_cvar!(model, 1., 0., 5.)  # x
add_ivar!(model, 2., 0, 10)   # y
add_bvar!(model, 5.)          # z
update_model!(model)

add_constr!(model, ones(3), '<', 10.)
add_constr!(model, [1., 2., 1.], '<', 15.)

update_model!(model)

@test Gurobi.get_dblattrelement(model, "UB", 1) == 5.0
@test Gurobi.get_charattrelement(model, "Sense", 1) == '<'

Gurobi.set_dblattrelement!(model, "UB", 1, 4.0)
Gurobi.set_charattrelement!(model, "Sense", 1, '>')
update_model!(model)
@test Gurobi.get_dblattrelement(model, "UB", 1) == 4.0
@test Gurobi.get_charattrelement(model, "Sense", 1) == '>'

ext: jl


text:
using Documenter, IJulia

makedocs(
    modules=[IJulia],
    sitename="IJulia",
    pages=[
        "Home" => "index.md",
        "Manual" => [
            "manual/installation.md",
            "manual/running.md",
            "manual/usage.md",
            "manual/troubleshooting.md",
        ],
        "Library" => [
            "library/public.md",
            "library/internals.md",
        ],
    ],
)

deploydocs(
    repo = "github.com/JuliaLang/IJulia.jl.git",
    push_preview = true,
)


text:
export box

function box(s)
	cubeVertices = GLfloat[
		-1.0, -1.0, -1.0,
		-1.0, -1.0,  1.0,
		-1.0,  1.0,  1.0,
		1.0,  1.0, -1.0,
		-1.0, -1.0, -1.0,
		-1.0,  1.0, -1.0,
		1.0, -1.0,  1.0,
		-1.0, -1.0, -1.0,
		1.0, -1.0, -1.0,
		1.0,  1.0, -1.0,
		1.0, -1.0, -1.0,
		-1.0, -1.0, -1.0,
		-1.0, -1.0, -1.0,
		-1.0,  1.0,  1.0,
		-1.0,  1.0, -1.0,
		1.0, -1.0,  1.0,
		-1.0, -1.0,  1.0,
		-1.0, -1.0, -1.0,
		-1.0,  1.0,  1.0,
		-1.0, -1.0,  1.0,
		1.0, -1.0,  1.0,
		1.0,  1.0,  1.0,
		1.0, -1.0, -1.0,
		1.0,  1.0, -1.0,
		1.0, -1.0, -1.0,
		1.0,  1.0,  1.0,
		1.0, -1.0,  1.0,
		1.0,  1.0,  1.0,
		1.0,  1.0, -1.0,
		-1.0,  1.0, -1.0,
		1.0,  1.0,  1.0,
		-1.0,  1.0, -1.0,
		-1.0,  1.0,  1.0,
		1.0,  1.0,  1.0,
		-1.0,  1.0,  1.0,
		1.0, -1.0,  1.0]

	cubeVertices = cubeVertices * s

	posStride = 35*3
	posData = zeros(GLfloat, 35*3*length(s))

	@inbounds @simd for x = 1:35
		posData[3*(x-1)+1] = cubeVertices[3*(x-1)+1]
		posData[3*(x-1)+2] = cubeVertices[3*(x-1)+2]
		posData[3*(x-1)+3] = cubeVertices[3*(x-1)+3]
	end

	glBindBuffer(GL_ARRAY_BUFFER, globjs.posvbos[globjs.posind])
	glBufferData(GL_ARRAY_BUFFER, sizeof(posData), posData, GL_STATIC_DRAW)

	# if state.drawTexture
	#	# texcoords
	#	texData = zeros(GLfloat, numSlices*4*length(xc))
	#	texData[8:vertexStride:end] = 0
	#	texData[9:vertexStride:end] = 0

	#	texData[17:vertexStride:end] = 1
	#	texData[18:vertexStride:end] = 0

	#	texData[26:vertexStride:end] = 1
	#	texData[27:vertexStride:end] = 1

	#	texData[35:vertexStride:end] = 0
	#	texData[36:vertexStride:end] = 1
	# end

	# elements = zeros(GLuint, 6*length(x1))

	# elements[1] = 0
	# elements[2] = 1
	# elements[3] = 2
	# elements[4] = 2
	# elements[5] = 3
	# elements[6] = 0

	# index = 7
	# for x = 2:length(x1)
	#	elements[index] = elements[index-6] + 4
	#	elements[index+1] = elements[(index-6)+1] + 4
	#	elements[index+2] = elements[(index-6)+2] + 4
	#	elements[index+3] = elements[(index-6)+3] + 4
	#	elements[index+4] = elements[(index-6)+4] + 4
	#	elements[index+5] = elements[(index-6)+5] + 4
	#	index += 6
	# end

	colData = []
	if state.fillStuff || state.strokeStuff
		colData = zeros(GLfloat, 35*4*length(s))
	end

	shapeStride = 35
	if state.fillStuff
		loadColors!(colData, state.fillCol, 35*4)
		glBindBuffer(GL_ARRAY_BUFFER, globjs.colvbos[globjs.colind])
		glBufferData(GL_ARRAY_BUFFER, sizeof(colData), colData, GL_STATIC_DRAW)
		@inbounds @simd for x = 1:length(s)
			glDrawArrays(GL_TRIANGLES, (x-1)*shapeStride, shapeStride)
		end
		# glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(elements), elements, GL_STATIC_DRAW)
		# glDrawElements(GL_TRIANGLES, 6*length(xtopleft), GL_UNSIGNED_INT, C_NULL)
	end
	if state.strokeStuff
		loadColors!(colData, state.strokeCol, 35*4)
		glBindBuffer(GL_ARRAY_BUFFER, globjs.colvbos[globjs.colind])
		glBufferData(GL_ARRAY_BUFFER, sizeof(colData), colData, GL_STATIC_DRAW)
		@inbounds @simd for x = 1:length(s)
			glDrawArrays(GL_LINE_LOOP, (x-1)*shapeStride, shapeStride)
		end
	end
end

function sphere(r)
	shapeStride = 35
	if state.fillStuff
		loadColors!(colData, state.fillCol, 35*4)
		glBindBuffer(GL_ARRAY_BUFFER, globjs.colvbos[globjs.colind])
		glBufferData(GL_ARRAY_BUFFER, sizeof(colData), colData, GL_STATIC_DRAW)
		@inbounds @simd for x = 1:length(s)
			glDrawArrays(GL_TRIANGLES, (x-1)*shapeStride, shapeStride)
		end
		# glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(elements), elements, GL_STATIC_DRAW)
		# glDrawElements(GL_TRIANGLES, 6*length(xtopleft), GL_UNSIGNED_INT, C_NULL)
	end
	# if state.strokeStuff
	#	loadColors!(colData, state.strokeCol, 35*4)
	#	glBufferData(GL_ARRAY_BUFFER, sizeof(vertexData), vertexData, GL_STATIC_DRAW)
	#	for x = 1:length(x1)
	#		glDrawArrays(GL_LINE_LOOP, (x-1)*shapeStride, shapeStride)
	#	end
	# end
end


text:
using Distributions: @check_args

"""
    MvDiscreteNonParametric(xs, ps)

A *multivariate Discrete nonparametric distribution* explicitly defines an arbitrary
probability mass function in terms of a list of real support values and their
corresponding probabilities

```julia
d = MvDiscreteNonParametric(xs, ps)

params(d)  # Get the parameters, i.e. (xs, ps)
support(d) # Get a sorted AbstractVector describing the support (xs) of the distribution
probs(d)   # Get a Matrix of the probabilities (ps) associated with the support
```

External links

* [Probability mass function on Wikipedia](http://en.wikipedia.org/wiki/Probability_mass_function)
"""
struct MvDiscreteNonParametric{T<:Real,P<:Real,Ts<:AbstractVector{T},Ps<:AbstractMatrix{P}} <: DiscreteMultivariateDistribution
    support::Ts
    p::Ps

    function MvDiscreteNonParametric{T,P,Ts,Ps}(vs::Ts, ps::Ps; check_args=true) where {
            T<:Real,P<:Real,Ts<:AbstractVector{T},Ps<:AbstractMatrix{P}}
        check_args || return new{T,P,Ts,Ps}(vs, ps)
        @check_args(MvDiscreteNonParametric, length(vs) == size(ps,1))
        @check_args(MvDiscreteNonParametric, all(isprobvec, eachcol(ps)))
        @check_args(MvDiscreteNonParametric, allunique(vs))
        sort_order = sortperm(vs)
        new{T,P,Ts,Ps}(vs[sort_order], ps[sort_order,:])
    end
end

MvDiscreteNonParametric(vs::Ts, ps::Ps; check_args=true) where {
        T<:Real,P<:Real,Ts<:AbstractVector{T},Ps<:AbstractMatrix{P}} =
    MvDiscreteNonParametric{T,P,Ts,Ps}(vs, ps, check_args=check_args)

Base.eltype(::Type{<:MvDiscreteNonParametric{T}}) where T = T

# Conversion
Base.convert(::Type{MvDiscreteNonParametric{T,P,Ts,Ps}}, d::MvDiscreteNonParametric) where {T,P,Ts,Ps} =
    MvDiscreteNonParametric{T,P,Ts,Ps}(Ts(support(d)), Ps(probs(d)), check_args=false)

# Accessors
Distributions.params(d::MvDiscreteNonParametric) = (d.support, d.p)

"""
    support(d::MvDiscreteNonParametric)

Get a sorted AbstractVector defining the support of `d`.
"""
Distributions.support(d::MvDiscreteNonParametric) = d.support

"""
    probs(d::MvDiscreteNonParametric)

Get the vector of probabilities associated with the support of `d`.
"""
Distributions.probs(d::MvDiscreteNonParametric)  = d.p

import Base: ==
==(c1::D, c2::D) where D<:MvDiscreteNonParametric =
    (support(c1) == support(c2) || all(support(c1) .== support(c2))) &&
    (probs(c1) == probs(c2) || all(probs(c1) .== probs(c2)))

Base.isapprox(c1::D, c2::D) where D<:MvDiscreteNonParametric =
    (support(c1) ≈ support(c2) || all(support(c1) .≈ support(c2))) &&
    (probs(c1) ≈ probs(c2) || all(probs(c1) .≈ probs(c2)))

# Sampling

function Base.rand(rng::AbstractRNG, d::MvDiscreteNonParametric{T,P}) where {T,P}
    x = support(d)
    p = probs(d)
    n, k = size(p)
    map(1:k) do j
        draw = rand(rng, P)
        cp = zero(P)
        i = 0
        while cp < draw && i < n
            cp += p[i +=1, j]
        end
        x[max(i,1)]
    end
end

Base.rand(d::MvDiscreteNonParametric) = rand(GLOBAL_RNG, d)

# Override the method in testutils.jl since it assumes
# an evenly-spaced integer support
Distributions.get_evalsamples(d::MvDiscreteNonParametric, ::Float64) = support(d)

# Evaluation

Distributions.pdf(d::MvDiscreteNonParametric) = copy(probs(d))

# Helper functions for pdf and cdf required to fix ambiguous method
# error involving [pc]df(::DisceteUnivariateDistribution, ::Int)
function _logpdf(d::MvDiscreteNonParametric{T,P}, x::AbstractVector{T}) where {T,P}
    s = zero(P)
    for col in 1:length(x)
        idx_range = searchsorted(support(d), x[col])
        if length(idx_range) > 0
            s += log(probs(d)[first(idx_range),col])
        end
    end
    return s
end
Distributions.logpdf(d::MvDiscreteNonParametric{T}, x::AbstractVector{<:Integer}) where T  = _logpdf(d, convert(AbstractVector{T}, x))
Distributions.logpdf(d::MvDiscreteNonParametric{T}, x::AbstractVector{<:Real}) where T = _logpdf(d, convert(AbstractVector{T}, x))
Distributions.pdf(d::MvDiscreteNonParametric, x::AbstractVector{<:Real}) = exp(logpdf(d, x))

Base.minimum(d::MvDiscreteNonParametric) = first(support(d))
Base.maximum(d::MvDiscreteNonParametric) = last(support(d))
Distributions.insupport(d::MvDiscreteNonParametric, x::AbstractVector{<:Real}) =
    all(x -> length(searchsorted(support(d), x)) > 0, x)

Distributions.mean(d::MvDiscreteNonParametric) = probs(d)' * support(d)

function Distributions.cov(d::MvDiscreteNonParametric)
    m = mean(d)
    x = support(d)
    p = probs(d)
    k = size(p,1)
    n = size(p,2)
    σ² = zero(m)
    for j in 1:n
        for i in 1:k
            @inbounds σ²[j] += abs2(x[i,j] - m[j]) * p[i,j]
        end
    end
    return Diagonal(σ²)
end

const MvCategorical{P,Ps} = MvDiscreteNonParametric{Int,P,Base.OneTo{Int},Ps}

MvCategorical(p::Ps; check_args=true) where {P<:Real, Ps<:AbstractMatrix{P}} =
    MvCategorical{P,Ps}(p, check_args=check_args)

function MvCategorical{P,Ps}(p::Ps; check_args=true) where {P<:Real, Ps<:AbstractMatrix{P}}
    check_args && @check_args(MvCategorical, all(isprobvec, eachcol(p)))
    return MvCategorical{P,Ps}(Base.OneTo(size(p, 1)), p, check_args=check_args)
end

Distributions.ncategories(d::MvCategorical) = support(d).stop
Distributions.params(d::MvCategorical{P,Ps}) where {P<:Real, Ps<:AbstractVector{P}} = (probs(d),)
Distributions.partype(::MvCategorical{T}) where {T<:Real} = T
function Distributions.logpdf(d::MvCategorical{T}, x::AbstractVector{<:Integer}) where {T<:Real}
    ps = probs(d)
    if insupport(d, x)
        _mv_categorical_logpdf(ps, x)
    else
        return zero(eltype(ps))
    end
end
_mv_categorical_logpdf(ps, x) = sum(log, view(ps, x, :))


text:
module SemialgebraicGames

include("solver/moment_constraints.jl");
include("solver/solver.jl");

export solve_game

include("utils/square_a_triangle.jl")
include("utils/available_result.jl")
include("utils/cholesky_like.jl")

include("bridges/bridges.jl")
include("iterative/iterative.jl")

export CoBModel, DD, SDD, DDPBridge, SDDPBridge, lazy_relax

end


text:
#==============
MetaPhlAn Utils
==============#
const taxlevels = Dict([
    :kingom     => 1,
    :phylum     => 2,
    :class      => 3,
    :order      => 4,
    :family     => 5,
    :genus      => 6,
    :species    => 7,
    :subspecies => 8])

"""
taxfilter!(df::DataFrame, level::Int=7; shortnames::Bool=true)

Filter a MetaPhlAn table (df) to a particular taxon level.
1 = Kingdom
2 = Phylum
3 = Class
4 = Order
5 = Family
6 = Genus
7 = Species
8 = Subspecies

If shortnames is true (default), also changes names in the first column to
remove higher order taxa
"""
function taxfilter!(taxonomic_profile::DataFrames.DataFrame, level::Int=7; shortnames::Bool=true)
    in(level, collect(1:8)) || @error "$level not a valid taxonomic level" taxlevels
    filter!(row->length(split(row[1], '|')) == level, taxonomic_profile)
    if shortnames
        matches = collect.(map(x->eachmatch(r"[kpcofgst]__(\w+)",x), taxonomic_profile[1]))
        taxonomic_profile[1] = String.([m[level].captures[1] for m in matches])
    end
    return taxonomic_profile
end

function taxfilter!(taxonomic_profile::DataFrames.DataFrame, level::Symbol; shortnames::Bool=true)
    in(level, keys(taxlevels)) || @error "$level not a valid taxonomic level" taxlevels
    taxfilter!(taxonomic_profile, taxlevels[level], shortnames=shortnames)
end

function taxfilter(taxonomic_profile::DataFrames.DataFrame, level::Int=7; shortnames::Bool=true)
    filt = deepcopy(taxonomic_profile)
    taxfilter!(filt, level, shortnames=shortnames)
    return filt
end

function taxfilter(taxonomic_profile::DataFrames.DataFrame, level::Symbol; shortnames::Bool=true)
    filt = deepcopy(taxonomic_profile)
    taxfilter!(filt, level, shortnames=shortnames)
    return filt
end


text:
struct MetaDict <: Base.AbstractDict{String, Vector{T} where {T}}
    data::Dict{String,Vector{T} where {T}}
end
MetaDict() = MetaDict(Dict())
Base.length(meta::MetaDict) = Base.length(meta.data)

function Base.iterate(meta::MetaDict, state...)
    vi = iterate(meta.data,state...)
    if vi === nothing return nothing end
    ((key,value),newstate) = vi
    return (Pair(key, Internal.lift(value)),newstate)
end

module Internal
    lift(x) = length(x) == 1 ? x[1] : x
end

Base.get(collection::MetaDict,key::String, default) = get(collection.data,key,default) |> Internal.lift
Base.setindex!(collection::MetaDict, value::Vector{T}, key::String) where {T} = setindex!(collection.data, value, key)
Base.setindex!(collection::MetaDict, value::T, key::String) where {T} = setindex!(collection.data, [value], key)

function push!(collection::MetaDict, key::String, values...)
    vec = get!(collection.data, key, [])
    Base.push!(vec, values...)
end

function read(io::IO, ::Type{MetaDict})
    function parse_node(string)

        val = tryparse(Int64, string)
        if val !== nothing
                return val
        end
        val = tryparse(Float64, string)
        if val !== nothing
            return val
        end
        return string
    end

    meta_string = read_string(io, UInt64)
    if isempty(meta_string)
        return MetaDict()
    end

    meta = MetaDict()
    meta_xml = EzXML.parsexml(meta_string)
    r = EzXML.root(meta_xml)

    for meta_node in EzXML.eachelement(r)
        name = EzXML.findfirst("name", meta_node).content
        values = map(x -> parse_node(x.content), EzXML.findall("value", meta_node))
        meta[name] = values
    end

    return meta

end

function to_xml_string(meta::MetaDict)::String
    if isempty(meta)
        return ""
    end

    doc = EzXML.XMLDocument()
    base = EzXML.ElementNode("ismrmrdMeta")

    for (key,values) in meta.data
        meta_node = EzXML.ElementNode("meta")
        EzXML.addelement!(meta_node,"name",key)
        values .|> string .|> EzXML.addelement! $ (meta_node,"value")
        EzXML.link!(base,meta_node)
    end

    EzXML.setroot!(doc,base)
    buffer = IOBuffer()
    EzXML.print(buffer,doc)
    seekstart(buffer)
    return  buffer |> take! |> String
end

function write(io::IO, meta::MetaDict)
    MRD.write_string(io,to_xml_string(meta),UInt64)
end


text:
include("dependencies_for_runtests.jl")

using Oceananigans.Grids: topology, XRegLatLonGrid, YRegLatLonGrid, ZRegLatLonGrid

function show_hydrostatic_test(grid, free_surface, precompute_metrics)

    typeof(grid) <: XRegLatLonGrid ? gx = :regular : gx = :stretched
    typeof(grid) <: YRegLatLonGrid ? gy = :regular : gy = :stretched
    typeof(grid) <: ZRegLatLonGrid ? gz = :regular : gz = :stretched

    arch = grid.architecture
    free_surface_str = string(typeof(free_surface).name.wrapper)

    strc = "$(precompute_metrics ? ", metrics are precomputed" : "")"

    testset_str = "Hydrostatic free turbulence regression [$(typeof(arch)), $(topology(grid, 1)) longitude,  ($gx, $gy, $gz) grid, $free_surface_str]" * strc
    info_str    =  "  Testing Hydrostatic free turbulence [$(typeof(arch)), $(topology(grid, 1)) longitude,  ($gx, $gy, $gz) grid, $free_surface_str]" * strc

    return testset_str, info_str
end

function get_fields_from_checkpoint(filename)
    file = jldopen(filename)

    tracers = keys(file["tracers"])
    tracers = Tuple(Symbol(c) for c in tracers)

    velocity_fields = (u = file["velocities/u/data"],
                       v = file["velocities/v/data"],
                       w = file["velocities/w/data"])

    tracer_fields =
        NamedTuple{tracers}(Tuple(file["tracers/$c/data"] for c in tracers))

    current_tendency_velocity_fields = (u = file["timestepper/Gⁿ/u/data"],
                                        v = file["timestepper/Gⁿ/v/data"],
                                        w = file["timestepper/Gⁿ/w/data"])

    current_tendency_tracer_fields =
        NamedTuple{tracers}(Tuple(file["timestepper/Gⁿ/$c/data"] for c in tracers))

    previous_tendency_velocity_fields = (u = file["timestepper/G⁻/u/data"],
                                         v = file["timestepper/G⁻/v/data"],
                                         w = file["timestepper/G⁻/w/data"])

    previous_tendency_tracer_fields =
        NamedTuple{tracers}(Tuple(file["timestepper/G⁻/$c/data"] for c in tracers))

    close(file)

    solution = merge(velocity_fields, tracer_fields)
    Gⁿ = merge(current_tendency_velocity_fields, current_tendency_tracer_fields)
    G⁻ = merge(previous_tendency_velocity_fields, previous_tendency_tracer_fields)

    return solution, Gⁿ, G⁻
end

include("regression_tests/hydrostatic_free_turbulence_regression_test.jl")

@testset "Hydrostatic Regression" begin
    @info "Running hydrostatic regression tests..."

    for arch in archs
        longitudes = [(-180, 180), (-160, 160)]
        latitudes  = [(-60, 60)]
        zs         = [(-90, 0)]

        explicit_free_surface = ExplicitFreeSurface(gravitational_acceleration = 1.0)
        implicit_free_surface = ImplicitFreeSurface(gravitational_acceleration = 1.0,
                                                    solver_method = :PreconditionedConjugateGradient,
                                                    reltol = 0, abstol = 1e-15)

            for longitude in longitudes, latitude in latitudes, z in zs, precompute_metrics in (true, false)
                longitude[1] == -180 ? size = (180, 60, 3) : size = (160, 60, 3)
                grid  = LatitudeLongitudeGrid(arch; size, longitude, latitude, z, precompute_metrics, halo=(2, 2, 2))

            for free_surface in [explicit_free_surface, implicit_free_surface]

                # GPU + ImplicitFreeSurface + precompute metrics cannot be tested on sverdrup at the moment
                # because "uses too much parameter space (maximum 0x1100 bytes)" error
                if !(precompute_metrics && free_surface isa ImplicitFreeSurface && arch isa GPU)

                    testset_str, info_str = show_hydrostatic_test(grid, free_surface, precompute_metrics)

                    @testset "$testset_str" begin
                        @info "$info_str"
                        run_hydrostatic_free_turbulence_regression_test(grid, free_surface)
                    end
                end
            end
        end
    end
end


text:
@testset "check gradient for IndRNN block in adding problem" begin
    function addingProblemData(T::Int)
        #= 两个长度为 T 的序列组成输入：
        第一个序列在 (0,1)范围内均匀采样，
        第二个序列的前两个为 1，其余都为 0.
        例如：
        x1 = 0.90  0.93  0.90  0.56  0.46
        x2 = 1.0   1.0   0.0   0.0   0.0
        而输出为 sum(x1 .* x2) = 0.90 + 0.93
        =#
        @assert (T>1) "The sequence length should lager than 1"
        x1 = rand(1,T)./3
        x2 = zeros(1,T)
        x2[1] = 1.0
        x2[2] = 1.0
        y = sum(x1 .* x2)
        return [x1;x2],[y]
    end

    TYPE = Array{Float64};
    clear()

    # [0] prepare model
    model = Chain(
    IndRNN(2,128,relu; type=TYPE),
    IndRNN(128,64,cos; type=TYPE),
    IndRNN(64,64,cos;  type=TYPE),
    Dense(64,1,relu;   type=TYPE)
    )

    # [1] prepare input data and its label
    T = 15
    x, s = addingProblemData(T)

    # [2] forward and backward propagation
    resethidden(model)
    for t = 1:T-1
        tmp = forward(model, Variable( reshape(x[:,t], 2,1); type=TYPE) )
        zeroDelta(tmp)
    end
    y = forward(model, Variable( reshape(x[:,T], 2,1); type=TYPE) )
    COST1 = mseCost(y, Variable( reshape(s,1,1); type=TYPE) )
    backward()

    # [3] with a samll change of a weight
    GRAD = model[1].w.delta[1]
    DELTA = 1e-4
    model[1].w.value[1] += DELTA

    # [4] forward and backward propagation again
    resethidden(model)
    for t = 1:T-1
        tmp = forward(model, Variable( reshape(x[:,t], 2,1); type=TYPE) )
        zeroDelta(tmp)
    end
    y = forward(model, Variable( reshape(x[:,T], 2,1); type=TYPE) )
    COST2 = mseCost(y, Variable( reshape(s,1,1); type=TYPE) )
    backward()

    # [5] check if the auto-grad is true or not
    dLdW = (COST2 - COST1)/DELTA
    @test abs(dLdW-GRAD)<1e-4
end

max_stars_repo_name: sonosole/Delta

max_issues_repo_name: sonosole/Delta

max_forks_repo_name: sonosole/Delta


text:
using ADFPEPS
using Test

@testset "ADFPEPS.jl" begin
    # Write your tests here.
end


text:
# solver

abstract type AbstractNLSolver{algType,iip} end

mutable struct NLSolver{algType,iip,uType,uTolType,tTypeNoUnits,C<:AbstractNLSolverCache} <: AbstractNLSolver{algType,iip}
  z::uType
  tmp::uType
  ztmp::uType
  γ::uTolType
  c::tTypeNoUnits
  alg::algType
  κ::uTolType
  fast_convergence_cutoff::uTolType
  ηold::uTolType
  iter::Int
  maxiters::Int
  status::NLStatus
  cache::C
end

# caches

mutable struct NLNewtonCache{uType,tType,rateType,uNoUnitsType,J,W,du1Type,ufType,jcType,lsType,G} <: AbstractNLSolverCache
  ustep::uType
  tstep::tType
  k::rateType
  atmp::uNoUnitsType
  dz::uType
  J::J
  W::W
  new_W::Bool
  W_dt::tType
  du1::du1Type
  uf::ufType
  jac_config::jcType
  linsolve::lsType
  weight::uType
  invγdt::G
  new_W_dt_cutoff::tType
end

mutable struct NLNewtonConstantCache{tType,J,W,ufType,G} <: AbstractNLSolverCache
  tstep::tType
  J::J
  W::W
  new_W::Bool
  W_dt::tType
  uf::ufType
  invγdt::G
  new_W_dt_cutoff::tType
end

mutable struct NLFunctionalCache{uType,tType,rateType,uNoUnitsType} <: AbstractNLSolverCache
  ustep::uType
  tstep::tType
  k::rateType
  atmp::uNoUnitsType
  dz::uType
end

mutable struct NLFunctionalConstantCache{tType} <: AbstractNLSolverCache
  tstep::tType
end

mutable struct NLAndersonCache{uType,tType,rateType,uNoUnitsType,uEltypeNoUnits,D} <: AbstractNLSolverCache
  ustep::uType
  tstep::tType
  k::rateType
  atmp::uNoUnitsType
  dz::uType
  """residuals `g(zprev) - zprev` of previous fixed-point iteration"""
  dzold::uType
  """value `g(zprev)` of previous fixed-point iteration"""
  z₊old::uType
  Δz₊s::Vector{uType}
  Q::Matrix{uEltypeNoUnits}
  R::Matrix{uEltypeNoUnits}
  γs::Vector{uEltypeNoUnits}
  history::Int
  aa_start::Int
  droptol::D
end

mutable struct NLAndersonConstantCache{uType,tType,uEltypeNoUnits,D} <: AbstractNLSolverCache
  tstep::tType
  dz::uType
  """residuals `g(zprev) - zprev` of previous fixed-point iteration"""
  dzold::uType
  """value `g(zprev)` of previous fixed-point iteration"""
  z₊old::uType
  Δz₊s::Vector{uType}
  Q::Matrix{uEltypeNoUnits}
  R::Matrix{uEltypeNoUnits}
  γs::Vector{uEltypeNoUnits}
  history::Int
  aa_start::Int
  droptol::D
end


text:
input = joinpath(@__DIR__, "input")
lines = readlines(input)

pairs = map(line -> split(line, "-"), lines)
pairs = map(pair -> (first(pair), last(pair)), pairs)

function neighbors(node, pairs)
    ns = Set()
    for p in pairs
        if first(p) == node && last(p) != "start"
            push!(ns, last(p))
        elseif last(p) == node && first(p) != "start"
            push!(ns, first(p))
        end
    end
    return ns
end

function small(node)
    chars = collect(node)
    return all(char -> char in collect("abcdefghijklmnopqrstuvwxyz"), chars)
end

function paths(current, pairs, visited, visitedtwice)
    v = copy(visited)
    current == "end" && return 1
    if small(current) && current in v
        if visitedtwice == nothing
            visitedtwice = current
        else
            return 0
        end
    end
    push!(v, current)
    count = 0
    ns = neighbors(current, pairs)
    for n in ns
        count += paths(n, pairs, v, visitedtwice)
    end
    return count
end

p1 = paths("start", pairs, Set(), false)
p2 = paths("start", pairs, Set(), nothing)

println("-----------------------------------------------------------------------")
println("passage pathing -- part one :: $p1")
println("passage pathing -- part two :: $p2")
println("-----------------------------------------------------------------------")

@assert(p1 == 4186)
@assert(p2 == 92111)


text:
#Shows bulk interacellular concentration profiles
using RCall
include("ProblemGenerator.jl")
include("VirusCallBacks.jl")

#Create a talbe to hold all the simulation data

#Create a function to output a table
function TableMaker(prob,sol,probInfo)

  timeLength = length(sol.t)

  T = DataFrame()
  T.ModelType = fill(probInfo,nCells*timeLength)

  T.CellType = repeat([i > 0.0 ? "Primary" : "Secondary" for i in vec(prob.u0[:, :, 2])], timeLength)
  T.Time = repeat(sol.t, inner = nCells)

  wantedSpecies = ["DNA","IFNb","IRF7","TREX1"]
  wantedSpeciesIdx = [findfirst(isequal(str),statesNames) for str in wantedSpecies]

  for (i, st) in zip(wantedSpeciesIdx,wantedSpecies)
    T[!, Symbol(st)] = vec(sol[:, :, i, :])
  end

  return T
end

#--------------ISD (Det, homo)--------------
ISDprob = ModelSetup(:ISD, :notStochastic, :Homo)
ISDsol = @time solve(ISDprob, CVODE_BDF(linear_solver = :GMRES), saveat = 1.0)

probInfo = "ISD/Det/Homo"
fig3Table = TableMaker(ISDprob,ISDsol,probInfo)

#--------------Virus (Det, homo)--------------
Virprob = ModelSetup(:Virus, :notStochastic, :Homo)
Virsol = @time solve(Virprob, CVODE_BDF(linear_solver = :GMRES), saveat = 1.0,callback = cb)

probInfo = "Virus/Det/Homo"
fig3Table = vcat(fig3Table,TableMaker(Virprob,Virsol,probInfo))

#--------------ISD (Stoch, hetero)--------------
ISDprob2 = ModelSetup(:ISD, :Stochastic, :Hetero)
ISDsol2 = @time solve(ISDprob2, CVODE_BDF(linear_solver = :GMRES), saveat = 1.0)

probInfo = "ISD/Stoch/Hetero"
fig3Table = vcat(fig3Table,TableMaker(ISDprob2,ISDsol2,probInfo))

#--------------Virus (Stoch, hetero)--------------
Virprob2 = ModelSetup(:Virus, :Stochastic, :Hetero)
Virsol2 = @time solve(Virprob2, CVODE_BDF(linear_solver = :GMRES), saveat = 1.0,callback = cb)

probInfo = "Virus/Stoch/Hetero"
fig3Table = vcat(fig3Table,TableMaker(Virprob2,Virsol2,probInfo))

@rput fig3Table
R"""
library(tidyverse)
library(ggpubr)
library(scales)

df_tidy <- fig3Table %>%
  pivot_longer(c(DNA,IFNb,IRF7,TREX1),names_to = "SpeciesNames",values_to = "SpeciesValues") %>%
  group_by(ModelType,CellType,SpeciesNames,Time) %>%
  summarise(AveState = mean(SpeciesValues),
            q05 = quantile(SpeciesValues,0.05),
            q95 = quantile(SpeciesValues,0.95))

CustomPlotter <- function(dfIN,typeIn, nameIn){

  df <- dfIN %>%
    filter(ModelType == typeIn,SpeciesNames == nameIn)

  p <- ggplot(df, aes(x=Time, y=AveState)) +
      geom_line(aes(x=Time, y=AveState, color=CellType)) +
      geom_ribbon(aes(ymin=q05, ymax=q95, fill=CellType),alpha=0.3) +
      scale_x_continuous(breaks=seq(0, 48, 12)) +
      ggtitle(nameIn) +
      xlab("Time (hours)") +
      ylab("nM") +
      theme_pubr(border=TRUE) +
      theme(plot.title = element_text(hjust = 0.5),aspect.ratio = 1)

return(p)
}

# I know facet exists but it wasn't working how I wanted...

p1 <- CustomPlotter(df_tidy,"ISD/Det/Homo", "DNA")
p2 <- CustomPlotter(df_tidy,"ISD/Det/Homo", "IFNb")
p3 <- CustomPlotter(df_tidy,"ISD/Det/Homo", "IRF7")
p4 <- CustomPlotter(df_tidy,"ISD/Det/Homo", "TREX1")

p5 <- CustomPlotter(df_tidy,"Virus/Det/Homo", "DNA")
p6 <- CustomPlotter(df_tidy,"Virus/Det/Homo", "IFNb")
p7 <- CustomPlotter(df_tidy,"Virus/Det/Homo", "IRF7")
p8 <- CustomPlotter(df_tidy,"Virus/Det/Homo", "TREX1")

p9 <- CustomPlotter(df_tidy,"ISD/Stoch/Hetero", "DNA")
p10 <- CustomPlotter(df_tidy,"ISD/Stoch/Hetero", "IFNb")
p11 <- CustomPlotter(df_tidy,"ISD/Stoch/Hetero", "IRF7")
p12 <- CustomPlotter(df_tidy,"ISD/Stoch/Hetero", "TREX1")

p13 <- CustomPlotter(df_tidy,"Virus/Stoch/Hetero", "DNA")
p14 <- CustomPlotter(df_tidy,"Virus/Stoch/Hetero", "IFNb")
p15 <- CustomPlotter(df_tidy,"Virus/Stoch/Hetero", "IRF7")
p16 <- CustomPlotter(df_tidy,"Virus/Stoch/Hetero", "TREX1")

figure <- ggarrange(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,
                    labels = "AUTO",
                    common.legend = TRUE, legend = "right",
                    align = "hv",
                    ncol = 4, nrow = 4)

ggsave("Figures/testF3.pdf",width = 12,height=9,units="in")
"""


text:
"""
Create a 1Q GST sequence for a csv file of single qubit Clifford numbers

create_1Q_GST_seqs(file, q; Id_length=50e-9, num_cals=500)

file	 : path to csv file
q		 : name of qubit in scope
Id_length : length of the Id pulse in seconds
num_cals	 : number of calibration sequences for 0 and 1

"""
function create_1Q_GST_seqs(file, q; Id_length=50e-9, num_cals=500)

	# create pulses once in a library
	m = MEAS(q)
	pulse_lib = [DiAC(q,x) for x in 1:24]
	insert!(pulse_lib, 1, QGL.PulseBlock(Id(q,Id_length)))

	seqs = Vector{Vector{QGL.SequenceEntry}}()
	f = open(file, "r")
	for ln in eachline(f)
		# convert from string to Int and 0-indexed to 1-indexed
		pulse_nums = map(x -> parse(Int, x) + 1, split(ln, ','))
		seq = Vector{QGL.SequenceEntry}(length(pulse_nums) + 1)
		map!(x -> pulse_lib[x], seq, pulse_nums)
		seq[end] = m
		push!(seqs, seq)
	end
	cals = cal_seqs((q,),num_repeats=nuCals)
	seqs = vcat(seqs, cals)
	return seqs
end


text:
# Dimensionality Reduction transformers.
module DimensionalityReductionWrapper

importall Orchestra.Types
importall Orchestra.Util
import DimensionalityReduction: pca

export PCA,
       fit!,
       transform!

# Principal Component Analysis rotation
# on features.
# Features ordered by maximal variance descending.
#
# Fails if zero-variance feature exists.
type PCA <: Transformer
  model
  options

  function PCA(options=Dict())
    default_options = {
      :center => true,
      :scale => true
    }
    new(nothing, nested_dict_merge(default_options, options))
  end
end

function fit!(p::PCA, instances::Matrix, labels::Vector)
  pca_model = pca(instances; p.options...)
  p.model = pca_model
end

function transform!(p::PCA, instances::Matrix)
  return instances * p.model.rotation
end

end # module


text:
"""
xlogx(x)

Return `x * log(x)` for `x ≥ 0`, handling `x = 0` by taking the downward limit.
"""
function xlogx(x)
  result = x * log(x)
  ifelse(iszero(x), zero(result), result)
end

CUDA.@cufunc function xlogx(x)
  result = x * log(x)
  ifelse(iszero(x), zero(result), result)
end

"""
xlogy(x, y)

Return `x * log(y)` for `y > 0` with correct limit at `x = 0`.
"""
function xlogy(x, y)
  result = x * log(y)
  ifelse(iszero(x), zero(result), result)
end

CUDA.@cufunc function xlogy(x, y)
  result = x * log(y)
  ifelse(iszero(x), zero(result), result)
end

@adjoint function broadcasted(::typeof(xlogy), x::Zygote.Numeric, y::Zygote.Numeric)
  res = xlogy.(x, y)
  res, Δ -> (nothing, Zygote.unbroadcast(x, xlogy.(Δ, y)), Zygote.unbroadcast(y, Δ .* x ./ y))
end


text:
# example from "Whos's #1", Langville and Meyer
#   p. 25
# example given as a matrix that must be converted to "scores"
using DataFrames
using CSV

file = "small_netflix_eg.txt"
df = CSV.read(file; comment="#")

competitions = DataFrame( A=[], B=[], Fa=[], Fb=[], O=[], Sa=[], Sb=[] )
for i=1:size(df,1)
    ranks = df[i,2:end]
    for j=1:length(ranks)-1
        for k=j+1:length(ranks)
            if ranks[j]>0 && ranks[k]>0
                push!( competitions, ["M$j", "M$k", 0, 0, sign(ranks[j]-ranks[k]), ranks[j], ranks[k] ] )
            end
        end
    end
end

names!( competitions,  Symbol.(["Player A","Player B","Factor A","Factor B","Outcome","Score A","Score B"]) )
outfile = "small_netflix_eg.csv"
CSV.write(outfile, competitions)


text:
# axis.jl

using MIRTjim: jim
using AxisArrays
using Unitful: μm
using Test: @testset

include("isplot.jl")

@testset "axis" begin
    x = (1:7)μm
    y = (1:4)μm
    z = AxisArray(ones(7) * (1:4)'; x=x, y=y)

    p = jim(z, "AxisArray")
    @isplot p
end


text:
const m128i = VecElement{Int128}
struct TinyIntVec
    data::Vector{Vector{m128i}}
    b::Vector{UInt8}
    n::Int64
    offset::Vector{UInt32}
end

# Overloaded function for getindex
function getindex(tinyx::TinyIntVec, i::Integer)
    @boundscheck (i <= tinyx.n && i > 0) || throw(BoundsError(i))
    chunk = i2chunk(i)
    ccall(simdselectFOR, UInt32, (UInt32, Ptr{m128i}, UInt32, Int32), tinyx.offset[chunk], pointer(tinyx.data[chunk]), tinyx.b[chunk], i2chunk_i(i))
end

# Overloaded function for length
length(tinyx::TinyIntVec) = tinyx.n


text:
function plotTrajectory(u_hat::Vector{Vector{Float64}}, o_hat::Vector{Vector{Float64}})
    ϕ = [o_hat_k[1] for o_hat_k in o_hat]
    x = [o_hat_k[2] for o_hat_k in o_hat]
    y = [o_hat_k[3] for o_hat_k in o_hat]

    Δϕ = [u_hat_k[1] for u_hat_k in u_hat]
    r  = [u_hat_k[2] for u_hat_k in u_hat]

    plot(x, y, color="black", marker="o", linewidth=2, alpha=0.8) # Observed locations
    for t=1:N
        arrow(x[t], y[t], 0.1*cos(ϕ[t]), 0.1*sin(ϕ[t]), color="green", width=0.02, head_width=0.1, alpha=0.8, zorder=1) # Observed orientation
    end

    ϕ_min = [ϕ_0; ϕ[1:end-1]]
    Δx = r.*cos.(ϕ_min + Δϕ)
    Δy = r.*sin.(ϕ_min + Δϕ)

    for t=2:N
        arrow(x[t-1], y[t-1], Δx[t], Δy[t], color="red", width=0.02, head_width=0.1, alpha=0.8, zorder=0) # Proposed movement
    end

    scatter(0.0, 0.0, marker="*", color="orange", s=50)

    axis("square")
    grid("on")
    xlabel("x")
    ylabel("y")
end

"""
To find the index of the slide message in the schedule:
schedule = sumProductSchedule(u[2])
slide_msg_idx = findMessageIndex(schedule, :equ_s_1_1, 3)
"""
function findMessageIndex(schedule::Schedule, node_id::Symbol, outbound_interface_id::Union{Int64, Symbol})
    condensed_schedule = ForneyLab.condense(ForneyLab.flatten(schedule))
    for (idx, entry) in enumerate(condensed_schedule)
        node = entry.interface.node
        if (node.id == node_id) && (entry.interface == node.i[outbound_interface_id])
            return idx
        end
    end

    error("Message $node_id[$outbound_interface_id] could not be found in schedule")
end

function inspectSnippet(algo::String)
    println(algo[8:625])
    println("\n...\n")
    println(algo[end-89:end-13])
end

max_stars_repo_name: Yikeru/BMLIP

max_issues_repo_name: Yikeru/BMLIP

max_forks_repo_name: Yikeru/BMLIP


text:
# Julia wrapper for header: /Users/gnimuc/Codes/BKMaxflow.jl/deps/usr/include/bk.h
# Automatically generated using Clang.jl wrap_c, version 0.0.0

function bk_error_message(error)
    ccall((:bk_error_message, libbkmaxflow), Cstring, (bk_error,), error)
end

function bk_error_release(error)
    ccall((:bk_error_release, libbkmaxflow), Cvoid, (bk_error,), error)
end

function bk_create_graph_int(node_num_max, edge_num_max, error)
    ccall((:bk_create_graph_int, libbkmaxflow), bk_graph_int, (Cint, Cint, Ptr{bk_error}), node_num_max, edge_num_max, error)
end

function bk_create_graph_short(node_num_max, edge_num_max, error)
    ccall((:bk_create_graph_short, libbkmaxflow), bk_graph_short, (Cint, Cint, Ptr{bk_error}), node_num_max, edge_num_max, error)
end

function bk_create_graph_float(node_num_max, edge_num_max, error)
    ccall((:bk_create_graph_float, libbkmaxflow), bk_graph_float, (Cint, Cint, Ptr{bk_error}), node_num_max, edge_num_max, error)
end

function bk_create_graph_double(node_num_max, edge_num_max, error)
    ccall((:bk_create_graph_double, libbkmaxflow), bk_graph_double, (Cint, Cint, Ptr{bk_error}), node_num_max, edge_num_max, error)
end

function bk_delete_graph_int(g)
    ccall((:bk_delete_graph_int, libbkmaxflow), Cvoid, (bk_graph_int,), g)
end

function bk_delete_graph_short(g)
    ccall((:bk_delete_graph_short, libbkmaxflow), Cvoid, (bk_graph_short,), g)
end

function bk_delete_graph_float(g)
    ccall((:bk_delete_graph_float, libbkmaxflow), Cvoid, (bk_graph_float,), g)
end

function bk_delete_graph_double(g)
    ccall((:bk_delete_graph_double, libbkmaxflow), Cvoid, (bk_graph_double,), g)
end

function bk_add_node_int(g, num, error)
    ccall((:bk_add_node_int, libbkmaxflow), Cint, (bk_graph_int, Cint, Ptr{bk_error}), g, num, error)
end

function bk_add_node_short(g, num, error)
    ccall((:bk_add_node_short, libbkmaxflow), Cint, (bk_graph_short, Cint, Ptr{bk_error}), g, num, error)
end

function bk_add_node_float(g, num, error)
    ccall((:bk_add_node_float, libbkmaxflow), Cint, (bk_graph_float, Cint, Ptr{bk_error}), g, num, error)
end

function bk_add_node_double(g, num, error)
    ccall((:bk_add_node_double, libbkmaxflow), Cint, (bk_graph_double, Cint, Ptr{bk_error}), g, num, error)
end

function bk_add_tweights_int(g, id, cap_source, cap_sink, error)
    ccall((:bk_add_tweights_int, libbkmaxflow), Cvoid, (bk_graph_int, Cint, Cint, Cint, Ptr{bk_error}), g, id, cap_source, cap_sink, error)
end

function bk_add_tweights_short(g, id, cap_source, cap_sink, error)
    ccall((:bk_add_tweights_short, libbkmaxflow), Cvoid, (bk_graph_short, Cint, Cint, Cint, Ptr{bk_error}), g, id, cap_source, cap_sink, error)
end

function bk_add_tweights_float(g, id, cap_source, cap_sink, error)
    ccall((:bk_add_tweights_float, libbkmaxflow), Cvoid, (bk_graph_float, Cint, Cfloat, Cfloat, Ptr{bk_error}), g, id, cap_source, cap_sink, error)
end

function bk_add_tweights_double(g, id, cap_source, cap_sink, error)
    ccall((:bk_add_tweights_double, libbkmaxflow), Cvoid, (bk_graph_double, Cint, Cdouble, Cdouble, Ptr{bk_error}), g, id, cap_source, cap_sink, error)
end

function bk_add_edge_int(g, i, j, cap, rev_cap, error)
    ccall((:bk_add_edge_int, libbkmaxflow), Cvoid, (bk_graph_int, Cint, Cint, Cint, Cint, Ptr{bk_error}), g, i, j, cap, rev_cap, error)
end

function bk_add_edge_short(g, i, j, cap, rev_cap, error)
    ccall((:bk_add_edge_short, libbkmaxflow), Cvoid, (bk_graph_short, Cint, Cint, Int16, Int16, Ptr{bk_error}), g, i, j, cap, rev_cap, error)
end

function bk_add_edge_float(g, i, j, cap, rev_cap, error)
    ccall((:bk_add_edge_float, libbkmaxflow), Cvoid, (bk_graph_float, Cint, Cint, Cfloat, Cfloat, Ptr{bk_error}), g, i, j, cap, rev_cap, error)
end

function bk_add_edge_double(g, i, j, cap, rev_cap, error)
    ccall((:bk_add_edge_double, libbkmaxflow), Cvoid, (bk_graph_double, Cint, Cint, Cdouble, Cdouble, Ptr{bk_error}), g, i, j, cap, rev_cap, error)
end

function bk_maxflow_int(g, reuse_trees, error)
    ccall((:bk_maxflow_int, libbkmaxflow), Cint, (bk_graph_int, Cint, Ptr{bk_error}), g, reuse_trees, error)
end

function bk_maxflow_short(g, reuse_trees, error)
    ccall((:bk_maxflow_short, libbkmaxflow), Cint, (bk_graph_short, Cint, Ptr{bk_error}), g, reuse_trees, error)
end

function bk_maxflow_float(g, reuse_trees, error)
    ccall((:bk_maxflow_float, libbkmaxflow), Cfloat, (bk_graph_float, Cint, Ptr{bk_error}), g, reuse_trees, error)
end

function bk_maxflow_double(g, reuse_trees, error)
    ccall((:bk_maxflow_double, libbkmaxflow), Cdouble, (bk_graph_double, Cint, Ptr{bk_error}), g, reuse_trees, error)
end

function bk_what_segment_int(g, i, error)
    ccall((:bk_what_segment_int, libbkmaxflow), bk_termtype, (bk_graph_int, Cint, Ptr{bk_error}), g, i, error)
end

function bk_what_segment_short(g, i, error)
    ccall((:bk_what_segment_short, libbkmaxflow), bk_termtype, (bk_graph_short, Cint, Ptr{bk_error}), g, i, error)
end

function bk_what_segment_float(g, i, error)
    ccall((:bk_what_segment_float, libbkmaxflow), bk_termtype, (bk_graph_float, Cint, Ptr{bk_error}), g, i, error)
end

function bk_what_segment_double(g, i, error)
    ccall((:bk_what_segment_double, libbkmaxflow), bk_termtype, (bk_graph_double, Cint, Ptr{bk_error}), g, i, error)
end

max_stars_repo_name: Gnimuc/BKmaxflow

max_issues_repo_name: Gnimuc/BKmaxflow

max_forks_repo_name: Gnimuc/BKmaxflow


text:
function _load_embeddings_csv(embedding_file, max_vocab_size, keep_words, delim::AbstractChar=',')
    local LL, indexed_words, index
    if length(keep_words) > 0
        max_vocab_size = length(keep_words)
    end
    indexed_words = Vector{String}()
    LL = Vector{Vector{Float32}}()
    open(embedding_file) do f
        index = 1
        for line in eachline(f)
            xs = split(line, delim)
            word = xs[1]
            if length(keep_words) == 0 || (word in keep_words)
                index > max_vocab_size && break
                push!(indexed_words, word)
                try
                    push!(LL, parse.(Float32, @view(xs[2:end])))
                catch err
                    err isa ArgumentError || rethrow()
                    @warn "Could not parse word vector" index word exception=err
                end
                index += 1
            end
        end
    end
    return reduce(hcat, LL), indexed_words
end


text:
 #Duffing Oscillator
 #Controller: RFPT (SISO)
 #using FPTControl toolbox

using FPTControl

Adaptive=1
LONG=Int(1e4)
δt=1e-3

#Kinematic Parameter
Λ=3

#Nominal Trajectory
ω=5
Ampl=0.4

#Controller Parameters
K=1e5
B=-1
A=1e-5

# Exact model parameters
αₑ=1
δₑ=0.2
βₑ=1

# Approx model parameters
αₐ=0.8
δₐ=0.1
βₐ=0.9

###############
# Exact Model #
###############

function exact(q,q_p,u)
  out=αₑ*q+δₑ*q_p+βₑ*q^3+u
  return out #q_pp
end

################
# Approx Model #
################

function approx(q,q_p,q_pp)
  out=q_pp#-αₐ*q-δₐ*q_p-βₐ*q^3
  return out #u
end

######################################
# Arrays for Plotting and simulation #
######################################

qN=zeros(LONG)
qN_p=zeros(LONG)
qN_pp=zeros(LONG)

qDes_pp=zeros(LONG)

qDef_pp=zeros(LONG)
u=zeros(LONG)

q=zeros(LONG)
q_p=zeros(LONG)
q_pp=zeros(LONG)

t=zeros(LONG)

error_int=0
past_input=0
past_response=0

for i=1:LONG-1
  t[i]=i*δt
  #Nominal trajectory
  qN[i]=Ampl*sin(ω*t[i])#sin(ω*time_mem[t])
  qN_p[i]=ω*Ampl*cos(ω*t[i])
  qN_pp[i]=-ω^2*Ampl*sin(ω*t[i])
  #Kinematic Block

  qDes_pp[i]=Λ^3*error_int+3*Λ^2*(qN[i]-q[i])+3*Λ*(qN_p[i]-q_p[i])+qN_pp[i]
  qDes_pp[i]
  # Deformation
  if Adaptive==1 && i>10
    qDef_pp[i]=G_SISO(past_input,past_response,qDes_pp[i],K,B,A)
  #  println(qDef_pp[i])
  else
    qDef_pp[i]=qDes_pp[i]
  end
  #Approx model
  u[i]=approx(q[i],q_p[i],qDef_pp[i])
  #u=qDef_pp_mem[t]
  past_input=qDef_pp[i]
  #Exact model
  q_pp[i]=exact(q[i],q_p[i],u[i])
  past_response=q_pp[i]
  #Integrals
  #q_p[i+1]=q_p[i]+δt*q_pp[i]
   q_p[i+1]=Integ(q_p[i],δt,q_pp[i])
  #q[i+1]=q[i]+δt*q_p[i]
  q[i+1]=Integ(q[i],δt,q_p[i])
  error_int=Integ(error_int,δt,qN[i]-q[i])
  #error_int=error_int+δt*(qN[i]-q[i])
end #for (simulation)

using PyPlot

figure(1)
title("Tracking error")
plot(t[3:LONG-1],qN[3:LONG-1]-q[3:LONG-1])
grid("on")
xlabel("Time [s]")
ylabel("error [m]")
#xlabel(L"\frac{x}{y}")   ##(L"") latex-es felirathoz

figure(2)
title("Nominal and Simulated")
plot(t[3:LONG-1],qN[3:LONG-1],color="red")
plot(t[3:LONG-1],q[3:LONG-1],color="green","r--")
grid("on")
xlabel("Time [s]")
ylabel("q [m]")

max_stars_repo_path: examples/RFPT_SISO/Duffing Oscillator with FPTControl Toolbox/duffing_FPTControl.jl

max_stars_repo_name: krisztiankosi/Control

max_issues_repo_name: krisztiankosi/Control

max_forks_repo_name: krisztiankosi/Control


text:
function show(io::IO, x::DoubleFloat{T}) where {T<:IEEEFloat}
    compact = get(io, :compact, true)
    if compact
        str = string(x.hi)
    else
        str = string(x)
    end
    print(io, str)
end

function show(io::IO, x::Complex{DoubleFloat{T}}) where {T<:IEEEFloat}
    re, im = reim(x)
    imstr = isfinite(im) ? "im" : "*im"
    compact = get(io, :compact, true)
    if compact
        str = string(HI(re), (signbit(x.im.hi) ? " - " : " + "), abs(HI(im)), imstr)
    else
        str = string(re, (signbit(HI(im)) ? " - " : " + "), abs(im), imstr)
    end
    print(io, str)
end

show(x::DoubleFloat{T}) where {T<:IEEEFloat} = show(Base.stdout, x)

show(x::Complex{DoubleFloat{T}}) where {T<:IEEEFloat} = show(Base.stdout, x)

function showtyped(io::IO, x::DoubleFloat{T}) where {T<:IEEEFloat}
    str = stringtyped(x)
    print(io, str)
end

function showtyped(io::IO, x::Complex{DoubleFloat{T}}) where {T<:IEEEFloat}
    str = stringtyped(x)
    print(io, str)
end

showtyped(x::DoubleFloat{T}) where {T<:IEEEFloat} = showtyped(Base.stdout, x)

showtyped(x::Complex{DoubleFloat{T}}) where {T<:IEEEFloat} = showtyped(Base.stdout, x)

showall(x::DoubleFloat{T}) where {T<:IEEEFloat} = print(Base.stdout, string(x))

showall(x::Complex{DoubleFloat{T}}) where {T<:IEEEFloat} = print(Base.stdout, string(x))