code string | signature string | docstring string | loss_without_docstring float64 | loss_with_docstring float64 | factor float64 |
|---|---|---|---|---|---|
ct = 'application/x-www-form-urlencoded; charset=UTF-8'
headers = {'Content-Type': ct}
params = params or {}
params['Action'] = action
for k, v in params.items():
if isinstance(v, unicode): # UTF-8 encode only if it's Unicode
params[k] = v.e... | def _make_request(self, action, params=None) | Make a call to the SES API.
:type action: string
:param action: The API method to use (e.g. SendRawEmail)
:type params: dict
:param params: Parameters that will be sent as POST data with the API
call. | 3.924979 | 3.98272 | 0.985502 |
boto.log.error('%s %s' % (response.status, response.reason))
boto.log.error('%s' % body)
if "Address blacklisted." in body:
# Delivery failures happened frequently enough with the recipient's
# email address for Amazon to blacklist it. After a day or three,
... | def _handle_error(self, response, body) | Handle raising the correct exception, depending on the error. Many
errors share the same HTTP response code, meaning we have to get really
kludgey and do string searches to figure out what went wrong. | 4.650827 | 4.582093 | 1.015001 |
format = format.lower().strip()
if body is not None:
if format == "text":
if text_body is not None:
raise Warning("You've passed in both a body and a text_body; please choose one or the other.")
text_body = body
else:
... | def send_email(self, source, subject, body, to_addresses, cc_addresses=None,
bcc_addresses=None, format='text', reply_addresses=None,
return_path=None, text_body=None, html_body=None) | Composes an email message based on input data, and then immediately
queues the message for sending.
:type source: string
:param source: The sender's email address.
:type subject: string
:param subject: The subject of the message: A short summary of the
c... | 1.918004 | 2.040692 | 0.939879 |
params = {
'RawMessage.Data': base64.b64encode(raw_message),
}
if source:
params['Source'] = source
if destinations:
self._build_list_params(params, destinations,
'Destinations.member')
return self... | def send_raw_email(self, raw_message, source=None, destinations=None) | Sends an email message, with header and content specified by the
client. The SendRawEmail action is useful for sending multipart MIME
emails, with attachments or inline content. The raw text of the message
must comply with Internet email standards; otherwise, the message
cannot be sent.
... | 2.234647 | 2.701129 | 0.827301 |
for item_name in self.item_names:
item = self.conn.get_attributes(self.domain_name, item_name)
self.items.append(item) | def run(self) | Start the threaded retrieval of items. Populates the
``items`` list with :class:`Item <boto.sdb.item.Item>` objects. | 5.260264 | 2.764826 | 1.902566 |
print 'Total Usage: %f compute seconds' % self.box_usage
cost = self.box_usage * 0.14
print 'Approximate Cost: $%f' % cost | def print_usage(self) | Print the BoxUsage and approximate costs of all requests made on
this specific SDBConnection instance.
.. tip:: This can be out of date, and should only be treated as a
rough estimate. Also note that this estimate only applies to the
requests made on this specific connec... | 11.009727 | 7.269357 | 1.514539 |
domain = Domain(self, domain_name)
if validate:
self.select(domain, % domain_name)
return domain | def get_domain(self, domain_name, validate=True) | Retrieves a :py:class:`boto.sdb.domain.Domain` object whose name
matches ``domain_name``.
:param str domain_name: The name of the domain to retrieve
:keyword bool validate: When ``True``, check to see if the domain
actually exists. If ``False``, blindly return a
... | 8.183816 | 20.330948 | 0.40253 |
try:
domain = self.get_domain(domain_name, validate)
except:
domain = None
return domain | def lookup(self, domain_name, validate=True) | Lookup an existing SimpleDB domain. This differs from
:py:meth:`get_domain` in that ``None`` is returned if ``validate`` is
``True`` and no match was found (instead of raising an exception).
:param str domain_name: The name of the domain to retrieve
:param bool validate: If ``... | 3.313331 | 3.333409 | 0.993977 |
params = {}
if max_domains:
params['MaxNumberOfDomains'] = max_domains
if next_token:
params['NextToken'] = next_token
return self.get_list('ListDomains', params, [('DomainName', Domain)]) | def get_all_domains(self, max_domains=None, next_token=None) | Returns a :py:class:`boto.resultset.ResultSet` containing
all :py:class:`boto.sdb.domain.Domain` objects associated with
this connection's Access Key ID.
:keyword int max_domains: Limit the returned
:py:class:`ResultSet <boto.resultset.ResultSet>` to the specified
... | 2.605132 | 2.838629 | 0.917743 |
params = {'DomainName':domain_name}
d = self.get_object('CreateDomain', params, Domain)
d.name = domain_name
return d | def create_domain(self, domain_name) | Create a SimpleDB domain.
:type domain_name: string
:param domain_name: The name of the new domain
:rtype: :class:`boto.sdb.domain.Domain` object
:return: The newly created domain | 4.314002 | 5.104445 | 0.845146 |
if (isinstance(domain_or_name, Domain)):
return (domain_or_name, domain_or_name.name)
else:
return (self.get_domain(domain_or_name), domain_or_name) | def get_domain_and_name(self, domain_or_name) | Given a ``str`` or :class:`boto.sdb.domain.Domain`, return a
``tuple`` with the following members (in order):
* In instance of :class:`boto.sdb.domain.Domain` for the requested
domain
* The domain's name as a ``str``
:type domain_or_name: ``str... | 1.970759 | 2.034829 | 0.968513 |
domain, domain_name = self.get_domain_and_name(domain_or_name)
params = {'DomainName':domain_name}
return self.get_status('DeleteDomain', params) | def delete_domain(self, domain_or_name) | Delete a SimpleDB domain.
.. caution:: This will delete the domain and all items within the domain.
:type domain_or_name: string or :class:`boto.sdb.domain.Domain` object.
:param domain_or_name: Either the name of a domain or a Domain object
:rtype: bool
:return: True if succe... | 3.073881 | 3.632428 | 0.846233 |
domain, domain_name = self.get_domain_and_name(domain_or_name)
params = {'DomainName':domain_name}
d = self.get_object('DomainMetadata', params, DomainMetaData)
d.domain = domain
return d | def domain_metadata(self, domain_or_name) | Get the Metadata for a SimpleDB domain.
:type domain_or_name: string or :class:`boto.sdb.domain.Domain` object.
:param domain_or_name: Either the name of a domain or a Domain object
:rtype: :class:`boto.sdb.domain.DomainMetaData` object
:return: The newly created domain metadata object | 3.736315 | 3.698778 | 1.010148 |
domain, domain_name = self.get_domain_and_name(domain_or_name)
params = {'DomainName' : domain_name}
self._build_batch_list(params, items, replace)
return self.get_status('BatchPutAttributes', params, verb='POST') | def batch_put_attributes(self, domain_or_name, items, replace=True) | Store attributes for multiple items in a domain.
:type domain_or_name: string or :class:`boto.sdb.domain.Domain` object.
:param domain_or_name: Either the name of a domain or a Domain object
:type items: dict or dict-like object
:param items: A dictionary-like object. The keys... | 3.324076 | 4.067096 | 0.817309 |
domain, domain_name = self.get_domain_and_name(domain_or_name)
params = {'DomainName' : domain_name,
'ItemName' : item_name}
if consistent_read:
params['ConsistentRead'] = 'true'
if attribute_names:
if not isinstance(attribute_names, lis... | def get_attributes(self, domain_or_name, item_name, attribute_names=None,
consistent_read=False, item=None) | Retrieve attributes for a given item in a domain.
:type domain_or_name: string or :class:`boto.sdb.domain.Domain` object.
:param domain_or_name: Either the name of a domain or a Domain object
:type item_name: string
:param item_name: The name of the item whose attributes are
... | 2.008281 | 1.968566 | 1.020174 |
domain, domain_name = self.get_domain_and_name(domain_or_name)
params = {'DomainName':domain_name,
'ItemName' : item_name}
if attr_names:
if isinstance(attr_names, list):
self._build_name_list(params, attr_names)
elif isinstance(... | def delete_attributes(self, domain_or_name, item_name, attr_names=None,
expected_value=None) | Delete attributes from a given item in a domain.
:type domain_or_name: string or :class:`boto.sdb.domain.Domain` object.
:param domain_or_name: Either the name of a domain or a Domain object
:type item_name: string
:param item_name: The name of the item whose attributes are being
... | 2.454265 | 2.429938 | 1.010011 |
domain, domain_name = self.get_domain_and_name(domain_or_name)
params = {'DomainName' : domain_name}
self._build_batch_list(params, items, False)
return self.get_status('BatchDeleteAttributes', params, verb='POST') | def batch_delete_attributes(self, domain_or_name, items) | Delete multiple items in a domain.
:type domain_or_name: string or :class:`boto.sdb.domain.Domain` object.
:param domain_or_name: Either the name of a domain or a Domain object
:type items: dict or dict-like object
:param items: A dictionary-like object. The keys of the dictio... | 3.771091 | 4.415382 | 0.85408 |
domain, domain_name = self.get_domain_and_name(domain_or_name)
params = {'SelectExpression' : query}
if consistent_read:
params['ConsistentRead'] = 'true'
if next_token:
params['NextToken'] = next_token
try:
return self.get_list('Selec... | def select(self, domain_or_name, query='', next_token=None,
consistent_read=False) | Returns a set of Attributes for item names within domain_name that
match the query. The query must be expressed in using the SELECT
style syntax rather than the original SimpleDB query language.
Even though the select request does not require a domain object,
a domain object must be pas... | 3.022814 | 2.998744 | 1.008027 |
"Note: partial implementation, just enough for the FeatureTracker"
parent_path = os.path.dirname(relpattern)
file_pattern = os.path.basename(relpattern)
parent = self._resolve_path(parent_path)
if parent is None:
return []
else:
r... | def list(self, relpattern) | Note: partial implementation, just enough for the FeatureTracker | 5.796309 | 3.666068 | 1.58107 |
params = {}
if vpc_ids:
self.build_list_params(params, vpc_ids, 'VpcId')
if filters:
i = 1
for filter in filters:
params[('Filter.%d.Name' % i)] = filter[0]
params[('Filter.%d.Value.1' % i)] = filter[1]
... | def get_all_vpcs(self, vpc_ids=None, filters=None) | Retrieve information about your VPCs. You can filter results to
return information only about those VPCs that match your search
parameters. Otherwise, all VPCs associated with your account
are returned.
:type vpc_ids: list
:param vpc_ids: A list of strings with the desired VPC... | 2.068512 | 2.074229 | 0.997243 |
params = {}
if route_table_ids:
self.build_list_params(params, route_table_ids, "RouteTableId")
if filters:
self.build_filter_params(params, dict(filters))
return self.get_list('DescribeRouteTables', params, [('item', RouteTable)]) | def get_all_route_tables(self, route_table_ids=None, filters=None) | Retrieve information about your routing tables. You can filter results
to return information only about those route tables that match your
search parameters. Otherwise, all route tables associated with your
account are returned.
:type route_table_ids: list
:param route_table_ids... | 2.159915 | 2.568101 | 0.841056 |
params = {
'RouteTableId': route_table_id,
'SubnetId': subnet_id
}
result = self.get_object('AssociateRouteTable', params, ResultSet)
return result.associationId | def associate_route_table(self, route_table_id, subnet_id) | Associates a route table with a specific subnet.
:type route_table_id: str
:param route_table_id: The ID of the route table to associate.
:type subnet_id: str
:param subnet_id: The ID of the subnet to associate with.
:rtype: str
:return: The ID of the association creat... | 3.140399 | 4.682598 | 0.670653 |
params = {
'RouteTableId': route_table_id,
'DestinationCidrBlock': destination_cidr_block
}
if gateway_id is not None:
params['GatewayId'] = gateway_id
elif instance_id is not None:
params['InstanceId'] = instance_id
retu... | def create_route(self, route_table_id, destination_cidr_block, gateway_id=None, instance_id=None) | Creates a new route in the route table within a VPC. The route's target
can be either a gateway attached to the VPC or a NAT instance in the
VPC.
:type route_table_id: str
:param route_table_id: The ID of the route table for the route.
:type destination_cidr_block: str
... | 1.545743 | 2.016407 | 0.766583 |
params = {
'RouteTableId': route_table_id,
'DestinationCidrBlock': destination_cidr_block
}
return self.get_status('DeleteRoute', params) | def delete_route(self, route_table_id, destination_cidr_block) | Deletes a route from a route table within a VPC.
:type route_table_id: str
:param route_table_id: The ID of the route table with the route.
:type destination_cidr_block: str
:param destination_cidr_block: The CIDR address block used for
destinatio... | 1.96701 | 3.093247 | 0.635905 |
params = {}
if internet_gateway_ids:
self.build_list_params(params, internet_gateway_ids, 'InternetGatewayId')
if filters:
self.build_filter_params(params, dict(filters))
return self.get_list('DescribeInternetGateways', params, [('item', InternetGateway... | def get_all_internet_gateways(self, internet_gateway_ids=None, filters=None) | Get a list of internet gateways. You can filter results to return information
about only those gateways that you're interested in.
:type internet_gateway_ids: list
:param internet_gateway_ids: A list of strings with the desired gateway IDs.
:type filters: list of tuples
:param ... | 2.170682 | 2.834686 | 0.765757 |
params = {
'InternetGatewayId': internet_gateway_id,
'VpcId': vpc_id
}
return self.get_status('AttachInternetGateway', params) | def attach_internet_gateway(self, internet_gateway_id, vpc_id) | Attach an internet gateway to a specific VPC.
:type internet_gateway_id: str
:param internet_gateway_id: The ID of the internet gateway to delete.
:type vpc_id: str
:param vpc_id: The ID of the VPC to attach to.
:rtype: Bool
:return: True if successful | 2.228682 | 3.2261 | 0.690828 |
params = {
'InternetGatewayId': internet_gateway_id,
'VpcId': vpc_id
}
return self.get_status('DetachInternetGateway', params) | def detach_internet_gateway(self, internet_gateway_id, vpc_id) | Detach an internet gateway from a specific VPC.
:type internet_gateway_id: str
:param internet_gateway_id: The ID of the internet gateway to delete.
:type vpc_id: str
:param vpc_id: The ID of the VPC to attach to.
:rtype: Bool
:return: True if successful | 2.210658 | 3.243934 | 0.681474 |
params = {}
if customer_gateway_ids:
self.build_list_params(params, customer_gateway_ids, 'CustomerGatewayId')
if filters:
i = 1
for filter in filters:
params[('Filter.%d.Name' % i)] = filter[0]
params[('Filter.%d.Value... | def get_all_customer_gateways(self, customer_gateway_ids=None, filters=None) | Retrieve information about your CustomerGateways. You can filter results to
return information only about those CustomerGateways that match your search
parameters. Otherwise, all CustomerGateways associated with your account
are returned.
:type customer_gateway_ids: list
:para... | 2.301646 | 2.36925 | 0.971466 |
params = {'Type' : type,
'IpAddress' : ip_address,
'BgpAsn' : bgp_asn}
return self.get_object('CreateCustomerGateway', params, CustomerGateway) | def create_customer_gateway(self, type, ip_address, bgp_asn) | Create a new Customer Gateway
:type type: str
:param type: Type of VPN Connection. Only valid valid currently is 'ipsec.1'
:type ip_address: str
:param ip_address: Internet-routable IP address for customer's gateway.
Must be a static address.
:type ... | 2.344723 | 2.596166 | 0.903149 |
params = {}
if vpn_gateway_ids:
self.build_list_params(params, vpn_gateway_ids, 'VpnGatewayId')
if filters:
i = 1
for filter in filters:
params[('Filter.%d.Name' % i)] = filter[0]
params[('Filter.%d.Value.1')] = filter[... | def get_all_vpn_gateways(self, vpn_gateway_ids=None, filters=None) | Retrieve information about your VpnGateways. You can filter results to
return information only about those VpnGateways that match your search
parameters. Otherwise, all VpnGateways associated with your account
are returned.
:type vpn_gateway_ids: list
:param vpn_gateway_ids: A... | 2.34604 | 2.302378 | 1.018964 |
params = {'Type' : type}
if availability_zone:
params['AvailabilityZone'] = availability_zone
return self.get_object('CreateVpnGateway', params, VpnGateway) | def create_vpn_gateway(self, type, availability_zone=None) | Create a new Vpn Gateway
:type type: str
:param type: Type of VPN Connection. Only valid valid currently is 'ipsec.1'
:type availability_zone: str
:param availability_zone: The Availability Zone where you want the VPN gateway.
:rtype: The newly created VpnGateway
:ret... | 2.164295 | 2.772978 | 0.780495 |
params = {'VpnGatewayId': vpn_gateway_id,
'VpcId' : vpc_id}
return self.get_object('AttachVpnGateway', params, Attachment) | def attach_vpn_gateway(self, vpn_gateway_id, vpc_id) | Attaches a VPN gateway to a VPC.
:type vpn_gateway_id: str
:param vpn_gateway_id: The ID of the vpn_gateway to attach
:type vpc_id: str
:param vpc_id: The ID of the VPC you want to attach the gateway to.
:rtype: An attachment
:return: a :class:`boto.vpc.vpngateway.Atta... | 2.895114 | 3.013678 | 0.960658 |
params = {}
if subnet_ids:
self.build_list_params(params, subnet_ids, 'SubnetId')
if filters:
i = 1
for filter in filters:
params[('Filter.%d.Name' % i)] = filter[0]
params[('Filter.%d.Value.1' % i)] = filter[1]
... | def get_all_subnets(self, subnet_ids=None, filters=None) | Retrieve information about your Subnets. You can filter results to
return information only about those Subnets that match your search
parameters. Otherwise, all Subnets associated with your account
are returned.
:type subnet_ids: list
:param subnet_ids: A list of strings with ... | 2.120539 | 2.062624 | 1.028078 |
params = {'VpcId' : vpc_id,
'CidrBlock' : cidr_block}
if availability_zone:
params['AvailabilityZone'] = availability_zone
return self.get_object('CreateSubnet', params, Subnet) | def create_subnet(self, vpc_id, cidr_block, availability_zone=None) | Create a new Subnet
:type vpc_id: str
:param vpc_id: The ID of the VPC where you want to create the subnet.
:type cidr_block: str
:param cidr_block: The CIDR block you want the subnet to cover.
:type availability_zone: str
:param availability_zone: The AZ you want the ... | 1.833033 | 2.283933 | 0.802577 |
params = {}
if dhcp_options_ids:
self.build_list_params(params, dhcp_options_ids, 'DhcpOptionsId')
return self.get_list('DescribeDhcpOptions', params, [('item', DhcpOptions)]) | def get_all_dhcp_options(self, dhcp_options_ids=None) | Retrieve information about your DhcpOptions.
:type dhcp_options_ids: list
:param dhcp_options_ids: A list of strings with the desired DhcpOption ID's
:rtype: list
:return: A list of :class:`boto.vpc.dhcpoptions.DhcpOptions` | 2.17963 | 2.343023 | 0.930264 |
params = {'VpcId' : vpc_id,
'CidrBlock' : cidr_block}
if availability_zone:
params['AvailabilityZone'] = availability_zone
return self.get_object('CreateDhcpOption', params, DhcpOptions) | def create_dhcp_options(self, vpc_id, cidr_block, availability_zone=None) | Create a new DhcpOption
:type vpc_id: str
:param vpc_id: The ID of the VPC where you want to create the subnet.
:type cidr_block: str
:param cidr_block: The CIDR block you want the subnet to cover.
:type availability_zone: str
:param availability_zone: The AZ you want ... | 2.300398 | 2.47767 | 0.928452 |
params = {'DhcpOptionsId': dhcp_options_id,
'VpcId' : vpc_id}
return self.get_status('AssociateDhcpOptions', params) | def associate_dhcp_options(self, dhcp_options_id, vpc_id) | Associate a set of Dhcp Options with a VPC.
:type dhcp_options_id: str
:param dhcp_options_id: The ID of the Dhcp Options
:type vpc_id: str
:param vpc_id: The ID of the VPC.
:rtype: bool
:return: True if successful | 2.225168 | 3.254062 | 0.683812 |
params = {}
if vpn_connection_ids:
self.build_list_params(params, vpn_connection_ids, 'Vpn_ConnectionId')
if filters:
i = 1
for filter in filters:
params[('Filter.%d.Name' % i)] = filter[0]
params[('Filter.%d.Value.1')]... | def get_all_vpn_connections(self, vpn_connection_ids=None, filters=None) | Retrieve information about your VPN_CONNECTIONs. You can filter results to
return information only about those VPN_CONNECTIONs that match your search
parameters. Otherwise, all VPN_CONNECTIONs associated with your account
are returned.
:type vpn_connection_ids: list
:param vpn... | 2.615872 | 2.429297 | 1.076802 |
params = {'Type' : type,
'CustomerGatewayId' : customer_gateway_id,
'VpnGatewayId' : vpn_gateway_id}
return self.get_object('CreateVpnConnection', params, VpnConnection) | def create_vpn_connection(self, type, customer_gateway_id, vpn_gateway_id) | Create a new VPN Connection.
:type type: str
:param type: The type of VPN Connection. Currently only 'ipsec.1'
is supported
:type customer_gateway_id: str
:param customer_gateway_id: The ID of the customer gateway.
:type vpn_gateway_id: str
:param... | 1.867156 | 2.260468 | 0.826004 |
END_TAGS = ('end_fedora_access',
'permission_denied', 'fedora_failed')
blocks = {}
blocks['fedora_access'] = parser.parse(END_TAGS)
token = parser.next_token()
while token.contents != 'end_fedora_access':
# need to convert token.contents manually to a str. django gives... | def do_catch_fedora_errors(parser, token) | Catches fedora errors between ``{% fedora_access %}`` and
``{% end_fedora_access %}``. Template designers may specify
optional ``{% permission_denied %}`` and ``{% fedora_failed %}``
sections with fallback content in case of permission or other errors
while rendering the main block.
Note that when... | 7.014857 | 5.883518 | 1.19229 |
if not position_to_eof:
cur_pos = fp.tell()
fp.seek(0, os.SEEK_END)
cur_file_size = fp.tell()
if not position_to_eof:
fp.seek(cur_pos, os.SEEK_SET)
return cur_file_size | def get_cur_file_size(fp, position_to_eof=False) | Returns size of file, optionally leaving fp positioned at EOF. | 1.691013 | 1.563368 | 1.081647 |
cur_file_size = get_cur_file_size(fp, position_to_eof=True)
if (cur_file_size and
self.etag_value_for_current_download and
self.etag_value_for_current_download == key.etag.strip('"\'')):
# Try to resume existing transfer.
if cur_file_size > key.... | def _attempt_resumable_download(self, key, fp, headers, cb, num_cb,
torrent, version_id) | Attempts a resumable download.
Raises ResumableDownloadException if any problems occur. | 4.822647 | 4.770072 | 1.011022 |
'''Method suitable for use as an etag function with
:class:`django.views.decorators.http.condition`. Takes the same
arguments as :meth:`~eulfedora.views.raw_datastream`.
'''
# if a range is requested and it is not for the entire file,
# do *NOT* return an etag
# NOTE: using api directly he... | def datastream_etag(request, pid, dsid, repo=None,
as_of_date=None, **kwargs) | Method suitable for use as an etag function with
:class:`django.views.decorators.http.condition`. Takes the same
arguments as :meth:`~eulfedora.views.raw_datastream`. | 6.768193 | 4.71384 | 1.435813 |
'''Method suitable for use as a a last-modified function with
:class:`django.views.decorators.http.condition`. Takes basically
the same arguments as :meth:`~eulfedora.views.raw_datastream`.
'''
try:
if repo is None:
repo = Repository()
resp = repo.api.getDatastream(pid, ... | def datastream_lastmodified(request, pid, dsid, repo=None,
as_of_date=None, *args, **kwargs) | Method suitable for use as a a last-modified function with
:class:`django.views.decorators.http.condition`. Takes basically
the same arguments as :meth:`~eulfedora.views.raw_datastream`. | 5.818393 | 2.872267 | 2.025714 |
'''
Access raw datastream content from a Fedora object.
Returns :class:`~django.http.HttpResponse` for HEAD requests,
:class:`~django.http.StreamingHttpResponse` for GET requests. The
headers and status code from Fedora response are set on the
django response; any headers specified in the param... | def raw_datastream(request, pid, dsid, repo=None, headers=None,
as_of_date=None) | Access raw datastream content from a Fedora object.
Returns :class:`~django.http.HttpResponse` for HEAD requests,
:class:`~django.http.StreamingHttpResponse` for GET requests. The
headers and status code from Fedora response are set on the
django response; any headers specified in the parameters will
... | 5.254896 | 1.224733 | 4.290646 |
'''Version of :meth:`raw_datastream` without conditionals, for use
in class-based views or elsewhere.'''
if repo is None:
repo = Repository()
# if a range request is present, pass it through to fedora
rqst_headers = {}
if 'HTTP_RANGE' in request.META:
rqst_headers['RANGE'] = req... | def _raw_datastream(request, pid, dsid, repo=None, headers=None,
as_of_date=None) | Version of :meth:`raw_datastream` without conditionals, for use
in class-based views or elsewhere. | 3.468069 | 3.05303 | 1.135943 |
'''Generator for range-requested datastream content. Iterates over
datastream content in chunks, and yields the chunks (or partial chunks)
that are part of the requested range.'''
if not end or end > ds.info.size:
end = ds.info.size - 1
chunksize = 4096
content_chunks = ds.get_chunked_... | def get_range_content(ds, start, end) | Generator for range-requested datastream content. Iterates over
datastream content in chunks, and yields the chunks (or partial chunks)
that are part of the requested range. | 4.659813 | 3.983789 | 1.169694 |
'''View to display the raw xml audit trail for a Fedora Object.
Returns an :class:`~django.http.HttpResponse` with the response content
populated with the content of the audit trial.
If the object is not found or does not have an audit trail, raises
an :class:`~django.http.Http404` . For any other... | def raw_audit_trail(request, pid, type=None, repo=None) | View to display the raw xml audit trail for a Fedora Object.
Returns an :class:`~django.http.HttpResponse` with the response content
populated with the content of the audit trial.
If the object is not found or does not have an audit trail, raises
an :class:`~django.http.Http404` . For any other errors... | 6.460298 | 2.259381 | 2.859322 |
'''Custom login view. Calls the standard Django authentication,
but on successful login, stores encrypted user credentials in
order to allow accessing the Fedora repository with the
credentials of the currently-logged in user (e.g., when the
application and Fedora share a common authentication syst... | def login_and_store_credentials_in_session(request, *args, **kwargs) | Custom login view. Calls the standard Django authentication,
but on successful login, stores encrypted user credentials in
order to allow accessing the Fedora repository with the
credentials of the currently-logged in user (e.g., when the
application and Fedora share a common authentication system, suc... | 7.279337 | 1.606712 | 4.530579 |
'''Class method to generate an ETag for use with
conditional processing; calls :meth:`datastream_etag` with
class configuration.'''
pid = kwargs[cls.pid_url_kwarg]
date = kwargs.get(cls.as_of_date_url_kwarg, None)
return datastream_etag(
request, pid, cls.data... | def etag(cls, request, *args, **kwargs) | Class method to generate an ETag for use with
conditional processing; calls :meth:`datastream_etag` with
class configuration. | 7.15541 | 3.954853 | 1.809273 |
try:
response = self.request('get', self.profile_url, token=raw_token)
response.raise_for_status()
except RequestException as e:
logger.error('Unable to fetch user profile: {0}'.format(e))
return None
else:
return response.json... | def get_profile_data(self, raw_token) | Fetch user profile information. | 2.942568 | 2.856647 | 1.030078 |
args = self.get_redirect_args(request, callback=callback)
additional = parameters or {}
args.update(additional)
params = urlencode(args)
return '{0}?{1}'.format(self.authorization_url, params) | def get_redirect_url(self, request, callback, parameters=None) | Build authentication redirect url. | 3.586431 | 3.176294 | 1.129124 |
callback = force_text(request.build_absolute_uri(callback))
try:
response = self.request('post', self.request_token_url, oauth_callback=callback)
response.raise_for_status()
except RequestException as e:
logger.error('Unable to fetch request token: {0... | def get_request_token(self, request, callback) | Fetch the OAuth request token. Only required for OAuth 1.0. | 3.275897 | 3.059576 | 1.070703 |
callback = force_text(request.build_absolute_uri(callback))
raw_token = self.get_request_token(request, callback)
token, secret, _ = self.parse_raw_token(raw_token)
if token is not None and secret is not None:
request.session[self.session_key] = raw_token
arg... | def get_redirect_args(self, request, callback) | Get request parameters for redirect url. | 2.749381 | 2.710741 | 1.014254 |
if raw_token is None:
return (None, None, None)
qs = parse_qs(raw_token)
token = qs.get('oauth_token', [None])[0]
token_secret = qs.get('oauth_token_secret', [None])[0]
return (token, token_secret, None) | def parse_raw_token(self, raw_token) | Parse token and secret from raw token response. | 2.155388 | 1.991273 | 1.082417 |
callback = request.build_absolute_uri(callback or request.path)
if not self.check_application_state(request):
logger.error('Application state check failed.')
return None
if 'code' in request.GET:
args = {
'client_id': self.consumer_key... | def get_access_token(self, request, callback=None) | Fetch access token from callback request. | 2.242732 | 2.189255 | 1.024427 |
callback = request.build_absolute_uri(callback)
args = {
'client_id': self.consumer_key,
'redirect_uri': callback,
'response_type': 'code',
}
scope = self.get_scope(request)
if scope:
args['scope'] = self.scope_separator.j... | def get_redirect_args(self, request, callback) | Get request parameters for redirect url. | 2.107158 | 2.03987 | 1.032986 |
if raw_token is None:
return (None, None, None)
# Load as json first then parse as query string
try:
token_data = json.loads(raw_token)
except ValueError:
qs = parse_qs(raw_token)
token = qs.get('access_token', [None])[0]
... | def parse_raw_token(self, raw_token) | Parse token and secret from raw token response. | 1.98836 | 1.959882 | 1.01453 |
user_token = kwargs.pop('token', self.token)
token, secret, expires_at = self.parse_raw_token(user_token)
if token is not None:
params = kwargs.get('params', {})
params['access_token'] = token
kwargs['params'] = params
return super(OAuth2Provi... | def request(self, method, url, **kwargs) | Build remote url request. Constructs necessary auth. | 2.974627 | 3.004274 | 0.990132 |
new_deck = []
if jokers:
new_deck += [Card("Joker", None) for i in xrange(num_jokers)]
new_deck += [Card(value, suit) for value in VALUES for suit in SUITS]
return new_deck | def build_cards(jokers=False, num_jokers=0) | Builds a list containing a full French deck of 52 Card instances. The
cards are sorted according to ``DEFAULT_RANKS``.
.. note:
Adding jokers may break some functions & methods at the moment.
:arg bool jokers:
Whether or not to include jokers in the deck.
:arg int num_jokers:
T... | 2.805529 | 3.199624 | 0.876831 |
ranks = ranks or DEFAULT_RANKS
sorted_cards = sort_cards(cards, ranks)
if cards == sorted_cards or cards[::-1] == sorted_cards:
return True
else:
return False | def check_sorted(cards, ranks=None) | Checks whether the given cards are sorted by the given ranks.
:arg cards:
The cards to check. Can be a ``Stack``, ``Deck``, or ``list`` of
``Card`` isntances.
:arg dict ranks:
The ranks to check against. Default is DEFAULT_RANKS.
:returns:
``True`` or ``False``. | 3.311731 | 4.786731 | 0.691856 |
check_list = [
x.lower() for x in [card.name, card.suit, card.value, card.abbrev,
card.suit[0], card.value[0]]
]
term = term.lower()
for check in check_list:
if check == term:
return True
return False | def check_term(card, term) | Checks a given search term against a given card's full name, suit,
value, and abbreviation.
:arg Card card:
The card to check.
:arg str term:
The search term to check for. Can be a card full name, suit,
value, or abbreviation.
:returns:
``True`` or ``False``. | 4.141606 | 3.779182 | 1.0959 |
if len(cards_x) == len(cards_y):
if not sorted:
cards_x = sort_cards(cards_x, DEFAULT_RANKS)
cards_y = sort_cards(cards_y, DEFAULT_RANKS)
for i, c in enumerate(cards_x):
if c != cards_y[i]:
return False
return True
else:
re... | def compare_stacks(cards_x, cards_y, sorted=False) | Checks whether two given ``Stack``, ``Deck``, or ``list`` instances,
contain the same cards (based on value & suit, not instance). Does not
take into account the ordering.
:arg cards_x:
The first stack to check. Can be a ``Stack``, ``Deck``, or ``list``
instance.
:arg cards_y:
T... | 1.937458 | 2.171628 | 0.892169 |
got_cards = []
try:
indices = find_card(cards, term, limit=limit)
got_cards = [cards[i] for i in indices]
cards = [v for i, v in enumerate(cards) if i not in indices]
except:
got_cards = [cards[term]]
cards = [v for i, v in enumerate(cards) if i is not term]
... | def get_card(cards, term, limit=0, sort=False, ranks=None) | Get the specified card from the stack.
:arg cards:
The cards to get from. Can be a ``Stack``, ``Deck`` or ``list``.
:arg str term:
The card's full name, value, suit, abbreviation, or stack indice.
:arg int limit:
The number of items to retrieve for each term.
:arg bool sort:
... | 2.582789 | 2.684079 | 0.962263 |
filename = filename or "cards-%s.txt" % (time.strftime("%Y%m%d"))
with open(filename, "r") as deck_file:
card_data = [line.rstrip("\n") for line in deck_file.readlines()]
cards = [None] * len(card_data)
for i, card in enumerate(card_data):
card = card.split()
cards[i] = C... | def open_cards(filename=None) | Open cards from a txt file.
:arg str filename:
The filename of the deck file to open. If no filename given,
defaults to "cards-YYYYMMDD.txt", where "YYYYMMDD" is the year, month,
and day. For example, "cards-20140711.txt".
:returns:
The opened cards, as a list. | 2.452681 | 2.749447 | 0.892063 |
if not remove:
return random.choice(cards)
else:
i = random.randrange(len(cards))
card = cards[i]
del cards[i]
return card | def random_card(cards, remove=False) | Returns a random card from the Stack. If ``remove=True``, it will
also remove the card from the deck.
:arg bool remove:
Whether or not to remove the card from the deck.
:returns:
A random Card object, from the Stack. | 2.211238 | 2.899635 | 0.762592 |
filename = filename or "cards-%s.txt" % (time.strftime("%Y%m%d"))
with open(filename, "w") as deck_file:
card_reprs = ["%s %s\n" % (card.value, card.suit) for card in cards]
card_reprs[-1] = card_reprs[-1].rstrip("\n")
for card in card_reprs:
deck_file.write(card) | def save_cards(cards, filename=None) | Save the given cards, in plain text, to a txt file.
:arg cards:
The cards to save. Can be a ``Stack``, ``Deck``, or ``list``.
:arg str filename:
The filename to use for the cards file. If no filename given,
defaults to "cards-YYYYMMDD.txt", where "YYYYMMDD" is the year, month,
a... | 2.627626 | 2.983005 | 0.880865 |
ranks = ranks or DEFAULT_RANKS
if ranks.get("suits"):
indices = sorted(
indices,
key=lambda x: ranks["suits"][cards[x].suit] if
cards[x].suit != None else 0
)
if ranks.get("values"):
indices = sorted(
indices,
key=... | def sort_card_indices(cards, indices, ranks=None) | Sorts the given Deck indices by the given ranks. Must also supply the
``Stack``, ``Deck``, or ``list`` that the indices are from.
:arg cards:
The cards the indices are from. Can be a ``Stack``, ``Deck``, or
``list``
:arg list indices:
The indices to sort.
:arg dict ranks:
... | 2.737195 | 3.214959 | 0.851394 |
ranks = ranks or DEFAULT_RANKS
if ranks.get("suits"):
cards = sorted(
cards,
key=lambda x: ranks["suits"][x.suit] if x.suit != None else 0
)
if ranks.get("values"):
cards = sorted(
cards,
key=lambda x: ranks["values"][x.value]
... | def sort_cards(cards, ranks=None) | Sorts a given list of cards, either by poker ranks, or big two ranks.
:arg cards:
The cards to sort.
:arg dict ranks:
The rank dict to reference for sorting. If ``None``, it will
default to ``DEFAULT_RANKS``.
:returns:
The sorted cards. | 2.495892 | 3.217735 | 0.775668 |
import urllib
key = value
if ":" in value:
key, value = value.split(':',1)
key = urllib.unquote(key)
if Model in item_type.mro():
value = item_type(id=value)
else:
value = self.decode(item_type, value)
return (key, ... | def decode_map_element(self, item_type, value) | Decode a single element for a map | 3.736471 | 3.74715 | 0.99715 |
s = '%e' % value
l = s.split('e')
mantissa = l[0].ljust(18, '0')
exponent = l[1]
if value == 0.0:
case = '3'
exponent = '000'
elif mantissa[0] != '-' and exponent[0] == '+':
case = '5'
exponent = exponent[1:].rjust(... | def encode_float(self, value) | See http://tools.ietf.org/html/draft-wood-ldapext-float-00. | 2.037921 | 1.997513 | 1.020229 |
if '-' in value or '+' in value:
# TODO: Handle tzinfo
raise TimeDecodeError("Can't handle timezone aware objects: %r" % value)
tmp = value.split('.')
arg = map(int, tmp[0].split(':'))
if len(tmp) == 2:
arg.append(int(tmp[1]))
return t... | def decode_time(self, value) | converts strings in the form of HH:MM:SS.mmmmmm
(created by datetime.time.isoformat()) to
datetime.time objects.
Timzone-aware strings ("HH:MM:SS.mmmmmm+HH:MM") won't
be handled right now and will raise TimeDecodeError. | 4.675134 | 4.011276 | 1.165498 |
if not isinstance(value, str): return value
try:
return unicode(value, 'utf-8')
except: # really, this should throw an exception.
# in the interest of not breaking current
# systems, however:
arr = []
for ch in value:
... | def encode_string(self, value) | Convert ASCII, Latin-1 or UTF-8 to pure Unicode | 5.575747 | 5.402595 | 1.03205 |
query = "select count(*) from `%s` %s" % (self.domain.name, self._build_filter_part(cls, filters, sort_by, select))
count = 0
for row in self.domain.select(query):
count += int(row['Count'])
if quick:
return count
return count | def count(self, cls, filters, quick=True, sort_by=None, select=None) | Get the number of results that would
be returned in this query | 3.84462 | 3.913209 | 0.982472 |
import types
query_parts = []
order_by_filtered = False
if order_by:
if order_by[0] == "-":
order_by_method = "DESC";
order_by = order_by[1:]
else:
order_by_method = "ASC";
if select:
... | def _build_filter_part(self, cls, filters, order_by=None, select=None) | Build the filter part | 2.150699 | 2.139531 | 1.00522 |
decendents = {}
for sc in cls.__sub_classes__:
decendents[sc.__name__] = sc
decendents.update(self._get_all_decendents(sc))
return decendents | def _get_all_decendents(self, cls) | Get all decendents for a given class | 2.512197 | 2.455099 | 1.023257 |
rs = self.connection.get_all_snapshots([self.id])
if len(rs) > 0:
self._update(rs[0])
elif validate:
raise ValueError('%s is not a valid Snapshot ID' % self.id)
return self.progress | def update(self, validate=False) | Update the data associated with this snapshot by querying EC2.
:type validate: bool
:param validate: By default, if EC2 returns no data about the
snapshot the update method returns quietly. If
the validate param is True, however, it will
... | 5.220152 | 3.392509 | 1.538729 |
ranks = ranks or DEFAULT_RANKS
if isinstance(other, Card):
if ranks.get("suits"):
return (
ranks["values"][self.value] !=
ranks["values"][other.value] or
ranks["suits"][self.suit] !=
rank... | def ne(self, other, ranks=None) | Compares the card against another card, ``other``, and checks whether
the card is not equal to ``other``, based on the given rank dict.
:arg Card other:
The second Card to compare.
:arg dict ranks:
The ranks to refer to for comparisons.
:returns:
``T... | 2.917094 | 2.996573 | 0.973476 |
'''This view returns the index configuration of the current
application as JSON. Currently, this consists of a Solr index url
and the Fedora content models that this application expects to index.
.. Note::
By default, Fedora system content models (such as
``fedora-system:ContentModel-3.... | def index_config(request) | This view returns the index configuration of the current
application as JSON. Currently, this consists of a Solr index url
and the Fedora content models that this application expects to index.
.. Note::
By default, Fedora system content models (such as
``fedora-system:ContentModel-3.0``) ar... | 6.005696 | 3.277985 | 1.83213 |
'''Return the fields and values to be indexed for a single object
as JSON. Index content is generated via
:meth:`eulfedora.models.DigitalObject.index_data`.
:param id: id of the object to be indexed; in this case a Fedora pid
'''
# Ensure permission to this resource is allowed. Currently base... | def index_data(request, id, repo=None) | Return the fields and values to be indexed for a single object
as JSON. Index content is generated via
:meth:`eulfedora.models.DigitalObject.index_data`.
:param id: id of the object to be indexed; in this case a Fedora pid | 4.996387 | 3.656914 | 1.366285 |
'''Internal function to verify that access to this webservice is allowed.
Currently, based on the value of EUL_INDEXER_ALLOWED_IPS in settings.py.
:param request: HttpRequest
'''
allowed_ips = settings.EUL_INDEXER_ALLOWED_IPS
if allowed_ips != "ANY" and not request.META['REMOTE_ADDR'] in allow... | def _permission_denied_check(request) | Internal function to verify that access to this webservice is allowed.
Currently, based on the value of EUL_INDEXER_ALLOWED_IPS in settings.py.
:param request: HttpRequest | 6.967365 | 2.56147 | 2.720065 |
rs = self.connection.get_all_instances([self.id])
if len(rs) > 0:
r = rs[0]
for i in r.instances:
if i.id == self.id:
self._update(i)
elif validate:
raise ValueError('%s is not a valid Instance ID' % self.id)
... | def update(self, validate=False) | Update the instance's state information by making a call to fetch
the current instance attributes from the service.
:type validate: bool
:param validate: By default, if EC2 returns no data about the
instance the update method returns quietly. If
... | 3.94963 | 2.813218 | 1.403954 |
rs = self.connection.terminate_instances([self.id])
if len(rs) > 0:
self._update(rs[0]) | def terminate(self) | Terminate the instance | 6.179514 | 4.772079 | 1.294931 |
rs = self.connection.stop_instances([self.id], force)
if len(rs) > 0:
self._update(rs[0]) | def stop(self, force=False) | Stop the instance
:type force: bool
:param force: Forces the instance to stop
:rtype: list
:return: A list of the instances stopped | 6.18073 | 5.885634 | 1.050138 |
rs = self.connection.start_instances([self.id])
if len(rs) > 0:
self._update(rs[0]) | def start(self) | Start the instance. | 7.119359 | 4.832022 | 1.473371 |
return self.connection.modify_instance_attribute(self.id, attribute,
value) | def modify_attribute(self, attribute, value) | Changes an attribute of this instance
:type attribute: string
:param attribute: The attribute you wish to change.
AttributeName - Expected value (default)
instanceType - A valid instance type (m1.small)
kernel - Kernel ID (No... | 6.784125 | 6.041869 | 1.122852 |
params = {}
if load_balancer_names:
self.build_list_params(params, load_balancer_names,
'LoadBalancerNames.member.%d')
return self.get_list('DescribeLoadBalancers', params,
[('member', LoadBalancer)]) | def get_all_load_balancers(self, load_balancer_names=None) | Retrieve all load balancers associated with your account.
:type load_balancer_names: list
:keyword load_balancer_names: An optional list of load balancer names.
:rtype: :py:class:`boto.resultset.ResultSet`
:return: A ResultSet containing instances of
:class:`boto.ec2.elb.lo... | 2.354759 | 2.810731 | 0.837775 |
params = {'LoadBalancerName' : name}
for index, listener in enumerate(listeners):
i = index + 1
params['Listeners.member.%d.LoadBalancerPort' % i] = listener[0]
params['Listeners.member.%d.InstancePort' % i] = listener[1]
params['Listeners.member.... | def create_load_balancer(self, name, zones, listeners, subnets=None,
security_groups=None) | Create a new load balancer for your account. By default the load
balancer will be created in EC2. To create a load balancer inside a
VPC, parameter zones must be set to None and subnets must not be None.
The load balancer will be automatically created under the VPC that
contains the subn... | 1.704547 | 1.683411 | 1.012556 |
params = {'LoadBalancerName' : name}
for index, listener in enumerate(listeners):
i = index + 1
params['Listeners.member.%d.LoadBalancerPort' % i] = listener[0]
params['Listeners.member.%d.InstancePort' % i] = listener[1]
params['Listeners.member.... | def create_load_balancer_listeners(self, name, listeners) | Creates a Listener (or group of listeners) for an existing Load Balancer
:type name: string
:param name: The name of the load balancer to create the listeners for
:type listeners: List of tuples
:param listeners: Each tuple contains three values,
(LoadBalancer... | 1.831719 | 1.877149 | 0.975798 |
params = {'LoadBalancerName' : name}
for index, port in enumerate(ports):
params['LoadBalancerPorts.member.%d' % (index + 1)] = port
return self.get_status('DeleteLoadBalancerListeners', params) | def delete_load_balancer_listeners(self, name, ports) | Deletes a load balancer listener (or group of listeners)
:type name: string
:param name: The name of the load balancer to create the listeners for
:type ports: List int
:param ports: Each int represents the port on the ELB to be removed
:return: The status of the request | 2.567977 | 3.422335 | 0.750358 |
params = {'LoadBalancerName' : load_balancer_name}
self.build_list_params(params, zones_to_add,
'AvailabilityZones.member.%d')
return self.get_list('EnableAvailabilityZonesForLoadBalancer',
params, None) | def enable_availability_zones(self, load_balancer_name, zones_to_add) | Add availability zones to an existing Load Balancer
All zones must be in the same region as the Load Balancer
Adding zones that are already registered with the Load Balancer
has no effect.
:type load_balancer_name: string
:param load_balancer_name: The name of the Load Balancer
... | 2.882452 | 4.231043 | 0.681263 |
params = {'LoadBalancerName' : load_balancer_name}
self.build_list_params(params, zones_to_remove,
'AvailabilityZones.member.%d')
return self.get_list('DisableAvailabilityZonesForLoadBalancer',
params, None) | def disable_availability_zones(self, load_balancer_name, zones_to_remove) | Remove availability zones from an existing Load Balancer.
All zones must be in the same region as the Load Balancer.
Removing zones that are not registered with the Load Balancer
has no effect.
You cannot remove all zones from an Load Balancer.
:type load_balancer_name: string
... | 2.749241 | 4.058367 | 0.677425 |
params = {'LoadBalancerName' : load_balancer_name}
self.build_list_params(params, instances,
'Instances.member.%d.InstanceId')
return self.get_list('RegisterInstancesWithLoadBalancer',
params, [('member', InstanceInfo)]) | def register_instances(self, load_balancer_name, instances) | Add new Instances to an existing Load Balancer.
:type load_balancer_name: string
:param load_balancer_name: The name of the Load Balancer
:type instances: List of strings
:param instances: The instance ID's of the EC2 instances to add.
:rtype: List of strings
:return: ... | 3.352269 | 4.364972 | 0.767993 |
params = {'LoadBalancerName' : load_balancer_name}
self.build_list_params(params, instances,
'Instances.member.%d.InstanceId')
return self.get_list('DeregisterInstancesFromLoadBalancer',
params, [('member', InstanceInfo)]) | def deregister_instances(self, load_balancer_name, instances) | Remove Instances from an existing Load Balancer.
:type load_balancer_name: string
:param load_balancer_name: The name of the Load Balancer
:type instances: List of strings
:param instances: The instance ID's of the EC2 instances to remove.
:rtype: List of strings
:retu... | 3.032649 | 3.971889 | 0.763528 |
params = {'LoadBalancerName' : load_balancer_name}
if instances:
self.build_list_params(params, instances,
'Instances.member.%d.InstanceId')
return self.get_list('DescribeInstanceHealth', params,
[('member', Ins... | def describe_instance_health(self, load_balancer_name, instances=None) | Get current state of all Instances registered to an Load Balancer.
:type load_balancer_name: string
:param load_balancer_name: The name of the Load Balancer
:type instances: List of strings
:param instances: The instance ID's of the EC2 instances
to return sta... | 2.6999 | 3.100599 | 0.870767 |
params = {'LoadBalancerName' : name,
'HealthCheck.Timeout' : health_check.timeout,
'HealthCheck.Target' : health_check.target,
'HealthCheck.Interval' : health_check.interval,
'HealthCheck.UnhealthyThreshold' : health_check.unhealth... | def configure_health_check(self, name, health_check) | Define a health check for the EndPoints.
:type name: string
:param name: The mnemonic name associated with the load balancer
:type health_check: :class:`boto.ec2.elb.healthcheck.HealthCheck`
:param health_check: A HealthCheck object populated with the desired
... | 1.955803 | 2.114547 | 0.924927 |
params = {
'LoadBalancerName' : lb_name,
'LoadBalancerPort' : lb_port,
'SSLCertificateId' : ssl_certificate_id,
}
return self.get_status('SetLoadBalancerListenerSSLCertificate', params) | def set_lb_listener_SSL_certificate(self, lb_name, lb_port,
ssl_certificate_id) | Sets the certificate that terminates the specified listener's SSL
connections. The specified certificate replaces any prior certificate
that was used on the same LoadBalancer and port. | 2.525063 | 2.602496 | 0.970247 |
params = {
'CookieName' : name,
'LoadBalancerName' : lb_name,
'PolicyName' : policy_name,
}
return self.get_status('CreateAppCookieStickinessPolicy', params) | def create_app_cookie_stickiness_policy(self, name, lb_name, policy_name) | Generates a stickiness policy with sticky session lifetimes that follow
that of an application-generated cookie. This policy can only be
associated with HTTP listeners.
This policy is similar to the policy created by
CreateLBCookieStickinessPolicy, except that the lifetime of the specia... | 2.893546 | 3.173522 | 0.911777 |
params = {
'CookieExpirationPeriod' : cookie_expiration_period,
'LoadBalancerName' : lb_name,
'PolicyName' : policy_name,
}
return self.get_status('CreateLBCookieStickinessPolicy', para... | def create_lb_cookie_stickiness_policy(self, cookie_expiration_period,
lb_name, policy_name) | Generates a stickiness policy with sticky session lifetimes controlled
by the lifetime of the browser (user-agent) or a specified expiration
period. This policy can only be associated only with HTTP listeners.
When a load balancer implements this policy, the load balancer uses a
special... | 2.483097 | 2.922182 | 0.849741 |
params = {
'LoadBalancerName' : lb_name,
'PolicyName' : policy_name,
}
return self.get_status('DeleteLoadBalancerPolicy', params) | def delete_lb_policy(self, lb_name, policy_name) | Deletes a policy from the LoadBalancer. The specified policy must not
be enabled for any listeners. | 3.459074 | 3.352791 | 1.0317 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.