prompt
large_stringlengths 70
991k
| completion
large_stringlengths 0
1.02k
|
---|---|
<|file_name|>Price.java<|end_file_name|><|fim▁begin|>package okeanos.data.services.entities;
import javax.measure.quantity.Power;
import org.jscience.physics.amount.Amount;<|fim▁hole|><|fim▁end|> |
public interface Price {
double getCostAtConsumption(Amount<Power> consumption);
} |
<|file_name|>AdminDao.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
# -*- coding:utf-8 -*-
"""
Author: AsherYang
Email: [email protected]
Date: 2018/6/27
Desc: 后台管理数据库操作类
"""
import sys
sys.path.append('../')
from util import DbUtil
from util.DateUtil import DateUtil
class AdminDao:
def __init__(self):
pass
# 根据管理员电话号码查询管理员信息
def queryByTel(self, admin_tel):
query = 'SELECT * FROM ffstore_admin WHERE admin_tel = "%s" ' % admin_tel
return DbUtil.query(query)<|fim▁hole|> def queryByTelAndPwd(self, admin_tel, sms_pwd):
query = 'SELECT * FROM ffstore_admin WHERE admin_tel = "%s" and sms_pwd = "%s" ' % (admin_tel, sms_pwd)
return DbUtil.query(query)
# 更新短信验证码
def updateSmsPwd(self, admin_tel, sms_pwd):
current_time = DateUtil().getCurrentTimeStamp()
update = 'update ffstore_admin set sms_pwd = "%s", login_time = "%s" where admin_tel = "%s"' \
% (sms_pwd, current_time, admin_tel)
return DbUtil.update(update)
# 更新登录时间(时间戳格式,秒级别)
def updateLoginTime(self, admin_tel, login_time):
current_time = DateUtil().getCurrentTimeStamp()
if not login_time or login_time > current_time:
return False
update = 'update ffstore_admin set login_time = "%s" where admin_tel = "%s"' % (login_time, admin_tel)
return DbUtil.update(update)<|fim▁end|> |
# 根据管理员号码和密码查询管理员信息 |
<|file_name|>warnings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
uds.warnings
~~~~~~~~~~~~
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL2, see LICENSE for more details.
"""
import warnings
def deprecated(func):
"""This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used.
:param func:
:return: new_func
"""
def new_func(*args, **kwargs):
warnings.warn("Call to deprecated function {}.".format(func.__name__),
category=DeprecationWarning)
return func(*args, **kwargs)
new_func.__name__ = func.__name__
new_func.__doc__ = func.__doc__
new_func.__dict__.update(func.__dict__)
return new_func
# Examples of use
<|fim▁hole|>
class SomeClass:
@deprecated
def some_old_method(self, x, y):
return x + y<|fim▁end|> | @deprecated
def some_old_function(x, y):
return x + y
|
<|file_name|>integration.karma.conf.js<|end_file_name|><|fim▁begin|>// Karma configuration
// Generated on Fri May 27 2016 18:39:38 GMT+0200 (CEST)
const webpackConf = require('./test/unit/webpack.config');
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: [
'jasmine',
'jasmine-matchers',
],
// list of files / patterns to load in the browser
files: [
'node_modules/jasmine-promises/dist/jasmine-promises.js',
'test/integration/index.js',
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'test/integration/index.js': ['webpack', 'sourcemap'],
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
// reporters: ['progress'],
// reporters: ['spec', 'jasmine-diff'],
// reporters: ['jasmine-diff'],
reporters: ['spec'],
// web server port
port: 9877,
// enable / disable colors in the output (reporters and logs)
colors: true,
<|fim▁hole|> // config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity,
// Hide webpack build information from output
webpackMiddleware: {
noInfo: 'errors-only',
},
});
// if (process.env.TRAVIS) {
config.customLaunchers = {
Chrome_no_sandbox: {
base: 'Chrome',
flags: ['--no-sandbox'],
},
};
config.browsers = ['Chrome_no_sandbox'];
config.webpack = webpackConf;
// Configure code coverage reporter
config.coverageReporter = {
dir: 'coverage/',
reporters: [
{ type: 'lcovonly', subdir: '.' },
{ type: 'json', subdir: '.' },
{ type: 'text', subdir: '.' },
{ type: 'html', subdir: '.' },
],
};
};<|fim▁end|> |
// level of logging
// possible values:
// config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>define([
"helpers/contract",
"helpers/types",
"components/content/views/content/single/view",
"components/content/views/content/multi/view"
], function(contract, types, SingleView, MultiView) {
function getView(options) {
contract(options, "object_type");
var type = types.baseObjectType(options.object_type);
// if this is a singular wordpress type, return the SingleView.
// otherwise, its a MultiView by default.
// To override this behavior, specify or register a custom view factory.
if (type === "post" || type === "page")
return SingleView;
else
return MultiView;<|fim▁hole|>
return {
getView: getView
};
});<|fim▁end|> | } |
<|file_name|>user-handler.js<|end_file_name|><|fim▁begin|>handlers.getRegister = function (ctx) {
ctx.loadPartials({
header: '../views/common/header.hbs',
footer: '../views/common/footer.hbs'
}).then(function () {
this.partial('../views/user/register.hbs');
});
}
handlers.getLogin = function (ctx) {
ctx.loadPartials({
header: '../views/common/header.hbs',
footer: '../views/common/footer.hbs'
}).then(function () {
this.partial('../views/user/login.hbs');
});
}
handlers.registerUser = function (ctx) {
let username = ctx.params.username;
let firstName = ctx.params.firstName;
let lastName = ctx.params.lastName;
let password = ctx.params.password;
let repeatPassword = ctx.params.repeatPassword;
if (firstName.length < 2) {
notify.showError("The firstName should be at least 2 characters long");
return;
}
if (lastName.length < 2) {
notify.showError("The lastName should be at least 2 characters long");
return;
}
if (username.length < 3) {
notify.showError("The username should be at least 3 characters long");
return;
}
if (password.length < 6) {
notify.showError('The password should be at least 6 characters long');
return;
}
if (password !== repeatPassword) {
notify.showError('The repeat password should be equal to the password');
return;
}<|fim▁hole|>
notify.showInfo('User registration successful.');
ctx.redirect('#/home');
}).catch(function (err) {
notify.handleError(err);
});
}
handlers.logoutUser = function (ctx) {
userService.logout().then(() => {
sessionStorage.clear();
notify.showInfo('Logout successful.');
ctx.redirect('#/home');
})
}
handlers.loginUser = function (ctx) {
let username = ctx.params.username;
let password = ctx.params.password;
userService.login(username, password).then((res) => {
userService.saveSession(res);
notify.showInfo('Login successful.');
ctx.redirect('#/home');
}).catch(function (err) {
notify.handleError(err);
});
}<|fim▁end|> |
userService.register(username, password, firstName, lastName).then((res) => {
userService.saveSession(res); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from _test_lbfgs_cpp import *
from _test_lj_cpp import *<|fim▁hole|>
if __name__ == "__main__":
unittest.main()<|fim▁end|> | from _test_lj_interaction_list import *
from _test_frozen_atoms import *
from _test_bljcut import *
|
<|file_name|>RouterDegradeAnnoBean.java<|end_file_name|><|fim▁begin|>package com.xiaojinzi.component.bean;<|fim▁hole|>
import javax.lang.model.element.Element;
/**
* time : 2018/07/26
*
* @author : xiaojinzi
*/
public class RouterDegradeAnnoBean {
/**
* 优先级
*/
private int priority;
/**
* 是一个类实现了 RouterDegrade 接口
*/
private Element rawType;
public int getPriority() {
return priority;
}
public void setPriority(int priority) {
this.priority = priority;
}
public Element getRawType() {
return rawType;
}
public void setRawType(Element rawType) {
this.rawType = rawType;
}
}<|fim▁end|> | |
<|file_name|>sound_resid.cc<|end_file_name|><|fim▁begin|>#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include "resid-fp/sid.h"
#include "sound_resid.h"
typedef struct psid_t
{
/* resid sid implementation */
SIDFP *sid;
int16_t last_sample;<|fim▁hole|>psid_t *psid;
void *sid_init()
{
// psid_t *psid;
int c;
sampling_method method=SAMPLE_INTERPOLATE;
float cycles_per_sec = 14318180.0 / 16.0;
psid = new psid_t;
// psid = (psid_t *)malloc(sizeof(sound_t));
psid->sid = new SIDFP;
psid->sid->set_chip_model(MOS8580FP);
psid->sid->set_voice_nonlinearity(1.0f);
psid->sid->get_filter().set_distortion_properties(0.f, 0.f, 0.f);
psid->sid->get_filter().set_type4_properties(6.55f, 20.0f);
psid->sid->enable_filter(true);
psid->sid->enable_external_filter(true);
psid->sid->reset();
for (c=0;c<32;c++)
psid->sid->write(c,0);
if (!psid->sid->set_sampling_parameters((float)cycles_per_sec, method,
(float)48000, 0.9*48000.0/2.0))
{
// printf("reSID failed!\n");
}
psid->sid->set_chip_model(MOS6581FP);
psid->sid->set_voice_nonlinearity(0.96f);
psid->sid->get_filter().set_distortion_properties(3.7e-3f, 2048.f, 1.2e-4f);
psid->sid->input(0);
psid->sid->get_filter().set_type3_properties(1.33e6f, 2.2e9f, 1.0056f, 7e3f);
return (void *)psid;
}
void sid_close(void *p)
{
// psid_t *psid = (psid_t *)p;
delete psid->sid;
// free(psid);
}
void sid_reset(void *p)
{
// psid_t *psid = (psid_t *)p;
int c;
psid->sid->reset();
for (c = 0; c < 32; c++)
psid->sid->write(c, 0);
}
uint8_t sid_read(uint16_t addr, void *p)
{
// psid_t *psid = (psid_t *)p;
return psid->sid->read(addr & 0x1f);
// return 0xFF;
}
void sid_write(uint16_t addr, uint8_t val, void *p)
{
// psid_t *psid = (psid_t *)p;
psid->sid->write(addr & 0x1f,val);
}
#define CLOCK_DELTA(n) (int)(((14318180.0 * n) / 16.0) / 48000.0)
static void fillbuf2(int& count, int16_t *buf, int len)
{
int c;
c = psid->sid->clock(count, buf, len, 1);
if (!c)
*buf = psid->last_sample;
psid->last_sample = *buf;
}
void sid_fillbuf(int16_t *buf, int len, void *p)
{
// psid_t *psid = (psid_t *)p;
int x = CLOCK_DELTA(len);
fillbuf2(x, buf, len);
}<|fim▁end|> | } psid_t;
|
<|file_name|>iso2022_jp_1.py<|end_file_name|><|fim▁begin|>#
# iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1
#
# Written by Hye-Shik Chang <[email protected]>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_1')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
codecs.IncrementalEncoder):
codec = codec
class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
codecs.IncrementalDecoder):
codec = codec
class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
codec = codec
class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
codec = codec
def getregentry():
return codecs.CodecInfo(
name='iso2022_jp_1',
encode=Codec().encode,
decode=Codec().decode,
<|fim▁hole|> streamwriter=StreamWriter,
)<|fim▁end|> | incrementalencoder=IncrementalEncoder,
incrementaldecoder=IncrementalDecoder,
streamreader=StreamReader,
|
<|file_name|>FileOutputConfigTest.java<|end_file_name|><|fim▁begin|>package com.github.aureliano.evtbridge.output.file;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.Set;
import org.junit.Test;
import com.github.aureliano.evtbridge.annotation.validation.NotNull;
import com.github.aureliano.evtbridge.annotation.validation.apply.ConstraintViolation;
import com.github.aureliano.evtbridge.annotation.validation.apply.ObjectValidator;
import com.github.aureliano.evtbridge.core.config.OutputConfigTypes;
public class FileOutputConfigTest {
ObjectValidator validator = ObjectValidator.instance();
@Test
public void testGetDefaults() {
FileOutputConfig c = new FileOutputConfig();
assertNull(c.getFile());
assertEquals("UTF-8", c.getEncoding());
assertFalse(c.isAppend());
assertTrue(c.isUseBuffer());
}
@Test
public void testConfiguration() {
FileOutputConfig c = new FileOutputConfig()
.withAppend(true)
.withEncoding("ISO-8859-1")
.withFile("/there/is/not/file");
assertEquals("/there/is/not/file", c.getFile().getPath());
assertEquals("ISO-8859-1", c.getEncoding());
assertTrue(c.isAppend());
}
@Test
public void testClone() {
FileOutputConfig c1 = new FileOutputConfig()
.withAppend(true)
.withUseBuffer(false)
.withEncoding("ISO-8859-1")
.withFile("/there/is/not/file")
.putMetadata("test", "my test");
FileOutputConfig c2 = c1.clone();
assertEquals(c1.getFile(), c2.getFile());
assertEquals(c1.getEncoding(), c2.getEncoding());
assertEquals(c1.isAppend(), c2.isAppend());
assertEquals(c1.isUseBuffer(), c2.isUseBuffer());
assertEquals(c1.getMetadata("test"), c2.getMetadata("test"));
}
@Test
public void testOutputType() {
assertEquals(OutputConfigTypes.FILE_OUTPUT.name(), new FileOutputConfig().id());
}
@Test
public void testValidation() {
FileOutputConfig c = this.createValidConfiguration();
assertTrue(this.validator.validate(c).isEmpty());
this._testValidateFile();
}
private void _testValidateFile() {
FileOutputConfig c = new FileOutputConfig();
Set<ConstraintViolation> violations = this.validator.validate(c);
assertTrue(violations.size() == 1);<|fim▁hole|> return new FileOutputConfig().withFile("/path/to/file");
}
}<|fim▁end|> | assertEquals(NotNull.class, violations.iterator().next().getValidator());
}
private FileOutputConfig createValidConfiguration() { |
<|file_name|>zip.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO(brettw) bug 582594: merge this with build/android/gn/zip.py and update
# callers to use the existing template rather than invoking this directly.
"""Archives a set of files.
"""
import optparse
import os
import sys
import zipfile
sys.path.append(os.path.join(os.path.dirname(__file__),
os.pardir, os.pardir, os.pardir, os.pardir,
"build"))
import gn_helpers
sys.path.append(os.path.join(os.path.dirname(__file__),
os.pardir, os.pardir, os.pardir, os.pardir,
'build', 'android', 'gyp'))
from util import build_utils
def DoZip(inputs, link_inputs, zip_inputs, output, base_dir):
files = []
with zipfile.ZipFile(output, 'w', zipfile.ZIP_DEFLATED) as outfile:
for f in inputs:
file_name = os.path.relpath(f, base_dir)
files.append(file_name)
build_utils.AddToZipHermetic(outfile, file_name, f)
for f in link_inputs:
realf = os.path.realpath(f) # Resolve symlinks.
file_name = os.path.relpath(realf, base_dir)
files.append(file_name)
build_utils.AddToZipHermetic(outfile, file_name, realf)
for zf_name in zip_inputs:
with zipfile.ZipFile(zf_name, 'r') as zf:
for f in zf.namelist():
if f not in files:
files.append(f)
build_utils.AddToZipHermetic(outfile, f, data=zf.read(f))
def main():
parser = optparse.OptionParser()
parser.add_option('--inputs',
help='GN format list of files to archive.')
parser.add_option('--link-inputs',
help='GN-format list of files to archive. Symbolic links are resolved.')
parser.add_option('--zip-inputs',
help='GN-format list of zip files to re-archive.')
parser.add_option('--output', help='Path to output archive.')
parser.add_option('--base-dir',
help='If provided, the paths in the archive will be '
'relative to this directory', default='.')
options, _ = parser.parse_args()
inputs = []
if (options.inputs):
parser = gn_helpers.GNValueParser(options.inputs)
inputs = parser.ParseList()
link_inputs = []
if options.link_inputs:<|fim▁hole|> if options.zip_inputs:
parser = gn_helpers.GNValueParser(options.zip_inputs)
zip_inputs = parser.ParseList()
output = options.output
base_dir = options.base_dir
DoZip(inputs, link_inputs, zip_inputs, output, base_dir)
if __name__ == '__main__':
sys.exit(main())<|fim▁end|> | parser = gn_helpers.GNValueParser(options.link_inputs)
link_inputs = parser.ParseList()
zip_inputs = [] |
<|file_name|>prepaid-card-pattern-serializer.ts<|end_file_name|><|fim▁begin|>import { inject } from '@cardstack/di';
import DatabaseManager from '@cardstack/db';
import { JSONAPIDocument } from '../../utils/jsonapi-document';
interface PrepaidCardPattern {
id: string;
patternUrl?: string;
description: string;
}
export default class PrepaidCardPatternSerializer {
databaseManager: DatabaseManager = inject('database-manager', { as: 'databaseManager' });
async serialize(id: string): Promise<JSONAPIDocument>;
async serialize(model: PrepaidCardPattern): Promise<JSONAPIDocument>;
async serialize(content: string | PrepaidCardPattern): Promise<JSONAPIDocument> {
if (typeof content === 'string') {
content = await this.loadPrepaidCardPattern(content);
}
let data = {
id: content.id,
type: 'prepaid-card-patterns',
attributes: {<|fim▁hole|> };
let result = {
data,
} as JSONAPIDocument;
return result;
}
async loadPrepaidCardPattern(id: string): Promise<PrepaidCardPattern> {
let db = await this.databaseManager.getClient();
let queryResult = await db.query('SELECT id, pattern_url, description FROM prepaid_card_patterns WHERE id = $1', [
id,
]);
if (queryResult.rowCount === 0) {
return Promise.reject(new Error(`No prepaid_card_pattern record found with id ${id}`));
}
let row = queryResult.rows[0];
return {
id: row['id'],
patternUrl: row['pattern_url'],
description: row['description'],
};
}
}
declare module '@cardstack/di' {
interface KnownServices {
'prepaid-card-pattern-serializer': PrepaidCardPatternSerializer;
}
}<|fim▁end|> | 'pattern-url': content.patternUrl,
description: content.description,
}, |
<|file_name|>subscription.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 Rohith All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package marathon
import (
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/http"
"strings"
"sync"
"time"
"github.com/donovanhide/eventsource"
)
// Subscriptions is a collection to urls that marathon is implementing a callback on
type Subscriptions struct {
CallbackURLs []string `json:"callbackUrls"`
}
// Subscriptions retrieves a list of registered subscriptions
func (r *marathonClient) Subscriptions() (*Subscriptions, error) {
subscriptions := new(Subscriptions)
if err := r.apiGet(marathonAPISubscription, nil, subscriptions); err != nil {
return nil, err
}
return subscriptions, nil
}
// AddEventsListener adds your self as a listener to events from Marathon
// channel: a EventsChannel used to receive event on
func (r *marathonClient) AddEventsListener(filter int) (EventsChannel, error) {
r.Lock()
defer r.Unlock()
// step: someone has asked to start listening to event, we need to register for events
// if we haven't done so already
if err := r.registerSubscription(); err != nil {
return nil, err
}
channel := make(EventsChannel)
r.listeners[channel] = EventsChannelContext{
filter: filter,
done: make(chan struct{}, 1),
completion: &sync.WaitGroup{},
}
return channel, nil
}
// RemoveEventsListener removes the channel from the events listeners
// channel: the channel you are removing
func (r *marathonClient) RemoveEventsListener(channel EventsChannel) {
r.Lock()
defer r.Unlock()
if context, found := r.listeners[channel]; found {
close(context.done)
delete(r.listeners, channel)
// step: if there is no one else listening, let's remove ourselves
// from the events callback
if r.config.EventsTransport == EventsTransportCallback && len(r.listeners) == 0 {
r.Unsubscribe(r.SubscriptionURL())<|fim▁hole|> completion.Wait()
close(channel)
}(context.completion)
}
}
// SubscriptionURL retrieves the subscription callback URL used when registering
func (r *marathonClient) SubscriptionURL() string {
if r.config.CallbackURL != "" {
return fmt.Sprintf("%s%s", r.config.CallbackURL, defaultEventsURL)
}
return fmt.Sprintf("http://%s:%d%s", r.ipAddress, r.config.EventsPort, defaultEventsURL)
}
// registerSubscription registers ourselves with Marathon to receive events from configured transport facility
func (r *marathonClient) registerSubscription() error {
switch r.config.EventsTransport {
case EventsTransportCallback:
return r.registerCallbackSubscription()
case EventsTransportSSE:
return r.registerSSESubscription()
default:
return fmt.Errorf("the events transport: %d is not supported", r.config.EventsTransport)
}
}
func (r *marathonClient) registerCallbackSubscription() error {
if r.eventsHTTP == nil {
ipAddress, err := getInterfaceAddress(r.config.EventsInterface)
if err != nil {
return fmt.Errorf("Unable to get the ip address from the interface: %s, error: %s",
r.config.EventsInterface, err)
}
// step: set the ip address
r.ipAddress = ipAddress
binding := fmt.Sprintf("%s:%d", ipAddress, r.config.EventsPort)
// step: register the handler
http.HandleFunc(defaultEventsURL, r.handleCallbackEvent)
// step: create the http server
r.eventsHTTP = &http.Server{
Addr: binding,
Handler: nil,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
MaxHeaderBytes: 1 << 20,
}
// @todo need to add a timeout value here
listener, err := net.Listen("tcp", binding)
if err != nil {
return nil
}
go func() {
for {
r.eventsHTTP.Serve(listener)
}
}()
}
// step: get the callback url
callback := r.SubscriptionURL()
// step: check if the callback is registered
found, err := r.HasSubscription(callback)
if err != nil {
return err
}
if !found {
// step: we need to register ourselves
if err := r.Subscribe(callback); err != nil {
return err
}
}
return nil
}
func (r *marathonClient) registerSSESubscription() error {
// Prevent multiple SSE subscriptions
if r.subscribedToSSE {
return nil
}
// Get a member from the cluster
marathon, err := r.cluster.GetMember()
if err != nil {
return err
}
request, err := r.apiRequest("GET", fmt.Sprintf("%s/%s", marathon, marathonAPIEventStream), nil)
if err != nil {
return err
}
// Try to connect to stream, reusing the http client settings
stream, err := eventsource.SubscribeWith("", r.httpClient, request)
if err != nil {
return err
}
go func() {
for {
select {
case ev := <-stream.Events:
if err := r.handleEvent(ev.Data()); err != nil {
// TODO let the user handle this error instead of logging it here
r.debugLog.Printf("registerSSESubscription(): failed to handle event: %v\n", err)
}
case err := <-stream.Errors:
// TODO let the user handle this error instead of logging it here
r.debugLog.Printf("registerSSESubscription(): failed to receive event: %v\n", err)
}
}
}()
r.subscribedToSSE = true
return nil
}
// Subscribe adds a URL to Marathon's callback facility
// callback : the URL you wish to subscribe
func (r *marathonClient) Subscribe(callback string) error {
uri := fmt.Sprintf("%s?callbackUrl=%s", marathonAPISubscription, callback)
return r.apiPost(uri, "", nil)
}
// Unsubscribe removes a URL from Marathon's callback facility
// callback : the URL you wish to unsubscribe
func (r *marathonClient) Unsubscribe(callback string) error {
// step: remove from the list of subscriptions
return r.apiDelete(fmt.Sprintf("%s?callbackUrl=%s", marathonAPISubscription, callback), nil, nil)
}
// HasSubscription checks to see a subscription already exists with Marathon
// callback: the url of the callback
func (r *marathonClient) HasSubscription(callback string) (bool, error) {
// step: generate our events callback
subscriptions, err := r.Subscriptions()
if err != nil {
return false, err
}
for _, subscription := range subscriptions.CallbackURLs {
if callback == subscription {
return true, nil
}
}
return false, nil
}
func (r *marathonClient) handleEvent(content string) error {
// step: process and decode the event
eventType := new(EventType)
err := json.NewDecoder(strings.NewReader(content)).Decode(eventType)
if err != nil {
return fmt.Errorf("failed to decode the event type, content: %s, error: %s", content, err)
}
// step: check whether event type is handled
event, err := GetEvent(eventType.EventType)
if err != nil {
return fmt.Errorf("unable to handle event, type: %s, error: %s", eventType.EventType, err)
}
// step: let's decode message
err = json.NewDecoder(strings.NewReader(content)).Decode(event.Event)
if err != nil {
return fmt.Errorf("failed to decode the event, id: %d, error: %s", event.ID, err)
}
r.RLock()
defer r.RUnlock()
// step: check if anyone is listen for this event
for channel, context := range r.listeners {
// step: check if this listener wants this event type
if event.ID&context.filter != 0 {
context.completion.Add(1)
go func(ch EventsChannel, context EventsChannelContext, e *Event) {
defer context.completion.Done()
select {
case ch <- e:
case <-context.done:
// Terminates goroutine.
}
}(channel, context, event)
}
}
return nil
}
func (r *marathonClient) handleCallbackEvent(writer http.ResponseWriter, request *http.Request) {
body, err := ioutil.ReadAll(request.Body)
if err != nil {
// TODO should this return a 500?
r.debugLog.Printf("handleCallbackEvent(): failed to read request body, error: %s\n", err)
return
}
if err := r.handleEvent(string(body[:])); err != nil {
// TODO should this return a 500?
r.debugLog.Printf("handleCallbackEvent(): failed to handle event: %v\n", err)
}
}<|fim▁end|> | }
// step: wait for pending goroutines to finish and close channel
go func(completion *sync.WaitGroup) { |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"github.com/weynsee/go-phrase/cli"
"log"
"os"
)
func main() {
args := os.Args[1:]<|fim▁hole|> c := cli.NewCLI("1.0.0", args)
exitStatus, err := c.Run()
if err != nil {
log.Println(err)
}
os.Exit(exitStatus)
}<|fim▁end|> | |
<|file_name|>imagePopupBody.ts<|end_file_name|><|fim▁begin|>import removeClass from 'tui-code-snippet/domUtil/removeClass';
import addClass from 'tui-code-snippet/domUtil/addClass';
import { HookCallback } from '@t/editor';
import { Emitter } from '@t/event';
import { ExecCommand, HidePopup, TabInfo } from '@t/ui';
import i18n from '@/i18n/i18n';
import { cls } from '@/utils/dom';
import { Component } from '@/ui/vdom/component';
import html from '@/ui/vdom/template';
import { Tabs } from '../tabs';
<|fim▁hole|>const TYPE_UI = 'ui';
type TabType = 'url' | 'file';
interface Props {
show: boolean;
eventEmitter: Emitter;
execCommand: ExecCommand;
hidePopup: HidePopup;
}
interface State {
activeTab: TabType;
file: File | null;
fileNameElClassName: string;
}
export class ImagePopupBody extends Component<Props, State> {
private tabs: TabInfo[];
constructor(props: Props) {
super(props);
this.state = { activeTab: 'file', file: null, fileNameElClassName: '' };
this.tabs = [
{ name: 'file', text: 'File' },
{ name: 'url', text: 'URL' },
];
}
private initialize = (activeTab: TabType = 'file') => {
const urlEl = this.refs.url as HTMLInputElement;
urlEl.value = '';
(this.refs.altText as HTMLInputElement).value = '';
(this.refs.file as HTMLInputElement).value = '';
removeClass(urlEl, 'wrong');
this.setState({ activeTab, file: null, fileNameElClassName: '' });
};
private emitAddImageBlob() {
const { files } = this.refs.file as HTMLInputElement;
const altTextEl = this.refs.altText as HTMLInputElement;
let fileNameElClassName = ' wrong';
if (files?.length) {
fileNameElClassName = '';
const imageFile = files.item(0)!;
const hookCallback: HookCallback = (url, text) =>
this.props.execCommand('addImage', { imageUrl: url, altText: text || altTextEl.value });
this.props.eventEmitter.emit('addImageBlobHook', imageFile, hookCallback, TYPE_UI);
}
this.setState({ fileNameElClassName });
}
private emitAddImage() {
const imageUrlEl = this.refs.url as HTMLInputElement;
const altTextEl = this.refs.altText as HTMLInputElement;
const imageUrl = imageUrlEl.value;
const altText = altTextEl.value || 'image';
removeClass(imageUrlEl, 'wrong');
if (!imageUrl.length) {
addClass(imageUrlEl, 'wrong');
return;
}
if (imageUrl) {
this.props.execCommand('addImage', { imageUrl, altText });
}
}
private execCommand = () => {
if (this.state.activeTab === 'file') {
this.emitAddImageBlob();
} else {
this.emitAddImage();
}
};
private toggleTab = (_: MouseEvent, activeTab: TabType) => {
if (activeTab !== this.state.activeTab) {
this.initialize(activeTab);
}
};
private showFileSelectBox = () => {
this.refs.file.click();
};
private changeFile = (ev: Event) => {
const { files } = ev.target as HTMLInputElement;
if (files?.length) {
this.setState({ file: files[0] });
}
};
private preventSelectStart(ev: Event) {
ev.preventDefault();
}
updated() {
if (!this.props.show) {
this.initialize();
}
}
render() {
const { activeTab, file, fileNameElClassName } = this.state;
return html`
<div aria-label="${i18n.get('Insert image')}">
<${Tabs} tabs=${this.tabs} activeTab=${activeTab} onClick=${this.toggleTab} />
<div style="display:${activeTab === 'url' ? 'block' : 'none'}">
<label for="toastuiImageUrlInput">${i18n.get('Image URL')}</label>
<input
id="toastuiImageUrlInput"
type="text"
ref=${(el: HTMLInputElement) => (this.refs.url = el)}
/>
</div>
<div style="display:${activeTab === 'file' ? 'block' : 'none'};position: relative;">
<label for="toastuiImageFileInput">${i18n.get('Select image file')}</label>
<span
class="${cls('file-name')}${file ? ' has-file' : fileNameElClassName}"
onClick=${this.showFileSelectBox}
onSelectstart=${this.preventSelectStart}
>
${file ? file.name : i18n.get('No file')}
</span>
<button
type="button"
class="${cls('file-select-button')}"
onClick=${this.showFileSelectBox}
>
${i18n.get('Choose a file')}
</button>
<input
id="toastuiImageFileInput"
type="file"
accept="image/*"
onChange=${this.changeFile}
ref=${(el: HTMLInputElement) => (this.refs.file = el)}
/>
</div>
<label for="toastuiAltTextInput">${i18n.get('Description')}</label>
<input
id="toastuiAltTextInput"
type="text"
ref=${(el: HTMLInputElement) => (this.refs.altText = el)}
/>
<div class="${cls('button-container')}">
<button type="button" class="${cls('close-button')}" onClick=${this.props.hidePopup}>
${i18n.get('Cancel')}
</button>
<button type="button" class="${cls('ok-button')}" onClick=${this.execCommand}>
${i18n.get('OK')}
</button>
</div>
</div>
`;
}
}<|fim▁end|> | |
<|file_name|>jobs_event_model_configuration_creator.py<|end_file_name|><|fim▁begin|># Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.configuration import Configuration
class JobsEventModelConfigurationCreator(object):
_model_name = 'agent_event_model'
def __init__(self,
location_set = 'gridcell',
agent_set = 'job',
agent_event_set = 'jobs_event'):
self.location_set = location_set
<|fim▁hole|> return Configuration({
'import': {
'washtenaw.models.%s' % self._model_name: 'AgentEventModel'
},
'init': {'name': 'AgentEventModel'},
'run': {
'arguments': {
'location_set': self.location_set,
'agent_event_set': self.agent_event_set,
'agent_set':self.agent_set,
'current_year': 'year',
'dataset_pool': 'dataset_pool'
}
}
})
from opus_core.tests import opus_unittest
class TestDeletionEventModelConfigurationCreator(opus_unittest.OpusTestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_defaults(self):
creator = JobsEventModelConfigurationCreator()
expected = Configuration({
'import': {
'washtenaw.models.agent_event_model': 'AgentEventModel'
},
'init': {'name': 'AgentEventModel'},
'run': {
'arguments': {
'location_set': 'gridcell',
'agent_event_set': 'jobs_event',
'agent_set':'job',
'current_year': 'year',
'dataset_pool': 'dataset_pool'
}
}
})
result = creator.execute()
self.assertDictsEqual(result, expected)
if __name__ == '__main__':
opus_unittest.main()<|fim▁end|> | self.agent_event_set = agent_event_set
self.agent_set = agent_set
def execute(self):
|
<|file_name|>client.go<|end_file_name|><|fim▁begin|>// Package mediaservices implements the Azure ARM Mediaservices service API
// version 2015-10-01.
//
// Media Services resource management APIs.
package mediaservices
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<|fim▁hole|>// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
"github.com/Azure/go-autorest/autorest"
)
const (
// APIVersion is the version of the Mediaservices
APIVersion = "2015-10-01"
// DefaultBaseURI is the default URI used for the service Mediaservices
DefaultBaseURI = "https://management.azure.com"
)
// ManagementClient is the base client for Mediaservices.
type ManagementClient struct {
autorest.Client
BaseURI string
APIVersion string
SubscriptionID string
}
// New creates an instance of the ManagementClient client.
func New(subscriptionID string) ManagementClient {
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewWithBaseURI creates an instance of the ManagementClient client.
func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}<|fim▁end|> | // |
<|file_name|>checkbox.d.ts<|end_file_name|><|fim▁begin|>import { ElementRef, EventEmitter, Renderer, AfterContentInit } from '@angular/core';
import { ControlValueAccessor } from '@angular/common';
export declare class MdCheckboxChange {
source: MdCheckbox;
checked: boolean;
}
/**
* A material design checkbox component. Supports all of the functionality of an HTML5 checkbox,
* and exposes a similar API. An MdCheckbox can be either checked, unchecked, indeterminate, or
* disabled. Note that all additional accessibility attributes are taken care of by the component,
* so there is no need to provide them yourself. However, if you want to omit a label and still
* have the checkbox be accessible, you may supply an [aria-label] input.
* See: https://www.google.com/design/spec/components/selection-controls.html
*/
export declare class MdCheckbox implements AfterContentInit, ControlValueAccessor {
private _renderer;
private _elementRef;
/**
* Attached to the aria-label attribute of the host element. In most cases, arial-labelledby will
* take precedence so this may be omitted.
*/
ariaLabel: string;
/**
* Users can specify the `aria-labelledby` attribute which will be forwarded to the input element
*/
<|fim▁hole|> inputId: string;
/** Whether or not the checkbox should come before or after the label. */
align: 'start' | 'end';
/**
* Whether the checkbox is disabled. When the checkbox is disabled it cannot be interacted with.
* The correct ARIA attributes are applied to denote this to assistive technology.
*/
disabled: boolean;
/**
* The tabindex attribute for the checkbox. Note that when the checkbox is disabled, the attribute
* on the host element will be removed. It will be placed back when the checkbox is re-enabled.
*/
tabindex: number;
/** Name value will be applied to the input element if present */
name: string;
/** Event emitted when the checkbox's `checked` value changes. */
change: EventEmitter<MdCheckboxChange>;
/** Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor. */
onTouched: () => any;
/** Whether the `checked` state has been set to its initial value. */
private _isInitialized;
private _currentAnimationClass;
private _currentCheckState;
private _checked;
private _indeterminate;
private _changeSubscription;
hasFocus: boolean;
constructor(_renderer: Renderer, _elementRef: ElementRef);
/**
* Whether the checkbox is checked. Note that setting `checked` will immediately set
* `indeterminate` to false.
*/
checked: boolean;
/** TODO: internal */
ngAfterContentInit(): void;
/**
* Whether the checkbox is indeterminate. This is also known as "mixed" mode and can be used to
* represent a checkbox with three states, e.g. a checkbox that represents a nested list of
* checkable items. Note that whenever `checked` is set, indeterminate is immediately set to
* false. This differs from the web platform in that indeterminate state on native
* checkboxes is only remove when the user manually checks the checkbox (rather than setting the
* `checked` property programmatically). However, we feel that this behavior is more accommodating
* to the way consumers would envision using this component.
*/
indeterminate: boolean;
/**
* Implemented as part of ControlValueAccessor.
* TODO: internal
*/
writeValue(value: any): void;
/**
* Implemented as part of ControlValueAccessor.
* TODO: internal
*/
registerOnChange(fn: any): void;
/**
* Implemented as part of ControlValueAccessor.
* TODO: internal
*/
registerOnTouched(fn: any): void;
private _transitionCheckState(newState);
private _emitChangeEvent();
/**
* Toggles the `checked` value between true and false
*/
toggle(): void;
private _getAnimationClassForCheckStateTransition(oldState, newState);
}
export declare const MD_CHECKBOX_DIRECTIVES: typeof MdCheckbox[];<|fim▁end|> | ariaLabelledby: string;
/** A unique id for the checkbox. If one is not supplied, it is auto-generated. */
id: string;
/** ID to be applied to the `input` element */
|
<|file_name|>p009.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
use euler::*; mod euler;
#[no_mangle]
pub extern "C" fn solution() -> EulerType {
for a in range_inclusive(5, 500) {
let r = 1000 - a;
for b in range_inclusive(a + 1, r) {
let c = r - b;
if triplet(a, b, c) {
return EulerU(a * b * c);
}
}
}
unreachable!()<|fim▁hole|><|fim▁end|> | }
fn main() { print_euler(solution()) } |
<|file_name|>client.rs<|end_file_name|><|fim▁begin|>#![feature(core, io, test)]
extern crate hyper;
extern crate test;
use std::fmt;
use std::old_io::net::ip::Ipv4Addr;
use hyper::server::{Request, Response, Server};
use hyper::header::Headers;
use hyper::Client;
fn listen() -> hyper::server::Listening {
let server = Server::http(Ipv4Addr(127, 0, 0, 1), 0);
server.listen(handle).unwrap()
}
macro_rules! try_return(
($e:expr) => {{
match $e {
Ok(v) => v,
Err(..) => return
}
}}
);<|fim▁hole|> let mut res = try_return!(res.start());
try_return!(res.write_all(BODY));
try_return!(res.end());
}
#[derive(Clone)]
struct Foo;
impl hyper::header::Header for Foo {
fn header_name() -> &'static str {
"x-foo"
}
fn parse_header(_: &[Vec<u8>]) -> Option<Foo> {
None
}
}
impl hyper::header::HeaderFormat for Foo {
fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.write_str("Bar")
}
}
#[bench]
fn bench_hyper(b: &mut test::Bencher) {
let mut listening = listen();
let s = format!("http://{}/", listening.socket);
let url = s.as_slice();
let mut client = Client::new();
let mut headers = Headers::new();
headers.set(Foo);
b.iter(|| {
client.get(url).header(Foo).send().unwrap().read_to_string().unwrap();
});
listening.close().unwrap()
}<|fim▁end|> |
fn handle(_r: Request, res: Response) {
static BODY: &'static [u8] = b"Benchmarking hyper vs others!"; |
<|file_name|>console.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ja" version="2.0">
<context>
<name>ConsolePlugin</name>
<message>
<location filename="../../plugins/console/consoleplugin.cpp" line="26"/>
<source>Console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consoleplugin.cpp" line="27"/>
<source>Allows to view XML stream between the client and server</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consoleplugin.cpp" line="58"/>
<source>XML Console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consoleplugin.cpp" line="68"/>
<source>Default Context</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ConsoleWidget</name>
<message>
<location filename="../../plugins/console/consolewidget.cpp" line="29"/>
<source><All Streams></source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.cpp" line="70"/>
<source>Search</source>
<translation type="unfinished"/>
</message>
<message><|fim▁hole|> <translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.cpp" line="252"/>
<source>Start sending user stanza...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.cpp" line="256"/>
<source>User stanza sent.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.cpp" line="260"/>
<source>Stanza is not well formed.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.cpp" line="265"/>
<source>XML is not well formed.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.cpp" line="271"/>
<source>New Context</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.cpp" line="271"/>
<source>Enter context name</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ConsoleWidgetClass</name>
<message>
<location filename="../../plugins/console/consolewidget.ui" line="14"/>
<source>XML Console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.ui" line="33"/>
<source>Filter</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.ui" line="42"/>
<source>Stream:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.ui" line="62"/>
<source>Condition:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.ui" line="96"/>
<location filename="../../plugins/console/consolewidget.ui" line="159"/>
<source>Add</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.ui" line="109"/>
<location filename="../../plugins/console/consolewidget.ui" line="172"/>
<source>Remove</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.ui" line="122"/>
<location filename="../../plugins/console/consolewidget.ui" line="322"/>
<source>Clear</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.ui" line="138"/>
<source>Available context:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.ui" line="188"/>
<source>Console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.ui" line="298"/>
<source>Word wrap</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.ui" line="305"/>
<source>Highlight XML</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../../plugins/console/consolewidget.ui" line="315"/>
<source>Send</source>
<translation type="unfinished"/>
</message>
</context>
</TS><|fim▁end|> | <location filename="../../plugins/console/consolewidget.cpp" line="140"/>
<source>XML Console - %1</source> |
<|file_name|>test_GLM2_many_cols_libsvm.py<|end_file_name|><|fim▁begin|>import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm
def write_syn_libsvm_dataset(csvPathname, rowCount, colCount, SEED):
r1 = random.Random(SEED)
dsf = open(csvPathname, "w+")
for i in range(rowCount):
rowData = []
for j in range(colCount):
ri = r1.randint(0,1)
if ri!=0: # don't include 0's
colNumber = j + 1
rowData.append(str(colNumber) + ":" + str(ri))
ri = r1.randint(0,1)
# output class goes first
rowData.insert(0, str(ri))
rowDataCsv = " ".join(rowData) # already all strings
dsf.write(rowDataCsv + "\n")
dsf.close()
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
global SEED
SEED = h2o.setup_random_seed()
h2o.init(1,java_heap_GB=10)
@classmethod
def tearDownClass(cls):
### time.sleep(3600)
h2o.tear_down_cloud()
def test_GLM2_many_cols_libsvm(self):
SYNDATASETS_DIR = h2o.make_syn_dir()
tryList = [
(100, 3000, 'cA', 300),
(100, 5000, 'cB', 500),
# too slow!
# (100, 10000, 'cC', 800),
]
### h2b.browseTheCloud()
lenNodes = len(h2o.nodes)
for (rowCount, colCount, hex_key, timeoutSecs) in tryList:
SEEDPERFILE = random.randint(0, sys.maxint)
csvFilename = 'syn_' + "binary" + "_" + str(rowCount) + 'x' + str(colCount) + '.svm'
csvPathname = SYNDATASETS_DIR + '/' + csvFilename
print "Creating random libsvm:", csvPathname
write_syn_libsvm_dataset(csvPathname, rowCount, colCount, SEEDPERFILE)
parseResult = h2i.import_parse(path=csvPathname, hex_key=hex_key, schema='put', timeoutSecs=timeoutSecs)<|fim▁hole|> # We should be able to see the parse result?
inspect = h2o_cmd.runInspect(None, parseResult['destination_key'])
print "\n" + csvFilename
y = colCount
kwargs = {'response': y, 'max_iter': 2, 'n_folds': 1, 'alpha': 0.2, 'lambda': 1e-5}
start = time.time()
glm = h2o_cmd.runGLM(parseResult=parseResult, timeoutSecs=timeoutSecs, **kwargs)
print "glm end on ", csvPathname, 'took', time.time() - start, 'seconds'
h2o_glm.simpleCheckGLM(self, glm, None, **kwargs)
if __name__ == '__main__':
h2o.unit_main()<|fim▁end|> | print "Parse result['destination_key']:", parseResult['destination_key']
|
<|file_name|>attribute.class.ts<|end_file_name|><|fim▁begin|>export class Attribute {
name = '';
value='';
<|fim▁hole|> codeValues= new Array<string>();
codeSets: any[];
constructor(_name,_value){
this.name=_name;
this.value =_value;
}
};<|fim▁end|> | datatype ='';
isEditable=false;
|
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for asucourses project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
<|fim▁hole|># Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'debug_toolbar',
'south',
'catalog'
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'asucourses.urls'
WSGI_APPLICATION = 'asucourses.wsgi.application'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'templates')
)
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')
]
execfile(os.path.join(BASE_DIR, 'asucourses', 'development_settings.py'))<|fim▁end|> | For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
|
<|file_name|>define_op_template.py<|end_file_name|><|fim▁begin|># Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""A template to define composite ops."""
# pylint: disable=g-direct-tensorflow-import
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
from absl import app
from tensorflow.compiler.mlir.tfr.python.composite import Composite
from tensorflow.compiler.mlir.tfr.python.op_reg_gen import gen_register_op
from tensorflow.compiler.mlir.tfr.python.tfr_gen import tfr_gen_from_module
from tensorflow.python.platform import flags
FLAGS = flags.FLAGS
flags.DEFINE_string(
'output', None,
'Path to write the genereated register op file and MLIR file.')
flags.DEFINE_bool('gen_register_op', True,
'Generate register op cc file or tfr mlir file.')
flags.mark_flag_as_required('output')
@Composite('TestRandom', derived_attrs=['T: numbertype'], outputs=['o: T'])
def _composite_random_op():
pass
def main(_):<|fim▁hole|> generated_code = gen_register_op(sys.modules[__name__], '_composite_')
else:
assert FLAGS.output.endswith('.mlir')
generated_code = tfr_gen_from_module(sys.modules[__name__], '_composite_')
dirname = os.path.dirname(FLAGS.output)
if not os.path.exists(dirname):
os.makedirs(dirname)
with open(FLAGS.output, 'w') as f:
f.write(generated_code)
if __name__ == '__main__':
app.run(main=main)<|fim▁end|> | if FLAGS.gen_register_op:
assert FLAGS.output.endswith('.cc') |
<|file_name|>spruit_atmosphere.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Thu Dec 11 13:55:17 2014
@author: sm1fg
This is the main module to construct a magnetohydrostatic solar atmosphere,
given a specified magnetic network of self-similar magnetic flux tubes and
save the output to gdf format.
To select an existing configuration change the import as model_pars, set Nxyz,
xyz_SI and any other special parameters, then execute mhs_atmopshere.
To add new configurations:
add the model options to set_options in parameters/options.py;
add options required in parameters/model_pars.py;
add alternative empirical data sets to hs_model/;
add alternativ table than interploate_atmosphere in hs_model/hs_atmosphere.py;
add option to get_flux_tubes in mhs_model/flux_tubes.py
If an alternative formulation of the flux tube is required add options to
construct_magnetic_field and construct_pairwise_field in
mhs_model/flux_tubes.py
Plotting options are included in plot/mhs_plot.py
"""
import os
import numpy as np
import pysac.mhs_atmosphere as atm
import astropy.units as u
from pysac.mhs_atmosphere.parameters.model_pars import spruit as model_pars
#==============================================================================
#check whether mpi is required and the number of procs = size
#==============================================================================
try:
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
l_mpi = True
l_mpi = l_mpi and (size != 1)
except ImportError:
l_mpi = False
rank = 0
size = 1
#==============================================================================
#set up model parameters
#==============================================================================
local_procs=1
#optional coordinate - resolution
model_pars['Nxyz'] = [64,64,128] # 3D grid
model_pars['xyz'] = [-0.63*u.Mm,0.63*u.Mm,-0.63*u.Mm,0.63*u.Mm,0.0*u.Mm,12.7*u.Mm] #grid size
#standard set of logical switches
option_pars = atm.set_options(model_pars, l_mpi, l_gdf=True)
#standard conversion to dimensionless units and physical constants
scales, physical_constants = \
atm.get_parameters()
# select the option in the next line
option_pars['l_linear'] = True
# Alfven speed constant along the axis of the flux tube
if option_pars['l_const']:
option_pars['l_B0_quadz'] = True
model_pars['chrom_scale'] *= 5e1
model_pars['p0'] *= 1.5e1
physical_constants['gravity'] *= 1.
model_pars['radial_scale'] *= 1.
# Alfven speed proportional to sqrt(Z) along the axis of the flux tube
elif option_pars['l_sqrt']:
option_pars['l_B0_rootz'] = True
model_pars['chrom_scale'] *= 5.65e-3
model_pars['p0'] *= 1.
physical_constants['gravity'] *= 7.5e3
model_pars['radial_scale'] *= 0.7
# Alfven speed proportional to Z along the axis of the flux tube
elif option_pars['l_linear']:
option_pars['l_B0_rootz'] = True
model_pars['chrom_scale'] *= 0.062
model_pars['p0'] *= 3e2
physical_constants['gravity'] *= 8e3
model_pars['radial_scale'] *= 1.
# Alfven speed proportional to Z^2 along the axis of the flux tube
elif option_pars['l_square']:
option_pars['l_B0_rootz'] = True
model_pars['chrom_scale'] *= 1.65
model_pars['p0'] *= 2e4
physical_constants['gravity'] *= 5e4
model_pars['radial_scale'] *= 1.
# Alfven speed not defined along the axis of the flux tube
else:
option_pars['l_B0_rootz'] = True
model_pars['chrom_scale'] *= 1.
model_pars['p0'] *= 1.
#obtain code coordinates and model parameters in astropy units
coords = atm.get_coords(model_pars['Nxyz'], u.Quantity(model_pars['xyz']))
#==============================================================================
#calculate 1d hydrostatic balance from empirical density profile
#==============================================================================
pressure_Z, rho_Z, Rgas_Z = atm.get_spruit_hs(coords['Z'],
model_pars,
physical_constants,
option_pars
)
#==============================================================================
# load flux tube footpoint parameters
#==============================================================================
# axial location and value of Bz at each footpoint
xi, yi, Si = atm.get_flux_tubes(
model_pars,
coords,
option_pars
)
#==============================================================================
# split domain into processes if mpi
#==============================================================================
ax, ay, az = np.mgrid[coords['xmin']:coords['xmax']:1j*model_pars['Nxyz'][0],
coords['ymin']:coords['ymax']:1j*model_pars['Nxyz'][1],
coords['zmin']:coords['zmax']:1j*model_pars['Nxyz'][2]]
# split the grid between processes for mpi
if l_mpi:
x_chunks = np.array_split(ax, size, axis=0)
y_chunks = np.array_split(ay, size, axis=0)
z_chunks = np.array_split(az, size, axis=0)
x = comm.scatter(x_chunks, root=0)
y = comm.scatter(y_chunks, root=0)
z = comm.scatter(z_chunks, root=0)
else:
x, y, z = ax, ay, az
x = u.Quantity(x, unit=coords['xmin'].unit)
y = u.Quantity(y, unit=coords['ymin'].unit)
z = u.Quantity(z, unit=coords['zmin'].unit)
#==============================================================================
# initialize zero arrays in which to add magnetic field and mhs adjustments
#==============================================================================
Bx = u.Quantity(np.zeros(x.shape), unit=u.T) # magnetic x-component
By = u.Quantity(np.zeros(x.shape), unit=u.T) # magnetic y-component
Bz = u.Quantity(np.zeros(x.shape), unit=u.T) # magnetic z-component
pressure_m = u.Quantity(np.zeros(x.shape), unit=u.Pa) # magneto-hydrostatic adjustment to pressure
rho_m = u.Quantity(np.zeros(x.shape), unit=u.kg/u.m**3) # magneto-hydrostatic adjustment to density
# initialize zero arrays in which to add balancing forces and magnetic tension
Fx = u.Quantity(np.zeros(x.shape), unit=u.N/u.m**3) # balancing force x-component
Fy = u.Quantity(np.zeros(x.shape), unit=u.N/u.m**3) # balancing force y-component
# total tension force for comparison with residual balancing force
Btensx = u.Quantity(np.zeros(x.shape), unit=u.N/u.m**3)
Btensy = u.Quantity(np.zeros(x.shape), unit=u.N/u.m**3)
#==============================================================================
#calculate the magnetic field and pressure/density balancing expressions
#==============================================================================
for i in range(0,model_pars['nftubes']):
for j in range(i,model_pars['nftubes']):
if rank == 0:
print'calculating ij-pair:',i,j
if i == j:
pressure_mi, rho_mi, Bxi, Byi ,Bzi, B2x, B2y =\
atm.construct_magnetic_field(
x, y, z,
xi[i], yi[i], Si[i],
model_pars, option_pars,
physical_constants,
scales
)
Bx, By, Bz = Bxi+Bx, Byi+By ,Bzi+Bz
Btensx += B2x
Btensy += B2y
pressure_m += pressure_mi
rho_m += rho_mi
else:
pressure_mi, rho_mi, Fxi, Fyi, B2x, B2y =\
atm.construct_pairwise_field(
x, y, z,
xi[i], yi[i],
xi[j], yi[j], Si[i], Si[j],
model_pars,
option_pars,
physical_constants,
scales
)
pressure_m += pressure_mi
rho_m += rho_mi
Fx += Fxi
Fy += Fyi
Btensx += B2x
Btensy += B2y
# clear some memory
del pressure_mi, rho_mi, Bxi, Byi ,Bzi, B2x, B2y
#==============================================================================
# Construct 3D hs arrays and then add the mhs adjustments to obtain atmosphere
#==============================================================================
# select the 1D array spanning the local mpi process; the add/sub of dz to
# ensure all indices are used, but only once
indz = np.where(coords['Z'] >= z.min()-0.1*coords['dz']) and \
np.where(coords['Z'] <= z.max()+0.1*coords['dz'])
pressure_z, rho_z, Rgas_z = pressure_Z[indz], rho_Z[indz], Rgas_Z[indz]
# local proc 3D mhs arrays
pressure, rho = atm.mhs_3D_profile(z,
pressure_z,
rho_z,
pressure_m,
rho_m
)
magp = (Bx**2 + By**2 + Bz**2)/(2.*physical_constants['mu0'])
if rank ==0:
print'max B corona = ',magp[:,:,-1].max().decompose()
energy = atm.get_internal_energy(pressure,
magp,
physical_constants)
#============================================================================
# Save data for SAC and plotting
#============================================================================
# set up data directory and file names
# may be worthwhile locating on /data if files are large
datadir = os.path.expanduser('~/Documents/mhs_atmosphere/'+model_pars['model']+'/')
filename = datadir + model_pars['model'] + option_pars['suffix']
if not os.path.exists(datadir):
os.makedirs(datadir)
sourcefile = datadir + model_pars['model'] + '_sources' + option_pars['suffix']
aux3D = datadir + model_pars['model'] + '_3Daux' + option_pars['suffix']
aux1D = datadir + model_pars['model'] + '_1Daux' + option_pars['suffix']
# save the variables for the initialisation of a SAC simulation
atm.save_SACvariables(
filename,
rho,
Bx,
By,
Bz,
energy,
option_pars,
physical_constants,
coords,
model_pars['Nxyz']<|fim▁hole|> sourcefile,
Fx,
Fy,
option_pars,
physical_constants,
coords,
model_pars['Nxyz']
)
# save auxilliary variable and 1D profiles for plotting and analysis
Rgas = u.Quantity(np.zeros(x.shape), unit=Rgas_z.unit)
Rgas[:] = Rgas_z
temperature = pressure/rho/Rgas
if not option_pars['l_hdonly']:
inan = np.where(magp <=1e-7*pressure.min())
magpbeta = magp
magpbeta[inan] = 1e-7*pressure.min() # low pressure floor to avoid NaN
pbeta = pressure/magpbeta
else:
pbeta = magp+1.0 #dummy to avoid NaN
alfven = np.sqrt(2.*magp/rho)
if rank == 0:
print'Alfven speed Z.min to Z.max =',\
alfven[model_pars['Nxyz'][0]/2,model_pars['Nxyz'][1]/2, 0].decompose(),\
alfven[model_pars['Nxyz'][0]/2,model_pars['Nxyz'][1]/2,-1].decompose()
cspeed = np.sqrt(physical_constants['gamma']*pressure/rho)
atm.save_auxilliary3D(
aux3D,
pressure_m,
rho_m,
temperature,
pbeta,
alfven,
cspeed,
Btensx,
Btensy,
option_pars,
physical_constants,
coords,
model_pars['Nxyz']
)
atm.save_auxilliary1D(
aux1D,
pressure_Z,
rho_Z,
Rgas_Z,
option_pars,
physical_constants,
coords,
model_pars['Nxyz']
)<|fim▁end|> | )
# save the balancing forces as the background source terms for SAC simulation
atm.save_SACsources( |
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016 CERN.
#
# Zenodo is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Zenodo is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Zenodo; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.
"""Test API for Zenodo and GitHub integration."""
from __future__ import absolute_import, print_function
from contextlib import contextmanager
from copy import deepcopy
import pytest
from flask import current_app
from invenio_accounts.models import User
from invenio_github.models import Release, ReleaseStatus, Repository
from invenio_pidrelations.contrib.versioning import PIDVersioning
from invenio_pidstore.models import PersistentIdentifier, PIDStatus
from invenio_sipstore.models import SIP
from mock import MagicMock, Mock, patch
from six import BytesIO
from zenodo.modules.deposit.tasks import datacite_register
from zenodo.modules.github.api import ZenodoGitHubRelease
from zenodo.modules.github.utils import is_github_owner, is_github_versioned
from zenodo.modules.records.api import ZenodoRecord
from zenodo.modules.records.minters import zenodo_record_minter
from zenodo.modules.records.permissions import has_newversion_permission, \
has_update_permission
creators_params = (
(dict(),
[dict(name='Contributor', affiliation='X'), ],
[dict(name='Owner', affiliation='Y'), ],
[dict(name='Contributor', affiliation='X'), ]),
(dict(creators=[]), # List of creators provided as empty
[dict(name='Contributor', affiliation='X'), ],
[dict(name='Owner', affiliation='Y'), ],
[dict(name='Owner', affiliation='Y'), ]),
(dict(creators=None),
[dict(name='Contributor', affiliation='X'), ],
None, # Failed to get GH owner
[dict(name='Unknown', affiliation=''), ]),
)
@pytest.mark.parametrize('defaults,contribs,owner,output', creators_params)
@patch('zenodo.modules.github.api.get_owner')
@patch('zenodo.modules.github.api.get_contributors')
@patch('zenodo.modules.github.api.legacyjson_v1_translator')
def test_github_creators_metadata(m_ljv1t, m_get_contributors, m_get_owner,
defaults, contribs, owner, output):
"""Test 'creators' metadata fetching from GitHub."""
m_get_contributors.return_value = contribs
m_get_owner.return_value = owner
release = MagicMock()
release.event.user_id = 1
release.event.payload['repository']['id'] = 1
zgh = ZenodoGitHubRelease(release)
zgh.defaults = defaults
zgh.gh.api = None
zgh.extra_metadata = {}
zgh.metadata
m_ljv1t.assert_called_with({'metadata': {'creators': output}})
@patch('zenodo.modules.github.api.ZenodoGitHubRelease.metadata')
@patch('invenio_pidstore.providers.datacite.DataCiteMDSClient')
def test_github_publish(datacite_mock, zgh_meta, db, users, location,
deposit_metadata):
"""Test basic GitHub payload."""
data = b'foobar'
resp = Mock()<|fim▁hole|> gh3mock = MagicMock()
gh3mock.api.session.get = Mock(return_value=resp)
gh3mock.account.user.email = '[email protected]'
release = MagicMock()
release.event.user_id = 1
release.event.payload['release']['author']['id'] = 1
release.event.payload['foo']['bar']['baz'] = 1
release.event.payload['repository']['id'] = 1
zgh = ZenodoGitHubRelease(release)
zgh.gh = gh3mock
zgh.release = dict(author=dict(id=1))
zgh.metadata = deposit_metadata
zgh.files = (('foobar.txt', None), )
zgh.model.repository.releases.filter_by().count.return_value = 0
datacite_task_mock = MagicMock()
# We have to make the call to the task synchronous
datacite_task_mock.delay = datacite_register.apply
with patch('zenodo.modules.deposit.tasks.datacite_register',
new=datacite_task_mock):
zgh.publish()
# datacite should be called twice - for regular DOI and Concept DOI
assert datacite_mock().metadata_post.call_count == 2
datacite_mock().doi_post.assert_any_call(
'10.5072/zenodo.1', 'https://zenodo.org/record/1')
datacite_mock().doi_post.assert_any_call(
'10.5072/zenodo.2', 'https://zenodo.org/record/2')
expected_sip_agent = {
'email': '[email protected]',
'$schema': 'http://zenodo.org/schemas/sipstore/'
'agent-githubclient-v1.0.0.json',
'user_id': 1,
'github_id': 1,
}
gh_sip = SIP.query.one()
assert gh_sip.agent == expected_sip_agent
@patch('invenio_github.api.GitHubAPI.check_sync', new=lambda *_, **__: False)
def test_github_newversion_permissions(app, db, minimal_record, users, g_users,
g_remoteaccounts):
"""Test new version creation permissions for GitHub records."""
old_owner, new_owner = [User.query.get(u['id']) for u in g_users]
# Create repository, and set owner to `old_owner`
repo = Repository.create(
name='foo/bar', github_id=8000, user_id=old_owner.id, hook=1234)
# Create concpetrecid for the GitHub records
conceptrecid = PersistentIdentifier.create(
'recid', '100', status=PIDStatus.RESERVED)
def create_deposit_and_record(pid_value, owner):
"""Utility function for creating records and deposits."""
recid = PersistentIdentifier.create(
'recid', pid_value, status=PIDStatus.RESERVED)
pv = PIDVersioning(parent=conceptrecid)
pv.insert_draft_child(recid)
depid = PersistentIdentifier.create(
'depid', pid_value, status=PIDStatus.REGISTERED)
deposit = ZenodoRecord.create({'_deposit': {'id': depid.pid_value},
'conceptrecid': conceptrecid.pid_value,
'recid': recid.pid_value})
deposit.commit()
depid.assign('rec', deposit.id)
record_metadata = deepcopy(minimal_record)
record_metadata['_deposit'] = {'id': depid.pid_value}
record_metadata['conceptrecid'] = conceptrecid.pid_value
record_metadata['recid'] = int(recid.pid_value)
record_metadata['owners'] = [owner.id]
record = ZenodoRecord.create(record_metadata)
zenodo_record_minter(record.id, record)
record.commit()
return (depid, deposit, recid, record)
# Create first GitHub record (by `old_owner`)
depid1, d1, recid1, r1 = create_deposit_and_record('101', old_owner)
rel1 = Release(release_id=111, repository_id=repo.id, record_id=d1.id,
status=ReleaseStatus.PUBLISHED)
db.session.add(rel1)
db.session.commit()
assert is_github_versioned(recid1)
@contextmanager
def set_identity(user):
from flask_principal import AnonymousIdentity, Identity
principal = current_app.extensions['security'].principal
principal.set_identity(Identity(user))
yield
principal.set_identity(AnonymousIdentity())
with app.test_request_context():
with set_identity(old_owner):
assert is_github_owner(old_owner, recid1)
assert has_update_permission(old_owner, r1)
assert has_newversion_permission(old_owner, r1)
with set_identity(new_owner):
assert not is_github_owner(new_owner, recid1)
assert not has_update_permission(new_owner, r1)
assert not has_newversion_permission(new_owner, r1)
# Change the repository owner
repo.user_id = new_owner.id
db.session.add(repo)
db.session.commit()
with app.test_request_context():
with set_identity(old_owner):
assert not is_github_owner(old_owner, recid1)
# `old_owner` can edit his record of course
assert has_update_permission(old_owner, r1)
assert has_newversion_permission(old_owner, r1)
with set_identity(new_owner):
assert is_github_owner(new_owner, recid1)
# `new_owner` can't edit the `old_owner`'s record
assert not has_update_permission(new_owner, r1)
assert not has_newversion_permission(new_owner, r1)
# Create second GitHub record (by `new_owner`)
depid2, d2, recid2, r2 = create_deposit_and_record('102', new_owner)
rel2 = Release(release_id=222, repository_id=repo.id, record_id=d2.id,
status=ReleaseStatus.PUBLISHED)
db.session.add(rel2)
db.session.commit()
with app.test_request_context():
with set_identity(old_owner):
assert not is_github_owner(old_owner, recid1)
assert not is_github_owner(old_owner, recid2)
assert has_update_permission(old_owner, r1)
# `old_owner` can't edit the `new_owner`'s record
assert not has_update_permission(old_owner, r2)
assert not has_newversion_permission(old_owner, r1)
assert not has_newversion_permission(old_owner, r2)
with set_identity(new_owner):
assert is_github_owner(new_owner, recid1)
assert is_github_owner(new_owner, recid2)
assert not has_update_permission(new_owner, r1)
# `new_owner` can edit his newly released record
assert has_update_permission(new_owner, r2)
assert has_newversion_permission(new_owner, r1)
assert has_newversion_permission(new_owner, r2)
# Create a manual record (by `new_owner`)
depid3, d3, recid3, r3 = create_deposit_and_record('103', new_owner)
db.session.commit()
with app.test_request_context():
with set_identity(old_owner):
assert not is_github_owner(old_owner, recid3)
assert not has_update_permission(old_owner, r3)
assert not has_newversion_permission(old_owner, r3)
with set_identity(new_owner):
assert is_github_owner(new_owner, recid3)
assert has_update_permission(new_owner, r3)
assert has_newversion_permission(new_owner, r3)<|fim▁end|> | resp.headers = {'Content-Length': len(data)}
resp.raw = BytesIO(b'foobar')
resp.status_code = 200 |
<|file_name|>BackstopException.js<|end_file_name|><|fim▁begin|>module.exports = class BackstopException {<|fim▁hole|> constructor (msg, scenario, viewport, originalError) {
this.msg = msg;
this.scenario = scenario;
this.viewport = viewport;
this.originalError = originalError;
}
toString () {
return 'BackstopException: ' +
this.scenario.label + ' on ' +
this.viewport.label + ': ' +
this.originalError.toString();
}
};<|fim▁end|> | |
<|file_name|>translate-unit-warning-confirm-dialog.component.ts<|end_file_name|><|fim▁begin|>import {Component, Inject, OnInit} from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog";
/**
* Dialog used by translate-unit-component to show errors and warning.
* There are 3 possible results:
* 'cancel': do not do anything, stay on this trans unit.
* 'discard': do not translate, leave transunit unchanged, but go to the next/prev unit.
* 'accept': translate tu as given, ignoring warnings (errors cannot be ignored).
*/
@Component({
selector: 'app-translate-unit-warning-confirm-dialog',
templateUrl: './translate-unit-warning-confirm-dialog.component.html',
styleUrls: ['./translate-unit-warning-confirm-dialog.component.css']
})
export class TranslateUnitWarningConfirmDialogComponent implements OnInit {
constructor(public dialogRef: MatDialogRef<TranslateUnitWarningConfirmDialogComponent>, @Inject(MAT_DIALOG_DATA) public data: any ) { }
ngOnInit() {
}
accept() {
this.dialogRef.close('accept');
}
discard() {
this.dialogRef.close('discard');
}
cancel() {
this.dialogRef.close('cancel');<|fim▁hole|>}<|fim▁end|> | } |
<|file_name|>jquery.dragsort.js<|end_file_name|><|fim▁begin|>// jQuery List DragSort v0.4
// Website: http://dragsort.codeplex.com/
// License: http://dragsort.codeplex.com/license
(function($) {
$.fn.dragsort = function(options) {
var opts = $.extend({}, $.fn.dragsort.defaults, options);
var lists = [];
var list = null, lastPos = null;
if (this.selector)
$("head").append("<style type='text/css'>" + (this.selector.split(",").join(" " + opts.dragSelector + ",") + " " + opts.dragSelector) + " { cursor: pointer; }</style>");
this.each(function(i, cont) {
if ($(cont).is("table") && $(cont).children().size() == 1 && $(cont).children().is("tbody"))
cont = $(cont).children().get(0);
var newList = {
draggedItem: null,
placeHolderItem: null,
pos: null,
offset: null,
offsetLimit: null,
scroll: null,
container: cont,
init: function() {
$(this.container).attr("data-listIdx", i).mousedown(this.grabItem).find(opts.dragSelector).css("cursor", "pointer");
$(this.container).children(opts.itemSelector).each(function(j) { $(this).attr("data-itemIdx", j); });
},
grabItem: function(e) {<|fim▁hole|> var elm = e.target;
while (!$(elm).is("[data-listIdx='" + $(this).attr("data-listIdx") + "'] " + opts.dragSelector)) {
if (elm == this) return;
elm = elm.parentNode;
}
if (list != null && list.draggedItem != null)
list.dropItem();
$(e.target).css("cursor", "move");
list = lists[$(this).attr("data-listIdx")];
list.draggedItem = $(elm).closest(opts.itemSelector);
var mt = parseInt(list.draggedItem.css("marginTop"));
var ml = parseInt(list.draggedItem.css("marginLeft"));
list.offset = list.draggedItem.offset();
list.offset.top = e.pageY - list.offset.top + (isNaN(mt) ? 0 : mt) - 1;
list.offset.left = e.pageX - list.offset.left + (isNaN(ml) ? 0 : ml) - 1;
if (!opts.dragBetween) {
var containerHeight = $(list.container).outerHeight() == 0 ? Math.max(1, Math.round(0.5 + $(list.container).children(opts.itemSelector).size() * list.draggedItem.outerWidth() / $(list.container).outerWidth())) * list.draggedItem.outerHeight() : $(list.container).outerHeight();
list.offsetLimit = $(list.container).offset();
list.offsetLimit.right = list.offsetLimit.left + $(list.container).outerWidth() - list.draggedItem.outerWidth();
list.offsetLimit.bottom = list.offsetLimit.top + containerHeight - list.draggedItem.outerHeight();
}
var h = list.draggedItem.height();
var w = list.draggedItem.width();
var orig = list.draggedItem.attr("style");
list.draggedItem.attr("data-origStyle", orig ? orig : "");
if (opts.itemSelector == "tr") {
list.draggedItem.children().each(function() { $(this).width($(this).width()); });
list.placeHolderItem = list.draggedItem.clone().attr("data-placeHolder", true);
list.draggedItem.after(list.placeHolderItem);
list.placeHolderItem.children().each(function() { $(this).css({ borderWidth:0, width: $(this).width() + 1, height: $(this).height() + 1 }).html(" "); });
} else {
list.draggedItem.after(opts.placeHolderTemplate);
list.placeHolderItem = list.draggedItem.next().css({ height: h, width: w }).attr("data-placeHolder", true);
}
list.draggedItem.css({ position: "absolute", opacity: 0.8, "z-index": 999, height: h, width: w });
$(lists).each(function(i, l) { l.createDropTargets(); l.buildPositionTable(); });
list.scroll = { moveX: 0, moveY: 0, maxX: $(document).width() - $(window).width(), maxY: $(document).height() - $(window).height() };
list.scroll.scrollY = window.setInterval(function() {
if (opts.scrollContainer != window) {
$(opts.scrollContainer).scrollTop($(opts.scrollContainer).scrollTop() + list.scroll.moveY);
return;
}
var t = $(opts.scrollContainer).scrollTop();
if (list.scroll.moveY > 0 && t < list.scroll.maxY || list.scroll.moveY < 0 && t > 0) {
$(opts.scrollContainer).scrollTop(t + list.scroll.moveY);
list.draggedItem.css("top", list.draggedItem.offset().top + list.scroll.moveY + 1);
}
}, 10);
list.scroll.scrollX = window.setInterval(function() {
if (opts.scrollContainer != window) {
$(opts.scrollContainer).scrollLeft($(opts.scrollContainer).scrollLeft() + list.scroll.moveX);
return;
}
var l = $(opts.scrollContainer).scrollLeft();
if (list.scroll.moveX > 0 && l < list.scroll.maxX || list.scroll.moveX < 0 && l > 0) {
$(opts.scrollContainer).scrollLeft(l + list.scroll.moveX);
list.draggedItem.css("left", list.draggedItem.offset().left + list.scroll.moveX + 1);
}
}, 10);
list.setPos(e.pageX, e.pageY);
$(document).bind("selectstart", list.stopBubble); //stop ie text selection
$(document).bind("mousemove", list.swapItems);
$(document).bind("mouseup", list.dropItem);
if (opts.scrollContainer != window)
$(window).bind("DOMMouseScroll mousewheel", list.wheel);
return false; //stop moz text selection
},
setPos: function(x, y) {
var top = y - this.offset.top;
var left = x - this.offset.left;
if (!opts.dragBetween) {
top = Math.min(this.offsetLimit.bottom, Math.max(top, this.offsetLimit.top));
left = Math.min(this.offsetLimit.right, Math.max(left, this.offsetLimit.left));
}
this.draggedItem.parents().each(function() {
if ($(this).css("position") != "static" && (!$.browser.mozilla || $(this).css("display") != "table")) {
var offset = $(this).offset();
top -= offset.top;
left -= offset.left;
return false;
}
});
if (opts.scrollContainer == window) {
y -= $(window).scrollTop();
x -= $(window).scrollLeft();
y = Math.max(0, y - $(window).height() + 5) + Math.min(0, y - 5);
x = Math.max(0, x - $(window).width() + 5) + Math.min(0, x - 5);
} else {
var cont = $(opts.scrollContainer);
var offset = cont.offset();
y = Math.max(0, y - cont.height() - offset.top) + Math.min(0, y - offset.top);
x = Math.max(0, x - cont.width() - offset.left) + Math.min(0, x - offset.left);
}
list.scroll.moveX = x == 0 ? 0 : x * opts.scrollSpeed / Math.abs(x);
list.scroll.moveY = y == 0 ? 0 : y * opts.scrollSpeed / Math.abs(y);
this.draggedItem.css({ top: top, left: left });
},
wheel: function(e) {
if (($.browser.safari || $.browser.mozilla) && list && opts.scrollContainer != window) {
var cont = $(opts.scrollContainer);
var offset = cont.offset();
if (e.pageX > offset.left && e.pageX < offset.left + cont.width() && e.pageY > offset.top && e.pageY < offset.top + cont.height()) {
var delta = e.detail ? e.detail * 5 : e.wheelDelta / -2;
cont.scrollTop(cont.scrollTop() + delta);
e.preventDefault();
}
}
},
buildPositionTable: function() {
var item = this.draggedItem == null ? null : this.draggedItem.get(0);
var pos = [];
$(this.container).children(opts.itemSelector).each(function(i, elm) {
if (elm != item) {
var loc = $(elm).offset();
loc.right = loc.left + $(elm).width();
loc.bottom = loc.top + $(elm).height();
loc.elm = elm;
pos.push(loc);
}
});
this.pos = pos;
},
dropItem: function() {
if (list.draggedItem == null)
return;
$(list.container).find(opts.dragSelector).css("cursor", "pointer");
list.placeHolderItem.before(list.draggedItem);
//list.draggedItem.attr("style", "") doesn't work on IE8 and jQuery 1.5 or lower
//list.draggedItem.removeAttr("style") doesn't work on chrome and jQuery 1.6 (works jQuery 1.5 or lower)
var orig = list.draggedItem.attr("data-origStyle");
list.draggedItem.attr("style", orig);
if (orig == "")
list.draggedItem.removeAttr("style");
list.draggedItem.removeAttr("data-origStyle");
list.placeHolderItem.remove();
$("[data-dropTarget]").remove();
window.clearInterval(list.scroll.scrollY);
window.clearInterval(list.scroll.scrollX);
var changed = false;
$(lists).each(function() {
$(this.container).children(opts.itemSelector).each(function(j) {
if (parseInt($(this).attr("data-itemIdx")) != j) {
changed = true;
$(this).attr("data-itemIdx", j);
}
});
});
if (changed)
opts.dragEnd.apply(list.draggedItem);
list.draggedItem = null;
$(document).unbind("selectstart", list.stopBubble);
$(document).unbind("mousemove", list.swapItems);
$(document).unbind("mouseup", list.dropItem);
if (opts.scrollContainer != window)
$(window).unbind("DOMMouseScroll mousewheel", list.wheel);
return false;
},
stopBubble: function() { return false; },
swapItems: function(e) {
if (list.draggedItem == null)
return false;
list.setPos(e.pageX, e.pageY);
var ei = list.findPos(e.pageX, e.pageY);
var nlist = list;
for (var i = 0; ei == -1 && opts.dragBetween && i < lists.length; i++) {
ei = lists[i].findPos(e.pageX, e.pageY);
nlist = lists[i];
}
if (ei == -1 || $(nlist.pos[ei].elm).attr("data-placeHolder"))
return false;
if (lastPos == null || lastPos.top > list.draggedItem.offset().top || lastPos.left > list.draggedItem.offset().left)
$(nlist.pos[ei].elm).before(list.placeHolderItem);
else
$(nlist.pos[ei].elm).after(list.placeHolderItem);
$(lists).each(function(i, l) { l.createDropTargets(); l.buildPositionTable(); });
lastPos = list.draggedItem.offset();
return false;
},
findPos: function(x, y) {
for (var i = 0; i < this.pos.length; i++) {
if (this.pos[i].left < x && this.pos[i].right > x && this.pos[i].top < y && this.pos[i].bottom > y)
return i;
}
return -1;
},
createDropTargets: function() {
if (!opts.dragBetween)
return;
$(lists).each(function() {
var ph = $(this.container).find("[data-placeHolder]");
var dt = $(this.container).find("[data-dropTarget]");
if (ph.size() > 0 && dt.size() > 0)
dt.remove();
else if (ph.size() == 0 && dt.size() == 0) {
//list.placeHolderItem.clone().removeAttr("data-placeHolder") crashes in IE7 and jquery 1.5.1 (doesn't in jquery 1.4.2 or IE8)
$(this.container).append(list.placeHolderItem.removeAttr("data-placeHolder").clone().attr("data-dropTarget", true));
list.placeHolderItem.attr("data-placeHolder", true);
}
});
}
};
newList.init();
lists.push(newList);
});
return this;
};
$.fn.dragsort.defaults = {
itemSelector: "li",
dragSelector: "li",
dragSelectorExclude: "input, textarea, a[href]",
dragEnd: function() { },
dragBetween: false,
placeHolderTemplate: "<li> </li>",
scrollContainer: window,
scrollSpeed: 5
};
})(jQuery);<|fim▁end|> | if (e.which != 1 || $(e.target).is(opts.dragSelectorExclude))
return;
|
<|file_name|>fake_service.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from cinder.backup.driver import BackupDriver
from cinder.openstack.common import log as logging
LOG = logging.getLogger(__name__)
class FakeBackupService(BackupDriver):
def __init__(self, context, db_driver=None):
super(FakeBackupService, self).__init__(context, db_driver)<|fim▁hole|>
def restore(self, backup, volume_id, volume_file):
pass
def delete(self, backup):
# if backup has magic name of 'fail_on_delete'
# we raise an error - useful for some tests -
# otherwise we return without error
if backup['display_name'] == 'fail_on_delete':
raise IOError('fake')
def get_backup_driver(context):
return FakeBackupService(context)<|fim▁end|> |
def backup(self, backup, volume_file):
pass |
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Wgsim(Package):<|fim▁hole|> (INDEL) polymorphisms, and simulate reads with uniform substitution
sequencing errors. It does not generate INDEL sequencing errors, but this
can be partly compensated by simulating INDEL polymorphisms."""
homepage = "https://github.com/lh3/wgsim"
git = "https://github.com/lh3/wgsim.git"
version('2011.10.17', commit='a12da3375ff3b51a5594d4b6fa35591173ecc229')
depends_on('zlib')
def install(self, spec, prefix):
cc = Executable(spack_cc)
cc('-g', '-O2', '-Wall', '-o', 'wgsim', 'wgsim.c', '-lz', '-lm')
install_tree(self.stage.source_path, prefix.bin)<|fim▁end|> | """Wgsim is a small tool for simulating sequence reads from a reference
genome.
It is able to simulate diploid genomes with SNPs and insertion/deletion |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use std::borrow::Cow;
use std::error::Error;
use std::path::{Path, PathBuf};
use std::io;
use std::fs;
pub trait Filesystem {
type Error: Error + Send + Sync + 'static;
type File: io::Read + io::Write + io::Seek;
fn create_dir(&self, path: &Path) -> Result<(), Self::Error>;
fn create_dir_all(&self, path: &Path) -> Result<(), Self::Error>;
fn create(&self, path: &Path) -> Result<Self::File, Self::Error>;
fn open(&self, path: &Path) -> Result<Self::File, Self::Error>;
}
pub struct StdFilesystem(Option<PathBuf>);
impl StdFilesystem {
pub fn new<P: Into<PathBuf>>(root: P) -> Self {
StdFilesystem(Some(root.into()))
}
fn path<'a>(&self, path: &'a Path) -> Cow<'a, Path> {
if let Some(mut root) = self.0.as_ref().map(Clone::clone) {
root.push(path);
Cow::Owned(root)
} else {
Cow::Borrowed(path)
}
}
}
impl Default for StdFilesystem {
fn default() -> Self {
StdFilesystem(None)
}
}
impl Filesystem for StdFilesystem {
type Error = io::Error;
type File = fs::File;
fn create(&self, path: &Path) -> Result<Self::File, Self::Error> {
fs::File::create(self.path(path))
}
fn open(&self, path: &Path) -> Result<Self::File, Self::Error> {
fs::File::open(self.path(path))
}
fn create_dir(&self, path: &Path) -> Result<(), Self::Error> {
fs::create_dir(self.path(path))
}
fn create_dir_all(&self, path: &Path) -> Result<(), Self::Error> {
fs::create_dir_all(self.path(path))
}
}
pub type FilesystemObject = Filesystem<Error = io::Error, File = Box<ReadWriteSeek>>;
pub struct FilesystemDynamic<F>(F);
pub struct FileDynamic<F>(F);
pub trait ReadWriteSeek: io::Read + io::Write + io::Seek { }
impl<F: io::Read + io::Write + io::Seek> ReadWriteSeek for F { }
<|fim▁hole|>
impl<'a, F: Filesystem + 'a> Filesystem for FilesystemDynamic<F> {
type Error = io::Error;
type File = Box<ReadWriteSeek + 'a>;
fn create(&self, path: &Path) -> Result<Self::File, Self::Error> {
self.0.create(path).map(|f| Box::new(FileDynamic(f)) as Box<_>).map_err(io_error)
}
fn open(&self, path: &Path) -> Result<Self::File, Self::Error> {
self.0.open(path).map(|f| Box::new(FileDynamic(f)) as Box<_>).map_err(io_error)
}
fn create_dir(&self, path: &Path) -> Result<(), Self::Error> {
self.0.create_dir(path).map_err(io_error)
}
fn create_dir_all(&self, path: &Path) -> Result<(), Self::Error> {
self.0.create_dir_all(path).map_err(io_error)
}
}
impl<F: io::Read> io::Read for FileDynamic<F> {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
self.0.read(buf)
}
}
impl<F: io::Write> io::Write for FileDynamic<F> {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.0.write(buf)
}
fn flush(&mut self) -> io::Result<()> {
self.0.flush()
}
}
impl<F: io::Seek> io::Seek for FileDynamic<F> {
fn seek(&mut self, seek: io::SeekFrom) -> io::Result<u64> {
self.0.seek(seek)
}
}<|fim▁end|> | fn io_error<E: Error + Send + Sync + 'static>(e: E) -> io::Error {
io::Error::new(io::ErrorKind::Other, e)
} |
<|file_name|>index-compiled.js<|end_file_name|><|fim▁begin|>"use strict";
exports.__esModule = true;
// istanbul ignore next
var _createClass = (function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
}
}return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
};
})();
// istanbul ignore next
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
}
}newObj["default"] = obj;return newObj;
}
}
// istanbul ignore next
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { "default": obj };
}
// istanbul ignore next
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var _convertSourceMap = require("convert-source-map");
var _convertSourceMap2 = _interopRequireDefault(_convertSourceMap);
var _modules = require("../modules");
var _modules2 = _interopRequireDefault(_modules);
var _optionsOptionManager = require("./options/option-manager");
var _optionsOptionManager2 = _interopRequireDefault(_optionsOptionManager);
var _pluginManager = require("./plugin-manager");
var _pluginManager2 = _interopRequireDefault(_pluginManager);
var _shebangRegex = require("shebang-regex");
var _shebangRegex2 = _interopRequireDefault(_shebangRegex);
var _traversalPath = require("../../traversal/path");
var _traversalPath2 = _interopRequireDefault(_traversalPath);
var _lodashLangIsFunction = require("lodash/lang/isFunction");
var _lodashLangIsFunction2 = _interopRequireDefault(_lodashLangIsFunction);
var _sourceMap = require("source-map");
var _sourceMap2 = _interopRequireDefault(_sourceMap);
var _generation = require("../../generation");
var _generation2 = _interopRequireDefault(_generation);
var _helpersCodeFrame = require("../../helpers/code-frame");
var _helpersCodeFrame2 = _interopRequireDefault(_helpersCodeFrame);
var _lodashObjectDefaults = require("lodash/object/defaults");
var _lodashObjectDefaults2 = _interopRequireDefault(_lodashObjectDefaults);
var _lodashCollectionIncludes = require("lodash/collection/includes");
var _lodashCollectionIncludes2 = _interopRequireDefault(_lodashCollectionIncludes);
var _traversal = require("../../traversal");
var _traversal2 = _interopRequireDefault(_traversal);
var _tryResolve = require("try-resolve");
var _tryResolve2 = _interopRequireDefault(_tryResolve);
var _logger = require("./logger");
var _logger2 = _interopRequireDefault(_logger);
var _plugin = require("../plugin");
var _plugin2 = _interopRequireDefault(_plugin);
var _helpersParse = require("../../helpers/parse");
var _helpersParse2 = _interopRequireDefault(_helpersParse);
var _traversalHub = require("../../traversal/hub");
var _traversalHub2 = _interopRequireDefault(_traversalHub);
var _util = require("../../util");
var util = _interopRequireWildcard(_util);
var _path = require("path");
var _path2 = _interopRequireDefault(_path);
var _types = require("../../types");
var t = _interopRequireWildcard(_types);
/**
* [Please add a description.]
*/
var File = (function () {
function File(opts, pipeline) {
if (opts === undefined) opts = {};
_classCallCheck(this, File);
this.transformerDependencies = {};
this.dynamicImportTypes = {};
this.dynamicImportIds = {};
this.dynamicImports = [];
this.declarations = {};
this.usedHelpers = {};
this.dynamicData = {};
this.data = {};
this.ast = {};
this.metadata = {
modules: {
imports: [],
exports: {
exported: [],
specifiers: []
}
}
};
this.hub = new _traversalHub2["default"](this);
this.pipeline = pipeline;
this.log = new _logger2["default"](this, opts.filename || "unknown");
this.opts = this.initOptions(opts);
this.buildTransformers();
}
/**
* [Please add a description.]
*/
File.prototype.initOptions = function initOptions(opts) {
opts = new _optionsOptionManager2["default"](this.log, this.pipeline).init(opts);
if (opts.inputSourceMap) {
opts.sourceMaps = true;
}
if (opts.moduleId) {
opts.moduleIds = true;
}
opts.basename = _path2["default"].basename(opts.filename, _path2["default"].extname(opts.filename));
opts.ignore = util.arrayify(opts.ignore, util.regexify);
if (opts.only) opts.only = util.arrayify(opts.only, util.regexify);
_lodashObjectDefaults2["default"](opts, {
moduleRoot: opts.sourceRoot
});
_lodashObjectDefaults2["default"](opts, {
sourceRoot: opts.moduleRoot
});
_lodashObjectDefaults2["default"](opts, {
filenameRelative: opts.filename
});
_lodashObjectDefaults2["default"](opts, {
sourceFileName: opts.filenameRelative,
sourceMapTarget: opts.filenameRelative
});
//
if (opts.externalHelpers) {
this.set("helpersNamespace", t.identifier("babelHelpers"));
}
return opts;
};
/**
* [Please add a description.]
*/
File.prototype.isLoose = function isLoose(key) {
return _lodashCollectionIncludes2["default"](this.opts.loose, key);
};
/**
* [Please add a description.]
*/
File.prototype.buildTransformers = function buildTransformers() {
var file = this;
var transformers = this.transformers = {};
var secondaryStack = [];
var stack = [];
// build internal transformers
for (var key in this.pipeline.transformers) {
var transformer = this.pipeline.transformers[key];
var pass = transformers[key] = transformer.buildPass(file);
if (pass.canTransform()) {
stack.push(pass);
if (transformer.metadata.secondPass) {
secondaryStack.push(pass);
}
if (transformer.manipulateOptions) {
transformer.manipulateOptions(file.opts, file);
}
}
}
// init plugins!
var beforePlugins = [];
var afterPlugins = [];
var pluginManager = new _pluginManager2["default"]({
file: this,
transformers: this.transformers,
before: beforePlugins,
after: afterPlugins
});
for (var i = 0; i < file.opts.plugins.length; i++) {
pluginManager.add(file.opts.plugins[i]);
}
stack = beforePlugins.concat(stack, afterPlugins);
// build transformer stack
this.uncollapsedTransformerStack = stack = stack.concat(secondaryStack);
// build dependency graph
var _arr = stack;
for (var _i = 0; _i < _arr.length; _i++) {
var pass = _arr[_i];var _arr2 = pass.plugin.dependencies;
for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
var dep = _arr2[_i2];
this.transformerDependencies[dep] = pass.key;
}
}
// collapse stack categories
this.transformerStack = this.collapseStack(stack);
};
/**
* [Please add a description.]
*/
File.prototype.collapseStack = function collapseStack(_stack) {
var stack = [];
var ignore = [];
var _arr3 = _stack;
for (var _i3 = 0; _i3 < _arr3.length; _i3++) {
var pass = _arr3[_i3];
// been merged
if (ignore.indexOf(pass) >= 0) continue;
var group = pass.plugin.metadata.group;
// can't merge
if (!pass.canTransform() || !group) {
stack.push(pass);
continue;
}
var mergeStack = [];
var _arr4 = _stack;
for (var _i4 = 0; _i4 < _arr4.length; _i4++) {
var _pass = _arr4[_i4];
if (_pass.plugin.metadata.group === group) {
mergeStack.push(_pass);
ignore.push(_pass);
}
}
var visitors = [];
var _arr5 = mergeStack;
for (var _i5 = 0; _i5 < _arr5.length; _i5++) {
var _pass2 = _arr5[_i5];
visitors.push(_pass2.plugin.visitor);
}
var visitor = _traversal2["default"].visitors.merge(visitors);
var mergePlugin = new _plugin2["default"](group, { visitor: visitor });
stack.push(mergePlugin.buildPass(this));
}
return stack;
};
/**
* [Please add a description.]
*/
File.prototype.set = function set(key, val) {
return this.data[key] = val;
};
/**
* [Please add a description.]
*/
File.prototype.setDynamic = function setDynamic(key, fn) {
this.dynamicData[key] = fn;
};
/**
* [Please add a description.]
*/
File.prototype.get = function get(key) {
var data = this.data[key];
if (data) {
return data;
} else {
var dynamic = this.dynamicData[key];
if (dynamic) {
return this.set(key, dynamic());
}
}
};
/**
* [Please add a description.]
*/
File.prototype.resolveModuleSource = function resolveModuleSource(source) {
var resolveModuleSource = this.opts.resolveModuleSource;
if (resolveModuleSource) source = resolveModuleSource(source, this.opts.filename);
return source;
};
/**
* [Please add a description.]
*/
File.prototype.addImport = function addImport(source, name, type) {
name = name || source;
var id = this.dynamicImportIds[name];
if (!id) {
source = this.resolveModuleSource(source);
id = this.dynamicImportIds[name] = this.scope.generateUidIdentifier(name);
var specifiers = [t.importDefaultSpecifier(id)];
var declar = t.importDeclaration(specifiers, t.literal(source));
declar._blockHoist = 3;
if (type) {
var modules = this.dynamicImportTypes[type] = this.dynamicImportTypes[type] || [];
modules.push(declar);
}
if (this.transformers["es6.modules"].canTransform()) {
this.moduleFormatter.importSpecifier(specifiers[0], declar, this.dynamicImports, this.scope);
this.moduleFormatter.hasLocalImports = true;
} else {
this.dynamicImports.push(declar);
}
}
return id;
};
/**
* [Please add a description.]
*/
File.prototype.attachAuxiliaryComment = function attachAuxiliaryComment(node) {
var beforeComment = this.opts.auxiliaryCommentBefore;
if (beforeComment) {
node.leadingComments = node.leadingComments || [];
node.leadingComments.push({
type: "CommentLine",
value: " " + beforeComment
});
}
var afterComment = this.opts.auxiliaryCommentAfter;
if (afterComment) {
node.trailingComments = node.trailingComments || [];
node.trailingComments.push({
type: "CommentLine",
value: " " + afterComment
});
}
return node;
};
/**
* [Please add a description.]
*/
File.prototype.addHelper = function addHelper(name) {
var isSolo = _lodashCollectionIncludes2["default"](File.soloHelpers, name);
if (!isSolo && !_lodashCollectionIncludes2["default"](File.helpers, name)) {
throw new ReferenceError("Unknown helper " + name);
}
var declar = this.declarations[name];
if (declar) return declar;
this.usedHelpers[name] = true;
if (!isSolo) {
var generator = this.get("helperGenerator");
var runtime = this.get("helpersNamespace");
if (generator) {
return generator(name);
} else if (runtime) {
var id = t.identifier(t.toIdentifier(name));
return t.memberExpression(runtime, id);
}
}
var ref = util.template("helper-" + name);
var uid = this.declarations[name] = this.scope.generateUidIdentifier(name);
if (t.isFunctionExpression(ref) && !ref.id) {
ref.body._compact = true;
ref._generated = true;
ref.id = uid;
ref.type = "FunctionDeclaration";
this.attachAuxiliaryComment(ref);
this.path.unshiftContainer("body", ref);
} else {
ref._compact = true;
this.scope.push({
id: uid,
init: ref,
unique: true
});
}
return uid;
};
File.prototype.addTemplateObject = function addTemplateObject(helperName, strings, raw) {
// Generate a unique name based on the string literals so we dedupe
// identical strings used in the program.
var stringIds = raw.elements.map(function (string) {
return string.value;
});
var name = helperName + "_" + raw.elements.length + "_" + stringIds.join(",");
var declar = this.declarations[name];
if (declar) return declar;
var uid = this.declarations[name] = this.scope.generateUidIdentifier("templateObject");
var helperId = this.addHelper(helperName);
var init = t.callExpression(helperId, [strings, raw]);
init._compact = true;
this.scope.push({
id: uid,
init: init,
_blockHoist: 1.9 // This ensures that we don't fail if not using function expression helpers
});
return uid;
};
/**
* [Please add a description.]
*/
File.prototype.errorWithNode = function errorWithNode(node, msg) {
var Error = arguments.length <= 2 || arguments[2] === undefined ? SyntaxError : arguments[2];
var err;
var loc = node && (node.loc || node._loc);
if (loc) {
err = new Error("Line " + loc.start.line + ": " + msg);
err.loc = loc.start;
} else {
// todo: find errors with nodes inside to at least point to something
err = new Error("There's been an error on a dynamic node. This is almost certainly an internal error. Please report it.");
}
return err;
};
/**
* [Please add a description.]
*/
File.prototype.mergeSourceMap = function mergeSourceMap(map) {
var opts = this.opts;
var inputMap = opts.inputSourceMap;
if (inputMap) {
map.sources[0] = inputMap.file;
var inputMapConsumer = new _sourceMap2["default"].SourceMapConsumer(inputMap);
var outputMapConsumer = new _sourceMap2["default"].SourceMapConsumer(map);
var outputMapGenerator = _sourceMap2["default"].SourceMapGenerator.fromSourceMap(outputMapConsumer);
outputMapGenerator.applySourceMap(inputMapConsumer);
var mergedMap = outputMapGenerator.toJSON();
mergedMap.sources = inputMap.sources;
mergedMap.file = inputMap.file;
return mergedMap;
}
return map;
};
/**
* [Please add a description.]
*/
File.prototype.getModuleFormatter = function getModuleFormatter(type) {
if (_lodashLangIsFunction2["default"](type) || !_modules2["default"][type]) {
this.log.deprecate("Custom module formatters are deprecated and will be removed in the next major. Please use Babel plugins instead.");
}
var ModuleFormatter = _lodashLangIsFunction2["default"](type) ? type : _modules2["default"][type];
if (!ModuleFormatter) {
var loc = _tryResolve2["default"].relative(type);
if (loc) ModuleFormatter = require(loc);
}
if (!ModuleFormatter) {
throw new ReferenceError("Unknown module formatter type " + JSON.stringify(type));
}
return new ModuleFormatter(this);
};
/**
* [Please add a description.]
*/
File.prototype.parse = function parse(code) {
var opts = this.opts;
//
var parseOpts = {
highlightCode: opts.highlightCode,
nonStandard: opts.nonStandard,
sourceType: opts.sourceType,
filename: opts.filename,
plugins: {}
};
var features = parseOpts.features = {};
for (var key in this.transformers) {
var transformer = this.transformers[key];
features[key] = transformer.canTransform();
}
parseOpts.looseModules = this.isLoose("es6.modules");
parseOpts.strictMode = features.strict;
this.log.debug("Parse start");
var ast = _helpersParse2["default"](code, parseOpts);
this.log.debug("Parse stop");
return ast;
};
/**
* [Please add a description.]<|fim▁hole|> */
File.prototype._addAst = function _addAst(ast) {
this.path = _traversalPath2["default"].get({
hub: this.hub,
parentPath: null,
parent: ast,
container: ast,
key: "program"
}).setContext();
this.scope = this.path.scope;
this.ast = ast;
};
/**
* [Please add a description.]
*/
File.prototype.addAst = function addAst(ast) {
this.log.debug("Start set AST");
this._addAst(ast);
this.log.debug("End set AST");
this.log.debug("Start module formatter init");
var modFormatter = this.moduleFormatter = this.getModuleFormatter(this.opts.modules);
if (modFormatter.init && this.transformers["es6.modules"].canTransform()) {
modFormatter.init();
}
this.log.debug("End module formatter init");
};
/**
* [Please add a description.]
*/
File.prototype.transform = function transform() {
this.call("pre");
var _arr6 = this.transformerStack;
for (var _i6 = 0; _i6 < _arr6.length; _i6++) {
var pass = _arr6[_i6];
pass.transform();
}
this.call("post");
return this.generate();
};
/**
* [Please add a description.]
*/
File.prototype.wrap = function wrap(code, callback) {
code = code + "";
try {
if (this.shouldIgnore()) {
return this.makeResult({ code: code, ignored: true });
} else {
return callback();
}
} catch (err) {
if (err._babel) {
throw err;
} else {
err._babel = true;
}
var message = err.message = this.opts.filename + ": " + err.message;
var loc = err.loc;
if (loc) {
err.codeFrame = _helpersCodeFrame2["default"](code, loc.line, loc.column + 1, this.opts);
message += "\n" + err.codeFrame;
}
if (process.browser) {
// chrome has it's own pretty stringifier which doesn't use the stack property
// https://github.com/babel/babel/issues/2175
err.message = message;
}
if (err.stack) {
var newStack = err.stack.replace(err.message, message);
try {
err.stack = newStack;
} catch (e) {
// `err.stack` may be a readonly property in some environments
}
}
throw err;
}
};
/**
* [Please add a description.]
*/
File.prototype.addCode = function addCode(code) {
code = (code || "") + "";
code = this.parseInputSourceMap(code);
this.code = code;
};
/**
* [Please add a description.]
*/
File.prototype.parseCode = function parseCode() {
this.parseShebang();
var ast = this.parse(this.code);
this.addAst(ast);
};
/**
* [Please add a description.]
*/
File.prototype.shouldIgnore = function shouldIgnore() {
var opts = this.opts;
return util.shouldIgnore(opts.filename, opts.ignore, opts.only);
};
/**
* [Please add a description.]
*/
File.prototype.call = function call(key) {
var _arr7 = this.uncollapsedTransformerStack;
for (var _i7 = 0; _i7 < _arr7.length; _i7++) {
var pass = _arr7[_i7];
var fn = pass.plugin[key];
if (fn) fn(this);
}
};
/**
* [Please add a description.]
*/
File.prototype.parseInputSourceMap = function parseInputSourceMap(code) {
var opts = this.opts;
if (opts.inputSourceMap !== false) {
var inputMap = _convertSourceMap2["default"].fromSource(code);
if (inputMap) {
opts.inputSourceMap = inputMap.toObject();
code = _convertSourceMap2["default"].removeComments(code);
}
}
return code;
};
/**
* [Please add a description.]
*/
File.prototype.parseShebang = function parseShebang() {
var shebangMatch = _shebangRegex2["default"].exec(this.code);
if (shebangMatch) {
this.shebang = shebangMatch[0];
this.code = this.code.replace(_shebangRegex2["default"], "");
}
};
/**
* [Please add a description.]
*/
File.prototype.makeResult = function makeResult(_ref) {
var code = _ref.code;
var _ref$map = _ref.map;
var map = _ref$map === undefined ? null : _ref$map;
var ast = _ref.ast;
var ignored = _ref.ignored;
var result = {
metadata: null,
ignored: !!ignored,
code: null,
ast: null,
map: map
};
if (this.opts.code) {
result.code = code;
}
if (this.opts.ast) {
result.ast = ast;
}
if (this.opts.metadata) {
result.metadata = this.metadata;
result.metadata.usedHelpers = Object.keys(this.usedHelpers);
}
return result;
};
/**
* [Please add a description.]
*/
File.prototype.generate = function generate() {
var opts = this.opts;
var ast = this.ast;
var result = { ast: ast };
if (!opts.code) return this.makeResult(result);
this.log.debug("Generation start");
var _result = _generation2["default"](ast, opts, this.code);
result.code = _result.code;
result.map = _result.map;
this.log.debug("Generation end");
if (this.shebang) {
// add back shebang
result.code = this.shebang + "\n" + result.code;
}
if (result.map) {
result.map = this.mergeSourceMap(result.map);
}
if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") {
result.code += "\n" + _convertSourceMap2["default"].fromObject(result.map).toComment();
}
if (opts.sourceMaps === "inline") {
result.map = null;
}
return this.makeResult(result);
};
_createClass(File, null, [{
key: "helpers",
/**
* [Please add a description.]
*/
value: ["inherits", "defaults", "create-class", "create-decorated-class", "create-decorated-object", "define-decorated-property-descriptor", "tagged-template-literal", "tagged-template-literal-loose", "to-array", "to-consumable-array", "sliced-to-array", "sliced-to-array-loose", "object-without-properties", "has-own", "slice", "bind", "define-property", "async-to-generator", "interop-export-wildcard", "interop-require-wildcard", "interop-require-default", "typeof", "extends", "get", "set", "new-arrow-check", "class-call-check", "object-destructuring-empty", "temporal-undefined", "temporal-assert-defined", "self-global", "typeof-react-element", "default-props", "instanceof",
// legacy
"interop-require"],
/**
* [Please add a description.]
*/
enumerable: true
}, {
key: "soloHelpers",
value: [],
enumerable: true
}]);
return File;
})();
exports["default"] = File;
module.exports = exports["default"];
//# sourceMappingURL=index-compiled.js.map<|fim▁end|> | |
<|file_name|>Explorer.js<|end_file_name|><|fim▁begin|>Ext.define('Omni.view.sizes.Explorer', {
extend: 'Buildit.ux.explorer.Panel',
alias: 'widget.omni-sizes-Explorer',
initComponent: function() {
var me = this;
// EXPLORER INIT (Start) ===============================================================
Ext.apply(this, {
allowFind: true,
store: Ext.create('Omni.store.Size'),
contextMenuConfig: {
xtype: 'omni-app-ExplorerContextMenu'
},
newForms: [{
xtype: 'omni-sizes-Form',
windowConfig: {}
}],
inspectorConfig: {
xtype: 'omni-sizes-Inspector'
}
});
// EXPLORER INIT (End)
// LABELS (Start) ======================================================================
Ext.applyIf(this, {
size_nbrLabel: Omni.i18n.model.Size.size_nbr,
size_typeLabel: Omni.i18n.model.Size.size_type,
displayLabel: Omni.i18n.model.Size.display,
concatenated_nameLabel: Omni.i18n.model.Size.concatenated_name,
dimension_1Label: Omni.i18n.model.Size.dimension_1,
dimension_2Label: Omni.i18n.model.Size.dimension_2,
is_enabledLabel: Omni.i18n.model.Size.is_enabled
});
// LABELS (End)
// COLUMNS (Start) =====================================================================
Ext.apply(this, {
columns: [{
header: this.displayLabel,
dataIndex: 'display',
flex: 1,
sortable: false
}, {
header: this.concatenated_nameLabel,
dataIndex: 'concatenated_name',
flex: 1,
sortable: false
}, {
header: this.dimension_1Label,
dataIndex: 'dimension_1',
flex: 1,
sortable: false
}, {
header: this.dimension_2Label,
dataIndex: 'dimension_2',
flex: 1,
sortable: false
}, {
header: this.size_typeLabel,
dataIndex: 'size_type',
flex: 1,
sortable: false,
renderer: Buildit.util.Format.lookupRenderer('SIZE_TYPE')
}, {
header: this.size_nbrLabel,
dataIndex: 'size_nbr',
flex: 1,
sortable: false
}, {
header: this.is_enabledLabel,
dataIndex: 'is_enabled',
flex: 1,
sortable: false
}, ]
});
// COLUMNS (End)
// TITLES (Start) ======================================================================
Ext.apply(this, {
title: 'Size',
subtitle: 'All Product Sizes that are valid in the system'
});
// TITLES (End)
this.callParent();<|fim▁hole|>});<|fim▁end|> | }
|
<|file_name|>B.cpp<|end_file_name|><|fim▁begin|>/* ========================================<|fim▁hole|> * Creation Date : 16-11-2020
* Last Modified : Po 16. listopadu 2020, 01:03:10
* Created By : Karel Ha <[email protected]>
* URL : https://codeforces.com/problemset/problem/1296/B
* Points Gained (in case of online contest) : AC
==========================================*/
#include <bits/stdc++.h>
using namespace std;
#define REP(I,N) FOR(I,0,N)
#define FOR(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define ALL(A) (A).begin(), (A).end()
#define MSG(a) cout << #a << " == " << (a) << endl;
const int CLEAN = -1;
template <typename T>
string NumberToString ( T Number ) {
ostringstream ss;
ss << Number;
return ss.str();
}
#define ERR(args...) { vector<string> _v = split(#args, ','); err(_v.begin(), args); }
vector<string> split(const string& s, char c) {
vector<string> v;
stringstream ss(s);
string x;
while (getline(ss, x, c))
v.emplace_back(x);
return move(v);
}
void err(vector<string>::iterator it) {}
template<typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
cout << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << endl;
err(++it, args...);
}
int solve(int s) {
if (s < 10) {
return s;
}
int x = s - s % 10;
return x + solve(s - x + x / 10);
}
int main() {
int t;
cin >> t;
while (t--) {
int s;
cin >> s;
cout << solve(s) << endl;
}
return 0;
}<|fim▁end|> |
* File Name : B.cpp
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const {Scene, Sprite} = spritejs;
const container = document.getElementById('stage');
const scene = new Scene({
container,
width: 1200,
height: 600,
// contextType: '2d',
});
const layer = scene.layer();
(async function () {
const sprite = new Sprite({
anchor: 0.5,
bgcolor: 'red',
pos: [500, 300],
size: [200, 200],
borderRadius: 50,
});
layer.append(sprite);
await sprite.transition(2.0)
.attr({
bgcolor: 'green',
width: width => width + 100,
});
await sprite.transition(1.0)<|fim▁hole|> bgcolor: 'orange',
height: height => height + 100,
});
}());<|fim▁end|> | .attr({ |
<|file_name|>audio.rs<|end_file_name|><|fim▁begin|>use docopt::ArgvMap;
use toml::{Value, ParserError};
use settings::Load;
#[derive(Clone, Debug)]
pub struct Audio {
music: bool,
only: bool,
}
impl Default for Audio {
fn default() -> Audio {
Audio {
music: true,
only: false,
}
}
}
impl Load for Audio {
fn load(&mut self, args: &ArgvMap, toml: &Value) -> Result<(), ParserError> {
let toml = toml.as_table().unwrap();
if let Some(toml) = toml.get("audio") {
let toml = expect!(toml.as_table(), "`audio` must be a table");
if let Some(value) = toml.get("only") {
self.only = expect!(value.as_bool(), "`audio.only` must be a boolean");
}
if let Some(value) = toml.get("music") {
self.music = expect!(value.as_bool(), "`audio.music` must be a boolean");
}
}
if args.get_bool("--audio-only") {
self.only = true;
}
if args.get_bool("--no-music") {
self.music = false;
}
Ok(())
}
}
impl Audio {
#[inline(always)]
pub fn music(&self) -> bool {
self.music<|fim▁hole|> pub fn only(&self) -> bool {
self.only
}
}<|fim▁end|> | }
#[inline(always)] |
<|file_name|>api.py<|end_file_name|><|fim▁begin|># proxy module
from __future__ import absolute_import<|fim▁hole|><|fim▁end|> | from mayavi.filters.api import * |
<|file_name|>test_rest.py<|end_file_name|><|fim▁begin|>import unittest
import json
import sys
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock
import requests
from tabpy_client.rest import *
class TestRequestsNetworkWrapper(unittest.TestCase):
def test_init(self):
rnw = RequestsNetworkWrapper()
def test_init_with_session(self):
session = {}
rnw = RequestsNetworkWrapper(session=session)
self.assertIs(session, rnw.session)
def setUp(self):
def mock_response(status_code):
response = Mock(requests.Response())
response.json.return_value = 'json'
response.status_code = status_code
return response
session = Mock(requests.session())
session.get.return_value = mock_response(200)
session.post.return_value = mock_response(200)
session.put.return_value = mock_response(200)
session.delete.return_value = mock_response(204)
self.rnw = RequestsNetworkWrapper(session=session)
def test_GET(self):
url = 'abc'
data = {'foo':'bar'}
self.assertEqual(self.rnw.GET(url, data), 'json')
self.rnw.session.get.assert_called_once_with(url,
params=data,
timeout=None)
def test_GET_InvalidData(self):
url = 'abc'
data = {'cat'}
try:
self.assertEqual(self.rnw.GET(url, data), 'json')
except:
e=sys.exc_info()[0]
self.assertEquals(e,TypeError)
def test_GET_InvalidURL(self):
url = ''
data = {'foo':'bar'}
try:
self.assertEqual(self.rnw.GET(url, data), 'json')
except:
e=sys.exc_info()[0]
self.assertEquals(e,TypeError)
def test_POST(self):
url = 'abc'
data = {'foo':'bar'}
self.assertEqual(self.rnw.POST(url, data), 'json')
self.rnw.session.post.assert_called_once_with(url,
data=json.dumps(data),
headers={'content-type':'application/json'},
timeout=None)
def test_POST_InvalidURL(self):
url = ''
data = {'foo':'bar'}
try:
self.assertEqual(self.rnw.POST(url, data), 'json')
except:
e=sys.exc_info()[0]
self.assertEquals(e,TypeError)
def test_POST_InvalidData(self):
url = 'url'
data = {'cat'}
try:
self.assertEqual(self.rnw.POST(url, data), 'json')
except:
e=sys.exc_info()[0]
self.assertEquals(e,TypeError)
def test_PUT(self):
url = 'abc'
data = {'foo':'bar'}
self.assertEqual(self.rnw.PUT(url, data), 'json')
self.rnw.session.put.assert_called_once_with(url,
data=json.dumps(data),
headers={'content-type':'application/json'},
timeout=None)
def test_PUT_InvalidData(self):<|fim▁hole|> data = {'cat'}
try:
self.assertEqual(self.rnw.PUT(url, data), 'json')
except:
e=sys.exc_info()[0]
self.assertEquals(e,TypeError)
def test_PUT_InvalidURL(self):
url = ''
data = {'foo:bar'}
try:
self.assertEqual(self.rnw.PUT(url, data), 'json')
except:
e=sys.exc_info()[0]
self.assertEquals(e,TypeError)
def test_DELETE(self):
url = 'abc'
data = {'foo':'bar'}
self.assertIs(self.rnw.DELETE(url, data), None)
self.rnw.session.delete.assert_called_once_with(url,
data=json.dumps(data),
timeout=None)
def test_DELETE_InvalidData(self):
url = 'abc'
data = {'cat'}
try:
self.assertEqual(self.rnw.DELETE(url, data), 'json')
except:
e=sys.exc_info()[0]
self.assertEquals(e,TypeError)
def test_DELETE_InvalidURL(self):
url = ''
data = {'foo:bar'}
try:
self.assertEqual(self.rnw.DELETE(url, data), 'json')
except:
e=sys.exc_info()[0]
self.assertEquals(e,TypeError)
class TestServiceClient(unittest.TestCase):
def setUp(self):
nw = Mock(RequestsNetworkWrapper())
nw.GET.return_value = 'GET'
nw.POST.return_value = 'POST'
nw.PUT.return_value = 'PUT'
nw.DELETE.return_value = 'DELETE'
self.sc = ServiceClient('endpoint', network_wrapper=nw)
def test_GET(self):
self.assertEquals(self.sc.GET('test'), 'GET')
self.sc.network_wrapper.GET.assert_called_once_with('endpoint/test',
None, None)
def test_POST(self):
self.assertEquals(self.sc.POST('test'), 'POST')
self.sc.network_wrapper.POST.assert_called_once_with('endpoint/test',
None, None)
def test_PUT(self):
self.assertEquals(self.sc.PUT('test'), 'PUT')
self.sc.network_wrapper.PUT.assert_called_once_with('endpoint/test',
None, None)
def test_DELETE(self):
self.assertEquals(self.sc.DELETE('test'), None)
self.sc.network_wrapper.DELETE.assert_called_once_with('endpoint/test',
None, None)<|fim▁end|> | url = 'url' |
<|file_name|>dbv.py<|end_file_name|><|fim▁begin|>MYSQL_DB = 'edxapp'
MYSQL_USER = 'root'
MYSQL_PSWD = ''<|fim▁hole|><|fim▁end|> |
MONGO_DB = 'edxapp'
MONGO_DISCUSSION_DB = 'cs_comments_service_development' |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for mdotproject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")<|fim▁hole|><|fim▁end|> |
application = get_wsgi_application() |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>/*
* JBOYM - Jupiter Broadcasting Open Your Mouth
* markdown web server
*
* Author : Term1nal
* Source : https://github.com/term1nal/jboym
*
* Based on Lanyon from Original Author : Marcus Kazmierczak
* Based on Original Source : http://github.com/mkaz/lanyon
* License: MIT
*
*/
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"github.com/russross/blackfriday"
"io/ioutil"
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
"strings"
"text/template"
"time"
)
// globals
var config struct {
PortNum int
PublicDir string
TemplateDir string
RedirectDomain []string
}
var configFile string
var ServerVersion = "0.0.1"
var staticExpire = 30 // (days) default 1 month
var ts *template.Template
type SubPage []Page
type Page struct {
Title, Content, Layout, Url string
Pages SubPage
}
func startup() {
loadConfig()
log.Printf("jboym Markdown Server listening on http://localhost:%d", config.PortNum)
// add trailing slashes to config directories
if !strings.HasSuffix(config.PublicDir, "/") {
config.PublicDir = config.PublicDir + "/"
}
// verify public directory exists
if _, err := os.Stat(config.PublicDir); err != nil {
log.Fatalln("Public directory does not exist")
}
// add trailing slashes to config directories
if !strings.HasSuffix(config.TemplateDir, "/") {
config.TemplateDir = config.TemplateDir + "/"
}
// verify template directory exists
if _, err := os.Stat(config.TemplateDir); err != nil {
log.Fatalln("Template directory does not exist")
}
if err := loadTemplates(); err != nil {
log.Fatalln("Error Parsing Templates: ", err.Error())
}
}
func loadTemplates() (err error) {
ts, err = template.ParseGlob(config.TemplateDir + "*.html")
return err
}
func main() {
flag.StringVar(&configFile, "config", "conf.json", "specify a config file")
flag.Parse()
startup()
http.HandleFunc("/", getRequest)
colonport := fmt.Sprintf(":%d", config.PortNum)
log.Fatal(http.ListenAndServe(colonport, nil))
}
// handler for all requests
func getRequest(w http.ResponseWriter, r *http.Request) {
// check domain redirect returns true on redirect
if domainRedirect(w, r) {
return
}
// add default headers
w.Header().Add("Server", ServerVersion)
w.Header().Add("Vary", "Accept-Encoding")
logRequest(r)
html := ""
fullpath := filepath.Clean(config.PublicDir + r.URL.Path)
ext := filepath.Ext(fullpath)
// check if file exists on filesystem
if fi, err := os.Stat(fullpath); err == nil {
if fi.IsDir() {
html, err = getDirectoryListing(fullpath)
if err != nil {
showFourOhFour(w, r)
return
}
} else {
setCacheExpirationDays(w, staticExpire)
http.ServeFile(w, r, fullpath)
return
}
} else { // file does not exist
// check if false extension and an actual
// file should be generated, or 404
switch ext {
case ".html":
html, err = getMarkdownFile(fullpath)
if err != nil {
showFourOhFour(w, r)
return
}
setCacheExpirationDays(w, 3)
case ".css":
html = getLessFile(fullpath)
w.Header().Set("Content-Type", "text/css")
setCacheExpirationDays(w, 3)
default:
showFourOhFour(w, r)
return
}
}
fmt.Fprint(w, html)
return
}
// directory listing checks for existing index file
// and if exists processes like any other markdown file
// otherwise gets directory listing of html and md files
// and creates a "category" page using the category.html
// template file with array of .Pages
func getDirectoryListing(dir string) (html string, err error) {
// fmt.Println("DEBUG: getDirectoryListing - Current Dir:", dir)
// TODO: re-add ndex page
page := Page{}
if dir == "public" {
page.Title = "Index"
} else {
page.Title = filepath.Base(dir)
}
page.Layout = "category"
var dirs []string
var files []string
dirlist, _ := ioutil.ReadDir(dir)
for _, fi := range dirlist {
f := filepath.Join(dir, fi.Name())
if fi.IsDir() {
if fi.Name() == "css" {
continue
}
dirs = append(dirs, f)
} else {
if fi.Name() == "about.md" {
continue
}
ext := filepath.Ext(f)
if ext == ".html" || ext == ".md" {
files = append(files, f)
}
}
}
// fmt.Println("DEBUG: getDirectoryListing - Found Files:", files)
// fmt.Println("DEBUG: getDirectoryListing - Found Directories:", len(dirs))
<|fim▁hole|> pg := Page{
Title: filepath.Base(d),
Layout: "entry",
Url: "/" + strings.Replace(d, config.PublicDir, "", 1),
}
page.Pages = append(page.Pages, pg)
}
// read markdown files to get title, date
for _, f := range files {
pg := readParseFile(f)
filename := strings.Replace(f, ".md", ".html", 1)
pg.Url = "/" + strings.Replace(filename, config.PublicDir, "", 1)
page.Pages = append(page.Pages, pg)
}
//page.Pages.Sort()
html = applyTemplates(page)
return html, err
}
// reads markdown file, parse front matter and render content
// using template file defined by layout: param or by default
// uses entry.html template
func getMarkdownFile(fullpath string) (html string, err error) {
mdfile := strings.Replace(fullpath, ".html", ".md", 1)
page := Page{}
if _, err := os.Stat(mdfile); err == nil {
page = readParseFile(mdfile)
} else {
return "", fmt.Errorf("Error reading file %s ", mdfile)
}
html = applyTemplates(page)
return html, err
}
func getLessFile(fullpath string) string {
lessfile := strings.Replace(fullpath, ".css", ".less", 1)
path, err := exec.LookPath("lessc")
if err != nil {
return "/* Less is not installed */"
}
// requires lessc binary
cmd := exec.Command(path, "--no-color", "--no-ie-compat", "--silent", "-su=off", "-sm=on", "--clean-css", lessfile)
output, err := cmd.Output()
if err != nil {
return ""
}
return string(output)
}
func showFourOhFour(w http.ResponseWriter, r *http.Request) {
md404 := config.PublicDir + "404.md"
html, err := getMarkdownFile(md404)
if err != nil {
http.NotFound(w, r)
return
}
w.WriteHeader(http.StatusNotFound)
fmt.Fprint(w, html)
}
// checks config.RedirectDomain for ["domain1", "domain2"]
// If config is set, checks if request domain matches domain1
// if request does not match, issues 301 redirect to "domain2"
// Used to handle non "www." requests to redirect
// to www.example.com
// @return bool - true if redirected, false otherwise
//
func domainRedirect(w http.ResponseWriter, r *http.Request) bool {
if len(config.RedirectDomain) != 2 {
return false
}
if r.Host == config.RedirectDomain[0] {
return false
}
redirect_url := fmt.Sprintf("http://%s/%s", config.RedirectDomain[1], r.RequestURI)
http.Redirect(w, r, redirect_url, 301)
return true
}
// read and parse markdown filename
func readParseFile(filename string) (page Page) {
// fmt.Println("DEBUG: readParseFile - filename:", filename)
// setup default page struct
page = Page{
Title: getName(filename),
Content: "",
Layout: "entry",
}
var data, err = ioutil.ReadFile(filename)
if err != nil {
return
}
output := markdownRender([]byte(data))
page.Content = string(output)
return page
}
func applyTemplates(page Page) string {
buffer := new(bytes.Buffer)
templateFile := ""
if page.Layout == "" {
templateFile = "entry.html"
} else {
templateFile = page.Layout + ".html"
}
ts.ExecuteTemplate(buffer, templateFile, page)
return buffer.String()
}
// configure markdown render options
// See blackfriday markdown source for details
func markdownRender(content []byte) []byte {
htmlFlags := 0
//htmlFlags |= blackfriday.HTML_SKIP_SCRIPT
htmlFlags |= blackfriday.HTML_USE_XHTML
htmlFlags |= blackfriday.HTML_USE_SMARTYPANTS
htmlFlags |= blackfriday.HTML_SMARTYPANTS_FRACTIONS
htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES
renderer := blackfriday.HtmlRenderer(htmlFlags, "", "")
extensions := 0
extensions |= blackfriday.EXTENSION_NO_INTRA_EMPHASIS
extensions |= blackfriday.EXTENSION_TABLES
extensions |= blackfriday.EXTENSION_FENCED_CODE
extensions |= blackfriday.EXTENSION_AUTOLINK
extensions |= blackfriday.EXTENSION_STRIKETHROUGH
extensions |= blackfriday.EXTENSION_SPACE_HEADERS
return blackfriday.Markdown(content, renderer, extensions)
}
func loadConfig() {
// checks if specified file exists, either flag passed in
// or default conf.json in current directory
if _, err := os.Stat(configFile); os.IsNotExist(err) {
// config file not found
// lets check one more spot in /etc/
configFile = "/etc/jboymconf.json"
if _, err := os.Stat(configFile); os.IsNotExist(err) {
log.Fatalln("Config file not found, /etc/jboymconf.json (default) or specify with --config=FILENAME")
}
}
file, err := ioutil.ReadFile(configFile)
if err != nil {
log.Fatalln("Error reading config file:", err)
}
if err := json.Unmarshal(file, &config); err != nil {
log.Fatalln("Error parsing config file: ", err)
}
}
func getName(fullpath string) (name string) {
name = filepath.Base(fullpath)
name = strings.Replace(name, filepath.Ext(name), "", 1)
return
}
// returns directory name from filepath
func getDirName(fullpath string) (dir string) {
dir = filepath.Dir(fullpath)
dir = filepath.Base(dir)
if strings.Trim(dir, "/") == strings.Trim(config.PublicDir, "/") {
dir = ""
}
return
}
func setCacheExpirationDays(w http.ResponseWriter, days int) {
d := time.Duration(int64(time.Hour) * 24 * int64(days))
expireDate := time.Now().Add(d)
expireSecs := days * 24 * 60 * 60
w.Header().Add("Cache-Control", fmt.Sprintf("max-age=%d, public", expireSecs))
w.Header().Add("Expires", expireDate.Format(time.RFC1123))
}
func logRequest(req *http.Request) {
now := time.Now()
log.Printf("%s - %s [%s] \"%s %s %s\" ",
req.RemoteAddr,
"",
now.Format("02/Jan/2006:15:04:05 -0700"),
req.Method,
req.URL.RequestURI(),
req.Proto)
}<|fim▁end|> | for _, d := range dirs {
//f := filepath.Join(dir, d) |
<|file_name|>bitcoin_nb.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="nb">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About FXCoin</source>
<translation>Om FXCoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>FXCoin</b> version</source>
<translation><b>FXCoin</b> versjon</translation>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The FXCoin developers</source>
<translation>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The FXCoin developers</translation>
</message>
<message>
<location line="+15"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or <a href="http://www.opensource.org/licenses/mit-license.php">http://www.opensource.org/licenses/mit-license.php</a>.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (<a href="https://www.openssl.org/">https://www.openssl.org/</a>) and cryptographic software written by Eric Young (<a href="mailto:[email protected]">[email protected]</a>) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Adressebok</translation>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation>Dobbeltklikk for å redigere adresse eller merkelapp</translation>
</message>
<message>
<location line="+24"/>
<source>Create a new address</source>
<translation>Lag en ny adresse</translation>
</message>
<message>
<location line="+10"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopier den valgte adressen til systemets utklippstavle</translation>
</message>
<message>
<location line="-7"/>
<source>&New Address</source>
<translation>&Ny Adresse</translation>
</message>
<message>
<location line="-43"/>
<source>These are your FXCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation>Dette er adressene for å motta betalinger. Du ønsker kanskje å gi ulike adresser til hver avsender så du lettere kan holde øye med hvem som betaler deg.</translation>
</message>
<message>
<location line="+53"/>
<source>&Copy Address</source>
<translation>&Kopier Adresse</translation>
</message>
<message>
<location line="+7"/>
<source>Show &QR Code</source>
<translation>Vis &QR Kode</translation>
</message>
<message>
<location line="+7"/>
<source>Sign a message to prove you own a FXCoin address</source>
<translation>Signer en melding for å bevise din egen FXCoin adresse.</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Signer &Melding</translation>
</message>
<message>
<location line="+17"/>
<source>Delete the currently selected address from the list</source>
<translation>Slett den valgte adressen fra listen.</translation>
</message>
<message>
<location line="-10"/>
<source>Verify a message to ensure it was signed with a specified FXCoin address</source>
<translation>Verifiser en melding får å forsikre deg om at den er signert med en spesifikk FXCoin adresse</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation>&Verifiser en melding</translation>
</message>
<message>
<location line="+10"/>
<source>&Delete</source>
<translation>&Slett</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation>Kopier &Merkelapp</translation>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation>&Rediger</translation>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation>Eksporter Adressebok</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kommaseparert fil (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Feil under eksportering</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Kunne ikke skrive til filen %1</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+145"/>
<source>Label</source>
<translation>Merkelapp</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(ingen merkelapp)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Dialog for Adgangsfrase</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Angi adgangsfrase</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Ny adgangsfrase</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Gjenta ny adgangsfrase</translation>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+38"/>
<source>Encrypt wallet</source>
<translation>Krypter lommebok</translation>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Denne operasjonen krever adgangsfrasen til lommeboken for å låse den opp.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Lås opp lommebok</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Denne operasjonen krever adgangsfrasen til lommeboken for å dekryptere den.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Dekrypter lommebok</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Endre adgangsfrase</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Skriv inn gammel og ny adgangsfrase for lommeboken.</translation>
</message>
<message>
<location line="+45"/>
<source>Confirm wallet encryption</source>
<translation>Bekreft kryptering av lommebok</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation>Advarsel: Viss du krypterer lommeboken og mister passordet vil du <b>MISTE ALLE MYNTENE DINE</b>!</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Er du sikker på at du vil kryptere lommeboken?</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation>VIKTIG: Tidligere sikkerhetskopier av din lommebok-fil, bør erstattes med den nylig genererte, krypterte filen, da de blir ugyldiggjort av sikkerhetshensyn så snart du begynner å bruke den nye krypterte lommeboken.</translation>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Advarsel: Caps Lock er på !</translation>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation>Lommebok kryptert</translation>
</message>
<message>
<location line="-140"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+82"/>
<source>FXCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Kryptering av lommebok feilet</translation>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Kryptering av lommebok feilet på grunn av en intern feil. Din lommebok ble ikke kryptert.</translation>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation>De angitte adgangsfrasene er ulike.</translation>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation>Opplåsing av lommebok feilet</translation>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Adgangsfrasen angitt for dekryptering av lommeboken var feil.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Dekryptering av lommebok feilet</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Adgangsfrase for lommebok endret.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+297"/>
<source>Sign &message...</source>
<translation>Signer &melding...</translation>
</message>
<message>
<location line="-64"/>
<source>Show general overview of wallet</source>
<translation>Vis generell oversikt over lommeboken</translation>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation>&Transaksjoner</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Vis transaksjonshistorikk</translation>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation>&Adressebok</translation>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Endre listen med lagrede adresser og merkelapper</translation>
</message>
<message>
<location line="-18"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Vis listen med adresser for å motta betalinger</translation>
</message>
<message>
<location line="+34"/>
<source>E&xit</source>
<translation>&Avslutt</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Avslutt applikasjonen</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about FXCoin</source>
<translation>Vis info om FXCoin</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Om &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Vis informasjon om Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Innstillinger...</translation>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation>&Krypter Lommebok...</translation>
</message>
<message>
<location line="+2"/>
<source>&Backup Wallet...</source>
<translation>Lag &Sikkerhetskopi av Lommebok...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Endre Adgangsfrase...</translation>
</message>
<message>
<location line="+9"/>
<source>&Export...</source>
<translation>&Eksporter...</translation>
</message>
<message>
<location line="-55"/>
<source>Send coins to a FXCoin address</source>
<translation>Send coins til en FXCoin adresse</translation>
</message>
<message>
<location line="+39"/>
<source>Modify configuration options for FXCoin</source>
<translation>Endre innstillingene til FXCoin</translation>
</message>
<message>
<location line="+17"/>
<source>Export the data in the current tab to a file</source>
<translation>Eksporter dataene i nåværende fane til en fil</translation>
</message>
<message>
<location line="-13"/>
<source>Encrypt or decrypt wallet</source>
<translation>Krypter eller dekrypter lommeboken</translation>
</message>
<message>
<location line="+2"/>
<source>Backup wallet to another location</source>
<translation>Sikkerhetskopiér lommebok til annet sted</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Endre adgangsfrasen brukt for kryptering av lommebok</translation>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation>&Feilsøkingsvindu</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Åpne konsoll for feilsøk og diagnostikk</translation>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation>&Verifiser melding...</translation>
</message>
<message>
<location line="-214"/>
<location line="+551"/>
<source>FXCoin</source>
<translation>FXCoin</translation>
</message>
<message>
<location line="-551"/>
<source>Wallet</source>
<translation>Lommebok</translation>
</message>
<message>
<location line="+193"/>
<source>&About FXCoin</source>
<translation>&Om FXCoin</translation>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>&Gjem / vis</translation>
</message>
<message>
<location line="+8"/>
<source>Unlock wallet</source>
<translation>Lås opp lommebok</translation>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation>&Lås Lommeboken</translation>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation>Lås lommeboken</translation>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Fil</translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation>&Innstillinger</translation>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation>&Hjelp</translation>
</message>
<message>
<location line="+17"/>
<source>Tabs toolbar</source>
<translation>Verktøylinje for faner</translation>
</message>
<message>
<location line="+46"/>
<location line="+9"/>
<source>[testnet]</source>
<translation>[testnett]</translation>
</message>
<message>
<location line="+0"/>
<location line="+58"/>
<source>FXCoin client</source>
<translation>FXCoin klient</translation>
</message>
<message numerus="yes">
<location line="+70"/>
<source>%n active connection(s) to FXCoin network</source>
<translation>
<numerusform>%n aktiv tilkobling til FXCoin nettverket</numerusform>
<numerusform>%n aktive tilkoblinger til FXCoin nettverket</numerusform>
</translation>
</message>
<message>
<location line="+488"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-808"/>
<source>&Dashboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>&Receive</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>&Send</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+49"/>
<source>&Unlock Wallet...</source>
<translation>&Lås opp lommeboken</translation>
</message>
<message>
<location line="+273"/>
<source>Up to date</source>
<translation>Ajour</translation>
</message>
<message>
<location line="+43"/>
<source>Catching up...</source>
<translation>Kommer ajour...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation>Sendt transaksjon</translation>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation>Innkommende transaksjon</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Dato: %1
Beløp: %2
Type: %3
Adresse: %4
</translation>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid FXCoin address or malformed URI parameters.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Wallet is <b>not encrypted</b></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Lommeboken er <b>kryptert</b> og for tiden <b>ulåst</b></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Lommeboken er <b>kryptert</b> og for tiden <b>låst</b></translation>
</message>
<message>
<location line="+24"/>
<source>Backup Wallet</source>
<translation>Sikkerhetskopier Lommeboken</translation>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation>Lommebokdata (*.dat)</translation>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation>Sikkerhetskopiering feilet</translation>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+91"/>
<source>%n second(s)</source>
<translation>
<numerusform>%n sekund</numerusform>
<numerusform>%n sekunder</numerusform>
</translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation>
<numerusform>%n minutt</numerusform>
<numerusform>%n minutter</numerusform>
</translation>
</message>
<message numerus="yes">
<location line="-429"/>
<location line="+433"/>
<source>%n hour(s)</source>
<translation>
<numerusform>%n time</numerusform>
<numerusform>%n timer</numerusform>
</translation>
</message>
<message>
<location line="-456"/>
<source>Processed %1 blocks of transaction history.</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+27"/>
<location line="+433"/>
<source>%n day(s)</source>
<translation>
<numerusform>%n dag</numerusform>
<numerusform>%n dager</numerusform>
</translation>
</message>
<message numerus="yes">
<location line="-429"/>
<location line="+6"/>
<source>%n week(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location line="+0"/>
<source>%1 and %2</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+0"/>
<source>%n year(s)</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location line="+5"/>
<source>%1 behind</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Last received block was generated %1 ago.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Error</source>
<translation type="unfinished">Feil</translation>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation type="unfinished">Advarsel</translation>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+69"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+324"/>
<source>Not staking</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+104"/>
<source>A fatal error occurred. FXCoin can no longer continue safely and will quit.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+110"/>
<source>Network Alert</source>
<translation>Nettverksvarsel</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation>Mengde:</translation>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation>Beløp:</translation>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation>Prioritet:</translation>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation>Avgift:</translation>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation>Lav Utdata:</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+537"/>
<source>no</source>
<translation>nei</translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation>Etter Avgift:</translation>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation>Endring:</translation>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation>Fjern alt valgt</translation>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation>Tre modus</translation>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation>Liste modus</translation>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation>Beløp</translation>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation>Merkelapp</translation>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation>Bekreftelser</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation>Bekreftet</translation>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation>Prioritet</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-500"/>
<source>Copy address</source>
<translation>Kopier adresse</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopier merkelapp</translation>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation>Kopiér beløp</translation>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation>Kopier transaksjons-ID</translation>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation>Kopier mengde</translation>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation>Kopier gebyr</translation>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation>Kopier etter gebyr</translation>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation>Kopier prioritet</translation>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation>Kopier veksel</translation>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation>høyest</translation>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation>høy</translation>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation>medium-høy</translation>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation>medium</translation>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation>lav-medium</translation>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation>lav</translation>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation>lavest</translation>
</message>
<message>
<location line="+140"/>
<source>DUST</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation>ja</translation>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"></translation>
</message>
<message><|fim▁hole|> This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation>Denne merkelappen blir rød, viss endringen er mindre enn %1
Dette betyr at det trengs en avgift på minimum %2.</translation>
</message>
<message>
<location line="+36"/>
<location line="+66"/>
<source>(no label)</source>
<translation>(ingen merkelapp)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation>endring fra %1 (%2)</translation>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation>(endring)</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Rediger adresse</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Merkelapp</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Merkelappen assosiert med denne adressen</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Adresse</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>Ny mottaksadresse</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Ny utsendingsadresse</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Rediger mottaksadresse</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Rediger utsendingsadresse</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Den oppgitte adressen "%1" er allerede i adresseboken.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid FXCoin address.</source>
<translation>Den angitte adressen "%1" er ikke en gyldig FXCoin adresse.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Kunne ikke låse opp lommeboken.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Generering av ny nøkkel feilet.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+426"/>
<location line="+12"/>
<source>FXCoin-Qt</source>
<translation>FXCoin-Qt</translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>versjon</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Bruk:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Start Minimert</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Innstillinger</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Hoved</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Betal transaksjons&gebyr</translation>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start FXCoin after logging in to the system.</source>
<translation>Start FXCoin automatisk ved hver innlogging.</translation>
</message>
<message>
<location line="+3"/>
<source>&Start FXCoin on system login</source>
<translation>&Start Blackcoin ved innlogging</translation>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation>&Nettverk</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the FXCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Sett opp port vha. &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the FXCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>&Koble til via en SOCKS proxy:</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>Proxy &IP:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Port:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Proxyens port (f.eks. 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS &Versjon:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>Proxyens SOCKS versjon (f.eks. 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Vindu</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Vis kun ikon i systemkurv etter minimering av vinduet.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Minimer til systemkurv istedenfor oppgavelinjen</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Minimerer vinduet istedenfor å avslutte applikasjonen når vinduet lukkes. Når dette er slått på avsluttes applikasjonen kun ved å velge avslutt i menyen.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>M&inimer ved lukking</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Visning</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>&Språk for brukergrensesnitt</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting FXCoin.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Enhet for visning av beløper:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Velg standard delt enhet for visning i grensesnittet og for sending av fxcoins.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show coin control features or not.</source>
<translation>Skal mynt kontroll funksjoner vises eller ikke.</translation>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Whether to select the coin outputs randomly or with minimal coin age.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Minimize weight consumption (experimental)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Use black visual theme (requires restart)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&OK</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Avbryt</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>&Bruk</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation>standardverdi</translation>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation>Advarsel</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting FXCoin.</source>
<translation>Denne innstillingen vil tre i kraft etter FXCoin er blitt startet på nytt.</translation>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Angitt proxyadresse er ugyldig.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Skjema</translation>
</message>
<message>
<location line="+46"/>
<location line="+247"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the FXCoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-173"/>
<source>Stake:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+32"/>
<source>Unconfirmed:</source>
<translation>Ubekreftet:</translation>
</message>
<message>
<location line="-113"/>
<source>Wallet</source>
<translation>Lommebok</translation>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation>Disponibelt:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation>Din nåværende saldo</translation>
</message>
<message>
<location line="+80"/>
<source>Immature:</source>
<translation>Umoden:</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation>Minet saldo har ikke modnet enda</translation>
</message>
<message>
<location line="+23"/>
<source>Total:</source>
<translation>Totalt:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation>Din nåværende saldo</translation>
</message>
<message>
<location line="+50"/>
<source><b>Recent transactions</b></source>
<translation><b>Siste transaksjoner</b></translation>
</message>
<message>
<location line="-118"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-32"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation>ute av synk</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start fxcoin: click-to-pay handler</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Beløp:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Merkelapp:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Melding:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&Lagre som...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>PNG Bilder (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Klientnavn</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<source>N/A</source>
<translation>-</translation>
</message>
<message>
<location line="-194"/>
<source>Client version</source>
<translation>Klientversjon</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>&Informasjon</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>Bruker OpenSSL versjon</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Oppstartstidspunkt</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Nettverk</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Antall tilkoblinger</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Blokkjeden</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Nåværende antall blokker</translation>
</message>
<message>
<location line="+197"/>
<source>&Network Traffic</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+52"/>
<source>&Clear</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Totals</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+64"/>
<source>In:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+80"/>
<source>Out:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-383"/>
<source>Last block time</source>
<translation>Tidspunkt for siste blokk</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Åpne</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Show the FXCoin-Qt help message to get a list with possible FXCoin command-line options.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation>&Vis</translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Konsoll</translation>
</message>
<message>
<location line="-237"/>
<source>Build date</source>
<translation>Byggedato</translation>
</message>
<message>
<location line="-104"/>
<source>FXCoin - Debug window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>FXCoin Core</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+256"/>
<source>Debug log file</source>
<translation>Loggfil for feilsøk</translation>
</message>
<message>
<location line="+7"/>
<source>Open the FXCoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Tøm konsoll</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="+325"/>
<source>Welcome to the FXCoin RPC console.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Bruk opp og ned pil for å navigere historikken, og <b>Ctrl-L</b> for å tømme skjermen.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Skriv <b>help</b> for en oversikt over kommandoer.</translation>
</message>
<message>
<location line="+127"/>
<source>%1 B</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>%1 KB</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>%1 MB</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>%1 GB</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>%1 m</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>%1 h</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>%1 h %2 m</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+182"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Send Blackcoins</translation>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation>Mynt Kontroll Funksjoner</translation>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation>Inndata...</translation>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation>automatisk valgte</translation>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation>Utilstrekkelige midler!</translation>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation>Mengde:</translation>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation>Beløp:</translation>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 FXC</source>
<translation>123.456 FXC {0.00 ?}</translation>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation>Prioritet:</translation>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation type="unfinished">medium</translation>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation>Avgift:</translation>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation>Lav Utdata:</translation>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation>nei</translation>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation>Etter Avgift:</translation>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation>Send til flere enn én mottaker</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>&Legg til Mottaker</translation>
</message>
<message>
<location line="+16"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Fjern &Alt</translation>
</message>
<message>
<location line="+24"/>
<source>Balance:</source>
<translation>Saldo:</translation>
</message>
<message>
<location line="+16"/>
<source>123.456 FXC</source>
<translation>123.456 FXC</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Bekreft sending</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>S&end</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-174"/>
<source>Enter a FXCoin address (e.g. FEFm2fX2nHKSaW2vecxHqbKvVWCprqwYTf)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation>Kopier mengde</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopiér beløp</translation>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation>Kopier gebyr</translation>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished">Kopier etter gebyr</translation>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished">Kopier prioritet</translation>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished">Kopier veksel</translation>
</message>
<message>
<location line="+87"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> til %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Bekreft sending av bitcoins</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Er du sikker på du ønsker å sende %1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation>og</translation>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Adresse for mottaker er ugyldig.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Beløpen som skal betales må være over 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Beløpet overstiger saldo.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Totalbeløpet overstiger saldo etter at %1 transaksjonsgebyr er lagt til.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Duplikate adresser funnet. Kan bare sende én gang til hver adresse per operasjon.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+247"/>
<source>WARNING: Invalid FXCoin address</source>
<translation>ADVARSEL: Ugyldig FXCoin adresse</translation>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(ingen merkelapp)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished">Skjema</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>&Beløp:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Betal &Til:</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. FEFm2fX2nHKSaW2vecxHqbKvVWCprqwYTf)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Skriv inn en merkelapp for denne adressen for å legge den til i din adressebok</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&Merkelapp:</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>Velg adresse fra adresseboken</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Lim inn adresse fra utklippstavlen</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation>Fjern denne mottakeren</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a FXCoin address (e.g. FEFm2fX2nHKSaW2vecxHqbKvVWCprqwYTf)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Signaturer - Signer / Verifiser en melding</translation>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation>&Signér Melding</translation>
</message>
<message>
<location line="-118"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>Du kan signere meldinger med dine adresser for å bevise at du eier dem. Ikke signér vage meldinger da phishing-angrep kan prøve å lure deg til å signere din identitet over til andre. Signér kun fullt detaljerte utsagn som du er enig i.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. FEFm2fX2nHKSaW2vecxHqbKvVWCprqwYTf)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation>Velg en adresse fra adresseboken</translation>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-193"/>
<source>Paste address from clipboard</source>
<translation>Lim inn adresse fra utklippstavlen</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Skriv inn meldingen du vil signere her</translation>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Kopier valgt signatur til utklippstavle</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this FXCoin address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation>Tilbakestill alle felter for meldingssignering</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Fjern &Alt</translation>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation>&Verifiser Melding</translation>
</message>
<message>
<location line="-64"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation>Angi adresse for signering, melding (vær sikker på at du kopierer linjeskift, mellomrom, tab, etc. helt nøyaktig) og signatur under for å verifisere meldingen. Vær forsiktig med at du ikke gir signaturen mer betydning enn det som faktisk står i meldingen, for å unngå å bli lurt av såkalte "man-in-the-middle" angrep.</translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. FEFm2fX2nHKSaW2vecxHqbKvVWCprqwYTf)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified FXCoin address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation>Tilbakestill alle felter for meldingsverifikasjon</translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a FXCoin address (e.g. FEFm2fX2nHKSaW2vecxHqbKvVWCprqwYTf)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Klikk "Signer Melding" for å generere signatur</translation>
</message>
<message>
<location line="+3"/>
<source>Enter FXCoin signature</source>
<translation>Skriv inn FXCoin signatur</translation>
</message>
<message>
<location line="+85"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Angitt adresse er ugyldig.</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Vennligst sjekk adressen og prøv igjen.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>Angitt adresse refererer ikke til en nøkkel.</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>Opplåsing av lommebok ble avbrutt.</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>Privat nøkkel for den angitte adressen er ikke tilgjengelig.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Signering av melding feilet.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Melding signert.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Signaturen kunne ikke dekodes.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Vennligst sjekk signaturen og prøv igjen.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>Signaturen passer ikke til meldingen.</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Verifikasjon av melding feilet.</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Melding verifisert.</translation>
</message>
</context>
<context>
<name>TrafficGraphWidget</name>
<message>
<location filename="../trafficgraphwidget.cpp" line="+75"/>
<source>KB/s</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+25"/>
<source>Open until %1</source>
<translation>Åpen til %1</translation>
</message>
<message>
<location line="+6"/>
<source>conflicted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation>%1/frakoblet</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/ubekreftet</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 bekreftelser</translation>
</message>
<message>
<location line="+17"/>
<source>Status</source>
<translation>Status</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation>
<numerusform>, kringkast gjennom %n node</numerusform>
<numerusform>, kringkast gjennom %n noder</numerusform>
</translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Kilde</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Generert</translation>
</message>
<message>
<location line="+5"/>
<location line="+13"/>
<source>From</source>
<translation>Fra</translation>
</message>
<message>
<location line="+1"/>
<location line="+19"/>
<location line="+58"/>
<source>To</source>
<translation>Til</translation>
</message>
<message>
<location line="-74"/>
<location line="+2"/>
<source>own address</source>
<translation>egen adresse</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>merkelapp</translation>
</message>
<message>
<location line="+34"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Kredit</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation>
<numerusform>blir moden om %n blokk</numerusform>
<numerusform>blir moden om %n blokker</numerusform>
</translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>ikke akseptert</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Debet</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Transaksjonsgebyr</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Nettobeløp</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Melding</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Kommentar</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>Transaksjons-ID</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 510 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>Informasjon for feilsøk</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Transaksjon</translation>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation>Inndata</translation>
</message>
<message>
<location line="+21"/>
<source>Amount</source>
<translation>Beløp</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>sann</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>usann</translation>
</message>
<message>
<location line="-202"/>
<source>, has not been successfully broadcast yet</source>
<translation>, har ikke blitt kringkastet uten problemer enda.</translation>
</message>
<message numerus="yes">
<location line="-36"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished">
<numerusform>Åpen for %n blokk til</numerusform>
<numerusform>Åpen for %n blokker til</numerusform>
</translation>
</message>
<message>
<location line="+67"/>
<source>unknown</source>
<translation>ukjent</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Transaksjonsdetaljer</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Her vises en detaljert beskrivelse av transaksjonen</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+231"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Type</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Beløp</translation>
</message>
<message>
<location line="+52"/>
<source>Open until %1</source>
<translation>Åpen til %1</translation>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Bekreftet (%1 bekreftelser)</translation>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation>
<numerusform>Åpen for %n blokk til</numerusform>
<numerusform>Åpen for %n blokker til</numerusform>
</translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation>Ubekreftet</translation>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation>Bekrefter (%1 av %2 anbefalte bekreftelser)</translation>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Denne blokken har ikke blitt mottatt av noen andre noder og vil sannsynligvis ikke bli akseptert!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Generert men ikke akseptert</translation>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation>Mottatt med</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Mottatt fra</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Sendt til</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Betaling til deg selv</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Utvunnet</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>-</translation>
</message>
<message>
<location line="+194"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Transaksjonsstatus. Hold muspekeren over dette feltet for å se antall bekreftelser.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Dato og tid for da transaksjonen ble mottat.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Type transaksjon.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Mottaksadresse for transaksjonen</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Beløp fjernet eller lagt til saldo.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+54"/>
<location line="+17"/>
<source>All</source>
<translation>Alle</translation>
</message>
<message>
<location line="-16"/>
<source>Today</source>
<translation>I dag</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Denne uken</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Denne måneden</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Forrige måned</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Dette året</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Intervall...</translation>
</message>
<message>
<location line="+12"/>
<source>Received with</source>
<translation>Mottatt med</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Sendt til</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Til deg selv</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Utvunnet</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Andre</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Skriv inn adresse eller merkelapp for søk</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Minimumsbeløp</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Kopier adresse</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopier merkelapp</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopiér beløp</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation>Kopier transaksjons-ID</translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Rediger merkelapp</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Vis transaksjonsdetaljer</translation>
</message>
<message>
<location line="+138"/>
<source>Export Transaction Data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kommaseparert fil (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Bekreftet</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Type</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Merkelapp</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Beløp</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished">Feil under eksportering</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Kunne ikke skrive til filen %1</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Intervall:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>til</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+208"/>
<source>Sending...</source>
<translation>Sender...</translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+172"/>
<source>FXCoin version</source>
<translation>FXCoin versjon</translation>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation>Bruk:</translation>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or fxcoind</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation>List opp kommandoer</translation>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation>Vis hjelpetekst for en kommando</translation>
</message>
<message>
<location line="-146"/>
<source>Options:</source>
<translation>Innstillinger:</translation>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: fxcoin.conf)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: fxcoind.pid)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation>Angi lommebok fil (inne i data mappe)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Angi mappe for datafiler</translation>
</message>
<message>
<location line="-25"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=fxcoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "FXCoin Alert" [email protected]
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+27"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Sett størrelse på mellomlager for database i megabytes (standardverdi: 25)</translation>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 15714 or testnet: 25714)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Hold maks <n> koblinger åpne til andre noder (standardverdi: 125)</translation>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Koble til node for å hente adresser til andre noder, koble så fra igjen</translation>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation>Angi din egen offentlige adresse</translation>
</message>
<message>
<location line="+4"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Always query for peer addresses via DNS lookup (default: 0)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Grenseverdi for å koble fra noder med dårlig oppførsel (standardverdi: 100)</translation>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Antall sekunder noder med dårlig oppførsel hindres fra å koble til på nytt (standardverdi: 86400)</translation>
</message>
<message>
<location line="-37"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation>En feil oppstod ved opprettelse av RPC port %u for lytting: %s</translation>
</message>
<message>
<location line="+64"/>
<source>Listen for JSON-RPC connections on <port> (default: 15715 or testnet: 25715)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-16"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Ta imot kommandolinje- og JSON-RPC-kommandoer</translation>
</message>
<message>
<location line="+1"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Kjør i bakgrunnen som daemon og ta imot kommandoer</translation>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation>Bruk testnettverket</translation>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Ta imot tilkoblinger fra utsiden (standardverdi: 1 hvis uten -proxy eller -connect)</translation>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation>En feil oppstod under oppsettet av RPC port %u for IPv6, tilbakestilles til IPv4: %s</translation>
</message>
<message>
<location line="+95"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Advarsel: -paytxfee er satt veldig høyt! Dette er transaksjonsgebyret du betaler når du sender transaksjoner.</translation>
</message>
<message>
<location line="-102"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong FXCoin will not work properly.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+131"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Advarsel: Feil ved lesing av wallet.dat! Alle taster lest riktig, men transaksjon dataene eller adresse innlegg er kanskje manglende eller feil.</translation>
</message>
<message>
<location line="-18"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation>Advarsel: wallet.dat korrupt, data reddet! Original wallet.dat lagret som wallet.{timestamp}.bak i %s; hvis din saldo eller dine transaksjoner ikke er korrekte bør du gjenopprette fra en backup.</translation>
</message>
<message>
<location line="-31"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Forsøk å berge private nøkler fra en korrupt wallet.dat</translation>
</message>
<message>
<location line="+5"/>
<source>Block creation options:</source>
<translation>Valg for opprettelse av blokker:</translation>
</message>
<message>
<location line="-68"/>
<source>Connect only to the specified node(s)</source>
<translation>Koble kun til angitt(e) node(r)</translation>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Oppdag egen IP-adresse (standardverdi: 1 ved lytting og uten -externalip)</translation>
</message>
<message>
<location line="+100"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>Kunne ikke lytte på noen port. Bruk -listen=0 hvis det er dette du vil.</translation>
</message>
<message>
<location line="-90"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+88"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-87"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>Maks mottaksbuffer per forbindelse, <n>*1000 bytes (standardverdi: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Maks sendebuffer per forbindelse, <n>*1000 bytes (standardverdi: 1000)</translation>
</message>
<message>
<location line="-17"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation>Koble kun til noder i nettverket <nett> (IPv4, IPv6 eller Tor)</translation>
</message>
<message>
<location line="+31"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+40"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation>SSL valg: (se Bitcoin Wiki for instruksjoner for oppsett av SSL)</translation>
</message>
<message>
<location line="-80"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+42"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Send spor/debug informasjon til konsollet istedenfor debug.log filen</translation>
</message>
<message>
<location line="+34"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>Sett minimum blokkstørrelse i bytes (standardverdi: 0)</translation>
</message>
<message>
<location line="-34"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Krymp debug.log filen når klienten starter (standardverdi: 1 hvis uten -debug)</translation>
</message>
<message>
<location line="-43"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Angi tidsavbrudd for forbindelse i millisekunder (standardverdi: 5000)</translation>
</message>
<message>
<location line="+115"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-85"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Bruk UPnP for lytteport (standardverdi: 0)</translation>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Bruk UPnP for lytteport (standardverdi: 1 ved lytting)</translation>
</message>
<message>
<location line="-26"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+46"/>
<source>Username for JSON-RPC connections</source>
<translation>Brukernavn for JSON-RPC forbindelser</translation>
</message>
<message>
<location line="+51"/>
<source>Verifying database integrity...</source>
<translation>Verifiserer databasens integritet...</translation>
</message>
<message>
<location line="+44"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Warning</source>
<translation type="unfinished">Advarsel</translation>
</message>
<message>
<location line="+1"/>
<source>Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>Advarsel: Denne versjonen er foreldet, oppgradering kreves!</translation>
</message>
<message>
<location line="-54"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation>wallet.dat korrupt, bergning feilet</translation>
</message>
<message>
<location line="-56"/>
<source>Password for JSON-RPC connections</source>
<translation>Passord for JSON-RPC forbindelser</translation>
</message>
<message>
<location line="-31"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Output debugging information (default: 0, supplying <category> is optional)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>If <category> is not supplied, output all debugging information.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source><category> can be:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Tillat JSON-RPC tilkoblinger fra angitt IP-adresse</translation>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Send kommandoer til node på <ip> (standardverdi: 127.0.0.1)</translation>
</message>
<message>
<location line="+1"/>
<source>Wait for RPC server to start</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Eksekvér kommando når beste blokk endrer seg (%s i kommandoen erstattes med blokkens hash)</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>Kjør kommando når en lommeboktransaksjon endres (%s i cmd er erstattet med TxID)</translation>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation>Oppgradér lommebok til nyeste format</translation>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Angi størrelse på nøkkel-lager til <n> (standardverdi: 100)</translation>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Se gjennom blokk-kjeden etter manglende lommeboktransaksjoner</translation>
</message>
<message>
<location line="+3"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Bruk OpenSSL (https) for JSON-RPC forbindelser</translation>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Servers sertifikat (standardverdi: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Servers private nøkkel (standardverdi: server.pem)</translation>
</message>
<message>
<location line="+10"/>
<source>Initialization sanity check failed. FXCoin is shutting down.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+50"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Error: Disk space is low!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-173"/>
<source>This help message</source>
<translation>Denne hjelpemeldingen</translation>
</message>
<message>
<location line="+103"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation>Lommeboken %s holder til utenfor data mappen %s.</translation>
</message>
<message>
<location line="+37"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Kan ikke binde til %s på denne datamaskinen (bind returnerte feil %d, %s)</translation>
</message>
<message>
<location line="-132"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Tillat DNS oppslag for -addnode, -seednode og -connect</translation>
</message>
<message>
<location line="+125"/>
<source>Loading addresses...</source>
<translation>Laster adresser...</translation>
</message>
<message>
<location line="-12"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Feil ved lasting av wallet.dat: Lommeboken er skadet</translation>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of FXCoin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart FXCoin to complete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation>Feil ved lasting av wallet.dat</translation>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Ugyldig -proxy adresse: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Ukjent nettverk angitt i -onlynet '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>Ukjent -socks proxy versjon angitt: %i</translation>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Kunne ikke slå opp -bind adresse: '%s'</translation>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Kunne ikke slå opp -externalip adresse: '%s'</translation>
</message>
<message>
<location line="-23"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Ugyldig beløp for -paytxfee=<beløp>: '%s'</translation>
</message>
<message>
<location line="+60"/>
<source>Sending...</source>
<translation>Sender...</translation>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation>Ugyldig beløp</translation>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation>Utilstrekkelige midler</translation>
</message>
<message>
<location line="-40"/>
<source>Loading block index...</source>
<translation>Laster blokkindeks...</translation>
</message>
<message>
<location line="-109"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Legg til node for tilkobling og hold forbindelsen åpen</translation>
</message>
<message>
<location line="+124"/>
<source>Unable to bind to %s on this computer. FXCoin is probably already running.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-100"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Gebyr per KB som skal legges til transaksjoner du sender</translation>
</message>
<message>
<location line="+33"/>
<source>Minimize weight consumption (experimental) (default: 0)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>How many blocks to check at startup (default: 500, 0 = all)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Keep at most <n> unconnectable blocks in memory (default: %u)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. FXCoin is probably already running.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Error initializing wallet database environment %s!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Loading wallet...</source>
<translation>Laster lommebok...</translation>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation>Kan ikke nedgradere lommebok</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation>Kan ikke skrive standardadresse</translation>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation>Leser gjennom...</translation>
</message>
<message>
<location line="+2"/>
<source>Done loading</source>
<translation>Ferdig med lasting</translation>
</message>
<message>
<location line="-160"/>
<source>To use the %s option</source>
<translation>For å bruke %s opsjonen</translation>
</message>
<message>
<location line="+187"/>
<source>Error</source>
<translation>Feil</translation>
</message>
<message>
<location line="-18"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>Du må sette rpcpassword=<passord> i konfigurasjonsfilen:
%s
Hvis filen ikke finnes, opprett den med leserettighet kun for eier av filen.</translation>
</message>
</context>
</TS><|fim▁end|> | <location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
|
<|file_name|>treemap.src.js<|end_file_name|><|fim▁begin|>/**
* @license Highcharts JS v4.2.2 (2016-02-04)
*
* (c) 2014 Highsoft AS
* Authors: Jon Arild Nygard / Oystein Moseng
*
* License: www.highcharts.com/license
*/
(function (factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function (H) {
var seriesTypes = H.seriesTypes,
map = H.map,
merge = H.merge,
extend = H.extend,
extendClass = H.extendClass,
defaultOptions = H.getOptions(),
plotOptions = defaultOptions.plotOptions,
noop = function () {
},
each = H.each,
grep = H.grep,
pick = H.pick,
Series = H.Series,
stableSort = H.stableSort,
Color = H.Color,
eachObject = function (list, func, context) {
var key;
context = context || this;
for (key in list) {
if (list.hasOwnProperty(key)) {
func.call(context, list[key], key, list);
}
}
},
reduce = function (arr, func, previous, context) {
context = context || this;
arr = arr || []; // @note should each be able to handle empty values automatically?
each(arr, function (current, i) {
previous = func.call(context, previous, current, i, arr);
});
return previous;
},
// @todo find correct name for this function.
recursive = function (item, func, context) {
var next;
context = context || this;
next = func.call(context, item);
if (next !== false) {
recursive(next, func, context);
}
};
// Define default options
plotOptions.treemap = merge(plotOptions.scatter, {
showInLegend: false,
marker: false,
borderColor: '#E0E0E0',
borderWidth: 1,
dataLabels: {
enabled: true,
defer: false,
verticalAlign: 'middle',
formatter: function () { // #2945
return this.point.name || this.point.id;
},
inside: true
},
tooltip: {
headerFormat: '',
pointFormat: '<b>{point.name}</b>: {point.node.val}</b><br/>'
},
layoutAlgorithm: 'sliceAndDice',
layoutStartingDirection: 'vertical',
alternateStartingDirection: false,
levelIsConstant: true,
states: {
hover: {
borderColor: '#A0A0A0',
brightness: seriesTypes.heatmap ? 0 : 0.1,
shadow: false
}
},
drillUpButton: {
position: {
align: 'right',
x: -10,
y: 10
}
}
});
// Stolen from heatmap
var colorSeriesMixin = {
// mapping between SVG attributes and the corresponding options
pointAttrToOptions: {},
pointArrayMap: ['value'],
axisTypes: seriesTypes.heatmap ? ['xAxis', 'yAxis', 'colorAxis'] : ['xAxis', 'yAxis'],
optionalAxis: 'colorAxis',
getSymbol: noop,
parallelArrays: ['x', 'y', 'value', 'colorValue'],
colorKey: 'colorValue', // Point color option key
translateColors: seriesTypes.heatmap && seriesTypes.heatmap.prototype.translateColors
};
// The Treemap series type
seriesTypes.treemap = extendClass(seriesTypes.scatter, merge(colorSeriesMixin, {
type: 'treemap',
trackerGroups: ['group', 'dataLabelsGroup'],
pointClass: extendClass(H.Point, {
setVisible: seriesTypes.pie.prototype.pointClass.prototype.setVisible
}),
/**
* Creates an object map from parent id to childrens index.
* @param {Array} data List of points set in options.
* @param {string} data[].parent Parent id of point.
* @param {Array} ids List of all point ids.
* @return {Object} Map from parent id to children index in data.
*/
getListOfParents: function (data, ids) {
var listOfParents = reduce(data, function (prev, curr, i) {
var parent = pick(curr.parent, '');
if (prev[parent] === undefined) {
prev[parent] = [];
}
prev[parent].push(i);
return prev;
}, {});
// If parent does not exist, hoist parent to root of tree.
eachObject(listOfParents, function (children, parent, list) {
if ((parent !== '') && (H.inArray(parent, ids) === -1)) {
each(children, function (child) {
list[''].push(child);
});
delete list[parent];
}
});
return listOfParents;
},
/**
* Creates a tree structured object from the series points
*/
getTree: function () {
var tree,
series = this,
allIds = map(this.data, function (d) {
return d.id;
}),
parentList = series.getListOfParents(this.data, allIds);
series.nodeMap = [];
tree = series.buildNode('', -1, 0, parentList, null);
recursive(this.nodeMap[this.rootNode], function (node) {
var next = false,
p = node.parent;
node.visible = true;
if (p || p === '') {
next = series.nodeMap[p];
}
return next;
});
recursive(this.nodeMap[this.rootNode].children, function (children) {
var next = false;
each(children, function (child) {
child.visible = true;
if (child.children.length) {
next = (next || []).concat(child.children);
}
});
return next;
});
this.setTreeValues(tree);
return tree;
},
init: function (chart, options) {
var series = this;
Series.prototype.init.call(series, chart, options);
if (series.options.allowDrillToNode) {
series.drillTo();
}
},
buildNode: function (id, i, level, list, parent) {
var series = this,
children = [],
point = series.points[i],
node,
child;
// Actions
each((list[id] || []), function (i) {
child = series.buildNode(series.points[i].id, i, (level + 1), list, id);
children.push(child);
});
node = {
id: id,
i: i,
children: children,
level: level,
parent: parent,
visible: false // @todo move this to better location
};
series.nodeMap[node.id] = node;
if (point) {
point.node = node;
}
return node;
},
setTreeValues: function (tree) {
var series = this,
options = series.options,
childrenTotal = 0,
children = [],
val,
point = series.points[tree.i];
// First give the children some values
each(tree.children, function (child) {
child = series.setTreeValues(child);
children.push(child);
if (!child.ignore) {
childrenTotal += child.val;
} else {
// @todo Add predicate to avoid looping already ignored children
recursive(child.children, function (children) {
var next = false;
each(children, function (node) {
extend(node, {
ignore: true,
isLeaf: false,
visible: false
});
if (node.children.length) {
next = (next || []).concat(node.children);
}
});
return next;
});
}
});
// Sort the children
stableSort(children, function (a, b) {
return a.sortIndex - b.sortIndex;
});
// Set the values
val = pick(point && point.value, childrenTotal);
extend(tree, {
children: children,
childrenTotal: childrenTotal,
// Ignore this node if point is not visible
ignore: !(pick(point && point.visible, true) && (val > 0)),
isLeaf: tree.visible && !childrenTotal,
levelDynamic: (options.levelIsConstant ? tree.level : (tree.level - series.nodeMap[series.rootNode].level)),
name: pick(point && point.name, ''),
sortIndex: pick(point && point.sortIndex, -val),
val: val
});
return tree;
},
/**
* Recursive function which calculates the area for all children of a node.
* @param {Object} node The node which is parent to the children.
* @param {Object} area The rectangular area of the parent.
*/
calculateChildrenAreas: function (parent, area) {
var series = this,
options = series.options,
level = this.levelMap[parent.levelDynamic + 1],
algorithm = pick((series[level && level.layoutAlgorithm] && level.layoutAlgorithm), options.layoutAlgorithm),
alternate = options.alternateStartingDirection,
childrenValues = [],
children;
// Collect all children which should be included
children = grep(parent.children, function (n) {
return !n.ignore;
});
if (level && level.layoutStartingDirection) {
area.direction = level.layoutStartingDirection === 'vertical' ? 0 : 1;
}
childrenValues = series[algorithm](area, children);
each(children, function (child, index) {
var values = childrenValues[index];
child.values = merge(values, {
val: child.childrenTotal,
direction: (alternate ? 1 - area.direction : area.direction)
});
child.pointValues = merge(values, {
x: (values.x / series.axisRatio),
width: (values.width / series.axisRatio)
});
// If node has children, then call method recursively
if (child.children.length) {
series.calculateChildrenAreas(child, child.values);
}
});
},
setPointValues: function () {
var series = this,
xAxis = series.xAxis,
yAxis = series.yAxis;
each(series.points, function (point) {
var node = point.node,
values = node.pointValues,
x1,
x2,
y1,
y2;
// Points which is ignored, have no values.
if (values) {
x1 = Math.round(xAxis.translate(values.x, 0, 0, 0, 1));
x2 = Math.round(xAxis.translate(values.x + values.width, 0, 0, 0, 1));
y1 = Math.round(yAxis.translate(values.y, 0, 0, 0, 1));
y2 = Math.round(yAxis.translate(values.y + values.height, 0, 0, 0, 1));
// Set point values
point.shapeType = 'rect';
point.shapeArgs = {
x: Math.min(x1, x2),
y: Math.min(y1, y2),
width: Math.abs(x2 - x1),
height: Math.abs(y2 - y1)
};
point.plotX = point.shapeArgs.x + (point.shapeArgs.width / 2);
point.plotY = point.shapeArgs.y + (point.shapeArgs.height / 2);
} else {
// Reset visibility
delete point.plotX;
delete point.plotY;
}
});
},
setColorRecursive: function (node, color) {
var series = this,
point,
level;
if (node) {
point = series.points[node.i];
level = series.levelMap[node.levelDynamic];
// Select either point color, level color or inherited color.
color = pick(point && point.options.color, level && level.color, color);
if (point) {
point.color = color;
}
// Do it all again with the children
if (node.children.length) {
each(node.children, function (child) {
series.setColorRecursive(child, color);
});
}
}
},
algorithmGroup: function (h, w, d, p) {
this.height = h;
this.width = w;
this.plot = p;
this.direction = d;
this.startDirection = d;
this.total = 0;
this.nW = 0;
this.lW = 0;
this.nH = 0;
this.lH = 0;
this.elArr = [];
this.lP = {
total: 0,
lH: 0,
nH: 0,
lW: 0,
nW: 0,
nR: 0,
lR: 0,
aspectRatio: function (w, h) {
return Math.max((w / h), (h / w));
}
};
this.addElement = function (el) {
this.lP.total = this.elArr[this.elArr.length - 1];
this.total = this.total + el;
if (this.direction === 0) {
// Calculate last point old aspect ratio
this.lW = this.nW;
this.lP.lH = this.lP.total / this.lW;
this.lP.lR = this.lP.aspectRatio(this.lW, this.lP.lH);
// Calculate last point new aspect ratio
this.nW = this.total / this.height;
this.lP.nH = this.lP.total / this.nW;
this.lP.nR = this.lP.aspectRatio(this.nW, this.lP.nH);
} else {
// Calculate last point old aspect ratio
this.lH = this.nH;
this.lP.lW = this.lP.total / this.lH;
this.lP.lR = this.lP.aspectRatio(this.lP.lW, this.lH);
// Calculate last point new aspect ratio
this.nH = this.total / this.width;
this.lP.nW = this.lP.total / this.nH;
this.lP.nR = this.lP.aspectRatio(this.lP.nW, this.nH);
}
this.elArr.push(el);
};
this.reset = function () {
this.nW = 0;
this.lW = 0;
this.elArr = [];
this.total = 0;
};
},
algorithmCalcPoints: function (directionChange, last, group, childrenArea) {
var pX,
pY,
pW,
pH,
gW = group.lW,
gH = group.lH,
plot = group.plot,
keep,
i = 0,
end = group.elArr.length - 1;
if (last) {
gW = group.nW;
gH = group.nH;
} else {
keep = group.elArr[group.elArr.length - 1];
}
each(group.elArr, function (p) {
if (last || (i < end)) {
if (group.direction === 0) {
pX = plot.x;
pY = plot.y;
pW = gW;
pH = p / pW;
} else {
pX = plot.x;
pY = plot.y;
pH = gH;
pW = p / pH;
}
childrenArea.push({
x: pX,
y: pY,
width: pW,
height: pH
});
if (group.direction === 0) {
plot.y = plot.y + pH;
} else {
plot.x = plot.x + pW;
}
}
i = i + 1;
});
// Reset variables
group.reset();
if (group.direction === 0) {
group.width = group.width - gW;
} else {
group.height = group.height - gH;
}
plot.y = plot.parent.y + (plot.parent.height - group.height);
plot.x = plot.parent.x + (plot.parent.width - group.width);
if (directionChange) {
group.direction = 1 - group.direction;
}
// If not last, then add uncalculated element
if (!last) {
group.addElement(keep);
}
},
algorithmLowAspectRatio: function (directionChange, parent, children) {
var childrenArea = [],
series = this,
pTot,
plot = {
x: parent.x,
y: parent.y,
parent: parent
},
direction = parent.direction,
i = 0,
end = children.length - 1,
group = new this.algorithmGroup(parent.height, parent.width, direction, plot);
// Loop through and calculate all areas
each(children, function (child) {
pTot = (parent.width * parent.height) * (child.val / parent.val);
group.addElement(pTot);
if (group.lP.nR > group.lP.lR) {
series.algorithmCalcPoints(directionChange, false, group, childrenArea, plot);
}
// If last child, then calculate all remaining areas
if (i === end) {
series.algorithmCalcPoints(directionChange, true, group, childrenArea, plot);
}
i = i + 1;
});
return childrenArea;
},
algorithmFill: function (directionChange, parent, children) {
var childrenArea = [],
pTot,
direction = parent.direction,
x = parent.x,
y = parent.y,
width = parent.width,
height = parent.height,
pX,
pY,
pW,
pH;
each(children, function (child) {
pTot = (parent.width * parent.height) * (child.val / parent.val);
pX = x;
pY = y;
if (direction === 0) {
pH = height;
pW = pTot / pH;
width = width - pW;
x = x + pW;
} else {
pW = width;
pH = pTot / pW;
height = height - pH;
y = y + pH;
}
childrenArea.push({
x: pX,
y: pY,
width: pW,
height: pH
});
if (directionChange) {
direction = 1 - direction;
}
});
return childrenArea;
},
strip: function (parent, children) {
return this.algorithmLowAspectRatio(false, parent, children);
},
squarified: function (parent, children) {
return this.algorithmLowAspectRatio(true, parent, children);
},
sliceAndDice: function (parent, children) {
return this.algorithmFill(true, parent, children);
},
stripes: function (parent, children) {
return this.algorithmFill(false, parent, children);
},
translate: function () {
var pointValues,
seriesArea,
tree,
val;
// Call prototype function
Series.prototype.translate.call(this);
// Assign variables
this.rootNode = pick(this.options.rootId, '');
// Create a object map from level to options
this.levelMap = reduce(this.options.levels, function (arr, item) {
arr[item.level] = item;
return arr;
}, {});
tree = this.tree = this.getTree(); // @todo Only if series.isDirtyData is true
// Calculate plotting values.
this.axisRatio = (this.xAxis.len / this.yAxis.len);
this.nodeMap[''].pointValues = pointValues = { x: 0, y: 0, width: 100, height: 100 };
this.nodeMap[''].values = seriesArea = merge(pointValues, {
width: (pointValues.width * this.axisRatio),
direction: (this.options.layoutStartingDirection === 'vertical' ? 0 : 1),
val: tree.val
});
this.calculateChildrenAreas(tree, seriesArea);
// Logic for point colors
if (this.colorAxis) {
this.translateColors();
} else if (!this.options.colorByPoint) {
this.setColorRecursive(this.tree, undefined);
}
// Update axis extremes according to the root node.
val = this.nodeMap[this.rootNode].pointValues;
this.xAxis.setExtremes(val.x, val.x + val.width, false);
this.yAxis.setExtremes(val.y, val.y + val.height, false);
this.xAxis.setScale();
this.yAxis.setScale();
// Assign values to points.
this.setPointValues();
},
/**
* Extend drawDataLabels with logic to handle custom options related to the treemap series:
* - Points which is not a leaf node, has dataLabels disabled by default.
* - Options set on series.levels is merged in.
* - Width of the dataLabel is set to match the width of the point shape.
*/
drawDataLabels: function () {
var series = this,
points = grep(series.points, function (n) {
return n.node.visible;
}),
options,
level;
each(points, function (point) {
level = series.levelMap[point.node.levelDynamic];
// Set options to new object to avoid problems with scope
options = { style: {} };
// If not a leaf, then label should be disabled as default
if (!point.node.isLeaf) {
options.enabled = false;
}
// If options for level exists, include them as well
if (level && level.dataLabels) {
options = merge(options, level.dataLabels);
series._hasPointLabels = true;
}<|fim▁hole|> // Set dataLabel width to the width of the point shape.
if (point.shapeArgs) {
options.style.width = point.shapeArgs.width;
}
// Merge custom options with point options
point.dlOptions = merge(options, point.options.dataLabels);
});
Series.prototype.drawDataLabels.call(this);
},
alignDataLabel: seriesTypes.column.prototype.alignDataLabel,
/**
* Get presentational attributes
*/
pointAttribs: function (point, state) {
var level = this.levelMap[point.node.levelDynamic] || {},
options = this.options,
attr,
stateOptions = (state && options.states[state]) || {};
// Set attributes by precedence. Point trumps level trumps series. Stroke width uses pick
// because it can be 0.
attr = {
'stroke': point.borderColor || level.borderColor || stateOptions.borderColor || options.borderColor,
'stroke-width': pick(point.borderWidth, level.borderWidth, stateOptions.borderWidth, options.borderWidth),
'dashstyle': point.borderDashStyle || level.borderDashStyle || stateOptions.borderDashStyle || options.borderDashStyle,
'fill': point.color || this.color,
'zIndex': state === 'hover' ? 1 : 0
};
if (point.node.level <= this.nodeMap[this.rootNode].level) {
// Hide levels above the current view
attr.fill = 'none';
attr['stroke-width'] = 0;
} else if (!point.node.isLeaf) {
// If not a leaf, then remove fill
// @todo let users set the opacity
attr.fill = pick(options.interactByLeaf, !options.allowDrillToNode) ? 'none' : Color(attr.fill).setOpacity(state === 'hover' ? 0.75 : 0.15).get();
} else if (state) {
// Brighten and hoist the hover nodes
attr.fill = Color(attr.fill).brighten(stateOptions.brightness).get();
}
return attr;
},
/**
* Extending ColumnSeries drawPoints
*/
drawPoints: function () {
var series = this,
points = grep(series.points, function (n) {
return n.node.visible;
});
each(points, function (point) {
var groupKey = 'levelGroup-' + point.node.levelDynamic;
if (!series[groupKey]) {
series[groupKey] = series.chart.renderer.g(groupKey)
.attr({
zIndex: 1000 - point.node.levelDynamic // @todo Set the zIndex based upon the number of levels, instead of using 1000
})
.add(series.group);
}
point.group = series[groupKey];
// Preliminary code in prepraration for HC5 that uses pointAttribs for all series
point.pointAttr = {
'': series.pointAttribs(point),
'hover': series.pointAttribs(point, 'hover'),
'select': {}
};
});
// Call standard drawPoints
seriesTypes.column.prototype.drawPoints.call(this);
// If drillToNode is allowed, set a point cursor on clickables & add drillId to point
if (series.options.allowDrillToNode) {
each(points, function (point) {
var cursor,
drillId;
if (point.graphic) {
drillId = point.drillId = series.options.interactByLeaf ? series.drillToByLeaf(point) : series.drillToByGroup(point);
cursor = drillId ? 'pointer' : 'default';
point.graphic.css({ cursor: cursor });
}
});
}
},
/**
* Add drilling on the suitable points
*/
drillTo: function () {
var series = this;
H.addEvent(series, 'click', function (event) {
var point = event.point,
drillId = point.drillId,
drillName;
// If a drill id is returned, add click event and cursor.
if (drillId) {
drillName = series.nodeMap[series.rootNode].name || series.rootNode;
point.setState(''); // Remove hover
series.drillToNode(drillId);
series.showDrillUpButton(drillName);
}
});
},
/**
* Finds the drill id for a parent node.
* Returns false if point should not have a click event
* @param {Object} point
* @return {string || boolean} Drill to id or false when point should not have a click event
*/
drillToByGroup: function (point) {
var series = this,
drillId = false;
if ((point.node.level - series.nodeMap[series.rootNode].level) === 1 && !point.node.isLeaf) {
drillId = point.id;
}
return drillId;
},
/**
* Finds the drill id for a leaf node.
* Returns false if point should not have a click event
* @param {Object} point
* @return {string || boolean} Drill to id or false when point should not have a click event
*/
drillToByLeaf: function (point) {
var series = this,
drillId = false,
nodeParent;
if ((point.node.parent !== series.rootNode) && (point.node.isLeaf)) {
nodeParent = point.node;
while (!drillId) {
nodeParent = series.nodeMap[nodeParent.parent];
if (nodeParent.parent === series.rootNode) {
drillId = nodeParent.id;
}
}
}
return drillId;
},
drillUp: function () {
var drillPoint = null,
node,
parent;
if (this.rootNode) {
node = this.nodeMap[this.rootNode];
if (node.parent !== null) {
drillPoint = this.nodeMap[node.parent];
} else {
drillPoint = this.nodeMap[''];
}
}
if (drillPoint !== null) {
this.drillToNode(drillPoint.id);
if (drillPoint.id === '') {
this.drillUpButton = this.drillUpButton.destroy();
} else {
parent = this.nodeMap[drillPoint.parent];
this.showDrillUpButton((parent.name || parent.id));
}
}
},
drillToNode: function (id) {
this.options.rootId = id;
this.isDirty = true; // Force redraw
this.chart.redraw();
},
showDrillUpButton: function (name) {
var series = this,
backText = (name || '< Back'),
buttonOptions = series.options.drillUpButton,
attr,
states;
if (buttonOptions.text) {
backText = buttonOptions.text;
}
if (!this.drillUpButton) {
attr = buttonOptions.theme;
states = attr && attr.states;
this.drillUpButton = this.chart.renderer.button(
backText,
null,
null,
function () {
series.drillUp();
},
attr,
states && states.hover,
states && states.select
)
.attr({
align: buttonOptions.position.align,
zIndex: 9
})
.add()
.align(buttonOptions.position, false, buttonOptions.relativeTo || 'plotBox');
} else {
this.drillUpButton.attr({
text: backText
})
.align();
}
},
buildKDTree: noop,
drawLegendSymbol: H.LegendSymbolMixin.drawRectangle,
getExtremes: function () {
// Get the extremes from the value data
Series.prototype.getExtremes.call(this, this.colorValueData);
this.valueMin = this.dataMin;
this.valueMax = this.dataMax;
// Get the extremes from the y data
Series.prototype.getExtremes.call(this);
},
getExtremesFromAll: true,
bindAxes: function () {
var treeAxis = {
endOnTick: false,
gridLineWidth: 0,
lineWidth: 0,
min: 0,
dataMin: 0,
minPadding: 0,
max: 100,
dataMax: 100,
maxPadding: 0,
startOnTick: false,
title: null,
tickPositions: []
};
Series.prototype.bindAxes.call(this);
H.extend(this.yAxis.options, treeAxis);
H.extend(this.xAxis.options, treeAxis);
}
}));
}));<|fim▁end|> | |
<|file_name|>boxed.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! A pointer type for heap allocation.
//!
//! `Box<T>`, casually referred to as a 'box', provides the simplest form of heap allocation in
//! Rust. Boxes provide ownership for this allocation, and drop their contents when they go out of
//! scope.
//!
//! Boxes are useful in two situations: recursive data structures, and occasionally when returning
//! data. [The Pointer chapter of the Book](../../../book/pointers.html#best-practices-1) explains
//! these cases in detail.
//!
//! # Examples
//!
//! Creating a box:
//!
//! ```
//! let x = Box::new(5);
//! ```
//!
//! Creating a recursive data structure:
//!
//! ```
//! #[derive(Show)]
//! enum List<T> {
//! Cons(T, Box<List<T>>),
//! Nil,
//! }
//!
//! fn main() {
//! let list: List<i32> = List::Cons(1, Box::new(List::Cons(2, Box::new(List::Nil))));
//! println!("{:?}", list);
//! }
//! ```
//!
//! This will print `Cons(1i32, Box(Cons(2i32, Box(Nil))))`.
#![stable]
use core::any::Any;
use core::clone::Clone;
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
use core::default::Default;
use core::error::{Error, FromError};
use core::fmt;
use core::hash::{self, Hash};
use core::iter::Iterator;
use core::marker::Sized;
use core::mem;
use core::ops::{Deref, DerefMut};
use core::option::Option;
use core::ptr::Unique;
use core::raw::TraitObject;
use core::result::Result::{Ok, Err};
use core::result::Result;
/// A value that represents the heap. This is the default place that the `box` keyword allocates
/// into when no place is supplied.
///
/// The following two examples are equivalent:
///
/// ```rust
/// #![feature(box_syntax)]
/// use std::boxed::HEAP;
///
/// fn main() {
/// let foo = box(HEAP) 5;
/// let foo = box 5;
/// }
/// ```
#[lang = "exchange_heap"]
#[unstable = "may be renamed; uncertain about custom allocator design"]
pub static HEAP: () = ();
/// A pointer type for heap allocation.
///
/// See the [module-level documentation](../../std/boxed/index.html) for more.
#[lang = "owned_box"]
#[stable]
pub struct Box<T>(Unique<T>);
impl<T> Box<T> {
/// Allocates memory on the heap and then moves `x` into it.
///
/// # Examples
///
/// ```
/// let x = Box::new(5);
/// ```
#[stable]
pub fn new(x: T) -> Box<T> {
box x
}
}
#[stable]
impl<T: Default> Default for Box<T> {
#[stable]
fn default() -> Box<T> { box Default::default() }
}
#[stable]
impl<T> Default for Box<[T]> {
#[stable]
fn default() -> Box<[T]> { box [] }
}
#[stable]
impl<T: Clone> Clone for Box<T> {
/// Returns a new box with a `clone()` of this box's contents.
///
/// # Examples
///
/// ```
/// let x = Box::new(5);
/// let y = x.clone();
/// ```
#[inline]
fn clone(&self) -> Box<T> { box {(**self).clone()} }
/// Copies `source`'s contents into `self` without creating a new allocation.
///
/// # Examples
///
/// ```
/// let x = Box::new(5);
/// let mut y = Box::new(10);
///
/// y.clone_from(&x);
///
/// assert_eq!(*y, 5);
/// ```
#[inline]
fn clone_from(&mut self, source: &Box<T>) {
(**self).clone_from(&(**source));
}
}
#[stable]
impl<T: ?Sized + PartialEq> PartialEq for Box<T> {
#[inline]
fn eq(&self, other: &Box<T>) -> bool { PartialEq::eq(&**self, &**other) }
#[inline]
fn ne(&self, other: &Box<T>) -> bool { PartialEq::ne(&**self, &**other) }
}
#[stable]
impl<T: ?Sized + PartialOrd> PartialOrd for Box<T> {
#[inline]
fn partial_cmp(&self, other: &Box<T>) -> Option<Ordering> {
PartialOrd::partial_cmp(&**self, &**other)
}
#[inline]
fn lt(&self, other: &Box<T>) -> bool { PartialOrd::lt(&**self, &**other) }
#[inline]
fn le(&self, other: &Box<T>) -> bool { PartialOrd::le(&**self, &**other) }
#[inline]
fn ge(&self, other: &Box<T>) -> bool { PartialOrd::ge(&**self, &**other) }
#[inline]
fn gt(&self, other: &Box<T>) -> bool { PartialOrd::gt(&**self, &**other) }
}
#[stable]
impl<T: ?Sized + Ord> Ord for Box<T> {
#[inline]
fn cmp(&self, other: &Box<T>) -> Ordering {
Ord::cmp(&**self, &**other)
}
}
#[stable]
impl<T: ?Sized + Eq> Eq for Box<T> {}
impl<S: hash::Hasher, T: ?Sized + Hash<S>> Hash<S> for Box<T> {
#[inline]
fn hash(&self, state: &mut S) {
(**self).hash(state);
}
}
/// Extension methods for an owning `Any` trait object.
#[unstable = "this trait will likely disappear once compiler bugs blocking \
a direct impl on `Box<Any>` have been fixed "]
// FIXME(#18737): this should be a direct impl on `Box<Any>`. If you're
// removing this please make sure that you can downcase on
// `Box<Any + Send>` as well as `Box<Any>`
pub trait BoxAny {
/// Returns the boxed value if it is of type `T`, or
/// `Err(Self)` if it isn't.
#[stable]
fn downcast<T: 'static>(self) -> Result<Box<T>, Self>;
}
#[stable]
impl BoxAny for Box<Any> {
#[inline]
fn downcast<T: 'static>(self) -> Result<Box<T>, Box<Any>> {
if self.is::<T>() {
unsafe {
// Get the raw representation of the trait object
let to: TraitObject =
mem::transmute::<Box<Any>, TraitObject>(self);
// Extract the data pointer
Ok(mem::transmute(to.data))
}
} else {<|fim▁hole|>
#[stable]
impl<T: fmt::Display + ?Sized> fmt::Display for Box<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Display::fmt(&**self, f)
}
}
#[stable]
impl<T: fmt::Debug + ?Sized> fmt::Debug for Box<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Debug::fmt(&**self, f)
}
}
#[stable]
impl fmt::Debug for Box<Any> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.pad("Box<Any>")
}
}
#[stable]
impl<T: ?Sized> Deref for Box<T> {
type Target = T;
fn deref(&self) -> &T { &**self }
}
#[stable]
impl<T: ?Sized> DerefMut for Box<T> {
fn deref_mut(&mut self) -> &mut T { &mut **self }
}
// FIXME(#21363) remove `old_impl_check` when bug is fixed
#[old_impl_check]
impl<'a, T> Iterator for Box<Iterator<Item=T> + 'a> {
type Item = T;
fn next(&mut self) -> Option<T> {
(**self).next()
}
fn size_hint(&self) -> (usize, Option<usize>) {
(**self).size_hint()
}
}
impl<'a, E: Error + 'a> FromError<E> for Box<Error + 'a> {
fn from_error(err: E) -> Box<Error + 'a> {
Box::new(err)
}
}<|fim▁end|> | Err(self)
}
}
} |
<|file_name|>mem_map.rs<|end_file_name|><|fim▁begin|>pub const VRAM_START: u32 = 0x00000000;
pub const VRAM_LENGTH: u32 = 0x00040000;
pub const VRAM_END: u32 = VRAM_START + VRAM_LENGTH - 1;
pub const CHR_RAM_PATTERN_TABLE_0_START: u32 = 0x00006000;
pub const CHR_RAM_PATTERN_TABLE_0_LENGTH: u32 = 0x00002000;
pub const CHR_RAM_PATTERN_TABLE_1_START: u32 = 0x0000e000;
pub const CHR_RAM_PATTERN_TABLE_1_LENGTH: u32 = 0x00002000;
pub const CHR_RAM_PATTERN_TABLE_2_START: u32 = 0x00016000;
pub const CHR_RAM_PATTERN_TABLE_2_LENGTH: u32 = 0x00002000;
pub const CHR_RAM_PATTERN_TABLE_3_START: u32 = 0x0001e000;
pub const CHR_RAM_PATTERN_TABLE_3_LENGTH: u32 = 0x00002000;
pub const WINDOW_ATTRIBS_START: u32 = 0x0003d800;
pub const WINDOW_ATTRIBS_LENGTH: u32 = 0x00000400;
pub const WINDOW_ATTRIBS_END: u32 = WINDOW_ATTRIBS_START + WINDOW_ATTRIBS_LENGTH - 1;
<|fim▁hole|>pub const INTERRUPT_ENABLE_REG: u32 = 0x0005f802;
pub const INTERRUPT_CLEAR_REG: u32 = 0x0005f804;
pub const DISPLAY_CONTROL_READ_REG: u32 = 0x0005f820;
pub const DISPLAY_CONTROL_WRITE_REG: u32 = 0x0005f822;
pub const LED_BRIGHTNESS_1_REG: u32 = 0x0005f824;
pub const LED_BRIGHTNESS_2_REG: u32 = 0x0005f826;
pub const LED_BRIGHTNESS_3_REG: u32 = 0x0005f828;
pub const LED_BRIGHTNESS_IDLE_REG: u32 = 0x0005f82a;
pub const GAME_FRAME_CONTROL_REG: u32 = 0x0005f82e;
pub const DRAWING_CONTROL_READ_REG: u32 = 0x0005f840;
pub const DRAWING_CONTROL_WRITE_REG: u32 = 0x0005f842;
pub const OBJ_GROUP_0_POINTER_REG: u32 = 0x0005f848;
pub const OBJ_GROUP_1_POINTER_REG: u32 = 0x0005f84a;
pub const OBJ_GROUP_2_POINTER_REG: u32 = 0x0005f84c;
pub const OBJ_GROUP_3_POINTER_REG: u32 = 0x0005f84e;
pub const BG_PALETTE_0_REG: u32 = 0x0005f860;
pub const BG_PALETTE_1_REG: u32 = 0x0005f862;
pub const BG_PALETTE_2_REG: u32 = 0x0005f864;
pub const BG_PALETTE_3_REG: u32 = 0x0005f866;
pub const OBJ_PALETTE_0_REG: u32 = 0x0005f868;
pub const OBJ_PALETTE_1_REG: u32 = 0x0005f86a;
pub const OBJ_PALETTE_2_REG: u32 = 0x0005f86c;
pub const OBJ_PALETTE_3_REG: u32 = 0x0005f86e;
pub const CLEAR_COLOR_REG: u32 = 0x0005f870;
pub const CHR_RAM_PATTERN_TABLE_0_MIRROR_START: u32 = 0x00078000;
pub const CHR_RAM_PATTERN_TABLE_0_MIRROR_LENGTH: u32 = CHR_RAM_PATTERN_TABLE_0_LENGTH;
pub const CHR_RAM_PATTERN_TABLE_0_MIRROR_END: u32 = CHR_RAM_PATTERN_TABLE_0_MIRROR_START + CHR_RAM_PATTERN_TABLE_0_MIRROR_LENGTH - 1;
pub const CHR_RAM_PATTERN_TABLE_1_MIRROR_START: u32 = 0x0007a000;
pub const CHR_RAM_PATTERN_TABLE_1_MIRROR_LENGTH: u32 = CHR_RAM_PATTERN_TABLE_1_LENGTH;
pub const CHR_RAM_PATTERN_TABLE_1_MIRROR_END: u32 = CHR_RAM_PATTERN_TABLE_1_MIRROR_START + CHR_RAM_PATTERN_TABLE_1_MIRROR_LENGTH - 1;
pub const CHR_RAM_PATTERN_TABLE_2_MIRROR_START: u32 = 0x0007c000;
pub const CHR_RAM_PATTERN_TABLE_2_MIRROR_LENGTH: u32 = CHR_RAM_PATTERN_TABLE_2_LENGTH;
pub const CHR_RAM_PATTERN_TABLE_2_MIRROR_END: u32 = CHR_RAM_PATTERN_TABLE_2_MIRROR_START + CHR_RAM_PATTERN_TABLE_2_MIRROR_LENGTH - 1;
pub const CHR_RAM_PATTERN_TABLE_3_MIRROR_START: u32 = 0x0007e000;
pub const CHR_RAM_PATTERN_TABLE_3_MIRROR_LENGTH: u32 = CHR_RAM_PATTERN_TABLE_3_LENGTH;
pub const CHR_RAM_PATTERN_TABLE_3_MIRROR_END: u32 = CHR_RAM_PATTERN_TABLE_3_MIRROR_START + CHR_RAM_PATTERN_TABLE_3_MIRROR_LENGTH - 1;<|fim▁end|> | pub const INTERRUPT_PENDING_REG: u32 = 0x0005f800; |
<|file_name|>axis.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 bluss and ndarray developers.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::cmp::Ordering;
/// An axis index.
///
/// An axis one of an array’s “dimensions”; an *n*-dimensional array has *n* axes.
/// Axis *0* is the array’s outermost axis and *n*-1 is the innermost.
///
/// All array axis arguments use this type to make the code easier to write
/// correctly and easier to understand.
#[derive(Eq, Ord, Hash, Debug)]
pub struct Axis(pub usize);<|fim▁hole|> /// Return the index of the axis.
#[inline(always)]
pub fn index(&self) -> usize { self.0 }
#[deprecated(note = "Renamed to .index()")]
#[inline(always)]
pub fn axis(&self) -> usize { self.0 }
}
copy_and_clone!{Axis}
macro_rules! derive_cmp {
($traitname:ident for $typename:ident, $method:ident -> $ret:ty) => {
impl $traitname for $typename {
#[inline(always)]
fn $method(&self, rhs: &Self) -> $ret {
(self.0).$method(&rhs.0)
}
}
}
}
derive_cmp!{PartialEq for Axis, eq -> bool}
derive_cmp!{PartialOrd for Axis, partial_cmp -> Option<Ordering>}<|fim▁end|> |
impl Axis { |
<|file_name|>price_fraction.rs<|end_file_name|><|fim▁begin|>// http://rosettacode.org/wiki/Price_fraction
fn fix_price(num: f64) -> f64 {
match num {
0.96...1.00 => 1.00,
0.91...0.96 => 0.98,
0.86...0.91 => 0.94,
0.81...0.86 => 0.90,
0.76...0.81 => 0.86,
0.71...0.76 => 0.82,
0.66...0.71 => 0.78,
0.61...0.66 => 0.74,
0.56...0.61 => 0.70,
0.51...0.56 => 0.66,
0.46...0.51 => 0.62,
0.41...0.46 => 0.58,
0.36...0.41 => 0.54,
0.31...0.36 => 0.50,
0.26...0.31 => 0.44,
0.21...0.26 => 0.38,
0.16...0.21 => 0.32,
0.11...0.16 => 0.26,
0.06...0.11 => 0.18,
0.00...0.06 => 0.10,
// panics on invalid value
_ => unreachable!(),
}
}
fn main() {
let mut n: f64 = 0.04;
while n <= 1.00 {
println!("{:.2} => {}", n, fix_price(n));
n += 0.04;
}
}
// typically this could be included in the match as those check for exhaustiveness already
// by explicitly listing all remaining ranges / values instead of a catch-all underscore (_)
// but f64::NaN, f64::INFINITY and f64::NEG_INFINITY can't be matched like this
#[test]
fn exhaustiveness_check() {<|fim▁hole|> input_price += 0.01;
}
}<|fim▁end|> | let mut input_price = 0.;
while input_price <= 1. {
fix_price(input_price); |
<|file_name|>app-module.ts<|end_file_name|><|fim▁begin|>import {BrowserModule} from "@angular/platform-browser";
import {Compiler, NgModule, ErrorHandler} from "@angular/core";
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
import {HttpModule, JsonpModule} from "@angular/http";
import {Ng2Bs3ModalModule} from "ng2-bs3-modal/ng2-bs3-modal";
import {AppComponent} from "./app-component";
import {LocalStorage} from "../services/LocalStorage";
import {RedPepperService} from "../services/redpepper.service";
import {YellowPepperService} from "../services/yellowpepper.service";
import {MsLibModule} from "ng-mslib/dist/mslib.module";
import {ToastModule, ToastOptions} from "ng2-toastr";
import {AccordionModule, AlertModule, ModalModule} from "ngx-bootstrap";
import {DropdownModule, DropdownModule as DropdownModulePrime, InputTextModule, SelectButtonModule, TreeModule} from "primeng/primeng";
import {routing} from "../app-routes";
import {LoginPanel} from "../comps/entry/LoginPanel";
import {Logout} from "../comps/logout/Logout";
import {AgmCoreModule} from "angular2-google-maps/core";
import {ImgLoader} from "../comps/imgloader/ImgLoader";
import {ChartModule} from "angular2-highcharts";
import {CommBroker} from "../services/CommBroker";
import {AUTH_PROVIDERS} from "../services/AuthService";
import {StoreService} from "../services/StoreService";
import {NgMenu} from "../comps/ng-menu/ng-menu";
import {NgMenuItem} from "../comps/ng-menu/ng-menu-item";
import {AutoLogin} from "../comps/entry/AutoLogin";
import {StoreModule} from "@ngrx/store";
import {INITIAL_APPLICATION_STATE} from "../store/application.state";
import {EffectsModule} from "@ngrx/effects";
import {StoreDevtoolsModule} from "@ngrx/store-devtools";
import {ACTION_LIVELOG_UPDATE, AppdbAction} from "../store/actions/appdb.actions";
import {AppDbEffects} from "../store/effects/appdb.effects";
import {MsdbEffects} from "../store/effects/msdb.effects";
import {environment} from "../environments/environment";
import {productionReducer} from "../store/store.data";
import {NgmslibService} from "ng-mslib";
import {SharedModule} from "../modules/shared.module";
import {Dashboard} from "./dashboard/dashboard-navigation";
import {Appwrap} from "./appwrap";
import "hammerjs";
import "print-js";
import "gsap";
import "gsap/CSSPlugin";
import "gsap/Draggable";
import "gsap/TweenLite";
import "gsap/ScrollToPlugin";
import {Lib} from "../Lib";<|fim▁hole|>import {SimpleGridModule} from "../comps/simple-grid-module/SimpleGridModule";
import {GlobalErrorHandler} from "../services/global-error-handler";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {FasterqTerminal} from "./fasterq/fasterq-terminal";
import {WizardService} from "../services/wizard-service";
import {ResellerLogo} from "../comps/logo/reseller-logo";
import {DashPanel} from "./dashboard/dash-panel";
import {ServerAvg} from "./dashboard/server-avg";
import {StorageUsed} from "./dashboard/storage-used";
import {LiveLogModel} from "../models/live-log-model";
// import "fabric"; // need to remove if we import via cli
// import {ScreenTemplate} from "../comps/screen-template/screen-template";
declare global {
interface JQueryStatic {
base64: any;
knob: any;
gradientPicker: any;
timepicker: any;
contextmenu: any;
index: any;
}
}
export class CustomToastOption extends ToastOptions {
animate: 'flyRight';
positionClass: 'toast-bottom-right';
toastLife: 10000;
showCloseButton: true;
maxShown: 5;
newestOnTop: true;
enableHTML: true;
dismiss: 'auto';
messageClass: "";
titleClass: ""
}
export const providing = [CommBroker, WizardService, AUTH_PROVIDERS, RedPepperService, YellowPepperService, LocalStorage, StoreService, FontLoaderService, AppdbAction, {
provide: "OFFLINE_ENV",
useValue: window['offlineDevMode']
},
{
provide: "HYBRID_PRIVATE",
useValue: false
},
{
provide: ErrorHandler,
useClass: GlobalErrorHandler
},
{
provide: ToastOptions,
useClass: CustomToastOption
}
];
const decelerations = [AppComponent, AutoLogin, LoginPanel, Appwrap, Dashboard, Logout, NgMenu, NgMenuItem, ImgLoader, FasterqTerminal, DashPanel, ServerAvg, StorageUsed];
export function appReducer(state: any = INITIAL_APPLICATION_STATE, action: any) {
if (environment.production) {
return productionReducer(state, action);
} else {
return productionReducer(state, action);
// return developmentReducer(state, action);
}
}
@NgModule({
declarations: [decelerations],
imports: [
BrowserModule,
FormsModule,
BrowserAnimationsModule,
ReactiveFormsModule,
Ng2Bs3ModalModule,
HttpModule,
ChartModule,
StoreModule.provideStore(appReducer),
EffectsModule.run(AppDbEffects),
EffectsModule.run(MsdbEffects),
environment.imports,
// StoreDevtoolsModule.instrumentStore({maxAge: 2}),
// StoreDevtoolsModule.instrumentOnlyWithExtension(),
AgmCoreModule.forRoot({
apiKey: 'AIzaSyDKa8Z3QLtACfSfxF-S8A44gm5bkvNTmuM',
libraries: ['places']
}),
SimpleGridModule.forRoot(),
SharedModule.forRoot(),
ToastModule.forRoot(),
AlertModule.forRoot(),
MsLibModule.forRoot({a: 1}),
ModalModule.forRoot(),
DropdownModule,
AccordionModule.forRoot(),
JsonpModule,
TreeModule,
InputTextModule,
SelectButtonModule,
InputTextModule,
DropdownModulePrime,
routing,
],
providers: [providing],
bootstrap: [AppComponent]
})
export class AppModule {
constructor(private commBroker: CommBroker, private compiler: Compiler, private ngmslibService: NgmslibService, private yp: YellowPepperService, private fontLoaderService: FontLoaderService) {
Lib.Con(`running in dev mode: ${Lib.DevMode()}`);
Lib.Con(`App in ${(compiler instanceof Compiler) ? 'AOT' : 'JIT'} mode`);
window['business_id'] = -1;
window['jQueryAny'] = jQuery;
window['jXML'] = jQuery;
this.ngmslibService.globalizeStringJS();
Lib.Con(StringJS('app-loaded-and-ready').humanize().s);
Lib.AlertOnLeave();
this.yp.dispatch(({type: ACTION_LIVELOG_UPDATE, payload: new LiveLogModel({event: 'app started'})}));
}
}<|fim▁end|> | import {FontLoaderService} from "../services/font-loader-service"; |
<|file_name|>hooks.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
requests.hooks
~~~~~~~~~~~~~~
This module provides the capabilities for the Requests hooks system.
Available hooks:
``args``:
A dictionary of the arguments being sent to Request().
``pre_request``:
The Request object, directly before being sent.
``post_request``:
The Request object, directly after being sent.
``response``:
The response generated from a Request.
"""
import traceback
HOOKS = ('args', 'pre_request', 'post_request', 'response')
def dispatch_hook(key, hooks, hook_data):
''''''
hooks = hooks or dict()
if key in hooks:
hooks = hooks.get(key)
if hasattr(hooks, '__call__'):
hooks = [hooks]
for hook in hooks:
try:
hook_data = hook(hook_data) or hook_data
except Exception:
traceback.print_exc()
<|fim▁hole|><|fim▁end|> | return hook_data |
<|file_name|>verifyCode-validator.directive.ts<|end_file_name|><|fim▁begin|>import { Directive, forwardRef, Attribute, Input } from '@angular/core';
import { Validator, FormControl, AbstractControl, NG_VALIDATORS, NG_ASYNC_VALIDATORS } from '@angular/forms';
import { Observable } from "rxjs";
import { VerifyCodeService } from '../services/verify-code.service'; // 登录服务
@Directive({
selector: '[validateVcode][ngModel]',
providers: [
{
provide: NG_ASYNC_VALIDATORS, // ng2 async validator
useExisting: forwardRef(() => VcodeValidatorDirective),
multi: true
}
]
})
export class VcodeValidatorDirective implements Validator {
constructor(public vCodeService: VerifyCodeService ) {
}
@Input('validateVcode') mobile: string;
validateVcodeObservable(mobile: string, vcode: string) {
return new Observable(observer => {
this.vCodeService.validateVerifyCode(mobile, vcode).subscribe(responseData => {
console.log(responseData);
// if (responseData.errorCode === 1) {
// // verify error.
// observer.next({ validateVcode: { valid: false }, message="验证码错误,请重新输入。" });
// } else {
// observer.next(null);
// }<|fim▁hole|> });
});
}
validate(c: AbstractControl): Observable<{[key : string] : any}> {
return this.validateVcodeObservable(this.mobile, c.value).first();
}
}<|fim▁end|> | |
<|file_name|>serialise.rs<|end_file_name|><|fim▁begin|>/* Notice: Copyright 2016, The Care Connections Initiative c.i.c.
* Author: Charlie Fyvie-Gauld ([email protected])
* License: GPLv3 (http://www.gnu.org/licenses/gpl-3.0.txt)
*/
use std::mem::transmute;
use ::enums::Failure;
pub trait NetSerial : Sized {
fn serialise(&self) -> Vec<u8>;
fn deserialise(bytes: &[u8]) -> Result<Self, Failure>;
fn lower_bound() -> usize;
}
pub fn push_bytes(v: &mut Vec<u8>, bytes: &[u8]) {
for b in bytes {
v.push(*b)
}
}
pub fn u32_transmute_be_arr(a: &[u8]) -> u32 {
unsafe { transmute::<[u8;4], u32>([a[3], a[2], a[1], a[0]]) }
}
pub fn u32_transmute_le_arr(a: &[u8]) -> u32 {
unsafe { transmute::<[u8;4], u32>([a[0], a[1], a[2], a[3]]) }
}
pub fn array_transmute_be_u32(d: u32) -> [u8;4] {
unsafe { transmute(d.to_be()) }
}
pub fn array_transmute_le_u32(d: u32) -> [u8;4] {
unsafe { transmute(d.to_le()) }
}
pub fn byte_slice_4array(a: &[u8]) -> [u8;4] {
[ a[0], a[1], a[2], a[3] ]
}
<|fim▁hole|> match byte {
0 => false,
_ => true
}
}
pub fn hex_str_to_byte(src: &[u8]) -> Option<u8> {
let mut val = 0;
let mut factor = 16;
for i in 0 .. 2 {
val += match src[i] {
v @ 48 ... 57 => (v - 48) * factor,
v @ 65 ... 70 => (v - 55) * factor,
v @ 97 ... 102 => (v - 87) * factor,
_ => return None,
};
factor >>= 4;
}
Some(val)
}
pub fn bin_to_hex(src: &Vec<u8>) -> String {
let mut s = String::new();
for byte in src {
s.push_str( format!("{:0>2x}", byte).as_ref() )
}
s
}<|fim▁end|> | pub fn deserialise_bool(byte: u8) -> bool { |
<|file_name|>TestWeakPtrFromStdModule.py<|end_file_name|><|fim▁begin|>"""
Test basic std::weak_ptr functionality.
"""
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestSharedPtr(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(["libc++"])
@skipIf(compiler=no_match("clang"))
def test(self):
self.build()
lldbutil.run_to_source_breakpoint(self,
"// Set break point at this line.", lldb.SBFileSpec("main.cpp"))
<|fim▁hole|> self.expect("expr (int)*w.lock()", substrs=['(int) $0 = 3'])
self.expect("expr (int)(*w.lock() = 5)", substrs=['(int) $1 = 5'])
self.expect("expr (int)*w.lock()", substrs=['(int) $2 = 5'])
self.expect("expr w.use_count()", substrs=['(long) $3 = 1'])
self.expect("expr w.reset()")
self.expect("expr w.use_count()", substrs=['(long) $4 = 0'])<|fim▁end|> | self.runCmd("settings set target.import-std-module true")
|
<|file_name|>DataHibernatorWorker.java<|end_file_name|><|fim▁begin|>/**
* DataHibernatorWorker.java
*
* Created on 24 October 2007, 18:10
*
* To change this template, choose Tools | Template Manager and open the template in the editor.
*/
package uk.co.sleonard.unison.input;
import java.util.ArrayList;
import java.util.ListIterator;
import java.util.concurrent.LinkedBlockingQueue;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import uk.co.sleonard.unison.UNISoNLogger;
import uk.co.sleonard.unison.datahandling.HibernateHelper;
/**
* The Class DataHibernatorWorker.
*
* @author Stephen <[email protected]>
* @since v1.0.0
*
*/
public class DataHibernatorWorker extends SwingWorker {
/** The logger. */
private static Logger logger = Logger.getLogger("DataHibernatorWorker");
/** The number of hibernators. */
private static int numberofHibernators = 20;
/** The log. */
private static UNISoNLogger log;
/** The workers. */
private static ArrayList<DataHibernatorWorker> workers = new ArrayList<>();
/** The reader. */
private final NewsGroupReader reader;
/** The save to database. */
private boolean saveToDatabase = true;
private final HibernateHelper helper;
private final LinkedBlockingQueue<NewsArticle> queue;
private final Session session;
/**
* Sets the logger.
*
* @param logger
* the new logger
*/
public static void setLogger(final UNISoNLogger logger) {
DataHibernatorWorker.log = logger;
}
/**
* Start hibernators.
*
* @param helper2
* @param queue2
* @param session2
*/
public synchronized static void startHibernators(final NewsGroupReader nntpReader,
final HibernateHelper helper2, final LinkedBlockingQueue<NewsArticle> queue2,<|fim▁hole|> }
}
/**
* Stop download.
*/
static void stopDownload() {
for (final ListIterator<DataHibernatorWorker> iter = DataHibernatorWorker.workers
.listIterator(); iter.hasNext();) {
iter.next().interrupt();
}
}
/**
* Creates a new instance of DataHibernatorWorker.
*
* @param reader
* the reader
* @param helper2
* @param session
*/
private DataHibernatorWorker(final NewsGroupReader reader, final HibernateHelper helper2,
final LinkedBlockingQueue<NewsArticle> queue, final Session session2) {
super("DataHibernatorWorker");
this.helper = helper2;
this.reader = reader;
this.queue = queue;
this.session = session2;
DataHibernatorWorker.logger
.debug("Creating " + this.getClass() + " " + reader.getNumberOfMessages());
this.start();
}
/*
* (non-Javadoc)
*
* @see uk.co.sleonard.unison.input.SwingWorker#construct()
*/
@Override
public Object construct() {
DataHibernatorWorker.logger
.debug("construct : " + this.saveToDatabase + " queue " + this.queue.size());
try {
// HAve one session per worker rather than per message
while (this.saveToDatabase) {
this.pollQueue(this.queue, this.session);
// wait a second
Thread.sleep(5000);
// completed save so close down
if (this.queue.isEmpty()) {
this.saveToDatabase = false;
}
}
DataHibernatorWorker.workers.remove(this);
if (DataHibernatorWorker.workers.size() == 0) {
DataHibernatorWorker.log.alert("Download complete");
}
}
catch (@SuppressWarnings("unused") final InterruptedException e) {
return "Interrupted";
}
return "Completed";
}
/**
* Poll for message.
*
* @param queue
* the queue
* @return the news article
*/
private synchronized NewsArticle pollForMessage(final LinkedBlockingQueue<NewsArticle> queue) {
final NewsArticle article = queue.poll();
return article;
}
private void pollQueue(final LinkedBlockingQueue<NewsArticle> queue, final Session session)
throws InterruptedException {
while (!queue.isEmpty()) {
if (Thread.interrupted()) {
this.stopHibernatingData();
throw new InterruptedException();
}
final NewsArticle article = this.pollForMessage(queue);
if (null != article) {
DataHibernatorWorker.logger
.debug("Hibernating " + article.getArticleId() + " " + queue.size());
if (this.helper.hibernateData(article, session)) {
this.reader.incrementMessagesStored();
}
else {
this.reader.incrementMessagesSkipped();
}
this.reader.showDownloadStatus();
}
}
}
/**
* Stop hibernating data.
*/
private void stopHibernatingData() {
DataHibernatorWorker.logger.warn("StopHibernatingData");
this.saveToDatabase = false;
}
}<|fim▁end|> | final Session session2) {
while (DataHibernatorWorker.workers.size() < DataHibernatorWorker.numberofHibernators) {
DataHibernatorWorker.workers
.add(new DataHibernatorWorker(nntpReader, helper2, queue2, session2)); |
<|file_name|>exporter.ts<|end_file_name|><|fim▁begin|>import * as Data from "app/data";
import * as Characters from "app/models/characters";
import * as Mustache from "mustache";
<|fim▁hole|>export class Exporter {
export(character: Characters.Character, template: string): string {
return Mustache.render(template.trim(), character);
}
};<|fim▁end|> | |
<|file_name|>derivedEntity.ts<|end_file_name|><|fim▁begin|>import Entity from "./entity";
class DerivedEntity {
constructor(public entity: Entity) { }<|fim▁hole|><|fim▁end|> | };
export default DerivedEntity; |
<|file_name|>config_path_test.py<|end_file_name|><|fim▁begin|># Copyright 2022 The ML Collections Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for config_path."""<|fim▁hole|>from absl.testing import absltest
from absl.testing import parameterized
from ml_collections.config_flags import config_path
from ml_collections.config_flags.tests import fieldreference_config
from ml_collections.config_flags.tests import mock_config
class ConfigPathTest(parameterized.TestCase):
def test_list_extra_index(self):
"""Tries to index a non-indexable list element."""
test_config = mock_config.get_config()
with self.assertRaises(IndexError):
config_path.get_value('dict.list[0][0]', test_config)
def test_list_out_of_range_get(self):
"""Tries to access out-of-range value in list."""
test_config = mock_config.get_config()
with self.assertRaises(IndexError):
config_path.get_value('dict.list[2][1]', test_config)
def test_list_out_of_range_set(self):
"""Tries to override out-of-range value in list."""
test_config = mock_config.get_config()
with self.assertRaises(IndexError):
config_path.set_value('dict.list[2][1]', test_config, -1)
def test_reading_non_existing_key(self):
"""Tests reading non existing key from config."""
test_config = mock_config.get_config()
with self.assertRaises(KeyError):
config_path.set_value('dict.not_existing_key', test_config, 1)
def test_reading_setting_existing_key_in_dict(self):
"""Tests setting non existing key from dict inside config."""
test_config = mock_config.get_config()
with self.assertRaises(KeyError):
config_path.set_value('dict.not_existing_key.key', test_config, 1)
def test_empty_key(self):
"""Tests calling an empty key update."""
test_config = mock_config.get_config()
with self.assertRaises(ValueError):
config_path.set_value('', test_config, None)
def test_field_reference_types(self):
"""Tests whether types of FieldReference fields are valid."""
test_config = fieldreference_config.get_config()
paths = ['ref_nodefault', 'ref']
paths_types = [int, int]
config_types = [config_path.get_type(path, test_config) for path in paths]
self.assertEqual(paths_types, config_types)
@parameterized.parameters(
('float', float),
('integer', int),
('string', str),
('bool', bool),
('dict', dict),
('dict.float', float),
('dict.list', list),
('list', list),
('list[0]', int),
('object.float', float),
('object.integer', int),
('object.string', str),
('object.bool', bool),
('object.dict', dict),
('object.dict.float', float),
('object.dict.list', list),
('object.list', list),
('object.list[0]', int),
('object.tuple', tuple),
('object_reference.float', float),
('object_reference.integer', int),
('object_reference.string', str),
('object_reference.bool', bool),
('object_reference.dict', dict),
('object_reference.dict.float', float),
('object_copy.float', float),
('object_copy.integer', int),
('object_copy.string', str),
('object_copy.bool', bool),
('object_copy.dict', dict),
('object_copy.dict.float', float),
)
def test_types(self, path, path_type):
"""Tests whether various types of objects are valid."""
test_config = mock_config.get_config()
self.assertEqual(path_type, config_path.get_type(path, test_config))
if __name__ == '__main__':
absltest.main()<|fim▁end|> | |
<|file_name|>ConsultarLoteRps.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from pysignfe.xml_sped import *
from .ConsultarSituacaoLoteRps import ListaMensagemRetorno
from .Rps import IdentificacaoPrestador, IdentificacaoRps
from .Nfse import CompNfse
import os
DIRNAME = os.path.dirname(__file__)
class ConsultarLoteRpsEnvio(XMLNFe):
def __init__(self):
super(ConsultarLoteRpsEnvio, self).__init__()
self.versao = TagDecimal(nome=u'ConsultarLoteRpsEnvio', propriedade=u'versao', namespace=NAMESPACE_NFSE, valor=u'1.00', raiz=u'/')
self.Prestador = IdentificacaoPrestador()
self.Protocolo = TagCaracter(nome=u'Protocolo', tamanho=[ 1, 50], raiz=u'/')
self.caminho_esquema = os.path.join(DIRNAME, u'schema/')
self.arquivo_esquema = u'nfse.xsd'<|fim▁hole|> xml = XMLNFe.get_xml(self)
xml += ABERTURA
xml += u'<ConsultarLoteRpsEnvio xmlns="'+ NAMESPACE_NFSE + '">'
xml += self.Prestador.xml.replace(ABERTURA, u'')
xml += self.Protocolo.xml
xml += u'</ConsultarLoteRpsEnvio>'
return xml
def set_xml(self, arquivo):
if self._le_xml(arquivo):
self.Prestador.xml = arquivo
self.Protocolo.xml = arquivo
xml = property(get_xml, set_xml)
class ConsultarLoteRpsResposta(XMLNFe):
def __init__(self):
super(ConsultarLoteRpsResposta, self).__init__()
self.CompNfse = []
self.ListaMensagemRetorno = ListaMensagemRetorno()
self.caminho_esquema = os.path.join(DIRNAME, u'schema/')
self.arquivo_esquema = u'nfse.xsd'
def get_xml(self):
xml = XMLNFe.get_xml(self)
xml += ABERTURA
xml += u'<ConsultarLoteRpsResposta xmlns="'+ NAMESPACE_NFSE + '">'
if len(self.ListaMensagemRetorno.MensagemRetorno) != 0:
xml += self.ListaMensagemRetorno.xml.replace(ABERTURA, u'')
else:
xml += u'<ListaNfse>'
for c in self.CompNfse:
xml += tira_abertura(c.xml)
xml += u'</ListaNfse>'
xml += u'</ConsultarLoteRpsResposta>'
return xml
def set_xml(self, arquivo):
if self._le_xml(arquivo):
self.CompNfse = self.le_grupo('[nfse]//ConsultarLoteRpsResposta/CompNfse', CompNfse)
self.ListaMensagemRetorno.xml = arquivo
xml = property(get_xml, set_xml)<|fim▁end|> |
def get_xml(self): |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"encoding/json"
"errors"
"fmt"
"os"
<|fim▁hole|>func main() {
NPM := npm.NewNPM()
command := check.NewCommand(NPM)
var request check.Request
if err := json.NewDecoder(os.Stdin).Decode(&request); err != nil {
fatal("reading request from stdin", err)
}
var err error
if request.Source.PackageName == "" {
err = errors.New("package_name")
}
if err != nil {
fatal("parameter required", err)
}
response, err := command.Run(request)
if err != nil {
fatal("running command", err)
}
if err := json.NewEncoder(os.Stdout).Encode(response); err != nil {
fatal("writing response to stdout", err)
}
}
func fatal(message string, err error) {
fmt.Fprintf(os.Stderr, "error %s: %s\n", message, err)
os.Exit(1)
}<|fim▁end|> | "github.com/idahobean/npm-resource/check"
"github.com/idahobean/npm-resource/npm"
)
|
<|file_name|>vm-installation-image-post-update-version.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
import os
import sys
<|fim▁hole|>def create_installer_config(path):
"""Create a basicl installation configuration file"""
config = u"template=file:///etc/ister.json\n"
jconfig = u'{"DestinationType" : "physical", "PartitionLayout" : \
[{"disk" : "vda", "partition" : 1, "size" : "512M", "type" : "EFI"}, \
{"disk" : "vda", "partition" : 2, \
"size" : "512M", "type" : "swap"}, {"disk" : "vda", "partition" : 3, \
"size" : "rest", "type" : "linux"}], \
"FilesystemTypes" : \
[{"disk" : "vda", "partition" : 1, "type" : "vfat"}, \
{"disk" : "vda", "partition" : 2, "type" : "swap"}, \
{"disk" : "vda", "partition" : 3, "type" : "ext4"}], \
"PartitionMountPoints" : \
[{"disk" : "vda", "partition" : 1, "mount" : "/boot"}, \
{"disk" : "vda", "partition" : 3, "mount" : "/"}], \
"Version" : 0, "Bundles" : ["kernel-native", "telemetrics", "os-core", "os-core-update"]}\n'
if not os.path.isdir("{}/etc".format(path)):
os.mkdir("{}/etc".format(path))
with open("{}/etc/ister.conf".format(path), "w") as cfile:
cfile.write(config)
with open("{}/etc/ister.json".format(path), "w") as jfile:
jfile.write(jconfig.replace('"Version" : 0',
'"Version" : ' + INSTALLER_VERSION))
def append_installer_rootwait(path):
"""Add a delay to the installer kernel commandline"""
entry_path = path + "/boot/loader/entries/"
entry_file = os.listdir(entry_path)
if len(entry_file) != 1:
raise Exception("Unable to find specific entry file in {0}, "
"found {1} instead".format(entry_path, entry_file))
file_full_path = entry_path + entry_file[0]
with open(file_full_path, "r") as entry:
entry_content = entry.readlines()
options_line = entry_content[-1]
if not options_line.startswith("options "):
raise Exception("Last line of entry file is not the kernel "
"commandline options")
# Account for newline at the end of the line
options_line = options_line[:-1] + " rootwait\n"
entry_content[-1] = options_line
os.unlink(file_full_path)
with open(file_full_path, "w") as entry:
entry.writelines(entry_content)
def disable_tty1_getty(path):
"""Add a symlink masking the systemd tty1 generator"""
os.makedirs(path + "/etc/systemd/system/getty.target.wants")
os.symlink("/dev/null", path + "/etc/systemd/system/getty.target.wants/[email protected]")
def add_installer_service(path):
os.symlink("{}/usr/lib/systemd/system/ister.service"
.format(path),
"{}/usr/lib/systemd/system/multi-user.target.wants/ister.service"
.format(path))
if __name__ == '__main__':
if len(sys.argv) != 2:
sys.exit(-1)
try:
create_installer_config(sys.argv[1])
append_installer_rootwait(sys.argv[1])
disable_tty1_getty(sys.argv[1])
add_installer_service(sys.argv[1])
except Exception as exep:
print(exep)
sys.exit(-1)
sys.exit(0)<|fim▁end|> | INSTALLER_VERSION = '"latest"'
|
<|file_name|>remote.py<|end_file_name|><|fim▁begin|>"""
Support for an interface to work with a remote instance of Home Assistant.
If a connection error occurs while communicating with the API a
HomeAssistantError will be raised.
For more details about the Python API, please refer to the documentation at
https://home-assistant.io/developers/python_api/
"""
from datetime import datetime
import enum
import json
import logging
import threading
import urllib.parse
import requests
import homeassistant.bootstrap as bootstrap
import homeassistant.core as ha
from homeassistant.const import (
HTTP_HEADER_HA_AUTH, SERVER_PORT, URL_API, URL_API_EVENT_FORWARD,
URL_API_EVENTS, URL_API_EVENTS_EVENT, URL_API_SERVICES,
URL_API_SERVICES_SERVICE, URL_API_STATES, URL_API_STATES_ENTITY,
HTTP_HEADER_CONTENT_TYPE, CONTENT_TYPE_JSON)
from homeassistant.exceptions import HomeAssistantError
METHOD_GET = "get"
METHOD_POST = "post"
METHOD_DELETE = "delete"
_LOGGER = logging.getLogger(__name__)
class APIStatus(enum.Enum):
"""Represent API status."""
# pylint: disable=no-init,invalid-name,too-few-public-methods
OK = "ok"
INVALID_PASSWORD = "invalid_password"
CANNOT_CONNECT = "cannot_connect"
UNKNOWN = "unknown"
def __str__(self):
"""Return the state."""
return self.value
class API(object):
"""Object to pass around Home Assistant API location and credentials."""
# pylint: disable=too-few-public-methods
def __init__(self, host, api_password=None, port=None, use_ssl=False):
"""Initalize the API."""
self.host = host
self.port = port or SERVER_PORT
self.api_password = api_password
if use_ssl:
self.base_url = "https://{}:{}".format(host, self.port)
else:
self.base_url = "http://{}:{}".format(host, self.port)
self.status = None
self._headers = {
HTTP_HEADER_CONTENT_TYPE: CONTENT_TYPE_JSON,
}
if api_password is not None:
self._headers[HTTP_HEADER_HA_AUTH] = api_password
def validate_api(self, force_validate=False):
"""Test if we can communicate with the API."""
if self.status is None or force_validate:
self.status = validate_api(self)
return self.status == APIStatus.OK
def __call__(self, method, path, data=None):
"""Make a call to the Home Assistant API."""
if data is not None:
data = json.dumps(data, cls=JSONEncoder)
url = urllib.parse.urljoin(self.base_url, path)
try:
if method == METHOD_GET:
return requests.get(
url, params=data, timeout=5, headers=self._headers)
else:
return requests.request(
method, url, data=data, timeout=5, headers=self._headers)
except requests.exceptions.ConnectionError:
_LOGGER.exception("Error connecting to server")
raise HomeAssistantError("Error connecting to server")
except requests.exceptions.Timeout:
error = "Timeout when talking to {}".format(self.host)
_LOGGER.exception(error)
raise HomeAssistantError(error)
def __repr__(self):
"""Return the representation of the API."""
return "API({}, {}, {})".format(
self.host, self.api_password, self.port)
class HomeAssistant(ha.HomeAssistant):
"""Home Assistant that forwards work."""
# pylint: disable=super-init-not-called,too-many-instance-attributes
def __init__(self, remote_api, local_api=None):
"""Initalize the forward instance."""
if not remote_api.validate_api():
raise HomeAssistantError(
"Remote API at {}:{} not valid: {}".format(
remote_api.host, remote_api.port, remote_api.status))
self.remote_api = remote_api
self.pool = pool = ha.create_worker_pool()
self.bus = EventBus(remote_api, pool)
self.services = ha.ServiceRegistry(self.bus, pool)
self.states = StateMachine(self.bus, self.remote_api)
self.config = ha.Config()
self.config.api = local_api
def start(self):
"""Start the instance."""
# Ensure a local API exists to connect with remote
if 'api' not in self.config.components:
if not bootstrap.setup_component(self, 'api'):
raise HomeAssistantError(
'Unable to setup local API to receive events')
ha.create_timer(self)
self.bus.fire(ha.EVENT_HOMEASSISTANT_START,
origin=ha.EventOrigin.remote)
# Give eventlet time to startup
import eventlet
eventlet.sleep(0.1)
# Setup that events from remote_api get forwarded to local_api
# Do this after we fire START, otherwise HTTP is not started
if not connect_remote_events(self.remote_api, self.config.api):
raise HomeAssistantError((
'Could not setup event forwarding from api {} to '
'local api {}').format(self.remote_api, self.config.api))
def stop(self):
"""Stop Home Assistant and shuts down all threads."""
_LOGGER.info("Stopping")
self.bus.fire(ha.EVENT_HOMEASSISTANT_STOP,
origin=ha.EventOrigin.remote)
self.pool.stop()
# Disconnect master event forwarding
disconnect_remote_events(self.remote_api, self.config.api)
class EventBus(ha.EventBus):
"""EventBus implementation that forwards fire_event to remote API."""
# pylint: disable=too-few-public-methods
def __init__(self, api, pool=None):
"""Initalize the eventbus."""
super().__init__(pool)
self._api = api
def fire(self, event_type, event_data=None, origin=ha.EventOrigin.local):
"""Forward local events to remote target.
Handles remote event as usual.
"""
# All local events that are not TIME_CHANGED are forwarded to API
if origin == ha.EventOrigin.local and \
event_type != ha.EVENT_TIME_CHANGED:
fire_event(self._api, event_type, event_data)
else:
super().fire(event_type, event_data, origin)
class EventForwarder(object):
"""Listens for events and forwards to specified APIs."""
def __init__(self, hass, restrict_origin=None):
"""Initalize the event forwarder."""
self.hass = hass
self.restrict_origin = restrict_origin
# We use a tuple (host, port) as key to ensure
# that we do not forward to the same host twice
self._targets = {}
self._lock = threading.Lock()
def connect(self, api):
"""Attach to a Home Assistant instance and forward events.
Will overwrite old target if one exists with same host/port.
"""
with self._lock:
if len(self._targets) == 0:
# First target we get, setup listener for events
self.hass.bus.listen(ha.MATCH_ALL, self._event_listener)
key = (api.host, api.port)
self._targets[key] = api
def disconnect(self, api):
"""Remove target from being forwarded to."""
with self._lock:
key = (api.host, api.port)
did_remove = self._targets.pop(key, None) is None
if len(self._targets) == 0:
# Remove event listener if no forwarding targets present
self.hass.bus.remove_listener(ha.MATCH_ALL,
self._event_listener)
return did_remove
def _event_listener(self, event):
"""Listen and forward all events."""
with self._lock:
# We don't forward time events or, if enabled, non-local events
if event.event_type == ha.EVENT_TIME_CHANGED or \
(self.restrict_origin and event.origin != self.restrict_origin):
return
for api in self._targets.values():
fire_event(api, event.event_type, event.data)
class StateMachine(ha.StateMachine):
"""Fire set events to an API. Uses state_change events to track states."""
def __init__(self, bus, api):
"""Initalize the statemachine."""
super().__init__(None)
self._api = api
self.mirror()
bus.listen(ha.EVENT_STATE_CHANGED, self._state_changed_listener)
def remove(self, entity_id):
"""Remove the state of an entity.
Returns boolean to indicate if an entity was removed.
"""
return remove_state(self._api, entity_id)
def set(self, entity_id, new_state, attributes=None):
"""Call set_state on remote API."""
set_state(self._api, entity_id, new_state, attributes)
def mirror(self):
"""Discard current data and mirrors the remote state machine."""<|fim▁hole|> """Listen for state changed events and applies them."""
if event.data['new_state'] is None:
self._states.pop(event.data['entity_id'], None)
else:
self._states[event.data['entity_id']] = event.data['new_state']
class JSONEncoder(json.JSONEncoder):
"""JSONEncoder that supports Home Assistant objects."""
# pylint: disable=too-few-public-methods,method-hidden
def default(self, obj):
"""Convert Home Assistant objects.
Hand other objects to the original method.
"""
if isinstance(obj, datetime):
return obj.isoformat()
elif hasattr(obj, 'as_dict'):
return obj.as_dict()
try:
return json.JSONEncoder.default(self, obj)
except TypeError:
# If the JSON serializer couldn't serialize it
# it might be a generator, convert it to a list
try:
return [self.default(child_obj)
for child_obj in obj]
except TypeError:
# Ok, we're lost, cause the original error
return json.JSONEncoder.default(self, obj)
def validate_api(api):
"""Make a call to validate API."""
try:
req = api(METHOD_GET, URL_API)
if req.status_code == 200:
return APIStatus.OK
elif req.status_code == 401:
return APIStatus.INVALID_PASSWORD
else:
return APIStatus.UNKNOWN
except HomeAssistantError:
return APIStatus.CANNOT_CONNECT
def connect_remote_events(from_api, to_api):
"""Setup from_api to forward all events to to_api."""
data = {
'host': to_api.host,
'api_password': to_api.api_password,
'port': to_api.port
}
try:
req = from_api(METHOD_POST, URL_API_EVENT_FORWARD, data)
if req.status_code == 200:
return True
else:
_LOGGER.error(
"Error setting up event forwarding: %s - %s",
req.status_code, req.text)
return False
except HomeAssistantError:
_LOGGER.exception("Error setting up event forwarding")
return False
def disconnect_remote_events(from_api, to_api):
"""Disconnect forwarding events from from_api to to_api."""
data = {
'host': to_api.host,
'port': to_api.port
}
try:
req = from_api(METHOD_DELETE, URL_API_EVENT_FORWARD, data)
if req.status_code == 200:
return True
else:
_LOGGER.error(
"Error removing event forwarding: %s - %s",
req.status_code, req.text)
return False
except HomeAssistantError:
_LOGGER.exception("Error removing an event forwarder")
return False
def get_event_listeners(api):
"""List of events that is being listened for."""
try:
req = api(METHOD_GET, URL_API_EVENTS)
return req.json() if req.status_code == 200 else {}
except (HomeAssistantError, ValueError):
# ValueError if req.json() can't parse the json
_LOGGER.exception("Unexpected result retrieving event listeners")
return {}
def fire_event(api, event_type, data=None):
"""Fire an event at remote API."""
try:
req = api(METHOD_POST, URL_API_EVENTS_EVENT.format(event_type), data)
if req.status_code != 200:
_LOGGER.error("Error firing event: %d - %s",
req.status_code, req.text)
except HomeAssistantError:
_LOGGER.exception("Error firing event")
def get_state(api, entity_id):
"""Query given API for state of entity_id."""
try:
req = api(METHOD_GET, URL_API_STATES_ENTITY.format(entity_id))
# req.status_code == 422 if entity does not exist
return ha.State.from_dict(req.json()) \
if req.status_code == 200 else None
except (HomeAssistantError, ValueError):
# ValueError if req.json() can't parse the json
_LOGGER.exception("Error fetching state")
return None
def get_states(api):
"""Query given API for all states."""
try:
req = api(METHOD_GET,
URL_API_STATES)
return [ha.State.from_dict(item) for
item in req.json()]
except (HomeAssistantError, ValueError, AttributeError):
# ValueError if req.json() can't parse the json
_LOGGER.exception("Error fetching states")
return []
def remove_state(api, entity_id):
"""Call API to remove state for entity_id.
Return True if entity is gone (removed/never existed).
"""
try:
req = api(METHOD_DELETE, URL_API_STATES_ENTITY.format(entity_id))
if req.status_code in (200, 404):
return True
_LOGGER.error("Error removing state: %d - %s",
req.status_code, req.text)
return False
except HomeAssistantError:
_LOGGER.exception("Error removing state")
return False
def set_state(api, entity_id, new_state, attributes=None):
"""Tell API to update state for entity_id.
Return True if success.
"""
attributes = attributes or {}
data = {'state': new_state,
'attributes': attributes}
try:
req = api(METHOD_POST,
URL_API_STATES_ENTITY.format(entity_id),
data)
if req.status_code not in (200, 201):
_LOGGER.error("Error changing state: %d - %s",
req.status_code, req.text)
return False
else:
return True
except HomeAssistantError:
_LOGGER.exception("Error setting state")
return False
def is_state(api, entity_id, state):
"""Query API to see if entity_id is specified state."""
cur_state = get_state(api, entity_id)
return cur_state and cur_state.state == state
def get_services(api):
"""Return a list of dicts.
Each dict has a string "domain" and a list of strings "services".
"""
try:
req = api(METHOD_GET, URL_API_SERVICES)
return req.json() if req.status_code == 200 else {}
except (HomeAssistantError, ValueError):
# ValueError if req.json() can't parse the json
_LOGGER.exception("Got unexpected services result")
return {}
def call_service(api, domain, service, service_data=None):
"""Call a service at the remote API."""
try:
req = api(METHOD_POST,
URL_API_SERVICES_SERVICE.format(domain, service),
service_data)
if req.status_code != 200:
_LOGGER.error("Error calling service: %d - %s",
req.status_code, req.text)
except HomeAssistantError:
_LOGGER.exception("Error calling service")<|fim▁end|> | self._states = {state.entity_id: state for state
in get_states(self._api)}
def _state_changed_listener(self, event): |
<|file_name|>13_039_animated_ball.py<|end_file_name|><|fim▁begin|>import tkinter
tk = tkinter.Tk()
tk.title("Bounce")
tk.resizable(0, 0)
# Keep the window on the top
tk.wm_attributes("-topmost", 1)
canvas = tkinter.Canvas(tk, width=500, height=400)
# Remove border. Apparently no effect on Linux, but good on Mac
canvas.configure(bd=0)
# Make the 0 horizontal and vertical line apparent
canvas.configure(highlightthickness=0)
canvas.pack()<|fim▁hole|>
def handle_timer_event():
canvas.move(ball, 10, 0)
tk.after(100, handle_timer_event)
handle_timer_event()
tk.mainloop()<|fim▁end|> |
ball = canvas.create_oval(10, 10, 25, 25, fill='red') |
<|file_name|>sciopt.py<|end_file_name|><|fim▁begin|>import numpy as np
try:
import scipy.optimize as opt
except ImportError:
pass
from ase.optimize.optimize import Optimizer
class Converged(Exception):
pass
class OptimizerConvergenceError(Exception):
pass
class SciPyOptimizer(Optimizer):
"""General interface for SciPy optimizers
Only the call to the optimizer is still needed
"""
def __init__(self, atoms, logfile='-', trajectory=None,
callback_always=False, alpha=70.0, master=None):
"""Initialize object
Parameters:
atoms: Atoms object
The Atoms object to relax.
trajectory: string
Pickle file used to store trajectory of atomic movement.
logfile: file object or str
If *logfile* is a string, a file with that name will be opened.
Use '-' for stdout.
callback_always: book
Should the callback be run after each force call (also in the
linesearch)
alpha: float
Initial guess for the Hessian (curvature of energy surface). A
conservative value of 70.0 is the default, but number of needed
steps to converge might be less if a lower value is used. However,
a lower value also means risk of instability.
master: boolean
Defaults to None, which causes only rank 0 to save files. If
set to true, this rank will save files.
"""
restart = None
Optimizer.__init__(self, atoms, restart, logfile, trajectory, master)
self.force_calls = 0
self.callback_always = callback_always
self.H0 = alpha
def x0(self):
"""Return x0 in a way SciPy can use
This class is mostly usable for subclasses wanting to redefine the
parameters (and the objective function)"""
return self.atoms.get_positions().reshape(-1)
def f(self, x):
"""Objective function for use of the optimizers"""
self.atoms.set_positions(x.reshape(-1, 3))
# Scale the problem as SciPy uses I as initial Hessian.
return self.atoms.get_potential_energy() / self.H0
def fprime(self, x):
"""Gradient of the objective function for use of the optimizers"""
self.atoms.set_positions(x.reshape(-1, 3))
self.force_calls += 1
if self.callback_always:
self.callback(x)
# Remember that forces are minus the gradient!
# Scale the problem as SciPy uses I as initial Hessian.
return - self.atoms.get_forces().reshape(-1) / self.H0
def callback(self, x):
"""Callback function to be run after each iteration by SciPy
This should also be called once before optimization starts, as SciPy
optimizers only calls it after each iteration, while ase optimizers
call something similar before as well.
"""
f = self.atoms.get_forces()
self.log(f)
self.call_observers()
if self.converged(f):
raise Converged
self.nsteps += 1
def run(self, fmax=0.05, steps=100000000):
self.fmax = fmax
# As SciPy does not log the zeroth iteration, we do that manually
self.callback(None)
try:
# Scale the problem as SciPy uses I as initial Hessian.
self.call_fmin(fmax / self.H0, steps)
except Converged:
pass
def dump(self, data):
pass
def load(self):
pass
def call_fmin(self, fmax, steps):
raise NotImplementedError
class SciPyFminCG(SciPyOptimizer):
"""Non-linear (Polak-Ribiere) conjugate gradient algorithm"""
def call_fmin(self, fmax, steps):
output = opt.fmin_cg(self.f,
self.x0(),
fprime=self.fprime,
#args=(),
gtol=fmax * 0.1, #Should never be reached
norm=np.inf,
#epsilon=
maxiter=steps,
full_output=1,
disp=0,
#retall=0,
callback=self.callback
)
warnflag = output[-1]
if warnflag == 2:
raise OptimizerConvergenceError('Warning: Desired error not necessarily achieved ' \
'due to precision loss')
class SciPyFminBFGS(SciPyOptimizer):
"""Quasi-Newton method (Broydon-Fletcher-Goldfarb-Shanno)"""
def call_fmin(self, fmax, steps):
output = opt.fmin_bfgs(self.f,
self.x0(),
fprime=self.fprime,
#args=(),
gtol=fmax * 0.1, #Should never be reached
norm=np.inf,
#epsilon=1.4901161193847656e-08,
maxiter=steps,
full_output=1,
disp=0,
#retall=0,
callback=self.callback
)
warnflag = output[-1]
if warnflag == 2:
raise OptimizerConvergenceError('Warning: Desired error not necessarily achieved' \
'due to precision loss')
class SciPyGradientlessOptimizer(Optimizer):
"""General interface for gradient less SciPy optimizers
Only the call to the optimizer is still needed
Note: If you redefine x0() and f(), you don't even need an atoms object.
Redefining these also allows you to specify an arbitrary objective
function.
XXX: This is still a work in progress
"""
def __init__(self, atoms, logfile='-', trajectory=None,
callback_always=False, master=None):
"""Initialize object
Parameters:
atoms: Atoms object
The Atoms object to relax.
trajectory: string
Pickle file used to store trajectory of atomic movement.
logfile: file object or str
If *logfile* is a string, a file with that name will be opened.
Use '-' for stdout.
callback_always: book
Should the callback be run after each force call (also in the
linesearch)
alpha: float
Initial guess for the Hessian (curvature of energy surface). A
conservative value of 70.0 is the default, but number of needed
steps to converge might be less if a lower value is used. However,
a lower value also means risk of instability.
master: boolean
Defaults to None, which causes only rank 0 to save files. If
set to true, this rank will save files.
"""
restart = None
Optimizer.__init__(self, atoms, restart, logfile, trajectory, master)
self.function_calls = 0
self.callback_always = callback_always
def x0(self):
"""Return x0 in a way SciPy can use
This class is mostly usable for subclasses wanting to redefine the
parameters (and the objective function)"""
return self.atoms.get_positions().reshape(-1)
def f(self, x):
"""Objective function for use of the optimizers"""
self.atoms.set_positions(x.reshape(-1, 3))
self.function_calls += 1
# Scale the problem as SciPy uses I as initial Hessian.
return self.atoms.get_potential_energy()
def callback(self, x):
"""Callback function to be run after each iteration by SciPy
This should also be called once before optimization starts, as SciPy
optimizers only calls it after each iteration, while ase optimizers
call something similar before as well.
"""
# We can't assume that forces are available!
#f = self.atoms.get_forces()
#self.log(f)
self.call_observers()
#if self.converged(f):
# raise Converged
self.nsteps += 1
def run(self, ftol=0.01, xtol=0.01, steps=100000000):
self.xtol = xtol
self.ftol = ftol
# As SciPy does not log the zeroth iteration, we do that manually
self.callback(None)
try:
# Scale the problem as SciPy uses I as initial Hessian.
self.call_fmin(xtol, ftol, steps)
except Converged:
pass
def dump(self, data):
pass
def load(self):<|fim▁hole|> pass
def call_fmin(self, fmax, steps):
raise NotImplementedError
class SciPyFmin(SciPyGradientlessOptimizer):
"""Nelder-Mead Simplex algorithm
Uses only function calls.
XXX: This is still a work in progress
"""
def call_fmin(self, xtol, ftol, steps):
output = opt.fmin(self.f,
self.x0(),
#args=(),
xtol=xtol,
ftol=ftol,
maxiter=steps,
#maxfun=None,
#full_output=1,
disp=0,
#retall=0,
callback=self.callback
)
class SciPyFminPowell(SciPyGradientlessOptimizer):
"""Powell's (modified) level set method
Uses only function calls.
XXX: This is still a work in progress
"""
def __init__(self, *args, **kwargs):
"""Parameters:
direc: float
How much to change x to initially. Defaults to 0.04.
"""
direc = kwargs.pop('direc', None)
SciPyGradientlessOptimizer.__init__(self, *args, **kwargs)
if direc is None:
self.direc = np.eye(len(self.x0()), dtype=float) * 0.04
else:
self.direc = np.eye(len(self.x0()), dtype=float) * direc
def call_fmin(self, xtol, ftol, steps):
output = opt.fmin_powell(self.f,
self.x0(),
#args=(),
xtol=xtol,
ftol=ftol,
maxiter=steps,
#maxfun=None,
#full_output=1,
disp=0,
#retall=0,
callback=self.callback,
direc=self.direc
)<|fim▁end|> | |
<|file_name|>AbstractCachingConfiguration.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cache.annotation;
import java.util.Collection;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.CacheManager;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportAware;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
/**
* Abstract base {@code @Configuration} class providing common structure for enabling
* Spring's annotation-driven cache management capability.
*
* @author Chris Beams
* @since 3.1
* @see EnableCaching
*/
@Configuration
public abstract class AbstractCachingConfiguration implements ImportAware {
protected AnnotationAttributes enableCaching;
protected CacheManager cacheManager;
protected KeyGenerator keyGenerator;
@Autowired(required=false)
private Collection<CacheManager> cacheManagerBeans;
@Autowired(required=false)
private Collection<CachingConfigurer> cachingConfigurers;
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
this.enableCaching = AnnotationAttributes.fromMap(
importMetadata.getAnnotationAttributes(EnableCaching.class.getName(), false));
Assert.notNull(this.enableCaching,
"@EnableCaching is not present on importing class " +
importMetadata.getClassName());
}
/**
* Determine which {@code CacheManager} bean to use. Prefer the result of
* {@link CachingConfigurer#cacheManager()} over any by-type matching. If none, fall
* back to by-type matching on {@code CacheManager}.
* @throws IllegalArgumentException if no CacheManager can be found; if more than one
* CachingConfigurer implementation exists; if multiple CacheManager beans and no
* CachingConfigurer exists to disambiguate.
*/
@PostConstruct
protected void reconcileCacheManager() {
if (!CollectionUtils.isEmpty(cachingConfigurers)) {
int nConfigurers = cachingConfigurers.size();
if (nConfigurers > 1) {
throw new IllegalStateException(nConfigurers + " implementations of " +
"CachingConfigurer were found when only 1 was expected. " +
"Refactor the configuration such that CachingConfigurer is " +
"implemented only once or not at all.");
}
CachingConfigurer cachingConfigurer = cachingConfigurers.iterator().next();
this.cacheManager = cachingConfigurer.cacheManager();
this.keyGenerator = cachingConfigurer.keyGenerator();
}
else if (!CollectionUtils.isEmpty(cacheManagerBeans)) {
int nManagers = cacheManagerBeans.size();
if (nManagers > 1) {
throw new IllegalStateException(nManagers + " beans of type CacheManager " +
"were found when only 1 was expected. Remove all but one of the " +
"CacheManager bean definitions, or implement CachingConfigurer " +
"to make explicit which CacheManager should be used for " +
"annotation-driven cache management.");
}
CacheManager cacheManager = cacheManagerBeans.iterator().next();
this.cacheManager = cacheManager;
// keyGenerator remains null; will fall back to default within CacheInterceptor
}<|fim▁hole|> "from your configuration.");
}
}
}<|fim▁end|> | else {
throw new IllegalStateException("No bean of type CacheManager could be found. " +
"Register a CacheManager bean or remove the @EnableCaching annotation " + |
<|file_name|>12-add-annotations.py<|end_file_name|><|fim▁begin|>"""
This code will fail at runtime...
Could you help `mypy` catching the problem at compile time?<|fim▁hole|>"""
def sum_numbers(*n) -> float:
"""Sums up any number of numbers"""
return sum(n)
if __name__ == '__main__':
sum_numbers(1, 2.0) # this is not a bug
sum_numbers('4', 5) # this is a bug - can `mypy` catch it?!<|fim▁end|> | |
<|file_name|>pat.rs<|end_file_name|><|fim▁begin|>//! Patterns
//!
//! See: [6.3 Patterns](http://erlang.org/doc/apps/erts/absform.html#id87135)
use ast;
use ast::common;
use ast::literal;
pub type Match = common::Match<Pattern, Pattern>;
pub type Tuple = common::Tuple<Pattern>;
pub type Cons = common::Cons<Pattern>;
pub type Binary = common::Binary<Pattern>;
pub type UnaryOp = common::UnaryOp<Pattern>;
pub type BinaryOp = common::BinaryOp<Pattern>;
pub type Record = common::Record<Pattern>;
pub type RecordIndex = common::RecordIndex<Pattern>;
pub type Map = common::Map<Pattern>;
#[derive(Debug, Clone)]
pub enum Pattern {
Integer(Box<literal::Integer>),
Float(Box<literal::Float>),
String(Box<literal::Str>),
Char(Box<literal::Char>),
Atom(Box<literal::Atom>),
Var(Box<common::Var>),
Match(Box<Match>),
Tuple(Box<Tuple>),
Nil(Box<common::Nil>),
Cons(Box<Cons>),
Binary(Box<Binary>),
UnaryOp(Box<UnaryOp>),
BinaryOp(Box<BinaryOp>),
Record(Box<Record>),
RecordIndex(Box<RecordIndex>),
Map(Box<Map>),
}
impl_from!(Pattern::Integer(literal::Integer));
impl_from!(Pattern::Float(literal::Float));
impl_from!(Pattern::String(literal::Str));
impl_from!(Pattern::Char(literal::Char));
impl_from!(Pattern::Atom(literal::Atom));
impl_from!(Pattern::Var(common::Var));
impl_from!(Pattern::Match(Match));<|fim▁hole|>impl_from!(Pattern::UnaryOp(UnaryOp));
impl_from!(Pattern::BinaryOp(BinaryOp));
impl_from!(Pattern::Record(Record));
impl_from!(Pattern::RecordIndex(RecordIndex));
impl_from!(Pattern::Map(Map));
impl ast::Node for Pattern {
fn line(&self) -> ast::LineNum {
match *self {
Pattern::Integer(ref x) => x.line(),
Pattern::Float(ref x) => x.line(),
Pattern::String(ref x) => x.line(),
Pattern::Char(ref x) => x.line(),
Pattern::Atom(ref x) => x.line(),
Pattern::Var(ref x) => x.line(),
Pattern::Match(ref x) => x.line(),
Pattern::Tuple(ref x) => x.line(),
Pattern::Nil(ref x) => x.line(),
Pattern::Cons(ref x) => x.line(),
Pattern::Binary(ref x) => x.line(),
Pattern::UnaryOp(ref x) => x.line(),
Pattern::BinaryOp(ref x) => x.line(),
Pattern::Record(ref x) => x.line(),
Pattern::RecordIndex(ref x) => x.line(),
Pattern::Map(ref x) => x.line(),
}
}
}<|fim▁end|> | impl_from!(Pattern::Tuple(Tuple));
impl_from!(Pattern::Nil(common::Nil));
impl_from!(Pattern::Cons(Cons));
impl_from!(Pattern::Binary(Binary)); |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>import re
from tower import ugettext_lazy as _lazy
from tower import ugettext as _
from django import forms
from django.conf import settings
from django.forms.widgets import CheckboxSelectMultiple
from kuma.contentflagging.forms import ContentFlagForm
import kuma.wiki.content
from kuma.core.form_fields import StrippedCharField
from .constants import (SLUG_CLEANSING_REGEX, REVIEW_FLAG_TAGS,
LOCALIZATION_FLAG_TAGS, RESERVED_SLUGS)
from .models import (Document, Revision,
valid_slug_parent)
TITLE_REQUIRED = _lazy(u'Please provide a title.')
TITLE_SHORT = _lazy(u'The title is too short (%(show_value)s characters). '
u'It must be at least %(limit_value)s characters.')
TITLE_LONG = _lazy(u'Please keep the length of the title to %(limit_value)s '
u'characters or less. It is currently %(show_value)s '
u'characters.')
TITLE_PLACEHOLDER = _lazy(u'Name Your Article')
SLUG_REQUIRED = _lazy(u'Please provide a slug.')
SLUG_INVALID = _lazy(u'The slug provided is not valid.')
SLUG_SHORT = _lazy(u'The slug is too short (%(show_value)s characters). '
u'It must be at least %(limit_value)s characters.')
SLUG_LONG = _lazy(u'Please keep the length of the slug to %(limit_value)s '
u'characters or less. It is currently %(show_value)s '
u'characters.')
SUMMARY_REQUIRED = _lazy(u'Please provide a summary.')
SUMMARY_SHORT = _lazy(u'The summary is too short (%(show_value)s characters). '
u'It must be at least %(limit_value)s characters.')
SUMMARY_LONG = _lazy(u'Please keep the length of the summary to '
u'%(limit_value)s characters or less. It is currently '
u'%(show_value)s characters.')
CONTENT_REQUIRED = _lazy(u'Please provide content.')
CONTENT_SHORT = _lazy(u'The content is too short (%(show_value)s characters). '
u'It must be at least %(limit_value)s characters.')
CONTENT_LONG = _lazy(u'Please keep the length of the content to '
u'%(limit_value)s characters or less. It is currently '
u'%(show_value)s characters.')
COMMENT_LONG = _lazy(u'Please keep the length of the comment to '
u'%(limit_value)s characters or less. It is currently '
u'%(show_value)s characters.')
SLUG_COLLIDES = _lazy(u'Another document with this slug already exists.')
OTHER_COLLIDES = _lazy(u'Another document with this metadata already exists.')
MIDAIR_COLLISION = _lazy(u'This document was modified while you were '
'editing it.')
MOVE_REQUIRED = _lazy(u"Changing this document's slug requires "
u"moving it and its children.")
class DocumentForm(forms.ModelForm):
"""Form to create/edit a document."""
title = StrippedCharField(min_length=1, max_length=255,
widget=forms.TextInput(
attrs={'placeholder': TITLE_PLACEHOLDER}),
label=_lazy(u'Title:'),
help_text=_lazy(u'Title of article'),
error_messages={'required': TITLE_REQUIRED,
'min_length': TITLE_SHORT,
'max_length': TITLE_LONG})
slug = StrippedCharField(min_length=1, max_length=255,
widget=forms.TextInput(),
label=_lazy(u'Slug:'),
help_text=_lazy(u'Article URL'),
error_messages={'required': SLUG_REQUIRED,
'min_length': SLUG_SHORT,
'max_length': SLUG_LONG})
category = forms.ChoiceField(choices=Document.CATEGORIES,
initial=10,
# Required for non-translations, which is
# enforced in Document.clean().
required=False,
label=_lazy(u'Category:'),
help_text=_lazy(u'Type of article'),
widget=forms.HiddenInput())
parent_topic = forms.ModelChoiceField(queryset=Document.objects.all(),
required=False,
label=_lazy(u'Parent:'))
locale = forms.CharField(widget=forms.HiddenInput())
def clean_slug(self):
slug = self.cleaned_data['slug']
if slug == '':
# Default to the title, if missing.
slug = self.cleaned_data['title']
# "?", " ", quote disallowed in slugs altogether
if '?' in slug or ' ' in slug or '"' in slug or "'" in slug:
raise forms.ValidationError(SLUG_INVALID)
# Pattern copied from urls.py
if not re.compile(r'^[^\$]+$').match(slug):
raise forms.ValidationError(SLUG_INVALID)
# Guard against slugs that match urlpatterns
for pat in RESERVED_SLUGS:
if re.compile(pat).match(slug):
raise forms.ValidationError(SLUG_INVALID)
return slug
class Meta:
model = Document
fields = ('title', 'slug', 'category', 'locale')
def save(self, parent_doc, **kwargs):
"""Persist the Document form, and return the saved Document."""
doc = super(DocumentForm, self).save(commit=False, **kwargs)
doc.parent = parent_doc
if 'parent_topic' in self.cleaned_data:
doc.parent_topic = self.cleaned_data['parent_topic']
doc.save()
# not strictly necessary since we didn't change
# any m2m data since we instantiated the doc
self.save_m2m()
return doc
class RevisionForm(forms.ModelForm):
"""Form to create new revisions."""
title = StrippedCharField(min_length=1, max_length=255,
required=False,
widget=forms.TextInput(
attrs={'placeholder': TITLE_PLACEHOLDER}),
label=_lazy(u'Title:'),
help_text=_lazy(u'Title of article'),
error_messages={'required': TITLE_REQUIRED,
'min_length': TITLE_SHORT,
'max_length': TITLE_LONG})
slug = StrippedCharField(min_length=1, max_length=255,
required=False,
widget=forms.TextInput(),
label=_lazy(u'Slug:'),
help_text=_lazy(u'Article URL'),
error_messages={'required': SLUG_REQUIRED,
'min_length': SLUG_SHORT,
'max_length': SLUG_LONG})
tags = StrippedCharField(required=False,
label=_lazy(u'Tags:'))
keywords = StrippedCharField(required=False,
label=_lazy(u'Keywords:'),
help_text=_lazy(u'Affects search results'))
summary = StrippedCharField(required=False,
min_length=5, max_length=1000, widget=forms.Textarea(),
label=_lazy(u'Search result summary:'),
help_text=_lazy(u'Only displayed on search results page'),
error_messages={'required': SUMMARY_REQUIRED,
'min_length': SUMMARY_SHORT,
'max_length': SUMMARY_LONG})
content = StrippedCharField(
min_length=5, max_length=300000,
label=_lazy(u'Content:'),
widget=forms.Textarea(),
error_messages={'required': CONTENT_REQUIRED,
'min_length': CONTENT_SHORT,
'max_length': CONTENT_LONG})
comment = StrippedCharField(required=False, label=_lazy(u'Comment:'))
review_tags = forms.MultipleChoiceField(
label=_("Tag this revision for review?"),
widget=CheckboxSelectMultiple, required=False,
choices=REVIEW_FLAG_TAGS)
localization_tags = forms.MultipleChoiceField(
label=_("Tag this revision for localization?"),
widget=CheckboxSelectMultiple, required=False,
choices=LOCALIZATION_FLAG_TAGS)
current_rev = forms.CharField(required=False,
widget=forms.HiddenInput())
class Meta(object):
model = Revision
fields = ('title', 'slug', 'tags', 'keywords', 'summary', 'content',
'comment', 'based_on', 'toc_depth',
'render_max_age')
def __init__(self, *args, **kwargs):
# Snag some optional kwargs and delete them before calling
# super-constructor.
for n in ('section_id', 'is_iframe_target'):
if n not in kwargs:
setattr(self, n, None)
else:
setattr(self, n, kwargs[n])
del kwargs[n]
super(RevisionForm, self).__init__(*args, **kwargs)
self.fields['based_on'].widget = forms.HiddenInput()
if self.instance and self.instance.pk:
<|fim▁hole|> # Ensure both title and slug are populated from parent document, if
# last revision didn't have them
if not self.instance.title:
self.initial['title'] = self.instance.document.title
if not self.instance.slug:
self.initial['slug'] = self.instance.document.slug
content = self.instance.content
if not self.instance.document.is_template:
tool = kuma.wiki.content.parse(content)
tool.injectSectionIDs()
if self.section_id:
tool.extractSection(self.section_id)
tool.filterEditorSafety()
content = tool.serialize()
self.initial['content'] = content
self.initial['review_tags'] = [x.name
for x in self.instance.review_tags.all()]
self.initial['localization_tags'] = [x.name
for x in self.instance.localization_tags.all()]
if self.section_id:
self.fields['toc_depth'].required = False
def _clean_collidable(self, name):
value = self.cleaned_data[name]
if self.is_iframe_target:
# Since these collidables can change the URL of the page, changes
# to them are ignored for an iframe submission
return getattr(self.instance.document, name)
error_message = {'slug': SLUG_COLLIDES}.get(name, OTHER_COLLIDES)
try:
existing_doc = Document.objects.get(
locale=self.instance.document.locale,
**{name: value})
if self.instance and self.instance.document:
if (not existing_doc.redirect_url() and
existing_doc.pk != self.instance.document.pk):
# There's another document with this value,
# and we're not a revision of it.
raise forms.ValidationError(error_message)
else:
# This document-and-revision doesn't exist yet, so there
# shouldn't be any collisions at all.
raise forms.ValidationError(error_message)
except Document.DoesNotExist:
# No existing document for this value, so we're good here.
pass
return value
def clean_slug(self):
# TODO: move this check somewhere else?
# edits can come in without a slug, so default to the current doc slug
if not self.cleaned_data['slug']:
existing_slug = self.instance.document.slug
self.cleaned_data['slug'] = self.instance.slug = existing_slug
cleaned_slug = self._clean_collidable('slug')
return cleaned_slug
def clean_content(self):
"""Validate the content, performing any section editing if necessary"""
content = self.cleaned_data['content']
# If we're editing a section, we need to replace the section content
# from the current revision.
if self.section_id and self.instance and self.instance.document:
# Make sure we start with content form the latest revision.
full_content = self.instance.document.current_revision.content
# Replace the section content with the form content.
tool = kuma.wiki.content.parse(full_content)
tool.replaceSection(self.section_id, content)
content = tool.serialize()
return content
def clean_current_rev(self):
"""If a current revision is supplied in the form, compare it against
what the document claims is the current revision. If there's a
difference, then an edit has occurred since the form was constructed
and we treat it as a mid-air collision."""
current_rev = self.cleaned_data.get('current_rev', None)
if not current_rev:
# If there's no current_rev, just bail.
return current_rev
try:
doc_current_rev = self.instance.document.current_revision.id
if unicode(current_rev) != unicode(doc_current_rev):
if (self.section_id and self.instance and
self.instance.document):
# This is a section edit. So, even though the revision has
# changed, it still might not be a collision if the section
# in particular hasn't changed.
orig_ct = (Revision.objects.get(pk=current_rev)
.get_section_content(self.section_id))
curr_ct = (self.instance.document.current_revision
.get_section_content(self.section_id))
if orig_ct != curr_ct:
# Oops. Looks like the section did actually get
# changed, so yeah this is a collision.
raise forms.ValidationError(MIDAIR_COLLISION)
return current_rev
else:
# No section edit, so this is a flat-out collision.
raise forms.ValidationError(MIDAIR_COLLISION)
except Document.DoesNotExist:
# If there's no document yet, just bail.
return current_rev
def save_section(self, creator, document, **kwargs):
"""Save a section edit."""
# This is separate because the logic is slightly different and
# may need to evolve over time; a section edit doesn't submit
# all the fields, and we need to account for that when we
# construct the new Revision.
old_rev = Document.objects.get(pk=self.instance.document.id).current_revision
new_rev = super(RevisionForm, self).save(commit=False, **kwargs)
new_rev.document = document
new_rev.creator = creator
new_rev.toc_depth = old_rev.toc_depth
new_rev.save()
new_rev.review_tags.set(*[t.name for t in
old_rev.review_tags.all()])
return new_rev
def save(self, creator, document, **kwargs):
"""Persist me, and return the saved Revision.
Take several other necessary pieces of data that aren't from the
form.
"""
if self.section_id and self.instance and \
self.instance.document:
return self.save_section(creator, document, **kwargs)
# Throws a TypeError if somebody passes in a commit kwarg:
new_rev = super(RevisionForm, self).save(commit=False, **kwargs)
new_rev.document = document
new_rev.creator = creator
new_rev.toc_depth = self.cleaned_data['toc_depth']
new_rev.save()
new_rev.review_tags.set(*self.cleaned_data['review_tags'])
new_rev.localization_tags.set(*self.cleaned_data['localization_tags'])
return new_rev
class RevisionValidationForm(RevisionForm):
"""Created primarily to disallow slashes in slugs during validation"""
def clean_slug(self):
is_valid = True
original = self.cleaned_data['slug']
# "/", "?", and " " disallowed in form input
if (u'' == original or
'/' in original or
'?' in original or
' ' in original):
is_valid = False
raise forms.ValidationError(SLUG_INVALID)
# Append parent slug data, call super, ensure still valid
self.cleaned_data['slug'] = self.data['slug'] = (self.parent_slug +
'/' +
original)
is_valid = (is_valid and
super(RevisionValidationForm, self).clean_slug())
# Set the slug back to original
# if not is_valid:
self.cleaned_data['slug'] = self.data['slug'] = original
return self.cleaned_data['slug']
class TreeMoveForm(forms.Form):
title = StrippedCharField(min_length=1, max_length=255,
required=False,
widget=forms.TextInput(
attrs={'placeholder': TITLE_PLACEHOLDER}),
label=_lazy(u'Title:'),
help_text=_lazy(u'Title of article'),
error_messages={'required': TITLE_REQUIRED,
'min_length': TITLE_SHORT,
'max_length': TITLE_LONG})
slug = StrippedCharField(min_length=1, max_length=255,
widget=forms.TextInput(),
label=_lazy(u'New slug:'),
help_text=_lazy(u'New article URL'),
error_messages={'required': SLUG_REQUIRED,
'min_length': SLUG_SHORT,
'max_length': SLUG_LONG})
locale = StrippedCharField(min_length=2, max_length=5,
widget=forms.HiddenInput())
def clean_slug(self):
# We only want the slug here; inputting a full URL would lead
# to disaster.
if '://' in self.cleaned_data['slug']:
raise forms.ValidationError('Please enter only the slug to move '
'to, not the full URL.')
# Removes leading slash and {locale/docs/} if necessary
# IMPORTANT: This exact same regex is used on the client side, so
# update both if doing so
self.cleaned_data['slug'] = re.sub(re.compile(SLUG_CLEANSING_REGEX),
'', self.cleaned_data['slug'])
return self.cleaned_data['slug']
def clean(self):
cleaned_data = super(TreeMoveForm, self).clean()
if set(['slug', 'locale']).issubset(cleaned_data):
slug, locale = cleaned_data['slug'], cleaned_data['locale']
try:
valid_slug_parent(slug, locale)
except Exception, e:
raise forms.ValidationError(e.args[0])
return cleaned_data
class DocumentDeletionForm(forms.Form):
reason = forms.CharField(widget=forms.Textarea(attrs={'autofocus': 'true'}))
class DocumentContentFlagForm(ContentFlagForm):
flag_type = forms.ChoiceField(
choices=settings.WIKI_FLAG_REASONS,
widget=forms.RadioSelect)<|fim▁end|> | |
<|file_name|>test_frontend.py<|end_file_name|><|fim▁begin|>import unittest
<|fim▁hole|>
class PlaybackDefaultsFrontendTest(unittest.TestCase):
def test_no_settings(self):
config = {'playbackdefaults': {'default_random': '', 'default_repeat': '', 'default_consume': '', 'default_single': ''}}
core = mock.Mock()
self.assertEqual(core.tracklist.set_random.call_count, 0)
self.assertEqual(core.tracklist.set_repeat.call_count, 0)
self.assertEqual(core.tracklist.set_consume.call_count, 0)
self.assertEqual(core.tracklist.set_single.call_count, 0)
PlaybackDefaultsFrontend(config, core)
self.assertEqual(core.tracklist.set_random.call_count, 0)
self.assertEqual(core.tracklist.set_repeat.call_count, 0)
self.assertEqual(core.tracklist.set_consume.call_count, 0)
self.assertEqual(core.tracklist.set_single.call_count, 0)
def test_random(self):
config = {'playbackdefaults': {'default_random': '', 'default_repeat': '', 'default_consume': '', 'default_single': ''}}
core = mock.Mock()
self.assertEqual(core.tracklist.set_random.call_count, 0)
self.assertEqual(core.tracklist.set_repeat.call_count, 0)
self.assertEqual(core.tracklist.set_consume.call_count, 0)
self.assertEqual(core.tracklist.set_single.call_count, 0)
config['playbackdefaults']['default_random'] = True
PlaybackDefaultsFrontend(config, core)
core.tracklist.set_random.assert_called_once_with(True)
config['playbackdefaults']['default_random'] = False
PlaybackDefaultsFrontend(config, core)
self.assertEqual(core.tracklist.set_random.call_count, 2)
core.tracklist.set_random.assert_called_with(False)
self.assertEqual(core.tracklist.set_repeat.call_count, 0)
self.assertEqual(core.tracklist.set_consume.call_count, 0)
self.assertEqual(core.tracklist.set_single.call_count, 0)
def test_repeat(self):
config = {'playbackdefaults': {'default_random': '', 'default_repeat': '', 'default_consume': '', 'default_single': ''}}
core = mock.Mock()
self.assertEqual(core.tracklist.set_random.call_count, 0)
self.assertEqual(core.tracklist.set_repeat.call_count, 0)
self.assertEqual(core.tracklist.set_consume.call_count, 0)
self.assertEqual(core.tracklist.set_single.call_count, 0)
config['playbackdefaults']['default_repeat'] = True
PlaybackDefaultsFrontend(config, core)
core.tracklist.set_repeat.assert_called_once_with(True)
config['playbackdefaults']['default_repeat'] = False
PlaybackDefaultsFrontend(config, core)
self.assertEqual(core.tracklist.set_repeat.call_count, 2)
core.tracklist.set_repeat.assert_called_with(False)
self.assertEqual(core.tracklist.set_random.call_count, 0)
self.assertEqual(core.tracklist.set_consume.call_count, 0)
self.assertEqual(core.tracklist.set_single.call_count, 0)
def test_consume(self):
config = {'playbackdefaults': {'default_random': '', 'default_repeat': '', 'default_consume': '', 'default_single': ''}}
core = mock.Mock()
self.assertEqual(core.tracklist.set_random.call_count, 0)
self.assertEqual(core.tracklist.set_repeat.call_count, 0)
self.assertEqual(core.tracklist.set_consume.call_count, 0)
self.assertEqual(core.tracklist.set_single.call_count, 0)
config['playbackdefaults']['default_consume'] = True
PlaybackDefaultsFrontend(config, core)
core.tracklist.set_consume.assert_called_once_with(True)
config['playbackdefaults']['default_consume'] = False
PlaybackDefaultsFrontend(config, core)
self.assertEqual(core.tracklist.set_consume.call_count, 2)
core.tracklist.set_consume.assert_called_with(False)
self.assertEqual(core.tracklist.set_random.call_count, 0)
self.assertEqual(core.tracklist.set_repeat.call_count, 0)
self.assertEqual(core.tracklist.set_single.call_count, 0)
def test_single(self):
config = {'playbackdefaults': {'default_random': '', 'default_repeat': '', 'default_consume': '', 'default_single': ''}}
core = mock.Mock()
self.assertEqual(core.tracklist.set_random.call_count, 0)
self.assertEqual(core.tracklist.set_repeat.call_count, 0)
self.assertEqual(core.tracklist.set_consume.call_count, 0)
self.assertEqual(core.tracklist.set_single.call_count, 0)
config['playbackdefaults']['default_single'] = True
PlaybackDefaultsFrontend(config, core)
core.tracklist.set_single.assert_called_once_with(True)
config['playbackdefaults']['default_single'] = False
PlaybackDefaultsFrontend(config, core)
self.assertEqual(core.tracklist.set_single.call_count, 2)
core.tracklist.set_single.assert_called_with(False)
self.assertEqual(core.tracklist.set_random.call_count, 0)
self.assertEqual(core.tracklist.set_repeat.call_count, 0)
self.assertEqual(core.tracklist.set_consume.call_count, 0)<|fim▁end|> | import mock
from mopidy_playbackdefaults import PlaybackDefaultsFrontend
|
<|file_name|>test_dataflow.py<|end_file_name|><|fim▁begin|>#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
import unittest
import mock
from airflow.providers.google.cloud.operators.dataflow import (
CheckJobRunning, DataflowCreateJavaJobOperator, DataflowCreatePythonJobOperator,
DataflowTemplatedJobStartOperator,
)
from airflow.version import version
TASK_ID = 'test-dataflow-operator'
JOB_NAME = 'test-dataflow-pipeline'
TEMPLATE = 'gs://dataflow-templates/wordcount/template_file'
PARAMETERS = {
'inputFile': 'gs://dataflow-samples/shakespeare/kinglear.txt',
'output': 'gs://test/output/my_output'
}
PY_FILE = 'gs://my-bucket/my-object.py'
PY_INTERPRETER = 'python3'
JAR_FILE = 'gs://my-bucket/example/test.jar'
JOB_CLASS = 'com.test.NotMain'
PY_OPTIONS = ['-m']
DEFAULT_OPTIONS_PYTHON = DEFAULT_OPTIONS_JAVA = {
'project': 'test',
'stagingLocation': 'gs://test/staging',
}
DEFAULT_OPTIONS_TEMPLATE = {
'project': 'test',
'stagingLocation': 'gs://test/staging',
'tempLocation': 'gs://test/temp',
'zone': 'us-central1-f'
}
ADDITIONAL_OPTIONS = {
'output': 'gs://test/output',
'labels': {'foo': 'bar'}
}
TEST_VERSION = 'v{}'.format(version.replace('.', '-').replace('+', '-'))
EXPECTED_ADDITIONAL_OPTIONS = {
'output': 'gs://test/output',
'labels': {'foo': 'bar', 'airflow-version': TEST_VERSION}
}
POLL_SLEEP = 30
GCS_HOOK_STRING = 'airflow.providers.google.cloud.operators.dataflow.{}'
TEST_LOCATION = "custom-location"
class TestDataflowPythonOperator(unittest.TestCase):
def setUp(self):
self.dataflow = DataflowCreatePythonJobOperator(
task_id=TASK_ID,
py_file=PY_FILE,
job_name=JOB_NAME,
py_options=PY_OPTIONS,
dataflow_default_options=DEFAULT_OPTIONS_PYTHON,
options=ADDITIONAL_OPTIONS,
poll_sleep=POLL_SLEEP,
location=TEST_LOCATION
)
def test_init(self):
"""Test DataFlowPythonOperator instance is properly initialized."""
self.assertEqual(self.dataflow.task_id, TASK_ID)
self.assertEqual(self.dataflow.job_name, JOB_NAME)
self.assertEqual(self.dataflow.py_file, PY_FILE)
self.assertEqual(self.dataflow.py_options, PY_OPTIONS)
self.assertEqual(self.dataflow.py_interpreter, PY_INTERPRETER)
self.assertEqual(self.dataflow.poll_sleep, POLL_SLEEP)
self.assertEqual(self.dataflow.dataflow_default_options,
DEFAULT_OPTIONS_PYTHON)
self.assertEqual(self.dataflow.options,
EXPECTED_ADDITIONAL_OPTIONS)
@mock.patch('airflow.providers.google.cloud.operators.dataflow.DataflowHook')
@mock.patch('airflow.providers.google.cloud.operators.dataflow.GCSHook')
def test_exec(self, gcs_hook, dataflow_mock):
"""Test DataflowHook is created and the right args are passed to
start_python_workflow.
"""
start_python_hook = dataflow_mock.return_value.start_python_dataflow
gcs_provide_file = gcs_hook.return_value.provide_file
self.dataflow.execute(None)
self.assertTrue(dataflow_mock.called)
expected_options = {
'project': 'test',
'staging_location': 'gs://test/staging',
'output': 'gs://test/output',
'labels': {'foo': 'bar', 'airflow-version': TEST_VERSION}
}
gcs_provide_file.assert_called_once_with(object_url=PY_FILE)
start_python_hook.assert_called_once_with(
job_name=JOB_NAME,
variables=expected_options,
dataflow=mock.ANY,
py_options=PY_OPTIONS,
py_interpreter=PY_INTERPRETER,
py_requirements=[],
py_system_site_packages=False,
on_new_job_id_callback=mock.ANY,
project_id=None,
location=TEST_LOCATION
)
self.assertTrue(self.dataflow.py_file.startswith('/tmp/dataflow'))
class TestDataflowJavaOperator(unittest.TestCase):
def setUp(self):
self.dataflow = DataflowCreateJavaJobOperator(
task_id=TASK_ID,
jar=JAR_FILE,
job_name=JOB_NAME,
job_class=JOB_CLASS,
dataflow_default_options=DEFAULT_OPTIONS_JAVA,
options=ADDITIONAL_OPTIONS,
poll_sleep=POLL_SLEEP,
location=TEST_LOCATION
)
def test_init(self):
"""Test DataflowTemplateOperator instance is properly initialized."""
self.assertEqual(self.dataflow.task_id, TASK_ID)
self.assertEqual(self.dataflow.job_name, JOB_NAME)
self.assertEqual(self.dataflow.poll_sleep, POLL_SLEEP)
self.assertEqual(self.dataflow.dataflow_default_options,
DEFAULT_OPTIONS_JAVA)
self.assertEqual(self.dataflow.job_class, JOB_CLASS)
self.assertEqual(self.dataflow.jar, JAR_FILE)
self.assertEqual(self.dataflow.options,<|fim▁hole|>
@mock.patch('airflow.providers.google.cloud.operators.dataflow.DataflowHook')
@mock.patch('airflow.providers.google.cloud.operators.dataflow.GCSHook')
def test_exec(self, gcs_hook, dataflow_mock):
"""Test DataflowHook is created and the right args are passed to
start_java_workflow.
"""
start_java_hook = dataflow_mock.return_value.start_java_dataflow
gcs_provide_file = gcs_hook.return_value.provide_file
self.dataflow.check_if_running = CheckJobRunning.IgnoreJob
self.dataflow.execute(None)
self.assertTrue(dataflow_mock.called)
gcs_provide_file.assert_called_once_with(object_url=JAR_FILE)
start_java_hook.assert_called_once_with(
job_name=JOB_NAME,
variables=mock.ANY,
jar=mock.ANY,
job_class=JOB_CLASS,
append_job_name=True,
multiple_jobs=None,
on_new_job_id_callback=mock.ANY,
project_id=None,
location=TEST_LOCATION
)
@mock.patch('airflow.providers.google.cloud.operators.dataflow.DataflowHook')
@mock.patch('airflow.providers.google.cloud.operators.dataflow.GCSHook')
def test_check_job_running_exec(self, gcs_hook, dataflow_mock):
"""Test DataflowHook is created and the right args are passed to
start_java_workflow.
"""
dataflow_running = dataflow_mock.return_value.is_job_dataflow_running
dataflow_running.return_value = True
start_java_hook = dataflow_mock.return_value.start_java_dataflow
gcs_provide_file = gcs_hook.return_value.provide_file
self.dataflow.check_if_running = True
self.dataflow.execute(None)
self.assertTrue(dataflow_mock.called)
gcs_provide_file.assert_not_called()
start_java_hook.assert_not_called()
dataflow_running.assert_called_once_with(
name=JOB_NAME, variables=mock.ANY, project_id=None, location=TEST_LOCATION)
@mock.patch('airflow.providers.google.cloud.operators.dataflow.DataflowHook')
@mock.patch('airflow.providers.google.cloud.operators.dataflow.GCSHook')
def test_check_job_not_running_exec(self, gcs_hook, dataflow_mock):
"""Test DataflowHook is created and the right args are passed to
start_java_workflow with option to check if job is running
"""
dataflow_running = dataflow_mock.return_value.is_job_dataflow_running
dataflow_running.return_value = False
start_java_hook = dataflow_mock.return_value.start_java_dataflow
gcs_provide_file = gcs_hook.return_value.provide_file
self.dataflow.check_if_running = True
self.dataflow.execute(None)
self.assertTrue(dataflow_mock.called)
gcs_provide_file.assert_called_once_with(object_url=JAR_FILE)
start_java_hook.assert_called_once_with(
job_name=JOB_NAME,
variables=mock.ANY,
jar=mock.ANY,
job_class=JOB_CLASS,
append_job_name=True,
multiple_jobs=None,
on_new_job_id_callback=mock.ANY,
project_id=None,
location=TEST_LOCATION
)
dataflow_running.assert_called_once_with(
name=JOB_NAME, variables=mock.ANY, project_id=None, location=TEST_LOCATION)
@mock.patch('airflow.providers.google.cloud.operators.dataflow.DataflowHook')
@mock.patch('airflow.providers.google.cloud.operators.dataflow.GCSHook')
def test_check_multiple_job_exec(self, gcs_hook, dataflow_mock):
"""Test DataflowHook is created and the right args are passed to
start_java_workflow with option to check multiple jobs
"""
dataflow_running = dataflow_mock.return_value.is_job_dataflow_running
dataflow_running.return_value = False
start_java_hook = dataflow_mock.return_value.start_java_dataflow
gcs_provide_file = gcs_hook.return_value.provide_file
self.dataflow.multiple_jobs = True
self.dataflow.check_if_running = True
self.dataflow.execute(None)
self.assertTrue(dataflow_mock.called)
gcs_provide_file.assert_called_once_with(object_url=JAR_FILE)
start_java_hook.assert_called_once_with(
job_name=JOB_NAME,
variables=mock.ANY,
jar=mock.ANY,
job_class=JOB_CLASS,
append_job_name=True,
multiple_jobs=True,
on_new_job_id_callback=mock.ANY,
project_id=None,
location=TEST_LOCATION
)
dataflow_running.assert_called_once_with(
name=JOB_NAME, variables=mock.ANY, project_id=None, location=TEST_LOCATION
)
class TestDataflowTemplateOperator(unittest.TestCase):
def setUp(self):
self.dataflow = DataflowTemplatedJobStartOperator(
task_id=TASK_ID,
template=TEMPLATE,
job_name=JOB_NAME,
parameters=PARAMETERS,
options=DEFAULT_OPTIONS_TEMPLATE,
dataflow_default_options={"EXTRA_OPTION": "TEST_A"},
poll_sleep=POLL_SLEEP,
location=TEST_LOCATION
)
@mock.patch('airflow.providers.google.cloud.operators.dataflow.DataflowHook')
def test_exec(self, dataflow_mock):
"""Test DataflowHook is created and the right args are passed to
start_template_workflow.
"""
start_template_hook = dataflow_mock.return_value.start_template_dataflow
self.dataflow.execute(None)
self.assertTrue(dataflow_mock.called)
expected_options = {
'project': 'test',
'stagingLocation': 'gs://test/staging',
'tempLocation': 'gs://test/temp',
'zone': 'us-central1-f',
'EXTRA_OPTION': "TEST_A"
}
start_template_hook.assert_called_once_with(
job_name=JOB_NAME,
variables=expected_options,
parameters=PARAMETERS,
dataflow_template=TEMPLATE,
on_new_job_id_callback=mock.ANY,
project_id=None,
location=TEST_LOCATION
)<|fim▁end|> | EXPECTED_ADDITIONAL_OPTIONS)
self.assertEqual(self.dataflow.check_if_running, CheckJobRunning.WaitForRun) |
<|file_name|>AmazonAdsListener.java<|end_file_name|><|fim▁begin|>/* Copyright (c) 2015 Pozirk Games
* http://www.pozirk.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.<|fim▁hole|>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.pozirk.ads;
//import android.util.Log;
import com.amazon.device.ads.*;
import org.haxe.lime.HaxeObject;
public class AmazonAdsListener implements AdListener
{
protected HaxeObject _callback = null;
protected String _who = null;
public AmazonAdsListener(HaxeObject callback, String who)
{
_callback = callback;
_who = who;
}
public void onAdLoaded(Ad ad, AdProperties adProperties)
{
//Log.d("amazonads", "onAdLoaded");
_callback.call("onStatus", new Object[] {"AD_LOADED", _who, "type: "+_who});
}
public void onAdFailedToLoad(Ad ad, AdError error)
{
//Log.d("amazonads", "onAdFailedToLoad: "+error.getMessage());
_callback.call("onStatus", new Object[] {"AD_FAILED_TO_LOAD", _who, "type: "+_who+", "+error.getCode()+": "+error.getMessage()});
}
public void onAdExpanded(Ad ad)
{
_callback.call("onStatus", new Object[] {"AD_EXPANDED", _who, "type: "+_who});
}
public void onAdCollapsed(Ad ad)
{
_callback.call("onStatus", new Object[] {"AD_COLLAPSED", _who, "type: "+_who});
}
public void onAdDismissed(Ad ad)
{
_callback.call("onStatus", new Object[] {"AD_DISMISSED", _who, "type: "+_who});
}
}<|fim▁end|> | |
<|file_name|>Home.java<|end_file_name|><|fim▁begin|>package edu.gatech.nutrack;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.support.v4.app.NavUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
public class Home extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.home, menu);
return true;
}
public void callScan(View view) {
Intent callScanIntent = new Intent(this, NutritionixActivity.class);
startActivity(callScanIntent);
}
public void callTrack(View view) {
Intent callTrackIntent = new Intent(this, Track.class);
startActivity(callTrackIntent);
}
public void callSync(View view) {
Intent callSyncIntent = new Intent(this, Sync.class);
startActivity(callSyncIntent);
}
public void callReco(View view) {
Intent callRecoIntent = new Intent(this, Reco.class);
startActivity(callRecoIntent);
}
public boolean onOptionsItemSelected(MenuItem item) {
// Handle presses on the action bar items
switch (item.getItemId()) {
case android.R.id.home:
// This ID represents the Home or Up button. In the case of this
// activity, the Up button is shown. Use NavUtils to allow users
// to navigate up one level in the application structure. For
// more details, see the Navigation pattern on Android Design:
//<|fim▁hole|> // http://developer.android.com/design/patterns/navigation.html#up-vs-back
//
NavUtils.navigateUpFromSameTask(this);
return true;
case R.id.action_scan:
Intent callScanIntent = new Intent(this, NutritionixActivity.class);
startActivity(callScanIntent);
return true;
case R.id.action_track:
Intent callTrackIntent = new Intent(this, Track.class);
startActivity(callTrackIntent);
return true;
case R.id.action_reco:
Intent callReco = new Intent(this, Track.class);
startActivity(callReco);
return true;
case R.id.action_nutrition_info:
Intent callNutritionInfo = new Intent(this, Track.class);
startActivity(callNutritionInfo);
return true;
case R.id.action_log_out:
callLogout(item.getActionView());
return true;
default:
return super.onOptionsItemSelected(item);
}
}
// log out. Every activity should have this method!
public void callLogout(View view) {
Intent callLoginIntent = new Intent(this, Login.class);
startActivity(callLoginIntent);
}
}<|fim▁end|> | |
<|file_name|>closure.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use back::abi;
use back::link::{mangle_internal_name_by_path_and_seq};
use lib::llvm::{llvm, ValueRef};
use middle::moves;
use middle::trans::base::*;
use middle::trans::build::*;
use middle::trans::callee;
use middle::trans::common::*;
use middle::trans::datum::{Datum, INIT, ByRef, ZeroMem};
use middle::trans::expr;
use middle::trans::glue;
use middle::trans::machine;
use middle::trans::type_of::*;
use middle::ty;
use util::ppaux::ty_to_str;
use middle::trans::type_::Type;
use std::str;
use std::vec;
use syntax::ast;
use syntax::ast_map::path_name;
use syntax::ast_util;
use syntax::parse::token::special_idents;
// ___Good to know (tm)__________________________________________________
//
// The layout of a closure environment in memory is
// roughly as follows:
//
// struct rust_opaque_box { // see rust_internal.h
// unsigned ref_count; // only used for @fn()
// type_desc *tydesc; // describes closure_data struct
// rust_opaque_box *prev; // (used internally by memory alloc)
// rust_opaque_box *next; // (used internally by memory alloc)
// struct closure_data {
// type_desc *bound_tdescs[]; // bound descriptors
// struct {
// upvar1_t upvar1;
// ...
// upvarN_t upvarN;
// } bound_data;
// }
// };
//
// Note that the closure is itself a rust_opaque_box. This is true
// even for ~fn and &fn, because we wish to keep binary compatibility
// between all kinds of closures. The allocation strategy for this
// closure depends on the closure type. For a sendfn, the closure
// (and the referenced type descriptors) will be allocated in the
// exchange heap. For a fn, the closure is allocated in the task heap
// and is reference counted. For a block, the closure is allocated on
// the stack.
//
// ## Opaque closures and the embedded type descriptor ##
//
// One interesting part of closures is that they encapsulate the data
// that they close over. So when I have a ptr to a closure, I do not
// know how many type descriptors it contains nor what upvars are
// captured within. That means I do not know precisely how big it is
// nor where its fields are located. This is called an "opaque
// closure".
//
// Typically an opaque closure suffices because we only manipulate it
// by ptr. The routine Type::opaque_box().ptr_to() returns an
// appropriate type for such an opaque closure; it allows access to
// the box fields, but not the closure_data itself.
//
// But sometimes, such as when cloning or freeing a closure, we need
// to know the full information. That is where the type descriptor
// that defines the closure comes in handy. We can use its take and
// drop glue functions to allocate/free data as needed.
//
// ## Subtleties concerning alignment ##
//
// It is important that we be able to locate the closure data *without
// knowing the kind of data that is being bound*. This can be tricky
// because the alignment requirements of the bound data affects the
// alignment requires of the closure_data struct as a whole. However,
// right now this is a non-issue in any case, because the size of the
// rust_opaque_box header is always a mutiple of 16-bytes, which is
// the maximum alignment requirement we ever have to worry about.
//
// The only reason alignment matters is that, in order to learn what data
// is bound, we would normally first load the type descriptors: but their
// location is ultimately depend on their content! There is, however, a
// workaround. We can load the tydesc from the rust_opaque_box, which
// describes the closure_data struct and has self-contained derived type
// descriptors, and read the alignment from there. It's just annoying to
// do. Hopefully should this ever become an issue we'll have monomorphized
// and type descriptors will all be a bad dream.
//
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pub enum EnvAction {
/// Copy the value from this llvm ValueRef into the environment.
EnvCopy,
/// Move the value from this llvm ValueRef into the environment.
EnvMove,
/// Access by reference (used for stack closures).
EnvRef
}
pub struct EnvValue {
action: EnvAction,
datum: Datum
}
impl EnvAction {
pub fn to_str(&self) -> ~str {
match *self {
EnvCopy => ~"EnvCopy",
EnvMove => ~"EnvMove",
EnvRef => ~"EnvRef"
}
}
}
impl EnvValue {
pub fn to_str(&self, ccx: &CrateContext) -> ~str {
fmt!("%s(%s)", self.action.to_str(), self.datum.to_str(ccx))
}
}
pub fn mk_tuplified_uniq_cbox_ty(tcx: ty::ctxt, cdata_ty: ty::t) -> ty::t {
let cbox_ty = tuplify_box_ty(tcx, cdata_ty);
return ty::mk_imm_uniq(tcx, cbox_ty);
}
// Given a closure ty, emits a corresponding tuple ty
pub fn mk_closure_tys(tcx: ty::ctxt,
bound_values: &[EnvValue])
-> ty::t {
// determine the types of the values in the env. Note that this
// is the actual types that will be stored in the map, not the
// logical types as the user sees them, so by-ref upvars must be
// converted to ptrs.
let bound_tys = bound_values.map(|bv| {
match bv.action {
EnvCopy | EnvMove => bv.datum.ty,
EnvRef => ty::mk_mut_ptr(tcx, bv.datum.ty)
}
});
let cdata_ty = ty::mk_tup(tcx, bound_tys);
debug!("cdata_ty=%s", ty_to_str(tcx, cdata_ty));
return cdata_ty;
}
fn heap_for_unique_closure(bcx: block, t: ty::t) -> heap {
if ty::type_contents(bcx.tcx(), t).contains_managed() {
heap_managed_unique
} else {
heap_exchange_closure
}
}
pub fn allocate_cbox(bcx: block, sigil: ast::Sigil, cdata_ty: ty::t)
-> Result {
let _icx = push_ctxt("closure::allocate_cbox");
let ccx = bcx.ccx();
let tcx = ccx.tcx;
fn nuke_ref_count(bcx: block, llbox: ValueRef) {
let _icx = push_ctxt("closure::nuke_ref_count");
// Initialize ref count to arbitrary value for debugging:
let ccx = bcx.ccx();
let llbox = PointerCast(bcx, llbox, Type::opaque_box(ccx).ptr_to());
let ref_cnt = GEPi(bcx, llbox, [0u, abi::box_field_refcnt]);
let rc = C_int(ccx, 0x12345678);
Store(bcx, rc, ref_cnt);
}
// Allocate and initialize the box:
match sigil {
ast::ManagedSigil => {
malloc_raw(bcx, cdata_ty, heap_managed)
}
ast::OwnedSigil => {
malloc_raw(bcx, cdata_ty, heap_for_unique_closure(bcx, cdata_ty))
}
ast::BorrowedSigil => {
let cbox_ty = tuplify_box_ty(tcx, cdata_ty);
let llbox = alloc_ty(bcx, cbox_ty, "__closure");
nuke_ref_count(bcx, llbox);
rslt(bcx, llbox)
}
}
}
pub struct ClosureResult {
llbox: ValueRef, // llvalue of ptr to closure
cdata_ty: ty::t, // type of the closure data
bcx: block // final bcx
}
// Given a block context and a list of tydescs and values to bind
// construct a closure out of them. If copying is true, it is a
// heap allocated closure that copies the upvars into environment.
// Otherwise, it is stack allocated and copies pointers to the upvars.
pub fn store_environment(bcx: block,
bound_values: ~[EnvValue],
sigil: ast::Sigil) -> ClosureResult {
let _icx = push_ctxt("closure::store_environment");
let ccx = bcx.ccx();
let tcx = ccx.tcx;
// compute the type of the closure
let cdata_ty = mk_closure_tys(tcx, bound_values);
// allocate closure in the heap
let Result {bcx: bcx, val: llbox} = allocate_cbox(bcx, sigil, cdata_ty);
// cbox_ty has the form of a tuple: (a, b, c) we want a ptr to a
// tuple. This could be a ptr in uniq or a box or on stack,
// whatever.
let cbox_ty = tuplify_box_ty(tcx, cdata_ty);
let cboxptr_ty = ty::mk_ptr(tcx, ty::mt {ty:cbox_ty, mutbl:ast::m_imm});
let llbox = PointerCast(bcx, llbox, type_of(ccx, cboxptr_ty));
debug!("tuplify_box_ty = %s", ty_to_str(tcx, cbox_ty));
// Copy expr values into boxed bindings.
let mut bcx = bcx;
for bound_values.iter().enumerate().advance |(i, bv)| {
debug!("Copy %s into closure", bv.to_str(ccx));
if ccx.sess.asm_comments() {
add_comment(bcx, fmt!("Copy %s into closure",
bv.to_str(ccx)));
}
let bound_data = GEPi(bcx, llbox, [0u, abi::box_field_body, i]);
match bv.action {
EnvCopy => {
bcx = bv.datum.copy_to(bcx, INIT, bound_data);
}
EnvMove => {
bcx = bv.datum.move_to(bcx, INIT, bound_data);
}
EnvRef => {
Store(bcx, bv.datum.to_ref_llval(bcx), bound_data);
}
}
}
ClosureResult { llbox: llbox, cdata_ty: cdata_ty, bcx: bcx }
}
// Given a context and a list of upvars, build a closure. This just
// collects the upvars and packages them up for store_environment.
pub fn build_closure(bcx0: block,
cap_vars: &[moves::CaptureVar],
sigil: ast::Sigil,
include_ret_handle: Option<ValueRef>) -> ClosureResult {
let _icx = push_ctxt("closure::build_closure");
// If we need to, package up the iterator body to call
let bcx = bcx0;
// Package up the captured upvars
let mut env_vals = ~[];
for cap_vars.iter().advance |cap_var| {
debug!("Building closure: captured variable %?", *cap_var);
let datum = expr::trans_local_var(bcx, cap_var.def);
match cap_var.mode {
moves::CapRef => {
assert_eq!(sigil, ast::BorrowedSigil);
env_vals.push(EnvValue {action: EnvRef,
datum: datum});
}
moves::CapCopy => {
env_vals.push(EnvValue {action: EnvCopy,
datum: datum});
}
moves::CapMove => {
env_vals.push(EnvValue {action: EnvMove,
datum: datum});
}
}
}
// If this is a `for` loop body, add two special environment
// variables:
for include_ret_handle.iter().advance |flagptr| {
// Flag indicating we have returned (a by-ref bool):
let flag_datum = Datum {val: *flagptr, ty: ty::mk_bool(),
mode: ByRef(ZeroMem)};
env_vals.push(EnvValue {action: EnvRef,
datum: flag_datum});
// Return value (we just pass a by-ref () and cast it later to
// the right thing):
let ret_true = match bcx.fcx.loop_ret {
Some((_, retptr)) => retptr,
None => match bcx.fcx.llretptr {
None => C_null(Type::nil().ptr_to()),
Some(retptr) => PointerCast(bcx, retptr, Type::nil().ptr_to()),
}
};
let ret_datum = Datum {val: ret_true, ty: ty::mk_nil(),
mode: ByRef(ZeroMem)};
env_vals.push(EnvValue {action: EnvRef,
datum: ret_datum});
}
return store_environment(bcx, env_vals, sigil);
}
// Given an enclosing block context, a new function context, a closure type,
// and a list of upvars, generate code to load and populate the environment
// with the upvars and type descriptors.
pub fn load_environment(fcx: fn_ctxt,
cdata_ty: ty::t,
cap_vars: &[moves::CaptureVar],
load_ret_handle: bool,
sigil: ast::Sigil) {
let _icx = push_ctxt("closure::load_environment");
let llloadenv = match fcx.llloadenv {
Some(ll) => ll,
None => {
let ll =
str::as_c_str("load_env",
|buf|
unsafe {
llvm::LLVMAppendBasicBlockInContext(fcx.ccx.llcx,
fcx.llfn,
buf)
});
fcx.llloadenv = Some(ll);
ll
}
};
let bcx = raw_block(fcx, false, llloadenv);
// Load a pointer to the closure data, skipping over the box header:
let llcdata = opaque_box_body(bcx, cdata_ty, fcx.llenv);
// Populate the upvars from the environment.
let mut i = 0u;
for cap_vars.iter().advance |cap_var| {
let mut upvarptr = GEPi(bcx, llcdata, [0u, i]);
match sigil {
ast::BorrowedSigil => { upvarptr = Load(bcx, upvarptr); }
ast::ManagedSigil | ast::OwnedSigil => {}
}
let def_id = ast_util::def_id_of_def(cap_var.def);
fcx.llupvars.insert(def_id.node, upvarptr);
i += 1u;
}
if load_ret_handle {
let flagptr = Load(bcx, GEPi(bcx, llcdata, [0u, i]));
let retptr = Load(bcx,
GEPi(bcx, llcdata, [0u, i+1u]));
fcx.loop_ret = Some((flagptr, retptr));
}
}
pub fn trans_expr_fn(bcx: block,
sigil: ast::Sigil,
decl: &ast::fn_decl,
body: &ast::blk,
outer_id: ast::node_id,
user_id: ast::node_id,
is_loop_body: Option<Option<ValueRef>>,
dest: expr::Dest) -> block {
/*!
*
* Translates the body of a closure expression.
*
* - `sigil`
* - `decl`
* - `body`
* - `outer_id`: The id of the closure expression with the correct
* type. This is usually the same as `user_id`, but in the
* case of a `for` loop, the `outer_id` will have the return
* type of boolean, and the `user_id` will have the return type
* of `nil`.
* - `user_id`: The id of the closure as the user expressed it.
Generally the same as `outer_id`
* - `cap_clause`: information about captured variables, if any.
* - `is_loop_body`: `Some()` if this is part of a `for` loop.
* - `dest`: where to write the closure value, which must be a
(fn ptr, env) pair
*/
let _icx = push_ctxt("closure::trans_expr_fn");
let dest_addr = match dest {
expr::SaveIn(p) => p,
expr::Ignore => {
return bcx; // closure construction is non-side-effecting
}
};
let ccx = bcx.ccx();
let fty = node_id_type(bcx, outer_id);
let llfnty = type_of_fn_from_ty(ccx, fty);
let sub_path = vec::append_one(/*bad*/copy bcx.fcx.path,
path_name(special_idents::anon));
// XXX: Bad copy.
let s = mangle_internal_name_by_path_and_seq(ccx,
copy sub_path,
"expr_fn");
let llfn = decl_internal_cdecl_fn(ccx.llmod, s, llfnty);
// Always mark inline if this is a loop body. This is important for
// performance on many programs with tight loops.
if is_loop_body.is_some() {
set_always_inline(llfn);
} else {
// Can't hurt.
set_inline_hint(llfn);
}
let real_return_type = if is_loop_body.is_some() {
ty::mk_bool()
} else {
ty::ty_fn_ret(fty)
};
let Result {bcx: bcx, val: closure} = match sigil {
ast::BorrowedSigil | ast::ManagedSigil | ast::OwnedSigil => {
let cap_vars = ccx.maps.capture_map.get_copy(&user_id);
let ret_handle = match is_loop_body {Some(x) => x,
None => None};
let ClosureResult {llbox, cdata_ty, bcx}
= build_closure(bcx, cap_vars, sigil, ret_handle);
trans_closure(ccx,
sub_path,
decl,
body,
llfn,
no_self,
/*bad*/ copy bcx.fcx.param_substs,
user_id,
[],
real_return_type,
|fcx| load_environment(fcx, cdata_ty, cap_vars,
ret_handle.is_some(), sigil),
|bcx| {
if is_loop_body.is_some() {
Store(bcx,
C_bool(true),
bcx.fcx.llretptr.get());
}
});
rslt(bcx, llbox)
}
};
fill_fn_pair(bcx, dest_addr, llfn, closure);
return bcx;
}
pub fn make_closure_glue(
cx: block,
v: ValueRef,
t: ty::t,
glue_fn: &fn(block, v: ValueRef, t: ty::t) -> block) -> block {
let _icx = push_ctxt("closure::make_closure_glue");
let bcx = cx;
let tcx = cx.tcx();
let sigil = ty::ty_closure_sigil(t);
match sigil {
ast::BorrowedSigil => bcx,
ast::OwnedSigil | ast::ManagedSigil => {<|fim▁hole|> let closure_ty = ty::mk_opaque_closure_ptr(tcx, sigil);
glue_fn(bcx, box_cell_v, closure_ty)
}
}
}
}
pub fn make_opaque_cbox_take_glue(
bcx: block,
sigil: ast::Sigil,
cboxptr: ValueRef) // ptr to ptr to the opaque closure
-> block {
// Easy cases:
let _icx = push_ctxt("closure::make_opaque_cbox_take_glue");
match sigil {
ast::BorrowedSigil => {
return bcx;
}
ast::ManagedSigil => {
glue::incr_refcnt_of_boxed(bcx, Load(bcx, cboxptr));
return bcx;
}
ast::OwnedSigil => {
/* hard case: fallthrough to code below */
}
}
// ~fn requires a deep copy.
let ccx = bcx.ccx();
let tcx = ccx.tcx;
let llopaquecboxty = Type::opaque_box(ccx).ptr_to();
let cbox_in = Load(bcx, cboxptr);
do with_cond(bcx, IsNotNull(bcx, cbox_in)) |bcx| {
// Load the size from the type descr found in the cbox
let cbox_in = PointerCast(bcx, cbox_in, llopaquecboxty);
let tydescptr = GEPi(bcx, cbox_in, [0u, abi::box_field_tydesc]);
let tydesc = Load(bcx, tydescptr);
let tydesc = PointerCast(bcx, tydesc, ccx.tydesc_type.ptr_to());
let sz = Load(bcx, GEPi(bcx, tydesc, [0u, abi::tydesc_field_size]));
// Adjust sz to account for the rust_opaque_box header fields
let sz = Add(bcx, sz, machine::llsize_of(ccx, Type::box_header(ccx)));
// Allocate memory, update original ptr, and copy existing data
let opaque_tydesc = PointerCast(bcx, tydesc, Type::i8p());
let mut bcx = bcx;
let llresult = unpack_result!(bcx, callee::trans_lang_call(
bcx,
bcx.tcx().lang_items.closure_exchange_malloc_fn(),
[opaque_tydesc, sz],
None));
let cbox_out = PointerCast(bcx, llresult, llopaquecboxty);
call_memcpy(bcx, cbox_out, cbox_in, sz, 1);
Store(bcx, cbox_out, cboxptr);
// Take the (deeply cloned) type descriptor
let tydesc_out = GEPi(bcx, cbox_out, [0u, abi::box_field_tydesc]);
let bcx = glue::take_ty(bcx, tydesc_out, ty::mk_type(tcx));
// Take the data in the tuple
let cdata_out = GEPi(bcx, cbox_out, [0u, abi::box_field_body]);
glue::call_tydesc_glue_full(bcx, cdata_out, tydesc,
abi::tydesc_field_take_glue, None);
bcx
}
}
pub fn make_opaque_cbox_drop_glue(
bcx: block,
sigil: ast::Sigil,
cboxptr: ValueRef) // ptr to the opaque closure
-> block {
let _icx = push_ctxt("closure::make_opaque_cbox_drop_glue");
match sigil {
ast::BorrowedSigil => bcx,
ast::ManagedSigil => {
glue::decr_refcnt_maybe_free(
bcx, Load(bcx, cboxptr), Some(cboxptr),
ty::mk_opaque_closure_ptr(bcx.tcx(), sigil))
}
ast::OwnedSigil => {
glue::free_ty(
bcx, cboxptr,
ty::mk_opaque_closure_ptr(bcx.tcx(), sigil))
}
}
}
pub fn make_opaque_cbox_free_glue(
bcx: block,
sigil: ast::Sigil,
cbox: ValueRef) // ptr to ptr to the opaque closure
-> block {
let _icx = push_ctxt("closure::make_opaque_cbox_free_glue");
match sigil {
ast::BorrowedSigil => {
return bcx;
}
ast::ManagedSigil | ast::OwnedSigil => {
/* hard cases: fallthrough to code below */
}
}
let ccx = bcx.ccx();
do with_cond(bcx, IsNotNull(bcx, cbox)) |bcx| {
// Load the type descr found in the cbox
let lltydescty = ccx.tydesc_type.ptr_to();
let cbox = Load(bcx, cbox);
let tydescptr = GEPi(bcx, cbox, [0u, abi::box_field_tydesc]);
let tydesc = Load(bcx, tydescptr);
let tydesc = PointerCast(bcx, tydesc, lltydescty);
// Drop the tuple data then free the descriptor
let cdata = GEPi(bcx, cbox, [0u, abi::box_field_body]);
glue::call_tydesc_glue_full(bcx, cdata, tydesc,
abi::tydesc_field_drop_glue, None);
// Free the ty descr (if necc) and the box itself
match sigil {
ast::ManagedSigil => glue::trans_free(bcx, cbox),
ast::OwnedSigil => glue::trans_exchange_free(bcx, cbox),
ast::BorrowedSigil => {
bcx.sess().bug("impossible")
}
}
}
}<|fim▁end|> | let box_cell_v = GEPi(cx, v, [0u, abi::fn_field_box]);
let box_ptr_v = Load(cx, box_cell_v);
do with_cond(cx, IsNotNull(cx, box_ptr_v)) |bcx| { |
<|file_name|>subselect.py<|end_file_name|><|fim▁begin|>import re
from unittest import TestCase
def mark_quoted_strings(sql):
"""Mark all quoted strings in the SOQL by '@' and get them as params,
with respect to all escaped backslashes and quotes.
"""
pm_pattern = re.compile(r"'[^\\']*(?:\\[\\'][^\\']*)*'")
bs_pattern = re.compile(r"\\([\\'])")
out_pattern = re.compile("^[-!()*+,.:<=>\w\s]*$")
start = 0
out = []
params = []
for match in pm_pattern.finditer(sql):
out.append(sql[start:match.start()])
assert out_pattern.match(sql[start:match.start()])
params.append(bs_pattern.sub('\\1', sql[match.start() + 1:match.end() -1]))
start = match.end()
out.append(sql[start:])
assert out_pattern.match(sql[start:])
return '@'.join(out), params
def subst_quoted_strings(sql, params):
"""Reverse operation to mark_quoted_strings - substitutes '@' by params.
"""
parts = sql.split('@')
assert len(parts) == len(params) + 1
out = []
for i, param in enumerate(params):
out.append(parts[i])
out.append("'%s'" % param.replace('\\', '\\\\').replace("\'", "\\\'"))
out.append(parts[-1])
return ''.join(out)
def find_closing_parenthesis(sql, startpos):
"""Find the pair of opening and closing parentheses.
Starts search at the position startpos.
Returns tuple of positions (opening, closing) if search succeeds, otherwise None.
"""
pattern = re.compile(r'[()]')
level = 0
opening = 0
for match in pattern.finditer(sql, startpos):
par = match.group()
if par == '(':
if level == 0:
opening = match.start()
level += 1
if par == ')':
assert level > 0
level -= 1
if level == 0:
closing = match.end()
return opening, closing
def transform_except_subselect(sql, func):
"""Call a func on every part of SOQL query except nested (SELECT ...)"""
start = 0
out = []
while sql.find('(SELECT', start) > -1:
pos = sql.find('(SELECT', start)
out.append(func(sql[start:pos]))
start, pos = find_closing_parenthesis(sql, pos)
out.append(sql[start:pos])
start = pos
out.append(func(sql[start:len(sql)]))
return ''.join(out)
class TestSubSelectSearch(TestCase):
def test_parenthesis(self):
self.assertEqual(find_closing_parenthesis('() (() (())) ()', 0), (0, 2))
self.assertEqual(find_closing_parenthesis('() (() (())) ()', 2), (3, 12))
self.assertEqual(find_closing_parenthesis('() (() (())) ()', 3), (3, 12))
self.assertEqual(find_closing_parenthesis('() (() (())) ()', 6), (7, 11))
self.assertEqual(find_closing_parenthesis('() (() (())) ()',13), (13,15))
self.assertRaises(AssertionError, find_closing_parenthesis, '() (() (())) ()',1)
def test_subselect(self):
sql = "SELECT a, (SELECT x FROM y) FROM b WHERE (c IN (SELECT p FROM q WHERE r = %s) AND c = %s)"
func = lambda sql: '*transfomed*'
expected = "*transfomed*(SELECT x FROM y)*transfomed*(SELECT p FROM q WHERE r = %s)*transfomed*"
self.assertEqual(transform_except_subselect(sql, func), expected)
def test_nested_subselect(self):
sql = "SELECT a, (SELECT x, (SELECT p FROM q) FROM y) FROM b"
func = lambda x: '*transfomed*'
expected = "*transfomed*(SELECT x, (SELECT p FROM q) FROM y)*transfomed*"
self.assertEqual(transform_except_subselect(sql, func), expected)
class ReplaceQuotedStringsTest(TestCase):
def test_subst_quoted_strings(self):
def inner(sql, expected):
result = mark_quoted_strings(sql)
self.assertEqual(result, expected)<|fim▁hole|> inner("a'bc'd", ("a@d", ['bc']))
inner(r"a'bc\\'d", ("a@d", ['bc\\']))
inner(r"a'\'\\'b''''", ("a@b@@", ['\'\\', '', '']))
self.assertRaises(AssertionError, mark_quoted_strings, r"a'bc'\\d")
self.assertRaises(AssertionError, mark_quoted_strings, "a'bc''d")<|fim▁end|> | self.assertEqual(subst_quoted_strings(*result), sql)
inner("where x=''", ("where x=@", [''])) |
<|file_name|>menu.cpp<|end_file_name|><|fim▁begin|>#include "core/bomberman.hpp"
#include "core/menu.hpp"
#include "core/screens.hpp"
#include "core/view.hpp"
#include "core/views/menu.hpp"
MenuView::MenuView(Screen *screen, Menu *menu)
: View(screen)
, menu(menu)
, clock(Timer::get(2))
{
}
MenuView::~MenuView()
{
delete this->menu;
}
void MenuView::update(const Events &events)
{
Vec2u pos(events.touch.x, events.touch.y);
if (events.touch.isTouch && this->clock.current() > 10000)
{
this->clock.reset();
this->menu->onClick(pos);
}
}
void MenuView::render()
{
swiWaitForVBlank();
dmaCopy(this->menu->bgSrc, bgGetGfxPtr(this->getScreen().bg), this->menu->bgSize);
}
void MenuView::setMenu(Menu *menu)
{
if (menu != nullptr)
{
menu->setView(this);
}
Menu *old = this->menu;
Bomberman::getInstance().nextTick([old]() {
delete old;<|fim▁hole|>Menu &MenuView::getMenu()
{
return *this->menu;
}
const Menu &MenuView::getMenu() const
{
return *this->menu;
}<|fim▁end|> | });
this->menu = menu;
}
|
<|file_name|>test_edax.py<|end_file_name|><|fim▁begin|>import gc
import hashlib
import os
import os.path
import tempfile
import zipfile
import numpy as np
import pytest
import requests
from hyperspy import signals
from hyperspy.io import load
MY_PATH = os.path.dirname(__file__)
ZIPF = os.path.join(MY_PATH, "edax_files.zip")
TMP_DIR = tempfile.TemporaryDirectory()
TEST_FILES_OK = os.path.isfile(ZIPF)
REASON = ""
SHA256SUM = "e217c71efbd208da4b52e9cf483443f9da2175f2924a96447ed393086fe32008"
# The test files are not included in HyperSpy v1.4 because their file size is 36.5MB
# taking the HyperSpy source distribution file size above PyPI's 60MB limit.
# As a temporary solution, we attempt to download the test files from GitHub
# and skip the tests if the download fails.
if not TEST_FILES_OK:
try:
r = requests.get(
"https://github.com/hyperspy/hyperspy/blob/e7a323a3bb9b237c24bd9267d2cc4fcb31bb99f3/hyperspy/tests/io/edax_files.zip?raw=true")
SHA256SUM_GOT = hashlib.sha256(r.content).hexdigest()
if SHA256SUM_GOT == SHA256SUM:
with open(ZIPF, 'wb') as f:
f.write(r.content)
TEST_FILES_OK = True
else:
REASON = "wrong sha256sum of downloaded file. Expected: %s, got: %s" % SHA256SUM, SHA256SUM_GOT
except BaseException as e:
REASON = "download of EDAX test files failed: %s" % e
def setup_module():
if TEST_FILES_OK:
with zipfile.ZipFile(ZIPF, 'r') as zipped:
zipped.extractall(TMP_DIR.name)
pytestmark = pytest.mark.skipif(not TEST_FILES_OK,
reason=REASON)
def teardown_module():
TMP_DIR.cleanup()
class TestSpcSpectrum_v061_xrf:
@classmethod
def setup_class(cls):
cls.spc = load(os.path.join(TMP_DIR.name, "spc0_61-ipr333_xrf.spc"))
cls.spc_loadAll = load(os.path.join(TMP_DIR.name,
"spc0_61-ipr333_xrf.spc"),
load_all_spc=True)
@classmethod
def teardown_class(cls):
del cls.spc, cls.spc_loadAll
gc.collect()
def test_data(self):
# test datatype
assert np.uint32 == TestSpcSpectrum_v061_xrf.spc.data.dtype
# test data shape
assert (4000,) == TestSpcSpectrum_v061_xrf.spc.data.shape
# test 40 datapoints
assert (
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 319, 504, 639, 924,
1081, 1326, 1470, 1727, 1983, 2123, 2278, 2509, 2586, 2639,
2681, 2833, 2696, 2704, 2812, 2745, 2709, 2647, 2608, 2620,
2571, 2669] == TestSpcSpectrum_v061_xrf.spc.data[:40].tolist())
def test_parameters(self):
elements = TestSpcSpectrum_v061_xrf.spc.metadata.as_dictionary()[
'Sample']['elements']
sem_dict = TestSpcSpectrum_v061_xrf.spc.metadata.as_dictionary()[
'Acquisition_instrument']['SEM'] # this will eventually need to
# be changed when XRF-specific
# features are added
eds_dict = sem_dict['Detector']['EDS']
signal_dict = TestSpcSpectrum_v061_xrf.spc.metadata.as_dictionary()[
'Signal']
# Testing SEM parameters
np.testing.assert_allclose(30, sem_dict['beam_energy'])
np.testing.assert_allclose(0, sem_dict['Stage']['tilt_alpha'])
# Testing EDS parameters
np.testing.assert_allclose(45, eds_dict['azimuth_angle'])
np.testing.assert_allclose(35, eds_dict['elevation_angle'])
np.testing.assert_allclose(137.92946, eds_dict['energy_resolution_MnKa'],
atol=1E-5)
np.testing.assert_allclose(2561.0, eds_dict['live_time'], atol=1E-6)
# Testing elements
assert ({'Al', 'Ca', 'Cl', 'Cr', 'Fe', 'K', 'Mg', 'Mn', 'Si', 'Y'} ==
set(elements))
# Testing HyperSpy parameters
assert 'EDS_SEM' == signal_dict['signal_type']
assert isinstance(TestSpcSpectrum_v061_xrf.spc, signals.EDSSEMSpectrum)
def test_axes(self):
spc_ax_manager = {'axis-0': {'_type': 'UniformDataAxis',
'name': 'Energy',
'navigate': False,
'is_binned': True,
'offset': 0.0,
'scale': 0.01,
'size': 4000,
'units': 'keV'}}
assert (spc_ax_manager ==
TestSpcSpectrum_v061_xrf.spc.axes_manager.as_dictionary())
def test_load_all_spc(self):
spc_header = TestSpcSpectrum_v061_xrf.spc_loadAll.original_metadata[
'spc_header']
np.testing.assert_allclose(4, spc_header['analysisType'])
np.testing.assert_allclose(4, spc_header['analyzerType'])
np.testing.assert_allclose(2013, spc_header['collectDateYear'])
np.testing.assert_allclose(9, spc_header['collectDateMon'])
np.testing.assert_allclose(26, spc_header['collectDateDay'])
np.testing.assert_equal(b'Garnet1.', spc_header['fileName'].view('|S8')[0])
np.testing.assert_allclose(45, spc_header['xRayTubeZ'])
class TestSpcSpectrum_v070_eds:
@classmethod
def setup_class(cls):
cls.spc = load(os.path.join(TMP_DIR.name, "single_spect.spc"))
cls.spc_loadAll = load(os.path.join(TMP_DIR.name,
"single_spect.spc"),
load_all_spc=True)
@classmethod
def teardown_class(cls):
del cls.spc, cls.spc_loadAll
gc.collect()
def test_data(self):
# test datatype
assert np.uint32 == TestSpcSpectrum_v070_eds.spc.data.dtype
# test data shape
assert (4096,) == TestSpcSpectrum_v070_eds.spc.data.shape
# test 1st 20 datapoints
assert (
[0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 10, 4, 10, 10, 45, 87, 146, 236,
312, 342] == TestSpcSpectrum_v070_eds.spc.data[:20].tolist())
def test_parameters(self):
elements = TestSpcSpectrum_v070_eds.spc.metadata.as_dictionary()[
'Sample']['elements']
sem_dict = TestSpcSpectrum_v070_eds.spc.metadata.as_dictionary()[
'Acquisition_instrument']['SEM']
eds_dict = sem_dict['Detector']['EDS']
signal_dict = TestSpcSpectrum_v070_eds.spc.metadata.as_dictionary()[
'Signal']
# Testing SEM parameters
np.testing.assert_allclose(22, sem_dict['beam_energy'])
np.testing.assert_allclose(0, sem_dict['Stage']['tilt_alpha'])
# Testing EDS parameters
np.testing.assert_allclose(0, eds_dict['azimuth_angle'])
np.testing.assert_allclose(34, eds_dict['elevation_angle'])
np.testing.assert_allclose(129.31299, eds_dict['energy_resolution_MnKa'],
atol=1E-5)
np.testing.assert_allclose(50.000004, eds_dict['live_time'], atol=1E-6)
# Testing elements
assert ({'Al', 'C', 'Ce', 'Cu', 'F', 'Ho', 'Mg', 'O'} ==
set(elements))
# Testing HyperSpy parameters
assert 'EDS_SEM' == signal_dict['signal_type']
assert isinstance(TestSpcSpectrum_v070_eds.spc, signals.EDSSEMSpectrum)
def test_axes(self):
spc_ax_manager = {'axis-0': {'_type': 'UniformDataAxis',
'name': 'Energy',
'navigate': False,
'is_binned': True,
'offset': 0.0,
'scale': 0.01,
'size': 4096,
'units': 'keV'}}
assert (spc_ax_manager ==
TestSpcSpectrum_v070_eds.spc.axes_manager.as_dictionary())
def test_load_all_spc(self):
spc_header = TestSpcSpectrum_v070_eds.spc_loadAll.original_metadata[
'spc_header']
np.testing.assert_allclose(4, spc_header['analysisType'])
np.testing.assert_allclose(5, spc_header['analyzerType'])
np.testing.assert_allclose(2016, spc_header['collectDateYear'])
np.testing.assert_allclose(4, spc_header['collectDateMon'])
np.testing.assert_allclose(19, spc_header['collectDateDay'])
np.testing.assert_equal(b'C:\\ProgramData\\EDAX\\jtaillon\\Cole\\Mapping\\Lsm\\'
b'GFdCr\\950\\Area 1\\spectrum20160419153851427_0.spc',
spc_header['longFileName'].view('|S256')[0])
np.testing.assert_allclose(0, spc_header['xRayTubeZ'])
class TestSpdMap_070_eds:
@classmethod
def setup_class(cls):
cls.spd = load(os.path.join(TMP_DIR.name, "spd_map.spd"),
convert_units=True)
@classmethod
def teardown_class(cls):
del cls.spd
gc.collect()
def test_data(self):
# test d_type
assert np.uint16 == TestSpdMap_070_eds.spd.data.dtype
# test d_shape
assert (200, 256, 2500) == TestSpdMap_070_eds.spd.data.shape
assert ([[[0, 0, 0, 0, 0], # test random data
[0, 0, 1, 0, 1],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]],
[[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]],
[[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 1],
[0, 1, 1, 0, 0],
[0, 0, 0, 0, 0]],
[[0, 1, 0, 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 0]],
[[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 1, 0, 1],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 0]]] ==
TestSpdMap_070_eds.spd.data[15:20, 15:20, 15:20].tolist())
def test_parameters(self):
elements = TestSpdMap_070_eds.spd.metadata.as_dictionary()[<|fim▁hole|> eds_dict = sem_dict['Detector']['EDS']
signal_dict = TestSpdMap_070_eds.spd.metadata.as_dictionary()['Signal']
# Testing SEM parameters
np.testing.assert_allclose(22, sem_dict['beam_energy'])
np.testing.assert_allclose(0, sem_dict['Stage']['tilt_alpha'])
# Testing EDS parameters
np.testing.assert_allclose(0, eds_dict['azimuth_angle'])
np.testing.assert_allclose(34, eds_dict['elevation_angle'])
np.testing.assert_allclose(126.60252, eds_dict['energy_resolution_MnKa'],
atol=1E-5)
np.testing.assert_allclose(2621.4399, eds_dict['live_time'], atol=1E-4)
# Testing elements
assert {'Ce', 'Co', 'Cr', 'Fe', 'Gd', 'La', 'Mg', 'O',
'Sr'} == set(elements)
# Testing HyperSpy parameters
assert 'EDS_SEM' == signal_dict['signal_type']
assert isinstance(TestSpdMap_070_eds.spd, signals.EDSSEMSpectrum)
def test_axes(self):
spd_ax_manager = {'axis-0': {'_type': 'UniformDataAxis',
'name': 'y',
'navigate': True,
'is_binned': False,
'offset': 0.0,
'scale': 14.227345585823057,
'size': 200,
'units': 'nm'},
'axis-1': {'_type': 'UniformDataAxis',
'name': 'x',
'navigate': True,
'is_binned': False,
'offset': 0.0,
'scale': 14.235896058380602,
'size': 256,
'units': 'nm'},
'axis-2': {'_type': 'UniformDataAxis',
'name': 'Energy',
'navigate': False,
'is_binned': True,
'offset': 0.0,
'scale': 0.0050000000000000001,
'size': 2500,
'units': 'keV'}}
assert (spd_ax_manager ==
TestSpdMap_070_eds.spd.axes_manager.as_dictionary())
def test_ipr_reading(self):
ipr_header = TestSpdMap_070_eds.spd.original_metadata['ipr_header']
np.testing.assert_allclose(0.014235896, ipr_header['mppX'])
np.testing.assert_allclose(0.014227346, ipr_header['mppY'])
def test_spc_reading(self):
# Test to make sure that spc metadata matches spd metadata
spc_header = TestSpdMap_070_eds.spd.original_metadata['spc_header']
elements = TestSpdMap_070_eds.spd.metadata.as_dictionary()[
'Sample']['elements']
sem_dict = TestSpdMap_070_eds.spd.metadata.as_dictionary()[
'Acquisition_instrument']['SEM']
eds_dict = sem_dict['Detector']['EDS']
np.testing.assert_allclose(spc_header.azimuth,
eds_dict['azimuth_angle'])
np.testing.assert_allclose(spc_header.detReso,
eds_dict['energy_resolution_MnKa'])
np.testing.assert_allclose(spc_header.elevation,
eds_dict['elevation_angle'])
np.testing.assert_allclose(spc_header.liveTime,
eds_dict['live_time'])
np.testing.assert_allclose(spc_header.evPerChan,
TestSpdMap_070_eds.spd.axes_manager[2].scale * 1000)
np.testing.assert_allclose(spc_header.kV,
sem_dict['beam_energy'])
np.testing.assert_allclose(spc_header.numElem,
len(elements))
class TestSpdMap_061_xrf:
@classmethod
def setup_class(cls):
cls.spd = load(os.path.join(TMP_DIR.name, "spc0_61-ipr333_xrf.spd"),
convert_units=True)
@classmethod
def teardown_class(cls):
del cls.spd
gc.collect()
def test_data(self):
# test d_type
assert np.uint16 == TestSpdMap_061_xrf.spd.data.dtype
# test d_shape
assert (200, 256, 2000) == TestSpdMap_061_xrf.spd.data.shape
assert ([[[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 1, 0]],
[[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]],
[[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 1]],
[[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 1]],
[[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]]] ==
TestSpdMap_061_xrf.spd.data[15:20, 15:20, 15:20].tolist())
def test_parameters(self):
elements = TestSpdMap_061_xrf.spd.metadata.as_dictionary()['Sample'][
'elements']
sem_dict = TestSpdMap_061_xrf.spd.metadata.as_dictionary()[
'Acquisition_instrument']['SEM']
eds_dict = sem_dict['Detector']['EDS']
signal_dict = TestSpdMap_061_xrf.spd.metadata.as_dictionary()['Signal']
# Testing SEM parameters
np.testing.assert_allclose(30, sem_dict['beam_energy'])
np.testing.assert_allclose(0, sem_dict['Stage']['tilt_alpha'])
# Testing EDS parameters
np.testing.assert_allclose(45, eds_dict['azimuth_angle'])
np.testing.assert_allclose(35, eds_dict['elevation_angle'])
np.testing.assert_allclose(137.92946, eds_dict['energy_resolution_MnKa'],
atol=1E-5)
np.testing.assert_allclose(2561.0, eds_dict['live_time'], atol=1E-4)
# Testing elements
assert {'Al', 'Ca', 'Cl', 'Cr', 'Fe', 'K', 'Mg', 'Mn', 'Si',
'Y'} == set(elements)
# Testing HyperSpy parameters
assert 'EDS_SEM' == signal_dict['signal_type']
assert isinstance(TestSpdMap_061_xrf.spd, signals.EDSSEMSpectrum)
def test_axes(self):
spd_ax_manager = {'axis-0': {'_type': 'UniformDataAxis',
'name': 'y',
'navigate': True,
'is_binned': False,
'offset': 0.0,
'scale': 0.5651920166015625,
'size': 200,
'units': 'mm'},
'axis-1': {'_type': 'UniformDataAxis',
'name': 'x',
'navigate': True,
'is_binned': False,
'offset': 0.0,
'scale': 0.5651920166015625,
'size': 256,
'units': 'mm'},
'axis-2': {'_type': 'UniformDataAxis',
'name': 'Energy',
'navigate': False,
'is_binned': True,
'offset': 0.0,
'scale': 0.01,
'size': 2000,
'units': 'keV'}}
assert (spd_ax_manager ==
TestSpdMap_061_xrf.spd.axes_manager.as_dictionary())
def test_ipr_reading(self):
ipr_header = TestSpdMap_061_xrf.spd.original_metadata['ipr_header']
np.testing.assert_allclose(565.1920166015625, ipr_header['mppX'])
np.testing.assert_allclose(565.1920166015625, ipr_header['mppY'])
def test_spc_reading(self):
# Test to make sure that spc metadata matches spd_061_xrf metadata
spc_header = TestSpdMap_061_xrf.spd.original_metadata['spc_header']
elements = TestSpdMap_061_xrf.spd.metadata.as_dictionary()['Sample'][
'elements']
sem_dict = TestSpdMap_061_xrf.spd.metadata.as_dictionary()[
'Acquisition_instrument']['SEM']
eds_dict = sem_dict['Detector']['EDS']
np.testing.assert_allclose(spc_header.azimuth,
eds_dict['azimuth_angle'])
np.testing.assert_allclose(spc_header.detReso,
eds_dict['energy_resolution_MnKa'])
np.testing.assert_allclose(spc_header.elevation,
eds_dict['elevation_angle'])
np.testing.assert_allclose(spc_header.liveTime,
eds_dict['live_time'])
np.testing.assert_allclose(spc_header.evPerChan,
TestSpdMap_061_xrf.spd.axes_manager[2].scale * 1000)
np.testing.assert_allclose(spc_header.kV,
sem_dict['beam_energy'])
np.testing.assert_allclose(spc_header.numElem,
len(elements))<|fim▁end|> | 'Sample']['elements']
sem_dict = TestSpdMap_070_eds.spd.metadata.as_dictionary()[
'Acquisition_instrument']['SEM'] |
<|file_name|>resolveExportDeclaration.ts<|end_file_name|><|fim▁begin|>import { namedTypes as t } from 'ast-types';
import resolveToValue from './resolveToValue';
import type { Importer } from '../parse';
import type { NodePath } from 'ast-types/lib/node-path';
export default function resolveExportDeclaration(
path: NodePath,
importer: Importer,
): NodePath[] {
const definitions: NodePath[] = [];<|fim▁hole|> path
.get('declaration', 'declarations')
.each(declarator => definitions.push(declarator));
} else {
definitions.push(path.get('declaration'));
}
} else if (path.node.specifiers) {
path
.get('specifiers')
.each(specifier => definitions.push(specifier.get('local')));
}
return definitions.map(definition => resolveToValue(definition, importer));
}<|fim▁end|> | if (path.node.default) {
definitions.push(path.get('declaration'));
} else if (path.node.declaration) {
if (t.VariableDeclaration.check(path.node.declaration)) { |
<|file_name|>fields.py<|end_file_name|><|fim▁begin|>import re
from django.db.models import fields
from django.template.defaultfilters import slugify
def _unique_slugify(instance, value, slug_field_name='slug', queryset=None, slug_separator='-'):
slug_field = instance._meta.get_field(slug_field_name)
slug_len = slug_field.max_length
# Sort out the initial slug. Chop its length down if we need to.
slug = slugify(value)
if slug_len:
slug = slug[:slug_len]
slug = _slug_strip(slug, slug_separator)
original_slug = slug
# Create a queryset, excluding the current instance.
if queryset is None:
queryset = instance.__class__._default_manager.all()
if instance.pk:
queryset = queryset.exclude(pk=instance.pk)
# Find a unique slug. If one matches, at '-2' to the end and try again
# (then '-3', etc).
next = 2
while not slug or queryset.filter(**{slug_field_name: slug}):
slug = original_slug
end = '-%s' % next
if slug_len and len(slug) + len(end) > slug_len:
slug = slug[:slug_len-len(end)]
slug = _slug_strip(slug, slug_separator)<|fim▁hole|> setattr(instance, slug_field.attname, slug)
return slug
def _slug_strip(value, separator=None):
"""
Cleans up a slug by removing slug separator characters that occur at the
beginning or end of a slug.
If an alternate separator is used, it will also replace any instances of the
default '-' separator with the new separator.
"""
if separator == '-' or not separator:
re_sep = '-'
else:
re_sep = '(?:-|%s)' % re.escape(separator)
value = re.sub('%s+' % re_sep, separator, value)
return re.sub(r'^%s+|%s+$' % (re_sep, re_sep), '', value)
class AutoSlugField(fields.SlugField):
"""Auto slug field, creates unique slug for model."""
def __init__(self, prepopulate_from, *args, **kwargs):
"""Create auto slug field.
If field is unique, the uniqueness of the slug is ensured from existing
slugs by adding extra number at the end of slug.
If field has slug given, it is used instead. If you want to re-generate
the slug, just set it :const:`None` or :const:`""` so it will be re-
generated automatically.
:param prepopulate_from: Must be assigned to list of field names which
are used to prepopulate automatically.
:type prepopulate_from: sequence
"""
self.prepopulate_separator = kwargs.get("prepopulate_separator", u"-")
self.prepopulate_from = prepopulate_from
kwargs["blank"] = True
super(fields.SlugField, self).__init__(*args, **kwargs)
def pre_save(self, model_instance, add): #@UnusedVariable
"""Pre-save event"""
current_slug = getattr(model_instance, self.attname)
# Use current slug instead, if it is given.
# Assumption: There are no empty slugs.
if not (current_slug is None or current_slug == ""):
slug = current_slug
else:
slug = self.prepopulate_separator.\
join(unicode(getattr(model_instance, prepop))
for prepop in self.prepopulate_from)
if self.unique:
return _unique_slugify(model_instance, value=slug,
slug_field_name=self.attname)
else:
return slugify(slug)[:self.max_length]<|fim▁end|> | slug = '%s%s' % (slug, end)
next += 1
|
<|file_name|>library_spec.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2014 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
var should = require("should");
var request = require('supertest');
var express = require('express');
var when = require('when');
var app = express();
var RED = require("../../../red/red.js");
var storage = require("../../../red/storage");
var library = require("../../../red/api/library");
describe("library api", function() {
function initStorage(_flows,_libraryEntries) {
var flows = _flows;
var libraryEntries = _libraryEntries;
storage.init({
storageModule: {
init: function() {
return when.resolve();
},
getAllFlows: function() {
return when.resolve(flows);
},
getFlow: function(fn) {
if (flows[fn]) {
return when.resolve(flows[fn]);
} else {
return when.reject();
}
},
saveFlow: function(fn,data) {
flows[fn] = data;
return when.resolve();
},
getLibraryEntry: function(type,path) {
if (libraryEntries[type] && libraryEntries[type][path]) {
return when.resolve(libraryEntries[type][path]);
} else {
return when.reject();
}
},
saveLibraryEntry: function(type,path,meta,body) {
libraryEntries[type][path] = body;
return when.resolve();
}
}
});
}
describe("flows", function() {
var app;
before(function() {
app = express();
app.use(express.json());
app.get("/library/flows",library.getAll);
app.post(new RegExp("/library/flows\/(.*)"),library.post);
app.get(new RegExp("/library/flows\/(.*)"),library.get);
});
it('returns empty result', function(done) {
initStorage({});
request(app)
.get('/library/flows')
.expect(200)
.end(function(err,res) {
if (err) {
throw err;
}
res.body.should.not.have.property('f');
res.body.should.not.have.property('d');
done();
});
});
it('returns 404 for non-existent entry', function(done) {
initStorage({});
request(app)
.get('/library/flows/foo')
.expect(404)
.end(done);
});
it('can store and retrieve item', function(done) {
initStorage({});
var flow = '[]';
request(app)
.post('/library/flows/foo')
.set('Content-Type', 'application/json')
.send(flow)
.expect(204).end(function (err, res) {
if (err) {
throw err;
}
request(app)
.get('/library/flows/foo')
.expect(200)
.end(function(err,res) {
if (err) {
throw err;
}
res.text.should.equal(flow);
done();
});
});
});
it('lists a stored item', function(done) {
initStorage({f:["bar"]});
request(app)
.get('/library/flows')
.expect(200)
.end(function(err,res) {
if (err) {
throw err;
}
res.body.should.have.property('f');
should.deepEqual(res.body.f,['bar']);
done();
});
});
it('returns 403 for malicious get attempt', function(done) {
initStorage({});
// without the userDir override the malicious url would be
// http://127.0.0.1:1880/library/flows/../../package to
// obtain package.json from the node-red root.
request(app)
.get('/library/flows/../../../../../package')
.expect(403)
.end(done);
});
it('returns 403 for malicious post attempt', function(done) {
initStorage({});
// without the userDir override the malicious url would be
// http://127.0.0.1:1880/library/flows/../../package to
// obtain package.json from the node-red root.
request(app)
.post('/library/flows/../../../../../package')
.expect(403)
.end(done);
});
});
describe("type", function() {
var app;
before(function() {
app = express();
app.use(express.json());
library.init(app);
RED.library.register("test");
});
it('returns empty result', function(done) {
initStorage({},{'test':{"":[]}});
request(app)
.get('/library/test')
.expect(200)
.end(function(err,res) {
if (err) {
throw err;
}
res.body.should.not.have.property('f');
done();
});
});
it('returns 404 for non-existent entry', function(done) {
initStorage({},{});
request(app)
.get('/library/test/foo')
.expect(404)
.end(done);
});
it('can store and retrieve item', function(done) {
initStorage({},{'test':{}});
var flow = '[]';
request(app)
.post('/library/test/foo')
.set('Content-Type', 'text/plain')
.send(flow)
.expect(204).end(function (err, res) {
if (err) {
throw err;
}
request(app)
.get('/library/test/foo')
.expect(200)
.end(function(err,res) {
if (err) {
throw err;
}
res.text.should.equal(flow);
done();
});
});
});
<|fim▁hole|> it('lists a stored item', function(done) {
initStorage({},{'test':{'':['abc','def']}});
request(app)
.get('/library/test')
.expect(200)
.end(function(err,res) {
if (err) {
throw err;
}
// This response isn't strictly accurate - but it
// verifies the api returns what storage gave it
should.deepEqual(res.body,['abc','def']);
done();
});
});
it('returns 403 for malicious access attempt', function(done) {
request(app)
.get('/library/test/../../../../../../../../../../etc/passwd')
.expect(403)
.end(done);
});
it('returns 403 for malicious access attempt', function(done) {
request(app)
.get('/library/test/..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\etc\\passwd')
.expect(403)
.end(done);
});
it('returns 403 for malicious access attempt', function(done) {
request(app)
.post('/library/test/../../../../../../../../../../etc/passwd')
.set('Content-Type', 'text/plain')
.send('root:x:0:0:root:/root:/usr/bin/tclsh')
.expect(403)
.end(done);
});
});
});<|fim▁end|> | |
<|file_name|>genericitesource0.rs<|end_file_name|><|fim▁begin|>// A est un type concret.
struct A;
// Lorsque nous déclarons `Single`, la première occurrence de `A` n'est
// pas précédée du type générique `<A>`. Le type `Single` et `A` sont donc
// concrets.
struct Single(A);
// ^ Voici la première occurrence du type `A`.
// En revanche, ici, `<T>` précède la première occurrence `T`, donc le type
// `SingleGen` est générique. Puisque le type `T` est générique, cela pourrait être
// "n'importe quoi", y compris le type concret `A` déclaré au début du fichier.
struct SingleGen<T>(T);
fn main() {
// `Single` est un type concret et prend explicitement un paramètre
// de type `A`.
let _s = Single(A);
// On créé une variable nommée `_char` de type `SingleGen<char>`
// et on lui assigne la valeur `SingleGen('a')`.
// Le type requis du paramètre passé pour cette instance de `SingleGen` <|fim▁hole|> // --->
let _t = SingleGen(A); // On passe une instance
// du type `A` définit en haut.
let _i32 = SingleGen(6); // On passe un entier de type `i32`.
let _char = SingleGen('a'); // On passe un `char`.
}<|fim▁end|> | // est spécifié, mais il peut être omis, exemple ---
let _char: SingleGen<char> = SingleGen('a');
|
<|file_name|>edit_modes.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.<|fim▁hole|>// Management Agent API
//
// API for Management Agent Cloud Service
//
package managementagent
// EditModesEnum Enum with underlying type: string
type EditModesEnum string
// Set of constants representing the allowable values for EditModesEnum
const (
EditModesReadOnly EditModesEnum = "READ_ONLY"
EditModesWritable EditModesEnum = "WRITABLE"
EditModesExtensible EditModesEnum = "EXTENSIBLE"
)
var mappingEditModes = map[string]EditModesEnum{
"READ_ONLY": EditModesReadOnly,
"WRITABLE": EditModesWritable,
"EXTENSIBLE": EditModesExtensible,
}
// GetEditModesEnumValues Enumerates the set of values for EditModesEnum
func GetEditModesEnumValues() []EditModesEnum {
values := make([]EditModesEnum, 0)
for _, v := range mappingEditModes {
values = append(values, v)
}
return values
}<|fim▁end|> | // Code generated. DO NOT EDIT.
|
<|file_name|>instantsearch.js<|end_file_name|><|fim▁begin|>// Read the Docs
// http://readthedocs.org/
// Searching as the user types.
(function(){
// Save a reference to the global object.
var root = this;
// Global Search object on which public functions can be added
var Search;
Search = root.Search = {};
// for instituting a delay between keypresses and searches
var timer = null;
var delay = 250;
var lastQuery = null;
var useApi = false;
// Check if the browser supports history manipulation so
// we can change the URL upon instant searches
var replaceStateSupported = (typeof history.replaceState === "function");
// queue of current requests
var xhr = [];
var $input, $button, $results, $title, $selected_facets = null;
function init() {
$input = $('#id_site_search_2');
$button = $('#id_search_button');
$results = $("#id_search_result");
$title = $("#id_search_title");
$selected_facets = $("#id_selected_facets");
// minimum requirements for this script to kick in...
if(!$input.length || !$results.length) {
return false;
} else {
lastQuery = queryString()
bind();
}
}
Search.init = init;
// Setup the bindings for clicking search or keypresses
function bind() {
// Set a delay so not _every_ keystroke sends a search
$input.keyup(function(ev) {
// Don't do anything unless the query has changed
if(lastQuery == queryString()) {
return;
}
if(timer) {
clearTimeout(timer);
}
timer = setTimeout("Search.run()", delay);
});
$button.click(Search.run);
}
// Abort all existing XHR requests, since a new search is starting
function abortCurrentXHR() {
var request = xhr.pop();
while(request) {
request.abort();
request = xhr.pop();
}
}
// Replace the search results HTML with `html` (string)
function replaceResults(html) {
$results.empty();
$results.append(html);
$title.html(getTitle());
$results.show();
}
// Construct the results HTML
// TODO: Use a template!
function buildHTML(results) {
var html = [];
for (var i=0; i<results.length; i++) {
html.push([
'<li class="module-item">',
'<p class="module-item-title">',
'File: <a href="', results[i].absolute_url,
'?highlight=', $("#id_site_search_2").val(), '">',
results[i].project.name,
" - ", results[i].name, "</a>",
"</p>",
"<p>", results[i].text, "</p>",
"</li>"].join('')
);
}
return html.join('');
}
// Pop the last search off the queue and render the `results`
function onResultsReceived(results) {
// remove the request from the queue
xhr.pop();
lastQuery = queryString()
replaceResults(buildHTML(results));
replaceState();
$("#id_remove_facets").attr('href', removeFacetsUrl());
}
// Replace the URL with the one corresponding to the current search
function replaceState() {
if(!replaceStateSupported) {
return;
}
var url = "/search/project/?" + queryString();
var title = getTitle() + ' | Read the Docs';
window.history.replaceState({}, title, url);
}
// Page title
function getTitle() {
return "Results for " + $("#id_site_search_2").val();
}<|fim▁hole|> var data = {
q: getKeywords(),
}
var selected_facets = $selected_facets.val() || ''
if(selected_facets) {
data['selected_facets'] = selected_facets;
}
return data;
}
// e.g. q=my+search&selected_facets=project_exact:Read%20The%20Docs
function queryString() {
return jQuery.param(getSearchData());
}
// The active query value
function getKeywords() {
return $input.val()
}
// Url for the current query with any facet filters removed
function removeFacetsUrl() {
return '?' + jQuery.param({q: getKeywords()});
}
// Perform the ajax request to get the search results from the API
function run(ev) {
if(ev) {
ev.preventDefault();
}
abortCurrentXHR();
// Don't do anything if there is no query
if(getKeywords() == '') {
$results.empty();
$results.hide();
$title.html("No search term entered");
return;
}
var data = getSearchData();
if(useApi) {
apiSearch(data);
} else {
htmlSearch(data);
}
}
Search.run = run;
// TODO: The api search is incomplete. It doesn't take into account
// facets nor pagination. It's a partial implemenation.
function apiSearch(data) {
xhr.push(jQuery.ajax({
type: 'GET',
url: "/api/v1/file/search/",
data: data,
dataType: 'jsonp',
success: function(res, text, xhqr) {
onResultsReceived(res.objects);
}
}));
}
// Alternative search implementation not using the API.
function htmlSearch(data) {
xhr.push(jQuery.ajax({
type: 'GET',
url: "/search/project/",
data: data,
success: function(res, text, xhqr) {
onHtmlReceived(res);
}
}));
}
// Alternative implementation not using the API. Receives
// the full HTML including title, pagination, facets, etc.
function onHtmlReceived(html) {
xhr.pop(); // remove the request from the queue
lastQuery = queryString()
$("#search_module").replaceWith(html);
replaceState();
}
}).call(this);<|fim▁end|> |
// Params used in the search
function getSearchData() { |
<|file_name|>WorkSpacePreferenceReader.java<|end_file_name|><|fim▁begin|>package view.menuBar.workspace;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import javax.swing.JOptionPane;
import view.Constants;
import view.ViewController;
/**
* Class that reads in workspace preference files
*
* @author Lalita Maraj
* @author Susan Zhang
*
*/
public class WorkSpacePreferenceReader {
private ViewController myController;
public WorkSpacePreferenceReader (ViewController controller) {
myController = controller;
}
public void loadPreferences (File prefFile) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(prefFile));
String sCurrentLine = br.readLine();
if (!sCurrentLine.equals("preferences")) {
JOptionPane.showMessageDialog(null, Constants.WRONG_PREF_FILE_MESSAGE);
}
while ((sCurrentLine = br.readLine()) != null) {
String[] s = sCurrentLine.split(" ");
if (s[0].equals(Constants.BACKGROUND_KEYWORD) && s.length == Constants.COLOR_LINE_LENGTH) {
myController.setBGColor(Integer.parseInt(s[1]));
setPalette(s[1], s[2], s[3], s[4]);
}
if (s[0].equals(Constants.PEN_KEYWORD) && s.length == Constants.COLOR_LINE_LENGTH) {
myController.setPenColor(Integer.parseInt(s[1]));
setPalette(s[1], s[2], s[3], s[4]);
}
if (s[0].equals(Constants.IMAGE_KEYWORD) && s[1] != null) {
myController.changeImage(Integer.parseInt(s[1]));
}
}
br.close();
}
<|fim▁hole|>}<|fim▁end|> | private void setPalette(String index, String r, String g, String b){
myController.setPalette(Integer.parseInt(index), Integer.parseInt(r), Integer.parseInt(g), Integer.parseInt(b));
}
|
<|file_name|>timestamp.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>/**
* @param scheduler
* @return {Observable<Timestamp<any>>|WebSocketSubject<T>|Observable<T>}
* @method timestamp
* @owner Observable
*/
export function timestamp<T>(this: Observable<T>, scheduler: SchedulerLike = async): Observable<Timestamp<T>> {
return higherOrder(scheduler)(this) as Observable<Timestamp<T>>;
}<|fim▁end|> | import { Observable } from '../../Observable';
import { SchedulerLike } from '../../types';
import { async } from '../../scheduler/async';
import { timestamp as higherOrder, Timestamp } from '../../operators/timestamp'; |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##############################################
#
# This module contains some utilities
#
##############################################
class argpasser(object):
"""
ComEst use the arguments that are almost repeatedly. Therefore, it will be useful to create a customized arguemnt passer like this.
"""
def __init__(self,
stamp_size_arcsec = 20.0,
mag_dict = {"lo":20.0, "hi":25.0 },
hlr_dict = {"lo":0.35, "hi":0.75 },
fbulge_dict = {"lo":0.5 , "hi":0.9 },
q_dict = {"lo":0.4 , "hi":1.0 },
pos_ang_dict = {"lo":0.0 , "hi":180.0},
ngals_arcmin2 = 15.0,
nsimimages = 50,
ncpu = 2,
):
"""
:param stamp_size_arcsec: The size of the stamp of each simulated source by **GalSim**. The stamp is with the size of ``stamp_size_arcsec`` x ``stamp_size_arcsec`` (``stamp_size_arcsec`` in arcsec) where the **GalSim** will simulate one single source on. By default, it is ``stamp_size_arcsec = 15.0``.
:param mag_dict: The magnitude range which **GalSim** will simulate sources. It must be in the form of ``{"lo": _value_, "hi": _value_}``, where _value_ is expressed in magnitude. By default, it is ``mag_dict = {"lo":20.0, "hi":25.0 }``.
:param hlr_dict: The half light radius configuration of the sources simulated by **GalSim**. It is in the unit of arcsec. It has to be in the form of ``{"lo": _value_, "high": _value_}``. By default, it is ``hlr_dict = {"lo":0.35 , "hi":0.75 }``.
:param fbulge_dict: The configuration of the fraction of the bulge component. It must be in the form of ``{"lo": _value_, "high": _value_}``. Note that the _value_ has to be within [0,1] and 1 means the galaxy has zero fraction of light from the disk component. By default, it is ``fbulge_dict = {"lo":0.5 , "hi":0.9 }``.
:param q_dict: The minor-to-major axis ratio configuration of the sources simulated by **GalSim**. It must be in the form of ``{"lo": _value_, "high": _value_}``. Note that the _value_ has to be within [0,1] and ``q = 1`` means spherical. By default, it is ``q_dict = {"lo":0.4 , "hi":1.0 }``.
:param pos_ang_dict: The position angle configuration of the sources simulated by **GalSim**. It is in the unit of degree. It must be in the form of ``{"lo": _value_, "high": _value_}``. Note that the _value_ has to be within [0,180.0] and it is counter-clockwise with +x is 0 degree. By default, it is ``pos_ang_dict={"lo":0.0 , "hi":180.0 }``.
:param ngals_arcmin2: The projected number of the sources simulated by **GalSim** per arcmin square. You dont want to set this number too high because it will cause the problem from blending in the source detection. However, you dont want to lose the statistic power if you set this number too low. By defualt, it is ``ngals_arcmin2 = 15.0``.
:param nsimimages: The number of the images you want to simulate. It will be saved in the multi-extension file with the code name ``sims_nameroot``. By default, it is ``nsimimages = 50``.
:param ncpu: The number of cpu for parallel running. By default, it is ``ncpu = 2``. Please do not set this number higher than the CPU cores you have.
"""
self.stamp_size_arcsec = float(stamp_size_arcsec)
self.mag_dict = mag_dict
self.hlr_dict = hlr_dict
self.fbulge_dict = fbulge_dict
self.q_dict = q_dict
self.pos_ang_dict = pos_ang_dict
self.ngals_arcmin2 = float(ngals_arcmin2)<|fim▁hole|> self.nsimimages = int(nsimimages)
self.ncpu = int(ncpu)
return
# i_am function
def i_am(self):
"""
"""
print "#", "stamp_size_arcsec:", self.stamp_size_arcsec
print "#", "mag_dict:", self.mag_dict
print "#", "hlr_dict:", self.hlr_dict
print "#", "fbulge_dict:", self.fbulge_dict
print "#", "q_dict:", self.q_dict
print "#", "pos_ang_dict:", self.pos_ang_dict
print "#", "ngals_arcmin2:", self.ngals_arcmin2
print "#", "nsimimages:", self.nsimimages
print "#", "ncpu:", self.ncpu
return<|fim▁end|> | |
<|file_name|>file.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package bigquery
import (
"io"
bq "google.golang.org/api/bigquery/v2"
)
// A ReaderSource is a source for a load operation that gets
// data from an io.Reader.
//
// When a ReaderSource is part of a LoadConfig obtained via Job.Config,
// its internal io.Reader will be nil, so it cannot be used for a
// subsequent load operation.
type ReaderSource struct {
r io.Reader
FileConfig
}
// NewReaderSource creates a ReaderSource from an io.Reader. You may
// optionally configure properties on the ReaderSource that describe the
// data being read, before passing it to Table.LoaderFrom.
func NewReaderSource(r io.Reader) *ReaderSource {
return &ReaderSource{r: r}
}
func (r *ReaderSource) populateLoadConfig(lc *bq.JobConfigurationLoad) io.Reader {
r.FileConfig.populateLoadConfig(lc)
return r.r
}
// FileConfig contains configuration options that pertain to files, typically
// text files that require interpretation to be used as a BigQuery table. A
// file may live in Google Cloud Storage (see GCSReference), or it may be
// loaded into a table via the Table.LoaderFromReader.
type FileConfig struct {
// SourceFormat is the format of the data to be read.
// Allowed values are: Avro, CSV, DatastoreBackup, JSON, ORC, and Parquet. The default is CSV.
SourceFormat DataFormat
// Indicates if we should automatically infer the options and
// schema for CSV and JSON sources.
AutoDetect bool
// MaxBadRecords is the maximum number of bad records that will be ignored
// when reading data.
MaxBadRecords int64
// IgnoreUnknownValues causes values not matching the schema to be
// tolerated. Unknown values are ignored. For CSV this ignores extra values
// at the end of a line. For JSON this ignores named values that do not
// match any column name. If this field is not set, records containing
// unknown values are treated as bad records. The MaxBadRecords field can
// be used to customize how bad records are handled.
IgnoreUnknownValues bool
// Schema describes the data. It is required when reading CSV or JSON data,
// unless the data is being loaded into a table that already exists.
Schema Schema
// Additional options for CSV files.
CSVOptions
}
func (fc *FileConfig) populateLoadConfig(conf *bq.JobConfigurationLoad) {
conf.SkipLeadingRows = fc.SkipLeadingRows
conf.SourceFormat = string(fc.SourceFormat)
conf.Autodetect = fc.AutoDetect
conf.AllowJaggedRows = fc.AllowJaggedRows
conf.AllowQuotedNewlines = fc.AllowQuotedNewlines
conf.Encoding = string(fc.Encoding)
conf.FieldDelimiter = fc.FieldDelimiter
conf.IgnoreUnknownValues = fc.IgnoreUnknownValues
conf.MaxBadRecords = fc.MaxBadRecords
if fc.Schema != nil {
conf.Schema = fc.Schema.toBQ()
}
conf.Quote = fc.quote()
}
func bqPopulateFileConfig(conf *bq.JobConfigurationLoad, fc *FileConfig) {
fc.SourceFormat = DataFormat(conf.SourceFormat)
fc.AutoDetect = conf.Autodetect
fc.MaxBadRecords = conf.MaxBadRecords
fc.IgnoreUnknownValues = conf.IgnoreUnknownValues
fc.Schema = bqToSchema(conf.Schema)
fc.SkipLeadingRows = conf.SkipLeadingRows
fc.AllowJaggedRows = conf.AllowJaggedRows
fc.AllowQuotedNewlines = conf.AllowQuotedNewlines
fc.Encoding = Encoding(conf.Encoding)
fc.FieldDelimiter = conf.FieldDelimiter
fc.CSVOptions.setQuote(conf.Quote)
}
func (fc *FileConfig) populateExternalDataConfig(conf *bq.ExternalDataConfiguration) {
format := fc.SourceFormat
if format == "" {
// Format must be explicitly set for external data sources.
format = CSV
}
conf.Autodetect = fc.AutoDetect
conf.IgnoreUnknownValues = fc.IgnoreUnknownValues
conf.MaxBadRecords = fc.MaxBadRecords
conf.SourceFormat = string(format)
if fc.Schema != nil {
conf.Schema = fc.Schema.toBQ()
}
if format == CSV {
fc.CSVOptions.populateExternalDataConfig(conf)
}
}
// Encoding specifies the character encoding of data to be loaded into BigQuery.
// See https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load.encoding
// for more details about how this is used.
type Encoding string<|fim▁hole|> ISO_8859_1 Encoding = "ISO-8859-1"
)<|fim▁end|> |
const (
UTF_8 Encoding = "UTF-8" |
<|file_name|>error_plot.py<|end_file_name|><|fim▁begin|>import numpy as np
import matplotlib.pyplot as plt
__all__ = ('error_plot',)
def error_plot(network, logx=False, ax=None, show=True):
""" Makes line plot that shows training progress. x-axis<|fim▁hole|>
Parameters
----------
logx : bool
Parameter set up logarithmic scale to x-axis.
Defaults to ``False``.
ax : object or None
Matplotlib axis object. ``None`` values means that axis equal
to the current one (the same as ``ax = plt.gca()``).
Defaults to ``None``.
show : bool
If parameter is equal to ``True`` plot will instantly shows
the plot. Defaults to ``True``.
Returns
-------
object
Matplotlib axis instance.
"""
if ax is None:
ax = plt.gca()
if not network.errors:
network.logs.warning("There is no data to plot")
return ax
train_errors = network.errors.normalized()
validation_errors = network.validation_errors.normalized()
if len(train_errors) != len(validation_errors):
network.logs.warning("Number of train and validation errors are "
"not the same. Ignored validation errors.")
validation_errors = []
if all(np.isnan(validation_errors)):
validation_errors = []
errors_range = np.arange(len(train_errors))
plot_function = ax.semilogx if logx else ax.plot
line_error_in, = plot_function(errors_range, train_errors)
if validation_errors:
line_error_out, = plot_function(errors_range, validation_errors)
ax.legend(
[line_error_in, line_error_out],
['Train', 'Validation']
)
ax.set_title('Training perfomance')
ax.set_ylim(bottom=0)
ax.set_ylabel('Error')
ax.set_xlabel('Epoch')
if show:
plt.show()
return ax<|fim▁end|> | is an epoch number and y-axis is an error. |
<|file_name|>shortcuts.py<|end_file_name|><|fim▁begin|>"""OpenAPI core validation request shortcuts module"""
from functools import partial
from openapi_core.validation.request.validators import RequestBodyValidator
from openapi_core.validation.request.validators import (
RequestParametersValidator,
)<|fim▁hole|>
def validate_request(validator, request):
result = validator.validate(request)
result.raise_for_errors()
return result
def spec_validate_request(
spec,
request,
request_factory=None,
validator_class=RequestValidator,
result_attribute=None,
):
if request_factory is not None:
request = request_factory(request)
validator = validator_class(spec)
result = validator.validate(request)
result.raise_for_errors()
if result_attribute is None:
return result
return getattr(result, result_attribute)
spec_validate_parameters = partial(
spec_validate_request,
validator_class=RequestParametersValidator,
result_attribute="parameters",
)
spec_validate_body = partial(
spec_validate_request,
validator_class=RequestBodyValidator,
result_attribute="body",
)
spec_validate_security = partial(
spec_validate_request,
validator_class=RequestSecurityValidator,
result_attribute="security",
)<|fim▁end|> | from openapi_core.validation.request.validators import RequestSecurityValidator
from openapi_core.validation.request.validators import RequestValidator
|
<|file_name|>watch.go<|end_file_name|><|fim▁begin|>// Copyright © 2019 Oxford Nanopore Technologies.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package cmd
import (
"encoding/csv"
"fmt"
"math"
"os"
"runtime"
"strconv"
"time"
"github.com/bsipos/thist"
"github.com/shenwei356/xopen"
"github.com/spf13/cobra"
)
// watchCmd represents the seq command
var watchCmd = &cobra.Command{
Use: "watch",
Short: "monitor the specified fields",
Long: "monitor the specified fields",
Run: func(cmd *cobra.Command, args []string) {
config := getConfigs(cmd)
files := getFileListFromArgsAndFile(cmd, args, true, "infile-list", true)
runtime.GOMAXPROCS(config.NumCPUs)
printField := getFlagString(cmd, "field")
printPdf := getFlagString(cmd, "image")
printFreq := getFlagInt(cmd, "print-freq")
printDump := getFlagBool(cmd, "dump")
printLog := getFlagBool(cmd, "log")
printQuiet := getFlagBool(cmd, "quiet")
printDelay := getFlagInt(cmd, "delay")
printReset := getFlagBool(cmd, "reset")
if printDelay < 0 {
printDelay = 0
}
printBins := getFlagInt(cmd, "bins")
printPass := getFlagBool(cmd, "pass")
if printFreq > 0 {
config.ChunkSize = printFreq
}
if config.Tabs {
config.OutDelimiter = rune('\t')
}
outfh, err := xopen.Wopen(config.OutFile)
checkError(err)
defer outfh.Close()
writer := csv.NewWriter(outfh)
if config.OutTabs || config.Tabs {
if config.OutDelimiter == ',' {
writer.Comma = '\t'
} else {
writer.Comma = config.OutDelimiter
}
} else {
writer.Comma = config.OutDelimiter
}
binMode := "termfit"
if printBins > 0 {
binMode = "fixed"
}
h := thist.NewHist([]float64{}, printField, binMode, printBins, true)
transform := func(x float64) float64 { return x }
if printLog {
transform = func(x float64) float64 {
return math.Log10(x + 1)
}
}
field2col := make(map[string]int)
var col int
if config.NoHeaderRow {
if len(printField) == 0 {
checkError(fmt.Errorf("flag -f (--field) needed"))
}
pcol, err := strconv.Atoi(printField)
if err != nil {
checkError(fmt.Errorf("illegal field number: %s", printField))
}
col = pcol - 1
if col < 0 {
checkError(fmt.Errorf("illegal field number: %d", pcol))
}
}
if printField == "" {
checkError(fmt.Errorf("flag -f (--field) needed"))
}
var count int
var i int
var p float64
for _, file := range files {
csvReader, err := newCSVReaderByConfig(config, file)
checkError(err)
csvReader.Run()
isHeaderLine := !config.NoHeaderRow
checkField := true
for chunk := range csvReader.Ch {
checkError(chunk.Err)
for _, record := range chunk.Data {
if isHeaderLine {
for i, column := range record {
field2col[column] = i
}
isHeaderLine = false
if printPass {
checkError(writer.Write(record))
}
continue
} // header
i = col
if !config.NoHeaderRow {
var ok bool
i, ok = field2col[printField]
if !ok {
checkError(fmt.Errorf("invalid field specified: %s", printField))
}
} else if checkField {
if i > len(record) {
checkError(fmt.Errorf(`field (%d) out of range (%d) in file: %s`, i+1, len(record), file))
}
checkField = false
}
p, err = strconv.ParseFloat(record[i], 64)
if err == nil {
count++
h.Update(transform(p))
if printPass {
checkError(writer.Write(record))
}
} else {
continue
}
if printFreq > 0 && count%printFreq == 0 {<|fim▁hole|> } else {
if !printQuiet {
os.Stderr.Write([]byte(thist.ClearScreenString()))
os.Stderr.Write([]byte(h.Draw()))
}
if printPdf != "" {
h.SaveImage(printPdf)
}
}
outfh.Flush()
if printReset {
h = thist.NewHist([]float64{}, printField, binMode, printBins, true)
}
time.Sleep(time.Duration(printDelay) * time.Second)
}
} // record
} //chunk
} //file
if printFreq < 0 || count%printFreq != 0 {
if printDump {
os.Stderr.Write([]byte(h.Dump()))
} else {
if !printQuiet {
os.Stderr.Write([]byte(thist.ClearScreenString()))
os.Stderr.Write([]byte(h.Draw()))
}
}
outfh.Flush()
if printPdf != "" {
h.SaveImage(printPdf)
}
}
},
}
func init() {
RootCmd.AddCommand(watchCmd)
watchCmd.Flags().StringP("field", "f", "", "field to watch")
watchCmd.Flags().IntP("print-freq", "p", -1, "print/report after this many records (-1 for print after EOF)")
watchCmd.Flags().StringP("image", "O", "", "save histogram to this PDF/image file")
watchCmd.Flags().IntP("delay", "W", 1, "sleep this many seconds after plotting")
watchCmd.Flags().IntP("bins", "B", -1, "number of histogram bins")
watchCmd.Flags().BoolP("dump", "y", false, "print histogram data to stderr instead of plotting")
watchCmd.Flags().BoolP("log", "L", false, "log10(x+1) transform numeric values")
watchCmd.Flags().BoolP("reset", "R", false, "reset histogram after every report")
watchCmd.Flags().BoolP("pass", "x", false, "passthrough mode (forward input to output)")
watchCmd.Flags().BoolP("quiet", "Q", false, "supress all plotting to stderr")
}<|fim▁end|> | if printDump {
os.Stderr.Write([]byte(h.Dump())) |
<|file_name|>token_encryption_algorithm.py<|end_file_name|><|fim▁begin|>def token_encryption_algorithm():<|fim▁hole|><|fim▁end|> | return 'HS256' |
<|file_name|>volume.py<|end_file_name|><|fim▁begin|>import numpy as np
from scipy import sparse
from . import Mapper
from . import samplers
class VolumeMapper(Mapper):
@classmethod
def _cache(cls, filename, subject, xfmname, **kwargs):
from .. import db
masks = []
xfm = db.get_xfm(subject, xfmname, xfmtype='coord')
pia = db.get_surf(subject, "pia", merge=False, nudge=False)
wm = db.get_surf(subject, "wm", merge=False, nudge=False)
#iterate over hemispheres
for (wpts, polys), (ppts, _) in zip(pia, wm):
masks.append(cls._getmask(xfm(ppts), xfm(wpts), polys, xfm.shape, **kwargs))
_savecache(filename, masks[0], masks[1], xfm.shape)
return cls(masks[0], masks[1], xfm.shape, subject, xfmname)
@classmethod
def _getmask(cls, pia, wm, polys, shape, **kwargs):
from .. import mp
rand = np.random.rand(npts, 3)
csrshape = len(wm), np.prod(shape)
def func(pts):
if len(pts) > 0:
#generate points within the bounding box
samples = rand * (pts.max(0) - pts.min(0)) + pts.min(0)
#check which points are inside the polyhedron
inside = polyutils.inside_convex_poly(pts)(samples)
return cls._sample(samples[inside], shape, np.sum(inside))
surf = polyutils.Surface(pia, polys)
samples = mp.map(func, surf.polyconvex(wm))
#samples = map(func, surf.polyconvex(wm)) ## For debugging
ij, data = [], []
for i, sample in enumerate(samples):
if sample is not None:
idx = np.zeros((2, len(sample[0])))
idx[0], idx[1] = i, sample[0]
ij.append(idx)
data.append(sample[1])
return sparse.csr_matrix((np.hstack(data), np.hstack(ij)), shape=csrshape)
class PolyConstMapper(VolumeMapper):
patchsize = 0.5
class PolyLinMapper(VolumeMapper):
patchsize = 1
class Polyhedral(VolumeMapper):
'''Uses an actual (likely concave) polyhedra betwen the pial and white surfaces
to estimate the thickness'''
@staticmethod
def _getmask(pia, wm, polys, shape):
from .. import polyutils
mask = sparse.csr_matrix((len(wm), np.prod(shape)))
from tvtk.api import tvtk
measure = tvtk.MassProperties()
planes = tvtk.PlaneCollection()
for norm in np.vstack([-np.eye(3), np.eye(3)]):
planes.append(tvtk.Plane(normal=norm))
ccs = tvtk.ClipClosedSurface(clipping_planes=planes)
feats = tvtk.FeatureEdges(boundary_edges=1, non_manifold_edges=0, manifold_edges=0, feature_edges=0)
feats.set_input(ccs.output)
surf = polyutils.Surface(pia, polys)
for i, (pts, faces) in enumerate(surf.polyhedra(wm)):
if len(pts) > 0:
poly = tvtk.PolyData(points=pts, polys=faces)
measure.set_input(poly)
measure.update()
totalvol = measure.volume
ccs.set_input(poly)
measure.set_input(ccs.output)
bmin = pts.min(0).round().astype(int)
bmax = (pts.max(0).round() + 1).astype(int)
vidx = np.mgrid[bmin[0]:bmax[0], bmin[1]:bmax[1], bmin[2]:bmax[2]]
for vox in vidx.reshape(3, -1).T:
try:
idx = np.ravel_multi_index(vox[::-1], shape)
for plane, m in zip(planes, [.5, .5, .5, -.5, -.5, -.5]):
plane.origin = vox+m
ccs.update()
if ccs.output.number_of_cells > 2:
measure.update()
mask[i, idx] = measure.volume
except ValueError:
print('Voxel not in volume: (%d, %d, %d)'%tuple(vox))
mask.data[mask.indptr[i]:mask.indptr[i+1]] /= mask[i].sum()
return mask
class ConvexPolyhedra(VolumeMapper):
@classmethod
def _getmask(cls, pia, wm, polys, shape, npts=1024):
from .. import mp<|fim▁hole|> from .. import polyutils
rand = np.random.rand(npts, 3)
csrshape = len(wm), np.prod(shape)
def func(pts):
if len(pts) > 0:
#generate points within the bounding box
samples = rand * (pts.max(0) - pts.min(0)) + pts.min(0)
#check which points are inside the polyhedron
inside = polyutils.inside_convex_poly(pts)(samples)
return cls._sample(samples[inside], shape, np.sum(inside))
surf = polyutils.Surface(pia, polys)
samples = mp.map(func, surf.polyconvex(wm))
#samples = map(func, surf.polyconvex(wm)) ## For debugging
ij, data = [], []
for i, sample in enumerate(samples):
if sample is not None:
idx = np.zeros((2, len(sample[0])))
idx[0], idx[1] = i, sample[0]
ij.append(idx)
data.append(sample[1])
return sparse.csr_matrix((np.hstack(data), np.hstack(ij)), shape=csrshape)
class ConvexNN(VolumeMapper):
@staticmethod
def _sample(pts, shape, norm):
coords = pts.round().astype(int)[:,::-1]
d1 = np.logical_and(0 <= coords[:,0], coords[:,0] < shape[0])
d2 = np.logical_and(0 <= coords[:,1], coords[:,1] < shape[1])
d3 = np.logical_and(0 <= coords[:,2], coords[:,2] < shape[2])
valid = np.logical_and(d1, np.logical_and(d2, d3))
if valid.any():
idx = np.ravel_multi_index(coords[valid].T, shape)
j, data = np.array(Counter(idx).items()).T
return j, data / float(norm)
class ConvexTrilin(VolumeMapper):
@staticmethod
def _sample(pts, shape, norm):
(x, y, z), floor = np.modf(pts.T)
floor = floor.astype(int)
ceil = floor + 1
x[x < 0] = 0
y[y < 0] = 0
z[z < 0] = 0
i000 = np.ravel_multi_index((floor[2], floor[1], floor[0]), shape, mode='clip')
i100 = np.ravel_multi_index((floor[2], floor[1], ceil[0]), shape, mode='clip')
i010 = np.ravel_multi_index((floor[2], ceil[1], floor[0]), shape, mode='clip')
i001 = np.ravel_multi_index(( ceil[2], floor[1], floor[0]), shape, mode='clip')
i101 = np.ravel_multi_index(( ceil[2], floor[1], ceil[0]), shape, mode='clip')
i011 = np.ravel_multi_index(( ceil[2], ceil[1], floor[0]), shape, mode='clip')
i110 = np.ravel_multi_index((floor[2], ceil[1], ceil[0]), shape, mode='clip')
i111 = np.ravel_multi_index(( ceil[2], ceil[1], ceil[0]), shape, mode='clip')
v000 = (1-x)*(1-y)*(1-z)
v100 = x*(1-y)*(1-z)
v010 = (1-x)*y*(1-z)
v110 = x*y*(1-z)
v001 = (1-x)*(1-y)*z
v101 = x*(1-y)*z
v011 = (1-x)*y*z
v111 = x*y*z
allj = np.vstack([i000, i100, i010, i001, i101, i011, i110, i111]).T.ravel()
data = np.vstack([v000, v100, v010, v001, v101, v011, v110, v111]).T.ravel()
uniquej = np.unique(allj)
uniquejdata = np.array([data[allj==j].sum() for j in uniquej])
return uniquej, uniquejdata / float(norm)
class ConvexLanczos(VolumeMapper):
def _sample(self, pts):
raise NotImplementedError<|fim▁end|> | |
<|file_name|>outer_lib.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | def this_is_the_outer_lib():
print 'For imports test' |
<|file_name|>test_utils.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
#![doc(hidden)]
#[cfg(test)]
use std::thread;
#[cfg(test)]
use std::time::Duration;
use crate::virtio::block::device::FileEngineType;
#[cfg(test)]
use crate::virtio::block::io::FileEngine;
#[cfg(test)]
use crate::virtio::IrqType;
use crate::virtio::{Block, CacheType, Queue};
use rate_limiter::RateLimiter;
use utils::kernel_version::{min_kernel_version_for_io_uring, KernelVersion};
use utils::tempfile::TempFile;
/// Create a default Block instance to be used in tests.
pub fn default_block(file_engine_type: FileEngineType) -> Block {
// Create backing file.
let f = TempFile::new().unwrap();
f.as_file().set_len(0x1000).unwrap();
default_block_with_path(f.as_path().to_str().unwrap().to_string(), file_engine_type)
}
/// Return the Async FileEngineType if supported by the host, otherwise default to Sync.
pub fn default_engine_type_for_kv() -> FileEngineType {
if KernelVersion::get().unwrap() >= min_kernel_version_for_io_uring() {
FileEngineType::Async
} else {
FileEngineType::Sync
}
}
/// Create a default Block instance using file at the specified path to be used in tests.
pub fn default_block_with_path(path: String, file_engine_type: FileEngineType) -> Block {
// Rate limiting is enabled but with a high operation rate (10 million ops/s).
let rate_limiter = RateLimiter::new(0, 0, 0, 100_000, 0, 10).unwrap();
let id = "test".to_string();
// The default block device is read-write and non-root.
Block::new(
id,
None,
CacheType::Unsafe,
path,
false,
false,
rate_limiter,
file_engine_type,
)
.unwrap()
}
pub fn set_queue(blk: &mut Block, idx: usize, q: Queue) {
blk.queues[idx] = q;
}
pub fn set_rate_limiter(blk: &mut Block, rl: RateLimiter) {
blk.rate_limiter = rl;
}
pub fn rate_limiter(blk: &mut Block) -> &RateLimiter {
&blk.rate_limiter<|fim▁hole|>pub fn simulate_queue_event(b: &mut Block, maybe_expected_irq: Option<bool>) {
// Trigger the queue event.
b.queue_evts[0].write(1).unwrap();
// Handle event.
b.process_queue_event();
// Validate the queue operation finished successfully.
if let Some(expected_irq) = maybe_expected_irq {
assert_eq!(b.irq_trigger.has_pending_irq(IrqType::Vring), expected_irq);
}
}
#[cfg(test)]
pub fn simulate_async_completion_event(b: &mut Block, expected_irq: bool) {
if let FileEngine::Async(engine) = b.disk.file_engine_mut() {
// Wait for all the async operations to complete.
engine.drain(false).unwrap();
// Wait for the async completion event to be sent.
thread::sleep(Duration::from_millis(150));
// Handle event.
b.process_async_completion_event();
}
// Validate if there are pending IRQs.
assert_eq!(b.irq_trigger.has_pending_irq(IrqType::Vring), expected_irq);
}
#[cfg(test)]
pub fn simulate_queue_and_async_completion_events(b: &mut Block, expected_irq: bool) {
match b.disk.file_engine_mut() {
FileEngine::Async(_) => {
simulate_queue_event(b, None);
simulate_async_completion_event(b, expected_irq);
}
FileEngine::Sync(_) => {
simulate_queue_event(b, Some(expected_irq));
}
}
}<|fim▁end|> | }
#[cfg(test)] |
<|file_name|>comment.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from .base import BaseModel
<|fim▁hole|> # Add created and updated attrs by default.
self.created = self.updated = datetime.now()
super().__init__(**kwargs)
def update(self):
""" Extends update method to update some fields before saving. """
self.updated = datetime.now()
super().update()<|fim▁end|> | class Comment(BaseModel):
def __init__(self, **kwargs): |
<|file_name|>messages.ts<|end_file_name|><|fim▁begin|>export function noProject(project: string) {
return `Unable to find project '${project}' in the workspace`;
}
<|fim▁hole|> return `Project style file found has unsupported extension: '${styleFilePath}'\nAdding 'bootstrap.min.css' to 'angular.json'`;
}<|fim▁end|> | export function unsupportedStyles(styleFilePath: string) { |
<|file_name|>markdown_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from hyputils.memex.util import markdown
class TestRender(object):
def test_it_renders_markdown(self):
actual = markdown.render("_emphasis_ **bold**")
assert "<p><em>emphasis</em> <strong>bold</strong></p>\n" == actual
def test_it_ignores_math_block(self):
actual = markdown.render("$$1 + 1 = 2$$")
assert "<p>$$1 + 1 = 2$$</p>\n" == actual
def test_it_ignores_inline_match(self):
actual = markdown.render(r"Foobar \(1 + 1 = 2\)")<|fim▁hole|> assert "<p>Foobar \\(1 + 1 = 2\\)</p>\n" == actual
def test_it_sanitizes_the_output(self, markdown_render, sanitize):
markdown.render("foobar")
sanitize.assert_called_once_with(markdown_render.return_value)
@pytest.fixture
def markdown_render(self, patch):
return patch("hyputils.memex.util.markdown.markdown")
@pytest.fixture
def sanitize(self, patch):
return patch("hyputils.memex.util.markdown.sanitize")
class TestSanitize(object):
@pytest.mark.parametrize(
"text,expected",
[
(
'<a href="https://example.org">example</a>',
'<a href="https://example.org" rel="nofollow noopener" target="_blank">example</a>',
),
# Don't add rel and target attrs to mailto: links
('<a href="mailto:[email protected]">example</a>', None),
('<a title="foobar">example</a>', None),
(
'<a href="https://example.org" rel="nofollow noopener" target="_blank" title="foobar">example</a>',
None,
),
("<blockquote>Foobar</blockquote>", None),
("<code>foobar</code>", None),
("<em>foobar</em>", None),
("<hr>", None),
("<h1>foobar</h1>", None),
("<h2>foobar</h2>", None),
("<h3>foobar</h3>", None),
("<h4>foobar</h4>", None),
("<h5>foobar</h5>", None),
("<h6>foobar</h6>", None),
('<img src="http://example.com/img.jpg">', None),
('<img src="/img.jpg">', None),
('<img alt="foobar" src="/img.jpg">', None),
('<img src="/img.jpg" title="foobar">', None),
('<img alt="hello" src="/img.jpg" title="foobar">', None),
("<ol><li>foobar</li></ol>", None),
("<p>foobar</p>", None),
("<pre>foobar</pre>", None),
("<strong>foobar</strong>", None),
("<ul><li>foobar</li></ul>", None),
],
)
def test_it_allows_markdown_html(self, text, expected):
if expected is None:
expected = text
assert markdown.sanitize(text) == expected
@pytest.mark.parametrize(
"text,expected",
[
("<script>evil()</script>", "<script>evil()</script>"),
(
'<a href="#" onclick="evil()">foobar</a>',
'<a href="#" rel="nofollow noopener" target="_blank">foobar</a>',
),
(
'<a href="#" onclick=evil()>foobar</a>',
'<a href="#" rel="nofollow noopener" target="_blank">foobar</a>',
),
("<a href=\"javascript:alert('evil')\">foobar</a>", "<a>foobar</a>"),
('<img src="/evil.jpg" onclick="evil()">', '<img src="/evil.jpg">'),
("<img src=\"javascript:alert('evil')\">", "<img>"),
],
)
def test_it_escapes_evil_html(self, text, expected):
assert markdown.sanitize(text) == expected
def test_it_adds_target_blank_and_rel_nofollow_to_links(self):
actual = markdown.sanitize('<a href="https://example.org">Hello</a>')
expected = '<a href="https://example.org" rel="nofollow noopener" target="_blank">Hello</a>'
assert actual == expected<|fim▁end|> | |
<|file_name|>permute.py<|end_file_name|><|fim▁begin|># File permute.py
def permute1(seq):
if not seq: # Shuffle any sequence: list
return [seq] # Empty sequence
else:
res = []
for i in range(len(seq)):
rest = seq[:i] + seq[i+1:] # Delete current node
for x in permute1(rest): # Permute the others
res.append(seq[i:i+1] + x) # Add node at front
return res
<|fim▁hole|> if not seq: # Shuffle any sequence: generator
yield seq # Empty sequence
else:
for i in range(len(seq)):
rest = seq[:i] + seq[i+1:] # Delete current node
for x in permute2(rest): # Permute the others
yield seq[i:i+1] + x # Add node at front<|fim▁end|> | def permute2(seq): |
<|file_name|>AVSwitch.py<|end_file_name|><|fim▁begin|>from config import config, ConfigSlider, ConfigSelection, ConfigYesNo, \
ConfigEnableDisable, ConfigSubsection, ConfigBoolean, ConfigSelectionNumber, ConfigNothing, NoSave
from enigma import eAVSwitch, getDesktop
from SystemInfo import SystemInfo
from os import path as os_path
class AVSwitch:
def setInput(self, input):
INPUT = { "ENCODER": 0, "SCART": 1, "AUX": 2 }<|fim▁hole|> def setColorFormat(self, value):
eAVSwitch.getInstance().setColorFormat(value)
def setAspectRatio(self, value):
eAVSwitch.getInstance().setAspectRatio(value)
def setSystem(self, value):
eAVSwitch.getInstance().setVideomode(value)
def getOutputAspect(self):
valstr = config.av.aspectratio.value
if valstr in ("4_3_letterbox", "4_3_panscan"): # 4:3
return (4,3)
elif valstr == "16_9": # auto ... 4:3 or 16:9
try:
aspect_str = open("/proc/stb/vmpeg/0/aspect", "r").read()
if aspect_str == "1": # 4:3
return (4,3)
except IOError:
pass
elif valstr in ("16_9_always", "16_9_letterbox"): # 16:9
pass
elif valstr in ("16_10_letterbox", "16_10_panscan"): # 16:10
return (16,10)
return (16,9)
def getFramebufferScale(self):
aspect = self.getOutputAspect()
fb_size = getDesktop(0).size()
return (aspect[0] * fb_size.height(), aspect[1] * fb_size.width())
def getAspectRatioSetting(self):
valstr = config.av.aspectratio.value
if valstr == "4_3_letterbox":
val = 0
elif valstr == "4_3_panscan":
val = 1
elif valstr == "16_9":
val = 2
elif valstr == "16_9_always":
val = 3
elif valstr == "16_10_letterbox":
val = 4
elif valstr == "16_10_panscan":
val = 5
elif valstr == "16_9_letterbox":
val = 6
return val
def setAspectWSS(self, aspect=None):
if not config.av.wss.value:
value = 2 # auto(4:3_off)
else:
value = 1 # auto
eAVSwitch.getInstance().setWSS(value)
def InitAVSwitch():
config.av = ConfigSubsection()
config.av.yuvenabled = ConfigBoolean(default=False)
colorformat_choices = {"cvbs": _("CVBS"), "rgb": _("RGB"), "svideo": _("S-Video")}
# when YUV is not enabled, don't let the user select it
if config.av.yuvenabled.value:
colorformat_choices["yuv"] = _("YPbPr")
# ikseong
config.av.colorformat = ConfigSelection(choices=colorformat_choices, default="cvbs")
config.av.aspectratio = ConfigSelection(choices={
"4_3_letterbox": _("4:3 Letterbox"),
"4_3_panscan": _("4:3 PanScan"),
"16_9": _("16:9"),
"16_9_always": _("16:9 always"),
"16_10_letterbox": _("16:10 Letterbox"),
"16_10_panscan": _("16:10 PanScan"),
"16_9_letterbox": _("16:9 Letterbox")},
default = "4_3_letterbox")
config.av.aspect = ConfigSelection(choices={
"4_3": _("4:3"),
"16_9": _("16:9"),
"16_10": _("16:10"),
"auto": _("Automatic")},
default = "auto")
config.av.policy_169 = ConfigSelection(choices={
# TRANSLATORS: (aspect ratio policy: black bars on top/bottom) in doubt, keep english term.
"letterbox": _("Letterbox"),
# TRANSLATORS: (aspect ratio policy: cropped content on left/right) in doubt, keep english term
"panscan": _("Pan&Scan"),
# TRANSLATORS: (aspect ratio policy: display as fullscreen, even if this breaks the aspect)
"scale": _("Just Scale")},
default = "letterbox")
config.av.policy_43 = ConfigSelection(choices={
# TRANSLATORS: (aspect ratio policy: black bars on left/right) in doubt, keep english term.
"pillarbox": _("Pillarbox"),
# TRANSLATORS: (aspect ratio policy: cropped content on left/right) in doubt, keep english term
"panscan": _("Pan&Scan"),
# TRANSLATORS: (aspect ratio policy: display as fullscreen, with stretching the left/right)
"nonlinear": _("Nonlinear"),
# TRANSLATORS: (aspect ratio policy: display as fullscreen, even if this breaks the aspect)
"scale": _("Just Scale")},
default = "pillarbox")
config.av.tvsystem = ConfigSelection(choices = {"pal": _("PAL"), "ntsc": _("NTSC"), "multinorm": _("multinorm")}, default="pal")
config.av.wss = ConfigEnableDisable(default = True)
config.av.defaultac3 = ConfigYesNo(default = False)
config.av.generalAC3delay = ConfigSelectionNumber(-1000, 1000, 25, default = 0)
config.av.generalPCMdelay = ConfigSelectionNumber(-1000, 1000, 25, default = 0)
config.av.vcrswitch = ConfigEnableDisable(default = False)
iAVSwitch = AVSwitch()
def setColorFormat(configElement):
map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3}
iAVSwitch.setColorFormat(map[configElement.value])
def setAspectRatio(configElement):
map = {"4_3_letterbox": 0, "4_3_panscan": 1, "16_9": 2, "16_9_always": 3, "16_10_letterbox": 4, "16_10_panscan": 5, "16_9_letterbox" : 6}
iAVSwitch.setAspectRatio(map[configElement.value])
def setSystem(configElement):
map = {"pal": 0, "ntsc": 1, "multinorm" : 2}
iAVSwitch.setSystem(map[configElement.value])
def setWSS(configElement):
iAVSwitch.setAspectWSS()
# this will call the "setup-val" initial
config.av.colorformat.addNotifier(setColorFormat)
config.av.aspectratio.addNotifier(setAspectRatio)
config.av.tvsystem.addNotifier(setSystem)
config.av.wss.addNotifier(setWSS)
iAVSwitch.setInput("ENCODER") # init on startup
SystemInfo["ScartSwitch"] = eAVSwitch.getInstance().haveScartSwitch()
try:
can_downmix = open("/proc/stb/audio/ac3_choices", "r").read()[:-1].find("downmix") != -1
except:
can_downmix = False
SystemInfo["CanDownmixAC3"] = can_downmix
if can_downmix:
def setAC3Downmix(configElement):
open("/proc/stb/audio/ac3", "w").write(configElement.value and "downmix" or "passthrough")
config.av.downmix_ac3 = ConfigYesNo(default = True)
config.av.downmix_ac3.addNotifier(setAC3Downmix)
try:
can_downmix_aac = open("/proc/stb/audio/aac_choices", "r").read()[:-1].find("downmix") != -1
except:
can_downmix_aac = False
SystemInfo["CanDownmixAAC"] = can_downmix_aac
if can_downmix_aac:
def setAACDownmix(configElement):
open("/proc/stb/audio/aac", "w").write(configElement.value and "downmix" or "passthrough")
config.av.downmix_aac = ConfigYesNo(default = True)
config.av.downmix_aac.addNotifier(setAACDownmix)
try:
can_osd_alpha = open("/proc/stb/video/alpha", "r") and True or False
except:
can_osd_alpha = False
SystemInfo["CanChangeOsdAlpha"] = can_osd_alpha
def setAlpha(config):
open("/proc/stb/video/alpha", "w").write(str(config.value))
if can_osd_alpha:
config.av.osd_alpha = ConfigSlider(default=255, limits=(0,255))
config.av.osd_alpha.addNotifier(setAlpha)
if os_path.exists("/proc/stb/vmpeg/0/pep_scaler_sharpness"):
def setScaler_sharpness(config):
myval = int(config.value)
try:
print "--> setting scaler_sharpness to: %0.8X" % myval
open("/proc/stb/vmpeg/0/pep_scaler_sharpness", "w").write("%0.8X" % myval)
open("/proc/stb/vmpeg/0/pep_apply", "w").write("1")
except IOError:
print "couldn't write pep_scaler_sharpness"
config.av.scaler_sharpness = ConfigSlider(default=13, limits=(0,26))
config.av.scaler_sharpness.addNotifier(setScaler_sharpness)
else:
config.av.scaler_sharpness = NoSave(ConfigNothing())<|fim▁end|> | eAVSwitch.getInstance().setInput(INPUT[input])
|
<|file_name|>defaults.go<|end_file_name|><|fim▁begin|>// Code generated by aws/endpoints/v3model_codegen.go. DO NOT EDIT.
package endpoints
import (
"regexp"
)
// Partition identifiers
const (
AwsPartitionID = "aws" // AWS Standard partition.
AwsCnPartitionID = "aws-cn" // AWS China partition.
AwsUsGovPartitionID = "aws-us-gov" // AWS GovCloud (US) partition.
AwsIsoPartitionID = "aws-iso" // AWS ISO (US) partition.
AwsIsoBPartitionID = "aws-iso-b" // AWS ISOB (US) partition.
)
// AWS Standard partition's regions.
const (
AfSouth1RegionID = "af-south-1" // Africa (Cape Town).
ApEast1RegionID = "ap-east-1" // Asia Pacific (Hong Kong).
ApNortheast1RegionID = "ap-northeast-1" // Asia Pacific (Tokyo).
ApNortheast2RegionID = "ap-northeast-2" // Asia Pacific (Seoul).
ApNortheast3RegionID = "ap-northeast-3" // Asia Pacific (Osaka).
ApSouth1RegionID = "ap-south-1" // Asia Pacific (Mumbai).
ApSoutheast1RegionID = "ap-southeast-1" // Asia Pacific (Singapore).
ApSoutheast2RegionID = "ap-southeast-2" // Asia Pacific (Sydney).
CaCentral1RegionID = "ca-central-1" // Canada (Central).
EuCentral1RegionID = "eu-central-1" // Europe (Frankfurt).
EuNorth1RegionID = "eu-north-1" // Europe (Stockholm).
EuSouth1RegionID = "eu-south-1" // Europe (Milan).
EuWest1RegionID = "eu-west-1" // Europe (Ireland).
EuWest2RegionID = "eu-west-2" // Europe (London).
EuWest3RegionID = "eu-west-3" // Europe (Paris).
MeSouth1RegionID = "me-south-1" // Middle East (Bahrain).
SaEast1RegionID = "sa-east-1" // South America (Sao Paulo).
UsEast1RegionID = "us-east-1" // US East (N. Virginia).
UsEast2RegionID = "us-east-2" // US East (Ohio).
UsWest1RegionID = "us-west-1" // US West (N. California).
UsWest2RegionID = "us-west-2" // US West (Oregon).
)
// AWS China partition's regions.
const (
CnNorth1RegionID = "cn-north-1" // China (Beijing).
CnNorthwest1RegionID = "cn-northwest-1" // China (Ningxia).
)
// AWS GovCloud (US) partition's regions.
const (
UsGovEast1RegionID = "us-gov-east-1" // AWS GovCloud (US-East).
UsGovWest1RegionID = "us-gov-west-1" // AWS GovCloud (US-West).
)
// AWS ISO (US) partition's regions.
const (
UsIsoEast1RegionID = "us-iso-east-1" // US ISO East.
)
// AWS ISOB (US) partition's regions.
const (
UsIsobEast1RegionID = "us-isob-east-1" // US ISOB East (Ohio).
)
// DefaultResolver returns an Endpoint resolver that will be able
// to resolve endpoints for: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US).
//
// Use DefaultPartitions() to get the list of the default partitions.
func DefaultResolver() Resolver {
return defaultPartitions
}
// DefaultPartitions returns a list of the partitions the SDK is bundled
// with. The available partitions are: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US).
//
// partitions := endpoints.DefaultPartitions
// for _, p := range partitions {
// // ... inspect partitions
// }
func DefaultPartitions() []Partition {
return defaultPartitions.Partitions()
}
var defaultPartitions = partitions{
awsPartition,
awscnPartition,
awsusgovPartition,
awsisoPartition,
awsisobPartition,
}
// AwsPartition returns the Resolver for AWS Standard.
func AwsPartition() Partition {
return awsPartition.Partition()
}
var awsPartition = partition{
ID: "aws",
Name: "AWS Standard",
DNSSuffix: "amazonaws.com",
RegionRegex: regionRegex{
Regexp: func() *regexp.Regexp {
reg, _ := regexp.Compile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$")
return reg
}(),
},
Defaults: endpoint{
Hostname: "{service}.{region}.{dnsSuffix}",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
Regions: regions{
"af-south-1": region{
Description: "Africa (Cape Town)",
},
"ap-east-1": region{
Description: "Asia Pacific (Hong Kong)",
},
"ap-northeast-1": region{
Description: "Asia Pacific (Tokyo)",
},
"ap-northeast-2": region{
Description: "Asia Pacific (Seoul)",
},
"ap-northeast-3": region{
Description: "Asia Pacific (Osaka)",
},
"ap-south-1": region{
Description: "Asia Pacific (Mumbai)",
},
"ap-southeast-1": region{
Description: "Asia Pacific (Singapore)",
},
"ap-southeast-2": region{
Description: "Asia Pacific (Sydney)",
},
"ca-central-1": region{
Description: "Canada (Central)",
},
"eu-central-1": region{
Description: "Europe (Frankfurt)",
},
"eu-north-1": region{
Description: "Europe (Stockholm)",
},
"eu-south-1": region{
Description: "Europe (Milan)",
},
"eu-west-1": region{
Description: "Europe (Ireland)",
},
"eu-west-2": region{
Description: "Europe (London)",
},
"eu-west-3": region{
Description: "Europe (Paris)",
},
"me-south-1": region{
Description: "Middle East (Bahrain)",
},
"sa-east-1": region{
Description: "South America (Sao Paulo)",
},
"us-east-1": region{
Description: "US East (N. Virginia)",
},
"us-east-2": region{
Description: "US East (Ohio)",
},
"us-west-1": region{
Description: "US West (N. California)",
},
"us-west-2": region{
Description: "US West (Oregon)",
},
},
Services: services{
"a4b": service{
Endpoints: endpoints{
"us-east-1": endpoint{},
},
},
"access-analyzer": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "access-analyzer-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "access-analyzer-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "access-analyzer-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "access-analyzer-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "access-analyzer-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"acm": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"ca-central-1-fips": endpoint{
Hostname: "acm-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "acm-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "acm-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "acm-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "acm-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"acm-pca": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "acm-pca-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "acm-pca-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "acm-pca-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "acm-pca-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "acm-pca-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"airflow": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"amplifybackend": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"api.detective": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "api.detective-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "api.detective-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "api.detective-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "api.detective-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"api.ecr": service{
Endpoints: endpoints{
"af-south-1": endpoint{
Hostname: "api.ecr.af-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "af-south-1",
},
},
"ap-east-1": endpoint{
Hostname: "api.ecr.ap-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-east-1",
},
},
"ap-northeast-1": endpoint{
Hostname: "api.ecr.ap-northeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-1",
},
},
"ap-northeast-2": endpoint{
Hostname: "api.ecr.ap-northeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-2",
},
},
"ap-northeast-3": endpoint{
Hostname: "api.ecr.ap-northeast-3.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-3",
},
},
"ap-south-1": endpoint{
Hostname: "api.ecr.ap-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-south-1",
},
},
"ap-southeast-1": endpoint{
Hostname: "api.ecr.ap-southeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-1",
},
},
"ap-southeast-2": endpoint{
Hostname: "api.ecr.ap-southeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-2",
},
},
"ca-central-1": endpoint{
Hostname: "api.ecr.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"eu-central-1": endpoint{
Hostname: "api.ecr.eu-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-central-1",
},
},
"eu-north-1": endpoint{
Hostname: "api.ecr.eu-north-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-north-1",
},
},
"eu-south-1": endpoint{
Hostname: "api.ecr.eu-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-south-1",
},
},
"eu-west-1": endpoint{
Hostname: "api.ecr.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"eu-west-2": endpoint{
Hostname: "api.ecr.eu-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-2",
},
},
"eu-west-3": endpoint{
Hostname: "api.ecr.eu-west-3.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-3",
},
},
"fips-dkr-us-east-1": endpoint{
Hostname: "ecr-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-dkr-us-east-2": endpoint{
Hostname: "ecr-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-dkr-us-west-1": endpoint{
Hostname: "ecr-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-dkr-us-west-2": endpoint{
Hostname: "ecr-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"fips-us-east-1": endpoint{
Hostname: "ecr-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "ecr-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "ecr-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "ecr-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{
Hostname: "api.ecr.me-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "me-south-1",
},
},
"sa-east-1": endpoint{
Hostname: "api.ecr.sa-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "sa-east-1",
},
},
"us-east-1": endpoint{
Hostname: "api.ecr.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{
Hostname: "api.ecr.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{
Hostname: "api.ecr.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{
Hostname: "api.ecr.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"api.elastic-inference": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{
Hostname: "api.elastic-inference.ap-northeast-1.amazonaws.com",
},
"ap-northeast-2": endpoint{
Hostname: "api.elastic-inference.ap-northeast-2.amazonaws.com",
},
"eu-west-1": endpoint{
Hostname: "api.elastic-inference.eu-west-1.amazonaws.com",
},
"us-east-1": endpoint{
Hostname: "api.elastic-inference.us-east-1.amazonaws.com",
},
"us-east-2": endpoint{
Hostname: "api.elastic-inference.us-east-2.amazonaws.com",
},
"us-west-2": endpoint{
Hostname: "api.elastic-inference.us-west-2.amazonaws.com",
},
},
},
"api.fleethub.iot": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"api.mediatailor": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"api.pricing": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "pricing",
},
},
Endpoints: endpoints{
"ap-south-1": endpoint{},
"us-east-1": endpoint{},
},
},
"api.sagemaker": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "api-fips.sagemaker.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "api-fips.sagemaker.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "api-fips.sagemaker.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "api-fips.sagemaker.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"apigateway": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"app-integrations": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"appflow": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"application-autoscaling": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"appmesh": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"apprunner": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"appstream2": service{
Defaults: endpoint{
Protocols: []string{"https"},
CredentialScope: credentialScope{
Service: "appstream",
},
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"fips": endpoint{
Hostname: "appstream2-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"appsync": service{
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"athena": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "athena-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "athena-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "athena-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "athena-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"autoscaling": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"autoscaling-plans": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"backup": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"batch": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "fips.batch.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "fips.batch.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "fips.batch.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "fips.batch.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"budgets": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "budgets.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
},
},
"ce": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "ce.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
},
},
"chime": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "chime.us-east-1.amazonaws.com",
Protocols: []string{"https"},
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
},
},
"cloud9": service{
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"clouddirectory": service{
Endpoints: endpoints{
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"cloudformation": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "cloudformation-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "cloudformation-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "cloudformation-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "cloudformation-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"cloudfront": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "cloudfront.amazonaws.com",
Protocols: []string{"http", "https"},
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
},
},
"cloudhsm": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"cloudhsmv2": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "cloudhsm",
},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"cloudsearch": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"cloudtrail": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "cloudtrail-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "cloudtrail-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "cloudtrail-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "cloudtrail-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"codeartifact": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"codebuild": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "codebuild-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "codebuild-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "codebuild-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "codebuild-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"codecommit": service{
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips": endpoint{
Hostname: "codecommit-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"codedeploy": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "codedeploy-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "codedeploy-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "codedeploy-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "codedeploy-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"codeguru-reviewer": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"codepipeline": service{
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "codepipeline-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "codepipeline-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "codepipeline-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "codepipeline-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "codepipeline-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"codestar": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"codestar-connections": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"cognito-identity": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "cognito-identity-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "cognito-identity-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-2": endpoint{
Hostname: "cognito-identity-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"cognito-idp": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "cognito-idp-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "cognito-idp-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "cognito-idp-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "cognito-idp-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"cognito-sync": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"comprehend": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "comprehend-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "comprehend-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-2": endpoint{
Hostname: "comprehend-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"comprehendmedical": service{
Endpoints: endpoints{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "comprehendmedical-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "comprehendmedical-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-2": endpoint{
Hostname: "comprehendmedical-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"config": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "config-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "config-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "config-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "config-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"connect": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"contact-lens": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"cur": service{
Endpoints: endpoints{
"us-east-1": endpoint{},
},
},
"data.mediastore": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"dataexchange": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"datapipeline": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"datasync": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "datasync-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "datasync-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "datasync-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "datasync-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "datasync-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"dax": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"devicefarm": service{
Endpoints: endpoints{
"us-west-2": endpoint{},
},
},
"directconnect": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "directconnect-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "directconnect-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "directconnect-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "directconnect-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"discovery": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"dms": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"dms-fips": endpoint{
Hostname: "dms-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"docdb": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{
Hostname: "rds.ap-northeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-1",
},
},
"ap-northeast-2": endpoint{
Hostname: "rds.ap-northeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-2",
},
},
"ap-south-1": endpoint{
Hostname: "rds.ap-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-south-1",
},
},
"ap-southeast-1": endpoint{
Hostname: "rds.ap-southeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-1",
},
},
"ap-southeast-2": endpoint{
Hostname: "rds.ap-southeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-2",
},
},
"ca-central-1": endpoint{
Hostname: "rds.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"eu-central-1": endpoint{
Hostname: "rds.eu-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-central-1",
},
},
"eu-west-1": endpoint{
Hostname: "rds.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"eu-west-2": endpoint{
Hostname: "rds.eu-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-2",
},
},
"eu-west-3": endpoint{
Hostname: "rds.eu-west-3.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-3",
},
},
"sa-east-1": endpoint{
Hostname: "rds.sa-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "sa-east-1",
},
},
"us-east-1": endpoint{
Hostname: "rds.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{
Hostname: "rds.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-2": endpoint{
Hostname: "rds.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"ds": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "ds-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "ds-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "ds-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "ds-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "ds-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"dynamodb": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"ca-central-1-fips": endpoint{
Hostname: "dynamodb-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"local": endpoint{
Hostname: "localhost:8000",
Protocols: []string{"http"},
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "dynamodb-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "dynamodb-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "dynamodb-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "dynamodb-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"ebs": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "ebs-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "ebs-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "ebs-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "ebs-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "ebs-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"ec2": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "ec2-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "ec2-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "ec2-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "ec2-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "ec2-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"ec2metadata": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "169.254.169.254/latest",
Protocols: []string{"http"},
},
},
},
"ecs": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "ecs-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "ecs-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "ecs-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "ecs-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"eks": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "fips.eks.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "fips.eks.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "fips.eks.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "fips.eks.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"elasticache": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips": endpoint{
Hostname: "elasticache-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"elasticbeanstalk": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "elasticbeanstalk-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "elasticbeanstalk-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "elasticbeanstalk-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "elasticbeanstalk-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"elasticfilesystem": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-af-south-1": endpoint{
Hostname: "elasticfilesystem-fips.af-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "af-south-1",
},
},
"fips-ap-east-1": endpoint{
Hostname: "elasticfilesystem-fips.ap-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-east-1",
},
},
"fips-ap-northeast-1": endpoint{
Hostname: "elasticfilesystem-fips.ap-northeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-1",
},
},
"fips-ap-northeast-2": endpoint{
Hostname: "elasticfilesystem-fips.ap-northeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-2",
},
},
"fips-ap-northeast-3": endpoint{
Hostname: "elasticfilesystem-fips.ap-northeast-3.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-3",
},
},
"fips-ap-south-1": endpoint{
Hostname: "elasticfilesystem-fips.ap-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-south-1",
},
},
"fips-ap-southeast-1": endpoint{
Hostname: "elasticfilesystem-fips.ap-southeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-1",
},
},
"fips-ap-southeast-2": endpoint{
Hostname: "elasticfilesystem-fips.ap-southeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-2",
},
},
"fips-ca-central-1": endpoint{
Hostname: "elasticfilesystem-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-eu-central-1": endpoint{
Hostname: "elasticfilesystem-fips.eu-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-central-1",
},
},
"fips-eu-north-1": endpoint{
Hostname: "elasticfilesystem-fips.eu-north-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-north-1",
},
},
"fips-eu-south-1": endpoint{
Hostname: "elasticfilesystem-fips.eu-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-south-1",
},
},
"fips-eu-west-1": endpoint{
Hostname: "elasticfilesystem-fips.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"fips-eu-west-2": endpoint{
Hostname: "elasticfilesystem-fips.eu-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-2",
},
},
"fips-eu-west-3": endpoint{
Hostname: "elasticfilesystem-fips.eu-west-3.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-3",
},
},
"fips-me-south-1": endpoint{
Hostname: "elasticfilesystem-fips.me-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "me-south-1",
},
},
"fips-sa-east-1": endpoint{
Hostname: "elasticfilesystem-fips.sa-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "sa-east-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "elasticfilesystem-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "elasticfilesystem-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "elasticfilesystem-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "elasticfilesystem-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"elasticloadbalancing": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "elasticloadbalancing-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "elasticloadbalancing-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "elasticloadbalancing-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "elasticloadbalancing-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"elasticmapreduce": service{
Defaults: endpoint{
SSLCommonName: "{region}.{service}.{dnsSuffix}",
Protocols: []string{"https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{
SSLCommonName: "{service}.{region}.{dnsSuffix}",
},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "elasticmapreduce-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "elasticmapreduce-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "elasticmapreduce-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "elasticmapreduce-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "elasticmapreduce-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{
SSLCommonName: "{service}.{region}.{dnsSuffix}",
},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"elastictranscoder": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"email": service{
Endpoints: endpoints{
"ap-south-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"emr-containers": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"entitlement.marketplace": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "aws-marketplace",
},
},
Endpoints: endpoints{
"us-east-1": endpoint{},
},
},
"es": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips": endpoint{
Hostname: "es-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"events": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "events-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "events-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "events-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "events-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"finspace": service{
Endpoints: endpoints{
"ca-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"finspace-api": service{
Endpoints: endpoints{
"ca-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"firehose": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "firehose-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "firehose-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "firehose-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "firehose-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"fms": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-af-south-1": endpoint{
Hostname: "fms-fips.af-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "af-south-1",
},
},
"fips-ap-east-1": endpoint{
Hostname: "fms-fips.ap-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-east-1",
},
},
"fips-ap-northeast-1": endpoint{
Hostname: "fms-fips.ap-northeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-1",
},
},
"fips-ap-northeast-2": endpoint{
Hostname: "fms-fips.ap-northeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-2",
},
},
"fips-ap-south-1": endpoint{
Hostname: "fms-fips.ap-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-south-1",
},
},
"fips-ap-southeast-1": endpoint{
Hostname: "fms-fips.ap-southeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-1",
},
},
"fips-ap-southeast-2": endpoint{
Hostname: "fms-fips.ap-southeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-2",
},
},
"fips-ca-central-1": endpoint{
Hostname: "fms-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-eu-central-1": endpoint{
Hostname: "fms-fips.eu-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-central-1",
},
},
"fips-eu-south-1": endpoint{
Hostname: "fms-fips.eu-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-south-1",
},
},
"fips-eu-west-1": endpoint{
Hostname: "fms-fips.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"fips-eu-west-2": endpoint{
Hostname: "fms-fips.eu-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-2",
},
},
"fips-eu-west-3": endpoint{
Hostname: "fms-fips.eu-west-3.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-3",
},
},
"fips-me-south-1": endpoint{
Hostname: "fms-fips.me-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "me-south-1",
},
},
"fips-sa-east-1": endpoint{
Hostname: "fms-fips.sa-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "sa-east-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "fms-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "fms-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "fms-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "fms-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"forecast": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "forecast-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "forecast-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-2": endpoint{
Hostname: "forecast-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"forecastquery": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "forecastquery-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "forecastquery-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-2": endpoint{
Hostname: "forecastquery-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"fsx": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-prod-ca-central-1": endpoint{
Hostname: "fsx-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-prod-us-east-1": endpoint{
Hostname: "fsx-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-prod-us-east-2": endpoint{
Hostname: "fsx-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-prod-us-west-1": endpoint{
Hostname: "fsx-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-prod-us-west-2": endpoint{
Hostname: "fsx-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"gamelift": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"glacier": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "glacier-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "glacier-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "glacier-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "glacier-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "glacier-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"glue": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "glue-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "glue-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "glue-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "glue-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"greengrass": service{
IsRegionalized: boxedTrue,
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"groundstation": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "groundstation-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "groundstation-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-2": endpoint{
Hostname: "groundstation-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"guardduty": service{
IsRegionalized: boxedTrue,
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "guardduty-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "guardduty-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "guardduty-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "guardduty-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"health": service{
Endpoints: endpoints{
"fips-us-east-2": endpoint{
Hostname: "health-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
},
},
"healthlake": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"us-east-1": endpoint{},
},
},
"honeycode": service{
Endpoints: endpoints{
"us-west-2": endpoint{},
},
},
"iam": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "iam.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"iam-fips": endpoint{
Hostname: "iam-fips.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
},
},
"identitystore": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"importexport": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "importexport.amazonaws.com",
SignatureVersions: []string{"v2", "v4"},
CredentialScope: credentialScope{
Region: "us-east-1",
Service: "IngestionService",
},
},
},
},
"inspector": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "inspector-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "inspector-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "inspector-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "inspector-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"iot": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "execute-api",
},
},
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"iotanalytics": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"iotevents": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"ioteventsdata": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{
Hostname: "data.iotevents.ap-northeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-1",
},
},
"ap-northeast-2": endpoint{
Hostname: "data.iotevents.ap-northeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-2",
},
},
"ap-southeast-1": endpoint{
Hostname: "data.iotevents.ap-southeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-1",
},
},
"ap-southeast-2": endpoint{
Hostname: "data.iotevents.ap-southeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-2",
},
},
"eu-central-1": endpoint{
Hostname: "data.iotevents.eu-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-central-1",
},
},
"eu-west-1": endpoint{
Hostname: "data.iotevents.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"eu-west-2": endpoint{
Hostname: "data.iotevents.eu-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-2",
},
},
"us-east-1": endpoint{
Hostname: "data.iotevents.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{
Hostname: "data.iotevents.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-2": endpoint{
Hostname: "data.iotevents.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"iotsecuredtunneling": service{
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"iotthingsgraph": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "iotthingsgraph",
},
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-2": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"iotwireless": service{
Endpoints: endpoints{
"eu-west-1": endpoint{
Hostname: "api.iotwireless.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"us-east-1": endpoint{
Hostname: "api.iotwireless.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
},
},
"kafka": service{
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"kinesis": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "kinesis-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "kinesis-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "kinesis-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "kinesis-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"kinesisanalytics": service{
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"kinesisvideo": service{
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"kms": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"lakeformation": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "lakeformation-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "lakeformation-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "lakeformation-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "lakeformation-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"lambda": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "lambda-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "lambda-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "lambda-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "lambda-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"license-manager": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "license-manager-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "license-manager-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "license-manager-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "license-manager-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"lightsail": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"logs": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "logs-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "logs-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "logs-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "logs-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"lookoutequipment": service{
Endpoints: endpoints{
"ap-northeast-2": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
},
},
"lookoutvision": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"machinelearning": service{
Endpoints: endpoints{
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
},
},
"macie": service{
Endpoints: endpoints{
"fips-us-east-1": endpoint{
Hostname: "macie-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "macie-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"macie2": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "macie2-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "macie2-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "macie2-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "macie2-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"managedblockchain": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
},
},
"marketplacecommerceanalytics": service{
Endpoints: endpoints{
"us-east-1": endpoint{},
},
},
"mediaconnect": service{
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"mediaconvert": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "mediaconvert-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "mediaconvert-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "mediaconvert-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "mediaconvert-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "mediaconvert-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"medialive": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "medialive-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "medialive-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-2": endpoint{
Hostname: "medialive-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"mediapackage": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"mediastore": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"metering.marketplace": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "aws-marketplace",
},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"mgh": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"mobileanalytics": service{
Endpoints: endpoints{
"us-east-1": endpoint{},
},
},
"models.lex": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "lex",
},
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "models-fips.lex.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "models-fips.lex.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"monitoring": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "monitoring-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "monitoring-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "monitoring-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "monitoring-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"mq": service{
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "mq-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "mq-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "mq-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "mq-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"mturk-requester": service{
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"sandbox": endpoint{
Hostname: "mturk-requester-sandbox.us-east-1.amazonaws.com",
},
"us-east-1": endpoint{},
},
},
"neptune": service{
Endpoints: endpoints{
"ap-east-1": endpoint{
Hostname: "rds.ap-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-east-1",
},
},
"ap-northeast-1": endpoint{
Hostname: "rds.ap-northeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-1",
},
},
"ap-northeast-2": endpoint{
Hostname: "rds.ap-northeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-2",
},
},
"ap-south-1": endpoint{
Hostname: "rds.ap-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-south-1",
},
},
"ap-southeast-1": endpoint{
Hostname: "rds.ap-southeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-1",
},
},
"ap-southeast-2": endpoint{
Hostname: "rds.ap-southeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-2",
},
},
"ca-central-1": endpoint{
Hostname: "rds.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"eu-central-1": endpoint{
Hostname: "rds.eu-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-central-1",
},
},
"eu-north-1": endpoint{
Hostname: "rds.eu-north-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-north-1",
},
},
"eu-west-1": endpoint{
Hostname: "rds.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"eu-west-2": endpoint{
Hostname: "rds.eu-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-2",
},
},
"eu-west-3": endpoint{
Hostname: "rds.eu-west-3.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-3",
},
},
"me-south-1": endpoint{
Hostname: "rds.me-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "me-south-1",
},
},
"sa-east-1": endpoint{
Hostname: "rds.sa-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "sa-east-1",
},
},
"us-east-1": endpoint{
Hostname: "rds.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{
Hostname: "rds.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{
Hostname: "rds.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{
Hostname: "rds.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"oidc": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{
Hostname: "oidc.ap-northeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-1",
},
},
"ap-northeast-2": endpoint{
Hostname: "oidc.ap-northeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-2",
},
},
"ap-south-1": endpoint{
Hostname: "oidc.ap-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-south-1",
},
},
"ap-southeast-1": endpoint{
Hostname: "oidc.ap-southeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-1",
},
},
"ap-southeast-2": endpoint{
Hostname: "oidc.ap-southeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-2",
},
},
"ca-central-1": endpoint{
Hostname: "oidc.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"eu-central-1": endpoint{
Hostname: "oidc.eu-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-central-1",
},
},
"eu-north-1": endpoint{
Hostname: "oidc.eu-north-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-north-1",
},
},
"eu-west-1": endpoint{
Hostname: "oidc.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"eu-west-2": endpoint{
Hostname: "oidc.eu-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-2",
},
},
"us-east-1": endpoint{
Hostname: "oidc.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{
Hostname: "oidc.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-2": endpoint{
Hostname: "oidc.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"opsworks": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"opsworks-cm": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"organizations": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "organizations.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-aws-global": endpoint{
Hostname: "organizations-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
},
},
"outposts": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "outposts-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "outposts-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "outposts-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "outposts-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "outposts-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"personalize": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"pinpoint": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "mobiletargeting",
},
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "pinpoint-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "pinpoint-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{
Hostname: "pinpoint.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-west-2": endpoint{
Hostname: "pinpoint.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"polly": service{
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "polly-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "polly-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "polly-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "polly-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"portal.sso": service{
Endpoints: endpoints{
"ap-southeast-1": endpoint{
Hostname: "portal.sso.ap-southeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-1",
},
},
"ap-southeast-2": endpoint{
Hostname: "portal.sso.ap-southeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-2",
},
},
"ca-central-1": endpoint{
Hostname: "portal.sso.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"eu-central-1": endpoint{
Hostname: "portal.sso.eu-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-central-1",
},
},
"eu-west-1": endpoint{
Hostname: "portal.sso.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"eu-west-2": endpoint{
Hostname: "portal.sso.eu-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-2",
},
},
"us-east-1": endpoint{
Hostname: "portal.sso.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{
Hostname: "portal.sso.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-2": endpoint{
Hostname: "portal.sso.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"profile": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"projects.iot1click": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"qldb": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "qldb-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "qldb-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-2": endpoint{
Hostname: "qldb-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"ram": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "ram-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "ram-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "ram-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "ram-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "ram-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"rds": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"rds-fips.ca-central-1": endpoint{
Hostname: "rds-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"rds-fips.us-east-1": endpoint{
Hostname: "rds-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"rds-fips.us-east-2": endpoint{
Hostname: "rds-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"rds-fips.us-west-1": endpoint{
Hostname: "rds-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"rds-fips.us-west-2": endpoint{
Hostname: "rds-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"sa-east-1": endpoint{},
"us-east-1": endpoint{
SSLCommonName: "{service}.{dnsSuffix}",
},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"redshift": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "redshift-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "redshift-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "redshift-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "redshift-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "redshift-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"rekognition": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"rekognition-fips.ca-central-1": endpoint{
Hostname: "rekognition-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"rekognition-fips.us-east-1": endpoint{
Hostname: "rekognition-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"rekognition-fips.us-east-2": endpoint{
Hostname: "rekognition-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"rekognition-fips.us-west-1": endpoint{
Hostname: "rekognition-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"rekognition-fips.us-west-2": endpoint{
Hostname: "rekognition-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"resource-groups": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "resource-groups-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "resource-groups-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "resource-groups-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "resource-groups-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"robomaker": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"route53": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "route53.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-aws-global": endpoint{
Hostname: "route53-fips.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
},
},
"route53domains": service{
Endpoints: endpoints{
"us-east-1": endpoint{},
},
},
"route53resolver": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"runtime.lex": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "lex",
},
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "runtime-fips.lex.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "runtime-fips.lex.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"runtime.sagemaker": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "runtime-fips.sagemaker.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "runtime-fips.sagemaker.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "runtime-fips.sagemaker.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "runtime-fips.sagemaker.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"s3": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedTrue,
Defaults: endpoint{
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
HasDualStack: boxedTrue,
DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}",
},
Endpoints: endpoints{
"accesspoint-af-south-1": endpoint{
Hostname: "s3-accesspoint.af-south-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-ap-east-1": endpoint{
Hostname: "s3-accesspoint.ap-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-ap-northeast-1": endpoint{
Hostname: "s3-accesspoint.ap-northeast-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-ap-northeast-2": endpoint{
Hostname: "s3-accesspoint.ap-northeast-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-ap-northeast-3": endpoint{
Hostname: "s3-accesspoint.ap-northeast-3.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-ap-south-1": endpoint{
Hostname: "s3-accesspoint.ap-south-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-ap-southeast-1": endpoint{
Hostname: "s3-accesspoint.ap-southeast-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-ap-southeast-2": endpoint{
Hostname: "s3-accesspoint.ap-southeast-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-ca-central-1": endpoint{
Hostname: "s3-accesspoint.ca-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-eu-central-1": endpoint{
Hostname: "s3-accesspoint.eu-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-eu-north-1": endpoint{
Hostname: "s3-accesspoint.eu-north-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-eu-south-1": endpoint{
Hostname: "s3-accesspoint.eu-south-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-eu-west-1": endpoint{
Hostname: "s3-accesspoint.eu-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-eu-west-2": endpoint{
Hostname: "s3-accesspoint.eu-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-eu-west-3": endpoint{
Hostname: "s3-accesspoint.eu-west-3.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-me-south-1": endpoint{
Hostname: "s3-accesspoint.me-south-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-sa-east-1": endpoint{
Hostname: "s3-accesspoint.sa-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-us-east-1": endpoint{
Hostname: "s3-accesspoint.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-us-east-2": endpoint{
Hostname: "s3-accesspoint.us-east-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-us-west-1": endpoint{
Hostname: "s3-accesspoint.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-us-west-2": endpoint{
Hostname: "s3-accesspoint.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{
Hostname: "s3.ap-northeast-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{
Hostname: "s3.ap-southeast-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
"ap-southeast-2": endpoint{
Hostname: "s3.ap-southeast-2.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
"aws-global": endpoint{
Hostname: "s3.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{
Hostname: "s3.eu-west-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-accesspoint-ca-central-1": endpoint{
Hostname: "s3-accesspoint-fips.ca-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"fips-accesspoint-us-east-1": endpoint{
Hostname: "s3-accesspoint-fips.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"fips-accesspoint-us-east-2": endpoint{
Hostname: "s3-accesspoint-fips.us-east-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"fips-accesspoint-us-west-1": endpoint{
Hostname: "s3-accesspoint-fips.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"fips-accesspoint-us-west-2": endpoint{
Hostname: "s3-accesspoint-fips.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"me-south-1": endpoint{},
"s3-external-1": endpoint{
Hostname: "s3-external-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"sa-east-1": endpoint{
Hostname: "s3.sa-east-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
"us-east-1": endpoint{
Hostname: "s3.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
"us-east-2": endpoint{},
"us-west-1": endpoint{
Hostname: "s3.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
"us-west-2": endpoint{
Hostname: "s3.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
},
},
"s3-control": service{
Defaults: endpoint{
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
HasDualStack: boxedTrue,
DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}",
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{
Hostname: "s3-control.ap-northeast-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "ap-northeast-1",
},
},
"ap-northeast-2": endpoint{
Hostname: "s3-control.ap-northeast-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "ap-northeast-2",
},
},
"ap-northeast-3": endpoint{
Hostname: "s3-control.ap-northeast-3.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "ap-northeast-3",
},
},
"ap-south-1": endpoint{
Hostname: "s3-control.ap-south-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "ap-south-1",
},
},
"ap-southeast-1": endpoint{
Hostname: "s3-control.ap-southeast-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "ap-southeast-1",
},
},
"ap-southeast-2": endpoint{
Hostname: "s3-control.ap-southeast-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "ap-southeast-2",
},
},
"ca-central-1": endpoint{
Hostname: "s3-control.ca-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"ca-central-1-fips": endpoint{
Hostname: "s3-control-fips.ca-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"eu-central-1": endpoint{
Hostname: "s3-control.eu-central-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "eu-central-1",
},
},
"eu-north-1": endpoint{
Hostname: "s3-control.eu-north-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "eu-north-1",
},
},
"eu-west-1": endpoint{
Hostname: "s3-control.eu-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"eu-west-2": endpoint{
Hostname: "s3-control.eu-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "eu-west-2",
},
},
"eu-west-3": endpoint{
Hostname: "s3-control.eu-west-3.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "eu-west-3",
},
},
"sa-east-1": endpoint{
Hostname: "s3-control.sa-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "sa-east-1",
},
},
"us-east-1": endpoint{
Hostname: "s3-control.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-1-fips": endpoint{
Hostname: "s3-control-fips.us-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{
Hostname: "s3-control.us-east-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-east-2-fips": endpoint{
Hostname: "s3-control-fips.us-east-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{
Hostname: "s3-control.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-1-fips": endpoint{
Hostname: "s3-control-fips.us-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{
Hostname: "s3-control.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-west-2-fips": endpoint{
Hostname: "s3-control-fips.us-west-2.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"savingsplans": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "savingsplans.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
},
},
"schemas": service{
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"sdb": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
SignatureVersions: []string{"v2"},
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-west-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{
Hostname: "sdb.amazonaws.com",
},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"secretsmanager": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "secretsmanager-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "secretsmanager-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "secretsmanager-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "secretsmanager-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"securityhub": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "securityhub-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "securityhub-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "securityhub-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "securityhub-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"serverlessrepo": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"ap-east-1": endpoint{
Protocols: []string{"https"},
},
"ap-northeast-1": endpoint{
Protocols: []string{"https"},
},
"ap-northeast-2": endpoint{
Protocols: []string{"https"},
},
"ap-south-1": endpoint{
Protocols: []string{"https"},
},
"ap-southeast-1": endpoint{
Protocols: []string{"https"},
},
"ap-southeast-2": endpoint{
Protocols: []string{"https"},
},
"ca-central-1": endpoint{
Protocols: []string{"https"},
},
"eu-central-1": endpoint{
Protocols: []string{"https"},
},
"eu-north-1": endpoint{
Protocols: []string{"https"},
},
"eu-west-1": endpoint{
Protocols: []string{"https"},
},
"eu-west-2": endpoint{
Protocols: []string{"https"},
},
"eu-west-3": endpoint{
Protocols: []string{"https"},
},
"me-south-1": endpoint{
Protocols: []string{"https"},
},
"sa-east-1": endpoint{
Protocols: []string{"https"},
},
"us-east-1": endpoint{
Protocols: []string{"https"},
},
"us-east-2": endpoint{
Protocols: []string{"https"},
},
"us-west-1": endpoint{
Protocols: []string{"https"},
},
"us-west-2": endpoint{
Protocols: []string{"https"},
},
},
},
"servicecatalog": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "servicecatalog-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "servicecatalog-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "servicecatalog-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "servicecatalog-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"servicecatalog-appregistry": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "servicecatalog-appregistry-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "servicecatalog-appregistry-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "servicecatalog-appregistry-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "servicecatalog-appregistry-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "servicecatalog-appregistry-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"servicediscovery": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"servicediscovery-fips": endpoint{
Hostname: "servicediscovery-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"servicequotas": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"session.qldb": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "session.qldb-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "session.qldb-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-2": endpoint{
Hostname: "session.qldb-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"shield": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Defaults: endpoint{
SSLCommonName: "shield.us-east-1.amazonaws.com",
Protocols: []string{"https"},
},
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "shield.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-aws-global": endpoint{
Hostname: "shield-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
},
},
"sms": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "sms-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "sms-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "sms-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "sms-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"snowball": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ap-northeast-1": endpoint{
Hostname: "snowball-fips.ap-northeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-1",
},
},
"fips-ap-northeast-2": endpoint{
Hostname: "snowball-fips.ap-northeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-2",
},
},
"fips-ap-northeast-3": endpoint{
Hostname: "snowball-fips.ap-northeast-3.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-3",
},
},
"fips-ap-south-1": endpoint{
Hostname: "snowball-fips.ap-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-south-1",
},
},
"fips-ap-southeast-1": endpoint{
Hostname: "snowball-fips.ap-southeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-1",
},
},
"fips-ap-southeast-2": endpoint{
Hostname: "snowball-fips.ap-southeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-2",
},
},
"fips-ca-central-1": endpoint{
Hostname: "snowball-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-eu-central-1": endpoint{
Hostname: "snowball-fips.eu-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-central-1",
},
},
"fips-eu-west-1": endpoint{
Hostname: "snowball-fips.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"fips-eu-west-2": endpoint{
Hostname: "snowball-fips.eu-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-2",
},
},
"fips-eu-west-3": endpoint{
Hostname: "snowball-fips.eu-west-3.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-3",
},
},
"fips-sa-east-1": endpoint{
Hostname: "snowball-fips.sa-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "sa-east-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "snowball-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "snowball-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "snowball-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "snowball-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"sns": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "sns-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "sns-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "sns-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "sns-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"sqs": service{
Defaults: endpoint{
SSLCommonName: "{region}.queue.{dnsSuffix}",
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "sqs-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "sqs-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "sqs-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "sqs-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{
SSLCommonName: "queue.{dnsSuffix}",
},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"ssm": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "ssm-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "ssm-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "ssm-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "ssm-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "ssm-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"states": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "states-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "states-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "states-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "states-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"storagegateway": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips": endpoint{
Hostname: "storagegateway-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"streams.dynamodb": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
CredentialScope: credentialScope{
Service: "dynamodb",
},
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"ca-central-1-fips": endpoint{
Hostname: "dynamodb-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"local": endpoint{
Hostname: "localhost:8000",
Protocols: []string{"http"},
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "dynamodb-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "dynamodb-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "dynamodb-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "dynamodb-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"sts": service{
PartitionEndpoint: "aws-global",
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"aws-global": endpoint{
Hostname: "sts.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "sts-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "sts-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-1-fips": endpoint{
Hostname: "sts-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "sts-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"support": service{
PartitionEndpoint: "aws-global",
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "support.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
},
},
"swf": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "swf-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "swf-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "swf-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "swf-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"tagging": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"transcribe": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "fips.transcribe.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "fips.transcribe.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "fips.transcribe.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "fips.transcribe.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"transcribestreaming": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"transfer": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "transfer-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "transfer-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "transfer-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "transfer-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "transfer-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"translate": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "translate-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{},
"us-east-2-fips": endpoint{
Hostname: "translate-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
"us-west-2-fips": endpoint{
Hostname: "translate-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"waf": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-fips": endpoint{
Hostname: "waf-fips.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"aws-global": endpoint{
Hostname: "waf.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
},
},
"waf-regional": service{
Endpoints: endpoints{
"af-south-1": endpoint{
Hostname: "waf-regional.af-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "af-south-1",
},
},
"ap-east-1": endpoint{
Hostname: "waf-regional.ap-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-east-1",
},
},
"ap-northeast-1": endpoint{
Hostname: "waf-regional.ap-northeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-1",
},
},
"ap-northeast-2": endpoint{
Hostname: "waf-regional.ap-northeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-2",
},
},
"ap-south-1": endpoint{
Hostname: "waf-regional.ap-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-south-1",
},
},
"ap-southeast-1": endpoint{
Hostname: "waf-regional.ap-southeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-1",
},
},
"ap-southeast-2": endpoint{
Hostname: "waf-regional.ap-southeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-2",
},
},
"ca-central-1": endpoint{
Hostname: "waf-regional.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"eu-central-1": endpoint{
Hostname: "waf-regional.eu-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-central-1",
},
},
"eu-north-1": endpoint{
Hostname: "waf-regional.eu-north-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-north-1",
},
},
"eu-south-1": endpoint{
Hostname: "waf-regional.eu-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-south-1",
},
},
"eu-west-1": endpoint{
Hostname: "waf-regional.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"eu-west-2": endpoint{
Hostname: "waf-regional.eu-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-2",
},
},
"eu-west-3": endpoint{
Hostname: "waf-regional.eu-west-3.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-3",
},
},
"fips-af-south-1": endpoint{
Hostname: "waf-regional-fips.af-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "af-south-1",
},
},
"fips-ap-east-1": endpoint{
Hostname: "waf-regional-fips.ap-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-east-1",
},
},
"fips-ap-northeast-1": endpoint{
Hostname: "waf-regional-fips.ap-northeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-1",
},
},
"fips-ap-northeast-2": endpoint{
Hostname: "waf-regional-fips.ap-northeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-northeast-2",
},
},
"fips-ap-south-1": endpoint{
Hostname: "waf-regional-fips.ap-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-south-1",
},
},
"fips-ap-southeast-1": endpoint{
Hostname: "waf-regional-fips.ap-southeast-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-1",
},
},
"fips-ap-southeast-2": endpoint{
Hostname: "waf-regional-fips.ap-southeast-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "ap-southeast-2",
},
},
"fips-ca-central-1": endpoint{
Hostname: "waf-regional-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-eu-central-1": endpoint{
Hostname: "waf-regional-fips.eu-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-central-1",
},
},
"fips-eu-north-1": endpoint{
Hostname: "waf-regional-fips.eu-north-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-north-1",
},
},
"fips-eu-south-1": endpoint{
Hostname: "waf-regional-fips.eu-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-south-1",
},
},
"fips-eu-west-1": endpoint{
Hostname: "waf-regional-fips.eu-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-1",
},
},
"fips-eu-west-2": endpoint{
Hostname: "waf-regional-fips.eu-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-2",
},
},
"fips-eu-west-3": endpoint{
Hostname: "waf-regional-fips.eu-west-3.amazonaws.com",
CredentialScope: credentialScope{
Region: "eu-west-3",
},
},
"fips-me-south-1": endpoint{
Hostname: "waf-regional-fips.me-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "me-south-1",
},
},
"fips-sa-east-1": endpoint{
Hostname: "waf-regional-fips.sa-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "sa-east-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "waf-regional-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "waf-regional-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "waf-regional-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "waf-regional-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{
Hostname: "waf-regional.me-south-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "me-south-1",
},
},
"sa-east-1": endpoint{
Hostname: "waf-regional.sa-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "sa-east-1",
},
},
"us-east-1": endpoint{
Hostname: "waf-regional.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"us-east-2": endpoint{
Hostname: "waf-regional.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"us-west-1": endpoint{
Hostname: "waf-regional.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"us-west-2": endpoint{
Hostname: "waf-regional.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
},
},
"workdocs": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-west-1": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "workdocs-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "workdocs-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"workmail": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"workspaces": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "workspaces-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "workspaces-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
"xray": service{
Endpoints: endpoints{
"af-south-1": endpoint{},
"ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-northeast-3": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-north-1": endpoint{},
"eu-south-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-us-east-1": endpoint{
Hostname: "xray-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "xray-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "xray-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "xray-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
},
}
// AwsCnPartition returns the Resolver for AWS China.
func AwsCnPartition() Partition {
return awscnPartition.Partition()
}
var awscnPartition = partition{
ID: "aws-cn",
Name: "AWS China",
DNSSuffix: "amazonaws.com.cn",
RegionRegex: regionRegex{
Regexp: func() *regexp.Regexp {
reg, _ := regexp.Compile("^cn\\-\\w+\\-\\d+$")
return reg
}(),
},
Defaults: endpoint{
Hostname: "{service}.{region}.{dnsSuffix}",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
Regions: regions{
"cn-north-1": region{
Description: "China (Beijing)",
},
"cn-northwest-1": region{
Description: "China (Ningxia)",
},
},
Services: services{
"access-analyzer": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"acm": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"api.ecr": service{
Endpoints: endpoints{
"cn-north-1": endpoint{
Hostname: "api.ecr.cn-north-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-north-1",
},
},
"cn-northwest-1": endpoint{
Hostname: "api.ecr.cn-northwest-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"api.sagemaker": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},<|fim▁hole|> },
},
"apigateway": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"application-autoscaling": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"appsync": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"athena": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"autoscaling": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"autoscaling-plans": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"backup": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"batch": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"budgets": service{
PartitionEndpoint: "aws-cn-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-cn-global": endpoint{
Hostname: "budgets.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"ce": service{
PartitionEndpoint: "aws-cn-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-cn-global": endpoint{
Hostname: "ce.cn-northwest-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"cloudformation": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"cloudfront": service{
PartitionEndpoint: "aws-cn-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-cn-global": endpoint{
Hostname: "cloudfront.cn-northwest-1.amazonaws.com.cn",
Protocols: []string{"http", "https"},
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"cloudtrail": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"codebuild": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"codecommit": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"codedeploy": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"cognito-identity": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
},
},
"config": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"cur": service{
Endpoints: endpoints{
"cn-northwest-1": endpoint{},
},
},
"dax": service{
Endpoints: endpoints{
"cn-northwest-1": endpoint{},
},
},
"directconnect": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"dms": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"docdb": service{
Endpoints: endpoints{
"cn-northwest-1": endpoint{
Hostname: "rds.cn-northwest-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"ds": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"dynamodb": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"ebs": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"ec2": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"ec2metadata": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "169.254.169.254/latest",
Protocols: []string{"http"},
},
},
},
"ecs": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"eks": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"elasticache": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"elasticbeanstalk": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"elasticfilesystem": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
"fips-cn-north-1": endpoint{
Hostname: "elasticfilesystem-fips.cn-north-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-north-1",
},
},
"fips-cn-northwest-1": endpoint{
Hostname: "elasticfilesystem-fips.cn-northwest-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"elasticloadbalancing": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"elasticmapreduce": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"es": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"events": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"firehose": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"fsx": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"gamelift": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
},
},
"glacier": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"glue": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"greengrass": service{
IsRegionalized: boxedTrue,
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
},
},
"guardduty": service{
IsRegionalized: boxedTrue,
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"health": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"iam": service{
PartitionEndpoint: "aws-cn-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-cn-global": endpoint{
Hostname: "iam.cn-north-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-north-1",
},
},
},
},
"iot": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "execute-api",
},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"iotanalytics": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
},
},
"iotevents": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
},
},
"ioteventsdata": service{
Endpoints: endpoints{
"cn-north-1": endpoint{
Hostname: "data.iotevents.cn-north-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-north-1",
},
},
},
},
"iotsecuredtunneling": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"kafka": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"kinesis": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"kinesisanalytics": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"kms": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"lakeformation": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"lambda": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"license-manager": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"logs": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"mediaconvert": service{
Endpoints: endpoints{
"cn-northwest-1": endpoint{
Hostname: "subscribe.mediaconvert.cn-northwest-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"monitoring": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"mq": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"neptune": service{
Endpoints: endpoints{
"cn-northwest-1": endpoint{
Hostname: "rds.cn-northwest-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"organizations": service{
PartitionEndpoint: "aws-cn-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-cn-global": endpoint{
Hostname: "organizations.cn-northwest-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"personalize": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
},
},
"polly": service{
Endpoints: endpoints{
"cn-northwest-1": endpoint{},
},
},
"ram": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"rds": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"redshift": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"resource-groups": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"route53": service{
PartitionEndpoint: "aws-cn-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-cn-global": endpoint{
Hostname: "route53.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"route53resolver": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"runtime.sagemaker": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"s3": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
HasDualStack: boxedTrue,
DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}",
},
Endpoints: endpoints{
"accesspoint-cn-north-1": endpoint{
Hostname: "s3-accesspoint.cn-north-1.amazonaws.com.cn",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-cn-northwest-1": endpoint{
Hostname: "s3-accesspoint.cn-northwest-1.amazonaws.com.cn",
SignatureVersions: []string{"s3v4"},
},
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"s3-control": service{
Defaults: endpoint{
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
HasDualStack: boxedTrue,
DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}",
},
Endpoints: endpoints{
"cn-north-1": endpoint{
Hostname: "s3-control.cn-north-1.amazonaws.com.cn",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "cn-north-1",
},
},
"cn-northwest-1": endpoint{
Hostname: "s3-control.cn-northwest-1.amazonaws.com.cn",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"secretsmanager": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"securityhub": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"serverlessrepo": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{
Protocols: []string{"https"},
},
"cn-northwest-1": endpoint{
Protocols: []string{"https"},
},
},
},
"servicecatalog": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"servicediscovery": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"sms": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"snowball": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
"fips-cn-north-1": endpoint{
Hostname: "snowball-fips.cn-north-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-north-1",
},
},
"fips-cn-northwest-1": endpoint{
Hostname: "snowball-fips.cn-northwest-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"sns": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"sqs": service{
Defaults: endpoint{
SSLCommonName: "{region}.queue.{dnsSuffix}",
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"ssm": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"states": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"storagegateway": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"streams.dynamodb": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
CredentialScope: credentialScope{
Service: "dynamodb",
},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"sts": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"support": service{
PartitionEndpoint: "aws-cn-global",
Endpoints: endpoints{
"aws-cn-global": endpoint{
Hostname: "support.cn-north-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-north-1",
},
},
},
},
"swf": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"tagging": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
"transcribe": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{
Hostname: "cn.transcribe.cn-north-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-north-1",
},
},
"cn-northwest-1": endpoint{
Hostname: "cn.transcribe.cn-northwest-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
},
},
},
"workspaces": service{
Endpoints: endpoints{
"cn-northwest-1": endpoint{},
},
},
"xray": service{
Endpoints: endpoints{
"cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
},
}
// AwsUsGovPartition returns the Resolver for AWS GovCloud (US).
func AwsUsGovPartition() Partition {
return awsusgovPartition.Partition()
}
var awsusgovPartition = partition{
ID: "aws-us-gov",
Name: "AWS GovCloud (US)",
DNSSuffix: "amazonaws.com",
RegionRegex: regionRegex{
Regexp: func() *regexp.Regexp {
reg, _ := regexp.Compile("^us\\-gov\\-\\w+\\-\\d+$")
return reg
}(),
},
Defaults: endpoint{
Hostname: "{service}.{region}.{dnsSuffix}",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
Regions: regions{
"us-gov-east-1": region{
Description: "AWS GovCloud (US-East)",
},
"us-gov-west-1": region{
Description: "AWS GovCloud (US-West)",
},
},
Services: services{
"access-analyzer": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "access-analyzer.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "access-analyzer.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"acm": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "acm.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "acm.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"acm-pca": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "acm-pca.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "acm-pca.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"api.detective": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-east-1-fips": endpoint{
Hostname: "api.detective-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "api.detective-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"api.ecr": service{
Endpoints: endpoints{
"fips-dkr-us-gov-east-1": endpoint{
Hostname: "ecr-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-dkr-us-gov-west-1": endpoint{
Hostname: "ecr-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"fips-us-gov-east-1": endpoint{
Hostname: "ecr-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "ecr-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{
Hostname: "api.ecr.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "api.ecr.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"api.sagemaker": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "api-fips.sagemaker.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1-fips-secondary": endpoint{
Hostname: "api.sagemaker.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"apigateway": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"application-autoscaling": service{
Defaults: endpoint{
Hostname: "autoscaling.{region}.amazonaws.com",
Protocols: []string{"http", "https"},
CredentialScope: credentialScope{
Service: "application-autoscaling",
},
},
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Protocols: []string{"http", "https"},
},
"us-gov-west-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
"appstream2": service{
Defaults: endpoint{
Protocols: []string{"https"},
CredentialScope: credentialScope{
Service: "appstream",
},
},
Endpoints: endpoints{
"fips": endpoint{
Hostname: "appstream2-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1": endpoint{},
},
},
"athena": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "athena-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "athena-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"autoscaling": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Protocols: []string{"http", "https"},
},
"us-gov-west-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
"autoscaling-plans": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Protocols: []string{"http", "https"},
},
"us-gov-west-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
"backup": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"batch": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "batch.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "batch.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"clouddirectory": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
"cloudformation": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "cloudformation.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "cloudformation.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"cloudhsm": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
"cloudhsmv2": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "cloudhsm",
},
},
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"cloudtrail": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "cloudtrail.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "cloudtrail.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"codebuild": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-east-1-fips": endpoint{
Hostname: "codebuild-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "codebuild-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"codecommit": service{
Endpoints: endpoints{
"fips": endpoint{
Hostname: "codecommit-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"codedeploy": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-east-1-fips": endpoint{
Hostname: "codedeploy-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "codedeploy-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"codepipeline": service{
Endpoints: endpoints{
"fips-us-gov-west-1": endpoint{
Hostname: "codepipeline-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1": endpoint{},
},
},
"cognito-identity": service{
Endpoints: endpoints{
"fips-us-gov-west-1": endpoint{
Hostname: "cognito-identity-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1": endpoint{},
},
},
"cognito-idp": service{
Endpoints: endpoints{
"fips-us-gov-west-1": endpoint{
Hostname: "cognito-idp-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1": endpoint{},
},
},
"comprehend": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"fips-us-gov-west-1": endpoint{
Hostname: "comprehend-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1": endpoint{},
},
},
"comprehendmedical": service{
Endpoints: endpoints{
"fips-us-gov-west-1": endpoint{
Hostname: "comprehendmedical-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1": endpoint{},
},
},
"config": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "config.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "config.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"connect": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
"datasync": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "datasync-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "datasync-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"directconnect": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "directconnect.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "directconnect.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"dms": service{
Endpoints: endpoints{
"dms-fips": endpoint{
Hostname: "dms.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"docdb": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{
Hostname: "rds.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"ds": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "ds-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "ds-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"dynamodb": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-east-1-fips": endpoint{
Hostname: "dynamodb.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "dynamodb.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"ebs": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"ec2": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "ec2.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "ec2.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"ec2metadata": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "169.254.169.254/latest",
Protocols: []string{"http"},
},
},
},
"ecs": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "ecs-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "ecs-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"eks": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "eks.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "eks.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"elasticache": service{
Endpoints: endpoints{
"fips": endpoint{
Hostname: "elasticache.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"elasticbeanstalk": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "elasticbeanstalk.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "elasticbeanstalk.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"elasticfilesystem": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "elasticfilesystem-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "elasticfilesystem-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"elasticloadbalancing": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "elasticloadbalancing.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "elasticloadbalancing.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
"elasticmapreduce": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "elasticmapreduce.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "elasticmapreduce.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{
Protocols: []string{"https"},
},
},
},
"email": service{
Endpoints: endpoints{
"fips-us-gov-west-1": endpoint{
Hostname: "email-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1": endpoint{},
},
},
"es": service{
Endpoints: endpoints{
"fips": endpoint{
Hostname: "es-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"events": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "events.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "events.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"firehose": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "firehose-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "firehose-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"fms": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "fms-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "fms-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"fsx": service{
Endpoints: endpoints{
"fips-prod-us-gov-east-1": endpoint{
Hostname: "fsx-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-prod-us-gov-west-1": endpoint{
Hostname: "fsx-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"glacier": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "glacier.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "glacier.us-gov-west-1.amazonaws.com",
Protocols: []string{"http", "https"},
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"glue": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "glue-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "glue-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"greengrass": service{
IsRegionalized: boxedTrue,
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"dataplane-us-gov-east-1": endpoint{
Hostname: "greengrass-ats.iot.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"dataplane-us-gov-west-1": endpoint{
Hostname: "greengrass-ats.iot.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"fips-us-gov-east-1": endpoint{
Hostname: "greengrass-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-east-1": endpoint{
Hostname: "greengrass.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "greengrass.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"guardduty": service{
IsRegionalized: boxedTrue,
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-east-1-fips": endpoint{
Hostname: "guardduty.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "guardduty.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"health": service{
Endpoints: endpoints{
"fips-us-gov-west-1": endpoint{
Hostname: "health-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"iam": service{
PartitionEndpoint: "aws-us-gov-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-us-gov-global": endpoint{
Hostname: "iam.us-gov.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"iam-govcloud-fips": endpoint{
Hostname: "iam.us-gov.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"inspector": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "inspector-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "inspector-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"iot": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "execute-api",
},
},
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"iotsecuredtunneling": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"kafka": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"kinesis": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "kinesis.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "kinesis.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"kinesisanalytics": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"kms": service{
Endpoints: endpoints{
"ProdFips": endpoint{
Hostname: "kms-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"lakeformation": service{
Endpoints: endpoints{
"fips-us-gov-west-1": endpoint{
Hostname: "lakeformation-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1": endpoint{},
},
},
"lambda": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "lambda-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "lambda-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"license-manager": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "license-manager-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "license-manager-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"logs": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "logs.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "logs.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"mediaconvert": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{
Hostname: "mediaconvert.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"metering.marketplace": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "aws-marketplace",
},
},
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"models.lex": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "lex",
},
},
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "models-fips.lex.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"monitoring": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "monitoring.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "monitoring.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"neptune": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "rds.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "rds.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"organizations": service{
PartitionEndpoint: "aws-us-gov-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-us-gov-global": endpoint{
Hostname: "organizations.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"fips-aws-us-gov-global": endpoint{
Hostname: "organizations.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"outposts": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "outposts.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "outposts.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"pinpoint": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "mobiletargeting",
},
},
Endpoints: endpoints{
"fips-us-gov-west-1": endpoint{
Hostname: "pinpoint-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "pinpoint.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"polly": service{
Endpoints: endpoints{
"fips-us-gov-west-1": endpoint{
Hostname: "polly-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1": endpoint{},
},
},
"ram": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "ram.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "ram.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"rds": service{
Endpoints: endpoints{
"rds.us-gov-east-1": endpoint{
Hostname: "rds.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"rds.us-gov-west-1": endpoint{
Hostname: "rds.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"redshift": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "redshift.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "redshift.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"rekognition": service{
Endpoints: endpoints{
"rekognition-fips.us-gov-west-1": endpoint{
Hostname: "rekognition-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1": endpoint{},
},
},
"resource-groups": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "resource-groups.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "resource-groups.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"route53": service{
PartitionEndpoint: "aws-us-gov-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-us-gov-global": endpoint{
Hostname: "route53.us-gov.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"fips-aws-us-gov-global": endpoint{
Hostname: "route53.us-gov.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"route53resolver": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"runtime.lex": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "lex",
},
},
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "runtime-fips.lex.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"runtime.sagemaker": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "runtime.sagemaker.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"s3": service{
Defaults: endpoint{
SignatureVersions: []string{"s3", "s3v4"},
HasDualStack: boxedTrue,
DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}",
},
Endpoints: endpoints{
"accesspoint-us-gov-east-1": endpoint{
Hostname: "s3-accesspoint.us-gov-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"accesspoint-us-gov-west-1": endpoint{
Hostname: "s3-accesspoint.us-gov-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"fips-accesspoint-us-gov-east-1": endpoint{
Hostname: "s3-accesspoint-fips.us-gov-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"fips-accesspoint-us-gov-west-1": endpoint{
Hostname: "s3-accesspoint-fips.us-gov-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
},
"fips-us-gov-west-1": endpoint{
Hostname: "s3-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{
Hostname: "s3.us-gov-east-1.amazonaws.com",
Protocols: []string{"http", "https"},
},
"us-gov-west-1": endpoint{
Hostname: "s3.us-gov-west-1.amazonaws.com",
Protocols: []string{"http", "https"},
},
},
},
"s3-control": service{
Defaults: endpoint{
Protocols: []string{"https"},
SignatureVersions: []string{"s3v4"},
HasDualStack: boxedTrue,
DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}",
},
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "s3-control.us-gov-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-east-1-fips": endpoint{
Hostname: "s3-control-fips.us-gov-east-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "s3-control.us-gov-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1-fips": endpoint{
Hostname: "s3-control-fips.us-gov-west-1.amazonaws.com",
SignatureVersions: []string{"s3v4"},
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"secretsmanager": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-east-1-fips": endpoint{
Hostname: "secretsmanager-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "secretsmanager-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"securityhub": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "securityhub-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "securityhub-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"serverlessrepo": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "serverlessrepo.us-gov-east-1.amazonaws.com",
Protocols: []string{"https"},
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "serverlessrepo.us-gov-west-1.amazonaws.com",
Protocols: []string{"https"},
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"servicecatalog": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-east-1-fips": endpoint{
Hostname: "servicecatalog-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "servicecatalog-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"servicecatalog-appregistry": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "servicecatalog-appregistry.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "servicecatalog-appregistry.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"servicequotas": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "servicequotas.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "servicequotas.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"sms": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "sms-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "sms-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"snowball": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "snowball-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "snowball-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"sns": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "sns.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "sns.us-gov-west-1.amazonaws.com",
Protocols: []string{"http", "https"},
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"sqs": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "sqs.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "sqs.us-gov-west-1.amazonaws.com",
SSLCommonName: "{region}.queue.{dnsSuffix}",
Protocols: []string{"http", "https"},
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"ssm": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "ssm.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "ssm.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"states": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "states-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "states.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"storagegateway": service{
Endpoints: endpoints{
"fips": endpoint{
Hostname: "storagegateway-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"streams.dynamodb": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "dynamodb",
},
},
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-east-1-fips": endpoint{
Hostname: "dynamodb.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "dynamodb.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"sts": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-east-1-fips": endpoint{
Hostname: "sts.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "sts.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"support": service{
PartitionEndpoint: "aws-us-gov-global",
Endpoints: endpoints{
"aws-us-gov-global": endpoint{
Hostname: "support.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "support.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"swf": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{
Hostname: "swf.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "swf.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"tagging": service{
Endpoints: endpoints{
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"transcribe": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "fips.transcribe.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "fips.transcribe.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"transfer": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "transfer-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "transfer-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"translate": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "translate-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"waf-regional": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "waf-regional-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "waf-regional-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{
Hostname: "waf-regional.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"us-gov-west-1": endpoint{
Hostname: "waf-regional.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
},
},
"workspaces": service{
Endpoints: endpoints{
"fips-us-gov-west-1": endpoint{
Hostname: "workspaces-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-west-1": endpoint{},
},
},
"xray": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "xray-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "xray-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
},
}
// AwsIsoPartition returns the Resolver for AWS ISO (US).
func AwsIsoPartition() Partition {
return awsisoPartition.Partition()
}
var awsisoPartition = partition{
ID: "aws-iso",
Name: "AWS ISO (US)",
DNSSuffix: "c2s.ic.gov",
RegionRegex: regionRegex{
Regexp: func() *regexp.Regexp {
reg, _ := regexp.Compile("^us\\-iso\\-\\w+\\-\\d+$")
return reg
}(),
},
Defaults: endpoint{
Hostname: "{service}.{region}.{dnsSuffix}",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
Regions: regions{
"us-iso-east-1": region{
Description: "US ISO East",
},
},
Services: services{
"api.ecr": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{
Hostname: "api.ecr.us-iso-east-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-east-1",
},
},
},
},
"api.sagemaker": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"apigateway": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"application-autoscaling": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"autoscaling": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
"cloudformation": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"cloudtrail": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"codedeploy": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"comprehend": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"config": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"datapipeline": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"directconnect": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"dms": service{
Endpoints: endpoints{
"dms-fips": endpoint{
Hostname: "dms.us-iso-east-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-east-1",
},
},
"us-iso-east-1": endpoint{},
},
},
"ds": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"dynamodb": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
"ec2": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"ec2metadata": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "169.254.169.254/latest",
Protocols: []string{"http"},
},
},
},
"ecs": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"elasticache": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"elasticfilesystem": service{
Endpoints: endpoints{
"fips-us-iso-east-1": endpoint{
Hostname: "elasticfilesystem-fips.us-iso-east-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-east-1",
},
},
"us-iso-east-1": endpoint{},
},
},
"elasticloadbalancing": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
"elasticmapreduce": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{
Protocols: []string{"https"},
},
},
},
"es": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"events": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"firehose": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"glacier": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
"health": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"iam": service{
PartitionEndpoint: "aws-iso-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-iso-global": endpoint{
Hostname: "iam.us-iso-east-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-east-1",
},
},
},
},
"kinesis": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"kms": service{
Endpoints: endpoints{
"ProdFips": endpoint{
Hostname: "kms-fips.us-iso-east-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-east-1",
},
},
"us-iso-east-1": endpoint{},
},
},
"lambda": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"logs": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"medialive": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"mediapackage": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"monitoring": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"outposts": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"ram": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"rds": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"redshift": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"route53": service{
PartitionEndpoint: "aws-iso-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-iso-global": endpoint{
Hostname: "route53.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-east-1",
},
},
},
},
"runtime.sagemaker": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"s3": service{
Defaults: endpoint{
SignatureVersions: []string{"s3v4"},
},
Endpoints: endpoints{
"us-iso-east-1": endpoint{
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
},
},
"secretsmanager": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"snowball": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"sns": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
"sqs": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
"ssm": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"states": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"streams.dynamodb": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
CredentialScope: credentialScope{
Service: "dynamodb",
},
},
Endpoints: endpoints{
"us-iso-east-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
"sts": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"support": service{
PartitionEndpoint: "aws-iso-global",
Endpoints: endpoints{
"aws-iso-global": endpoint{
Hostname: "support.us-iso-east-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-east-1",
},
},
},
},
"swf": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"transcribe": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"transcribestreaming": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"translate": service{
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
"workspaces": service{
Endpoints: endpoints{
"us-iso-east-1": endpoint{},
},
},
},
}
// AwsIsoBPartition returns the Resolver for AWS ISOB (US).
func AwsIsoBPartition() Partition {
return awsisobPartition.Partition()
}
var awsisobPartition = partition{
ID: "aws-iso-b",
Name: "AWS ISOB (US)",
DNSSuffix: "sc2s.sgov.gov",
RegionRegex: regionRegex{
Regexp: func() *regexp.Regexp {
reg, _ := regexp.Compile("^us\\-isob\\-\\w+\\-\\d+$")
return reg
}(),
},
Defaults: endpoint{
Hostname: "{service}.{region}.{dnsSuffix}",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
Regions: regions{
"us-isob-east-1": region{
Description: "US ISOB East (Ohio)",
},
},
Services: services{
"api.ecr": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{
Hostname: "api.ecr.us-isob-east-1.sc2s.sgov.gov",
CredentialScope: credentialScope{
Region: "us-isob-east-1",
},
},
},
},
"application-autoscaling": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"autoscaling": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"cloudformation": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"cloudtrail": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"codedeploy": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"config": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"directconnect": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"dms": service{
Endpoints: endpoints{
"dms-fips": endpoint{
Hostname: "dms.us-isob-east-1.sc2s.sgov.gov",
CredentialScope: credentialScope{
Region: "us-isob-east-1",
},
},
"us-isob-east-1": endpoint{},
},
},
"dynamodb": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"ec2": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"ec2metadata": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-global": endpoint{
Hostname: "169.254.169.254/latest",
Protocols: []string{"http"},
},
},
},
"ecs": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"elasticache": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"elasticloadbalancing": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{
Protocols: []string{"https"},
},
},
},
"elasticmapreduce": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"es": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"events": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"glacier": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"health": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"iam": service{
PartitionEndpoint: "aws-iso-b-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-iso-b-global": endpoint{
Hostname: "iam.us-isob-east-1.sc2s.sgov.gov",
CredentialScope: credentialScope{
Region: "us-isob-east-1",
},
},
},
},
"kinesis": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"kms": service{
Endpoints: endpoints{
"ProdFips": endpoint{
Hostname: "kms-fips.us-isob-east-1.sc2s.sgov.gov",
CredentialScope: credentialScope{
Region: "us-isob-east-1",
},
},
"us-isob-east-1": endpoint{},
},
},
"lambda": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"license-manager": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"logs": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"monitoring": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"rds": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"redshift": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"route53": service{
PartitionEndpoint: "aws-iso-b-global",
IsRegionalized: boxedFalse,
Endpoints: endpoints{
"aws-iso-b-global": endpoint{
Hostname: "route53.sc2s.sgov.gov",
CredentialScope: credentialScope{
Region: "us-isob-east-1",
},
},
},
},
"s3": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
SignatureVersions: []string{"s3v4"},
},
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"snowball": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"sns": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"sqs": service{
Defaults: endpoint{
SSLCommonName: "{region}.queue.{dnsSuffix}",
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"ssm": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"states": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"streams.dynamodb": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
CredentialScope: credentialScope{
Service: "dynamodb",
},
},
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"sts": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
"support": service{
PartitionEndpoint: "aws-iso-b-global",
Endpoints: endpoints{
"aws-iso-b-global": endpoint{
Hostname: "support.us-isob-east-1.sc2s.sgov.gov",
CredentialScope: credentialScope{
Region: "us-isob-east-1",
},
},
},
},
"swf": service{
Endpoints: endpoints{
"us-isob-east-1": endpoint{},
},
},
},
}<|fim▁end|> | "cn-northwest-1": endpoint{}, |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.