prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>IpWatch.java<|end_file_name|><|fim▁begin|>/* * $Id: IpWatch.java 3905 2008-07-28 13:55:03Z uckelman $ * * Copyright (c) 2007-2008 by Rodney Kinney * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License (LGPL) as published by the Free Software Foundation. * * This library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, copies are available * at http://www.opensource.org. */ package VASSAL.chat.peer2peer; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.net.InetAddress; import java.net.UnknownHostException; public class IpWatch implements Runnable { private PropertyChangeSupport propSupport = new PropertyChangeSupport(this); private String currentIp; private long wait = 1000; public IpWatch(long waitInterval) { wait = waitInterval; currentIp = findIp(); } public IpWatch() { this(1000); } public void addPropertyChangeListener(PropertyChangeListener l) { propSupport.addPropertyChangeListener(l); } public void run() { while (true) { String newIp = findIp(); propSupport.firePropertyChange("address", currentIp, newIp); //$NON-NLS-1$ currentIp = newIp;<|fim▁hole|> try { Thread.sleep(wait); } catch (InterruptedException ex) { } } } public String getCurrentIp() { return currentIp; } private String findIp() { try { InetAddress a[] = InetAddress.getAllByName(InetAddress.getLocalHost().getHostName()); final StringBuilder buff = new StringBuilder(); for (int i = 0; i < a.length; ++i) { buff.append(a[i].getHostAddress()); if (i < a.length - 1) { buff.append(","); //$NON-NLS-1$ } } return buff.toString(); } // FIXME: review error message catch (UnknownHostException e) { return null; } } public static void main(String[] args) { IpWatch w = new IpWatch(); w.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { System.out.println("Address = " + evt.getNewValue()); //$NON-NLS-1$ } }); System.out.println("Address = " + w.getCurrentIp()); //$NON-NLS-1$ new Thread(w).start(); } }<|fim▁end|>
<|file_name|>test-api.ts<|end_file_name|><|fim▁begin|>// Typescript adaptation of mithril's test suite. // Not intended to be run; only to compile & check types. import * as m from 'mithril'; import * as Stream from 'mithril/stream'; const FRAME_BUDGET = 100; { const vnode = m('div'); console.assert(vnode.tag === 'div'); } { const vnode = m.trust('<br>'); } { const vnode = m.fragment({ key: 123 }, [m('div')]); console.assert((vnode.children as Array<m.Vnode<any, any>>).length === 1); console.assert((vnode.children as Array<m.Vnode<any, any>>)[0].tag === 'div'); } { const params = m.parseQueryString('?a=1&b=2'); const query = m.buildQueryString({ a: 1, b: 2 }); } { const { params, path } = m.parsePathname('/api/user/1'); console.assert(params != null); console.assert(typeof path === 'string'); const url = m.buildPathname('/api/user/:id', { id: 1 }); console.assert(url.endsWith('/1')); } { const root = window.document.createElement('div'); m.render(root, m('div')); console.assert(root.childNodes.length === 1); } { const root = window.document.createElement('div'); m.mount(root, { view: () => m('div') }); console.assert(root.childNodes.length === 1); console.assert(root.firstChild!.nodeName === 'DIV'); } { const root = window.document.createElement('div'); m.route(root, '/a', { '/a': { view: () => m('div') }, }); setTimeout(() => { console.assert(root.childNodes.length === 1); console.assert(root.firstChild!.nodeName === 'DIV'); }, FRAME_BUDGET); } { const root = window.document.createElement('div'); m.route.prefix = '#'; m.route(root, '/a', { '/a': { view: () => m('div') }, }); setTimeout(() => { console.assert(root.childNodes.length === 1); console.assert(root.firstChild!.nodeName === 'DIV'); }, FRAME_BUDGET); } { const root = window.document.createElement('div'); m.route(root, '/a', { '/a': { view: () => m('div') }, }); setTimeout(() => { console.assert(m.route.get() === '/a'); }, FRAME_BUDGET); } { const root = window.document.createElement('div'); m.route(root, '/a', { '/:id': { view: () => m('div') }, }); setTimeout(() => { m.route.set('/b'); setTimeout(() => { console.assert(m.route.get() === '/b'); }, FRAME_BUDGET); }, FRAME_BUDGET); } { let count = 0; const root = window.document.createElement('div'); m.mount(root, { view() { count++; }, }); setTimeout(() => { m.redraw(); console.assert(count === 2); }, FRAME_BUDGET); } // // Additional tests by andraaspar // //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/hyperscript.html#components //////////////////////////////////////////////////////////////////////////////// { // define a component const Greeter: m.Comp<{ style: string }> = { view(vnode) { return m('div', vnode.attrs, ['Hello ', vnode.children]); }, }; // consume it m(Greeter, { style: 'color:red;' }, 'world'); } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/hyperscript.html#keys //////////////////////////////////////////////////////////////////////////////// { const users = [ { id: 1, name: 'John' }, { id: 2, name: 'Mary' }, ]; const userInputs = (users: Array<{ id: number; name: string }>) => { return users.map(u => { return m('input', { key: u.id }, u.name); }); }; m.render(document.body, userInputs(users)); } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/components.html#state //////////////////////////////////////////////////////////////////////////////// { const ComponentWithInitialState: m.Comp<{}, { data: string }> = { data: 'Initial content', view(vnode) { return m('div', vnode.state.data); }, }; m(ComponentWithInitialState); } { const ComponentWithDynamicState: m.Comp<{ text: string }, { data?: string }> = { oninit(vnode) { vnode.state.data = vnode.attrs.text; }, view(vnode) { return m('div', vnode.state.data); }, }; m(ComponentWithDynamicState, { text: 'Hello' }); } { const ComponentUsingThis: m.Comp<{ text: string }, { data?: string }> = { oninit(vnode) { this.data = vnode.attrs.text; }, view(vnode) { return m('div', this.data); }, }; m(ComponentUsingThis, { text: 'Hello' }); } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/lifecycle-methods.html //////////////////////////////////////////////////////////////////////////////// { const Fader: m.Comp = { onbeforeremove(vnode) { vnode.dom.classList.add('fade-out'); return new Promise(resolve => { setTimeout(resolve, 1000); }); }, view() { return m('div', 'Bye'); }, }; } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/route.html#wrapping-a-layout-component //////////////////////////////////////////////////////////////////////////////// { const Home = { view() { return 'Welcome'; }, }; const state = { term: '', search() { // save the state for this route // this is equivalent to `history.replaceState({term: state.term}, null, location.href)` m.route.set(m.route.get(), null, { replace: true, state: { term: state.term } }); // navigate away location.href = 'https://google.com/?q=' + state.term; }, }; const Form: m.Comp<{ term: string }> = { oninit(vnode) { state.term = vnode.attrs.term || ''; // populated from the `history.state` property if the user presses the back button }, view() { return m('form', [ m("input[placeholder='Search']", { oninput: (e: { currentTarget: HTMLInputElement }) => { state.term = e.currentTarget.value; }, value: state.term, }), m('button', { onclick: state.search }, 'Search'), ]); }, }; const Layout: m.Comp = { view(vnode) { return m('.layout', vnode.children); }, }; // example 1 m.route(document.body, '/', { '/': { view() { return m(Layout, m(Home)); }, }, '/form': { view() { return m(Layout, m(Form)); }, }, }); // example 2 m.route(document.body, '/', { '/': { render() { return m(Layout, m(Home)); }, }, '/form': { render() { return m(Layout, m(Form)); }, }, }); // functionally equivalent to example 1 const Anon1 = { view() { return m(Layout, m(Home)); }, }; const Anon2 = { view() { return m(Layout, m(Form)); }, }; m.route(document.body, '/', { '/': { render() { return m(Anon1); }, }, '/form': { render() { return m(Anon2); }, }, }); } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/route.html#preloading-data //////////////////////////////////////////////////////////////////////////////// { const state = { users: [] as any[], loadUsers() { return m.request<any>('/api/v1/users').then(users => { state.users = users; }); }, }; m.route(document.body, '/user/list', { '/user/list': { onmatch: state.loadUsers, render() { return state.users.map(user => m('div', user.id)); }, }, }); } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/request.html#monitoring-progress //////////////////////////////////////////////////////////////////////////////// { let progress = 0; m.mount(document.body, { view() { return [m('input[type=file]', { onchange: upload }), progress + '% completed']; }, }); const upload = (e: Event) => { const file = ((e.target as HTMLInputElement).files as FileList)[0]; const data = new FormData(); data.append('myfile', file); m.request({ method: 'POST', url: '/api/v1/upload', body: data, config: xhr => { xhr.addEventListener('progress', e => { progress = e.loaded / e.total; m.redraw(); // tell Mithril that data changed and a re-render is needed }); }, }); }; } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/request.html#casting-response-to-a-type //////////////////////////////////////////////////////////////////////////////// { // Start rewrite to TypeScript class User { name: string; constructor(data: any) { this.name = `${data.firstName} ${data.lastName}`; } } // End rewrite to TypeScript // function User(data) { // this.name = `${data.firstName} ${data.lastName}` // } m.request<User[]>({ method: 'GET', url: '/api/v1/users', type: User, }).then(users => { console.log(users[0].name); // logs a name }); } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/request.html#non-json-responses //////////////////////////////////////////////////////////////////////////////// { m.request<string>({ method: 'GET', url: '/files/icon.svg', deserialize: value => value, }).then(svg => { m.render(document.body, m.trust(svg)); }); } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/jsonp.html //////////////////////////////////////////////////////////////////////////////// { m.jsonp({ url: '/api/v1/users/:id', params: { id: 1 }, callbackKey: 'callback', }).then(result => { console.log(result); }); } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/fragment.html //////////////////////////////////////////////////////////////////////////////// { const groupVisible = true; const log = () => { console.log('group is now visible'); }; m('ul', [ m('li', 'child 1'), m('li', 'child 2'), groupVisible ? m.fragment({ oninit: log }, [ // a fragment containing two elements m('li', 'child 3'), m('li', 'child 4'), ]) : null, ]); } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/stream.html#computed-properties //////////////////////////////////////////////////////////////////////////////// { const firstName = Stream('John'); const lastName = Stream('Doe'); const fullName = Stream.merge([firstName, lastName]).map(values => { return values.join(' '); }); console.log(fullName()); // logs "John Doe" firstName('Mary'); console.log(fullName()); // logs "Mary Doe" } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/stream.html#chaining-streams //////////////////////////////////////////////////////////////////////////////// { const skipped = Stream(1).map(value => { return Stream.SKIP; }); skipped.map(() => { // never runs }); } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/stream.html#combining-streams //////////////////////////////////////////////////////////////////////////////// { const a = Stream(5); const b = Stream(7); const added = Stream.combine( (a: Stream<number>, b: Stream<number>) => { return a() + b(); }, [a, b], ); console.log(added()); // logs 12 } //////////////////////////////////////////////////////////////////////////////// // http://mithril.js.org/stream.html#ended-state //////////////////////////////////////////////////////////////////////////////// { const value = Stream<number>(); const doubled = value.map(value => value * 2); value.end(true); // set to ended state value(5); console.log(doubled()); } //////////////////////////////////////////////////////////////////////////////// // https://github.com/lhorie/mithril.js/blob/master/examples/animation/mosaic.html //////////////////////////////////////////////////////////////////////////////// // Excerpt { const root = document.getElementById('root')!; const empty: any[] = []; const full: any[] = []; for (let i = 0; i < 100; i++) full.push(i); let cells: any[]; const view = () => m( '.container', cells.map(i => m('.slice', { style: { backgroundPosition: `${(i % 10) * 11}% ${Math.floor(i / 10) * 11}%` }, onbeforeremove: exit, }), ), ); const exit = (vnode: m.VnodeDOM<any, any>) => { vnode.dom.classList.add('exit'); return new Promise(resolve => { setTimeout(resolve, 1000); }); }; const run = () => { cells = cells === full ? empty : full; m.render(root, [view()]); setTimeout(run, 2000); }; run(); } //////////////////////////////////////////////////////////////////////////////// // https://github.com/lhorie/mithril.js/blob/master/examples/editor/index.html //////////////////////////////////////////////////////////////////////////////// // Excerpt { // Start extra declarations const marked = (v: string) => v; // End extra declarations // model const state = { text: '# Markdown Editor\n\nType on the left panel and see the result on the right panel', update(value: string) { state.text = value; }, }; // view const Editor = { view() { return [ m('textarea.input', { oninput: (e: { currentTarget: HTMLTextAreaElement }) => { state.update(e.currentTarget.value); }, value: state.text, }), m('.preview', m.trust(marked(state.text))), ]; }, }; m.mount(document.getElementById('editor')!, Editor); } //////////////////////////////////////////////////////////////////////////////// // https://github.com/lhorie/mithril.js/blob/master/examples/todomvc/todomvc.js //////////////////////////////////////////////////////////////////////////////// { // model const state = { dispatch(action: string, args?: any) { (state as any)[action].apply(state, args || []); requestAnimationFrame(() => { localStorage['todos-mithril'] = JSON.stringify(state.todos); }); }, todos: JSON.parse(localStorage['todos-mithril'] || '[]'), editing: null as any, filter: '', remaining: 0, todosByStatus: [] as any[], showing: undefined as any, createTodo(title: string) { state.todos.push({ title: title.trim(), completed: false }); }, setStatuses(completed: boolean) { for (const todo of state.todos) todo.completed = completed; }, setStatus(todo: any, completed: boolean) { todo.completed = completed; }, destroy(todo: any) { const index = state.todos.indexOf(todo); if (index > -1) state.todos.splice(index, 1); }, clear() { for (let i = 0; i < state.todos.length; i++) { if (state.todos[i].completed) state.destroy(state.todos[i--]); } }, edit(todo: any) { state.editing = todo; }, update(title: string) { if (state.editing != null) { state.editing.title = title.trim(); if (state.editing.title === '') state.destroy(state.editing); state.editing = null; } }, reset() { state.editing = null; }, computed(vnode: m.Vnode<any, any>) { state.showing = vnode.attrs.status || ''; state.remaining = state.todos.filter((todo: any) => !todo.completed).length; state.todosByStatus = state.todos.filter((todo: any) => { switch (state.showing) { case '': return true; case 'active': return !todo.completed; case 'completed': return todo.completed; } }); }, }; // view const Todos: m.Comp< {}, { add(e: Event): void; toggleAll(): void; toggle(todo: any): void; focus(vnode: m.VnodeDOM<any, any>, todo: any): void; save(e: KeyboardEvent): void; } > = { add(e: KeyboardEvent) { if (e.keyCode === 13) { state.dispatch('createTodo', [(e.target as HTMLInputElement).value]); (e.target as HTMLInputElement).value = ''; } }, toggleAll() { state.dispatch('setStatuses', [(document.getElementById('toggle-all') as HTMLInputElement).checked]); }, toggle(todo: any) { state.dispatch('setStatus', [todo, !todo.completed]); }, focus(vnode: m.VnodeDOM<any, any>, todo: any) { if (todo === state.editing && vnode.dom !== document.activeElement) { const el = vnode.dom as HTMLInputElement; el.value = todo.title; el.focus(); el.selectionStart = el.selectionEnd = todo.title.length; } }, save(e: KeyboardEvent) { if (e.keyCode === 13 || e.type === 'blur') state.dispatch('update', [(e.target as HTMLInputElement).value]); else if (e.keyCode === 27) state.dispatch('reset'); }, oninit: state.computed, onbeforeupdate: state.computed, view(vnode) { const ui = vnode.state; return [ m('header.header', [ m('h1', 'todos'), m("input#new-todo[placeholder='What needs to be done?'][autofocus]", { onkeypress: ui.add }), ]),<|fim▁hole|> m("label[for='toggle-all']", { onclick: ui.toggleAll }, 'Mark all as complete'), m('ul#todo-list', [ state.todosByStatus.map((todo: any) => { return m( 'li', { class: `${todo.completed ? 'completed' : ''} ${ todo === state.editing ? 'editing' : '' }`, }, [ m('.view', [ m("input.toggle[type='checkbox']", { checked: todo.completed, onclick: () => { ui.toggle(todo); }, }), m( 'label', { ondblclick: () => { state.dispatch('edit', [todo]); }, }, todo.title, ), m('button.destroy', { onclick: () => { state.dispatch('destroy', [todo]); }, }), ]), m('input.edit', { onupdate(vnode: m.VnodeDOM<any, any>) { ui.focus(vnode, todo); }, onkeypress: ui.save, onblur: ui.save, }), ], ); }), ]), ]), state.todos.length ? m('footer#footer', [ m('span#todo-count', [ m('strong', state.remaining), state.remaining === 1 ? ' item left' : ' items left', ]), m('ul#filters', [ // m("li", m("a[href='/']", {oncreate: m.route.link, class: state.showing === "" ? "selected" : ""}, "All")), // m("li", m("a[href='/active']", {oncreate: m.route.link, class: state.showing === "active" ? "selected" : ""}, "Active")), // m("li", m("a[href='/completed']", {oncreate: m.route.link, class: state.showing === "completed" ? "selected" : ""}, "Completed")), m(m.route.Link, { href: '/' }, 'All'), m(m.route.Link, { href: '/active' }, 'Active'), m(m.route.Link, { href: '/completed' }, 'Completed'), ]), m( 'button#clear-completed', { onclick: () => { state.dispatch('clear'); }, }, 'Clear completed', ), ]) : null, ]; }, }; m.route(document.getElementById('todoapp')!, '/', { '/': Todos, '/:status': Todos, }); }<|fim▁end|>
m('section#main', { style: { display: state.todos.length > 0 ? '' : 'none' } }, [ m("input#toggle-all[type='checkbox']", { checked: state.remaining === 0, onclick: ui.toggleAll }),
<|file_name|>loadjs.js<|end_file_name|><|fim▁begin|>loadjs = (function () { /** * Global dependencies. * @global {Object} document - DOM */ var devnull = function() {}, bundleIdCache = {}, bundleResultCache = {}, bundleCallbackQueue = {}; /** * Subscribe to bundle load event. * @param {string[]} bundleIds - Bundle ids * @param {Function} callbackFn - The callback function */ function subscribe(bundleIds, callbackFn) { // listify bundleIds = bundleIds.push ? bundleIds : [bundleIds]; var depsNotFound = [], i = bundleIds.length, numWaiting = i, fn, bundleId, r, q; // define callback function fn = function (bundleId, pathsNotFound) { if (pathsNotFound.length) depsNotFound.push(bundleId); numWaiting--; if (!numWaiting) callbackFn(depsNotFound); }; // register callback while (i--) { bundleId = bundleIds[i]; // execute callback if in result cache r = bundleResultCache[bundleId]; if (r) { fn(bundleId, r);<|fim▁hole|> q = bundleCallbackQueue[bundleId] = bundleCallbackQueue[bundleId] || []; q.push(fn); } } /** * Publish bundle load event. * @param {string} bundleId - Bundle id * @param {string[]} pathsNotFound - List of files not found */ function publish(bundleId, pathsNotFound) { // exit if id isn't defined if (!bundleId) return; var q = bundleCallbackQueue[bundleId]; // cache result bundleResultCache[bundleId] = pathsNotFound; // exit if queue is empty if (!q) return; // empty callback queue while (q.length) { q[0](bundleId, pathsNotFound); q.splice(0, 1); } } /** * Load individual file. * @param {string} path - The file path * @param {Function} callbackFn - The callback function */ function loadFile(path, callbackFn, args, numTries) { var doc = document, async = args.async, maxTries = (args.numRetries || 0) + 1, beforeCallbackFn = args.before || devnull, isCss, e; numTries = numTries || 0; if (/\.css$/.test(path)) { isCss = true; // css e = doc.createElement('link'); e.rel = 'stylesheet'; e.href = path; } else { // javascript e = doc.createElement('script'); e.src = path; e.async = async === undefined ? true : async; } e.onload = e.onerror = e.onbeforeload = function (ev) { var result = ev.type[0]; // Note: The following code isolates IE using `hideFocus` and treats empty // stylesheets as failures to get around lack of onerror support if (isCss && 'hideFocus' in e) { try { if (!e.sheet.cssText.length) result = 'e'; } catch (x) { // sheets objects created from load errors don't allow access to // `cssText` result = 'e'; } } // handle retries in case of load failure if (result == 'e') { // increment counter numTries += 1; // exit function and try again if (numTries < maxTries) { return loadFile(path, callbackFn, args, numTries); } } // execute callback callbackFn(path, result, ev.defaultPrevented); }; // execute before callback beforeCallbackFn(path, e); // add to document doc.head.appendChild(e); } /** * Load multiple files. * @param {string[]} paths - The file paths * @param {Function} callbackFn - The callback function */ function loadFiles(paths, callbackFn, args) { // listify paths paths = paths.push ? paths : [paths]; var numWaiting = paths.length, x = numWaiting, pathsNotFound = [], fn, i; // define callback function fn = function(path, result, defaultPrevented) { // handle error if (result == 'e') pathsNotFound.push(path); // handle beforeload event. If defaultPrevented then that means the load // will be blocked (ex. Ghostery/ABP on Safari) if (result == 'b') { if (defaultPrevented) pathsNotFound.push(path); else return; } numWaiting--; if (!numWaiting) callbackFn(pathsNotFound); }; // load scripts for (i=0; i < x; i++) loadFile(paths[i], fn, args); } /** * Initiate script load and register bundle. * @param {(string|string[])} paths - The file paths * @param {(string|Function)} [arg1] - The bundleId or success callback * @param {Function} [arg2] - The success or error callback * @param {Function} [arg3] - The error callback */ function loadjs(paths, arg1, arg2) { var bundleId, args; // bundleId (if string) if (arg1 && arg1.trim) bundleId = arg1; // args (default is {}) args = (bundleId ? arg2 : arg1) || {}; // throw error if bundle is already defined if (bundleId) { if (bundleId in bundleIdCache) { throw "LoadJS"; } else { bundleIdCache[bundleId] = true; } } // load scripts loadFiles(paths, function (pathsNotFound) { // success and error callbacks if (pathsNotFound.length) (args.error || devnull)(pathsNotFound); else (args.success || devnull)(); // publish bundle load event publish(bundleId, pathsNotFound); }, args); } /** * Execute callbacks when dependencies have been satisfied. * @param {(string|string[])} deps - List of bundle ids * @param {Object} args - success/error arguments */ loadjs.ready = function ready(deps, args) { // subscribe to bundle load event subscribe(deps, function (depsNotFound) { // execute callbacks if (depsNotFound.length) (args.error || devnull)(depsNotFound); else (args.success || devnull)(); }); return loadjs; }; /** * Manually satisfy bundle dependencies. * @param {string} bundleId - The bundle id */ loadjs.done = function done(bundleId) { publish(bundleId, []); }; /** * Reset loadjs dependencies statuses */ loadjs.reset = function reset() { bundleIdCache = {}; bundleResultCache = {}; bundleCallbackQueue = {}; }; /** * Determine if bundle has already been defined * @param String} bundleId - The bundle id */ loadjs.isDefined = function isDefined(bundleId) { return bundleId in bundleIdCache; }; // export return loadjs; })();<|fim▁end|>
continue; } // add to callback queue
<|file_name|>fake_blobstore_factory.go<|end_file_name|><|fim▁begin|>package fakes<|fim▁hole|> biblobstore "github.com/cloudfoundry/bosh-cli/blobstore" ) type FakeBlobstoreFactory struct { CreateBlobstoreURL string CreateBlobstore biblobstore.Blobstore CreateErr error } func NewFakeBlobstoreFactory() *FakeBlobstoreFactory { return &FakeBlobstoreFactory{} } func (f *FakeBlobstoreFactory) Create(blobstoreURL string) (biblobstore.Blobstore, error) { f.CreateBlobstoreURL = blobstoreURL return f.CreateBlobstore, f.CreateErr }<|fim▁end|>
import (
<|file_name|>DataSetSelectionTable.java<|end_file_name|><|fim▁begin|>package idare.imagenode.internal.GUI.DataSetController; import idare.imagenode.ColorManagement.ColorScalePane; import idare.imagenode.Interfaces.DataSets.DataSet; import idare.imagenode.Interfaces.Layout.DataSetLayoutProperties; import idare.imagenode.internal.GUI.DataSetController.DataSetSelectionModel.ColorPaneBox; import idare.imagenode.internal.GUI.DataSetController.DataSetSelectionModel.ComboBoxRenderer; import javax.swing.JTable; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; /** * A DataSetSelectionTable, that is specific to the {@link DataSetSelectionModel}, using its unique renderers and editors. * @author Thomas Pfau * */ public class DataSetSelectionTable extends JTable { DataSetSelectionModel tablemodel; public DataSetSelectionTable(DataSetSelectionModel mod) { super(mod); tablemodel = mod; } /** * Move the selected entry (we assume single selection) down one row. * If the selected row is already the top row, nothing happens. */ public void moveEntryUp() { int row = getSelectedRow(); if(row > 0) { tablemodel.moveRowUp(row); } getSelectionModel().setSelectionInterval(row-1, row-1); } /** * Move the selected entry (we assume single selection) down one row. * If the selected row is already the last row, nothing happens. */ public void moveEntryDown() { int row = getSelectedRow(); if(row >= 0 & row < getRowCount()-1 ) { tablemodel.moveRowDown(row); } getSelectionModel().setSelectionInterval(row+1, row+1); } @Override public TableCellEditor getCellEditor(int row, int column) { Object value = super.getValueAt(row, column); if(value != null) { // we need very specific Editors for ColorScales and Dataset Properties. if(value instanceof DataSetLayoutProperties) { return tablemodel.getPropertiesEditor(row); } if(value instanceof ColorScalePane) { return tablemodel.getColorScaleEditor(row); } if(value instanceof DataSet) { return tablemodel.getDataSetEditor(row); } return getDefaultEditor(value.getClass()); } return super.getCellEditor(row, column); } @Override public TableCellRenderer getCellRenderer(int row, int column) { Object value = super.getValueAt(row, column); if(value != null) { // we need very specific renderers for ColorScales and Dataset Properties. if(value instanceof ComboBoxRenderer || value instanceof DataSetLayoutProperties) { TableCellRenderer current = tablemodel.getPropertiesRenderer(row); if(current != null) return current; else return super.getCellRenderer(row, column); } if(value instanceof ColorPaneBox|| value instanceof ColorScalePane) { TableCellRenderer current = tablemodel.getColorScaleRenderer(row);<|fim▁hole|> return current; else return super.getCellRenderer(row, column); } return getDefaultRenderer(value.getClass()); } return super.getCellRenderer(row, column); } }<|fim▁end|>
if(current != null)
<|file_name|>LossOfControl.ts<|end_file_name|><|fim▁begin|>import { OvaleDebug } from "./Debug"; import { OvaleProfiler } from "./Profiler"; import { Ovale } from "./Ovale"; import { OvaleState } from "./State"; import { RegisterRequirement, UnregisterRequirement, Tokens } from "./Requirement"; import aceEvent from "@wowts/ace_event-3.0"; import { C_LossOfControl, GetTime } from "@wowts/wow-mock"; import { LuaArray, pairs } from "@wowts/lua"; import { insert } from "@wowts/table"; import { sub, upper } from "@wowts/string"; interface LossOfControlEventInfo{ locType: string; spellID: number; startTime: number, duration: number, } export let OvaleLossOfControl:OvaleLossOfControlClass; const OvaleLossOfControlBase = OvaleProfiler.RegisterProfiling(OvaleDebug.RegisterDebugging(Ovale.NewModule("OvaleLossOfControl", aceEvent))) class OvaleLossOfControlClass extends OvaleLossOfControlBase { lossOfControlHistory: LuaArray<LossOfControlEventInfo>; OnInitialize() { this.Debug("Enabled LossOfControl module"); this.lossOfControlHistory = {}; this.RegisterEvent("LOSS_OF_CONTROL_ADDED"); RegisterRequirement("lossofcontrol", this.RequireLossOfControlHandler); } OnDisable() { this.Debug("Disabled LossOfControl module"); this.lossOfControlHistory = {}; this.UnregisterEvent("LOSS_OF_CONTROL_ADDED"); UnregisterRequirement("lossofcontrol"); } LOSS_OF_CONTROL_ADDED(event: string, eventIndex: number){ this.Debug("GetEventInfo:", eventIndex, C_LossOfControl.GetEventInfo(eventIndex)); let [locType, spellID, , , startTime, , duration] = C_LossOfControl.GetEventInfo(eventIndex); let data: LossOfControlEventInfo = { locType: upper(locType), spellID: spellID, startTime: startTime || GetTime(), duration: duration || 10, } insert(this.lossOfControlHistory, data); } RequireLossOfControlHandler = (spellId: number, atTime: number, requirement:string, tokens: Tokens, index: number, targetGUID: string):[boolean, string, number] => { let verified: boolean = false; let locType = <string>tokens[index]; index = index + 1; <|fim▁hole|> if (locType) { let required = true; if (sub(locType, 1, 1) === "!") { required = false; locType = sub(locType, 2); } let hasLoss = this.HasLossOfControl(locType, atTime); verified = (required && hasLoss) || (!required && !hasLoss); } else { Ovale.OneTimeMessage("Warning: requirement '%s' is missing a locType argument.", requirement); } return [verified, requirement, index]; } HasLossOfControl = function(locType: string, atTime: number) { let lowestStartTime: number|undefined = undefined; let highestEndTime: number|undefined = undefined; for (const [, data] of pairs<LossOfControlEventInfo>(this.lossOfControlHistory)) { if (upper(locType) == data.locType && (data.startTime <= atTime && atTime <= data.startTime+data.duration)) { if (lowestStartTime == undefined || lowestStartTime > data.startTime) { lowestStartTime = data.startTime; } if (highestEndTime == undefined || highestEndTime < data.startTime + data.duration) { highestEndTime = data.startTime+data.duration; } } } return lowestStartTime != undefined && highestEndTime != undefined; } CleanState(): void { } InitializeState(): void { } ResetState(): void { } } OvaleLossOfControl = new OvaleLossOfControlClass(); OvaleState.RegisterState(OvaleLossOfControl);<|fim▁end|>
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from frontend import views from rest_framework import routers from django.conf.urls import patterns, url, include router = routers.DefaultRouter() router.register(r'categories', views.CategoryViewSet) router.register(r'packages', views.PackageViewSet) router.register(r'files', views.FileViewSet) router.register(r'clients', views.ClientViewSet) router.register(r'jobs', views.JobViewSet)<|fim▁hole|> url(r'^$', views.index, name='index'), url(r'^login/$', views.user_login, name='user_login'), url(r'^logout/$', views.user_logout, name='user_logout'), url(r'^profile/$', views.user_profile, name='user_profile'), url(r'^categories/$', views.categories, name='categories'), url(r'^categories/add/$', views.category_add, name='category_add'), url(r'^categories/(?P<category_name>\w+)/change/$', views.category_change, name='category_change'), url(r'^categories/(?P<category_name>\w+)/delete/$', views.category_delete, name='category_delete'), url(r'^packages/$', views.packages, name='packages'), url(r'^packages/add/$', views.package_add, name='package_add'), url(r'^packages/(?P<package_id>\d+)/$', views.package_view, name='package_view'), url(r'^packages/(?P<package_id>\d+)/change/$', views.package_change, name='package_change'), url(r'^packages/(?P<package_id>\d+)/delete/$', views.package_delete, name='package_delete'), url(r'^clients/$', views.clients, name='clients'), url(r'^clients/add/$', views.client_add, name='client_add'), url(r'^clients/(?P<client_id>\d+)/change/$', views.client_change, name='client_change'), url(r'^clients/(?P<client_id>\d+)/delete/$', views.client_delete, name='client_delete'), url(r'^clients/(?P<client_id>\d+)/discover/$', views.client_discover, name='client_discover'), url(r'^clients/(?P<client_id>\d+)/history/$', views.client_history, name='client_history'), url(r'^jobs/$', views.jobs, name='jobs'), url(r'^jobs/add/$', views.job_add, name='job_add'), url(r'^jobs/history/$', views.job_history, name='job_history'), url(r'^jobs/(?P<job_id>\d+)/$', views.job_view, name='job_view'), url(r'^jobs/(?P<job_id>\d+)/delete/$', views.job_delete, name='job_delete'), url(r'api/', include(router.urls)) )<|fim▁end|>
router.register(r'packageavailability', views.ClientPackageAvailabilityViewSet) router.register(r'fileavailability', views.ClientFileAvailabilityViewSet) urlpatterns = patterns('',
<|file_name|>SortedSetMultimap.java<|end_file_name|><|fim▁begin|>// Generated automatically from com.google.common.collect.SortedSetMultimap for testing purposes package com.google.common.collect; import com.google.common.collect.SetMultimap; import java.util.Collection; import java.util.Comparator; import java.util.Map; import java.util.SortedSet; public interface SortedSetMultimap<K, V> extends SetMultimap<K, V> { Comparator<? super V> valueComparator(); Map<K, Collection<V>> asMap(); SortedSet<V> get(K p0); SortedSet<V> removeAll(Object p0); SortedSet<V> replaceValues(K p0, Iterable<? extends V> p1);<|fim▁hole|><|fim▁end|>
}
<|file_name|>test_write_worksheet.py<|end_file_name|><|fim▁begin|>############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest<|fim▁hole|> class TestWriteWorksheet(unittest.TestCase): """ Test the Worksheet _write_worksheet() method. """ def setUp(self): self.fh = StringIO() self.worksheet = Worksheet() self.worksheet._set_filehandle(self.fh) def test_write_worksheet(self): """Test the _write_worksheet() method""" self.worksheet._write_worksheet() exp = """<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">""" got = self.fh.getvalue() self.assertEqual(got, exp)<|fim▁end|>
from ...compatibility import StringIO from ...worksheet import Worksheet
<|file_name|>score_board_test.py<|end_file_name|><|fim▁begin|>import unittest import datetime from classes.score_board import ScoreBoard class DateTimeStub(object): def now(self): return "test_date_time" class ScoreBoardTest(unittest.TestCase): def __init__(self, *args, **kwargs): super(ScoreBoardTest, self).__init__(*args, **kwargs) self.score_board = ScoreBoard("testdatabase.db") def seedScores(self): self.score_board.clear() dummy_scores = [ ("player1", 5, datetime.datetime.now() - datetime.timedelta(days=3)), ("player2", 6, datetime.datetime.now()), ("player3", 3, datetime.datetime.now() - datetime.timedelta(days=2)) ] self.score_board.cursor.executemany( "INSERT INTO scores(name, score, recorded_at) VALUES(?,?,?)", dummy_scores ) self.score_board.db.commit() def testRecorderAt(self): self.assertEqual(type(self.score_board.recordedAt()), datetime.datetime) def testCount(self): self.seedScores() self.assertEqual(self.score_board.count(), 3) def testClear(self): self.seedScores() self.score_board.clear() self.assertEqual(self.score_board.count(), 0) def testAdd(self): self.seedScores() self.score_board.add("player4", 15) self.assertEqual(self.score_board.count(), 4) def testHighest(self): self.seedScores() scores = self.score_board.highest() self.assertEqual(scores[0][0], "player2") self.assertEqual(scores[2][0], "player3") def testRecent(self): self.seedScores() scores = self.score_board.recent()<|fim▁hole|> self.assertEqual(scores[0][0], "player2") self.assertEqual(scores[2][0], "player1")<|fim▁end|>
<|file_name|>main_ascii_iterate.go<|end_file_name|><|fim▁begin|>package main import "./ascii" func main() {<|fim▁hole|><|fim▁end|>
ascii.IterateOverASCIIStringLiteral() }
<|file_name|>helpers_test.go<|end_file_name|><|fim▁begin|>/* Copyright 2014 The Kubernetes 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 util import ( "fmt" "io/ioutil" "net/http" "os" "reflect" "strings" "syscall" "testing" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/api/testapi" apitesting "k8s.io/kubernetes/pkg/api/testing" "k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/apimachinery/registered" "k8s.io/kubernetes/pkg/apis/extensions" metav1 "k8s.io/kubernetes/pkg/apis/meta/v1" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime/schema" uexec "k8s.io/kubernetes/pkg/util/exec" "k8s.io/kubernetes/pkg/util/validation/field" ) func TestMerge(t *testing.T) { grace := int64(30) tests := []struct { obj runtime.Object fragment string expected runtime.Object expectErr bool kind string }{ { kind: "Pod", obj: &api.Pod{ ObjectMeta: api.ObjectMeta{ Name: "foo", }, }, fragment: fmt.Sprintf(`{ "apiVersion": "%s" }`, registered.GroupOrDie(api.GroupName).GroupVersion.String()), expected: &api.Pod{ ObjectMeta: api.ObjectMeta{ Name: "foo", }, Spec: apitesting.DeepEqualSafePodSpec(), }, }, /* TODO: uncomment this test once Merge is updated to use strategic-merge-patch. See #8449. { kind: "Pod", obj: &api.Pod{ ObjectMeta: api.ObjectMeta{ Name: "foo", }, Spec: api.PodSpec{ Containers: []api.Container{ api.Container{ Name: "c1", Image: "red-image", }, api.Container{ Name: "c2", Image: "blue-image", }, }, }, }, fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "containers": [ { "name": "c1", "image": "green-image" } ] } }`, registered.GroupOrDie(api.GroupName).GroupVersion.String()), expected: &api.Pod{ ObjectMeta: api.ObjectMeta{ Name: "foo", }, Spec: api.PodSpec{ Containers: []api.Container{ api.Container{ Name: "c1", Image: "green-image", }, api.Container{ Name: "c2", Image: "blue-image", }, }, }, }, }, */ { kind: "Pod", obj: &api.Pod{ ObjectMeta: api.ObjectMeta{ Name: "foo", }, }, fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "volumes": [ {"name": "v1"}, {"name": "v2"} ] } }`, registered.GroupOrDie(api.GroupName).GroupVersion.String()), expected: &api.Pod{ ObjectMeta: api.ObjectMeta{ Name: "foo", }, Spec: api.PodSpec{ Volumes: []api.Volume{ { Name: "v1", VolumeSource: api.VolumeSource{EmptyDir: &api.EmptyDirVolumeSource{}}, }, { Name: "v2", VolumeSource: api.VolumeSource{EmptyDir: &api.EmptyDirVolumeSource{}}, }, }, RestartPolicy: api.RestartPolicyAlways, DNSPolicy: api.DNSClusterFirst, TerminationGracePeriodSeconds: &grace, SecurityContext: &api.PodSecurityContext{}, }, }, }, { kind: "Pod", obj: &api.Pod{}, fragment: "invalid json", expected: &api.Pod{}, expectErr: true, }, { kind: "Service", obj: &api.Service{}, fragment: `{ "apiVersion": "badVersion" }`, expectErr: true, }, { kind: "Service", obj: &api.Service{ Spec: api.ServiceSpec{}, }, fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "ports": [ { "port": 0 } ] } }`, registered.GroupOrDie(api.GroupName).GroupVersion.String()), expected: &api.Service{ Spec: api.ServiceSpec{ SessionAffinity: "None", Type: api.ServiceTypeClusterIP, Ports: []api.ServicePort{ { Protocol: api.ProtocolTCP, Port: 0, }, }, }, }, }, { kind: "Service", obj: &api.Service{ Spec: api.ServiceSpec{ Selector: map[string]string{ "version": "v1", }, }, }, fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "selector": { "version": "v2" } } }`, registered.GroupOrDie(api.GroupName).GroupVersion.String()), expected: &api.Service{ Spec: api.ServiceSpec{ SessionAffinity: "None", Type: api.ServiceTypeClusterIP, Selector: map[string]string{ "version": "v2", }, }, }, }, } for i, test := range tests { out, err := Merge(testapi.Default.Codec(), test.obj, test.fragment, test.kind) if !test.expectErr { if err != nil { t.Errorf("testcase[%d], unexpected error: %v", i, err) } else if !reflect.DeepEqual(out, test.expected) { t.Errorf("\n\ntestcase[%d]\nexpected:\n%+v\nsaw:\n%+v", i, test.expected, out) } } if test.expectErr && err == nil { t.Errorf("testcase[%d], unexpected non-error", i) } } } type fileHandler struct { data []byte } func (f *fileHandler) ServeHTTP(res http.ResponseWriter, req *http.Request) { if req.URL.Path == "/error" { res.WriteHeader(http.StatusNotFound) return } res.WriteHeader(http.StatusOK) res.Write(f.data) } type checkErrTestCase struct { err error expectedErr string expectedCode int } func TestCheckInvalidErr(t *testing.T) { testCheckError(t, []checkErrTestCase{ { errors.NewInvalid(api.Kind("Invalid1"), "invalidation", field.ErrorList{field.Invalid(field.NewPath("field"), "single", "details")}), "The Invalid1 \"invalidation\" is invalid: field: Invalid value: \"single\": details\n", DefaultErrorExitCode, }, { errors.NewInvalid(api.Kind("Invalid2"), "invalidation", field.ErrorList{field.Invalid(field.NewPath("field1"), "multi1", "details"), field.Invalid(field.NewPath("field2"), "multi2", "details")}), "The Invalid2 \"invalidation\" is invalid: \n* field1: Invalid value: \"multi1\": details\n* field2: Invalid value: \"multi2\": details\n", DefaultErrorExitCode, }, { errors.NewInvalid(api.Kind("Invalid3"), "invalidation", field.ErrorList{}), "The Invalid3 \"invalidation\" is invalid", DefaultErrorExitCode, }, { errors.NewInvalid(api.Kind("Invalid4"), "invalidation", field.ErrorList{field.Invalid(field.NewPath("field4"), "multi4", "details"), field.Invalid(field.NewPath("field4"), "multi4", "details")}), "The Invalid4 \"invalidation\" is invalid: field4: Invalid value: \"multi4\": details\n", DefaultErrorExitCode, }, }) } func TestCheckNoResourceMatchError(t *testing.T) { testCheckError(t, []checkErrTestCase{ { &meta.NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "foo"}}, `the server doesn't have a resource type "foo"`, DefaultErrorExitCode, }, { &meta.NoResourceMatchError{PartialResource: schema.GroupVersionResource{Version: "theversion", Resource: "foo"}}, `the server doesn't have a resource type "foo" in version "theversion"`, DefaultErrorExitCode, }, { &meta.NoResourceMatchError{PartialResource: schema.GroupVersionResource{Group: "thegroup", Version: "theversion", Resource: "foo"}}, `the server doesn't have a resource type "foo" in group "thegroup" and version "theversion"`, DefaultErrorExitCode, }, { &meta.NoResourceMatchError{PartialResource: schema.GroupVersionResource{Group: "thegroup", Resource: "foo"}}, `the server doesn't have a resource type "foo" in group "thegroup"`, DefaultErrorExitCode, }, }) } func TestCheckExitError(t *testing.T) { testCheckError(t, []checkErrTestCase{ { uexec.CodeExitError{Err: fmt.Errorf("pod foo/bar terminated"), Code: 42}, "", 42, }, }) } func testCheckError(t *testing.T, tests []checkErrTestCase) { var errReturned string var codeReturned int errHandle := func(err string, code int) { errReturned = err codeReturned = code } for _, test := range tests { checkErr("", test.err, errHandle) if errReturned != test.expectedErr { t.Fatalf("Got: %s, expected: %s", errReturned, test.expectedErr) } if codeReturned != test.expectedCode { t.Fatalf("Got: %d, expected: %d", codeReturned, test.expectedCode) } } } func TestDumpReaderToFile(t *testing.T) { testString := "TEST STRING" tempFile, err := ioutil.TempFile("", "hlpers_test_dump_") if err != nil { t.Errorf("unexpected error setting up a temporary file %v", err) } defer syscall.Unlink(tempFile.Name()) defer tempFile.Close() defer func() { if !t.Failed() { os.Remove(tempFile.Name()) } }() err = DumpReaderToFile(strings.NewReader(testString), tempFile.Name()) if err != nil { t.Errorf("error in DumpReaderToFile: %v", err) } data, err := ioutil.ReadFile(tempFile.Name()) if err != nil { t.Errorf("error when reading %s: %v", tempFile.Name(), err) } stringData := string(data) if stringData != testString { t.Fatalf("Wrong file content %s != %s", testString, stringData) } } func TestMaybeConvert(t *testing.T) { tests := []struct { input runtime.Object gv schema.GroupVersion expected runtime.Object }{ { input: &api.Pod{ ObjectMeta: api.ObjectMeta{ Name: "foo", }, },<|fim▁hole|> Kind: "Pod", }, ObjectMeta: v1.ObjectMeta{ Name: "foo", }, }, }, { input: &extensions.ThirdPartyResourceData{ ObjectMeta: api.ObjectMeta{ Name: "foo", }, Data: []byte("this is some data"), }, expected: &extensions.ThirdPartyResourceData{ ObjectMeta: api.ObjectMeta{ Name: "foo", }, Data: []byte("this is some data"), }, }, } for _, test := range tests { obj, err := MaybeConvertObject(test.input, test.gv, testapi.Default.Converter()) if err != nil { t.Errorf("unexpected error: %v", err) } if !reflect.DeepEqual(test.expected, obj) { t.Errorf("expected:\n%#v\nsaw:\n%#v\n", test.expected, obj) } } }<|fim▁end|>
gv: schema.GroupVersion{Group: "", Version: "v1"}, expected: &v1.Pod{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1",
<|file_name|>errorlib.go<|end_file_name|><|fim▁begin|>package errorlib import ( "bytes" "errors" "fmt" ) // Merge merges a slice of errors into a single error. func Merge(errs []error) error { if len(errs) == 0 { return nil<|fim▁hole|> if len(errs) == 1 { return errs[0] } var buf bytes.Buffer numErrors := 0 for _, err := range errs { if err == nil { continue } if numErrors > 0 { buf.WriteString(", ") } buf.WriteString(err.Error()) numErrors++ } if numErrors == 0 { return nil } else if numErrors == 1 { return errors.New(buf.String()) } message := fmt.Sprintf("%v errors: %s", numErrors, buf.String()) return errors.New(message) }<|fim▁end|>
}
<|file_name|>DoubleSquares.go<|end_file_name|><|fim▁begin|>/* A double-square number is an integer X which can be expressed as the sum of two perfect squares. For example, 10 is a double-square because 10 = 32 + 12. Your task in this problem is, given X, determine the number of ways in which it can be written as the sum of two squares. For example, 10 can only be written as 32 + 12 (we don't count 12 + 32 as being different). On the other hand, 25 can be written as 52 + 02 or as 42 + 32. Input You should first read an integer N, the number of test cases. The next N lines will contain N values of X. Constraints 0 ≤ X ≤ 2147483647 1 ≤ N ≤ 100 Output For each value of X, you should output the number of ways to write X as the sum of two squares. */ package main import ( "bufio" "fmt" "log" "os" "strconv" "strings" ) func main() { // read input file name from command line if len(os.Args) != 3 { log.Fatal("Usage: $>go run DoubleSquares.go input.file output.file") } inputFileName := os.Args[1] outputFileName := os.Args[2] // read input file inputFile, err := os.Open(inputFileName) if err != nil { log.Fatal(err) } defer inputFile.Close() inputFileScanner := bufio.NewScanner(inputFile) lineNo := 0 testCases := 0 var str strings.Builder for inputFileScanner.Scan() { num, err := strconv.Atoi(inputFileScanner.Text()) if err != nil { log.Printf("Error reading line %d: %v\n", lineNo, err) continue } if lineNo == 0 { testCases = num<|fim▁hole|> } if lineNo > testCases { break } y := 0 squareFactors := [][]int{} for { xsq := num - (y * y) if xsq < 0 { break } // determine if xsq is a full square. // if yes, add its square root and y to squareFactors (if not already there) x := -1 for i := 0; i*i <= xsq; i++ { if xsq == i*i { x = i break } } if x != -1 { // xsq is a full square xyFound := false for _, factorSet := range squareFactors { if len(factorSet) >= 2 { if (x == factorSet[0] || x == factorSet[1]) && (y == factorSet[0] || y == factorSet[1]) { xyFound = true break } } } if !xyFound { squareFactors = append(squareFactors, []int{x, y}) } } y++ } str.WriteString(fmt.Sprintf("Case #%d: %d\n", lineNo, len(squareFactors))) lineNo++ } outputFile, err := os.Create(outputFileName) if err != nil { log.Fatal(err) } defer outputFile.Close() _, err = outputFile.WriteString(str.String()) if err != nil { log.Fatal(err) } outputFile.Sync() }<|fim▁end|>
lineNo++ continue
<|file_name|>v8-profiler.js<|end_file_name|><|fim▁begin|>var binary = require('node-pre-gyp'); var path = require('path');<|fim▁hole|> var Stream = require('stream').Stream, inherits = require('util').inherits; function Snapshot() {} Snapshot.prototype.getHeader = function() { return { typeId: this.typeId, uid: this.uid, title: this.title } } /** * @param {Snapshot} other * @returns {Object} */ Snapshot.prototype.compare = function(other) { var selfHist = nodesHist(this), otherHist = nodesHist(other), keys = Object.keys(selfHist).concat(Object.keys(otherHist)), diff = {}; keys.forEach(function(key) { if (key in diff) return; var selfCount = selfHist[key] || 0, otherCount = otherHist[key] || 0; diff[key] = otherCount - selfCount; }); return diff; }; function ExportStream() { Stream.Transform.call(this); this._transform = function noTransform(chunk, encoding, done) { done(null, chunk); } } inherits(ExportStream, Stream.Transform); /** * @param {Stream.Writable|function} dataReceiver * @returns {Stream|undefined} */ Snapshot.prototype.export = function(dataReceiver) { dataReceiver = dataReceiver || new ExportStream(); var toStream = dataReceiver instanceof Stream, chunks = toStream ? null : []; function onChunk(chunk, len) { if (toStream) dataReceiver.write(chunk); else chunks.push(chunk); } function onDone() { if (toStream) dataReceiver.end(); else dataReceiver(null, chunks.join('')); } this.serialize(onChunk, onDone); return toStream ? dataReceiver : undefined; }; function nodes(snapshot) { var n = snapshot.nodesCount, i, nodes = []; for (i = 0; i < n; i++) { nodes[i] = snapshot.getNode(i); } return nodes; }; function nodesHist(snapshot) { var objects = {}; nodes(snapshot).forEach(function(node){ var key = node.type === "Object" ? node.name : node.type; objects[key] = objects[node.name] || 0; objects[key]++; }); return objects; }; function CpuProfile() {} CpuProfile.prototype.getHeader = function() { return { typeId: this.typeId, uid: this.uid, title: this.title } } CpuProfile.prototype.export = function(dataReceiver) { dataReceiver = dataReceiver || new ExportStream(); var toStream = dataReceiver instanceof Stream; var error, result; try { result = JSON.stringify(this); } catch (err) { error = err; } process.nextTick(function() { if (toStream) { if (error) { dataReceiver.emit('error', error); } dataReceiver.end(result); } else { dataReceiver(error, result); } }); return toStream ? dataReceiver : undefined; }; var startTime, endTime; var activeProfiles = []; var profiler = { /*HEAP PROFILER API*/ get snapshots() { return binding.heap.snapshots; }, takeSnapshot: function(name, control) { var snapshot = binding.heap.takeSnapshot.apply(null, arguments); snapshot.__proto__ = Snapshot.prototype; snapshot.title = name; return snapshot; }, getSnapshot: function(index) { var snapshot = binding.heap.snapshots[index]; if (!snapshot) return; snapshot.__proto__ = Snapshot.prototype; return snapshot; }, findSnapshot: function(uid) { var snapshot = binding.heap.snapshots.filter(function(snapshot) { return snapshot.uid == uid; })[0]; if (!snapshot) return; snapshot.__proto__ = Snapshot.prototype; return snapshot; }, deleteAllSnapshots: function () { binding.heap.snapshots.forEach(function(snapshot) { snapshot.delete(); }); }, startTrackingHeapObjects: binding.heap.startTrackingHeapObjects, stopTrackingHeapObjects: binding.heap.stopTrackingHeapObjects, getHeapStats: binding.heap.getHeapStats, getObjectByHeapObjectId: binding.heap.getObjectByHeapObjectId, /*CPU PROFILER API*/ get profiles() { return binding.cpu.profiles; }, startProfiling: function(name, recsamples) { if (activeProfiles.length == 0 && typeof process._startProfilerIdleNotifier == "function") process._startProfilerIdleNotifier(); name = name || ""; if (activeProfiles.indexOf(name) < 0) activeProfiles.push(name) startTime = Date.now(); binding.cpu.startProfiling(name, recsamples); }, stopProfiling: function(name) { var index = activeProfiles.indexOf(name); if (name && index < 0) return; var profile = binding.cpu.stopProfiling(name); endTime = Date.now(); profile.__proto__ = CpuProfile.prototype; if (!profile.startTime) profile.startTime = startTime; if (!profile.endTime) profile.endTime = endTime; if (name) activeProfiles.splice(index, 1); else activeProfiles.length = activeProfiles.length - 1; if (activeProfiles.length == 0 && typeof process._stopProfilerIdleNotifier == "function") process._stopProfilerIdleNotifier(); return profile; }, getProfile: function(index) { return binding.cpu.profiles[index]; }, findProfile: function(uid) { var profile = binding.cpu.profiles.filter(function(profile) { return profile.uid == uid; })[0]; return profile; }, deleteAllProfiles: function() { binding.cpu.profiles.forEach(function(profile) { profile.delete(); }); } }; module.exports = profiler; process.profiler = profiler;<|fim▁end|>
var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json'))); var binding = require(binding_path);
<|file_name|>LoginandSignupV10.py<|end_file_name|><|fim▁begin|>from tkinter import * import mysql.connector as mysql from MySQLdb import dbConnect from HomeOOP import * import datetime from PIL import Image, ImageTk class MainMenu(Frame): def __init__(self, parent): #The very first screen of the web app Frame.__init__(self, parent) w, h = parent.winfo_screenwidth(), parent.winfo_screenheight() #parent.overrideredirect(1) parent.geometry("%dx%d+0+0" % (w, h)) frame = Frame(parent, width=w, height=h).place(x=350, y=450) # frame.pack(expand=True) # canvas = Canvas(parent, width=w, height=h) # scale_width = w / 3900 # scale_height = h / 2613 web = "https://raw.githubusercontent.com/ACBL-Bridge/Bridge-Application/master/Login/" URL = "login_background_resized.jpg" u = urlopen(web + URL) raw_data = u.read() u.close() im = Image.open(BytesIO(raw_data)) bckgrd = ImageTk.PhotoImage(im) login_bckgrd = Label(frame, image=bckgrd) login_bckgrd.image = bckgrd login_bckgrd.place(x=0, y=0, relwidth=1, relheight=1) titleLabel = Label(frame, text="LET'S PLAY BRIDGE", fg="black", font='Arial 36') titleLabel.pack(side="top", pady=150) loginButton = Button(frame, text="Existing User", fg="blue", font="Arial 14", command=lambda: self.LoginScreen(parent)) loginButton.pack(side='top') signupButton = Button(frame, text="Sign up", fg="blue", font="Arial 14", command=self.SignupScreen) signupButton.pack(side="top") quitButton = Button(frame, text="Quit", font="Arial 14", command=self.SignupScreen) quitButton.pack(side="top") ####################################Login - GUI ########################### def LoginScreen(self,parent): global entry_user global entry_pass top = Toplevel(self) top.title("Log In - ABCL") w, h = top.winfo_screenwidth(), top.winfo_screenheight() top.overrideredirect(1) top.geometry("550x400+%d+%d" % (w/2-275, h/2-125)) #250 #top.configure(background = 'white') quitButton = Button(top, text="Go Back", font="Arial 14", command= top.destroy).pack(side="bottom", padx=20) #entry_user = StringVar() #entry_pass = StringVar() # Frames to divide the window into three parts.. makes it easier to organize the widgets topFrame = Frame(top) topFrame.pack() middleFrame = Frame(top) middleFrame.pack(pady=50) bottomFrame = Frame(top) bottomFrame.pack(side=BOTTOM) # Widgets and which frame they are in #label = Label(topFrame, text="LET'S PLAY BRIDGE") userLabel = Label(middleFrame, text='Username:', font="Arial 14") passLabel = Label(middleFrame, text='Password:', font="Arial 14") entry_user = Entry(middleFrame) # For DB entry_pass = Entry(middleFrame, show ='*') # For DB b = Button(bottomFrame, text="Log In",fg ="blue", font ="Arial 14", command=lambda: get_Login_input(self, parent)) #Location of the Widgets in their frames #label.pack(side="top", fill="both", expand=True, padx=20, pady=20) userLabel.grid(row=10, column=0, sticky=W, padx=20) entry_user.grid(row=10, column=1, padx=20) passLabel.grid(row=11, column=0, sticky=W, padx=20) entry_pass.grid(row=11, column=1, padx=20) b.grid(row=12, columnspan=2) ###############################################DATABASE Check Login!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! def go_to_HomePage(user): root = Tk() app = Home(root,user) root.mainloop() def get_Login_input(self, parent): var = dbConnect() dbconn = mysql.connect(host=var.host, user=var.user, password=var.password, db=var.db) cur = dbconn.cursor() # Cursor object - required to execute all queries cur.execute("SELECT username FROM playerinfo WHERE username = '%s' AND password = '%s'" % (entry_user.get(), entry_pass.get())) rows = cur.fetchall() if rows: cur.execute("SELECT firstname, lastname, username FROM playerinfo WHERE username = '%s' AND password = '%s'" % (entry_user.get(), entry_pass.get())) for namerow in cur.fetchall(): # print all the first cell fn = namerow[0] #store firstname ln = namerow[1] #store lastname user = namerow[2] self.destroy() parent.destroy() go_to_HomePage(user) '''top = Toplevel(self) w, h = top.winfo_screenwidth(), top.winfo_screenheight() top.overrideredirect(1) top.geometry("%dx%d+0+0" % (w, h)) # Frames to divide the window into three parts.. makes it easier to organize the widgets topFrame = Frame(top) topFrame.pack() middleFrame = Frame(top) middleFrame.pack(pady=250) bottomFrame = Frame(top) bottomFrame.pack(side=BOTTOM) myProfileButton = Button(middleFrame, text="My Profile", fg="blue", font="Arial 14", command=self.myProfileScreen) myProfileButton.pack() quitButton = Button(top, text="Log Out", font="Arial 14", command=top.destroy).pack(side="bottom", padx=20) #top.title(':D') #top.geometry('250x200') #get first name and last name of current player cur.execute("SELECT firstname, lastname FROM playerinfo WHERE username = '%s' AND password = '%s'" % (entry_user.get(), entry_pass.get())) for namerow in cur.fetchall(): # print all the first cell fn = namerow[0] #store firstname ln = namerow[1] #store lastname rlb1 = Label(middleFrame, text='\nWelcome %s %s\n' % (fn, ln), font="Arial 14") rlb1.pack() rlb2 = Label(middleFrame, text='\nUserName: %s' % entry_user.get(), font="Arial 14") rlb2.pack() top.mainloop() self.destroy() parent.destroy() go_to_HomePage()''' else:<|fim▁hole|> r.title(':D') r.geometry('150x150') rlbl = Label(r, text='\n[!] Invalid Login') rlbl.pack() r.mainloop() dbconn.close() ########################################## SIGN UP SCREEN - GUI #################################################### def SignupScreen(self): global entry_fname global entry_lname global entry_user global entry_pass global entry_repass global entry_email global entry_ACBL global entry_disID top = Toplevel(self) w, h = top.winfo_screenwidth(), top.winfo_screenheight() top.overrideredirect(1) top.geometry("550x450+%d+%d" % (w / 2 - 275, h / 2 - 140)) # 250 #top.configure(background='white') quitButton = Button(top, text="Go Back", font="Arial 14", command= top.destroy).pack(side="bottom", padx=20) #topFrame = Frame(top) #topFrame.pack() middleFrame = Frame(top) middleFrame.pack(pady=50) bottomFrame = Frame(top) bottomFrame.pack(side=BOTTOM) # Widgets and which frame they are in #label = Label(topFrame, text="LET'S PLAY BRIDGE") fnameLabel = Label(middleFrame,text = 'First Name:',font="Arial 14") lnameLabel = Label(middleFrame, text='Last Name:',font="Arial 14") userLabel = Label(middleFrame, text='Username:',font="Arial 14") passLabel = Label(middleFrame, text='Password:',font="Arial 14") repassLabel = Label(middleFrame, text='Re-Enter Password:',font="Arial 14") emailLabel = Label(middleFrame, text='Email(optional):',font="Arial 14") ACBLnumLabel = Label(middleFrame, text='ACBLnum(optional):',font="Arial 14") disIDLabel = Label(middleFrame, text='DistrictID(optional):',font="Arial 14") entry_fname = Entry(middleFrame) #For DB entry_lname = Entry(middleFrame) #For DB entry_user = Entry(middleFrame)#For DB entry_pass = Entry(middleFrame, show = '*')#For DB entry_repass = Entry(middleFrame, show = '*')#For DB entry_email = Entry(middleFrame)#For DB entry_ACBL = Entry(middleFrame)#For DB entry_disID = Entry(middleFrame)#For DB b = Button(bottomFrame, text="Sign up", font="Arial 14", command=lambda : combined_Functions(self)) # Location of the Widgets in their frames #label.pack(side="top", fill="both", expand=True, padx=20, pady=20) fnameLabel.grid(row=1, column=0, sticky=W) entry_fname.grid(row=1, column=1) lnameLabel.grid(row=2, column=0, sticky=W) entry_lname.grid(row=2, column=1) userLabel.grid(row=3, column=0, sticky=W) entry_user.grid(row=3, column=1) passLabel.grid(row=4, column=0, sticky=W) entry_pass.grid(row=4, column=1) repassLabel.grid(row=5, column=0, sticky=W) entry_repass.grid(row=5, column=1) emailLabel.grid(row=6, column=0, sticky=W) entry_email.grid(row=6, column=1, padx=20, sticky= W) ACBLnumLabel.grid(row=7, column=0, sticky=W) entry_ACBL.grid(row=7, column=1, padx=20) disIDLabel.grid(row=8, column=0, sticky=W) entry_disID.grid(row=8, column=1) b.grid(row=10, columnspan=2) ####################################DATABASE Check if Username is available, check if passwords Match -> if so SIGN UP!!!!!!!!!!!!!!! def get_Signup_input(): var = dbConnect() dbconn = mysql.connect(host=var.host, user=var.user, password=var.password, db=var.db) cur = dbconn.cursor() # Cursor object - required to execute all queries cur.execute("SELECT username FROM playerinfo WHERE username = '%s'" % entry_user.get()) rows = cur.fetchall() if not rows: # print(userInput + " is available") if (entry_pass.get() == entry_repass.get()) and (entry_pass.get()!= "") and (entry_repass.get()!= ""): # print("passwords match, good job brotha") # INSERT new player ... playerinfo check todaysdate = datetime.datetime.today().strftime('%Y-%m-%d') # current date cur.execute("INSERT INTO playerinfo(username, password, signUpDate, firstname, lastname, email, ACLnum, districtID) VALUES('%s','%s','%s','%s','%s','%s','%s','%s')" % ( entry_user.get(), entry_pass.get(), todaysdate, entry_fname.get(), entry_lname.get(), entry_email.get(),entry_ACBL.get(), entry_disID.get())) #get new player's ID cur.execute("SELECT ID FROM playerinfo WHERE username='%s'" % entry_user.get()) for namerow in cur.fetchall(): # print all the first cell idNum = namerow[0] # store ID number # new player's...playerstats inserted by ID cur.execute("INSERT INTO playerstats(ID) VALUES('%s')" % idNum) dbconn.commit() #database commit aka save r = Tk() r.title(':D') r.geometry('150x150') rlbl = Label(r, text='\n[+] Signed Up!') rlbl.pack() r.mainloop() else: # print("passwords don't match bruh or are NULL") r = Tk() r.title(':D') r.geometry('150x150') rlbl = Label(r, text='\n[!] Retype your passwords') rlbl.pack() r.mainloop() else: r = Tk() r.title(':D') r.geometry('150x150') rlbl = Label(r, text='\n[!] Username Not Available ') rlbl.pack() r.mainloop() dbconn.close() def go_to_Tutorial(): window = Toplevel() window.geometry("600x500") quitButton = Button(window, text="Cancel", font="Arial 14", command= window.destroy).pack(side="bottom", padx=20) top_Frame = Frame(window) top_Frame.pack() tLabel = Label(top_Frame, text="TUTORIAL", font="Arial 36").pack(side="top", fill="both", expand=True, padx=20, pady=20) def combined_Functions(self): # for the Sign Up button - store data, exits Sign Up screen, goes to Tutorial screen get_Signup_input() # top.destroy() #go_to_Tutorial() #####################################My Profile - GUI ######################################### def myProfileScreen(self): top = Toplevel(self) w, h = top.winfo_screenwidth(), top.winfo_screenheight() top.overrideredirect(1) w, h = self.winfo_screenwidth(), self.winfo_screenheight() top.overrideredirect(1) top.geometry("%dx%d+0+0" % (w, h)) topFrame = Frame(top) topFrame.pack() bottomFrame = Frame(top) bottomFrame.pack(side=BOTTOM) rightFrame = Frame(top) rightFrame.pack(side= RIGHT) leftFrame = Frame(top) leftFrame.pack(side=LEFT) #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@DB stuff@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ #entry_user.get() //username var = dbConnect() dbconn = mysql.connect(host=var.host, user=var.user, password=var.password, db=var.db) cur = dbconn.cursor() # Cursor object - required to execute all queries global data data=[] # get all info from playerinfo and playerstats using current username cur.execute( "SELECT playerinfo.firstname, playerinfo.lastname, playerinfo.username, playerinfo.email, playerinfo.signUpDate, playerinfo.districtID, playerinfo.ACLnum, playerstats.dealsplayed, playerstats.level, playerstats.exp, playerstats.coins, playerstats.tournys FROM playerstats INNER JOIN playerinfo ON playerinfo.ID=playerstats.ID AND playerinfo.username='%s'" % entry_user.get()) for namerow in cur.fetchall(): # print all info fn = namerow[0] # firstname ln = namerow[1] # lastname un = namerow[2] #username em = namerow[3] # email sData = namerow[4] # signUpDate districtID = namerow[5] # District ID acblNumba = namerow[6] # ACBL Number dPlay = namerow[7] #deals played lvl = namerow[8] # level exp = namerow[9] # experience coins = namerow[10] # coins tornys = namerow[11] # tournaments dbconn.close() #close db connection #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ label = Label(topFrame, text="LET'S PLAY BRIDGE",font =('Coralva', 42)).pack(side="top", fill="both", expand=True) mpLabel = Label(rightFrame, text='My Profile: ', font = ('Comic Sans MS',24)).grid(ipadx = 200, columnspan = 2) nameLabel = Label(rightFrame, text="Name: %s %s" % (fn, ln), font = ('Comic Sans MS',14)).grid(row=1, column=0, sticky = W) userLabel = Label(rightFrame, text='Username: %s' % un, font = ('Comic Sans MS',14)).grid(row=2, column=0, sticky = W) emailLabel = Label (rightFrame, text='Email: %s' % em, font = ('Comic Sans MS',14)).grid(row=3, column=0, sticky = W) sLabel = Label(rightFrame, text='Signup Date: %s' %sData, font = ('Comic Sans MS',14)).grid(row=4, column=0, sticky = W) disIDLabel = Label(rightFrame, text='DistrictID: %s' % districtID , font = ('Comic Sans MS',14)).grid(row=5, column=0, sticky = W) ACBLnumLabel = Label(rightFrame, text='ACBL #: %s' % acblNumba, font = ('Comic Sans MS',14)).grid(row=6, column=0, sticky = W) nothing = Label(rightFrame).grid(row=7, column=0) msLabel= Label(rightFrame, text='My Stats', font = ('Comic Sans MS',14, 'bold')).grid(row=8, column=0, sticky = W) dpLabel = Label(rightFrame, text='Deals Played: %s' %dPlay, font = ('Comic Sans MS',14)).grid(row=9, column=0, sticky = W) levelLabel = Label(rightFrame, text='Level: %s' % lvl, font = ('Comic Sans MS',14)).grid(row=10, column=0, sticky = W) expLabel = Label(rightFrame, text='Experience: %s' % exp, font = ('Comic Sans MS',14)).grid(row=11, column=0, sticky = W) coinsLabel = Label(rightFrame, text='Coins: %s' % coins, font = ('Comic Sans MS',14)).grid(row=12, column=0, sticky = W) tourLabel = Label(rightFrame, text='Tournaments: %s' % tornys, font = ('Comic Sans MS',14)).grid(row=13, column=0, sticky = W) #b = Button(bottomFrame, text="HOME",font = 'Arial 12').pack(side=LEFT) #FIND A IMAGE OF A HOUSE quitButton = Button(bottomFrame, text="Go Back", command=top.destroy, font = 'Arial 12').pack(side = RIGHT) root = Tk() MainMenu(root).pack(fill="both", expand=True) root.mainloop()<|fim▁end|>
r = Tk()
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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. import warnings from tencentcloud.common.abstract_model import AbstractModel class AbnormalProcessChildRuleInfo(AbstractModel): """容器运行时安全,子策略信息 """ def __init__(self): r""" :param RuleMode: 策略模式, RULE_MODE_RELEASE: 放行 RULE_MODE_ALERT: 告警 RULE_MODE_HOLDUP:拦截 :type RuleMode: str :param ProcessPath: 进程路径 :type ProcessPath: str :param RuleId: 子策略id 注意:此字段可能返回 null,表示取不到有效值。 :type RuleId: str """ self.RuleMode = None self.ProcessPath = None self.RuleId = None def _deserialize(self, params): self.RuleMode = params.get("RuleMode") self.ProcessPath = params.get("ProcessPath") self.RuleId = params.get("RuleId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AbnormalProcessEventDescription(AbstractModel): """运行时容器访问控制事件描述信息 """ def __init__(self): r""" :param Description: 事件规则 :type Description: str :param Solution: 解决方案 :type Solution: str :param Remark: 事件备注信息 注意:此字段可能返回 null,表示取不到有效值。 :type Remark: str :param MatchRule: 命中规则详细信息 :type MatchRule: :class:`tencentcloud.tcss.v20201101.models.AbnormalProcessChildRuleInfo` :param RuleName: 命中规则名字 :type RuleName: str :param RuleId: 命中规则的id :type RuleId: str """ self.Description = None self.Solution = None self.Remark = None self.MatchRule = None self.RuleName = None self.RuleId = None def _deserialize(self, params): self.Description = params.get("Description") self.Solution = params.get("Solution") self.Remark = params.get("Remark") if params.get("MatchRule") is not None: self.MatchRule = AbnormalProcessChildRuleInfo() self.MatchRule._deserialize(params.get("MatchRule")) self.RuleName = params.get("RuleName") self.RuleId = params.get("RuleId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AbnormalProcessEventInfo(AbstractModel): """容器运行时安全异常进程信息 """ def __init__(self): r""" :param ProcessPath: 进程目录 :type ProcessPath: str :param EventType: 事件类型,MALICE_PROCESS_START:恶意进程启动 :type EventType: str :param MatchRuleName: 命中规则 :type MatchRuleName: str :param FoundTime: 生成时间 :type FoundTime: str :param ContainerName: 容器名 :type ContainerName: str :param ImageName: 镜像名 :type ImageName: str :param Behavior: 动作执行结果, BEHAVIOR_NONE: 无 BEHAVIOR_ALERT: 告警 BEHAVIOR_RELEASE:放行 BEHAVIOR_HOLDUP_FAILED:拦截失败 BEHAVIOR_HOLDUP_SUCCESSED:拦截失败 :type Behavior: str :param Status: 状态,EVENT_UNDEAL:事件未处理 EVENT_DEALED:事件已经处理 EVENT_INGNORE:事件已经忽略 :type Status: str :param Id: 事件记录的唯一id :type Id: str :param ImageId: 镜像id,用于跳转 :type ImageId: str :param ContainerId: 容器id,用于跳转 :type ContainerId: str :param Solution: 事件解决方案 :type Solution: str :param Description: 事件详细描述 :type Description: str :param MatchRuleId: 命中策略id :type MatchRuleId: str :param MatchAction: 命中规则行为: RULE_MODE_RELEASE 放行 RULE_MODE_ALERT 告警 RULE_MODE_HOLDUP 拦截 :type MatchAction: str :param MatchProcessPath: 命中规则进程信息 :type MatchProcessPath: str :param RuleExist: 规则是否存在 :type RuleExist: bool :param EventCount: 事件数量 :type EventCount: int :param LatestFoundTime: 最近生成时间 :type LatestFoundTime: str :param RuleId: 规则组Id :type RuleId: str """ self.ProcessPath = None self.EventType = None self.MatchRuleName = None self.FoundTime = None self.ContainerName = None self.ImageName = None self.Behavior = None self.Status = None self.Id = None self.ImageId = None self.ContainerId = None self.Solution = None self.Description = None self.MatchRuleId = None self.MatchAction = None self.MatchProcessPath = None self.RuleExist = None self.EventCount = None self.LatestFoundTime = None self.RuleId = None def _deserialize(self, params): self.ProcessPath = params.get("ProcessPath") self.EventType = params.get("EventType") self.MatchRuleName = params.get("MatchRuleName") self.FoundTime = params.get("FoundTime") self.ContainerName = params.get("ContainerName") self.ImageName = params.get("ImageName") self.Behavior = params.get("Behavior") self.Status = params.get("Status") self.Id = params.get("Id") self.ImageId = params.get("ImageId") self.ContainerId = params.get("ContainerId") self.Solution = params.get("Solution") self.Description = params.get("Description") self.MatchRuleId = params.get("MatchRuleId") self.MatchAction = params.get("MatchAction") self.MatchProcessPath = params.get("MatchProcessPath") self.RuleExist = params.get("RuleExist") self.EventCount = params.get("EventCount") self.LatestFoundTime = params.get("LatestFoundTime") self.RuleId = params.get("RuleId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AbnormalProcessRuleInfo(AbstractModel): """运行时安全,异常进程检测策略 """ def __init__(self): r""" :param IsEnable: true:策略启用,false:策略禁用 :type IsEnable: bool :param ImageIds: 生效镜像id,空数组代表全部镜像 :type ImageIds: list of str :param ChildRules: 用户策略的子策略数组 :type ChildRules: list of AbnormalProcessChildRuleInfo :param RuleName: 策略名字 :type RuleName: str :param RuleId: 策略id 注意:此字段可能返回 null,表示取不到有效值。 :type RuleId: str :param SystemChildRules: 系统策略的子策略数组 :type SystemChildRules: list of AbnormalProcessSystemChildRuleInfo """ self.IsEnable = None self.ImageIds = None self.ChildRules = None self.RuleName = None self.RuleId = None self.SystemChildRules = None def _deserialize(self, params): self.IsEnable = params.get("IsEnable") self.ImageIds = params.get("ImageIds") if params.get("ChildRules") is not None: self.ChildRules = [] for item in params.get("ChildRules"): obj = AbnormalProcessChildRuleInfo() obj._deserialize(item) self.ChildRules.append(obj) self.RuleName = params.get("RuleName") self.RuleId = params.get("RuleId") if params.get("SystemChildRules") is not None: self.SystemChildRules = [] for item in params.get("SystemChildRules"): obj = AbnormalProcessSystemChildRuleInfo() obj._deserialize(item) self.SystemChildRules.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AbnormalProcessSystemChildRuleInfo(AbstractModel): """异常进程系统策略的子策略信息 """ def __init__(self): r""" :param RuleId: 子策略Id :type RuleId: str :param IsEnable: 子策略状态,true为开启,false为关闭 :type IsEnable: bool :param RuleMode: 策略模式, RULE_MODE_RELEASE: 放行 RULE_MODE_ALERT: 告警 RULE_MODE_HOLDUP:拦截 :type RuleMode: str :param RuleType: 子策略检测的行为类型 PROXY_TOOL: 代理软件 TRANSFER_CONTROL:横向渗透 ATTACK_CMD: 恶意命令 REVERSE_SHELL:反弹shell FILELESS:无文件程序执行 RISK_CMD:高危命令 ABNORMAL_CHILD_PROC: 敏感服务异常子进程启动 :type RuleType: str """ self.RuleId = None self.IsEnable = None self.RuleMode = None self.RuleType = None def _deserialize(self, params): self.RuleId = params.get("RuleId") self.IsEnable = params.get("IsEnable") self.RuleMode = params.get("RuleMode") self.RuleType = params.get("RuleType") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AccessControlChildRuleInfo(AbstractModel): """容器运行时安全,访问控制子策略信息 """ def __init__(self): r""" :param RuleMode: 策略模式, RULE_MODE_RELEASE: 放行 RULE_MODE_ALERT: 告警 RULE_MODE_HOLDUP:拦截 :type RuleMode: str :param ProcessPath: 进程路径 :type ProcessPath: str :param TargetFilePath: 被访问文件路径,仅仅在访问控制生效 :type TargetFilePath: str :param RuleId: 子策略id 注意:此字段可能返回 null,表示取不到有效值。 :type RuleId: str """ self.RuleMode = None self.ProcessPath = None self.TargetFilePath = None self.RuleId = None def _deserialize(self, params): self.RuleMode = params.get("RuleMode") self.ProcessPath = params.get("ProcessPath") self.TargetFilePath = params.get("TargetFilePath") self.RuleId = params.get("RuleId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AccessControlEventDescription(AbstractModel): """运行时容器访问控制事件描述信息 """ def __init__(self): r""" :param Description: 事件规则 :type Description: str :param Solution: 解决方案 :type Solution: str :param Remark: 事件备注信息 注意:此字段可能返回 null,表示取不到有效值。 :type Remark: str :param MatchRule: 命中规则详细信息 :type MatchRule: :class:`tencentcloud.tcss.v20201101.models.AccessControlChildRuleInfo` :param RuleName: 命中规则名字 :type RuleName: str :param RuleId: 命中规则id :type RuleId: str """ self.Description = None self.Solution = None self.Remark = None self.MatchRule = None self.RuleName = None self.RuleId = None def _deserialize(self, params): self.Description = params.get("Description") self.Solution = params.get("Solution") self.Remark = params.get("Remark") if params.get("MatchRule") is not None: self.MatchRule = AccessControlChildRuleInfo() self.MatchRule._deserialize(params.get("MatchRule")) self.RuleName = params.get("RuleName") self.RuleId = params.get("RuleId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AccessControlEventInfo(AbstractModel): """容器运行时安全访问控制事件信息 """ def __init__(self): r""" :param ProcessName: 进程名称 :type ProcessName: str :param MatchRuleName: 命中规则名称 :type MatchRuleName: str :param FoundTime: 生成时间 :type FoundTime: str :param ContainerName: 容器名 :type ContainerName: str :param ImageName: 镜像名 :type ImageName: str :param Behavior: 动作执行结果, BEHAVIOR_NONE: 无 BEHAVIOR_ALERT: 告警 BEHAVIOR_RELEASE:放行 BEHAVIOR_HOLDUP_FAILED:拦截失败 BEHAVIOR_HOLDUP_SUCCESSED:拦截失败 :type Behavior: str :param Status: 状态0:未处理 “EVENT_UNDEAL”:事件未处理 "EVENT_DEALED":事件已经处理 "EVENT_INGNORE":事件已经忽略 :type Status: str :param Id: 事件记录的唯一id :type Id: str :param FileName: 文件名称 :type FileName: str :param EventType: 事件类型, FILE_ABNORMAL_READ:文件异常读取 :type EventType: str :param ImageId: 镜像id, 用于跳转 :type ImageId: str :param ContainerId: 容器id, 用于跳转 :type ContainerId: str :param Solution: 事件解决方案 :type Solution: str :param Description: 事件详细描述 :type Description: str :param MatchRuleId: 命中策略id :type MatchRuleId: str :param MatchAction: 命中规则行为: RULE_MODE_RELEASE 放行 RULE_MODE_ALERT 告警 RULE_MODE_HOLDUP 拦截 :type MatchAction: str :param MatchProcessPath: 命中规则进程信息 :type MatchProcessPath: str :param MatchFilePath: 命中规则文件信息 :type MatchFilePath: str :param FilePath: 文件路径,包含名字 :type FilePath: str :param RuleExist: 规则是否存在 :type RuleExist: bool :param EventCount: 事件数量 :type EventCount: int :param LatestFoundTime: 最近生成时间 :type LatestFoundTime: str :param RuleId: 规则组id :type RuleId: str """ self.ProcessName = None self.MatchRuleName = None self.FoundTime = None self.ContainerName = None self.ImageName = None self.Behavior = None self.Status = None self.Id = None self.FileName = None self.EventType = None self.ImageId = None self.ContainerId = None self.Solution = None self.Description = None self.MatchRuleId = None self.MatchAction = None self.MatchProcessPath = None self.MatchFilePath = None self.FilePath = None self.RuleExist = None self.EventCount = None self.LatestFoundTime = None self.RuleId = None def _deserialize(self, params): self.ProcessName = params.get("ProcessName") self.MatchRuleName = params.get("MatchRuleName") self.FoundTime = params.get("FoundTime") self.ContainerName = params.get("ContainerName") self.ImageName = params.get("ImageName") self.Behavior = params.get("Behavior") self.Status = params.get("Status") self.Id = params.get("Id") self.FileName = params.get("FileName") self.EventType = params.get("EventType") self.ImageId = params.get("ImageId") self.ContainerId = params.get("ContainerId") self.Solution = params.get("Solution") self.Description = params.get("Description") self.MatchRuleId = params.get("MatchRuleId") self.MatchAction = params.get("MatchAction") self.MatchProcessPath = params.get("MatchProcessPath") self.MatchFilePath = params.get("MatchFilePath") self.FilePath = params.get("FilePath") self.RuleExist = params.get("RuleExist") self.EventCount = params.get("EventCount") self.LatestFoundTime = params.get("LatestFoundTime") self.RuleId = params.get("RuleId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AccessControlRuleInfo(AbstractModel): """容器运行时,访问控制策略信息 """ def __init__(self): r""" :param IsEnable: 开关,true:开启,false:禁用 :type IsEnable: bool :param ImageIds: 生效惊现id,空数组代表全部镜像 :type ImageIds: list of str :param ChildRules: 用户策略的子策略数组 :type ChildRules: list of AccessControlChildRuleInfo :param RuleName: 策略名字 :type RuleName: str :param RuleId: 策略id 注意:此字段可能返回 null,表示取不到有效值。 :type RuleId: str :param SystemChildRules: 系统策略的子策略数组 :type SystemChildRules: list of AccessControlSystemChildRuleInfo """ self.IsEnable = None self.ImageIds = None self.ChildRules = None self.RuleName = None self.RuleId = None self.SystemChildRules = None def _deserialize(self, params): self.IsEnable = params.get("IsEnable") self.ImageIds = params.get("ImageIds") if params.get("ChildRules") is not None: self.ChildRules = [] for item in params.get("ChildRules"): obj = AccessControlChildRuleInfo() obj._deserialize(item) self.ChildRules.append(obj) self.RuleName = params.get("RuleName") self.RuleId = params.get("RuleId") if params.get("SystemChildRules") is not None: self.SystemChildRules = [] for item in params.get("SystemChildRules"): obj = AccessControlSystemChildRuleInfo() obj._deserialize(item) self.SystemChildRules.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AccessControlSystemChildRuleInfo(AbstractModel): """容器运行时安全,访问控制系统策略的子策略信息 """ def __init__(self): r""" :param RuleId: 子策略Id :type RuleId: str :param RuleMode: 策略模式, RULE_MODE_RELEASE: 放行 RULE_MODE_ALERT: 告警 RULE_MODE_HOLDUP:拦截 :type RuleMode: str :param IsEnable: 子策略状态,true为开启,false为关闭 :type IsEnable: bool :param RuleType: 子策略检测的入侵行为类型 CHANGE_CRONTAB:篡改计划任务 CHANGE_SYS_BIN:篡改系统程序 CHANGE_USRCFG:篡改用户配置 :type RuleType: str """ self.RuleId = None self.RuleMode = None self.IsEnable = None self.RuleType = None def _deserialize(self, params): self.RuleId = params.get("RuleId") self.RuleMode = params.get("RuleMode") self.IsEnable = params.get("IsEnable") self.RuleType = params.get("RuleType") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AddAssetImageRegistryRegistryDetailRequest(AbstractModel): """AddAssetImageRegistryRegistryDetail请求参数结构体 """ def __init__(self): r""" :param Name: 仓库名 :type Name: str :param Username: 用户名 :type Username: str :param Password: 密码 :type Password: str :param Url: 仓库url :type Url: str :param RegistryType: 仓库类型,列表:harbor :type RegistryType: str :param NetType: 网络类型,列表:public(公网) :type NetType: str :param RegistryVersion: 仓库版本 :type RegistryVersion: str :param RegistryRegion: 区域,列表:default(默认) :type RegistryRegion: str :param SpeedLimit: 限速 :type SpeedLimit: int :param Insecure: 安全模式(证书校验):0(默认) 非安全模式(跳过证书校验):1 :type Insecure: int """ self.Name = None self.Username = None self.Password = None self.Url = None self.RegistryType = None self.NetType = None self.RegistryVersion = None self.RegistryRegion = None self.SpeedLimit = None self.Insecure = None def _deserialize(self, params): self.Name = params.get("Name") self.Username = params.get("Username") self.Password = params.get("Password") self.Url = params.get("Url") self.RegistryType = params.get("RegistryType") self.NetType = params.get("NetType") self.RegistryVersion = params.get("RegistryVersion") self.RegistryRegion = params.get("RegistryRegion") self.SpeedLimit = params.get("SpeedLimit") self.Insecure = params.get("Insecure") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AddAssetImageRegistryRegistryDetailResponse(AbstractModel): """AddAssetImageRegistryRegistryDetail返回参数结构体 """ def __init__(self): r""" :param HealthCheckErr: 连接错误信息 注意:此字段可能返回 null,表示取不到有效值。 :type HealthCheckErr: str :param NameRepeatErr: 名称错误信息 注意:此字段可能返回 null,表示取不到有效值。 :type NameRepeatErr: str :param RegistryId: 仓库唯一id 注意:此字段可能返回 null,表示取不到有效值。 :type RegistryId: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.HealthCheckErr = None self.NameRepeatErr = None self.RegistryId = None self.RequestId = None def _deserialize(self, params): self.HealthCheckErr = params.get("HealthCheckErr") self.NameRepeatErr = params.get("NameRepeatErr") self.RegistryId = params.get("RegistryId") self.RequestId = params.get("RequestId") class AddCompliancePolicyItemToWhitelistRequest(AbstractModel): """AddCompliancePolicyItemToWhitelist请求参数结构体 """ def __init__(self): r""" :param CustomerPolicyItemIdSet: 要忽略的检测项的ID的列表 :type CustomerPolicyItemIdSet: list of int non-negative """ self.CustomerPolicyItemIdSet = None def _deserialize(self, params): self.CustomerPolicyItemIdSet = params.get("CustomerPolicyItemIdSet") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AddCompliancePolicyItemToWhitelistResponse(AbstractModel): """AddCompliancePolicyItemToWhitelist返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class AddEditAbnormalProcessRuleRequest(AbstractModel): """AddEditAbnormalProcessRule请求参数结构体 """ def __init__(self): r""" :param RuleInfo: 增加策略信息,策略id为空,编辑策略是id不能为空 :type RuleInfo: :class:`tencentcloud.tcss.v20201101.models.AbnormalProcessRuleInfo` :param EventId: 仅在加白的时候带上 :type EventId: str """ self.RuleInfo = None self.EventId = None def _deserialize(self, params): if params.get("RuleInfo") is not None: self.RuleInfo = AbnormalProcessRuleInfo() self.RuleInfo._deserialize(params.get("RuleInfo")) self.EventId = params.get("EventId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AddEditAbnormalProcessRuleResponse(AbstractModel): """AddEditAbnormalProcessRule返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class AddEditAccessControlRuleRequest(AbstractModel): """AddEditAccessControlRule请求参数结构体 """ def __init__(self): r""" :param RuleInfo: 增加策略信息,策略id为空,编辑策略是id不能为空 :type RuleInfo: :class:`tencentcloud.tcss.v20201101.models.AccessControlRuleInfo` :param EventId: 仅在白名单时候使用 :type EventId: str """ self.RuleInfo = None self.EventId = None def _deserialize(self, params): if params.get("RuleInfo") is not None: self.RuleInfo = AccessControlRuleInfo() self.RuleInfo._deserialize(params.get("RuleInfo")) self.EventId = params.get("EventId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AddEditAccessControlRuleResponse(AbstractModel): """AddEditAccessControlRule返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class AddEditReverseShellWhiteListRequest(AbstractModel): """AddEditReverseShellWhiteList请求参数结构体 """ def __init__(self): r""" :param WhiteListInfo: 增加或编辑白名单信息。新增白名单时WhiteListInfo.id为空,编辑白名单WhiteListInfo.id不能为空。 :type WhiteListInfo: :class:`tencentcloud.tcss.v20201101.models.ReverseShellWhiteListInfo` :param EventId: 仅在添加事件白名单时候使用 :type EventId: str """ self.WhiteListInfo = None self.EventId = None def _deserialize(self, params): if params.get("WhiteListInfo") is not None: self.WhiteListInfo = ReverseShellWhiteListInfo() self.WhiteListInfo._deserialize(params.get("WhiteListInfo")) self.EventId = params.get("EventId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AddEditReverseShellWhiteListResponse(AbstractModel): """AddEditReverseShellWhiteList返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class AddEditRiskSyscallWhiteListRequest(AbstractModel): """AddEditRiskSyscallWhiteList请求参数结构体 """ def __init__(self): r""" :param EventId: 仅在添加白名单时候使用 :type EventId: str :param WhiteListInfo: 增加白名单信息,白名单id为空,编辑白名单id不能为空 :type WhiteListInfo: :class:`tencentcloud.tcss.v20201101.models.RiskSyscallWhiteListInfo` """ self.EventId = None self.WhiteListInfo = None def _deserialize(self, params): self.EventId = params.get("EventId") if params.get("WhiteListInfo") is not None: self.WhiteListInfo = RiskSyscallWhiteListInfo() self.WhiteListInfo._deserialize(params.get("WhiteListInfo")) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AddEditRiskSyscallWhiteListResponse(AbstractModel): """AddEditRiskSyscallWhiteList返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class AddEditWarningRulesRequest(AbstractModel): """AddEditWarningRules请求参数结构体 """ def __init__(self): r""" :param WarningRules: 告警开关策略 :type WarningRules: list of WarningRule """ self.WarningRules = None def _deserialize(self, params): if params.get("WarningRules") is not None: self.WarningRules = [] for item in params.get("WarningRules"): obj = WarningRule() obj._deserialize(item) self.WarningRules.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AddEditWarningRulesResponse(AbstractModel): """AddEditWarningRules返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class AffectedNodeItem(AbstractModel): """受影响的节点类型结构体 """ def __init__(self): r""" :param ClusterId: 集群ID :type ClusterId: str :param ClusterName: 集群名字 :type ClusterName: str :param InstanceId: 实例id :type InstanceId: str :param PrivateIpAddresses: 内网ip地址 :type PrivateIpAddresses: str :param InstanceRole: 节点的角色,Master、Work等 :type InstanceRole: str :param ClusterVersion: k8s版本 :type ClusterVersion: str :param ContainerRuntime: 运行时组件,docker或者containerd :type ContainerRuntime: str :param Region: 区域 :type Region: str :param VerifyInfo: 检查结果的验证信息 :type VerifyInfo: str """ self.ClusterId = None self.ClusterName = None self.InstanceId = None self.PrivateIpAddresses = None self.InstanceRole = None self.ClusterVersion = None self.ContainerRuntime = None self.Region = None self.VerifyInfo = None def _deserialize(self, params): self.ClusterId = params.get("ClusterId") self.ClusterName = params.get("ClusterName") self.InstanceId = params.get("InstanceId") self.PrivateIpAddresses = params.get("PrivateIpAddresses") self.InstanceRole = params.get("InstanceRole") self.ClusterVersion = params.get("ClusterVersion") self.ContainerRuntime = params.get("ContainerRuntime") self.Region = params.get("Region") self.VerifyInfo = params.get("VerifyInfo") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AffectedWorkloadItem(AbstractModel): """集群安全检查受影响的工作负载Item """ def __init__(self): r""" :param ClusterId: 集群Id :type ClusterId: str :param ClusterName: 集群名字 :type ClusterName: str :param WorkloadName: 工作负载名称 :type WorkloadName: str :param WorkloadType: 工作负载类型 :type WorkloadType: str :param Region: 区域 :type Region: str :param VerifyInfo: 检测结果的验证信息 :type VerifyInfo: str """ self.ClusterId = None self.ClusterName = None self.WorkloadName = None self.WorkloadType = None self.Region = None self.VerifyInfo = None def _deserialize(self, params): self.ClusterId = params.get("ClusterId") self.ClusterName = params.get("ClusterName") self.WorkloadName = params.get("WorkloadName") self.WorkloadType = params.get("WorkloadType") self.Region = params.get("Region") self.VerifyInfo = params.get("VerifyInfo") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AssetFilters(AbstractModel): """容器安全 描述键值对过滤器,用于条件过滤查询。例如过滤ID、名称、状态等 若存在多个Filter时,Filter间的关系为逻辑与(AND)关系。 若同一个Filter存在多个Values,同一Filter下Values间的关系为逻辑或(OR)关系。 """ def __init__(self): r""" :param Name: 过滤键的名称 :type Name: str :param Values: 一个或者多个过滤值。 :type Values: list of str :param ExactMatch: 是否模糊查询 :type ExactMatch: bool """ self.Name = None self.Values = None self.ExactMatch = None def _deserialize(self, params): self.Name = params.get("Name") self.Values = params.get("Values") self.ExactMatch = params.get("ExactMatch") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class AssetSimpleImageInfo(AbstractModel): """容器安全资产镜像简略信息 """ def __init__(self): r""" :param ImageID: 镜像ID :type ImageID: str :param ImageName: 镜像名称 :type ImageName: str :param ContainerCnt: 关联容器个数 :type ContainerCnt: int :param ScanTime: 最后扫描时间 :type ScanTime: str :param Size: 镜像大小 :type Size: int """ self.ImageID = None self.ImageName = None self.ContainerCnt = None self.ScanTime = None self.Size = None def _deserialize(self, params): self.ImageID = params.get("ImageID") self.ImageName = params.get("ImageName") self.ContainerCnt = params.get("ContainerCnt") self.ScanTime = params.get("ScanTime") self.Size = params.get("Size") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CheckRepeatAssetImageRegistryRequest(AbstractModel): """CheckRepeatAssetImageRegistry请求参数结构体 """ def __init__(self): r""" :param Name: 仓库名 :type Name: str """ self.Name = None def _deserialize(self, params): self.Name = params.get("Name") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CheckRepeatAssetImageRegistryResponse(AbstractModel): """CheckRepeatAssetImageRegistry返回参数结构体 """ def __init__(self): r""" :param IsRepeat: 是否重复 注意:此字段可能返回 null,表示取不到有效值。 :type IsRepeat: bool :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.IsRepeat = None self.RequestId = None def _deserialize(self, params): self.IsRepeat = params.get("IsRepeat") self.RequestId = params.get("RequestId") class ClusterCheckItem(AbstractModel): """表示一条集群安全检测项的详细信息 """ def __init__(self): r""" :param CheckItemId: 唯一的检测项的ID 注意:此字段可能返回 null,表示取不到有效值。 :type CheckItemId: int :param Name: 风险项的名称 :type Name: str :param ItemDetail: 检测项详细描述。 注意:此字段可能返回 null,表示取不到有效值。 :type ItemDetail: str :param RiskLevel: 威胁等级。严重Serious,高危High,中危Middle,提示Hint 注意:此字段可能返回 null,表示取不到有效值。 :type RiskLevel: str :param RiskTarget: 检查对象、风险对象.Runc,Kubelet,Containerd,Pods 注意:此字段可能返回 null,表示取不到有效值。 :type RiskTarget: str :param RiskType: 风险类别,漏洞风险CVERisk,配置风险ConfigRisk 注意:此字段可能返回 null,表示取不到有效值。 :type RiskType: str :param RiskAttribute: 检测项所属的风险类型,权限提升:PrivilegePromotion,拒绝服务:RefuseService,目录穿越:DirectoryEscape,未授权访问:UnauthorizedAccess,权限许可和访问控制问题:PrivilegeAndAccessControl,敏感信息泄露:SensitiveInfoLeak 注意:此字段可能返回 null,表示取不到有效值。 :type RiskAttribute: str :param RiskProperty: 风险特征,Tag.存在EXP:ExistEXP,存在POD:ExistPOC,无需重启:NoNeedReboot, 服务重启:ServerRestart,远程信息泄露:RemoteInfoLeak,远程拒绝服务:RemoteRefuseService,远程利用:RemoteExploit,远程执行:RemoteExecute 注意:此字段可能返回 null,表示取不到有效值。 :type RiskProperty: str :param CVENumber: CVE编号 注意:此字段可能返回 null,表示取不到有效值。 :type CVENumber: str :param DiscoverTime: 披露时间 注意:此字段可能返回 null,表示取不到有效值。 :type DiscoverTime: str :param Solution: 解决方案 注意:此字段可能返回 null,表示取不到有效值。 :type Solution: str :param CVSS: CVSS信息,用于画图 注意:此字段可能返回 null,表示取不到有效值。 :type CVSS: str :param CVSSScore: CVSS分数 注意:此字段可能返回 null,表示取不到有效值。 :type CVSSScore: str :param RelateLink: 参考连接 注意:此字段可能返回 null,表示取不到有效值。 :type RelateLink: str :param AffectedType: 影响类型,为Node或者Workload 注意:此字段可能返回 null,表示取不到有效值。 :type AffectedType: str :param AffectedVersion: 受影响的版本信息 注意:此字段可能返回 null,表示取不到有效值。 :type AffectedVersion: str """ self.CheckItemId = None self.Name = None self.ItemDetail = None self.RiskLevel = None self.RiskTarget = None self.RiskType = None self.RiskAttribute = None self.RiskProperty = None self.CVENumber = None self.DiscoverTime = None self.Solution = None self.CVSS = None self.CVSSScore = None self.RelateLink = None self.AffectedType = None self.AffectedVersion = None def _deserialize(self, params): self.CheckItemId = params.get("CheckItemId") self.Name = params.get("Name") self.ItemDetail = params.get("ItemDetail") self.RiskLevel = params.get("RiskLevel") self.RiskTarget = params.get("RiskTarget") self.RiskType = params.get("RiskType") self.RiskAttribute = params.get("RiskAttribute") self.RiskProperty = params.get("RiskProperty") self.CVENumber = params.get("CVENumber") self.DiscoverTime = params.get("DiscoverTime") self.Solution = params.get("Solution") self.CVSS = params.get("CVSS") self.CVSSScore = params.get("CVSSScore") self.RelateLink = params.get("RelateLink") self.AffectedType = params.get("AffectedType") self.AffectedVersion = params.get("AffectedVersion") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ClusterCheckTaskItem(AbstractModel): """集群检查任务入参 """ def __init__(self): r""" :param ClusterId: 指定要扫描的集群ID :type ClusterId: str :param ClusterRegion: 集群所属地域 :type ClusterRegion: str :param NodeIp: 指定要扫描的节点IP :type NodeIp: str :param WorkloadName: 按照要扫描的workload名字 :type WorkloadName: str """ self.ClusterId = None self.ClusterRegion = None self.NodeIp = None self.WorkloadName = None def _deserialize(self, params): self.ClusterId = params.get("ClusterId") self.ClusterRegion = params.get("ClusterRegion") self.NodeIp = params.get("NodeIp") self.WorkloadName = params.get("WorkloadName") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ClusterCreateComponentItem(AbstractModel): """CreateCheckComponent的入口参数,用于批量安装防御容器 """ def __init__(self): r""" :param ClusterId: 要安装组件的集群ID。 :type ClusterId: str :param ClusterRegion: 该集群对应的地域 :type ClusterRegion: str """ self.ClusterId = None self.ClusterRegion = None def _deserialize(self, params): self.ClusterId = params.get("ClusterId") self.ClusterRegion = params.get("ClusterRegion") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ClusterInfoItem(AbstractModel): """集群资产返回的结构体 """ def __init__(self): r""" :param ClusterId: 集群id :type ClusterId: str :param ClusterName: 集群名字 :type ClusterName: str :param ClusterVersion: 集群版本 :type ClusterVersion: str :param ClusterOs: 集群操作系统 :type ClusterOs: str :param ClusterType: 集群类型 :type ClusterType: str :param ClusterNodeNum: 集群节点数 :type ClusterNodeNum: int :param Region: 集群区域 :type Region: str :param DefenderStatus: 监控组件的状态,为Defender_Uninstall、Defender_Normal、Defender_Error、Defender_Installing :type DefenderStatus: str :param ClusterStatus: 集群状态 :type ClusterStatus: str :param ClusterCheckMode: 集群的检测模式,为Cluster_Normal或者Cluster_Actived. :type ClusterCheckMode: str :param ClusterAutoCheck: 是否自动定期检测 :type ClusterAutoCheck: bool :param DefenderErrorReason: 防护容器部署失败原因,为UserDaemonSetNotReady时,和UnreadyNodeNum转成"N个节点防御容器为就绪",其他错误直接展示 :type DefenderErrorReason: str :param UnreadyNodeNum: 防御容器没有ready状态的节点数量 :type UnreadyNodeNum: int :param SeriousRiskCount: 严重风险检查项的数量 :type SeriousRiskCount: int :param HighRiskCount: 高风险检查项的数量 :type HighRiskCount: int :param MiddleRiskCount: 中风险检查项的数量 :type MiddleRiskCount: int :param HintRiskCount: 提示风险检查项的数量 :type HintRiskCount: int :param CheckFailReason: 检查失败原因 :type CheckFailReason: str :param CheckStatus: 检查状态,为Task_Running, NoRisk, HasRisk, Uncheck, Task_Error :type CheckStatus: str :param TaskCreateTime: 任务创建时间,检查时间 :type TaskCreateTime: str """ self.ClusterId = None self.ClusterName = None self.ClusterVersion = None self.ClusterOs = None self.ClusterType = None self.ClusterNodeNum = None self.Region = None self.DefenderStatus = None self.ClusterStatus = None self.ClusterCheckMode = None self.ClusterAutoCheck = None self.DefenderErrorReason = None self.UnreadyNodeNum = None self.SeriousRiskCount = None self.HighRiskCount = None self.MiddleRiskCount = None self.HintRiskCount = None self.CheckFailReason = None self.CheckStatus = None self.TaskCreateTime = None def _deserialize(self, params): self.ClusterId = params.get("ClusterId") self.ClusterName = params.get("ClusterName") self.ClusterVersion = params.get("ClusterVersion") self.ClusterOs = params.get("ClusterOs") self.ClusterType = params.get("ClusterType") self.ClusterNodeNum = params.get("ClusterNodeNum") self.Region = params.get("Region") self.DefenderStatus = params.get("DefenderStatus") self.ClusterStatus = params.get("ClusterStatus") self.ClusterCheckMode = params.get("ClusterCheckMode") self.ClusterAutoCheck = params.get("ClusterAutoCheck") self.DefenderErrorReason = params.get("DefenderErrorReason") self.UnreadyNodeNum = params.get("UnreadyNodeNum") self.SeriousRiskCount = params.get("SeriousRiskCount") self.HighRiskCount = params.get("HighRiskCount") self.MiddleRiskCount = params.get("MiddleRiskCount") self.HintRiskCount = params.get("HintRiskCount") self.CheckFailReason = params.get("CheckFailReason") self.CheckStatus = params.get("CheckStatus") self.TaskCreateTime = params.get("TaskCreateTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ClusterRiskItem(AbstractModel): """风险项是检查完之后,有问题的检测项,并且加了一些检查结果信息。 """ def __init__(self): r""" :param CheckItem: 检测项相关信息 :type CheckItem: :class:`tencentcloud.tcss.v20201101.models.ClusterCheckItem` :param VerifyInfo: 验证信息 :type VerifyInfo: str :param ErrorMessage: 事件描述,检查的错误信息 :type ErrorMessage: str :param AffectedClusterCount: 受影响的集群数量 :type AffectedClusterCount: int :param AffectedNodeCount: 受影响的节点数量 :type AffectedNodeCount: int """ self.CheckItem = None self.VerifyInfo = None self.ErrorMessage = None self.AffectedClusterCount = None self.AffectedNodeCount = None def _deserialize(self, params): if params.get("CheckItem") is not None: self.CheckItem = ClusterCheckItem() self.CheckItem._deserialize(params.get("CheckItem")) self.VerifyInfo = params.get("VerifyInfo") self.ErrorMessage = params.get("ErrorMessage") self.AffectedClusterCount = params.get("AffectedClusterCount") self.AffectedNodeCount = params.get("AffectedNodeCount") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceAffectedAsset(AbstractModel): """表示检测项所影响的资产的信息。 """ def __init__(self): r""" :param CustomerAssetId: 为客户分配的唯一的资产项的ID。 :type CustomerAssetId: int :param AssetName: 资产项的名称。 :type AssetName: str :param AssetType: 资产项的类型 :type AssetType: str :param CheckStatus: 检测状态 CHECK_INIT, 待检测 CHECK_RUNNING, 检测中 CHECK_FINISHED, 检测完成 CHECK_FAILED, 检测失败 :type CheckStatus: str :param NodeName: 节点名称。 :type NodeName: str :param LastCheckTime: 上次检测的时间,格式为”YYYY-MM-DD HH:m::SS“。 如果没有检测过,此处为”0000-00-00 00:00:00“。 :type LastCheckTime: str :param CheckResult: 检测结果。取值为: RESULT_FAILED: 未通过 RESULT_PASSED: 通过 :type CheckResult: str :param HostIP: 主机IP 注意:此字段可能返回 null,表示取不到有效值。 :type HostIP: str :param ImageTag: 镜像的tag 注意:此字段可能返回 null,表示取不到有效值。 :type ImageTag: str<|fim▁hole|> self.AssetName = None self.AssetType = None self.CheckStatus = None self.NodeName = None self.LastCheckTime = None self.CheckResult = None self.HostIP = None self.ImageTag = None def _deserialize(self, params): self.CustomerAssetId = params.get("CustomerAssetId") self.AssetName = params.get("AssetName") self.AssetType = params.get("AssetType") self.CheckStatus = params.get("CheckStatus") self.NodeName = params.get("NodeName") self.LastCheckTime = params.get("LastCheckTime") self.CheckResult = params.get("CheckResult") self.HostIP = params.get("HostIP") self.ImageTag = params.get("ImageTag") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceAssetDetailInfo(AbstractModel): """表示一项资产的详情。 """ def __init__(self): r""" :param CustomerAssetId: 客户资产的ID。 :type CustomerAssetId: int :param AssetType: 资产类别。 :type AssetType: str :param AssetName: 资产的名称。 :type AssetName: str :param NodeName: 资产所属的节点的名称。 :type NodeName: str :param HostName: 资产所在的主机的名称。 :type HostName: str :param HostIP: 资产所在的主机的IP。 :type HostIP: str :param CheckStatus: 检测状态 CHECK_INIT, 待检测 CHECK_RUNNING, 检测中 CHECK_FINISHED, 检测完成 CHECK_FAILED, 检测失败 :type CheckStatus: str :param PassedPolicyItemCount: 此类资产通过的检测项的数目。 :type PassedPolicyItemCount: int :param FailedPolicyItemCount: 此类资产未通过的检测的数目。 :type FailedPolicyItemCount: int :param LastCheckTime: 上次检测的时间。 注意:此字段可能返回 null,表示取不到有效值。 :type LastCheckTime: str :param CheckResult: 检测结果: RESULT_FAILED: 未通过。 RESULT_PASSED: 通过。 注意:此字段可能返回 null,表示取不到有效值。 :type CheckResult: str :param AssetStatus: 资产的运行状态。 :type AssetStatus: str :param AssetCreateTime: 创建资产的时间。 ASSET_NORMAL: 正常运行, ASSET_PAUSED: 暂停运行, ASSET_STOPPED: 停止运行, ASSET_ABNORMAL: 异常 :type AssetCreateTime: str """ self.CustomerAssetId = None self.AssetType = None self.AssetName = None self.NodeName = None self.HostName = None self.HostIP = None self.CheckStatus = None self.PassedPolicyItemCount = None self.FailedPolicyItemCount = None self.LastCheckTime = None self.CheckResult = None self.AssetStatus = None self.AssetCreateTime = None def _deserialize(self, params): self.CustomerAssetId = params.get("CustomerAssetId") self.AssetType = params.get("AssetType") self.AssetName = params.get("AssetName") self.NodeName = params.get("NodeName") self.HostName = params.get("HostName") self.HostIP = params.get("HostIP") self.CheckStatus = params.get("CheckStatus") self.PassedPolicyItemCount = params.get("PassedPolicyItemCount") self.FailedPolicyItemCount = params.get("FailedPolicyItemCount") self.LastCheckTime = params.get("LastCheckTime") self.CheckResult = params.get("CheckResult") self.AssetStatus = params.get("AssetStatus") self.AssetCreateTime = params.get("AssetCreateTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceAssetInfo(AbstractModel): """表示一项资产的信息。 """ def __init__(self): r""" :param CustomerAssetId: 客户资产的ID。 :type CustomerAssetId: int :param AssetType: 资产类别。 :type AssetType: str :param AssetName: 资产的名称。 :type AssetName: str :param ImageTag: 当资产为镜像时,这个字段为镜像Tag。 注意:此字段可能返回 null,表示取不到有效值。 :type ImageTag: str :param HostIP: 资产所在的主机IP。 :type HostIP: str :param NodeName: 资产所属的节点的名称 :type NodeName: str :param CheckStatus: 检测状态 CHECK_INIT, 待检测 CHECK_RUNNING, 检测中 CHECK_FINISHED, 检测完成 CHECK_FAILED, 检测失败 :type CheckStatus: str :param PassedPolicyItemCount: 此类资产通过的检测项的数目。 注意:此字段可能返回 null,表示取不到有效值。 :type PassedPolicyItemCount: int :param FailedPolicyItemCount: 此类资产未通过的检测的数目。 注意:此字段可能返回 null,表示取不到有效值。 :type FailedPolicyItemCount: int :param LastCheckTime: 上次检测的时间。 注意:此字段可能返回 null,表示取不到有效值。 :type LastCheckTime: str :param CheckResult: 检测结果: RESULT_FAILED: 未通过。 RESULT_PASSED: 通过。 注意:此字段可能返回 null,表示取不到有效值。 :type CheckResult: str """ self.CustomerAssetId = None self.AssetType = None self.AssetName = None self.ImageTag = None self.HostIP = None self.NodeName = None self.CheckStatus = None self.PassedPolicyItemCount = None self.FailedPolicyItemCount = None self.LastCheckTime = None self.CheckResult = None def _deserialize(self, params): self.CustomerAssetId = params.get("CustomerAssetId") self.AssetType = params.get("AssetType") self.AssetName = params.get("AssetName") self.ImageTag = params.get("ImageTag") self.HostIP = params.get("HostIP") self.NodeName = params.get("NodeName") self.CheckStatus = params.get("CheckStatus") self.PassedPolicyItemCount = params.get("PassedPolicyItemCount") self.FailedPolicyItemCount = params.get("FailedPolicyItemCount") self.LastCheckTime = params.get("LastCheckTime") self.CheckResult = params.get("CheckResult") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceAssetPolicyItem(AbstractModel): """表示一条检测项的信息。 """ def __init__(self): r""" :param CustomerPolicyItemId: 为客户分配的唯一的检测项的ID。 :type CustomerPolicyItemId: int :param BasePolicyItemId: 检测项的原始ID :type BasePolicyItemId: int :param Name: 检测项的名称。 :type Name: str :param Category: 检测项所属的类型的名称 :type Category: str :param BenchmarkStandardId: 所属的合规标准的ID :type BenchmarkStandardId: int :param BenchmarkStandardName: 所属的合规标准的名称 :type BenchmarkStandardName: str :param RiskLevel: 威胁等级 :type RiskLevel: str :param CheckStatus: 检测状态 CHECK_INIT, 待检测 CHECK_RUNNING, 检测中 CHECK_FINISHED, 检测完成 CHECK_FAILED, 检测失败 :type CheckStatus: str :param CheckResult: 检测结果 RESULT_PASSED: 通过 RESULT_FAILED: 未通过 注意:此字段可能返回 null,表示取不到有效值。 :type CheckResult: str :param WhitelistId: 检测项对应的白名单项的ID。如果存在且非0,表示检测项被用户忽略。 注意:此字段可能返回 null,表示取不到有效值。 :type WhitelistId: int :param FixSuggestion: 处理建议。 :type FixSuggestion: str :param LastCheckTime: 最近检测的时间。 注意:此字段可能返回 null,表示取不到有效值。 :type LastCheckTime: str """ self.CustomerPolicyItemId = None self.BasePolicyItemId = None self.Name = None self.Category = None self.BenchmarkStandardId = None self.BenchmarkStandardName = None self.RiskLevel = None self.CheckStatus = None self.CheckResult = None self.WhitelistId = None self.FixSuggestion = None self.LastCheckTime = None def _deserialize(self, params): self.CustomerPolicyItemId = params.get("CustomerPolicyItemId") self.BasePolicyItemId = params.get("BasePolicyItemId") self.Name = params.get("Name") self.Category = params.get("Category") self.BenchmarkStandardId = params.get("BenchmarkStandardId") self.BenchmarkStandardName = params.get("BenchmarkStandardName") self.RiskLevel = params.get("RiskLevel") self.CheckStatus = params.get("CheckStatus") self.CheckResult = params.get("CheckResult") self.WhitelistId = params.get("WhitelistId") self.FixSuggestion = params.get("FixSuggestion") self.LastCheckTime = params.get("LastCheckTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceAssetSummary(AbstractModel): """表示一类资产的总览信息。 """ def __init__(self): r""" :param AssetType: 资产类别。 :type AssetType: str :param IsCustomerFirstCheck: 是否为客户的首次检测。与CheckStatus配合使用。 :type IsCustomerFirstCheck: bool :param CheckStatus: 检测状态 CHECK_UNINIT, 用户未启用此功能 CHECK_INIT, 待检测 CHECK_RUNNING, 检测中 CHECK_FINISHED, 检测完成 CHECK_FAILED, 检测失败 :type CheckStatus: str :param CheckProgress: 此类别的检测进度,为 0~100 的数。若未在检测中,无此字段。 注意:此字段可能返回 null,表示取不到有效值。 :type CheckProgress: float :param PassedPolicyItemCount: 此类资产通过的检测项的数目。 :type PassedPolicyItemCount: int :param FailedPolicyItemCount: 此类资产未通过的检测的数目。 :type FailedPolicyItemCount: int :param FailedCriticalPolicyItemCount: 此类资产下未通过的严重级别的检测项的数目。 :type FailedCriticalPolicyItemCount: int :param FailedHighRiskPolicyItemCount: 此类资产下未通过的高危检测项的数目。 :type FailedHighRiskPolicyItemCount: int :param FailedMediumRiskPolicyItemCount: 此类资产下未通过的中危检测项的数目。 :type FailedMediumRiskPolicyItemCount: int :param FailedLowRiskPolicyItemCount: 此类资产下未通过的低危检测项的数目。 :type FailedLowRiskPolicyItemCount: int :param NoticePolicyItemCount: 此类资产下提示级别的检测项的数目。 :type NoticePolicyItemCount: int :param PassedAssetCount: 通过检测的资产的数目。 :type PassedAssetCount: int :param FailedAssetCount: 未通过检测的资产的数目。 :type FailedAssetCount: int :param AssetPassedRate: 此类资产的合规率,0~100的数。 :type AssetPassedRate: float :param ScanFailedAssetCount: 检测失败的资产的数目。 :type ScanFailedAssetCount: int :param CheckCostTime: 上次检测的耗时,单位为秒。 注意:此字段可能返回 null,表示取不到有效值。 :type CheckCostTime: float :param LastCheckTime: 上次检测的时间。 注意:此字段可能返回 null,表示取不到有效值。 :type LastCheckTime: str :param PeriodRule: 定时检测规则。 :type PeriodRule: :class:`tencentcloud.tcss.v20201101.models.CompliancePeriodTaskRule` """ self.AssetType = None self.IsCustomerFirstCheck = None self.CheckStatus = None self.CheckProgress = None self.PassedPolicyItemCount = None self.FailedPolicyItemCount = None self.FailedCriticalPolicyItemCount = None self.FailedHighRiskPolicyItemCount = None self.FailedMediumRiskPolicyItemCount = None self.FailedLowRiskPolicyItemCount = None self.NoticePolicyItemCount = None self.PassedAssetCount = None self.FailedAssetCount = None self.AssetPassedRate = None self.ScanFailedAssetCount = None self.CheckCostTime = None self.LastCheckTime = None self.PeriodRule = None def _deserialize(self, params): self.AssetType = params.get("AssetType") self.IsCustomerFirstCheck = params.get("IsCustomerFirstCheck") self.CheckStatus = params.get("CheckStatus") self.CheckProgress = params.get("CheckProgress") self.PassedPolicyItemCount = params.get("PassedPolicyItemCount") self.FailedPolicyItemCount = params.get("FailedPolicyItemCount") self.FailedCriticalPolicyItemCount = params.get("FailedCriticalPolicyItemCount") self.FailedHighRiskPolicyItemCount = params.get("FailedHighRiskPolicyItemCount") self.FailedMediumRiskPolicyItemCount = params.get("FailedMediumRiskPolicyItemCount") self.FailedLowRiskPolicyItemCount = params.get("FailedLowRiskPolicyItemCount") self.NoticePolicyItemCount = params.get("NoticePolicyItemCount") self.PassedAssetCount = params.get("PassedAssetCount") self.FailedAssetCount = params.get("FailedAssetCount") self.AssetPassedRate = params.get("AssetPassedRate") self.ScanFailedAssetCount = params.get("ScanFailedAssetCount") self.CheckCostTime = params.get("CheckCostTime") self.LastCheckTime = params.get("LastCheckTime") if params.get("PeriodRule") is not None: self.PeriodRule = CompliancePeriodTaskRule() self.PeriodRule._deserialize(params.get("PeriodRule")) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceBenchmarkStandard(AbstractModel): """表示一个合规标准的信息。 """ def __init__(self): r""" :param StandardId: 合规标准的ID :type StandardId: int :param Name: 合规标准的名称 :type Name: str :param PolicyItemCount: 合规标准包含的数目 :type PolicyItemCount: int :param Enabled: 是否启用此标准 :type Enabled: bool :param Description: 标准的描述 :type Description: str """ self.StandardId = None self.Name = None self.PolicyItemCount = None self.Enabled = None self.Description = None def _deserialize(self, params): self.StandardId = params.get("StandardId") self.Name = params.get("Name") self.PolicyItemCount = params.get("PolicyItemCount") self.Enabled = params.get("Enabled") self.Description = params.get("Description") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceBenchmarkStandardEnable(AbstractModel): """表示是否启用合规标准。 """ def __init__(self): r""" :param StandardId: 合规标准的ID。 :type StandardId: int :param Enable: 是否启用合规标准 :type Enable: bool """ self.StandardId = None self.Enable = None def _deserialize(self, params): self.StandardId = params.get("StandardId") self.Enable = params.get("Enable") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceContainerDetailInfo(AbstractModel): """表示容器资产专属的详情。 """ def __init__(self): r""" :param ContainerId: 容器在主机上的ID。 :type ContainerId: str :param PodName: 容器所属的Pod的名称。 注意:此字段可能返回 null,表示取不到有效值。 :type PodName: str """ self.ContainerId = None self.PodName = None def _deserialize(self, params): self.ContainerId = params.get("ContainerId") self.PodName = params.get("PodName") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceFilters(AbstractModel): """键值对过滤器,用于条件过滤查询。例如过滤ID、名称、状态等 若存在多个Filter时,Filter间的关系为逻辑与(AND)关系。 若同一个Filter存在多个Values,同一Filter下Values间的关系为逻辑或(OR)关系。 """ def __init__(self): r""" :param Name: 过滤键的名称 :type Name: str :param Values: 一个或者多个过滤值。 :type Values: list of str :param ExactMatch: 是否模糊查询。默认为是。 :type ExactMatch: bool """ self.Name = None self.Values = None self.ExactMatch = None def _deserialize(self, params): self.Name = params.get("Name") self.Values = params.get("Values") self.ExactMatch = params.get("ExactMatch") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceHostDetailInfo(AbstractModel): """表示主机资产专属的详情。 """ def __init__(self): r""" :param DockerVersion: 主机上的Docker版本。 注意:此字段可能返回 null,表示取不到有效值。 :type DockerVersion: str :param K8SVersion: 主机上的K8S的版本。 注意:此字段可能返回 null,表示取不到有效值。 :type K8SVersion: str """ self.DockerVersion = None self.K8SVersion = None def _deserialize(self, params): self.DockerVersion = params.get("DockerVersion") self.K8SVersion = params.get("K8SVersion") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceImageDetailInfo(AbstractModel): """表示镜像资产专属的详情。 """ def __init__(self): r""" :param ImageId: 镜像在主机上的ID。 :type ImageId: str :param ImageName: 镜像的名称。 :type ImageName: str :param ImageTag: 镜像的Tag。 :type ImageTag: str :param Repository: 镜像所在远程仓库的路径。 注意:此字段可能返回 null,表示取不到有效值。 :type Repository: str """ self.ImageId = None self.ImageName = None self.ImageTag = None self.Repository = None def _deserialize(self, params): self.ImageId = params.get("ImageId") self.ImageName = params.get("ImageName") self.ImageTag = params.get("ImageTag") self.Repository = params.get("Repository") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceK8SDetailInfo(AbstractModel): """表示K8S资产专属的详情。 """ def __init__(self): r""" :param ClusterName: K8S集群的名称。 注意:此字段可能返回 null,表示取不到有效值。 :type ClusterName: str :param ClusterVersion: K8S集群的版本。 注意:此字段可能返回 null,表示取不到有效值。 :type ClusterVersion: str """ self.ClusterName = None self.ClusterVersion = None def _deserialize(self, params): self.ClusterName = params.get("ClusterName") self.ClusterVersion = params.get("ClusterVersion") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CompliancePeriodTask(AbstractModel): """表示一个合规基线检测定时任务的信息。 """ def __init__(self): r""" :param PeriodTaskId: 周期任务的ID :type PeriodTaskId: int :param AssetType: 资产类型。 ASSET_CONTAINER, 容器 ASSET_IMAGE, 镜像 ASSET_HOST, 主机 ASSET_K8S, K8S资产 :type AssetType: str :param LastTriggerTime: 最近一次触发的时间 注意:此字段可能返回 null,表示取不到有效值。 :type LastTriggerTime: str :param TotalPolicyItemCount: 总的检查项数目 :type TotalPolicyItemCount: int :param PeriodRule: 周期设置 :type PeriodRule: :class:`tencentcloud.tcss.v20201101.models.CompliancePeriodTaskRule` :param BenchmarkStandardSet: 合规标准列表 :type BenchmarkStandardSet: list of ComplianceBenchmarkStandard """ self.PeriodTaskId = None self.AssetType = None self.LastTriggerTime = None self.TotalPolicyItemCount = None self.PeriodRule = None self.BenchmarkStandardSet = None def _deserialize(self, params): self.PeriodTaskId = params.get("PeriodTaskId") self.AssetType = params.get("AssetType") self.LastTriggerTime = params.get("LastTriggerTime") self.TotalPolicyItemCount = params.get("TotalPolicyItemCount") if params.get("PeriodRule") is not None: self.PeriodRule = CompliancePeriodTaskRule() self.PeriodRule._deserialize(params.get("PeriodRule")) if params.get("BenchmarkStandardSet") is not None: self.BenchmarkStandardSet = [] for item in params.get("BenchmarkStandardSet"): obj = ComplianceBenchmarkStandard() obj._deserialize(item) self.BenchmarkStandardSet.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CompliancePeriodTaskRule(AbstractModel): """表示一个定时任务的周期设置 """ def __init__(self): r""" :param Frequency: 执行的频率(几天一次),取值为:1,3,7。 :type Frequency: int :param ExecutionTime: 在这天的什么时间执行,格式为:HH:mm:SS。 :type ExecutionTime: str """ self.Frequency = None self.ExecutionTime = None def _deserialize(self, params): self.Frequency = params.get("Frequency") self.ExecutionTime = params.get("ExecutionTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CompliancePolicyItemSummary(AbstractModel): """表示一条检测项对应的汇总信息。 """ def __init__(self): r""" :param CustomerPolicyItemId: 为客户分配的唯一的检测项的ID。 :type CustomerPolicyItemId: int :param BasePolicyItemId: 检测项的原始ID。 :type BasePolicyItemId: int :param Name: 检测项的名称。 :type Name: str :param Category: 检测项所属的类型,枚举字符串。 :type Category: str :param BenchmarkStandardName: 所属的合规标准 :type BenchmarkStandardName: str :param RiskLevel: 威胁等级。RISK_CRITICAL, RISK_HIGH, RISK_MEDIUM, RISK_LOW, RISK_NOTICE。 :type RiskLevel: str :param AssetType: 检测项所属的资产类型 :type AssetType: str :param LastCheckTime: 最近检测的时间 注意:此字段可能返回 null,表示取不到有效值。 :type LastCheckTime: str :param CheckStatus: 检测状态 CHECK_INIT, 待检测 CHECK_RUNNING, 检测中 CHECK_FINISHED, 检测完成 CHECK_FAILED, 检测失败 :type CheckStatus: str :param CheckResult: 检测结果。RESULT_PASSED: 通过 RESULT_FAILED: 未通过 注意:此字段可能返回 null,表示取不到有效值。 :type CheckResult: str :param PassedAssetCount: 通过检测的资产的数目 注意:此字段可能返回 null,表示取不到有效值。 :type PassedAssetCount: int :param FailedAssetCount: 未通过检测的资产的数目 注意:此字段可能返回 null,表示取不到有效值。 :type FailedAssetCount: int :param WhitelistId: 检测项对应的白名单项的ID。如果存在且非0,表示检测项被用户忽略。 注意:此字段可能返回 null,表示取不到有效值。 :type WhitelistId: int :param FixSuggestion: 处理建议。 :type FixSuggestion: str :param BenchmarkStandardId: 所属的合规标准的ID :type BenchmarkStandardId: int """ self.CustomerPolicyItemId = None self.BasePolicyItemId = None self.Name = None self.Category = None self.BenchmarkStandardName = None self.RiskLevel = None self.AssetType = None self.LastCheckTime = None self.CheckStatus = None self.CheckResult = None self.PassedAssetCount = None self.FailedAssetCount = None self.WhitelistId = None self.FixSuggestion = None self.BenchmarkStandardId = None def _deserialize(self, params): self.CustomerPolicyItemId = params.get("CustomerPolicyItemId") self.BasePolicyItemId = params.get("BasePolicyItemId") self.Name = params.get("Name") self.Category = params.get("Category") self.BenchmarkStandardName = params.get("BenchmarkStandardName") self.RiskLevel = params.get("RiskLevel") self.AssetType = params.get("AssetType") self.LastCheckTime = params.get("LastCheckTime") self.CheckStatus = params.get("CheckStatus") self.CheckResult = params.get("CheckResult") self.PassedAssetCount = params.get("PassedAssetCount") self.FailedAssetCount = params.get("FailedAssetCount") self.WhitelistId = params.get("WhitelistId") self.FixSuggestion = params.get("FixSuggestion") self.BenchmarkStandardId = params.get("BenchmarkStandardId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceScanFailedAsset(AbstractModel): """表示检测失败的资产的信息。 """ def __init__(self): r""" :param CustomerAssetId: 客户资产的ID。 :type CustomerAssetId: int :param AssetType: 资产类别。 :type AssetType: str :param CheckStatus: 检测状态 CHECK_INIT, 待检测 CHECK_RUNNING, 检测中 CHECK_FINISHED, 检测完成 CHECK_FAILED, 检测失败 :type CheckStatus: str :param AssetName: 资产的名称。 :type AssetName: str :param FailureReason: 资产检测失败的原因。 :type FailureReason: str :param Suggestion: 检测失败的处理建议。 :type Suggestion: str :param CheckTime: 检测的时间。 :type CheckTime: str """ self.CustomerAssetId = None self.AssetType = None self.CheckStatus = None self.AssetName = None self.FailureReason = None self.Suggestion = None self.CheckTime = None def _deserialize(self, params): self.CustomerAssetId = params.get("CustomerAssetId") self.AssetType = params.get("AssetType") self.CheckStatus = params.get("CheckStatus") self.AssetName = params.get("AssetName") self.FailureReason = params.get("FailureReason") self.Suggestion = params.get("Suggestion") self.CheckTime = params.get("CheckTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComplianceWhitelistItem(AbstractModel): """表示一条白名单记录。 """ def __init__(self): r""" :param WhitelistItemId: 白名单项的ID。 :type WhitelistItemId: int :param CustomerPolicyItemId: 客户检测项的ID。 :type CustomerPolicyItemId: int :param Name: 检测项的名称。 :type Name: str :param StandardName: 合规标准的名称。 :type StandardName: str :param StandardId: 合规标准的ID。 :type StandardId: int :param AffectedAssetCount: 检测项影响的资产的数目。 :type AffectedAssetCount: int :param LastUpdateTime: 最后更新的时间 :type LastUpdateTime: str :param InsertTime: 加入到白名单的时间 :type InsertTime: str """ self.WhitelistItemId = None self.CustomerPolicyItemId = None self.Name = None self.StandardName = None self.StandardId = None self.AffectedAssetCount = None self.LastUpdateTime = None self.InsertTime = None def _deserialize(self, params): self.WhitelistItemId = params.get("WhitelistItemId") self.CustomerPolicyItemId = params.get("CustomerPolicyItemId") self.Name = params.get("Name") self.StandardName = params.get("StandardName") self.StandardId = params.get("StandardId") self.AffectedAssetCount = params.get("AffectedAssetCount") self.LastUpdateTime = params.get("LastUpdateTime") self.InsertTime = params.get("InsertTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComponentInfo(AbstractModel): """容器组件信息 """ def __init__(self): r""" :param Name: 名称 :type Name: str :param Version: 版本 :type Version: str """ self.Name = None self.Version = None def _deserialize(self, params): self.Name = params.get("Name") self.Version = params.get("Version") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ComponentsInfo(AbstractModel): """组件信息 """ def __init__(self): r""" :param Component: 组件名称 注意:此字段可能返回 null,表示取不到有效值。 :type Component: str :param Version: 组件版本信息 注意:此字段可能返回 null,表示取不到有效值。 :type Version: str """ self.Component = None self.Version = None def _deserialize(self, params): self.Component = params.get("Component") self.Version = params.get("Version") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ContainerInfo(AbstractModel): """容器列表集合 """ def __init__(self): r""" :param ContainerID: 容器id :type ContainerID: str :param ContainerName: 容器名称 :type ContainerName: str :param Status: 容器运行状态 :type Status: str :param CreateTime: 创建时间 :type CreateTime: str :param RunAs: 运行用户 :type RunAs: str :param Cmd: 命令行 :type Cmd: str :param CPUUsage: CPU使用率 *1000 :type CPUUsage: int :param RamUsage: 内存使用 kb :type RamUsage: int :param ImageName: 镜像名称 :type ImageName: str :param ImageID: 镜像id :type ImageID: str :param POD: 镜像id :type POD: str :param HostID: 主机id :type HostID: str :param HostIP: 主机ip :type HostIP: str :param UpdateTime: 更新时间 :type UpdateTime: str :param HostName: 主机名称 :type HostName: str :param PublicIp: 外网ip :type PublicIp: str """ self.ContainerID = None self.ContainerName = None self.Status = None self.CreateTime = None self.RunAs = None self.Cmd = None self.CPUUsage = None self.RamUsage = None self.ImageName = None self.ImageID = None self.POD = None self.HostID = None self.HostIP = None self.UpdateTime = None self.HostName = None self.PublicIp = None def _deserialize(self, params): self.ContainerID = params.get("ContainerID") self.ContainerName = params.get("ContainerName") self.Status = params.get("Status") self.CreateTime = params.get("CreateTime") self.RunAs = params.get("RunAs") self.Cmd = params.get("Cmd") self.CPUUsage = params.get("CPUUsage") self.RamUsage = params.get("RamUsage") self.ImageName = params.get("ImageName") self.ImageID = params.get("ImageID") self.POD = params.get("POD") self.HostID = params.get("HostID") self.HostIP = params.get("HostIP") self.UpdateTime = params.get("UpdateTime") self.HostName = params.get("HostName") self.PublicIp = params.get("PublicIp") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ContainerMount(AbstractModel): """容器挂载信息 """ def __init__(self): r""" :param Type: 挂载类型 bind :type Type: str :param Source: 宿主机路径 :type Source: str :param Destination: 容器内路径 :type Destination: str :param Mode: 模式 :type Mode: str :param RW: 读写权限 :type RW: bool :param Propagation: 传播类型 :type Propagation: str :param Name: 名称 :type Name: str :param Driver: 驱动 :type Driver: str """ self.Type = None self.Source = None self.Destination = None self.Mode = None self.RW = None self.Propagation = None self.Name = None self.Driver = None def _deserialize(self, params): self.Type = params.get("Type") self.Source = params.get("Source") self.Destination = params.get("Destination") self.Mode = params.get("Mode") self.RW = params.get("RW") self.Propagation = params.get("Propagation") self.Name = params.get("Name") self.Driver = params.get("Driver") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ContainerNetwork(AbstractModel): """容器网络信息 """ def __init__(self): r""" :param EndpointID: endpoint id :type EndpointID: str :param Mode: 模式:bridge :type Mode: str :param Name: 网络名称 :type Name: str :param NetworkID: 网络ID :type NetworkID: str :param Gateway: 网关 :type Gateway: str :param Ipv4: IPV4地址 :type Ipv4: str :param Ipv6: IPV6地址 :type Ipv6: str :param MAC: MAC 地址 :type MAC: str """ self.EndpointID = None self.Mode = None self.Name = None self.NetworkID = None self.Gateway = None self.Ipv4 = None self.Ipv6 = None self.MAC = None def _deserialize(self, params): self.EndpointID = params.get("EndpointID") self.Mode = params.get("Mode") self.Name = params.get("Name") self.NetworkID = params.get("NetworkID") self.Gateway = params.get("Gateway") self.Ipv4 = params.get("Ipv4") self.Ipv6 = params.get("Ipv6") self.MAC = params.get("MAC") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CreateAssetImageRegistryScanTaskOneKeyRequest(AbstractModel): """CreateAssetImageRegistryScanTaskOneKey请求参数结构体 """ def __init__(self): r""" :param All: 是否扫描全部镜像 :type All: bool :param Images: 扫描的镜像列表 :type Images: list of ImageInfo :param ScanType: 扫描类型数组 :type ScanType: list of str :param Id: 扫描的镜像列表Id :type Id: list of int non-negative """ self.All = None self.Images = None self.ScanType = None self.Id = None def _deserialize(self, params): self.All = params.get("All") if params.get("Images") is not None: self.Images = [] for item in params.get("Images"): obj = ImageInfo() obj._deserialize(item) self.Images.append(obj) self.ScanType = params.get("ScanType") self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CreateAssetImageRegistryScanTaskOneKeyResponse(AbstractModel): """CreateAssetImageRegistryScanTaskOneKey返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class CreateAssetImageRegistryScanTaskRequest(AbstractModel): """CreateAssetImageRegistryScanTask请求参数结构体 """ def __init__(self): r""" :param All: 是否扫描全部镜像 :type All: bool :param Images: 扫描的镜像列表 :type Images: list of ImageInfo :param ScanType: 扫描类型数组 :type ScanType: list of str :param Id: 扫描的镜像列表 :type Id: list of int non-negative :param Filters: 过滤条件 :type Filters: list of AssetFilters :param ExcludeImageList: 不需要扫描的镜像列表, 与Filters配合使用 :type ExcludeImageList: list of int non-negative :param OnlyScanLatest: 是否仅扫描各repository最新版的镜像, 与Filters配合使用 :type OnlyScanLatest: bool """ self.All = None self.Images = None self.ScanType = None self.Id = None self.Filters = None self.ExcludeImageList = None self.OnlyScanLatest = None def _deserialize(self, params): self.All = params.get("All") if params.get("Images") is not None: self.Images = [] for item in params.get("Images"): obj = ImageInfo() obj._deserialize(item) self.Images.append(obj) self.ScanType = params.get("ScanType") self.Id = params.get("Id") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.ExcludeImageList = params.get("ExcludeImageList") self.OnlyScanLatest = params.get("OnlyScanLatest") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CreateAssetImageRegistryScanTaskResponse(AbstractModel): """CreateAssetImageRegistryScanTask返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class CreateAssetImageScanSettingRequest(AbstractModel): """CreateAssetImageScanSetting请求参数结构体 """ def __init__(self): r""" :param Enable: 开关 :type Enable: bool :param ScanTime: 扫描时间 :type ScanTime: str :param ScanPeriod: 扫描周期 :type ScanPeriod: int :param ScanVirus: 扫描木马 :type ScanVirus: bool :param ScanRisk: 扫描敏感信息 :type ScanRisk: bool :param ScanVul: 扫描漏洞 :type ScanVul: bool :param All: 全部镜像 :type All: bool :param Images: 自定义镜像 :type Images: list of str """ self.Enable = None self.ScanTime = None self.ScanPeriod = None self.ScanVirus = None self.ScanRisk = None self.ScanVul = None self.All = None self.Images = None def _deserialize(self, params): self.Enable = params.get("Enable") self.ScanTime = params.get("ScanTime") self.ScanPeriod = params.get("ScanPeriod") self.ScanVirus = params.get("ScanVirus") self.ScanRisk = params.get("ScanRisk") self.ScanVul = params.get("ScanVul") self.All = params.get("All") self.Images = params.get("Images") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CreateAssetImageScanSettingResponse(AbstractModel): """CreateAssetImageScanSetting返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class CreateAssetImageScanTaskRequest(AbstractModel): """CreateAssetImageScanTask请求参数结构体 """ def __init__(self): r""" :param All: 是否扫描全部镜像;全部镜像,镜像列表和根据过滤条件筛选三选一。 :type All: bool :param Images: 需要扫描的镜像列表;全部镜像,镜像列表和根据过滤条件筛选三选一。 :type Images: list of str :param ScanVul: 扫描漏洞;漏洞,木马和风险需选其一 :type ScanVul: bool :param ScanVirus: 扫描木马;漏洞,木马和风险需选其一 :type ScanVirus: bool :param ScanRisk: 扫描风险;漏洞,木马和风险需选其一 :type ScanRisk: bool :param Filters: 根据过滤条件筛选出镜像;全部镜像,镜像列表和根据过滤条件筛选三选一。 :type Filters: list of AssetFilters :param ExcludeImageIds: 根据过滤条件筛选出镜像,再排除个别镜像 :type ExcludeImageIds: list of str """ self.All = None self.Images = None self.ScanVul = None self.ScanVirus = None self.ScanRisk = None self.Filters = None self.ExcludeImageIds = None def _deserialize(self, params): self.All = params.get("All") self.Images = params.get("Images") self.ScanVul = params.get("ScanVul") self.ScanVirus = params.get("ScanVirus") self.ScanRisk = params.get("ScanRisk") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.ExcludeImageIds = params.get("ExcludeImageIds") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CreateAssetImageScanTaskResponse(AbstractModel): """CreateAssetImageScanTask返回参数结构体 """ def __init__(self): r""" :param TaskID: 任务id :type TaskID: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskID = None self.RequestId = None def _deserialize(self, params): self.TaskID = params.get("TaskID") self.RequestId = params.get("RequestId") class CreateCheckComponentRequest(AbstractModel): """CreateCheckComponent请求参数结构体 """ def __init__(self): r""" :param ClusterInfoList: 要安装的集群列表信息 :type ClusterInfoList: list of ClusterCreateComponentItem """ self.ClusterInfoList = None def _deserialize(self, params): if params.get("ClusterInfoList") is not None: self.ClusterInfoList = [] for item in params.get("ClusterInfoList"): obj = ClusterCreateComponentItem() obj._deserialize(item) self.ClusterInfoList.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CreateCheckComponentResponse(AbstractModel): """CreateCheckComponent返回参数结构体 """ def __init__(self): r""" :param InstallResult: "InstallSucc"表示安装成功,"InstallFailed"表示安装失败 :type InstallResult: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.InstallResult = None self.RequestId = None def _deserialize(self, params): self.InstallResult = params.get("InstallResult") self.RequestId = params.get("RequestId") class CreateClusterCheckTaskRequest(AbstractModel): """CreateClusterCheckTask请求参数结构体 """ def __init__(self): r""" :param ClusterCheckTaskList: 指定要扫描的集群信息 :type ClusterCheckTaskList: list of ClusterCheckTaskItem """ self.ClusterCheckTaskList = None def _deserialize(self, params): if params.get("ClusterCheckTaskList") is not None: self.ClusterCheckTaskList = [] for item in params.get("ClusterCheckTaskList"): obj = ClusterCheckTaskItem() obj._deserialize(item) self.ClusterCheckTaskList.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CreateClusterCheckTaskResponse(AbstractModel): """CreateClusterCheckTask返回参数结构体 """ def __init__(self): r""" :param TaskId: 返回创建的集群检查任务的ID,为0表示创建失败。 :type TaskId: int :param CreateResult: 创建检查任务的结果,"Succ"为成功,其他的为失败原因 :type CreateResult: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskId = None self.CreateResult = None self.RequestId = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.CreateResult = params.get("CreateResult") self.RequestId = params.get("RequestId") class CreateComplianceTaskRequest(AbstractModel): """CreateComplianceTask请求参数结构体 """ def __init__(self): r""" :param AssetTypeSet: 指定要扫描的资产类型列表。 ASSET_CONTAINER, 容器 ASSET_IMAGE, 镜像 ASSET_HOST, 主机 ASSET_K8S, K8S资产 AssetTypeSet, PolicySetId, PeriodTaskId三个参数,必须要给其中一个参数填写有效的值。 :type AssetTypeSet: list of str :param PolicySetId: 按照策略集ID指定的策略执行合规检查。 :type PolicySetId: int :param PeriodTaskId: 按照定时任务ID指定的策略执行合规检查。 :type PeriodTaskId: int """ self.AssetTypeSet = None self.PolicySetId = None self.PeriodTaskId = None def _deserialize(self, params): self.AssetTypeSet = params.get("AssetTypeSet") self.PolicySetId = params.get("PolicySetId") self.PeriodTaskId = params.get("PeriodTaskId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CreateComplianceTaskResponse(AbstractModel): """CreateComplianceTask返回参数结构体 """ def __init__(self): r""" :param TaskId: 返回创建的合规检查任务的ID。 :type TaskId: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskId = None self.RequestId = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.RequestId = params.get("RequestId") class CreateExportComplianceStatusListJobRequest(AbstractModel): """CreateExportComplianceStatusListJob请求参数结构体 """ def __init__(self): r""" :param AssetType: 要导出信息的资产类型 :type AssetType: str :param ExportByAsset: 按照检测项导出,还是按照资产导出。true: 按照资产导出;false: 按照检测项导出。 :type ExportByAsset: bool :param ExportAll: true, 全部导出;false, 根据IdList来导出数据。 :type ExportAll: bool :param IdList: 要导出的资产ID列表或检测项ID列表,由ExportByAsset的取值决定。 :type IdList: list of int non-negative """ self.AssetType = None self.ExportByAsset = None self.ExportAll = None self.IdList = None def _deserialize(self, params): self.AssetType = params.get("AssetType") self.ExportByAsset = params.get("ExportByAsset") self.ExportAll = params.get("ExportAll") self.IdList = params.get("IdList") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CreateExportComplianceStatusListJobResponse(AbstractModel): """CreateExportComplianceStatusListJob返回参数结构体 """ def __init__(self): r""" :param JobId: 返回创建的导出任务的ID 注意:此字段可能返回 null,表示取不到有效值。 :type JobId: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.JobId = None self.RequestId = None def _deserialize(self, params): self.JobId = params.get("JobId") self.RequestId = params.get("RequestId") class CreateOrModifyPostPayCoresRequest(AbstractModel): """CreateOrModifyPostPayCores请求参数结构体 """ def __init__(self): r""" :param CoresCnt: 弹性计费上限,最小值500 :type CoresCnt: int """ self.CoresCnt = None def _deserialize(self, params): self.CoresCnt = params.get("CoresCnt") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CreateOrModifyPostPayCoresResponse(AbstractModel): """CreateOrModifyPostPayCores返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class CreateRefreshTaskRequest(AbstractModel): """CreateRefreshTask请求参数结构体 """ class CreateRefreshTaskResponse(AbstractModel): """CreateRefreshTask返回参数结构体 """ def __init__(self): r""" :param TaskId: 返回创建的集群检查任务的ID,为0表示创建失败。 :type TaskId: int :param CreateResult: 创建检查任务的结果,"Succ"为成功,"Failed"为失败 :type CreateResult: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskId = None self.CreateResult = None self.RequestId = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.CreateResult = params.get("CreateResult") self.RequestId = params.get("RequestId") class CreateVirusScanAgainRequest(AbstractModel): """CreateVirusScanAgain请求参数结构体 """ def __init__(self): r""" :param TaskId: 任务id :type TaskId: str :param ContainerIds: 需要扫描的容器id集合 :type ContainerIds: list of str :param TimeoutAll: 是否是扫描全部超时的 :type TimeoutAll: bool :param Timeout: 重新设置的超时时长 :type Timeout: int """ self.TaskId = None self.ContainerIds = None self.TimeoutAll = None self.Timeout = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.ContainerIds = params.get("ContainerIds") self.TimeoutAll = params.get("TimeoutAll") self.Timeout = params.get("Timeout") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CreateVirusScanAgainResponse(AbstractModel): """CreateVirusScanAgain返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class CreateVirusScanTaskRequest(AbstractModel): """CreateVirusScanTask请求参数结构体 """ def __init__(self): r""" :param ScanPathAll: 是否扫描所有路径 :type ScanPathAll: bool :param ScanRangeType: 扫描范围0容器1主机节点 :type ScanRangeType: int :param ScanRangeAll: true 全选,false 自选 :type ScanRangeAll: bool :param Timeout: 超时时长,单位小时 :type Timeout: int :param ScanPathType: 当ScanPathAll为false生效 0扫描以下路径 1、扫描除以下路径 :type ScanPathType: int :param ScanIds: 自选扫描范围的容器id或者主机id 根据ScanRangeType决定 :type ScanIds: list of str :param ScanPath: 自选排除或扫描的地址 :type ScanPath: list of str """ self.ScanPathAll = None self.ScanRangeType = None self.ScanRangeAll = None self.Timeout = None self.ScanPathType = None self.ScanIds = None self.ScanPath = None def _deserialize(self, params): self.ScanPathAll = params.get("ScanPathAll") self.ScanRangeType = params.get("ScanRangeType") self.ScanRangeAll = params.get("ScanRangeAll") self.Timeout = params.get("Timeout") self.ScanPathType = params.get("ScanPathType") self.ScanIds = params.get("ScanIds") self.ScanPath = params.get("ScanPath") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class CreateVirusScanTaskResponse(AbstractModel): """CreateVirusScanTask返回参数结构体 """ def __init__(self): r""" :param TaskID: 任务id :type TaskID: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskID = None self.RequestId = None def _deserialize(self, params): self.TaskID = params.get("TaskID") self.RequestId = params.get("RequestId") class DeleteAbnormalProcessRulesRequest(AbstractModel): """DeleteAbnormalProcessRules请求参数结构体 """ def __init__(self): r""" :param RuleIdSet: 策略的ids :type RuleIdSet: list of str """ self.RuleIdSet = None def _deserialize(self, params): self.RuleIdSet = params.get("RuleIdSet") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DeleteAbnormalProcessRulesResponse(AbstractModel): """DeleteAbnormalProcessRules返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class DeleteAccessControlRulesRequest(AbstractModel): """DeleteAccessControlRules请求参数结构体 """ def __init__(self): r""" :param RuleIdSet: 策略的ids :type RuleIdSet: list of str """ self.RuleIdSet = None def _deserialize(self, params): self.RuleIdSet = params.get("RuleIdSet") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DeleteAccessControlRulesResponse(AbstractModel): """DeleteAccessControlRules返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class DeleteCompliancePolicyItemFromWhitelistRequest(AbstractModel): """DeleteCompliancePolicyItemFromWhitelist请求参数结构体 """ def __init__(self): r""" :param WhitelistIdSet: 指定的白名单项的ID的列表 :type WhitelistIdSet: list of int non-negative """ self.WhitelistIdSet = None def _deserialize(self, params): self.WhitelistIdSet = params.get("WhitelistIdSet") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DeleteCompliancePolicyItemFromWhitelistResponse(AbstractModel): """DeleteCompliancePolicyItemFromWhitelist返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class DeleteReverseShellWhiteListsRequest(AbstractModel): """DeleteReverseShellWhiteLists请求参数结构体 """ def __init__(self): r""" :param WhiteListIdSet: 白名单ids :type WhiteListIdSet: list of str """ self.WhiteListIdSet = None def _deserialize(self, params): self.WhiteListIdSet = params.get("WhiteListIdSet") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DeleteReverseShellWhiteListsResponse(AbstractModel): """DeleteReverseShellWhiteLists返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class DeleteRiskSyscallWhiteListsRequest(AbstractModel): """DeleteRiskSyscallWhiteLists请求参数结构体 """ def __init__(self): r""" :param WhiteListIdSet: 白名单ids :type WhiteListIdSet: list of str """ self.WhiteListIdSet = None def _deserialize(self, params): self.WhiteListIdSet = params.get("WhiteListIdSet") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DeleteRiskSyscallWhiteListsResponse(AbstractModel): """DeleteRiskSyscallWhiteLists返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class DescribeAbnormalProcessDetailRequest(AbstractModel): """DescribeAbnormalProcessDetail请求参数结构体 """ def __init__(self): r""" :param EventId: 事件唯一id :type EventId: str """ self.EventId = None def _deserialize(self, params): self.EventId = params.get("EventId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAbnormalProcessDetailResponse(AbstractModel): """DescribeAbnormalProcessDetail返回参数结构体 """ def __init__(self): r""" :param EventBaseInfo: 事件基本信息 :type EventBaseInfo: :class:`tencentcloud.tcss.v20201101.models.RunTimeEventBaseInfo` :param ProcessInfo: 进程信息 :type ProcessInfo: :class:`tencentcloud.tcss.v20201101.models.ProcessDetailInfo` :param ParentProcessInfo: 父进程信息 :type ParentProcessInfo: :class:`tencentcloud.tcss.v20201101.models.ProcessDetailBaseInfo` :param EventDetail: 事件描述 :type EventDetail: :class:`tencentcloud.tcss.v20201101.models.AbnormalProcessEventDescription` :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.EventBaseInfo = None self.ProcessInfo = None self.ParentProcessInfo = None self.EventDetail = None self.RequestId = None def _deserialize(self, params): if params.get("EventBaseInfo") is not None: self.EventBaseInfo = RunTimeEventBaseInfo() self.EventBaseInfo._deserialize(params.get("EventBaseInfo")) if params.get("ProcessInfo") is not None: self.ProcessInfo = ProcessDetailInfo() self.ProcessInfo._deserialize(params.get("ProcessInfo")) if params.get("ParentProcessInfo") is not None: self.ParentProcessInfo = ProcessDetailBaseInfo() self.ParentProcessInfo._deserialize(params.get("ParentProcessInfo")) if params.get("EventDetail") is not None: self.EventDetail = AbnormalProcessEventDescription() self.EventDetail._deserialize(params.get("EventDetail")) self.RequestId = params.get("RequestId") class DescribeAbnormalProcessEventsExportRequest(AbstractModel): """DescribeAbnormalProcessEventsExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.ExportField = None self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAbnormalProcessEventsExportResponse(AbstractModel): """DescribeAbnormalProcessEventsExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: execle下载地址 注意:此字段可能返回 null,表示取不到有效值。 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeAbnormalProcessEventsRequest(AbstractModel): """DescribeAbnormalProcessEvents请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAbnormalProcessEventsResponse(AbstractModel): """DescribeAbnormalProcessEvents返回参数结构体 """ def __init__(self): r""" :param TotalCount: 事件总数量 :type TotalCount: int :param EventSet: 异常进程数组 :type EventSet: list of AbnormalProcessEventInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.EventSet = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("EventSet") is not None: self.EventSet = [] for item in params.get("EventSet"): obj = AbnormalProcessEventInfo() obj._deserialize(item) self.EventSet.append(obj) self.RequestId = params.get("RequestId") class DescribeAbnormalProcessRuleDetailRequest(AbstractModel): """DescribeAbnormalProcessRuleDetail请求参数结构体 """ def __init__(self): r""" :param RuleId: 策略唯一id :type RuleId: str :param ImageId: 镜像id, 在添加白名单的时候使用 :type ImageId: str """ self.RuleId = None self.ImageId = None def _deserialize(self, params): self.RuleId = params.get("RuleId") self.ImageId = params.get("ImageId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAbnormalProcessRuleDetailResponse(AbstractModel): """DescribeAbnormalProcessRuleDetail返回参数结构体 """ def __init__(self): r""" :param RuleDetail: 异常进程策略详细信息 :type RuleDetail: :class:`tencentcloud.tcss.v20201101.models.AbnormalProcessRuleInfo` :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RuleDetail = None self.RequestId = None def _deserialize(self, params): if params.get("RuleDetail") is not None: self.RuleDetail = AbnormalProcessRuleInfo() self.RuleDetail._deserialize(params.get("RuleDetail")) self.RequestId = params.get("RequestId") class DescribeAbnormalProcessRulesExportRequest(AbstractModel): """DescribeAbnormalProcessRulesExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.ExportField = None self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAbnormalProcessRulesExportResponse(AbstractModel): """DescribeAbnormalProcessRulesExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: execle下载地址 注意:此字段可能返回 null,表示取不到有效值。 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeAbnormalProcessRulesRequest(AbstractModel): """DescribeAbnormalProcessRules请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAbnormalProcessRulesResponse(AbstractModel): """DescribeAbnormalProcessRules返回参数结构体 """ def __init__(self): r""" :param TotalCount: 事件总数量 :type TotalCount: int :param RuleSet: 异常进程策略信息列表 :type RuleSet: list of RuleBaseInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.RuleSet = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("RuleSet") is not None: self.RuleSet = [] for item in params.get("RuleSet"): obj = RuleBaseInfo() obj._deserialize(item) self.RuleSet.append(obj) self.RequestId = params.get("RequestId") class DescribeAccessControlDetailRequest(AbstractModel): """DescribeAccessControlDetail请求参数结构体 """ def __init__(self): r""" :param EventId: 事件唯一id :type EventId: str """ self.EventId = None def _deserialize(self, params): self.EventId = params.get("EventId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAccessControlDetailResponse(AbstractModel): """DescribeAccessControlDetail返回参数结构体 """ def __init__(self): r""" :param EventBaseInfo: 事件基本信息 :type EventBaseInfo: :class:`tencentcloud.tcss.v20201101.models.RunTimeEventBaseInfo` :param ProcessInfo: 进程信息 :type ProcessInfo: :class:`tencentcloud.tcss.v20201101.models.ProcessDetailInfo` :param TamperedFileInfo: 被篡改信息 :type TamperedFileInfo: :class:`tencentcloud.tcss.v20201101.models.FileAttributeInfo` :param EventDetail: 事件描述 :type EventDetail: :class:`tencentcloud.tcss.v20201101.models.AccessControlEventDescription` :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.EventBaseInfo = None self.ProcessInfo = None self.TamperedFileInfo = None self.EventDetail = None self.RequestId = None def _deserialize(self, params): if params.get("EventBaseInfo") is not None: self.EventBaseInfo = RunTimeEventBaseInfo() self.EventBaseInfo._deserialize(params.get("EventBaseInfo")) if params.get("ProcessInfo") is not None: self.ProcessInfo = ProcessDetailInfo() self.ProcessInfo._deserialize(params.get("ProcessInfo")) if params.get("TamperedFileInfo") is not None: self.TamperedFileInfo = FileAttributeInfo() self.TamperedFileInfo._deserialize(params.get("TamperedFileInfo")) if params.get("EventDetail") is not None: self.EventDetail = AccessControlEventDescription() self.EventDetail._deserialize(params.get("EventDetail")) self.RequestId = params.get("RequestId") class DescribeAccessControlEventsExportRequest(AbstractModel): """DescribeAccessControlEventsExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.ExportField = None self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAccessControlEventsExportResponse(AbstractModel): """DescribeAccessControlEventsExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: execle下载地址 注意:此字段可能返回 null,表示取不到有效值。 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeAccessControlEventsRequest(AbstractModel): """DescribeAccessControlEvents请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAccessControlEventsResponse(AbstractModel): """DescribeAccessControlEvents返回参数结构体 """ def __init__(self): r""" :param TotalCount: 事件总数量 :type TotalCount: int :param EventSet: 访问控制事件数组 :type EventSet: list of AccessControlEventInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.EventSet = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("EventSet") is not None: self.EventSet = [] for item in params.get("EventSet"): obj = AccessControlEventInfo() obj._deserialize(item) self.EventSet.append(obj) self.RequestId = params.get("RequestId") class DescribeAccessControlRuleDetailRequest(AbstractModel): """DescribeAccessControlRuleDetail请求参数结构体 """ def __init__(self): r""" :param RuleId: 策略唯一id :type RuleId: str :param ImageId: 镜像id, 仅仅在事件加白的时候使用 :type ImageId: str """ self.RuleId = None self.ImageId = None def _deserialize(self, params): self.RuleId = params.get("RuleId") self.ImageId = params.get("ImageId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAccessControlRuleDetailResponse(AbstractModel): """DescribeAccessControlRuleDetail返回参数结构体 """ def __init__(self): r""" :param RuleDetail: 运行时策略详细信息 :type RuleDetail: :class:`tencentcloud.tcss.v20201101.models.AccessControlRuleInfo` :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RuleDetail = None self.RequestId = None def _deserialize(self, params): if params.get("RuleDetail") is not None: self.RuleDetail = AccessControlRuleInfo() self.RuleDetail._deserialize(params.get("RuleDetail")) self.RequestId = params.get("RequestId") class DescribeAccessControlRulesExportRequest(AbstractModel): """DescribeAccessControlRulesExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.ExportField = None self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAccessControlRulesExportResponse(AbstractModel): """DescribeAccessControlRulesExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: execle下载地址 注意:此字段可能返回 null,表示取不到有效值。 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeAccessControlRulesRequest(AbstractModel): """DescribeAccessControlRules请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAccessControlRulesResponse(AbstractModel): """DescribeAccessControlRules返回参数结构体 """ def __init__(self): r""" :param TotalCount: 事件总数量 :type TotalCount: int :param RuleSet: 访问控制策略信息列表 :type RuleSet: list of RuleBaseInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.RuleSet = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("RuleSet") is not None: self.RuleSet = [] for item in params.get("RuleSet"): obj = RuleBaseInfo() obj._deserialize(item) self.RuleSet.append(obj) self.RequestId = params.get("RequestId") class DescribeAffectedClusterCountRequest(AbstractModel): """DescribeAffectedClusterCount请求参数结构体 """ class DescribeAffectedClusterCountResponse(AbstractModel): """DescribeAffectedClusterCount返回参数结构体 """ def __init__(self): r""" :param SeriousRiskClusterCount: 严重风险的集群数量 :type SeriousRiskClusterCount: int :param HighRiskClusterCount: 高危风险的集群数量 :type HighRiskClusterCount: int :param MiddleRiskClusterCount: 中危风险的集群数量 :type MiddleRiskClusterCount: int :param HintRiskClusterCount: 低危风险的集群数量 :type HintRiskClusterCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.SeriousRiskClusterCount = None self.HighRiskClusterCount = None self.MiddleRiskClusterCount = None self.HintRiskClusterCount = None self.RequestId = None def _deserialize(self, params): self.SeriousRiskClusterCount = params.get("SeriousRiskClusterCount") self.HighRiskClusterCount = params.get("HighRiskClusterCount") self.MiddleRiskClusterCount = params.get("MiddleRiskClusterCount") self.HintRiskClusterCount = params.get("HintRiskClusterCount") self.RequestId = params.get("RequestId") class DescribeAffectedNodeListRequest(AbstractModel): """DescribeAffectedNodeList请求参数结构体 """ def __init__(self): r""" :param CheckItemId: 唯一的检测项的ID :type CheckItemId: int :param Offset: 偏移量 :type Offset: int :param Limit: 每次查询的最大记录数量 :type Limit: int :param Filters: Name - String Name 可取值:ClusterName, ClusterId,InstanceId,PrivateIpAddresses :type Filters: list of ComplianceFilters :param By: 排序字段 :type By: str :param Order: 排序方式 asc,desc :type Order: str """ self.CheckItemId = None self.Offset = None self.Limit = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.CheckItemId = params.get("CheckItemId") self.Offset = params.get("Offset") self.Limit = params.get("Limit") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = ComplianceFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAffectedNodeListResponse(AbstractModel): """DescribeAffectedNodeList返回参数结构体 """ def __init__(self): r""" :param TotalCount: 受影响的节点总数 :type TotalCount: int :param AffectedNodeList: 受影响的节点列表 :type AffectedNodeList: list of AffectedNodeItem :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.AffectedNodeList = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("AffectedNodeList") is not None: self.AffectedNodeList = [] for item in params.get("AffectedNodeList"): obj = AffectedNodeItem() obj._deserialize(item) self.AffectedNodeList.append(obj) self.RequestId = params.get("RequestId") class DescribeAffectedWorkloadListRequest(AbstractModel): """DescribeAffectedWorkloadList请求参数结构体 """ def __init__(self): r""" :param CheckItemId: 唯一的检测项的ID :type CheckItemId: int :param Offset: 偏移量 :type Offset: int :param Limit: 每次查询的最大记录数量 :type Limit: int :param Filters: Name - String Name 可取值:WorkloadType,ClusterId :type Filters: list of ComplianceFilters :param By: 排序字段 :type By: str :param Order: 排序方式 asc,desc :type Order: str """ self.CheckItemId = None self.Offset = None self.Limit = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.CheckItemId = params.get("CheckItemId") self.Offset = params.get("Offset") self.Limit = params.get("Limit") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = ComplianceFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAffectedWorkloadListResponse(AbstractModel): """DescribeAffectedWorkloadList返回参数结构体 """ def __init__(self): r""" :param TotalCount: 受影响的workload列表数量 :type TotalCount: int :param AffectedWorkloadList: 受影响的workload列表 :type AffectedWorkloadList: list of AffectedWorkloadItem :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.AffectedWorkloadList = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("AffectedWorkloadList") is not None: self.AffectedWorkloadList = [] for item in params.get("AffectedWorkloadList"): obj = AffectedWorkloadItem() obj._deserialize(item) self.AffectedWorkloadList.append(obj) self.RequestId = params.get("RequestId") class DescribeAssetAppServiceListRequest(AbstractModel): """DescribeAssetAppServiceList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Keywords- String - 是否必填:否 - 模糊查询可选字段</li> :type Filters: list of AssetFilters """ self.Limit = None self.Offset = None self.Filters = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetAppServiceListResponse(AbstractModel): """DescribeAssetAppServiceList返回参数结构体 """ def __init__(self): r""" :param List: db服务列表 :type List: list of ServiceInfo :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ServiceInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetComponentListRequest(AbstractModel): """DescribeAssetComponentList请求参数结构体 """ def __init__(self): r""" :param ContainerID: 容器id :type ContainerID: str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件 :type Filters: list of AssetFilters """ self.ContainerID = None self.Limit = None self.Offset = None self.Filters = None def _deserialize(self, params): self.ContainerID = params.get("ContainerID") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetComponentListResponse(AbstractModel): """DescribeAssetComponentList返回参数结构体 """ def __init__(self): r""" :param List: 组件列表 :type List: list of ComponentInfo :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ComponentInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetContainerDetailRequest(AbstractModel): """DescribeAssetContainerDetail请求参数结构体 """ def __init__(self): r""" :param ContainerId: 容器id :type ContainerId: str """ self.ContainerId = None def _deserialize(self, params): self.ContainerId = params.get("ContainerId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetContainerDetailResponse(AbstractModel): """DescribeAssetContainerDetail返回参数结构体 """ def __init__(self): r""" :param HostID: 主机id :type HostID: str :param HostIP: 主机ip :type HostIP: str :param ContainerName: 容器名称 :type ContainerName: str :param Status: 运行状态 :type Status: str :param RunAs: 运行账户 :type RunAs: str :param Cmd: 命令行 :type Cmd: str :param CPUUsage: CPU使用率 * 1000 :type CPUUsage: int :param RamUsage: 内存使用 KB :type RamUsage: int :param ImageName: 镜像名 :type ImageName: str :param ImageID: 镜像ID :type ImageID: str :param POD: 归属POD :type POD: str :param K8sMaster: k8s 主节点 :type K8sMaster: str :param ProcessCnt: 容器内进程数 :type ProcessCnt: int :param PortCnt: 容器内端口数 :type PortCnt: int :param ComponentCnt: 组件数 :type ComponentCnt: int :param AppCnt: app数 :type AppCnt: int :param WebServiceCnt: websvc数 :type WebServiceCnt: int :param Mounts: 挂载 :type Mounts: list of ContainerMount :param Network: 容器网络信息 :type Network: :class:`tencentcloud.tcss.v20201101.models.ContainerNetwork` :param CreateTime: 创建时间 :type CreateTime: str :param ImageCreateTime: 镜像创建时间 :type ImageCreateTime: str :param ImageSize: 镜像大小 :type ImageSize: int :param HostStatus: 主机状态 offline,online,pause :type HostStatus: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.HostID = None self.HostIP = None self.ContainerName = None self.Status = None self.RunAs = None self.Cmd = None self.CPUUsage = None self.RamUsage = None self.ImageName = None self.ImageID = None self.POD = None self.K8sMaster = None self.ProcessCnt = None self.PortCnt = None self.ComponentCnt = None self.AppCnt = None self.WebServiceCnt = None self.Mounts = None self.Network = None self.CreateTime = None self.ImageCreateTime = None self.ImageSize = None self.HostStatus = None self.RequestId = None def _deserialize(self, params): self.HostID = params.get("HostID") self.HostIP = params.get("HostIP") self.ContainerName = params.get("ContainerName") self.Status = params.get("Status") self.RunAs = params.get("RunAs") self.Cmd = params.get("Cmd") self.CPUUsage = params.get("CPUUsage") self.RamUsage = params.get("RamUsage") self.ImageName = params.get("ImageName") self.ImageID = params.get("ImageID") self.POD = params.get("POD") self.K8sMaster = params.get("K8sMaster") self.ProcessCnt = params.get("ProcessCnt") self.PortCnt = params.get("PortCnt") self.ComponentCnt = params.get("ComponentCnt") self.AppCnt = params.get("AppCnt") self.WebServiceCnt = params.get("WebServiceCnt") if params.get("Mounts") is not None: self.Mounts = [] for item in params.get("Mounts"): obj = ContainerMount() obj._deserialize(item) self.Mounts.append(obj) if params.get("Network") is not None: self.Network = ContainerNetwork() self.Network._deserialize(params.get("Network")) self.CreateTime = params.get("CreateTime") self.ImageCreateTime = params.get("ImageCreateTime") self.ImageSize = params.get("ImageSize") self.HostStatus = params.get("HostStatus") self.RequestId = params.get("RequestId") class DescribeAssetContainerListRequest(AbstractModel): """DescribeAssetContainerList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>ContainerName - String - 是否必填:否 - 容器名称模糊搜索</li> <li>Status - String - 是否必填:否 - 容器运行状态筛选,0:"created",1:"running", 2:"paused", 3:"restarting", 4:"removing", 5:"exited", 6:"dead" </li> <li>Runas - String - 是否必填:否 - 运行用户筛选</li> <li>ImageName- String - 是否必填:否 - 镜像名称搜索</li> <li>HostIP- string - 是否必填:否 - 主机ip搜索</li> <li>OrderBy - String 是否必填:否 -排序字段,支持:cpu_usage, mem_usage的动态排序 ["cpu_usage","+"] '+'升序、'-'降序</li> :type Filters: list of AssetFilters :param By: 排序字段 :type By: str :param Order: 排序方式 asc,desc :type Order: str """ self.Limit = None self.Offset = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetContainerListResponse(AbstractModel): """DescribeAssetContainerList返回参数结构体 """ def __init__(self): r""" :param List: 容器列表 :type List: list of ContainerInfo :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ContainerInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetDBServiceListRequest(AbstractModel): """DescribeAssetDBServiceList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Keywords- String - 是否必填:否 - 模糊查询可选字段</li> :type Filters: list of AssetFilters """ self.Limit = None self.Offset = None self.Filters = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetDBServiceListResponse(AbstractModel): """DescribeAssetDBServiceList返回参数结构体 """ def __init__(self): r""" :param List: db服务列表 :type List: list of ServiceInfo :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ServiceInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetHostDetailRequest(AbstractModel): """DescribeAssetHostDetail请求参数结构体 """ def __init__(self): r""" :param HostId: 主机id :type HostId: str """ self.HostId = None def _deserialize(self, params): self.HostId = params.get("HostId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetHostDetailResponse(AbstractModel): """DescribeAssetHostDetail返回参数结构体 """ def __init__(self): r""" :param UUID: 云镜uuid :type UUID: str :param UpdateTime: 更新时间 :type UpdateTime: str :param HostName: 主机名 :type HostName: str :param Group: 主机分组 :type Group: str :param HostIP: 主机IP :type HostIP: str :param OsName: 操作系统 :type OsName: str :param AgentVersion: agent版本 :type AgentVersion: str :param KernelVersion: 内核版本 :type KernelVersion: str :param DockerVersion: docker版本 :type DockerVersion: str :param DockerAPIVersion: docker api版本 :type DockerAPIVersion: str :param DockerGoVersion: docker go 版本 :type DockerGoVersion: str :param DockerFileSystemDriver: docker 文件系统类型 :type DockerFileSystemDriver: str :param DockerRootDir: docker root 目录 :type DockerRootDir: str :param ImageCnt: 镜像数 :type ImageCnt: int :param ContainerCnt: 容器数 :type ContainerCnt: int :param K8sMasterIP: k8s IP :type K8sMasterIP: str :param K8sVersion: k8s version :type K8sVersion: str :param KubeProxyVersion: kube proxy :type KubeProxyVersion: str :param Status: "UNINSTALL":"未安装","OFFLINE":"离线", "ONLINE":"防护中 :type Status: str :param IsContainerd: 是否Containerd :type IsContainerd: bool :param MachineType: 主机来源;"TENCENTCLOUD":"腾讯云服务器","OTHERCLOUD":"非腾讯云服务器" :type MachineType: str :param PublicIp: 外网ip :type PublicIp: str :param InstanceID: 主机实例ID :type InstanceID: str :param RegionID: 地域ID :type RegionID: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.UUID = None self.UpdateTime = None self.HostName = None self.Group = None self.HostIP = None self.OsName = None self.AgentVersion = None self.KernelVersion = None self.DockerVersion = None self.DockerAPIVersion = None self.DockerGoVersion = None self.DockerFileSystemDriver = None self.DockerRootDir = None self.ImageCnt = None self.ContainerCnt = None self.K8sMasterIP = None self.K8sVersion = None self.KubeProxyVersion = None self.Status = None self.IsContainerd = None self.MachineType = None self.PublicIp = None self.InstanceID = None self.RegionID = None self.RequestId = None def _deserialize(self, params): self.UUID = params.get("UUID") self.UpdateTime = params.get("UpdateTime") self.HostName = params.get("HostName") self.Group = params.get("Group") self.HostIP = params.get("HostIP") self.OsName = params.get("OsName") self.AgentVersion = params.get("AgentVersion") self.KernelVersion = params.get("KernelVersion") self.DockerVersion = params.get("DockerVersion") self.DockerAPIVersion = params.get("DockerAPIVersion") self.DockerGoVersion = params.get("DockerGoVersion") self.DockerFileSystemDriver = params.get("DockerFileSystemDriver") self.DockerRootDir = params.get("DockerRootDir") self.ImageCnt = params.get("ImageCnt") self.ContainerCnt = params.get("ContainerCnt") self.K8sMasterIP = params.get("K8sMasterIP") self.K8sVersion = params.get("K8sVersion") self.KubeProxyVersion = params.get("KubeProxyVersion") self.Status = params.get("Status") self.IsContainerd = params.get("IsContainerd") self.MachineType = params.get("MachineType") self.PublicIp = params.get("PublicIp") self.InstanceID = params.get("InstanceID") self.RegionID = params.get("RegionID") self.RequestId = params.get("RequestId") class DescribeAssetHostListRequest(AbstractModel): """DescribeAssetHostList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Status - String - 是否必填:否 - agent状态筛选,"ALL":"全部"(或不传该字段),"UNINSTALL":"未安装","OFFLINE":"离线", "ONLINE":"防护中"</li> <li>HostName - String - 是否必填:否 - 主机名筛选</li> <li>Group- String - 是否必填:否 - 主机群组搜索</li> <li>HostIP- string - 是否必填:否 - 主机ip搜索</li> <li>HostID- string - 是否必填:否 - 主机id搜索</li> <li>DockerVersion- string - 是否必填:否 - docker版本搜索</li> <li>MachineType- string - 是否必填:否 - 主机来源MachineType搜索,"ALL":"全部"(或不传该字段),主机来源:["CVM", "ECM", "LH", "BM"] 中的之一为腾讯云服务器;["Other"]之一非腾讯云服务器;</li> <li>DockerStatus- string - 是否必填:否 - docker安装状态,"ALL":"全部"(或不传该字段),"INSTALL":"已安装","UNINSTALL":"未安装"</li> :type Filters: list of AssetFilters :param By: 排序字段 :type By: str :param Order: 排序方式 asc,desc :type Order: str """ self.Limit = None self.Offset = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetHostListResponse(AbstractModel): """DescribeAssetHostList返回参数结构体 """ def __init__(self): r""" :param List: 主机列表 :type List: list of HostInfo :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = HostInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetImageBindRuleInfoRequest(AbstractModel): """DescribeAssetImageBindRuleInfo请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"EventType","Values":[""]}] EventType取值: "FILE_ABNORMAL_READ" 访问控制 "MALICE_PROCESS_START" 恶意进程启动 :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageBindRuleInfoResponse(AbstractModel): """DescribeAssetImageBindRuleInfo返回参数结构体 """ def __init__(self): r""" :param TotalCount: 事件总数量 :type TotalCount: int :param ImageBindRuleSet: 镜像绑定规则列表 :type ImageBindRuleSet: list of ImagesBindRuleInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.ImageBindRuleSet = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("ImageBindRuleSet") is not None: self.ImageBindRuleSet = [] for item in params.get("ImageBindRuleSet"): obj = ImagesBindRuleInfo() obj._deserialize(item) self.ImageBindRuleSet.append(obj) self.RequestId = params.get("RequestId") class DescribeAssetImageDetailRequest(AbstractModel): """DescribeAssetImageDetail请求参数结构体 """ def __init__(self): r""" :param ImageID: 镜像id :type ImageID: str """ self.ImageID = None def _deserialize(self, params): self.ImageID = params.get("ImageID") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageDetailResponse(AbstractModel): """DescribeAssetImageDetail返回参数结构体 """ def __init__(self): r""" :param ImageID: 镜像ID :type ImageID: str :param ImageName: 镜像名称 :type ImageName: str :param CreateTime: 创建时间 :type CreateTime: str :param Size: 镜像大小 :type Size: int :param HostCnt: 关联主机个数 注意:此字段可能返回 null,表示取不到有效值。 :type HostCnt: int :param ContainerCnt: 关联容器个数 注意:此字段可能返回 null,表示取不到有效值。 :type ContainerCnt: int :param ScanTime: 最近扫描时间 注意:此字段可能返回 null,表示取不到有效值。 :type ScanTime: str :param VulCnt: 漏洞个数 注意:此字段可能返回 null,表示取不到有效值。 :type VulCnt: int :param RiskCnt: 风险行为数 注意:此字段可能返回 null,表示取不到有效值。 :type RiskCnt: int :param SensitiveInfoCnt: 敏感信息数 注意:此字段可能返回 null,表示取不到有效值。 :type SensitiveInfoCnt: int :param IsTrustImage: 是否信任镜像 :type IsTrustImage: bool :param OsName: 镜像系统 :type OsName: str :param AgentError: agent镜像扫描错误 注意:此字段可能返回 null,表示取不到有效值。 :type AgentError: str :param ScanError: 后端镜像扫描错误 注意:此字段可能返回 null,表示取不到有效值。 :type ScanError: str :param Architecture: 系统架构 注意:此字段可能返回 null,表示取不到有效值。 :type Architecture: str :param Author: 作者 注意:此字段可能返回 null,表示取不到有效值。 :type Author: str :param BuildHistory: 构建历史 注意:此字段可能返回 null,表示取不到有效值。 :type BuildHistory: str :param ScanVirusProgress: 木马扫描进度 注意:此字段可能返回 null,表示取不到有效值。 :type ScanVirusProgress: int :param ScanVulProgress: 漏洞扫进度 注意:此字段可能返回 null,表示取不到有效值。 :type ScanVulProgress: int :param ScanRiskProgress: 敏感信息扫描进度 注意:此字段可能返回 null,表示取不到有效值。 :type ScanRiskProgress: int :param ScanVirusError: 木马扫描错误 注意:此字段可能返回 null,表示取不到有效值。 :type ScanVirusError: str :param ScanVulError: 漏洞扫描错误 注意:此字段可能返回 null,表示取不到有效值。 :type ScanVulError: str :param ScanRiskError: 敏感信息错误 注意:此字段可能返回 null,表示取不到有效值。 :type ScanRiskError: str :param ScanStatus: 镜像扫描状态 注意:此字段可能返回 null,表示取不到有效值。 :type ScanStatus: str :param VirusCnt: 木马病毒数 注意:此字段可能返回 null,表示取不到有效值。 :type VirusCnt: int :param Status: 镜像扫描状态 注意:此字段可能返回 null,表示取不到有效值。 :type Status: int :param RemainScanTime: 剩余扫描时间 注意:此字段可能返回 null,表示取不到有效值。 :type RemainScanTime: int :param IsAuthorized: 授权为:1,未授权为:0 :type IsAuthorized: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ImageID = None self.ImageName = None self.CreateTime = None self.Size = None self.HostCnt = None self.ContainerCnt = None self.ScanTime = None self.VulCnt = None self.RiskCnt = None self.SensitiveInfoCnt = None self.IsTrustImage = None self.OsName = None self.AgentError = None self.ScanError = None self.Architecture = None self.Author = None self.BuildHistory = None self.ScanVirusProgress = None self.ScanVulProgress = None self.ScanRiskProgress = None self.ScanVirusError = None self.ScanVulError = None self.ScanRiskError = None self.ScanStatus = None self.VirusCnt = None self.Status = None self.RemainScanTime = None self.IsAuthorized = None self.RequestId = None def _deserialize(self, params): self.ImageID = params.get("ImageID") self.ImageName = params.get("ImageName") self.CreateTime = params.get("CreateTime") self.Size = params.get("Size") self.HostCnt = params.get("HostCnt") self.ContainerCnt = params.get("ContainerCnt") self.ScanTime = params.get("ScanTime") self.VulCnt = params.get("VulCnt") self.RiskCnt = params.get("RiskCnt") self.SensitiveInfoCnt = params.get("SensitiveInfoCnt") self.IsTrustImage = params.get("IsTrustImage") self.OsName = params.get("OsName") self.AgentError = params.get("AgentError") self.ScanError = params.get("ScanError") self.Architecture = params.get("Architecture") self.Author = params.get("Author") self.BuildHistory = params.get("BuildHistory") self.ScanVirusProgress = params.get("ScanVirusProgress") self.ScanVulProgress = params.get("ScanVulProgress") self.ScanRiskProgress = params.get("ScanRiskProgress") self.ScanVirusError = params.get("ScanVirusError") self.ScanVulError = params.get("ScanVulError") self.ScanRiskError = params.get("ScanRiskError") self.ScanStatus = params.get("ScanStatus") self.VirusCnt = params.get("VirusCnt") self.Status = params.get("Status") self.RemainScanTime = params.get("RemainScanTime") self.IsAuthorized = params.get("IsAuthorized") self.RequestId = params.get("RequestId") class DescribeAssetImageHostListRequest(AbstractModel): """DescribeAssetImageHostList请求参数结构体 """ def __init__(self): r""" :param Filters: 过滤条件 支持ImageID,HostID :type Filters: list of AssetFilters """ self.Filters = None def _deserialize(self, params): if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageHostListResponse(AbstractModel): """DescribeAssetImageHostList返回参数结构体 """ def __init__(self): r""" :param List: 镜像列表 :type List: list of ImageHost :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ImageHost() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetImageListExportRequest(AbstractModel): """DescribeAssetImageListExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>ImageName- String - 是否必填:否 - 镜像名称筛选,</li> <li>ScanStatus - String - 是否必填:否 - 镜像扫描状态notScan,scanning,scanned,scanErr</li> <li>ImageID- String - 是否必填:否 - 镜像ID筛选,</li> <li>SecurityRisk- String - 是否必填:否 - 安全风险,VulCnt 、VirusCnt、RiskCnt、IsTrustImage</li> :type Filters: list of AssetFilters :param By: 排序字段 :type By: str :param Order: 排序方式 asc,desc :type Order: str """ self.ExportField = None self.Limit = None self.Offset = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageListExportResponse(AbstractModel): """DescribeAssetImageListExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: excel文件下载地址 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeAssetImageListRequest(AbstractModel): """DescribeAssetImageList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>ImageName- String - 是否必填:否 - 镜像名称筛选,</li> <li>ScanStatus - String - 是否必填:否 - 镜像扫描状态notScan,scanning,scanned,scanErr</li> <li>ImageID- String - 是否必填:否 - 镜像ID筛选,</li> <li>SecurityRisk- String - 是否必填:否 - 安全风险,VulCnt 、VirusCnt、RiskCnt、IsTrustImage</li> :type Filters: list of AssetFilters :param By: 排序字段 :type By: str :param Order: 排序方式 asc,desc :type Order: str """ self.Limit = None self.Offset = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageListResponse(AbstractModel): """DescribeAssetImageList返回参数结构体 """ def __init__(self): r""" :param List: 镜像列表 :type List: list of ImagesInfo :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ImagesInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryAssetStatusRequest(AbstractModel): """DescribeAssetImageRegistryAssetStatus请求参数结构体 """ class DescribeAssetImageRegistryAssetStatusResponse(AbstractModel): """DescribeAssetImageRegistryAssetStatus返回参数结构体 """ def __init__(self): r""" :param Status: 更新进度状态,doing更新中,success更新成功,failed失败 :type Status: str :param Err: 错误信息 注意:此字段可能返回 null,表示取不到有效值。 :type Err: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.Status = None self.Err = None self.RequestId = None def _deserialize(self, params): self.Status = params.get("Status") self.Err = params.get("Err") self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryDetailRequest(AbstractModel): """DescribeAssetImageRegistryDetail请求参数结构体 """ def __init__(self): r""" :param Id: 仓库列表id :type Id: int :param ImageId: 镜像ID :type ImageId: str """ self.Id = None self.ImageId = None def _deserialize(self, params): self.Id = params.get("Id") self.ImageId = params.get("ImageId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRegistryDetailResponse(AbstractModel): """DescribeAssetImageRegistryDetail返回参数结构体 """ def __init__(self): r""" :param ImageDigest: 镜像Digest 注意:此字段可能返回 null,表示取不到有效值。 :type ImageDigest: str :param ImageRepoAddress: 镜像地址 注意:此字段可能返回 null,表示取不到有效值。 :type ImageRepoAddress: str :param RegistryType: 镜像类型 注意:此字段可能返回 null,表示取不到有效值。 :type RegistryType: str :param ImageName: 仓库名称 注意:此字段可能返回 null,表示取不到有效值。 :type ImageName: str :param ImageTag: 镜像版本 注意:此字段可能返回 null,表示取不到有效值。 :type ImageTag: str :param ScanTime: 扫描时间 注意:此字段可能返回 null,表示取不到有效值。 :type ScanTime: str :param ScanStatus: 扫描状态 注意:此字段可能返回 null,表示取不到有效值。 :type ScanStatus: str :param VulCnt: 安全漏洞数 注意:此字段可能返回 null,表示取不到有效值。 :type VulCnt: int :param VirusCnt: 木马病毒数 注意:此字段可能返回 null,表示取不到有效值。 :type VirusCnt: int :param RiskCnt: 风险行为数 注意:此字段可能返回 null,表示取不到有效值。 :type RiskCnt: int :param SentiveInfoCnt: 敏感信息数 注意:此字段可能返回 null,表示取不到有效值。 :type SentiveInfoCnt: int :param OsName: 镜像系统 注意:此字段可能返回 null,表示取不到有效值。 :type OsName: str :param ScanVirusError: 木马扫描错误 注意:此字段可能返回 null,表示取不到有效值。 :type ScanVirusError: str :param ScanVulError: 漏洞扫描错误 注意:此字段可能返回 null,表示取不到有效值。 :type ScanVulError: str :param LayerInfo: 层文件信息 注意:此字段可能返回 null,表示取不到有效值。 :type LayerInfo: str :param InstanceId: 实例id 注意:此字段可能返回 null,表示取不到有效值。 :type InstanceId: str :param InstanceName: 实例名称 注意:此字段可能返回 null,表示取不到有效值。 :type InstanceName: str :param Namespace: 命名空间 注意:此字段可能返回 null,表示取不到有效值。 :type Namespace: str :param ScanRiskError: 高危扫描错误 注意:此字段可能返回 null,表示取不到有效值。 :type ScanRiskError: str :param ScanVirusProgress: 木马信息扫描进度 注意:此字段可能返回 null,表示取不到有效值。 :type ScanVirusProgress: int :param ScanVulProgress: 漏洞扫描进度 注意:此字段可能返回 null,表示取不到有效值。 :type ScanVulProgress: int :param ScanRiskProgress: 敏感扫描进度 注意:此字段可能返回 null,表示取不到有效值。 :type ScanRiskProgress: int :param ScanRemainTime: 剩余扫描时间秒 注意:此字段可能返回 null,表示取不到有效值。 :type ScanRemainTime: int :param CveStatus: cve扫描状态 注意:此字段可能返回 null,表示取不到有效值。 :type CveStatus: str :param RiskStatus: 高危扫描状态 注意:此字段可能返回 null,表示取不到有效值。 :type RiskStatus: str :param VirusStatus: 木马扫描状态 注意:此字段可能返回 null,表示取不到有效值。 :type VirusStatus: str :param Progress: 总进度 注意:此字段可能返回 null,表示取不到有效值。 :type Progress: int :param IsAuthorized: 授权状态 注意:此字段可能返回 null,表示取不到有效值。 :type IsAuthorized: int :param ImageSize: 镜像大小 注意:此字段可能返回 null,表示取不到有效值。 :type ImageSize: int :param ImageId: 镜像Id 注意:此字段可能返回 null,表示取不到有效值。 :type ImageId: str :param RegistryRegion: 镜像区域 注意:此字段可能返回 null,表示取不到有效值。 :type RegistryRegion: str :param ImageCreateTime: 镜像创建的时间 注意:此字段可能返回 null,表示取不到有效值。 :type ImageCreateTime: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ImageDigest = None self.ImageRepoAddress = None self.RegistryType = None self.ImageName = None self.ImageTag = None self.ScanTime = None self.ScanStatus = None self.VulCnt = None self.VirusCnt = None self.RiskCnt = None self.SentiveInfoCnt = None self.OsName = None self.ScanVirusError = None self.ScanVulError = None self.LayerInfo = None self.InstanceId = None self.InstanceName = None self.Namespace = None self.ScanRiskError = None self.ScanVirusProgress = None self.ScanVulProgress = None self.ScanRiskProgress = None self.ScanRemainTime = None self.CveStatus = None self.RiskStatus = None self.VirusStatus = None self.Progress = None self.IsAuthorized = None self.ImageSize = None self.ImageId = None self.RegistryRegion = None self.ImageCreateTime = None self.RequestId = None def _deserialize(self, params): self.ImageDigest = params.get("ImageDigest") self.ImageRepoAddress = params.get("ImageRepoAddress") self.RegistryType = params.get("RegistryType") self.ImageName = params.get("ImageName") self.ImageTag = params.get("ImageTag") self.ScanTime = params.get("ScanTime") self.ScanStatus = params.get("ScanStatus") self.VulCnt = params.get("VulCnt") self.VirusCnt = params.get("VirusCnt") self.RiskCnt = params.get("RiskCnt") self.SentiveInfoCnt = params.get("SentiveInfoCnt") self.OsName = params.get("OsName") self.ScanVirusError = params.get("ScanVirusError") self.ScanVulError = params.get("ScanVulError") self.LayerInfo = params.get("LayerInfo") self.InstanceId = params.get("InstanceId") self.InstanceName = params.get("InstanceName") self.Namespace = params.get("Namespace") self.ScanRiskError = params.get("ScanRiskError") self.ScanVirusProgress = params.get("ScanVirusProgress") self.ScanVulProgress = params.get("ScanVulProgress") self.ScanRiskProgress = params.get("ScanRiskProgress") self.ScanRemainTime = params.get("ScanRemainTime") self.CveStatus = params.get("CveStatus") self.RiskStatus = params.get("RiskStatus") self.VirusStatus = params.get("VirusStatus") self.Progress = params.get("Progress") self.IsAuthorized = params.get("IsAuthorized") self.ImageSize = params.get("ImageSize") self.ImageId = params.get("ImageId") self.RegistryRegion = params.get("RegistryRegion") self.ImageCreateTime = params.get("ImageCreateTime") self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryListExportRequest(AbstractModel): """DescribeAssetImageRegistryListExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0 :type Offset: int :param Filters: 排序字段 :type Filters: list of AssetFilters :param By: 排序字段 :type By: str :param Order: 排序方式,asc,desc :type Order: str :param OnlyShowLatest: 是否仅展示repository版本最新的镜像,默认为false :type OnlyShowLatest: bool """ self.ExportField = None self.Limit = None self.Offset = None self.Filters = None self.By = None self.Order = None self.OnlyShowLatest = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") self.OnlyShowLatest = params.get("OnlyShowLatest") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRegistryListExportResponse(AbstractModel): """DescribeAssetImageRegistryListExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: excel文件下载地址 注意:此字段可能返回 null,表示取不到有效值。 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryListRequest(AbstractModel): """DescribeAssetImageRegistryList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0 :type Offset: int :param Filters: 过滤字段 IsAuthorized是否授权,取值全部all,未授权0,已授权1 :type Filters: list of AssetFilters :param By: 排序字段 :type By: str :param Order: 排序方式,asc,desc :type Order: str :param OnlyShowLatest: 是否仅展示各repository最新的镜像, 默认为false :type OnlyShowLatest: bool """ self.Limit = None self.Offset = None self.Filters = None self.By = None self.Order = None self.OnlyShowLatest = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") self.OnlyShowLatest = params.get("OnlyShowLatest") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRegistryListResponse(AbstractModel): """DescribeAssetImageRegistryList返回参数结构体 """ def __init__(self): r""" :param List: 镜像仓库列表 注意:此字段可能返回 null,表示取不到有效值。 :type List: list of ImageRepoInfo :param TotalCount: 总数量 注意:此字段可能返回 null,表示取不到有效值。 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ImageRepoInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryRegistryDetailRequest(AbstractModel): """DescribeAssetImageRegistryRegistryDetail请求参数结构体 """ def __init__(self): r""" :param RegistryId: 仓库唯一id :type RegistryId: int """ self.RegistryId = None def _deserialize(self, params): self.RegistryId = params.get("RegistryId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRegistryRegistryDetailResponse(AbstractModel): """DescribeAssetImageRegistryRegistryDetail返回参数结构体 """ def __init__(self): r""" :param Name: 仓库名 :type Name: str :param Username: 用户名 :type Username: str :param Password: 密码 :type Password: str :param Url: 仓库url :type Url: str :param RegistryType: 仓库类型,列表:harbor :type RegistryType: str :param RegistryVersion: 仓库版本 注意:此字段可能返回 null,表示取不到有效值。 :type RegistryVersion: str :param NetType: 网络类型,列表:public(公网) :type NetType: str :param RegistryRegion: 区域,列表:default(默认) 注意:此字段可能返回 null,表示取不到有效值。 :type RegistryRegion: str :param SpeedLimit: 限速 注意:此字段可能返回 null,表示取不到有效值。 :type SpeedLimit: int :param Insecure: 安全模式(证书校验):0(默认) 非安全模式(跳过证书校验):1 注意:此字段可能返回 null,表示取不到有效值。 :type Insecure: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.Name = None self.Username = None self.Password = None self.Url = None self.RegistryType = None self.RegistryVersion = None self.NetType = None self.RegistryRegion = None self.SpeedLimit = None self.Insecure = None self.RequestId = None def _deserialize(self, params): self.Name = params.get("Name") self.Username = params.get("Username") self.Password = params.get("Password") self.Url = params.get("Url") self.RegistryType = params.get("RegistryType") self.RegistryVersion = params.get("RegistryVersion") self.NetType = params.get("NetType") self.RegistryRegion = params.get("RegistryRegion") self.SpeedLimit = params.get("SpeedLimit") self.Insecure = params.get("Insecure") self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryRegistryListRequest(AbstractModel): """DescribeAssetImageRegistryRegistryList请求参数结构体 """ class DescribeAssetImageRegistryRegistryListResponse(AbstractModel): """DescribeAssetImageRegistryRegistryList返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryRiskInfoListRequest(AbstractModel): """DescribeAssetImageRegistryRiskInfoList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Level- String - 是否必填:否 - 漏洞级别筛选,</li> <li>Name - String - 是否必填:否 - 漏洞名称</li> :type Filters: list of AssetFilters :param ImageInfo: 镜像id :type ImageInfo: :class:`tencentcloud.tcss.v20201101.models.ImageInfo` :param By: 排序字段(Level) :type By: str :param Order: 排序方式 + - :type Order: str :param Id: 镜像标识Id :type Id: int """ self.Limit = None self.Offset = None self.Filters = None self.ImageInfo = None self.By = None self.Order = None self.Id = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) if params.get("ImageInfo") is not None: self.ImageInfo = ImageInfo() self.ImageInfo._deserialize(params.get("ImageInfo")) self.By = params.get("By") self.Order = params.get("Order") self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRegistryRiskInfoListResponse(AbstractModel): """DescribeAssetImageRegistryRiskInfoList返回参数结构体 """ def __init__(self): r""" :param List: 镜像漏洞列表 注意:此字段可能返回 null,表示取不到有效值。 :type List: list of ImageRisk :param TotalCount: 总数量 注意:此字段可能返回 null,表示取不到有效值。 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ImageRisk() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryRiskListExportRequest(AbstractModel): """DescribeAssetImageRegistryRiskListExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Level- String - 是否必填:否 - 漏洞级别筛选,</li> <li>Name - String - 是否必填:否 - 漏洞名称</li> :type Filters: list of AssetFilters :param ImageInfo: 镜像信息 :type ImageInfo: :class:`tencentcloud.tcss.v20201101.models.ImageInfo` :param Id: 镜像标识Id :type Id: int """ self.ExportField = None self.Limit = None self.Offset = None self.Filters = None self.ImageInfo = None self.Id = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) if params.get("ImageInfo") is not None: self.ImageInfo = ImageInfo() self.ImageInfo._deserialize(params.get("ImageInfo")) self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRegistryRiskListExportResponse(AbstractModel): """DescribeAssetImageRegistryRiskListExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: excel文件下载地址 注意:此字段可能返回 null,表示取不到有效值。 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryScanStatusOneKeyRequest(AbstractModel): """DescribeAssetImageRegistryScanStatusOneKey请求参数结构体 """ def __init__(self): r""" :param Images: 需要获取进度的镜像列表 :type Images: list of ImageInfo :param All: 是否获取全部镜像 :type All: bool :param Id: 需要获取进度的镜像列表Id :type Id: list of int non-negative """ self.Images = None self.All = None self.Id = None def _deserialize(self, params): if params.get("Images") is not None: self.Images = [] for item in params.get("Images"): obj = ImageInfo() obj._deserialize(item) self.Images.append(obj) self.All = params.get("All") self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRegistryScanStatusOneKeyResponse(AbstractModel): """DescribeAssetImageRegistryScanStatusOneKey返回参数结构体 """ def __init__(self): r""" :param ImageTotal: 镜像个数 :type ImageTotal: int :param ImageScanCnt: 扫描镜像个数 :type ImageScanCnt: int :param ImageStatus: 扫描进度列表 注意:此字段可能返回 null,表示取不到有效值。 :type ImageStatus: list of ImageProgress :param SuccessCount: 安全个数 :type SuccessCount: int :param RiskCount: 风险个数 :type RiskCount: int :param Schedule: 总的扫描进度 :type Schedule: int :param Status: 总的扫描状态 :type Status: str :param ScanRemainTime: 扫描剩余时间 注意:此字段可能返回 null,表示取不到有效值。 :type ScanRemainTime: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ImageTotal = None self.ImageScanCnt = None self.ImageStatus = None self.SuccessCount = None self.RiskCount = None self.Schedule = None self.Status = None self.ScanRemainTime = None self.RequestId = None def _deserialize(self, params): self.ImageTotal = params.get("ImageTotal") self.ImageScanCnt = params.get("ImageScanCnt") if params.get("ImageStatus") is not None: self.ImageStatus = [] for item in params.get("ImageStatus"): obj = ImageProgress() obj._deserialize(item) self.ImageStatus.append(obj) self.SuccessCount = params.get("SuccessCount") self.RiskCount = params.get("RiskCount") self.Schedule = params.get("Schedule") self.Status = params.get("Status") self.ScanRemainTime = params.get("ScanRemainTime") self.RequestId = params.get("RequestId") class DescribeAssetImageRegistrySummaryRequest(AbstractModel): """DescribeAssetImageRegistrySummary请求参数结构体 """ class DescribeAssetImageRegistrySummaryResponse(AbstractModel): """DescribeAssetImageRegistrySummary返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryVirusListExportRequest(AbstractModel): """DescribeAssetImageRegistryVirusListExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Level- String - 是否必填:否 - 漏洞级别筛选,</li> <li>Name - String - 是否必填:否 - 漏洞名称</li> :type Filters: list of AssetFilters :param ImageInfo: 镜像信息 :type ImageInfo: :class:`tencentcloud.tcss.v20201101.models.ImageInfo` :param Id: 镜像标识Id :type Id: int """ self.ExportField = None self.Limit = None self.Offset = None self.Filters = None self.ImageInfo = None self.Id = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) if params.get("ImageInfo") is not None: self.ImageInfo = ImageInfo() self.ImageInfo._deserialize(params.get("ImageInfo")) self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRegistryVirusListExportResponse(AbstractModel): """DescribeAssetImageRegistryVirusListExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: excel文件下载地址 注意:此字段可能返回 null,表示取不到有效值。 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryVirusListRequest(AbstractModel): """DescribeAssetImageRegistryVirusList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Level- String - 是否必填:否 - 漏洞级别筛选,</li> <li>Name - String - 是否必填:否 - 漏洞名称</li> :type Filters: list of AssetFilters :param ImageInfo: 镜像信息 :type ImageInfo: :class:`tencentcloud.tcss.v20201101.models.ImageInfo` :param Id: 镜像标识Id :type Id: int """ self.Limit = None self.Offset = None self.Filters = None self.ImageInfo = None self.Id = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) if params.get("ImageInfo") is not None: self.ImageInfo = ImageInfo() self.ImageInfo._deserialize(params.get("ImageInfo")) self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRegistryVirusListResponse(AbstractModel): """DescribeAssetImageRegistryVirusList返回参数结构体 """ def __init__(self): r""" :param List: 镜像漏洞列表 注意:此字段可能返回 null,表示取不到有效值。 :type List: list of ImageVirus :param TotalCount: 总数量 注意:此字段可能返回 null,表示取不到有效值。 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ImageVirus() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryVulListExportRequest(AbstractModel): """DescribeAssetImageRegistryVulListExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Level- String - 是否必填:否 - 漏洞级别筛选,</li> <li>Name - String - 是否必填:否 - 漏洞名称</li> :type Filters: list of AssetFilters :param ImageInfo: 镜像信息 :type ImageInfo: :class:`tencentcloud.tcss.v20201101.models.ImageInfo` :param Id: 镜像标识Id :type Id: int """ self.ExportField = None self.Limit = None self.Offset = None self.Filters = None self.ImageInfo = None self.Id = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) if params.get("ImageInfo") is not None: self.ImageInfo = ImageInfo() self.ImageInfo._deserialize(params.get("ImageInfo")) self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRegistryVulListExportResponse(AbstractModel): """DescribeAssetImageRegistryVulListExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: excel文件下载地址 注意:此字段可能返回 null,表示取不到有效值。 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeAssetImageRegistryVulListRequest(AbstractModel): """DescribeAssetImageRegistryVulList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Level- String - 是否必填:否 - 漏洞级别筛选,</li> <li>Name - String - 是否必填:否 - 漏洞名称</li> :type Filters: list of AssetFilters :param ImageInfo: 镜像信息 :type ImageInfo: :class:`tencentcloud.tcss.v20201101.models.ImageInfo` :param Id: 镜像标识Id :type Id: int """ self.Limit = None self.Offset = None self.Filters = None self.ImageInfo = None self.Id = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) if params.get("ImageInfo") is not None: self.ImageInfo = ImageInfo() self.ImageInfo._deserialize(params.get("ImageInfo")) self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRegistryVulListResponse(AbstractModel): """DescribeAssetImageRegistryVulList返回参数结构体 """ def __init__(self): r""" :param List: 镜像漏洞列表 注意:此字段可能返回 null,表示取不到有效值。 :type List: list of ImageVul :param TotalCount: 总数量 注意:此字段可能返回 null,表示取不到有效值。 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ImageVul() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetImageRiskListExportRequest(AbstractModel): """DescribeAssetImageRiskListExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param ImageID: 镜像id :type ImageID: str :param Filters: 过滤条件。 <li>Level- String - 是否必填:否 - 风险级别 1,2,3,4,</li> <li>Behavior - String - 是否必填:否 - 风险行为 1,2,3,4</li> <li>Type - String - 是否必填:否 - 风险类型 1,2,</li> :type Filters: list of AssetFilters """ self.ExportField = None self.ImageID = None self.Filters = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.ImageID = params.get("ImageID") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRiskListExportResponse(AbstractModel): """DescribeAssetImageRiskListExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: excel文件下载地址 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeAssetImageRiskListRequest(AbstractModel): """DescribeAssetImageRiskList请求参数结构体 """ def __init__(self): r""" :param ImageID: 镜像id :type ImageID: str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Level- String - 是否必填:否 - 风险级别 1,2,3,4,</li> <li>Behavior - String - 是否必填:否 - 风险行为 1,2,3,4</li> <li>Type - String - 是否必填:否 - 风险类型 1,2,</li> :type Filters: list of AssetFilters :param By: 排序字段 :type By: str :param Order: 排序方式 :type Order: str """ self.ImageID = None self.Limit = None self.Offset = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.ImageID = params.get("ImageID") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageRiskListResponse(AbstractModel): """DescribeAssetImageRiskList返回参数结构体 """ def __init__(self): r""" :param List: 镜像病毒列表 :type List: list of ImageRiskInfo :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ImageRiskInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetImageScanSettingRequest(AbstractModel): """DescribeAssetImageScanSetting请求参数结构体 """ class DescribeAssetImageScanSettingResponse(AbstractModel): """DescribeAssetImageScanSetting返回参数结构体 """ def __init__(self): r""" :param Enable: 开关 :type Enable: bool :param ScanTime: 扫描时刻(完整时间;后端按0时区解析时分秒) :type ScanTime: str :param ScanPeriod: 扫描间隔 :type ScanPeriod: int :param ScanVirus: 扫描木马 :type ScanVirus: bool :param ScanRisk: 扫描敏感信息 :type ScanRisk: bool :param ScanVul: 扫描漏洞 :type ScanVul: bool :param All: 扫描全部镜像 :type All: bool :param Images: 自定义扫描镜像 :type Images: list of str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.Enable = None self.ScanTime = None self.ScanPeriod = None self.ScanVirus = None self.ScanRisk = None self.ScanVul = None self.All = None self.Images = None self.RequestId = None def _deserialize(self, params): self.Enable = params.get("Enable") self.ScanTime = params.get("ScanTime") self.ScanPeriod = params.get("ScanPeriod") self.ScanVirus = params.get("ScanVirus") self.ScanRisk = params.get("ScanRisk") self.ScanVul = params.get("ScanVul") self.All = params.get("All") self.Images = params.get("Images") self.RequestId = params.get("RequestId") class DescribeAssetImageScanStatusRequest(AbstractModel): """DescribeAssetImageScanStatus请求参数结构体 """ def __init__(self): r""" :param TaskID: 任务id :type TaskID: str """ self.TaskID = None def _deserialize(self, params): self.TaskID = params.get("TaskID") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageScanStatusResponse(AbstractModel): """DescribeAssetImageScanStatus返回参数结构体 """ def __init__(self): r""" :param ImageTotal: 镜像个数 :type ImageTotal: int :param ImageScanCnt: 扫描镜像个数 :type ImageScanCnt: int :param Status: 扫描状态 :type Status: str :param Schedule: 扫描进度 ImageScanCnt/ImageTotal *100 :type Schedule: int :param SuccessCount: 安全个数 :type SuccessCount: int :param RiskCount: 风险个数 :type RiskCount: int :param LeftSeconds: 剩余扫描时间 :type LeftSeconds: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ImageTotal = None self.ImageScanCnt = None self.Status = None self.Schedule = None self.SuccessCount = None self.RiskCount = None self.LeftSeconds = None self.RequestId = None def _deserialize(self, params): self.ImageTotal = params.get("ImageTotal") self.ImageScanCnt = params.get("ImageScanCnt") self.Status = params.get("Status") self.Schedule = params.get("Schedule") self.SuccessCount = params.get("SuccessCount") self.RiskCount = params.get("RiskCount") self.LeftSeconds = params.get("LeftSeconds") self.RequestId = params.get("RequestId") class DescribeAssetImageScanTaskRequest(AbstractModel): """DescribeAssetImageScanTask请求参数结构体 """ class DescribeAssetImageScanTaskResponse(AbstractModel): """DescribeAssetImageScanTask返回参数结构体 """ def __init__(self): r""" :param TaskID: 任务id :type TaskID: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskID = None self.RequestId = None def _deserialize(self, params): self.TaskID = params.get("TaskID") self.RequestId = params.get("RequestId") class DescribeAssetImageSimpleListRequest(AbstractModel): """DescribeAssetImageSimpleList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Keywords- String - 是否必填:否 - 镜像名、镜像id 称筛选,</li> :type Filters: list of AssetFilters :param By: 排序字段 :type By: str :param Order: 排序方式 asc,desc :type Order: str """ self.Limit = None self.Offset = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageSimpleListResponse(AbstractModel): """DescribeAssetImageSimpleList返回参数结构体 """ def __init__(self): r""" :param List: 镜像列表 :type List: list of AssetSimpleImageInfo :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = AssetSimpleImageInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetImageVirusListExportRequest(AbstractModel): """DescribeAssetImageVirusListExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 列表支持字段 :type ExportField: list of str :param ImageID: 镜像id :type ImageID: str :param Filters: 过滤条件。 <li>Name- String - 是否必填:否 - 镜像名称筛选,</li> <li>RiskLevel - String - 是否必填:否 - 风险等级 1,2,3,4</li> :type Filters: list of AssetFilters """ self.ExportField = None self.ImageID = None self.Filters = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.ImageID = params.get("ImageID") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageVirusListExportResponse(AbstractModel): """DescribeAssetImageVirusListExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: excel文件下载地址 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeAssetImageVirusListRequest(AbstractModel): """DescribeAssetImageVirusList请求参数结构体 """ def __init__(self): r""" :param ImageID: 镜像id :type ImageID: str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Name- String - 是否必填:否 - 镜像名称筛选,</li> <li>RiskLevel - String - 是否必填:否 - 风险等级 1,2,3,4</li> :type Filters: list of AssetFilters :param Order: 排序 asc desc :type Order: str :param By: 排序字段 :type By: str """ self.ImageID = None self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.ImageID = params.get("ImageID") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageVirusListResponse(AbstractModel): """DescribeAssetImageVirusList返回参数结构体 """ def __init__(self): r""" :param List: 镜像病毒列表 :type List: list of ImageVirusInfo :param TotalCount: 总数量 :type TotalCount: int :param VirusScanStatus: 病毒扫描状态 0:未扫描 1:扫描中 2:扫描完成 3:扫描出错 4:扫描取消 :type VirusScanStatus: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.VirusScanStatus = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ImageVirusInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.VirusScanStatus = params.get("VirusScanStatus") self.RequestId = params.get("RequestId") class DescribeAssetImageVulListExportRequest(AbstractModel): """DescribeAssetImageVulListExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param ImageID: 镜像id :type ImageID: str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Name- String - 是否必填:否 - 漏洞名称名称筛选,</li> <li>Level - String - 是否必填:否 - 风险等级 1,2,3,4</li> :type Filters: list of AssetFilters """ self.ExportField = None self.ImageID = None self.Limit = None self.Offset = None self.Filters = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.ImageID = params.get("ImageID") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageVulListExportResponse(AbstractModel): """DescribeAssetImageVulListExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: excel文件下载地址 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeAssetImageVulListRequest(AbstractModel): """DescribeAssetImageVulList请求参数结构体 """ def __init__(self): r""" :param ImageID: 镜像id :type ImageID: str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Name- String - 是否必填:否 - 漏洞名称名称筛选,</li> <li>Level - String - 是否必填:否 - 风险等级 1,2,3,4</li> :type Filters: list of AssetFilters :param By: 排序字段(Level) :type By: str :param Order: 排序方式 + - :type Order: str """ self.ImageID = None self.Limit = None self.Offset = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.ImageID = params.get("ImageID") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetImageVulListResponse(AbstractModel): """DescribeAssetImageVulList返回参数结构体 """ def __init__(self): r""" :param List: 镜像漏洞列表 :type List: list of ImagesVul :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ImagesVul() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetPortListRequest(AbstractModel): """DescribeAssetPortList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>All - String - 是否必填:否 - 模糊查询可选字段</li> <li>RunAs - String - 是否必填:否 - 运行用户筛选,</li> <li>ContainerID - String - 是否必填:否 - 容器id</li> <li>HostID- String - 是否必填:是 - 主机id</li> <li>HostIP- string - 是否必填:否 - 主机ip搜索</li> <li>ProcessName- string - 是否必填:否 - 进程名搜索</li> :type Filters: list of AssetFilters """ self.Limit = None self.Offset = None self.Filters = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetPortListResponse(AbstractModel): """DescribeAssetPortList返回参数结构体 """ def __init__(self): r""" :param List: 端口列表 :type List: list of PortInfo :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = PortInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetProcessListRequest(AbstractModel): """DescribeAssetProcessList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>RunAs - String - 是否必填:否 - 运行用户筛选,</li> <li>ContainerID - String - 是否必填:否 - 容器id</li> <li>HostID- String - 是否必填:是 - 主机id</li> <li>HostIP- string - 是否必填:否 - 主机ip搜索</li> <li>ProcessName- string - 是否必填:否 - 进程名搜索</li> <li>Pid- string - 是否必填:否 - 进程id搜索(关联进程)</li> :type Filters: list of AssetFilters """ self.Limit = None self.Offset = None self.Filters = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetProcessListResponse(AbstractModel): """DescribeAssetProcessList返回参数结构体 """ def __init__(self): r""" :param List: 端口列表 :type List: list of ProcessInfo :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ProcessInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeAssetSummaryRequest(AbstractModel): """DescribeAssetSummary请求参数结构体 """ class DescribeAssetSummaryResponse(AbstractModel): """DescribeAssetSummary返回参数结构体 """ def __init__(self): r""" :param AppCnt: 应用个数 :type AppCnt: int :param ContainerCnt: 容器个数 :type ContainerCnt: int :param ContainerPause: 暂停的容器个数 :type ContainerPause: int :param ContainerRunning: 运行的容器个数 :type ContainerRunning: int :param ContainerStop: 停止运行的容器个数 :type ContainerStop: int :param CreateTime: 创建时间 :type CreateTime: str :param DbCnt: 数据库个数 :type DbCnt: int :param ImageCnt: 镜像个数 :type ImageCnt: int :param HostOnline: 主机在线个数 :type HostOnline: int :param HostCnt: 主机个数 :type HostCnt: int :param ImageHasRiskInfoCnt: 有风险的镜像个数 :type ImageHasRiskInfoCnt: int :param ImageHasVirusCnt: 有病毒的镜像个数 :type ImageHasVirusCnt: int :param ImageHasVulsCnt: 有漏洞的镜像个数 :type ImageHasVulsCnt: int :param ImageUntrustCnt: 不受信任的镜像个数 :type ImageUntrustCnt: int :param ListenPortCnt: 监听的端口个数 :type ListenPortCnt: int :param ProcessCnt: 进程个数 :type ProcessCnt: int :param WebServiceCnt: web服务个数 :type WebServiceCnt: int :param LatestImageScanTime: 最近镜像扫描时间 :type LatestImageScanTime: str :param ImageUnsafeCnt: 风险镜像个数 :type ImageUnsafeCnt: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.AppCnt = None self.ContainerCnt = None self.ContainerPause = None self.ContainerRunning = None self.ContainerStop = None self.CreateTime = None self.DbCnt = None self.ImageCnt = None self.HostOnline = None self.HostCnt = None self.ImageHasRiskInfoCnt = None self.ImageHasVirusCnt = None self.ImageHasVulsCnt = None self.ImageUntrustCnt = None self.ListenPortCnt = None self.ProcessCnt = None self.WebServiceCnt = None self.LatestImageScanTime = None self.ImageUnsafeCnt = None self.RequestId = None def _deserialize(self, params): self.AppCnt = params.get("AppCnt") self.ContainerCnt = params.get("ContainerCnt") self.ContainerPause = params.get("ContainerPause") self.ContainerRunning = params.get("ContainerRunning") self.ContainerStop = params.get("ContainerStop") self.CreateTime = params.get("CreateTime") self.DbCnt = params.get("DbCnt") self.ImageCnt = params.get("ImageCnt") self.HostOnline = params.get("HostOnline") self.HostCnt = params.get("HostCnt") self.ImageHasRiskInfoCnt = params.get("ImageHasRiskInfoCnt") self.ImageHasVirusCnt = params.get("ImageHasVirusCnt") self.ImageHasVulsCnt = params.get("ImageHasVulsCnt") self.ImageUntrustCnt = params.get("ImageUntrustCnt") self.ListenPortCnt = params.get("ListenPortCnt") self.ProcessCnt = params.get("ProcessCnt") self.WebServiceCnt = params.get("WebServiceCnt") self.LatestImageScanTime = params.get("LatestImageScanTime") self.ImageUnsafeCnt = params.get("ImageUnsafeCnt") self.RequestId = params.get("RequestId") class DescribeAssetWebServiceListRequest(AbstractModel): """DescribeAssetWebServiceList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>Keywords- String - 是否必填:否 - 模糊查询可选字段</li> <li>Type- String - 是否必填:否 - 主机运行状态筛选,"Apache" "Jboss" "lighttpd" "Nginx" "Tomcat"</li> :type Filters: list of AssetFilters """ self.Limit = None self.Offset = None self.Filters = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeAssetWebServiceListResponse(AbstractModel): """DescribeAssetWebServiceList返回参数结构体 """ def __init__(self): r""" :param List: 主机列表 :type List: list of ServiceInfo :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = ServiceInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeCheckItemListRequest(AbstractModel): """DescribeCheckItemList请求参数结构体 """ def __init__(self): r""" :param Offset: 偏移量 :type Offset: int :param Limit: 每次查询的最大记录数量 :type Limit: int :param Filters: Name 可取值:risk_level风险等级, risk_target检查对象,风险对象,risk_type风险类别,risk_attri检测项所属的风险类型 :type Filters: list of ComplianceFilters """ self.Offset = None self.Limit = None self.Filters = None def _deserialize(self, params): self.Offset = params.get("Offset") self.Limit = params.get("Limit") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = ComplianceFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeCheckItemListResponse(AbstractModel): """DescribeCheckItemList返回参数结构体 """ def __init__(self): r""" :param ClusterCheckItems: 检查项详情数组 :type ClusterCheckItems: list of ClusterCheckItem :param TotalCount: 检查项总数 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ClusterCheckItems = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("ClusterCheckItems") is not None: self.ClusterCheckItems = [] for item in params.get("ClusterCheckItems"): obj = ClusterCheckItem() obj._deserialize(item) self.ClusterCheckItems.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeClusterDetailRequest(AbstractModel): """DescribeClusterDetail请求参数结构体 """ def __init__(self): r""" :param ClusterId: 集群id :type ClusterId: str """ self.ClusterId = None def _deserialize(self, params): self.ClusterId = params.get("ClusterId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeClusterDetailResponse(AbstractModel): """DescribeClusterDetail返回参数结构体 """ def __init__(self): r""" :param ClusterId: 集群id :type ClusterId: str :param ClusterName: 集群名字 :type ClusterName: str :param ScanTaskProgress: 当前集群扫描任务的进度,100表示扫描完成. :type ScanTaskProgress: int :param ClusterVersion: 集群版本 :type ClusterVersion: str :param ContainerRuntime: 运行时组件 :type ContainerRuntime: str :param ClusterNodeNum: 集群节点数 :type ClusterNodeNum: int :param ClusterStatus: 集群状态 (Running 运行中 Creating 创建中 Abnormal 异常 ) :type ClusterStatus: str :param ClusterType: 集群类型:为托管集群MANAGED_CLUSTER、独立集群INDEPENDENT_CLUSTER :type ClusterType: str :param Region: 集群区域 :type Region: str :param SeriousRiskCount: 严重风险检查项的数量 :type SeriousRiskCount: int :param HighRiskCount: 高风险检查项的数量 :type HighRiskCount: int :param MiddleRiskCount: 中风险检查项的数量 :type MiddleRiskCount: int :param HintRiskCount: 提示风险检查项的数量 :type HintRiskCount: int :param CheckStatus: 检查任务的状态 :type CheckStatus: str :param DefenderStatus: 防御容器状态 :type DefenderStatus: str :param TaskCreateTime: 扫描任务创建时间 :type TaskCreateTime: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ClusterId = None self.ClusterName = None self.ScanTaskProgress = None self.ClusterVersion = None self.ContainerRuntime = None self.ClusterNodeNum = None self.ClusterStatus = None self.ClusterType = None self.Region = None self.SeriousRiskCount = None self.HighRiskCount = None self.MiddleRiskCount = None self.HintRiskCount = None self.CheckStatus = None self.DefenderStatus = None self.TaskCreateTime = None self.RequestId = None def _deserialize(self, params): self.ClusterId = params.get("ClusterId") self.ClusterName = params.get("ClusterName") self.ScanTaskProgress = params.get("ScanTaskProgress") self.ClusterVersion = params.get("ClusterVersion") self.ContainerRuntime = params.get("ContainerRuntime") self.ClusterNodeNum = params.get("ClusterNodeNum") self.ClusterStatus = params.get("ClusterStatus") self.ClusterType = params.get("ClusterType") self.Region = params.get("Region") self.SeriousRiskCount = params.get("SeriousRiskCount") self.HighRiskCount = params.get("HighRiskCount") self.MiddleRiskCount = params.get("MiddleRiskCount") self.HintRiskCount = params.get("HintRiskCount") self.CheckStatus = params.get("CheckStatus") self.DefenderStatus = params.get("DefenderStatus") self.TaskCreateTime = params.get("TaskCreateTime") self.RequestId = params.get("RequestId") class DescribeClusterSummaryRequest(AbstractModel): """DescribeClusterSummary请求参数结构体 """ class DescribeClusterSummaryResponse(AbstractModel): """DescribeClusterSummary返回参数结构体 """ def __init__(self): r""" :param TotalCount: 集群总数 :type TotalCount: int :param RiskClusterCount: 有风险的集群数量 :type RiskClusterCount: int :param UncheckClusterCount: 未检查的集群数量 :type UncheckClusterCount: int :param ManagedClusterCount: 托管集群数量 :type ManagedClusterCount: int :param IndependentClusterCount: 独立集群数量 :type IndependentClusterCount: int :param NoRiskClusterCount: 无风险的集群数量 :type NoRiskClusterCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.RiskClusterCount = None self.UncheckClusterCount = None self.ManagedClusterCount = None self.IndependentClusterCount = None self.NoRiskClusterCount = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") self.RiskClusterCount = params.get("RiskClusterCount") self.UncheckClusterCount = params.get("UncheckClusterCount") self.ManagedClusterCount = params.get("ManagedClusterCount") self.IndependentClusterCount = params.get("IndependentClusterCount") self.NoRiskClusterCount = params.get("NoRiskClusterCount") self.RequestId = params.get("RequestId") class DescribeComplianceAssetDetailInfoRequest(AbstractModel): """DescribeComplianceAssetDetailInfo请求参数结构体 """ def __init__(self): r""" :param CustomerAssetId: 客户资产ID。 :type CustomerAssetId: int """ self.CustomerAssetId = None def _deserialize(self, params): self.CustomerAssetId = params.get("CustomerAssetId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeComplianceAssetDetailInfoResponse(AbstractModel): """DescribeComplianceAssetDetailInfo返回参数结构体 """ def __init__(self): r""" :param AssetDetailInfo: 某资产的详情。 :type AssetDetailInfo: :class:`tencentcloud.tcss.v20201101.models.ComplianceAssetDetailInfo` :param ContainerDetailInfo: 当资产为容器时,返回此字段。 注意:此字段可能返回 null,表示取不到有效值。 :type ContainerDetailInfo: :class:`tencentcloud.tcss.v20201101.models.ComplianceContainerDetailInfo` :param ImageDetailInfo: 当资产为镜像时,返回此字段。 注意:此字段可能返回 null,表示取不到有效值。 :type ImageDetailInfo: :class:`tencentcloud.tcss.v20201101.models.ComplianceImageDetailInfo` :param HostDetailInfo: 当资产为主机时,返回此字段。 注意:此字段可能返回 null,表示取不到有效值。 :type HostDetailInfo: :class:`tencentcloud.tcss.v20201101.models.ComplianceHostDetailInfo` :param K8SDetailInfo: 当资产为K8S时,返回此字段。 注意:此字段可能返回 null,表示取不到有效值。 :type K8SDetailInfo: :class:`tencentcloud.tcss.v20201101.models.ComplianceK8SDetailInfo` :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.AssetDetailInfo = None self.ContainerDetailInfo = None self.ImageDetailInfo = None self.HostDetailInfo = None self.K8SDetailInfo = None self.RequestId = None def _deserialize(self, params): if params.get("AssetDetailInfo") is not None: self.AssetDetailInfo = ComplianceAssetDetailInfo() self.AssetDetailInfo._deserialize(params.get("AssetDetailInfo")) if params.get("ContainerDetailInfo") is not None: self.ContainerDetailInfo = ComplianceContainerDetailInfo() self.ContainerDetailInfo._deserialize(params.get("ContainerDetailInfo")) if params.get("ImageDetailInfo") is not None: self.ImageDetailInfo = ComplianceImageDetailInfo() self.ImageDetailInfo._deserialize(params.get("ImageDetailInfo")) if params.get("HostDetailInfo") is not None: self.HostDetailInfo = ComplianceHostDetailInfo() self.HostDetailInfo._deserialize(params.get("HostDetailInfo")) if params.get("K8SDetailInfo") is not None: self.K8SDetailInfo = ComplianceK8SDetailInfo() self.K8SDetailInfo._deserialize(params.get("K8SDetailInfo")) self.RequestId = params.get("RequestId") class DescribeComplianceAssetListRequest(AbstractModel): """DescribeComplianceAssetList请求参数结构体 """ def __init__(self): r""" :param AssetTypeSet: 资产类型列表。 :type AssetTypeSet: list of str :param Offset: 起始偏移量,默认为0。 :type Offset: int :param Limit: 返回的数据量,默认为10,最大为100。 :type Limit: int :param Filters: 查询过滤器 :type Filters: list of ComplianceFilters """ self.AssetTypeSet = None self.Offset = None self.Limit = None self.Filters = None def _deserialize(self, params): self.AssetTypeSet = params.get("AssetTypeSet") self.Offset = params.get("Offset") self.Limit = params.get("Limit") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = ComplianceFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeComplianceAssetListResponse(AbstractModel): """DescribeComplianceAssetList返回参数结构体 """ def __init__(self): r""" :param TotalCount: 返回资产的总数。 :type TotalCount: int :param AssetInfoList: 返回各类资产的列表。 注意:此字段可能返回 null,表示取不到有效值。 :type AssetInfoList: list of ComplianceAssetInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.AssetInfoList = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("AssetInfoList") is not None: self.AssetInfoList = [] for item in params.get("AssetInfoList"): obj = ComplianceAssetInfo() obj._deserialize(item) self.AssetInfoList.append(obj) self.RequestId = params.get("RequestId") class DescribeComplianceAssetPolicyItemListRequest(AbstractModel): """DescribeComplianceAssetPolicyItemList请求参数结构体 """ def __init__(self): r""" :param CustomerAssetId: 客户资产的ID。 :type CustomerAssetId: int :param Offset: 起始偏移量,默认为0。 :type Offset: int :param Limit: 要获取的数据量,默认为10,最大为100。 :type Limit: int :param Filters: 过滤器列表。Name字段支持 RiskLevel :type Filters: list of ComplianceFilters """ self.CustomerAssetId = None self.Offset = None self.Limit = None self.Filters = None def _deserialize(self, params): self.CustomerAssetId = params.get("CustomerAssetId") self.Offset = params.get("Offset") self.Limit = params.get("Limit") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = ComplianceFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeComplianceAssetPolicyItemListResponse(AbstractModel): """DescribeComplianceAssetPolicyItemList返回参数结构体 """ def __init__(self): r""" :param TotalCount: 返回检测项的总数。如果用户未启用基线检查,此处返回0。 :type TotalCount: int :param AssetPolicyItemList: 返回某个资产下的检测项的列表。 :type AssetPolicyItemList: list of ComplianceAssetPolicyItem :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.AssetPolicyItemList = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("AssetPolicyItemList") is not None: self.AssetPolicyItemList = [] for item in params.get("AssetPolicyItemList"): obj = ComplianceAssetPolicyItem() obj._deserialize(item) self.AssetPolicyItemList.append(obj) self.RequestId = params.get("RequestId") class DescribeCompliancePeriodTaskListRequest(AbstractModel): """DescribeCompliancePeriodTaskList请求参数结构体 """ def __init__(self): r""" :param AssetType: 资产的类型,取值为: ASSET_CONTAINER, 容器 ASSET_IMAGE, 镜像 ASSET_HOST, 主机 ASSET_K8S, K8S资产 :type AssetType: str :param Offset: 偏移量,默认为0。 :type Offset: int :param Limit: 需要返回的数量,默认为10,最大值为100。 :type Limit: int """ self.AssetType = None self.Offset = None self.Limit = None def _deserialize(self, params): self.AssetType = params.get("AssetType") self.Offset = params.get("Offset") self.Limit = params.get("Limit") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeCompliancePeriodTaskListResponse(AbstractModel): """DescribeCompliancePeriodTaskList返回参数结构体 """ def __init__(self): r""" :param TotalCount: 定时任务的总量。 :type TotalCount: int :param PeriodTaskSet: 定时任务信息的列表 :type PeriodTaskSet: list of CompliancePeriodTask :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.PeriodTaskSet = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("PeriodTaskSet") is not None: self.PeriodTaskSet = [] for item in params.get("PeriodTaskSet"): obj = CompliancePeriodTask() obj._deserialize(item) self.PeriodTaskSet.append(obj) self.RequestId = params.get("RequestId") class DescribeCompliancePolicyItemAffectedAssetListRequest(AbstractModel): """DescribeCompliancePolicyItemAffectedAssetList请求参数结构体 """ def __init__(self): r""" :param CustomerPolicyItemId: DescribeComplianceTaskPolicyItemSummaryList返回的CustomerPolicyItemId,表示检测项的ID。 :type CustomerPolicyItemId: int :param Offset: 起始偏移量,默认为0。 :type Offset: int :param Limit: 需要返回的数量,默认为10,最大值为100。 :type Limit: int :param Filters: 过滤条件。 Name - String Name 可取值:NodeName, CheckResult :type Filters: list of ComplianceFilters """ self.CustomerPolicyItemId = None self.Offset = None self.Limit = None self.Filters = None def _deserialize(self, params): self.CustomerPolicyItemId = params.get("CustomerPolicyItemId") self.Offset = params.get("Offset") self.Limit = params.get("Limit") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = ComplianceFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeCompliancePolicyItemAffectedAssetListResponse(AbstractModel): """DescribeCompliancePolicyItemAffectedAssetList返回参数结构体 """ def __init__(self): r""" :param AffectedAssetList: 返回各检测项所影响的资产的列表。 :type AffectedAssetList: list of ComplianceAffectedAsset :param TotalCount: 检测项影响的资产的总数。 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.AffectedAssetList = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("AffectedAssetList") is not None: self.AffectedAssetList = [] for item in params.get("AffectedAssetList"): obj = ComplianceAffectedAsset() obj._deserialize(item) self.AffectedAssetList.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeCompliancePolicyItemAffectedSummaryRequest(AbstractModel): """DescribeCompliancePolicyItemAffectedSummary请求参数结构体 """ def __init__(self): r""" :param CustomerPolicyItemId: DescribeComplianceTaskPolicyItemSummaryList返回的CustomerPolicyItemId,表示检测项的ID。 :type CustomerPolicyItemId: int """ self.CustomerPolicyItemId = None def _deserialize(self, params): self.CustomerPolicyItemId = params.get("CustomerPolicyItemId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeCompliancePolicyItemAffectedSummaryResponse(AbstractModel): """DescribeCompliancePolicyItemAffectedSummary返回参数结构体 """ def __init__(self): r""" :param PolicyItemSummary: 返回各检测项影响的资产的汇总信息。 :type PolicyItemSummary: :class:`tencentcloud.tcss.v20201101.models.CompliancePolicyItemSummary` :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.PolicyItemSummary = None self.RequestId = None def _deserialize(self, params): if params.get("PolicyItemSummary") is not None: self.PolicyItemSummary = CompliancePolicyItemSummary() self.PolicyItemSummary._deserialize(params.get("PolicyItemSummary")) self.RequestId = params.get("RequestId") class DescribeComplianceScanFailedAssetListRequest(AbstractModel): """DescribeComplianceScanFailedAssetList请求参数结构体 """ def __init__(self): r""" :param AssetTypeSet: 资产类型列表。 ASSET_CONTAINER, 容器 ASSET_IMAGE, 镜像 ASSET_HOST, 主机 ASSET_K8S, K8S资产 :type AssetTypeSet: list of str :param Offset: 起始偏移量,默认为0。 :type Offset: int :param Limit: 返回的数据量,默认为10,最大为100。 :type Limit: int :param Filters: 查询过滤器 :type Filters: list of ComplianceFilters """ self.AssetTypeSet = None self.Offset = None self.Limit = None self.Filters = None def _deserialize(self, params): self.AssetTypeSet = params.get("AssetTypeSet") self.Offset = params.get("Offset") self.Limit = params.get("Limit") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = ComplianceFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeComplianceScanFailedAssetListResponse(AbstractModel): """DescribeComplianceScanFailedAssetList返回参数结构体 """ def __init__(self): r""" :param TotalCount: 返回检测失败的资产的总数。 :type TotalCount: int :param ScanFailedAssetList: 返回各类检测失败的资产的汇总信息的列表。 注意:此字段可能返回 null,表示取不到有效值。 :type ScanFailedAssetList: list of ComplianceScanFailedAsset :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.ScanFailedAssetList = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("ScanFailedAssetList") is not None: self.ScanFailedAssetList = [] for item in params.get("ScanFailedAssetList"): obj = ComplianceScanFailedAsset() obj._deserialize(item) self.ScanFailedAssetList.append(obj) self.RequestId = params.get("RequestId") class DescribeComplianceTaskAssetSummaryRequest(AbstractModel): """DescribeComplianceTaskAssetSummary请求参数结构体 """ def __init__(self): r""" :param AssetTypeSet: 资产类型列表。 ASSET_CONTAINER, 容器 ASSET_IMAGE, 镜像 ASSET_HOST, 主机 ASSET_K8S, K8S资产 :type AssetTypeSet: list of str """ self.AssetTypeSet = None def _deserialize(self, params): self.AssetTypeSet = params.get("AssetTypeSet") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeComplianceTaskAssetSummaryResponse(AbstractModel): """DescribeComplianceTaskAssetSummary返回参数结构体 """ def __init__(self): r""" :param Status: 返回用户的状态, USER_UNINIT: 用户未初始化。 USER_INITIALIZING,表示用户正在初始化环境。 USER_NORMAL: 正常状态。 :type Status: str :param AssetSummaryList: 返回各类资产的汇总信息的列表。 :type AssetSummaryList: list of ComplianceAssetSummary :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.Status = None self.AssetSummaryList = None self.RequestId = None def _deserialize(self, params): self.Status = params.get("Status") if params.get("AssetSummaryList") is not None: self.AssetSummaryList = [] for item in params.get("AssetSummaryList"): obj = ComplianceAssetSummary() obj._deserialize(item) self.AssetSummaryList.append(obj) self.RequestId = params.get("RequestId") class DescribeComplianceTaskPolicyItemSummaryListRequest(AbstractModel): """DescribeComplianceTaskPolicyItemSummaryList请求参数结构体 """ def __init__(self): r""" :param AssetType: 资产类型。仅查询与指定资产类型相关的检测项。 ASSET_CONTAINER, 容器 ASSET_IMAGE, 镜像 ASSET_HOST, 主机 ASSET_K8S, K8S资产 :type AssetType: str :param Offset: 起始偏移量,默认为0。 :type Offset: int :param Limit: 需要返回的数量,默认为10,最大值为100。 :type Limit: int :param Filters: 过滤条件。 Name - String Name 可取值:ItemType, StandardId, RiskLevel。 当为K8S资产时,还可取ClusterName。 :type Filters: list of ComplianceFilters """ self.AssetType = None self.Offset = None self.Limit = None self.Filters = None def _deserialize(self, params): self.AssetType = params.get("AssetType") self.Offset = params.get("Offset") self.Limit = params.get("Limit") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = ComplianceFilters() obj._deserialize(item) self.Filters.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeComplianceTaskPolicyItemSummaryListResponse(AbstractModel): """DescribeComplianceTaskPolicyItemSummaryList返回参数结构体 """ def __init__(self): r""" :param TaskId: 返回最近一次合规检查任务的ID。这个任务为本次所展示数据的来源。 注意:此字段可能返回 null,表示取不到有效值。 :type TaskId: int :param TotalCount: 返回检测项的总数。 :type TotalCount: int :param PolicyItemSummaryList: 返回各检测项对应的汇总信息的列表。 :type PolicyItemSummaryList: list of CompliancePolicyItemSummary :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskId = None self.TotalCount = None self.PolicyItemSummaryList = None self.RequestId = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.TotalCount = params.get("TotalCount") if params.get("PolicyItemSummaryList") is not None: self.PolicyItemSummaryList = [] for item in params.get("PolicyItemSummaryList"): obj = CompliancePolicyItemSummary() obj._deserialize(item) self.PolicyItemSummaryList.append(obj) self.RequestId = params.get("RequestId") class DescribeComplianceWhitelistItemListRequest(AbstractModel): """DescribeComplianceWhitelistItemList请求参数结构体 """ def __init__(self): r""" :param Offset: 起始偏移量,默认为0。 :type Offset: int :param Limit: 要获取的数量,默认为10,最大为100。 :type Limit: int :param AssetTypeSet: 资产类型列表。 :type AssetTypeSet: list of str :param Filters: 查询过滤器 :type Filters: list of ComplianceFilters :param By: 排序字段 :type By: str :param Order: 排序方式 desc asc :type Order: str """ self.Offset = None self.Limit = None self.AssetTypeSet = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.Offset = params.get("Offset") self.Limit = params.get("Limit") self.AssetTypeSet = params.get("AssetTypeSet") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = ComplianceFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeComplianceWhitelistItemListResponse(AbstractModel): """DescribeComplianceWhitelistItemList返回参数结构体 """ def __init__(self): r""" :param WhitelistItemSet: 白名单项的列表。 :type WhitelistItemSet: list of ComplianceWhitelistItem :param TotalCount: 白名单项的总数。 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.WhitelistItemSet = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("WhitelistItemSet") is not None: self.WhitelistItemSet = [] for item in params.get("WhitelistItemSet"): obj = ComplianceWhitelistItem() obj._deserialize(item) self.WhitelistItemSet.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeContainerAssetSummaryRequest(AbstractModel): """DescribeContainerAssetSummary请求参数结构体 """ class DescribeContainerAssetSummaryResponse(AbstractModel): """DescribeContainerAssetSummary返回参数结构体 """ def __init__(self): r""" :param ContainerTotalCnt: 容器总数 :type ContainerTotalCnt: int :param ContainerRunningCnt: 正在运行容器数量 :type ContainerRunningCnt: int :param ContainerPauseCnt: 暂停运行容器数量 :type ContainerPauseCnt: int :param ContainerStopped: 停止运行容器数量 :type ContainerStopped: int :param ImageCnt: 本地镜像数量 :type ImageCnt: int :param HostCnt: 主机节点数量 :type HostCnt: int :param HostRunningCnt: 主机正在运行节点数量 :type HostRunningCnt: int :param HostOfflineCnt: 主机离线节点数量 :type HostOfflineCnt: int :param ImageRegistryCnt: 镜像仓库数量 :type ImageRegistryCnt: int :param ImageTotalCnt: 镜像总数 :type ImageTotalCnt: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ContainerTotalCnt = None self.ContainerRunningCnt = None self.ContainerPauseCnt = None self.ContainerStopped = None self.ImageCnt = None self.HostCnt = None self.HostRunningCnt = None self.HostOfflineCnt = None self.ImageRegistryCnt = None self.ImageTotalCnt = None self.RequestId = None def _deserialize(self, params): self.ContainerTotalCnt = params.get("ContainerTotalCnt") self.ContainerRunningCnt = params.get("ContainerRunningCnt") self.ContainerPauseCnt = params.get("ContainerPauseCnt") self.ContainerStopped = params.get("ContainerStopped") self.ImageCnt = params.get("ImageCnt") self.HostCnt = params.get("HostCnt") self.HostRunningCnt = params.get("HostRunningCnt") self.HostOfflineCnt = params.get("HostOfflineCnt") self.ImageRegistryCnt = params.get("ImageRegistryCnt") self.ImageTotalCnt = params.get("ImageTotalCnt") self.RequestId = params.get("RequestId") class DescribeContainerSecEventSummaryRequest(AbstractModel): """DescribeContainerSecEventSummary请求参数结构体 """ class DescribeContainerSecEventSummaryResponse(AbstractModel): """DescribeContainerSecEventSummary返回参数结构体 """ def __init__(self): r""" :param UnhandledEscapeCnt: 未处理逃逸事件 :type UnhandledEscapeCnt: int :param UnhandledReverseShellCnt: 未处理反弹shell事件 :type UnhandledReverseShellCnt: int :param UnhandledRiskSyscallCnt: 未处理高危系统调用 :type UnhandledRiskSyscallCnt: int :param UnhandledAbnormalProcessCnt: 未处理异常进程 :type UnhandledAbnormalProcessCnt: int :param UnhandledFileCnt: 未处理文件篡改 :type UnhandledFileCnt: int :param UnhandledVirusEventCnt: 未处理木马事件 :type UnhandledVirusEventCnt: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.UnhandledEscapeCnt = None self.UnhandledReverseShellCnt = None self.UnhandledRiskSyscallCnt = None self.UnhandledAbnormalProcessCnt = None self.UnhandledFileCnt = None self.UnhandledVirusEventCnt = None self.RequestId = None def _deserialize(self, params): self.UnhandledEscapeCnt = params.get("UnhandledEscapeCnt") self.UnhandledReverseShellCnt = params.get("UnhandledReverseShellCnt") self.UnhandledRiskSyscallCnt = params.get("UnhandledRiskSyscallCnt") self.UnhandledAbnormalProcessCnt = params.get("UnhandledAbnormalProcessCnt") self.UnhandledFileCnt = params.get("UnhandledFileCnt") self.UnhandledVirusEventCnt = params.get("UnhandledVirusEventCnt") self.RequestId = params.get("RequestId") class DescribeEscapeEventDetailRequest(AbstractModel): """DescribeEscapeEventDetail请求参数结构体 """ def __init__(self): r""" :param EventId: 事件唯一id :type EventId: str """ self.EventId = None def _deserialize(self, params): self.EventId = params.get("EventId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeEscapeEventDetailResponse(AbstractModel): """DescribeEscapeEventDetail返回参数结构体 """ def __init__(self): r""" :param EventBaseInfo: 事件基本信息 :type EventBaseInfo: :class:`tencentcloud.tcss.v20201101.models.RunTimeEventBaseInfo` :param ProcessInfo: 进程信息 :type ProcessInfo: :class:`tencentcloud.tcss.v20201101.models.ProcessDetailInfo` :param EventDetail: 事件描述 :type EventDetail: :class:`tencentcloud.tcss.v20201101.models.EscapeEventDescription` :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.EventBaseInfo = None self.ProcessInfo = None self.EventDetail = None self.RequestId = None def _deserialize(self, params): if params.get("EventBaseInfo") is not None: self.EventBaseInfo = RunTimeEventBaseInfo() self.EventBaseInfo._deserialize(params.get("EventBaseInfo")) if params.get("ProcessInfo") is not None: self.ProcessInfo = ProcessDetailInfo() self.ProcessInfo._deserialize(params.get("ProcessInfo")) if params.get("EventDetail") is not None: self.EventDetail = EscapeEventDescription() self.EventDetail._deserialize(params.get("EventDetail")) self.RequestId = params.get("RequestId") class DescribeEscapeEventInfoRequest(AbstractModel): """DescribeEscapeEventInfo请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeEscapeEventInfoResponse(AbstractModel): """DescribeEscapeEventInfo返回参数结构体 """ def __init__(self): r""" :param EventSet: 逃逸事件数组 :type EventSet: list of EscapeEventInfo :param TotalCount: 事件总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.EventSet = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("EventSet") is not None: self.EventSet = [] for item in params.get("EventSet"): obj = EscapeEventInfo() obj._deserialize(item) self.EventSet.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeEscapeEventsExportRequest(AbstractModel): """DescribeEscapeEventsExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.ExportField = None self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeEscapeEventsExportResponse(AbstractModel): """DescribeEscapeEventsExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: execle下载地址 注意:此字段可能返回 null,表示取不到有效值。 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeEscapeRuleInfoRequest(AbstractModel): """DescribeEscapeRuleInfo请求参数结构体 """ class DescribeEscapeRuleInfoResponse(AbstractModel): """DescribeEscapeRuleInfo返回参数结构体 """ def __init__(self): r""" :param RuleSet: 规则信息 :type RuleSet: list of EscapeRule :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RuleSet = None self.RequestId = None def _deserialize(self, params): if params.get("RuleSet") is not None: self.RuleSet = [] for item in params.get("RuleSet"): obj = EscapeRule() obj._deserialize(item) self.RuleSet.append(obj) self.RequestId = params.get("RequestId") class DescribeEscapeSafeStateRequest(AbstractModel): """DescribeEscapeSafeState请求参数结构体 """ class DescribeEscapeSafeStateResponse(AbstractModel): """DescribeEscapeSafeState返回参数结构体 """ def __init__(self): r""" :param IsSafe: Unsafe:存在风险,Safe:暂无风险,UnKnown:未知风险 :type IsSafe: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.IsSafe = None self.RequestId = None def _deserialize(self, params): self.IsSafe = params.get("IsSafe") self.RequestId = params.get("RequestId") class DescribeExportJobResultRequest(AbstractModel): """DescribeExportJobResult请求参数结构体 """ def __init__(self): r""" :param JobId: CreateExportComplianceStatusListJob返回的JobId字段的值 :type JobId: str """ self.JobId = None def _deserialize(self, params): self.JobId = params.get("JobId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeExportJobResultResponse(AbstractModel): """DescribeExportJobResult返回参数结构体 """ def __init__(self): r""" :param ExportStatus: 导出的状态。取值为, SUCCESS:成功、FAILURE:失败,RUNNING: 进行中。 :type ExportStatus: str :param DownloadURL: 返回下载URL 注意:此字段可能返回 null,表示取不到有效值。 :type DownloadURL: str :param ExportProgress: 当ExportStatus为RUNNING时,返回导出进度。0~100范围的浮点数。 注意:此字段可能返回 null,表示取不到有效值。 :type ExportProgress: float :param FailureMsg: 失败原因 注意:此字段可能返回 null,表示取不到有效值。 :type FailureMsg: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ExportStatus = None self.DownloadURL = None self.ExportProgress = None self.FailureMsg = None self.RequestId = None def _deserialize(self, params): self.ExportStatus = params.get("ExportStatus") self.DownloadURL = params.get("DownloadURL") self.ExportProgress = params.get("ExportProgress") self.FailureMsg = params.get("FailureMsg") self.RequestId = params.get("RequestId") class DescribeImageAuthorizedInfoRequest(AbstractModel): """DescribeImageAuthorizedInfo请求参数结构体 """ class DescribeImageAuthorizedInfoResponse(AbstractModel): """DescribeImageAuthorizedInfo返回参数结构体 """ def __init__(self): r""" :param TotalAuthorizedCnt: 总共有效的镜像授权数 :type TotalAuthorizedCnt: int :param UsedAuthorizedCnt: 已使用镜像授权数 :type UsedAuthorizedCnt: int :param ScannedImageCnt: 已开启扫描镜像数 :type ScannedImageCnt: int :param NotScannedImageCnt: 未开启扫描镜像数 :type NotScannedImageCnt: int :param NotScannedLocalImageCnt: 本地未开启扫描镜像数 :type NotScannedLocalImageCnt: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalAuthorizedCnt = None self.UsedAuthorizedCnt = None self.ScannedImageCnt = None self.NotScannedImageCnt = None self.NotScannedLocalImageCnt = None self.RequestId = None def _deserialize(self, params): self.TotalAuthorizedCnt = params.get("TotalAuthorizedCnt") self.UsedAuthorizedCnt = params.get("UsedAuthorizedCnt") self.ScannedImageCnt = params.get("ScannedImageCnt") self.NotScannedImageCnt = params.get("NotScannedImageCnt") self.NotScannedLocalImageCnt = params.get("NotScannedLocalImageCnt") self.RequestId = params.get("RequestId") class DescribeImageRegistryTimingScanTaskRequest(AbstractModel): """DescribeImageRegistryTimingScanTask请求参数结构体 """ class DescribeImageRegistryTimingScanTaskResponse(AbstractModel): """DescribeImageRegistryTimingScanTask返回参数结构体 """ def __init__(self): r""" :param Enable: 定时扫描开关 注意:此字段可能返回 null,表示取不到有效值。 :type Enable: bool :param ScanTime: 定时任务扫描时间 :type ScanTime: str :param ScanPeriod: 定时扫描间隔 :type ScanPeriod: int :param ScanType: 扫描类型数组 注意:此字段可能返回 null,表示取不到有效值。 :type ScanType: list of str :param All: 扫描全部镜像 :type All: bool :param Images: 自定义扫描镜像 注意:此字段可能返回 null,表示取不到有效值。 :type Images: list of ImageInfo :param Id: 自动以扫描镜像Id 注意:此字段可能返回 null,表示取不到有效值。 :type Id: list of int non-negative :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.Enable = None self.ScanTime = None self.ScanPeriod = None self.ScanType = None self.All = None self.Images = None self.Id = None self.RequestId = None def _deserialize(self, params): self.Enable = params.get("Enable") self.ScanTime = params.get("ScanTime") self.ScanPeriod = params.get("ScanPeriod") self.ScanType = params.get("ScanType") self.All = params.get("All") if params.get("Images") is not None: self.Images = [] for item in params.get("Images"): obj = ImageInfo() obj._deserialize(item) self.Images.append(obj) self.Id = params.get("Id") self.RequestId = params.get("RequestId") class DescribeImageRiskSummaryRequest(AbstractModel): """DescribeImageRiskSummary请求参数结构体 """ class DescribeImageRiskSummaryResponse(AbstractModel): """DescribeImageRiskSummary返回参数结构体 """ def __init__(self): r""" :param VulnerabilityCnt: 安全漏洞 :type VulnerabilityCnt: list of RunTimeRiskInfo :param MalwareVirusCnt: 木马病毒 :type MalwareVirusCnt: list of RunTimeRiskInfo :param RiskCnt: 敏感信息 :type RiskCnt: list of RunTimeRiskInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.VulnerabilityCnt = None self.MalwareVirusCnt = None self.RiskCnt = None self.RequestId = None def _deserialize(self, params): if params.get("VulnerabilityCnt") is not None: self.VulnerabilityCnt = [] for item in params.get("VulnerabilityCnt"): obj = RunTimeRiskInfo() obj._deserialize(item) self.VulnerabilityCnt.append(obj) if params.get("MalwareVirusCnt") is not None: self.MalwareVirusCnt = [] for item in params.get("MalwareVirusCnt"): obj = RunTimeRiskInfo() obj._deserialize(item) self.MalwareVirusCnt.append(obj) if params.get("RiskCnt") is not None: self.RiskCnt = [] for item in params.get("RiskCnt"): obj = RunTimeRiskInfo() obj._deserialize(item) self.RiskCnt.append(obj) self.RequestId = params.get("RequestId") class DescribeImageRiskTendencyRequest(AbstractModel): """DescribeImageRiskTendency请求参数结构体 """ def __init__(self): r""" :param StartTime: 开始时间 :type StartTime: str :param EndTime: 结束时间 :type EndTime: str """ self.StartTime = None self.EndTime = None def _deserialize(self, params): self.StartTime = params.get("StartTime") self.EndTime = params.get("EndTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeImageRiskTendencyResponse(AbstractModel): """DescribeImageRiskTendency返回参数结构体 """ def __init__(self): r""" :param ImageRiskTendencySet: 本地镜像新增风险趋势信息列表 :type ImageRiskTendencySet: list of ImageRiskTendencyInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ImageRiskTendencySet = None self.RequestId = None def _deserialize(self, params): if params.get("ImageRiskTendencySet") is not None: self.ImageRiskTendencySet = [] for item in params.get("ImageRiskTendencySet"): obj = ImageRiskTendencyInfo() obj._deserialize(item) self.ImageRiskTendencySet.append(obj) self.RequestId = params.get("RequestId") class DescribeImageSimpleListRequest(AbstractModel): """DescribeImageSimpleList请求参数结构体 """ def __init__(self): r""" :param Filters: IsAuthorized 是否已经授权, 0:否 1:是 无:全部 :type Filters: list of RunTimeFilters :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Order: 排序方式 :type Order: str :param By: 排序字段 :type By: str """ self.Filters = None self.Limit = None self.Offset = None self.Order = None self.By = None def _deserialize(self, params): if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Limit = params.get("Limit") self.Offset = params.get("Offset") self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeImageSimpleListResponse(AbstractModel): """DescribeImageSimpleList返回参数结构体 """ def __init__(self): r""" :param ImageList: 镜像列表 :type ImageList: list of ImageSimpleInfo :param ImageCnt: 镜像数 :type ImageCnt: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ImageList = None self.ImageCnt = None self.RequestId = None def _deserialize(self, params): if params.get("ImageList") is not None: self.ImageList = [] for item in params.get("ImageList"): obj = ImageSimpleInfo() obj._deserialize(item) self.ImageList.append(obj) self.ImageCnt = params.get("ImageCnt") self.RequestId = params.get("RequestId") class DescribePostPayDetailRequest(AbstractModel): """DescribePostPayDetail请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int """ self.Limit = None self.Offset = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribePostPayDetailResponse(AbstractModel): """DescribePostPayDetail返回参数结构体 """ def __init__(self): r""" :param SoftQuotaDayDetail: 弹性计费扣费详情 注意:此字段可能返回 null,表示取不到有效值。 :type SoftQuotaDayDetail: list of SoftQuotaDayInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.SoftQuotaDayDetail = None self.RequestId = None def _deserialize(self, params): if params.get("SoftQuotaDayDetail") is not None: self.SoftQuotaDayDetail = [] for item in params.get("SoftQuotaDayDetail"): obj = SoftQuotaDayInfo() obj._deserialize(item) self.SoftQuotaDayDetail.append(obj) self.RequestId = params.get("RequestId") class DescribeProVersionInfoRequest(AbstractModel): """DescribeProVersionInfo请求参数结构体 """ class DescribeProVersionInfoResponse(AbstractModel): """DescribeProVersionInfo返回参数结构体 """ def __init__(self): r""" :param StartTime: 专业版开始时间,补充购买时才不为空 注意:此字段可能返回 null,表示取不到有效值。 :type StartTime: str :param EndTime: 专业版结束时间,补充购买时才不为空 注意:此字段可能返回 null,表示取不到有效值。 :type EndTime: str :param CoresCnt: 需购买的机器核数 :type CoresCnt: int :param MaxPostPayCoresCnt: 弹性计费上限 :type MaxPostPayCoresCnt: int :param ResourceId: 资源ID 注意:此字段可能返回 null,表示取不到有效值。 :type ResourceId: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.StartTime = None self.EndTime = None self.CoresCnt = None self.MaxPostPayCoresCnt = None self.ResourceId = None self.RequestId = None def _deserialize(self, params): self.StartTime = params.get("StartTime") self.EndTime = params.get("EndTime") self.CoresCnt = params.get("CoresCnt") self.MaxPostPayCoresCnt = params.get("MaxPostPayCoresCnt") self.ResourceId = params.get("ResourceId") self.RequestId = params.get("RequestId") class DescribePurchaseStateInfoRequest(AbstractModel): """DescribePurchaseStateInfo请求参数结构体 """ class DescribePurchaseStateInfoResponse(AbstractModel): """DescribePurchaseStateInfo返回参数结构体 """ def __init__(self): r""" :param State: 0:可申请试用可购买;1:只可购买(含试用审核不通过和试用过期);2:试用生效中;3:专业版生效中;4:专业版过期 :type State: int :param CoresCnt: 总核数 注意:此字段可能返回 null,表示取不到有效值。 :type CoresCnt: int :param AuthorizedCoresCnt: 已购买核数 注意:此字段可能返回 null,表示取不到有效值。 :type AuthorizedCoresCnt: int :param ImageCnt: 镜像数 注意:此字段可能返回 null,表示取不到有效值。 :type ImageCnt: int :param AuthorizedImageCnt: 已授权镜像数 注意:此字段可能返回 null,表示取不到有效值。 :type AuthorizedImageCnt: int :param PurchasedAuthorizedCnt: 已购买镜像授权数 注意:此字段可能返回 null,表示取不到有效值。 :type PurchasedAuthorizedCnt: int :param ExpirationTime: 过期时间 注意:此字段可能返回 null,表示取不到有效值。 :type ExpirationTime: str :param AutomaticRenewal: 0表示默认状态(用户未设置,即初始状态), 1表示自动续费,2表示明确不自动续费(用户设置) 注意:此字段可能返回 null,表示取不到有效值。 :type AutomaticRenewal: int :param GivenAuthorizedCnt: 试用期间赠送镜像授权数,可能会过期 注意:此字段可能返回 null,表示取不到有效值。 :type GivenAuthorizedCnt: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.State = None self.CoresCnt = None self.AuthorizedCoresCnt = None self.ImageCnt = None self.AuthorizedImageCnt = None self.PurchasedAuthorizedCnt = None self.ExpirationTime = None self.AutomaticRenewal = None self.GivenAuthorizedCnt = None self.RequestId = None def _deserialize(self, params): self.State = params.get("State") self.CoresCnt = params.get("CoresCnt") self.AuthorizedCoresCnt = params.get("AuthorizedCoresCnt") self.ImageCnt = params.get("ImageCnt") self.AuthorizedImageCnt = params.get("AuthorizedImageCnt") self.PurchasedAuthorizedCnt = params.get("PurchasedAuthorizedCnt") self.ExpirationTime = params.get("ExpirationTime") self.AutomaticRenewal = params.get("AutomaticRenewal") self.GivenAuthorizedCnt = params.get("GivenAuthorizedCnt") self.RequestId = params.get("RequestId") class DescribeRefreshTaskRequest(AbstractModel): """DescribeRefreshTask请求参数结构体 """ def __init__(self): r""" :param TaskId: 任务ID :type TaskId: int """ self.TaskId = None def _deserialize(self, params): self.TaskId = params.get("TaskId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeRefreshTaskResponse(AbstractModel): """DescribeRefreshTask返回参数结构体 """ def __init__(self): r""" :param TaskStatus: 刷新任务状态,可能为:Task_New,Task_Running,Task_Finish,Task_Error,Task_NoExist :type TaskStatus: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskStatus = None self.RequestId = None def _deserialize(self, params): self.TaskStatus = params.get("TaskStatus") self.RequestId = params.get("RequestId") class DescribeReverseShellDetailRequest(AbstractModel): """DescribeReverseShellDetail请求参数结构体 """ def __init__(self): r""" :param EventId: 事件唯一id :type EventId: str """ self.EventId = None def _deserialize(self, params): self.EventId = params.get("EventId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeReverseShellDetailResponse(AbstractModel): """DescribeReverseShellDetail返回参数结构体 """ def __init__(self): r""" :param EventBaseInfo: 事件基本信息 :type EventBaseInfo: :class:`tencentcloud.tcss.v20201101.models.RunTimeEventBaseInfo` :param ProcessInfo: 进程信息 :type ProcessInfo: :class:`tencentcloud.tcss.v20201101.models.ProcessDetailInfo` :param ParentProcessInfo: 父进程信息 :type ParentProcessInfo: :class:`tencentcloud.tcss.v20201101.models.ProcessDetailBaseInfo` :param EventDetail: 事件描述 :type EventDetail: :class:`tencentcloud.tcss.v20201101.models.ReverseShellEventDescription` :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.EventBaseInfo = None self.ProcessInfo = None self.ParentProcessInfo = None self.EventDetail = None self.RequestId = None def _deserialize(self, params): if params.get("EventBaseInfo") is not None: self.EventBaseInfo = RunTimeEventBaseInfo() self.EventBaseInfo._deserialize(params.get("EventBaseInfo")) if params.get("ProcessInfo") is not None: self.ProcessInfo = ProcessDetailInfo() self.ProcessInfo._deserialize(params.get("ProcessInfo")) if params.get("ParentProcessInfo") is not None: self.ParentProcessInfo = ProcessDetailBaseInfo() self.ParentProcessInfo._deserialize(params.get("ParentProcessInfo")) if params.get("EventDetail") is not None: self.EventDetail = ReverseShellEventDescription() self.EventDetail._deserialize(params.get("EventDetail")) self.RequestId = params.get("RequestId") class DescribeReverseShellEventsExportRequest(AbstractModel): """DescribeReverseShellEventsExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.ExportField = None self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeReverseShellEventsExportResponse(AbstractModel): """DescribeReverseShellEventsExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: execle下载地址 注意:此字段可能返回 null,表示取不到有效值。 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeReverseShellEventsRequest(AbstractModel): """DescribeReverseShellEvents请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeReverseShellEventsResponse(AbstractModel): """DescribeReverseShellEvents返回参数结构体 """ def __init__(self): r""" :param TotalCount: 事件总数量 :type TotalCount: int :param EventSet: 反弹shell数组 :type EventSet: list of ReverseShellEventInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.EventSet = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("EventSet") is not None: self.EventSet = [] for item in params.get("EventSet"): obj = ReverseShellEventInfo() obj._deserialize(item) self.EventSet.append(obj) self.RequestId = params.get("RequestId") class DescribeReverseShellWhiteListDetailRequest(AbstractModel): """DescribeReverseShellWhiteListDetail请求参数结构体 """ def __init__(self): r""" :param WhiteListId: 白名单id :type WhiteListId: str """ self.WhiteListId = None def _deserialize(self, params): self.WhiteListId = params.get("WhiteListId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeReverseShellWhiteListDetailResponse(AbstractModel): """DescribeReverseShellWhiteListDetail返回参数结构体 """ def __init__(self): r""" :param WhiteListDetailInfo: 事件基本信息 :type WhiteListDetailInfo: :class:`tencentcloud.tcss.v20201101.models.ReverseShellWhiteListInfo` :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.WhiteListDetailInfo = None self.RequestId = None def _deserialize(self, params): if params.get("WhiteListDetailInfo") is not None: self.WhiteListDetailInfo = ReverseShellWhiteListInfo() self.WhiteListDetailInfo._deserialize(params.get("WhiteListDetailInfo")) self.RequestId = params.get("RequestId") class DescribeReverseShellWhiteListsRequest(AbstractModel): """DescribeReverseShellWhiteLists请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeReverseShellWhiteListsResponse(AbstractModel): """DescribeReverseShellWhiteLists返回参数结构体 """ def __init__(self): r""" :param TotalCount: 事件总数量 :type TotalCount: int :param WhiteListSet: 白名单信息列表 :type WhiteListSet: list of ReverseShellWhiteListBaseInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.WhiteListSet = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("WhiteListSet") is not None: self.WhiteListSet = [] for item in params.get("WhiteListSet"): obj = ReverseShellWhiteListBaseInfo() obj._deserialize(item) self.WhiteListSet.append(obj) self.RequestId = params.get("RequestId") class DescribeRiskListRequest(AbstractModel): """DescribeRiskList请求参数结构体 """ def __init__(self): r""" :param ClusterId: 要查询的集群ID,如果不指定,则查询用户所有的风险项 :type ClusterId: str :param Offset: 偏移量 :type Offset: int :param Limit: 每次查询的最大记录数量 :type Limit: int :param Filters: Name - String Name 可取值:RiskLevel风险等级, RiskTarget检查对象,风险对象,RiskType风险类别,RiskAttribute检测项所属的风险类型,Name :type Filters: list of ComplianceFilters :param By: 排序字段 :type By: str :param Order: 排序方式 asc,desc :type Order: str """ self.ClusterId = None self.Offset = None self.Limit = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.ClusterId = params.get("ClusterId") self.Offset = params.get("Offset") self.Limit = params.get("Limit") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = ComplianceFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeRiskListResponse(AbstractModel): """DescribeRiskList返回参数结构体 """ def __init__(self): r""" :param ClusterRiskItems: 风险详情数组 :type ClusterRiskItems: list of ClusterRiskItem :param TotalCount: 风险项的总数 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ClusterRiskItems = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("ClusterRiskItems") is not None: self.ClusterRiskItems = [] for item in params.get("ClusterRiskItems"): obj = ClusterRiskItem() obj._deserialize(item) self.ClusterRiskItems.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeRiskSyscallDetailRequest(AbstractModel): """DescribeRiskSyscallDetail请求参数结构体 """ def __init__(self): r""" :param EventId: 事件唯一id :type EventId: str """ self.EventId = None def _deserialize(self, params): self.EventId = params.get("EventId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeRiskSyscallDetailResponse(AbstractModel): """DescribeRiskSyscallDetail返回参数结构体 """ def __init__(self): r""" :param EventBaseInfo: 事件基本信息 :type EventBaseInfo: :class:`tencentcloud.tcss.v20201101.models.RunTimeEventBaseInfo` :param ProcessInfo: 进程信息 :type ProcessInfo: :class:`tencentcloud.tcss.v20201101.models.ProcessDetailInfo` :param ParentProcessInfo: 父进程信息 :type ParentProcessInfo: :class:`tencentcloud.tcss.v20201101.models.ProcessDetailBaseInfo` :param EventDetail: 事件描述 :type EventDetail: :class:`tencentcloud.tcss.v20201101.models.RiskSyscallEventDescription` :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.EventBaseInfo = None self.ProcessInfo = None self.ParentProcessInfo = None self.EventDetail = None self.RequestId = None def _deserialize(self, params): if params.get("EventBaseInfo") is not None: self.EventBaseInfo = RunTimeEventBaseInfo() self.EventBaseInfo._deserialize(params.get("EventBaseInfo")) if params.get("ProcessInfo") is not None: self.ProcessInfo = ProcessDetailInfo() self.ProcessInfo._deserialize(params.get("ProcessInfo")) if params.get("ParentProcessInfo") is not None: self.ParentProcessInfo = ProcessDetailBaseInfo() self.ParentProcessInfo._deserialize(params.get("ParentProcessInfo")) if params.get("EventDetail") is not None: self.EventDetail = RiskSyscallEventDescription() self.EventDetail._deserialize(params.get("EventDetail")) self.RequestId = params.get("RequestId") class DescribeRiskSyscallEventsExportRequest(AbstractModel): """DescribeRiskSyscallEventsExport请求参数结构体 """ def __init__(self): r""" :param ExportField: 导出字段 :type ExportField: list of str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.ExportField = None self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.ExportField = params.get("ExportField") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeRiskSyscallEventsExportResponse(AbstractModel): """DescribeRiskSyscallEventsExport返回参数结构体 """ def __init__(self): r""" :param DownloadUrl: Excel下载地址 注意:此字段可能返回 null,表示取不到有效值。 :type DownloadUrl: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.DownloadUrl = None self.RequestId = None def _deserialize(self, params): self.DownloadUrl = params.get("DownloadUrl") self.RequestId = params.get("RequestId") class DescribeRiskSyscallEventsRequest(AbstractModel): """DescribeRiskSyscallEvents请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeRiskSyscallEventsResponse(AbstractModel): """DescribeRiskSyscallEvents返回参数结构体 """ def __init__(self): r""" :param TotalCount: 事件总数量 :type TotalCount: int :param EventSet: 高危系统调用数组 :type EventSet: list of RiskSyscallEventInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.EventSet = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("EventSet") is not None: self.EventSet = [] for item in params.get("EventSet"): obj = RiskSyscallEventInfo() obj._deserialize(item) self.EventSet.append(obj) self.RequestId = params.get("RequestId") class DescribeRiskSyscallNamesRequest(AbstractModel): """DescribeRiskSyscallNames请求参数结构体 """ class DescribeRiskSyscallNamesResponse(AbstractModel): """DescribeRiskSyscallNames返回参数结构体 """ def __init__(self): r""" :param TotalCount: 事件总数量 :type TotalCount: int :param SyscallNames: 系统调用名称列表 :type SyscallNames: list of str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.SyscallNames = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") self.SyscallNames = params.get("SyscallNames") self.RequestId = params.get("RequestId") class DescribeRiskSyscallWhiteListDetailRequest(AbstractModel): """DescribeRiskSyscallWhiteListDetail请求参数结构体 """ def __init__(self): r""" :param WhiteListId: 白名单id :type WhiteListId: str """ self.WhiteListId = None def _deserialize(self, params): self.WhiteListId = params.get("WhiteListId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeRiskSyscallWhiteListDetailResponse(AbstractModel): """DescribeRiskSyscallWhiteListDetail返回参数结构体 """ def __init__(self): r""" :param WhiteListDetailInfo: 白名单基本信息 :type WhiteListDetailInfo: :class:`tencentcloud.tcss.v20201101.models.RiskSyscallWhiteListInfo` :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.WhiteListDetailInfo = None self.RequestId = None def _deserialize(self, params): if params.get("WhiteListDetailInfo") is not None: self.WhiteListDetailInfo = RiskSyscallWhiteListInfo() self.WhiteListDetailInfo._deserialize(params.get("WhiteListDetailInfo")) self.RequestId = params.get("RequestId") class DescribeRiskSyscallWhiteListsRequest(AbstractModel): """DescribeRiskSyscallWhiteLists请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤参数,"Filters":[{"Name":"Status","Values":["2"]}] :type Filters: list of RunTimeFilters :param Order: 升序降序,asc desc :type Order: str :param By: 排序字段 :type By: str """ self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeRiskSyscallWhiteListsResponse(AbstractModel): """DescribeRiskSyscallWhiteLists返回参数结构体 """ def __init__(self): r""" :param TotalCount: 事件总数量 :type TotalCount: int :param WhiteListSet: 白名单信息列表 :type WhiteListSet: list of RiskSyscallWhiteListBaseInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.WhiteListSet = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("WhiteListSet") is not None: self.WhiteListSet = [] for item in params.get("WhiteListSet"): obj = RiskSyscallWhiteListBaseInfo() obj._deserialize(item) self.WhiteListSet.append(obj) self.RequestId = params.get("RequestId") class DescribeSecEventsTendencyRequest(AbstractModel): """DescribeSecEventsTendency请求参数结构体 """ def __init__(self): r""" :param StartTime: 开始时间 :type StartTime: str :param EndTime: 结束时间 :type EndTime: str """ self.StartTime = None self.EndTime = None def _deserialize(self, params): self.StartTime = params.get("StartTime") self.EndTime = params.get("EndTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeSecEventsTendencyResponse(AbstractModel): """DescribeSecEventsTendency返回参数结构体 """ def __init__(self): r""" :param EventTendencySet: 运行时安全事件趋势信息列表 :type EventTendencySet: list of SecTendencyEventInfo :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.EventTendencySet = None self.RequestId = None def _deserialize(self, params): if params.get("EventTendencySet") is not None: self.EventTendencySet = [] for item in params.get("EventTendencySet"): obj = SecTendencyEventInfo() obj._deserialize(item) self.EventTendencySet.append(obj) self.RequestId = params.get("RequestId") class DescribeTaskResultSummaryRequest(AbstractModel): """DescribeTaskResultSummary请求参数结构体 """ class DescribeTaskResultSummaryResponse(AbstractModel): """DescribeTaskResultSummary返回参数结构体 """ def __init__(self): r""" :param SeriousRiskNodeCount: 严重风险影响的节点数量,返回7天数据 :type SeriousRiskNodeCount: list of int non-negative :param HighRiskNodeCount: 高风险影响的节点的数量,返回7天数据 :type HighRiskNodeCount: list of int non-negative :param MiddleRiskNodeCount: 中风险检查项的节点数量,返回7天数据 :type MiddleRiskNodeCount: list of int non-negative :param HintRiskNodeCount: 提示风险检查项的节点数量,返回7天数据 :type HintRiskNodeCount: list of int non-negative :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.SeriousRiskNodeCount = None self.HighRiskNodeCount = None self.MiddleRiskNodeCount = None self.HintRiskNodeCount = None self.RequestId = None def _deserialize(self, params): self.SeriousRiskNodeCount = params.get("SeriousRiskNodeCount") self.HighRiskNodeCount = params.get("HighRiskNodeCount") self.MiddleRiskNodeCount = params.get("MiddleRiskNodeCount") self.HintRiskNodeCount = params.get("HintRiskNodeCount") self.RequestId = params.get("RequestId") class DescribeUnfinishRefreshTaskRequest(AbstractModel): """DescribeUnfinishRefreshTask请求参数结构体 """ class DescribeUnfinishRefreshTaskResponse(AbstractModel): """DescribeUnfinishRefreshTask返回参数结构体 """ def __init__(self): r""" :param TaskId: 返回最近的一次任务ID :type TaskId: int :param TaskStatus: 任务状态,为Task_New,Task_Running,Task_Finish,Task_Error,Task_NoExist.Task_New,Task_Running表示有任务存在,不允许新下发 :type TaskStatus: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskId = None self.TaskStatus = None self.RequestId = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.TaskStatus = params.get("TaskStatus") self.RequestId = params.get("RequestId") class DescribeUserClusterRequest(AbstractModel): """DescribeUserCluster请求参数结构体 """ def __init__(self): r""" :param Offset: 偏移量 :type Offset: int :param Limit: 每次查询的最大记录数量 :type Limit: int :param Filters: Name - String Name 可取值:ClusterName,ClusterId,ClusterType,Region,ClusterCheckMode,ClusterAutoCheck :type Filters: list of ComplianceFilters :param By: 排序字段 :type By: str :param Order: 排序方式 asc,desc :type Order: str """ self.Offset = None self.Limit = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.Offset = params.get("Offset") self.Limit = params.get("Limit") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = ComplianceFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeUserClusterResponse(AbstractModel): """DescribeUserCluster返回参数结构体 """ def __init__(self): r""" :param TotalCount: 集群总数 :type TotalCount: int :param ClusterInfoList: 集群的详细信息 :type ClusterInfoList: list of ClusterInfoItem :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TotalCount = None self.ClusterInfoList = None self.RequestId = None def _deserialize(self, params): self.TotalCount = params.get("TotalCount") if params.get("ClusterInfoList") is not None: self.ClusterInfoList = [] for item in params.get("ClusterInfoList"): obj = ClusterInfoItem() obj._deserialize(item) self.ClusterInfoList.append(obj) self.RequestId = params.get("RequestId") class DescribeValueAddedSrvInfoRequest(AbstractModel): """DescribeValueAddedSrvInfo请求参数结构体 """ class DescribeValueAddedSrvInfoResponse(AbstractModel): """DescribeValueAddedSrvInfo返回参数结构体 """ def __init__(self): r""" :param RegistryImageCnt: 仓库镜像未授权数量 :type RegistryImageCnt: int :param LocalImageCnt: 本地镜像未授权数量 :type LocalImageCnt: int :param UnusedAuthorizedCnt: 未使用的镜像安全扫描授权数 :type UnusedAuthorizedCnt: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RegistryImageCnt = None self.LocalImageCnt = None self.UnusedAuthorizedCnt = None self.RequestId = None def _deserialize(self, params): self.RegistryImageCnt = params.get("RegistryImageCnt") self.LocalImageCnt = params.get("LocalImageCnt") self.UnusedAuthorizedCnt = params.get("UnusedAuthorizedCnt") self.RequestId = params.get("RequestId") class DescribeVirusDetailRequest(AbstractModel): """DescribeVirusDetail请求参数结构体 """ def __init__(self): r""" :param Id: 木马文件id :type Id: str """ self.Id = None def _deserialize(self, params): self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeVirusDetailResponse(AbstractModel): """DescribeVirusDetail返回参数结构体 """ def __init__(self): r""" :param ImageId: 镜像ID 注意:此字段可能返回 null,表示取不到有效值。 :type ImageId: str :param ImageName: 镜像名称 注意:此字段可能返回 null,表示取不到有效值。 :type ImageName: str :param CreateTime: 创建时间 注意:此字段可能返回 null,表示取不到有效值。 :type CreateTime: str :param Size: 木马文件大小 注意:此字段可能返回 null,表示取不到有效值。 :type Size: int :param FilePath: 木马文件路径 注意:此字段可能返回 null,表示取不到有效值。 :type FilePath: str :param ModifyTime: 最近生成时间 注意:此字段可能返回 null,表示取不到有效值。 :type ModifyTime: str :param VirusName: 病毒名称 注意:此字段可能返回 null,表示取不到有效值。 :type VirusName: str :param RiskLevel: 风险等级 RISK_CRITICAL, RISK_HIGH, RISK_MEDIUM, RISK_LOW, RISK_NOTICE。 注意:此字段可能返回 null,表示取不到有效值。 :type RiskLevel: str :param ContainerName: 容器名称 注意:此字段可能返回 null,表示取不到有效值。 :type ContainerName: str :param ContainerId: 容器id 注意:此字段可能返回 null,表示取不到有效值。 :type ContainerId: str :param HostName: 主机名称 注意:此字段可能返回 null,表示取不到有效值。 :type HostName: str :param HostId: 主机id 注意:此字段可能返回 null,表示取不到有效值。 :type HostId: str :param ProcessName: 进程名称 注意:此字段可能返回 null,表示取不到有效值。 :type ProcessName: str :param ProcessPath: 进程路径 注意:此字段可能返回 null,表示取不到有效值。 :type ProcessPath: str :param ProcessMd5: 进程md5 注意:此字段可能返回 null,表示取不到有效值。 :type ProcessMd5: str :param ProcessId: 进程id 注意:此字段可能返回 null,表示取不到有效值。 :type ProcessId: int :param ProcessArgv: 进程参数 注意:此字段可能返回 null,表示取不到有效值。 :type ProcessArgv: str :param ProcessChan: 进程链 注意:此字段可能返回 null,表示取不到有效值。 :type ProcessChan: str :param ProcessAccountGroup: 进程组 注意:此字段可能返回 null,表示取不到有效值。 :type ProcessAccountGroup: str :param ProcessStartAccount: 进程启动用户 注意:此字段可能返回 null,表示取不到有效值。 :type ProcessStartAccount: str :param ProcessFileAuthority: 进程文件权限 注意:此字段可能返回 null,表示取不到有效值。 :type ProcessFileAuthority: str :param SourceType: 来源:0:一键扫描, 1:定时扫描 2:实时监控 注意:此字段可能返回 null,表示取不到有效值。 :type SourceType: int :param PodName: 集群名称 注意:此字段可能返回 null,表示取不到有效值。 :type PodName: str :param Tags: 标签 注意:此字段可能返回 null,表示取不到有效值。 :type Tags: list of str :param HarmDescribe: 事件描述 注意:此字段可能返回 null,表示取不到有效值。 :type HarmDescribe: str :param SuggestScheme: 建议方案 注意:此字段可能返回 null,表示取不到有效值。 :type SuggestScheme: str :param Mark: 备注 注意:此字段可能返回 null,表示取不到有效值。 :type Mark: str :param FileName: 风险文件名称 注意:此字段可能返回 null,表示取不到有效值。 :type FileName: str :param FileMd5: 文件MD5 注意:此字段可能返回 null,表示取不到有效值。 :type FileMd5: str :param EventType: 事件类型 注意:此字段可能返回 null,表示取不到有效值。 :type EventType: str :param Status: DEAL_NONE:文件待处理 DEAL_IGNORE:已经忽略 DEAL_ADD_WHITELIST:加白 DEAL_DEL:文件已经删除 DEAL_ISOLATE:已经隔离 DEAL_ISOLATING:隔离中 DEAL_ISOLATE_FAILED:隔离失败 DEAL_RECOVERING:恢复中 DEAL_RECOVER_FAILED: 恢复失败 注意:此字段可能返回 null,表示取不到有效值。 :type Status: str :param SubStatus: 失败子状态: FILE_NOT_FOUND:文件不存在 FILE_ABNORMAL:文件异常 FILE_ABNORMAL_DEAL_RECOVER:恢复文件时,文件异常 BACKUP_FILE_NOT_FOUND:备份文件不存在 CONTAINER_NOT_FOUND_DEAL_ISOLATE:隔离时,容器不存在 CONTAINER_NOT_FOUND_DEAL_RECOVER:恢复时,容器不存在 注意:此字段可能返回 null,表示取不到有效值。 :type SubStatus: str :param HostIP: 内网ip 注意:此字段可能返回 null,表示取不到有效值。 :type HostIP: str :param ClientIP: 外网ip 注意:此字段可能返回 null,表示取不到有效值。 :type ClientIP: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ImageId = None self.ImageName = None self.CreateTime = None self.Size = None self.FilePath = None self.ModifyTime = None self.VirusName = None self.RiskLevel = None self.ContainerName = None self.ContainerId = None self.HostName = None self.HostId = None self.ProcessName = None self.ProcessPath = None self.ProcessMd5 = None self.ProcessId = None self.ProcessArgv = None self.ProcessChan = None self.ProcessAccountGroup = None self.ProcessStartAccount = None self.ProcessFileAuthority = None self.SourceType = None self.PodName = None self.Tags = None self.HarmDescribe = None self.SuggestScheme = None self.Mark = None self.FileName = None self.FileMd5 = None self.EventType = None self.Status = None self.SubStatus = None self.HostIP = None self.ClientIP = None self.RequestId = None def _deserialize(self, params): self.ImageId = params.get("ImageId") self.ImageName = params.get("ImageName") self.CreateTime = params.get("CreateTime") self.Size = params.get("Size") self.FilePath = params.get("FilePath") self.ModifyTime = params.get("ModifyTime") self.VirusName = params.get("VirusName") self.RiskLevel = params.get("RiskLevel") self.ContainerName = params.get("ContainerName") self.ContainerId = params.get("ContainerId") self.HostName = params.get("HostName") self.HostId = params.get("HostId") self.ProcessName = params.get("ProcessName") self.ProcessPath = params.get("ProcessPath") self.ProcessMd5 = params.get("ProcessMd5") self.ProcessId = params.get("ProcessId") self.ProcessArgv = params.get("ProcessArgv") self.ProcessChan = params.get("ProcessChan") self.ProcessAccountGroup = params.get("ProcessAccountGroup") self.ProcessStartAccount = params.get("ProcessStartAccount") self.ProcessFileAuthority = params.get("ProcessFileAuthority") self.SourceType = params.get("SourceType") self.PodName = params.get("PodName") self.Tags = params.get("Tags") self.HarmDescribe = params.get("HarmDescribe") self.SuggestScheme = params.get("SuggestScheme") self.Mark = params.get("Mark") self.FileName = params.get("FileName") self.FileMd5 = params.get("FileMd5") self.EventType = params.get("EventType") self.Status = params.get("Status") self.SubStatus = params.get("SubStatus") self.HostIP = params.get("HostIP") self.ClientIP = params.get("ClientIP") self.RequestId = params.get("RequestId") class DescribeVirusListRequest(AbstractModel): """DescribeVirusList请求参数结构体 """ def __init__(self): r""" :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>FileName - String - 是否必填:否 - 文件名称</li> <li>FilePath - String - 是否必填:否 - 文件路径</li> <li>VirusName - String - 是否必填:否 - 病毒名称</li> <li>ContainerName- String - 是否必填:是 - 容器名称</li> <li>ContainerId- string - 是否必填:否 - 容器id</li> <li>ImageName- string - 是否必填:否 - 镜像名称</li> <li>ImageId- string - 是否必填:否 - 镜像id</li> <li>IsRealTime- int - 是否必填:否 - 过滤是否实时监控数据</li> <li>TaskId- string - 是否必填:否 - 任务ID</li> :type Filters: list of RunTimeFilters :param Order: 排序方式 :type Order: str :param By: 排序字段 :type By: str """ self.Limit = None self.Offset = None self.Filters = None self.Order = None self.By = None def _deserialize(self, params): self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeVirusListResponse(AbstractModel): """DescribeVirusList返回参数结构体 """ def __init__(self): r""" :param List: 木马列表 :type List: list of VirusInfo :param TotalCount: 总数量 :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = VirusInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeVirusMonitorSettingRequest(AbstractModel): """DescribeVirusMonitorSetting请求参数结构体 """ class DescribeVirusMonitorSettingResponse(AbstractModel): """DescribeVirusMonitorSetting返回参数结构体 """ def __init__(self): r""" :param EnableScan: 是否开启实时监控 :type EnableScan: bool :param ScanPathAll: 扫描全部路径 注意:此字段可能返回 null,表示取不到有效值。 :type ScanPathAll: bool :param ScanPathType: 当ScanPathAll为true 生效 0扫描以下路径 1、扫描除以下路径 注意:此字段可能返回 null,表示取不到有效值。 :type ScanPathType: int :param ScanPath: 自选排除或扫描的地址 注意:此字段可能返回 null,表示取不到有效值。 :type ScanPath: list of str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.EnableScan = None self.ScanPathAll = None self.ScanPathType = None self.ScanPath = None self.RequestId = None def _deserialize(self, params): self.EnableScan = params.get("EnableScan") self.ScanPathAll = params.get("ScanPathAll") self.ScanPathType = params.get("ScanPathType") self.ScanPath = params.get("ScanPath") self.RequestId = params.get("RequestId") class DescribeVirusScanSettingRequest(AbstractModel): """DescribeVirusScanSetting请求参数结构体 """ class DescribeVirusScanSettingResponse(AbstractModel): """DescribeVirusScanSetting返回参数结构体 """ def __init__(self): r""" :param EnableScan: 是否开启定期扫描 :type EnableScan: bool :param Cycle: 检测周期每隔多少天 :type Cycle: int :param BeginScanAt: 扫描开始时间 :type BeginScanAt: str :param ScanPathAll: 扫描全部路径 :type ScanPathAll: bool :param ScanPathType: 当ScanPathAll为true 生效 0扫描以下路径 1、扫描除以下路径 :type ScanPathType: int :param Timeout: 超时时长,单位小时 :type Timeout: int :param ScanRangeType: 扫描范围0容器1主机节点 :type ScanRangeType: int :param ScanRangeAll: true 全选,false 自选 :type ScanRangeAll: bool :param ScanIds: 自选扫描范围的容器id或者主机id 根据ScanRangeType决定 :type ScanIds: list of str :param ScanPath: 自选排除或扫描的地址 :type ScanPath: list of str :param ClickTimeout: 一键检测的超时设置 注意:此字段可能返回 null,表示取不到有效值。 :type ClickTimeout: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.EnableScan = None self.Cycle = None self.BeginScanAt = None self.ScanPathAll = None self.ScanPathType = None self.Timeout = None self.ScanRangeType = None self.ScanRangeAll = None self.ScanIds = None self.ScanPath = None self.ClickTimeout = None self.RequestId = None def _deserialize(self, params): self.EnableScan = params.get("EnableScan") self.Cycle = params.get("Cycle") self.BeginScanAt = params.get("BeginScanAt") self.ScanPathAll = params.get("ScanPathAll") self.ScanPathType = params.get("ScanPathType") self.Timeout = params.get("Timeout") self.ScanRangeType = params.get("ScanRangeType") self.ScanRangeAll = params.get("ScanRangeAll") self.ScanIds = params.get("ScanIds") self.ScanPath = params.get("ScanPath") self.ClickTimeout = params.get("ClickTimeout") self.RequestId = params.get("RequestId") class DescribeVirusScanTaskStatusRequest(AbstractModel): """DescribeVirusScanTaskStatus请求参数结构体 """ def __init__(self): r""" :param TaskID: 任务id :type TaskID: str """ self.TaskID = None def _deserialize(self, params): self.TaskID = params.get("TaskID") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeVirusScanTaskStatusResponse(AbstractModel): """DescribeVirusScanTaskStatus返回参数结构体 """ def __init__(self): r""" :param ContainerTotal: 查杀容器个数 :type ContainerTotal: int :param RiskContainerCnt: 风险容器个数 :type RiskContainerCnt: int :param Status: 扫描状态 任务状态: SCAN_NONE:无, SCAN_SCANNING:正在扫描中, SCAN_FINISH:扫描完成, SCAN_TIMEOUT:扫描超时 SCAN_CANCELING: 取消中 SCAN_CANCELED:已取消 :type Status: str :param Schedule: 扫描进度 I :type Schedule: int :param ContainerScanCnt: 已经扫描了的容器个数 :type ContainerScanCnt: int :param RiskCnt: 风险个数 :type RiskCnt: int :param LeftSeconds: 剩余扫描时间 :type LeftSeconds: int :param StartTime: 扫描开始时间 :type StartTime: str :param EndTime: 扫描结束时间 :type EndTime: str :param ScanType: 扫描类型,"CYCLE":周期扫描, "MANUAL":手动扫描 :type ScanType: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.ContainerTotal = None self.RiskContainerCnt = None self.Status = None self.Schedule = None self.ContainerScanCnt = None self.RiskCnt = None self.LeftSeconds = None self.StartTime = None self.EndTime = None self.ScanType = None self.RequestId = None def _deserialize(self, params): self.ContainerTotal = params.get("ContainerTotal") self.RiskContainerCnt = params.get("RiskContainerCnt") self.Status = params.get("Status") self.Schedule = params.get("Schedule") self.ContainerScanCnt = params.get("ContainerScanCnt") self.RiskCnt = params.get("RiskCnt") self.LeftSeconds = params.get("LeftSeconds") self.StartTime = params.get("StartTime") self.EndTime = params.get("EndTime") self.ScanType = params.get("ScanType") self.RequestId = params.get("RequestId") class DescribeVirusScanTimeoutSettingRequest(AbstractModel): """DescribeVirusScanTimeoutSetting请求参数结构体 """ def __init__(self): r""" :param ScanType: 设置类型0一键检测,1定时检测 :type ScanType: int """ self.ScanType = None def _deserialize(self, params): self.ScanType = params.get("ScanType") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeVirusScanTimeoutSettingResponse(AbstractModel): """DescribeVirusScanTimeoutSetting返回参数结构体 """ def __init__(self): r""" :param Timeout: 超时时长单位小时 注意:此字段可能返回 null,表示取不到有效值。 :type Timeout: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.Timeout = None self.RequestId = None def _deserialize(self, params): self.Timeout = params.get("Timeout") self.RequestId = params.get("RequestId") class DescribeVirusSummaryRequest(AbstractModel): """DescribeVirusSummary请求参数结构体 """ class DescribeVirusSummaryResponse(AbstractModel): """DescribeVirusSummary返回参数结构体 """ def __init__(self): r""" :param TaskId: 最近的一次扫描任务id :type TaskId: str :param RiskContainerCnt: 木马影响容器个数 注意:此字段可能返回 null,表示取不到有效值。 :type RiskContainerCnt: int :param RiskCnt: 待处理风险个数 注意:此字段可能返回 null,表示取不到有效值。 :type RiskCnt: int :param VirusDataBaseModifyTime: 病毒库更新时间 注意:此字段可能返回 null,表示取不到有效值。 :type VirusDataBaseModifyTime: str :param RiskContainerIncrease: 木马影响容器个数较昨日增长 注意:此字段可能返回 null,表示取不到有效值。 :type RiskContainerIncrease: int :param RiskIncrease: 待处理风险个数较昨日增长 注意:此字段可能返回 null,表示取不到有效值。 :type RiskIncrease: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskId = None self.RiskContainerCnt = None self.RiskCnt = None self.VirusDataBaseModifyTime = None self.RiskContainerIncrease = None self.RiskIncrease = None self.RequestId = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.RiskContainerCnt = params.get("RiskContainerCnt") self.RiskCnt = params.get("RiskCnt") self.VirusDataBaseModifyTime = params.get("VirusDataBaseModifyTime") self.RiskContainerIncrease = params.get("RiskContainerIncrease") self.RiskIncrease = params.get("RiskIncrease") self.RequestId = params.get("RequestId") class DescribeVirusTaskListRequest(AbstractModel): """DescribeVirusTaskList请求参数结构体 """ def __init__(self): r""" :param TaskId: 任务id :type TaskId: str :param Limit: 需要返回的数量,默认为10,最大值为100 :type Limit: int :param Offset: 偏移量,默认为0。 :type Offset: int :param Filters: 过滤条件。 <li>ContainerName - String - 是否必填:否 - 容器名称</li> <li>ContainerId - String - 是否必填:否 - 容器id</li> <li>Hostname - String - 是否必填:否 - 主机名称</li> <li>HostIp- String - 是否必填:是 - 容器名称</li> :type Filters: list of RunTimeFilters :param By: 排序字段 :type By: str :param Order: 排序方式 :type Order: str """ self.TaskId = None self.Limit = None self.Offset = None self.Filters = None self.By = None self.Order = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.Limit = params.get("Limit") self.Offset = params.get("Offset") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.By = params.get("By") self.Order = params.get("Order") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class DescribeVirusTaskListResponse(AbstractModel): """DescribeVirusTaskList返回参数结构体 """ def __init__(self): r""" :param List: 文件查杀列表 :type List: list of VirusTaskInfo :param TotalCount: 总数量(容器任务数量) :type TotalCount: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.List = None self.TotalCount = None self.RequestId = None def _deserialize(self, params): if params.get("List") is not None: self.List = [] for item in params.get("List"): obj = VirusTaskInfo() obj._deserialize(item) self.List.append(obj) self.TotalCount = params.get("TotalCount") self.RequestId = params.get("RequestId") class DescribeWarningRulesRequest(AbstractModel): """DescribeWarningRules请求参数结构体 """ class DescribeWarningRulesResponse(AbstractModel): """DescribeWarningRules返回参数结构体 """ def __init__(self): r""" :param WarningRules: 告警策略列表 :type WarningRules: list of WarningRule :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.WarningRules = None self.RequestId = None def _deserialize(self, params): if params.get("WarningRules") is not None: self.WarningRules = [] for item in params.get("WarningRules"): obj = WarningRule() obj._deserialize(item) self.WarningRules.append(obj) self.RequestId = params.get("RequestId") class EscapeEventDescription(AbstractModel): """运行时容器逃逸事件描述信息 """ def __init__(self): r""" :param Description: 事件规则 :type Description: str :param Solution: 解决方案 :type Solution: str :param Remark: 事件备注信息 注意:此字段可能返回 null,表示取不到有效值。 :type Remark: str """ self.Description = None self.Solution = None self.Remark = None def _deserialize(self, params): self.Description = params.get("Description") self.Solution = params.get("Solution") self.Remark = params.get("Remark") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class EscapeEventInfo(AbstractModel): """容器逃逸事件列表 """ def __init__(self): r""" :param EventType: 事件类型 ESCAPE_HOST_ACESS_FILE:宿主机文件访问逃逸 ESCAPE_MOUNT_NAMESPACE:MountNamespace逃逸 ESCAPE_PRIVILEDGE:程序提权逃逸 ESCAPE_PRIVILEDGE_CONTAINER_START:特权容器启动逃逸 ESCAPE_MOUNT_SENSITIVE_PTAH:敏感路径挂载 ESCAPE_SYSCALL:Syscall逃逸 :type EventType: str :param ContainerName: 容器名 :type ContainerName: str :param ImageName: 镜像名 :type ImageName: str :param Status: 状态 EVENT_UNDEAL:事件未处理 EVENT_DEALED:事件已经处理 EVENT_INGNORE:事件忽略 :type Status: str :param EventId: 事件记录的唯一id :type EventId: str :param NodeName: 节点名称 :type NodeName: str :param PodName: pod(实例)的名字 :type PodName: str :param FoundTime: 生成时间 :type FoundTime: str :param EventName: 事件名字, 宿主机文件访问逃逸、 Syscall逃逸、 MountNamespace逃逸、 程序提权逃逸、 特权容器启动逃逸、 敏感路径挂载 :type EventName: str :param ImageId: 镜像id,用于跳转 :type ImageId: str :param ContainerId: 容器id,用于跳转 :type ContainerId: str :param Solution: 事件解决方案 :type Solution: str :param Description: 事件描述 :type Description: str :param EventCount: 事件数量 :type EventCount: int :param LatestFoundTime: 最近生成时间 :type LatestFoundTime: str """ self.EventType = None self.ContainerName = None self.ImageName = None self.Status = None self.EventId = None self.NodeName = None self.PodName = None self.FoundTime = None self.EventName = None self.ImageId = None self.ContainerId = None self.Solution = None self.Description = None self.EventCount = None self.LatestFoundTime = None def _deserialize(self, params): self.EventType = params.get("EventType") self.ContainerName = params.get("ContainerName") self.ImageName = params.get("ImageName") self.Status = params.get("Status") self.EventId = params.get("EventId") self.NodeName = params.get("NodeName") self.PodName = params.get("PodName") self.FoundTime = params.get("FoundTime") self.EventName = params.get("EventName") self.ImageId = params.get("ImageId") self.ContainerId = params.get("ContainerId") self.Solution = params.get("Solution") self.Description = params.get("Description") self.EventCount = params.get("EventCount") self.LatestFoundTime = params.get("LatestFoundTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class EscapeRule(AbstractModel): """容器逃逸扫描策略开关信息 """ def __init__(self): r""" :param Type: 规则类型 ESCAPE_HOST_ACESS_FILE:宿主机文件访问逃逸 ESCAPE_MOUNT_NAMESPACE:MountNamespace逃逸 ESCAPE_PRIVILEDGE:程序提权逃逸 ESCAPE_PRIVILEDGE_CONTAINER_START:特权容器启动逃逸 ESCAPE_MOUNT_SENSITIVE_PTAH:敏感路径挂载 ESCAPE_SYSCALL:Syscall逃逸 :type Type: str :param Name: 规则名称 宿主机文件访问逃逸、 Syscall逃逸、 MountNamespace逃逸、 程序提权逃逸、 特权容器启动逃逸、 敏感路径挂载 :type Name: str :param IsEnable: 是否打开:false否 ,true是 :type IsEnable: bool """ self.Type = None self.Name = None self.IsEnable = None def _deserialize(self, params): self.Type = params.get("Type") self.Name = params.get("Name") self.IsEnable = params.get("IsEnable") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class EscapeRuleEnabled(AbstractModel): """修改容器逃逸扫描策略开关信息 """ def __init__(self): r""" :param Type: 规则类型 ESCAPE_HOST_ACESS_FILE:宿主机文件访问逃逸 ESCAPE_MOUNT_NAMESPACE:MountNamespace逃逸 ESCAPE_PRIVILEDGE:程序提权逃逸 ESCAPE_PRIVILEDGE_CONTAINER_START:特权容器启动逃逸 ESCAPE_MOUNT_SENSITIVE_PTAH:敏感路径挂载 ESCAPE_SYSCALL:Syscall逃逸 :type Type: str :param IsEnable: 是否打开:false否 ,true是 :type IsEnable: bool """ self.Type = None self.IsEnable = None def _deserialize(self, params): self.Type = params.get("Type") self.IsEnable = params.get("IsEnable") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ExportVirusListRequest(AbstractModel): """ExportVirusList请求参数结构体 """ def __init__(self): r""" :param Filters: 过滤条件。 <li>FileName - String - 是否必填:否 - 文件名称</li> <li>FilePath - String - 是否必填:否 - 文件路径</li> <li>VirusName - String - 是否必填:否 - 病毒名称</li> <li>ContainerName- String - 是否必填:是 - 容器名称</li> <li>ContainerId- string - 是否必填:否 - 容器id</li> <li>ImageName- string - 是否必填:否 - 镜像名称</li> <li>ImageId- string - 是否必填:否 - 镜像id</li> :type Filters: list of RunTimeFilters :param Order: 排序方式 :type Order: str :param By: 排序字段 :type By: str :param ExportField: 导出字段 :type ExportField: list of str """ self.Filters = None self.Order = None self.By = None self.ExportField = None def _deserialize(self, params): if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = RunTimeFilters() obj._deserialize(item) self.Filters.append(obj) self.Order = params.get("Order") self.By = params.get("By") self.ExportField = params.get("ExportField") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ExportVirusListResponse(AbstractModel): """ExportVirusList返回参数结构体 """ def __init__(self): r""" :param JobId: 导出任务ID,前端拿着任务ID查询任务进度 :type JobId: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.JobId = None self.RequestId = None def _deserialize(self, params): self.JobId = params.get("JobId") self.RequestId = params.get("RequestId") class FileAttributeInfo(AbstractModel): """容器安全运行时,文件属性信息 """ def __init__(self): r""" :param FileName: 文件名 :type FileName: str :param FileType: 文件类型 :type FileType: str :param FileSize: 文件大小(字节) :type FileSize: int :param FilePath: 文件路径 :type FilePath: str :param FileCreateTime: 文件创建时间 :type FileCreateTime: str :param LatestTamperedFileMTime: 最近被篡改文件创建时间 :type LatestTamperedFileMTime: str """ self.FileName = None self.FileType = None self.FileSize = None self.FilePath = None self.FileCreateTime = None self.LatestTamperedFileMTime = None def _deserialize(self, params): self.FileName = params.get("FileName") self.FileType = params.get("FileType") self.FileSize = params.get("FileSize") self.FilePath = params.get("FilePath") self.FileCreateTime = params.get("FileCreateTime") self.LatestTamperedFileMTime = params.get("LatestTamperedFileMTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class HostInfo(AbstractModel): """容器安全主机列表 """ def __init__(self): r""" :param HostID: 主机id :type HostID: str :param HostIP: 主机ip即内网ip :type HostIP: str :param HostName: 主机名称 :type HostName: str :param Group: 业务组 :type Group: str :param DockerVersion: docker 版本 :type DockerVersion: str :param DockerFileSystemDriver: docker 文件系统类型 :type DockerFileSystemDriver: str :param ImageCnt: 镜像个数 :type ImageCnt: int :param ContainerCnt: 容器个数 :type ContainerCnt: int :param Status: agent运行状态 :type Status: str :param IsContainerd: 是否是Containerd :type IsContainerd: bool :param MachineType: 主机来源:["CVM", "ECM", "LH", "BM"] 中的之一为腾讯云服务器;["Other"]之一非腾讯云服务器; :type MachineType: str :param PublicIp: 外网ip :type PublicIp: str :param Uuid: 主机uuid :type Uuid: str :param InstanceID: 主机实例ID :type InstanceID: str :param RegionID: 地域ID :type RegionID: int """ self.HostID = None self.HostIP = None self.HostName = None self.Group = None self.DockerVersion = None self.DockerFileSystemDriver = None self.ImageCnt = None self.ContainerCnt = None self.Status = None self.IsContainerd = None self.MachineType = None self.PublicIp = None self.Uuid = None self.InstanceID = None self.RegionID = None def _deserialize(self, params): self.HostID = params.get("HostID") self.HostIP = params.get("HostIP") self.HostName = params.get("HostName") self.Group = params.get("Group") self.DockerVersion = params.get("DockerVersion") self.DockerFileSystemDriver = params.get("DockerFileSystemDriver") self.ImageCnt = params.get("ImageCnt") self.ContainerCnt = params.get("ContainerCnt") self.Status = params.get("Status") self.IsContainerd = params.get("IsContainerd") self.MachineType = params.get("MachineType") self.PublicIp = params.get("PublicIp") self.Uuid = params.get("Uuid") self.InstanceID = params.get("InstanceID") self.RegionID = params.get("RegionID") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImageHost(AbstractModel): """容器安全 主机镜像关联列表 """ def __init__(self): r""" :param ImageID: 镜像id :type ImageID: str :param HostID: 主机id :type HostID: str """ self.ImageID = None self.HostID = None def _deserialize(self, params): self.ImageID = params.get("ImageID") self.HostID = params.get("HostID") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImageInfo(AbstractModel): """基本镜像信息 """ def __init__(self): r""" :param InstanceName: 实例名称 :type InstanceName: str :param Namespace: 命名空间 :type Namespace: str :param ImageName: 镜像名称 :type ImageName: str :param ImageTag: 镜像tag :type ImageTag: str :param Force: 强制扫描 :type Force: str :param ImageDigest: 镜像id :type ImageDigest: str :param RegistryType: 仓库类型 :type RegistryType: str :param ImageRepoAddress: 镜像仓库地址 :type ImageRepoAddress: str :param InstanceId: 实例id :type InstanceId: str """ self.InstanceName = None self.Namespace = None self.ImageName = None self.ImageTag = None self.Force = None self.ImageDigest = None self.RegistryType = None self.ImageRepoAddress = None self.InstanceId = None def _deserialize(self, params): self.InstanceName = params.get("InstanceName") self.Namespace = params.get("Namespace") self.ImageName = params.get("ImageName") self.ImageTag = params.get("ImageTag") self.Force = params.get("Force") self.ImageDigest = params.get("ImageDigest") self.RegistryType = params.get("RegistryType") self.ImageRepoAddress = params.get("ImageRepoAddress") self.InstanceId = params.get("InstanceId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImageProgress(AbstractModel): """基本镜像信息 """ def __init__(self): r""" :param ImageId: 镜像id 注意:此字段可能返回 null,表示取不到有效值。 :type ImageId: str :param RegistryType: 仓库类型 注意:此字段可能返回 null,表示取不到有效值。 :type RegistryType: str :param ImageRepoAddress: 镜像仓库地址 注意:此字段可能返回 null,表示取不到有效值。 :type ImageRepoAddress: str :param InstanceId: 实例id 注意:此字段可能返回 null,表示取不到有效值。 :type InstanceId: str :param InstanceName: 实例名称 注意:此字段可能返回 null,表示取不到有效值。 :type InstanceName: str :param Namespace: 命名空间 注意:此字段可能返回 null,表示取不到有效值。 :type Namespace: str :param ImageName: 仓库名称 注意:此字段可能返回 null,表示取不到有效值。 :type ImageName: str :param ImageTag: 镜像tag 注意:此字段可能返回 null,表示取不到有效值。 :type ImageTag: str :param ScanStatus: 镜像扫描状态 注意:此字段可能返回 null,表示取不到有效值。 :type ScanStatus: str :param CveProgress: 镜像cve扫描进度 注意:此字段可能返回 null,表示取不到有效值。 :type CveProgress: int :param RiskProgress: 镜像敏感扫描进度 注意:此字段可能返回 null,表示取不到有效值。 :type RiskProgress: int :param VirusProgress: 镜像木马扫描进度 注意:此字段可能返回 null,表示取不到有效值。 :type VirusProgress: int """ self.ImageId = None self.RegistryType = None self.ImageRepoAddress = None self.InstanceId = None self.InstanceName = None self.Namespace = None self.ImageName = None self.ImageTag = None self.ScanStatus = None self.CveProgress = None self.RiskProgress = None self.VirusProgress = None def _deserialize(self, params): self.ImageId = params.get("ImageId") self.RegistryType = params.get("RegistryType") self.ImageRepoAddress = params.get("ImageRepoAddress") self.InstanceId = params.get("InstanceId") self.InstanceName = params.get("InstanceName") self.Namespace = params.get("Namespace") self.ImageName = params.get("ImageName") self.ImageTag = params.get("ImageTag") self.ScanStatus = params.get("ScanStatus") self.CveProgress = params.get("CveProgress") self.RiskProgress = params.get("RiskProgress") self.VirusProgress = params.get("VirusProgress") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImageRepoInfo(AbstractModel): """容器安全镜像仓库列表 """ def __init__(self): r""" :param ImageDigest: 镜像Digest :type ImageDigest: str :param ImageRepoAddress: 镜像仓库地址 :type ImageRepoAddress: str :param RegistryType: 仓库类型 :type RegistryType: str :param ImageName: 镜像名称 :type ImageName: str :param ImageTag: 镜像版本 :type ImageTag: str :param ImageSize: 镜像大小 :type ImageSize: int :param ScanTime: 最近扫描时间 :type ScanTime: str :param ScanStatus: 扫描状态 :type ScanStatus: str :param VulCnt: 安全漏洞数 :type VulCnt: int :param VirusCnt: 木马病毒数 :type VirusCnt: int :param RiskCnt: 风险行为数 :type RiskCnt: int :param SentiveInfoCnt: 敏感信息数 :type SentiveInfoCnt: int :param IsTrustImage: 是否可信镜像 :type IsTrustImage: bool :param OsName: 镜像系统 :type OsName: str :param ScanVirusError: 木马扫描错误 注意:此字段可能返回 null,表示取不到有效值。 :type ScanVirusError: str :param ScanVulError: 漏洞扫描错误 注意:此字段可能返回 null,表示取不到有效值。 :type ScanVulError: str :param InstanceId: 实例id :type InstanceId: str :param InstanceName: 实例名称 :type InstanceName: str :param Namespace: 命名空间 :type Namespace: str :param ScanRiskError: 高危扫描错误 注意:此字段可能返回 null,表示取不到有效值。 :type ScanRiskError: str :param ScanVirusProgress: 敏感信息扫描进度 注意:此字段可能返回 null,表示取不到有效值。 :type ScanVirusProgress: int :param ScanVulProgress: 木马扫描进度 注意:此字段可能返回 null,表示取不到有效值。 :type ScanVulProgress: int :param ScanRiskProgress: 漏洞扫描进度 注意:此字段可能返回 null,表示取不到有效值。 :type ScanRiskProgress: int :param ScanRemainTime: 剩余扫描时间秒 注意:此字段可能返回 null,表示取不到有效值。 :type ScanRemainTime: int :param CveStatus: cve扫描状态 注意:此字段可能返回 null,表示取不到有效值。 :type CveStatus: str :param RiskStatus: 高危扫描状态 注意:此字段可能返回 null,表示取不到有效值。 :type RiskStatus: str :param VirusStatus: 木马扫描状态 注意:此字段可能返回 null,表示取不到有效值。 :type VirusStatus: str :param Progress: 总进度 注意:此字段可能返回 null,表示取不到有效值。 :type Progress: int :param IsAuthorized: 授权状态 :type IsAuthorized: int :param RegistryRegion: 仓库区域 :type RegistryRegion: str :param Id: 列表id :type Id: int :param ImageId: 镜像Id 注意:此字段可能返回 null,表示取不到有效值。 :type ImageId: str :param ImageCreateTime: 镜像创建的时间 注意:此字段可能返回 null,表示取不到有效值。 :type ImageCreateTime: str :param IsLatestImage: 是否为镜像的最新版本 注意:此字段可能返回 null,表示取不到有效值。 :type IsLatestImage: bool """ self.ImageDigest = None self.ImageRepoAddress = None self.RegistryType = None self.ImageName = None self.ImageTag = None self.ImageSize = None self.ScanTime = None self.ScanStatus = None self.VulCnt = None self.VirusCnt = None self.RiskCnt = None self.SentiveInfoCnt = None self.IsTrustImage = None self.OsName = None self.ScanVirusError = None self.ScanVulError = None self.InstanceId = None self.InstanceName = None self.Namespace = None self.ScanRiskError = None self.ScanVirusProgress = None self.ScanVulProgress = None self.ScanRiskProgress = None self.ScanRemainTime = None self.CveStatus = None self.RiskStatus = None self.VirusStatus = None self.Progress = None self.IsAuthorized = None self.RegistryRegion = None self.Id = None self.ImageId = None self.ImageCreateTime = None self.IsLatestImage = None def _deserialize(self, params): self.ImageDigest = params.get("ImageDigest") self.ImageRepoAddress = params.get("ImageRepoAddress") self.RegistryType = params.get("RegistryType") self.ImageName = params.get("ImageName") self.ImageTag = params.get("ImageTag") self.ImageSize = params.get("ImageSize") self.ScanTime = params.get("ScanTime") self.ScanStatus = params.get("ScanStatus") self.VulCnt = params.get("VulCnt") self.VirusCnt = params.get("VirusCnt") self.RiskCnt = params.get("RiskCnt") self.SentiveInfoCnt = params.get("SentiveInfoCnt") self.IsTrustImage = params.get("IsTrustImage") self.OsName = params.get("OsName") self.ScanVirusError = params.get("ScanVirusError") self.ScanVulError = params.get("ScanVulError") self.InstanceId = params.get("InstanceId") self.InstanceName = params.get("InstanceName") self.Namespace = params.get("Namespace") self.ScanRiskError = params.get("ScanRiskError") self.ScanVirusProgress = params.get("ScanVirusProgress") self.ScanVulProgress = params.get("ScanVulProgress") self.ScanRiskProgress = params.get("ScanRiskProgress") self.ScanRemainTime = params.get("ScanRemainTime") self.CveStatus = params.get("CveStatus") self.RiskStatus = params.get("RiskStatus") self.VirusStatus = params.get("VirusStatus") self.Progress = params.get("Progress") self.IsAuthorized = params.get("IsAuthorized") self.RegistryRegion = params.get("RegistryRegion") self.Id = params.get("Id") self.ImageId = params.get("ImageId") self.ImageCreateTime = params.get("ImageCreateTime") self.IsLatestImage = params.get("IsLatestImage") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImageRisk(AbstractModel): """容器安全镜像高危行为信息 """ def __init__(self): r""" :param Behavior: 高危行为 注意:此字段可能返回 null,表示取不到有效值。 :type Behavior: int :param Type: 种类 注意:此字段可能返回 null,表示取不到有效值。 :type Type: int :param Level: 风险等级 注意:此字段可能返回 null,表示取不到有效值。 :type Level: str :param Desc: 描述 注意:此字段可能返回 null,表示取不到有效值。 :type Desc: str :param InstructionContent: 解决方案 注意:此字段可能返回 null,表示取不到有效值。 :type InstructionContent: str """ self.Behavior = None self.Type = None self.Level = None self.Desc = None self.InstructionContent = None def _deserialize(self, params): self.Behavior = params.get("Behavior") self.Type = params.get("Type") self.Level = params.get("Level") self.Desc = params.get("Desc") self.InstructionContent = params.get("InstructionContent") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImageRiskInfo(AbstractModel): """镜像风险详情 """ def __init__(self): r""" :param Behavior: 行为 :type Behavior: int :param Type: 类型 :type Type: int :param Level: 级别 :type Level: int :param Desc: 详情 :type Desc: str :param InstructionContent: 解决方案 :type InstructionContent: str """ self.Behavior = None self.Type = None self.Level = None self.Desc = None self.InstructionContent = None def _deserialize(self, params): self.Behavior = params.get("Behavior") self.Type = params.get("Type") self.Level = params.get("Level") self.Desc = params.get("Desc") self.InstructionContent = params.get("InstructionContent") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImageRiskTendencyInfo(AbstractModel): """运行时安全事件趋势信息 """ def __init__(self): r""" :param ImageRiskSet: 趋势列表 :type ImageRiskSet: list of RunTimeTendencyInfo :param ImageRiskType: 风险类型: IRT_VULNERABILITY : 安全漏洞 IRT_MALWARE_VIRUS: 木马病毒 IRT_RISK:敏感信息 :type ImageRiskType: str """ self.ImageRiskSet = None self.ImageRiskType = None def _deserialize(self, params): if params.get("ImageRiskSet") is not None: self.ImageRiskSet = [] for item in params.get("ImageRiskSet"): obj = RunTimeTendencyInfo() obj._deserialize(item) self.ImageRiskSet.append(obj) self.ImageRiskType = params.get("ImageRiskType") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImageSimpleInfo(AbstractModel): """镜像列表 """ def __init__(self): r""" :param ImageID: 镜像id :type ImageID: str :param ImageName: 镜像名称 :type ImageName: str :param Size: 镜像大小 :type Size: int :param ImageType: 类型 :type ImageType: str :param ContainerCnt: 关联容器数 :type ContainerCnt: int """ self.ImageID = None self.ImageName = None self.Size = None self.ImageType = None self.ContainerCnt = None def _deserialize(self, params): self.ImageID = params.get("ImageID") self.ImageName = params.get("ImageName") self.Size = params.get("Size") self.ImageType = params.get("ImageType") self.ContainerCnt = params.get("ContainerCnt") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImageVirus(AbstractModel): """容器安全镜像病毒信息 """ def __init__(self): r""" :param Path: 路径 注意:此字段可能返回 null,表示取不到有效值。 :type Path: str :param RiskLevel: 风险等级 注意:此字段可能返回 null,表示取不到有效值。 :type RiskLevel: str :param Category: 分类 注意:此字段可能返回 null,表示取不到有效值。 :type Category: str :param VirusName: 病毒名称 注意:此字段可能返回 null,表示取不到有效值。 :type VirusName: str :param Tags: 标签 注意:此字段可能返回 null,表示取不到有效值。 :type Tags: list of str :param Desc: 描述 注意:此字段可能返回 null,表示取不到有效值。 :type Desc: str :param Solution: 解决方案 注意:此字段可能返回 null,表示取不到有效值。 :type Solution: str :param FileType: 文件类型 注意:此字段可能返回 null,表示取不到有效值。 :type FileType: str :param FileName: 文件路径 注意:此字段可能返回 null,表示取不到有效值。 :type FileName: str :param FileMd5: 文件md5 注意:此字段可能返回 null,表示取不到有效值。 :type FileMd5: str :param FileSize: 大小 注意:此字段可能返回 null,表示取不到有效值。 :type FileSize: int :param FirstScanTime: 首次发现时间 注意:此字段可能返回 null,表示取不到有效值。 :type FirstScanTime: str :param LatestScanTime: 最近扫描时间 注意:此字段可能返回 null,表示取不到有效值。 :type LatestScanTime: str """ self.Path = None self.RiskLevel = None self.Category = None self.VirusName = None self.Tags = None self.Desc = None self.Solution = None self.FileType = None self.FileName = None self.FileMd5 = None self.FileSize = None self.FirstScanTime = None self.LatestScanTime = None def _deserialize(self, params): self.Path = params.get("Path") self.RiskLevel = params.get("RiskLevel") self.Category = params.get("Category") self.VirusName = params.get("VirusName") self.Tags = params.get("Tags") self.Desc = params.get("Desc") self.Solution = params.get("Solution") self.FileType = params.get("FileType") self.FileName = params.get("FileName") self.FileMd5 = params.get("FileMd5") self.FileSize = params.get("FileSize") self.FirstScanTime = params.get("FirstScanTime") self.LatestScanTime = params.get("LatestScanTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImageVirusInfo(AbstractModel): """容器安全镜像病毒信息 """ def __init__(self): r""" :param Path: 路径 注意:此字段可能返回 null,表示取不到有效值。 :type Path: str :param RiskLevel: 风险等级 注意:此字段可能返回 null,表示取不到有效值。 :type RiskLevel: int :param VirusName: 病毒名称 注意:此字段可能返回 null,表示取不到有效值。 :type VirusName: str :param Tags: 标签 注意:此字段可能返回 null,表示取不到有效值。 :type Tags: list of str :param Desc: 描述 注意:此字段可能返回 null,表示取不到有效值。 :type Desc: str :param Solution: 修护建议 注意:此字段可能返回 null,表示取不到有效值。 :type Solution: str :param Size: 大小 注意:此字段可能返回 null,表示取不到有效值。 :type Size: int :param FirstScanTime: 首次发现时间 注意:此字段可能返回 null,表示取不到有效值。 :type FirstScanTime: str :param LatestScanTime: 最近扫描时间 注意:此字段可能返回 null,表示取不到有效值。 :type LatestScanTime: str :param Md5: 文件md5 注意:此字段可能返回 null,表示取不到有效值。 :type Md5: str :param FileName: 文件名称 注意:此字段可能返回 null,表示取不到有效值。 :type FileName: str """ self.Path = None self.RiskLevel = None self.VirusName = None self.Tags = None self.Desc = None self.Solution = None self.Size = None self.FirstScanTime = None self.LatestScanTime = None self.Md5 = None self.FileName = None def _deserialize(self, params): self.Path = params.get("Path") self.RiskLevel = params.get("RiskLevel") self.VirusName = params.get("VirusName") self.Tags = params.get("Tags") self.Desc = params.get("Desc") self.Solution = params.get("Solution") self.Size = params.get("Size") self.FirstScanTime = params.get("FirstScanTime") self.LatestScanTime = params.get("LatestScanTime") self.Md5 = params.get("Md5") self.FileName = params.get("FileName") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImageVul(AbstractModel): """容器安全镜像漏洞信息 """ def __init__(self): r""" :param CVEID: 漏洞id 注意:此字段可能返回 null,表示取不到有效值。 :type CVEID: str :param POCID: 观点验证程序id 注意:此字段可能返回 null,表示取不到有效值。 :type POCID: str :param Name: 漏洞名称 注意:此字段可能返回 null,表示取不到有效值。 :type Name: str :param Components: 涉及组件信息 注意:此字段可能返回 null,表示取不到有效值。 :type Components: list of ComponentsInfo :param Category: 分类 注意:此字段可能返回 null,表示取不到有效值。 :type Category: str :param CategoryType: 分类2 注意:此字段可能返回 null,表示取不到有效值。 :type CategoryType: str :param Level: 风险等级 注意:此字段可能返回 null,表示取不到有效值。 :type Level: str :param Des: 描述 注意:此字段可能返回 null,表示取不到有效值。 :type Des: str :param OfficialSolution: 解决方案 注意:此字段可能返回 null,表示取不到有效值。 :type OfficialSolution: str :param Reference: 引用 注意:此字段可能返回 null,表示取不到有效值。 :type Reference: str :param DefenseSolution: 防御方案 注意:此字段可能返回 null,表示取不到有效值。 :type DefenseSolution: str :param SubmitTime: 提交时间 注意:此字段可能返回 null,表示取不到有效值。 :type SubmitTime: str :param CvssScore: Cvss分数 注意:此字段可能返回 null,表示取不到有效值。 :type CvssScore: str :param CvssVector: Cvss信息 注意:此字段可能返回 null,表示取不到有效值。 :type CvssVector: str :param IsSuggest: 是否建议修复 注意:此字段可能返回 null,表示取不到有效值。 :type IsSuggest: str :param FixedVersions: 修复版本号 注意:此字段可能返回 null,表示取不到有效值。 :type FixedVersions: str :param Tag: 漏洞标签:"CanBeFixed","DynamicLevelPoc","DynamicLevelExp" 注意:此字段可能返回 null,表示取不到有效值。 :type Tag: list of str :param Component: 组件名 注意:此字段可能返回 null,表示取不到有效值。 :type Component: str :param Version: 组件版本 注意:此字段可能返回 null,表示取不到有效值。 :type Version: str """ self.CVEID = None self.POCID = None self.Name = None self.Components = None self.Category = None self.CategoryType = None self.Level = None self.Des = None self.OfficialSolution = None self.Reference = None self.DefenseSolution = None self.SubmitTime = None self.CvssScore = None self.CvssVector = None self.IsSuggest = None self.FixedVersions = None self.Tag = None self.Component = None self.Version = None def _deserialize(self, params): self.CVEID = params.get("CVEID") self.POCID = params.get("POCID") self.Name = params.get("Name") if params.get("Components") is not None: self.Components = [] for item in params.get("Components"): obj = ComponentsInfo() obj._deserialize(item) self.Components.append(obj) self.Category = params.get("Category") self.CategoryType = params.get("CategoryType") self.Level = params.get("Level") self.Des = params.get("Des") self.OfficialSolution = params.get("OfficialSolution") self.Reference = params.get("Reference") self.DefenseSolution = params.get("DefenseSolution") self.SubmitTime = params.get("SubmitTime") self.CvssScore = params.get("CvssScore") self.CvssVector = params.get("CvssVector") self.IsSuggest = params.get("IsSuggest") self.FixedVersions = params.get("FixedVersions") self.Tag = params.get("Tag") self.Component = params.get("Component") self.Version = params.get("Version") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImagesBindRuleInfo(AbstractModel): """查询镜像绑定的运行时规则信息 """ def __init__(self): r""" :param ImageId: 镜像id :type ImageId: str :param ImageName: 镜像名称 :type ImageName: str :param ContainerCnt: 关联容器数量 :type ContainerCnt: int :param RuleId: 绑定规则id 注意:此字段可能返回 null,表示取不到有效值。 :type RuleId: str :param RuleName: 规则名字 注意:此字段可能返回 null,表示取不到有效值。 :type RuleName: str :param ImageSize: 镜像大小 注意:此字段可能返回 null,表示取不到有效值。 :type ImageSize: int :param ScanTime: 最近扫描时间 注意:此字段可能返回 null,表示取不到有效值。 :type ScanTime: str """ self.ImageId = None self.ImageName = None self.ContainerCnt = None self.RuleId = None self.RuleName = None self.ImageSize = None self.ScanTime = None def _deserialize(self, params): self.ImageId = params.get("ImageId") self.ImageName = params.get("ImageName") self.ContainerCnt = params.get("ContainerCnt") self.RuleId = params.get("RuleId") self.RuleName = params.get("RuleName") self.ImageSize = params.get("ImageSize") self.ScanTime = params.get("ScanTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImagesInfo(AbstractModel): """容器安全镜像列表 """ def __init__(self): r""" :param ImageID: 镜像id :type ImageID: str :param ImageName: 镜像名称 :type ImageName: str :param CreateTime: 创建时间 :type CreateTime: str :param Size: 镜像大小 :type Size: int :param HostCnt: 主机个数 :type HostCnt: int :param ContainerCnt: 容器个数 :type ContainerCnt: int :param ScanTime: 扫描时间 :type ScanTime: str :param VulCnt: 漏洞个数 :type VulCnt: int :param VirusCnt: 病毒个数 :type VirusCnt: int :param RiskCnt: 敏感信息个数 :type RiskCnt: int :param IsTrustImage: 是否信任镜像 :type IsTrustImage: bool :param OsName: 镜像系统 :type OsName: str :param AgentError: agent镜像扫描错误 :type AgentError: str :param ScanError: 后端镜像扫描错误 :type ScanError: str :param ScanStatus: 扫描状态 :type ScanStatus: str :param ScanVirusError: 木马扫描错误信息 :type ScanVirusError: str :param ScanVulError: 漏洞扫描错误信息 :type ScanVulError: str :param ScanRiskError: 风险扫描错误信息 :type ScanRiskError: str :param IsSuggest: 是否是重点关注镜像,为0不是,非0是 :type IsSuggest: int :param IsAuthorized: 是否授权,1是0否 :type IsAuthorized: int :param ComponentCnt: 组件个数 :type ComponentCnt: int """ self.ImageID = None self.ImageName = None self.CreateTime = None self.Size = None self.HostCnt = None self.ContainerCnt = None self.ScanTime = None self.VulCnt = None self.VirusCnt = None self.RiskCnt = None self.IsTrustImage = None self.OsName = None self.AgentError = None self.ScanError = None self.ScanStatus = None self.ScanVirusError = None self.ScanVulError = None self.ScanRiskError = None self.IsSuggest = None self.IsAuthorized = None self.ComponentCnt = None def _deserialize(self, params): self.ImageID = params.get("ImageID") self.ImageName = params.get("ImageName") self.CreateTime = params.get("CreateTime") self.Size = params.get("Size") self.HostCnt = params.get("HostCnt") self.ContainerCnt = params.get("ContainerCnt") self.ScanTime = params.get("ScanTime") self.VulCnt = params.get("VulCnt") self.VirusCnt = params.get("VirusCnt") self.RiskCnt = params.get("RiskCnt") self.IsTrustImage = params.get("IsTrustImage") self.OsName = params.get("OsName") self.AgentError = params.get("AgentError") self.ScanError = params.get("ScanError") self.ScanStatus = params.get("ScanStatus") self.ScanVirusError = params.get("ScanVirusError") self.ScanVulError = params.get("ScanVulError") self.ScanRiskError = params.get("ScanRiskError") self.IsSuggest = params.get("IsSuggest") self.IsAuthorized = params.get("IsAuthorized") self.ComponentCnt = params.get("ComponentCnt") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ImagesVul(AbstractModel): """容器安全镜像漏洞 """ def __init__(self): r""" :param CVEID: 漏洞id :type CVEID: str :param Name: 漏洞名称 :type Name: str :param Component: 组件 :type Component: str :param Version: 版本 :type Version: str :param Category: 分类 :type Category: str :param CategoryType: 分类2 :type CategoryType: str :param Level: 风险等级 :type Level: int :param Des: 描述 :type Des: str :param OfficialSolution: 解决方案 :type OfficialSolution: str :param Reference: 引用 :type Reference: str :param DefenseSolution: 防御方案 :type DefenseSolution: str :param SubmitTime: 提交时间 :type SubmitTime: str :param CVSSV3Score: CVSS V3分数 :type CVSSV3Score: float :param CVSSV3Desc: CVSS V3描述 :type CVSSV3Desc: str :param IsSuggest: 是否是重点关注:true:是,false:不是 :type IsSuggest: bool :param FixedVersions: 修复版本号 注意:此字段可能返回 null,表示取不到有效值。 :type FixedVersions: str :param Tag: 漏洞标签:"CanBeFixed","DynamicLevelPoc","DynamicLevelExp" 注意:此字段可能返回 null,表示取不到有效值。 :type Tag: list of str """ self.CVEID = None self.Name = None self.Component = None self.Version = None self.Category = None self.CategoryType = None self.Level = None self.Des = None self.OfficialSolution = None self.Reference = None self.DefenseSolution = None self.SubmitTime = None self.CVSSV3Score = None self.CVSSV3Desc = None self.IsSuggest = None self.FixedVersions = None self.Tag = None def _deserialize(self, params): self.CVEID = params.get("CVEID") self.Name = params.get("Name") self.Component = params.get("Component") self.Version = params.get("Version") self.Category = params.get("Category") self.CategoryType = params.get("CategoryType") self.Level = params.get("Level") self.Des = params.get("Des") self.OfficialSolution = params.get("OfficialSolution") self.Reference = params.get("Reference") self.DefenseSolution = params.get("DefenseSolution") self.SubmitTime = params.get("SubmitTime") self.CVSSV3Score = params.get("CVSSV3Score") self.CVSSV3Desc = params.get("CVSSV3Desc") self.IsSuggest = params.get("IsSuggest") self.FixedVersions = params.get("FixedVersions") self.Tag = params.get("Tag") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class InitializeUserComplianceEnvironmentRequest(AbstractModel): """InitializeUserComplianceEnvironment请求参数结构体 """ class InitializeUserComplianceEnvironmentResponse(AbstractModel): """InitializeUserComplianceEnvironment返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyAbnormalProcessRuleStatusRequest(AbstractModel): """ModifyAbnormalProcessRuleStatus请求参数结构体 """ def __init__(self): r""" :param RuleIdSet: 策略的ids :type RuleIdSet: list of str :param IsEnable: 策略开关,true开启,false关闭 :type IsEnable: bool """ self.RuleIdSet = None self.IsEnable = None def _deserialize(self, params): self.RuleIdSet = params.get("RuleIdSet") self.IsEnable = params.get("IsEnable") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyAbnormalProcessRuleStatusResponse(AbstractModel): """ModifyAbnormalProcessRuleStatus返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyAbnormalProcessStatusRequest(AbstractModel): """ModifyAbnormalProcessStatus请求参数结构体 """ def __init__(self): r""" :param EventIdSet: 处理事件ids :type EventIdSet: list of str :param Status: 标记事件的状态, EVENT_DEALED:事件处理 EVENT_INGNORE":事件忽略 EVENT_DEL:事件删除 EVENT_ADD_WHITE:事件加白 :type Status: str :param Remark: 事件备注 :type Remark: str """ self.EventIdSet = None self.Status = None self.Remark = None def _deserialize(self, params): self.EventIdSet = params.get("EventIdSet") self.Status = params.get("Status") self.Remark = params.get("Remark") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyAbnormalProcessStatusResponse(AbstractModel): """ModifyAbnormalProcessStatus返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyAccessControlRuleStatusRequest(AbstractModel): """ModifyAccessControlRuleStatus请求参数结构体 """ def __init__(self): r""" :param RuleIdSet: 策略的ids :type RuleIdSet: list of str :param IsEnable: 策略开关,true:代表开启, false代表关闭 :type IsEnable: bool """ self.RuleIdSet = None self.IsEnable = None def _deserialize(self, params): self.RuleIdSet = params.get("RuleIdSet") self.IsEnable = params.get("IsEnable") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyAccessControlRuleStatusResponse(AbstractModel): """ModifyAccessControlRuleStatus返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyAccessControlStatusRequest(AbstractModel): """ModifyAccessControlStatus请求参数结构体 """ def __init__(self): r""" :param EventIdSet: 处理事件ids :type EventIdSet: list of str :param Status: 标记事件的状态, EVENT_DEALED:事件已经处理 EVENT_INGNORE:事件忽略 EVENT_DEL:事件删除 EVENT_ADD_WHITE:事件加白 :type Status: str :param Remark: 备注事件信息 :type Remark: str """ self.EventIdSet = None self.Status = None self.Remark = None def _deserialize(self, params): self.EventIdSet = params.get("EventIdSet") self.Status = params.get("Status") self.Remark = params.get("Remark") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyAccessControlStatusResponse(AbstractModel): """ModifyAccessControlStatus返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyAssetImageRegistryScanStopOneKeyRequest(AbstractModel): """ModifyAssetImageRegistryScanStopOneKey请求参数结构体 """ def __init__(self): r""" :param All: 是否扫描全部镜像 :type All: bool :param Images: 扫描的镜像列表 :type Images: list of ImageInfo :param Id: 扫描的镜像列表Id :type Id: list of int non-negative """ self.All = None self.Images = None self.Id = None def _deserialize(self, params): self.All = params.get("All") if params.get("Images") is not None: self.Images = [] for item in params.get("Images"): obj = ImageInfo() obj._deserialize(item) self.Images.append(obj) self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyAssetImageRegistryScanStopOneKeyResponse(AbstractModel): """ModifyAssetImageRegistryScanStopOneKey返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyAssetImageRegistryScanStopRequest(AbstractModel): """ModifyAssetImageRegistryScanStop请求参数结构体 """ def __init__(self): r""" :param All: 是否扫描全部镜像 :type All: bool :param Images: 扫描的镜像列表 :type Images: list of ImageInfo :param Id: 扫描的镜像列表 :type Id: list of int non-negative :param Filters: 过滤条件 :type Filters: list of AssetFilters :param ExcludeImageList: 不要扫描的镜像列表,与Filters配合使用 :type ExcludeImageList: list of int non-negative :param OnlyScanLatest: 是否仅扫描各repository最新版本的镜像 :type OnlyScanLatest: bool """ self.All = None self.Images = None self.Id = None self.Filters = None self.ExcludeImageList = None self.OnlyScanLatest = None def _deserialize(self, params): self.All = params.get("All") if params.get("Images") is not None: self.Images = [] for item in params.get("Images"): obj = ImageInfo() obj._deserialize(item) self.Images.append(obj) self.Id = params.get("Id") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.ExcludeImageList = params.get("ExcludeImageList") self.OnlyScanLatest = params.get("OnlyScanLatest") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyAssetImageRegistryScanStopResponse(AbstractModel): """ModifyAssetImageRegistryScanStop返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyAssetImageScanStopRequest(AbstractModel): """ModifyAssetImageScanStop请求参数结构体 """ def __init__(self): r""" :param TaskID: 任务id;任务id,镜像id和根据过滤条件筛选三选一。 :type TaskID: str :param Images: 镜像id;任务id,镜像id和根据过滤条件筛选三选一。 :type Images: list of str :param Filters: 根据过滤条件筛选出镜像;任务id,镜像id和根据过滤条件筛选三选一。 :type Filters: list of AssetFilters :param ExcludeImageIds: 根据过滤条件筛选出镜像,再排除个别镜像 :type ExcludeImageIds: str """ self.TaskID = None self.Images = None self.Filters = None self.ExcludeImageIds = None def _deserialize(self, params): self.TaskID = params.get("TaskID") self.Images = params.get("Images") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = AssetFilters() obj._deserialize(item) self.Filters.append(obj) self.ExcludeImageIds = params.get("ExcludeImageIds") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyAssetImageScanStopResponse(AbstractModel): """ModifyAssetImageScanStop返回参数结构体 """ def __init__(self): r""" :param Status: 停止状态 :type Status: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.Status = None self.RequestId = None def _deserialize(self, params): self.Status = params.get("Status") self.RequestId = params.get("RequestId") class ModifyAssetRequest(AbstractModel): """ModifyAsset请求参数结构体 """ def __init__(self): r""" :param All: 全部同步 :type All: bool :param Hosts: 要同步的主机列表 两个参数必选一个 All优先 :type Hosts: list of str """ self.All = None self.Hosts = None def _deserialize(self, params): self.All = params.get("All") self.Hosts = params.get("Hosts") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyAssetResponse(AbstractModel): """ModifyAsset返回参数结构体 """ def __init__(self): r""" :param Status: 同步任务发送结果 :type Status: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.Status = None self.RequestId = None def _deserialize(self, params): self.Status = params.get("Status") self.RequestId = params.get("RequestId") class ModifyCompliancePeriodTaskRequest(AbstractModel): """ModifyCompliancePeriodTask请求参数结构体 """ def __init__(self): r""" :param PeriodTaskId: 要修改的定时任务的ID,由DescribeCompliancePeriodTaskList接口返回。 :type PeriodTaskId: int :param PeriodRule: 定时任务的周期规则。不填时,不修改。 :type PeriodRule: :class:`tencentcloud.tcss.v20201101.models.CompliancePeriodTaskRule` :param StandardSettings: 设置合规标准。不填时,不修改。 :type StandardSettings: list of ComplianceBenchmarkStandardEnable """ self.PeriodTaskId = None self.PeriodRule = None self.StandardSettings = None def _deserialize(self, params): self.PeriodTaskId = params.get("PeriodTaskId") if params.get("PeriodRule") is not None: self.PeriodRule = CompliancePeriodTaskRule() self.PeriodRule._deserialize(params.get("PeriodRule")) if params.get("StandardSettings") is not None: self.StandardSettings = [] for item in params.get("StandardSettings"): obj = ComplianceBenchmarkStandardEnable() obj._deserialize(item) self.StandardSettings.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyCompliancePeriodTaskResponse(AbstractModel): """ModifyCompliancePeriodTask返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyEscapeEventStatusRequest(AbstractModel): """ModifyEscapeEventStatus请求参数结构体 """ def __init__(self): r""" :param EventIdSet: 处理事件ids :type EventIdSet: list of str :param Status: 标记事件的状态 EVENT_DEALED:事件已经处理 EVENT_INGNORE:事件忽略 EVENT_DEL:事件删除 :type Status: str :param Remark: 备注 :type Remark: str """ self.EventIdSet = None self.Status = None self.Remark = None def _deserialize(self, params): self.EventIdSet = params.get("EventIdSet") self.Status = params.get("Status") self.Remark = params.get("Remark") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyEscapeEventStatusResponse(AbstractModel): """ModifyEscapeEventStatus返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyEscapeRuleRequest(AbstractModel): """ModifyEscapeRule请求参数结构体 """ def __init__(self): r""" :param RuleSet: 需要修改的数组 :type RuleSet: list of EscapeRuleEnabled """ self.RuleSet = None def _deserialize(self, params): if params.get("RuleSet") is not None: self.RuleSet = [] for item in params.get("RuleSet"): obj = EscapeRuleEnabled() obj._deserialize(item) self.RuleSet.append(obj) memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyEscapeRuleResponse(AbstractModel): """ModifyEscapeRule返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyReverseShellStatusRequest(AbstractModel): """ModifyReverseShellStatus请求参数结构体 """ def __init__(self): r""" :param EventIdSet: 处理事件ids :type EventIdSet: list of str :param Status: 标记事件的状态, EVENT_DEALED:事件处理 EVENT_INGNORE":事件忽略 EVENT_DEL:事件删除 EVENT_ADD_WHITE:事件加白 :type Status: str :param Remark: 事件备注 :type Remark: str """ self.EventIdSet = None self.Status = None self.Remark = None def _deserialize(self, params): self.EventIdSet = params.get("EventIdSet") self.Status = params.get("Status") self.Remark = params.get("Remark") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyReverseShellStatusResponse(AbstractModel): """ModifyReverseShellStatus返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyRiskSyscallStatusRequest(AbstractModel): """ModifyRiskSyscallStatus请求参数结构体 """ def __init__(self): r""" :param EventIdSet: 处理事件ids :type EventIdSet: list of str :param Status: 标记事件的状态, EVENT_DEALED:事件处理 EVENT_INGNORE":事件忽略 EVENT_DEL:事件删除 EVENT_ADD_WHITE:事件加白 :type Status: str :param Remark: 事件备注 :type Remark: str """ self.EventIdSet = None self.Status = None self.Remark = None def _deserialize(self, params): self.EventIdSet = params.get("EventIdSet") self.Status = params.get("Status") self.Remark = params.get("Remark") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyRiskSyscallStatusResponse(AbstractModel): """ModifyRiskSyscallStatus返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyVirusFileStatusRequest(AbstractModel): """ModifyVirusFileStatus请求参数结构体 """ def __init__(self): r""" :param EventIdSet: 处理事件id :type EventIdSet: list of str :param Status: 标记事件的状态, EVENT_DEALED:事件处理 EVENT_INGNORE":事件忽略 EVENT_DEL:事件删除 EVENT_ADD_WHITE:事件加白 EVENT_PENDING: 事件待处理 :type Status: str :param Remark: 事件备注 :type Remark: str """ self.EventIdSet = None self.Status = None self.Remark = None def _deserialize(self, params): self.EventIdSet = params.get("EventIdSet") self.Status = params.get("Status") self.Remark = params.get("Remark") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyVirusFileStatusResponse(AbstractModel): """ModifyVirusFileStatus返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyVirusMonitorSettingRequest(AbstractModel): """ModifyVirusMonitorSetting请求参数结构体 """ def __init__(self): r""" :param EnableScan: 是否开启定期扫描 :type EnableScan: bool :param ScanPathAll: 扫描全部路径 :type ScanPathAll: bool :param ScanPathType: 当ScanPathAll为true 生效 0扫描以下路径 1、扫描除以下路径(扫描范围只能小于等于1) :type ScanPathType: int :param ScanPath: 自选排除或扫描的地址 :type ScanPath: list of str """ self.EnableScan = None self.ScanPathAll = None self.ScanPathType = None self.ScanPath = None def _deserialize(self, params): self.EnableScan = params.get("EnableScan") self.ScanPathAll = params.get("ScanPathAll") self.ScanPathType = params.get("ScanPathType") self.ScanPath = params.get("ScanPath") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyVirusMonitorSettingResponse(AbstractModel): """ModifyVirusMonitorSetting返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyVirusScanSettingRequest(AbstractModel): """ModifyVirusScanSetting请求参数结构体 """ def __init__(self): r""" :param EnableScan: 是否开启定期扫描 :type EnableScan: bool :param Cycle: 检测周期每隔多少天(1|3|7) :type Cycle: int :param BeginScanAt: 扫描开始时间 :type BeginScanAt: str :param ScanPathAll: 扫描全部路径(true:全选,false:自选) :type ScanPathAll: bool :param ScanPathType: 当ScanPathAll为true 生效 0扫描以下路径 1、扫描除以下路径 :type ScanPathType: int :param Timeout: 超时时长(5~24h) :type Timeout: int :param ScanRangeType: 扫描范围0容器1主机节点 :type ScanRangeType: int :param ScanRangeAll: true 全选,false 自选 :type ScanRangeAll: bool :param ScanIds: 自选扫描范围的容器id或者主机id 根据ScanRangeType决定 :type ScanIds: list of str :param ScanPath: 扫描路径 :type ScanPath: list of str """ self.EnableScan = None self.Cycle = None self.BeginScanAt = None self.ScanPathAll = None self.ScanPathType = None self.Timeout = None self.ScanRangeType = None self.ScanRangeAll = None self.ScanIds = None self.ScanPath = None def _deserialize(self, params): self.EnableScan = params.get("EnableScan") self.Cycle = params.get("Cycle") self.BeginScanAt = params.get("BeginScanAt") self.ScanPathAll = params.get("ScanPathAll") self.ScanPathType = params.get("ScanPathType") self.Timeout = params.get("Timeout") self.ScanRangeType = params.get("ScanRangeType") self.ScanRangeAll = params.get("ScanRangeAll") self.ScanIds = params.get("ScanIds") self.ScanPath = params.get("ScanPath") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyVirusScanSettingResponse(AbstractModel): """ModifyVirusScanSetting返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyVirusScanTimeoutSettingRequest(AbstractModel): """ModifyVirusScanTimeoutSetting请求参数结构体 """ def __init__(self): r""" :param Timeout: 超时时长单位小时(5~24h) :type Timeout: int :param ScanType: 设置类型0一键检测,1定时检测 :type ScanType: int """ self.Timeout = None self.ScanType = None def _deserialize(self, params): self.Timeout = params.get("Timeout") self.ScanType = params.get("ScanType") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ModifyVirusScanTimeoutSettingResponse(AbstractModel): """ModifyVirusScanTimeoutSetting返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class PortInfo(AbstractModel): """容器安全端口信息列表 """ def __init__(self): r""" :param Type: 类型 :type Type: str :param PublicIP: 对外ip :type PublicIP: str :param PublicPort: 主机端口 :type PublicPort: int :param ContainerPort: 容器端口 :type ContainerPort: int :param ContainerPID: 容器Pid :type ContainerPID: int :param ContainerName: 容器名 :type ContainerName: str :param HostID: 主机id :type HostID: str :param HostIP: 主机ip :type HostIP: str :param ProcessName: 进程名称 :type ProcessName: str :param ListenContainer: 容器内监听地址 :type ListenContainer: str :param ListenHost: 容器外监听地址 :type ListenHost: str :param RunAs: 运行账号 :type RunAs: str :param HostName: 主机名称 :type HostName: str :param PublicIp: 外网ip :type PublicIp: str """ self.Type = None self.PublicIP = None self.PublicPort = None self.ContainerPort = None self.ContainerPID = None self.ContainerName = None self.HostID = None self.HostIP = None self.ProcessName = None self.ListenContainer = None self.ListenHost = None self.RunAs = None self.HostName = None self.PublicIp = None def _deserialize(self, params): self.Type = params.get("Type") self.PublicIP = params.get("PublicIP") self.PublicPort = params.get("PublicPort") self.ContainerPort = params.get("ContainerPort") self.ContainerPID = params.get("ContainerPID") self.ContainerName = params.get("ContainerName") self.HostID = params.get("HostID") self.HostIP = params.get("HostIP") self.ProcessName = params.get("ProcessName") self.ListenContainer = params.get("ListenContainer") self.ListenHost = params.get("ListenHost") self.RunAs = params.get("RunAs") self.HostName = params.get("HostName") self.PublicIp = params.get("PublicIp") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ProcessDetailBaseInfo(AbstractModel): """运行是安全详情,进程基础信息 """ def __init__(self): r""" :param ProcessName: 进程名称 :type ProcessName: str :param ProcessId: 进程pid :type ProcessId: int :param ProcessStartUser: 进程启动用户 :type ProcessStartUser: str :param ProcessUserGroup: 进程用户组 :type ProcessUserGroup: str :param ProcessPath: 进程路径 :type ProcessPath: str :param ProcessParam: 进程命令行参数 :type ProcessParam: str """ self.ProcessName = None self.ProcessId = None self.ProcessStartUser = None self.ProcessUserGroup = None self.ProcessPath = None self.ProcessParam = None def _deserialize(self, params): self.ProcessName = params.get("ProcessName") self.ProcessId = params.get("ProcessId") self.ProcessStartUser = params.get("ProcessStartUser") self.ProcessUserGroup = params.get("ProcessUserGroup") self.ProcessPath = params.get("ProcessPath") self.ProcessParam = params.get("ProcessParam") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ProcessDetailInfo(AbstractModel): """运行是安全详情,进程信息 """ def __init__(self): r""" :param ProcessName: 进程名称 :type ProcessName: str :param ProcessAuthority: 进程权限 :type ProcessAuthority: str :param ProcessId: 进程pid :type ProcessId: int :param ProcessStartUser: 进程启动用户 :type ProcessStartUser: str :param ProcessUserGroup: 进程用户组 :type ProcessUserGroup: str :param ProcessPath: 进程路径 :type ProcessPath: str :param ProcessTree: 进程树 :type ProcessTree: str :param ProcessMd5: 进程md5 :type ProcessMd5: str :param ProcessParam: 进程命令行参数 :type ProcessParam: str """ self.ProcessName = None self.ProcessAuthority = None self.ProcessId = None self.ProcessStartUser = None self.ProcessUserGroup = None self.ProcessPath = None self.ProcessTree = None self.ProcessMd5 = None self.ProcessParam = None def _deserialize(self, params): self.ProcessName = params.get("ProcessName") self.ProcessAuthority = params.get("ProcessAuthority") self.ProcessId = params.get("ProcessId") self.ProcessStartUser = params.get("ProcessStartUser") self.ProcessUserGroup = params.get("ProcessUserGroup") self.ProcessPath = params.get("ProcessPath") self.ProcessTree = params.get("ProcessTree") self.ProcessMd5 = params.get("ProcessMd5") self.ProcessParam = params.get("ProcessParam") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ProcessInfo(AbstractModel): """容器安全进程列表 """ def __init__(self): r""" :param StartTime: 进程启动时间 :type StartTime: str :param RunAs: 运行用户 :type RunAs: str :param CmdLine: 命令行参数 :type CmdLine: str :param Exe: Exe路径 :type Exe: str :param PID: 主机PID :type PID: int :param ContainerPID: 容器内pid :type ContainerPID: int :param ContainerName: 容器名称 :type ContainerName: str :param HostID: 主机id :type HostID: str :param HostIP: 主机ip :type HostIP: str :param ProcessName: 进程名称 :type ProcessName: str :param HostName: 主机名称 :type HostName: str :param PublicIp: 外网ip :type PublicIp: str """ self.StartTime = None self.RunAs = None self.CmdLine = None self.Exe = None self.PID = None self.ContainerPID = None self.ContainerName = None self.HostID = None self.HostIP = None self.ProcessName = None self.HostName = None self.PublicIp = None def _deserialize(self, params): self.StartTime = params.get("StartTime") self.RunAs = params.get("RunAs") self.CmdLine = params.get("CmdLine") self.Exe = params.get("Exe") self.PID = params.get("PID") self.ContainerPID = params.get("ContainerPID") self.ContainerName = params.get("ContainerName") self.HostID = params.get("HostID") self.HostIP = params.get("HostIP") self.ProcessName = params.get("ProcessName") self.HostName = params.get("HostName") self.PublicIp = params.get("PublicIp") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RemoveAssetImageRegistryRegistryDetailRequest(AbstractModel): """RemoveAssetImageRegistryRegistryDetail请求参数结构体 """ def __init__(self): r""" :param RegistryId: 仓库唯一id :type RegistryId: int """ self.RegistryId = None def _deserialize(self, params): self.RegistryId = params.get("RegistryId") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RemoveAssetImageRegistryRegistryDetailResponse(AbstractModel): """RemoveAssetImageRegistryRegistryDetail返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class RenewImageAuthorizeStateRequest(AbstractModel): """RenewImageAuthorizeState请求参数结构体 """ def __init__(self): r""" :param AllImages: 是否全部未授权镜像 :type AllImages: bool :param ImageIds: 镜像ids :type ImageIds: list of str """ self.AllImages = None self.ImageIds = None def _deserialize(self, params): self.AllImages = params.get("AllImages") self.ImageIds = params.get("ImageIds") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RenewImageAuthorizeStateResponse(AbstractModel): """RenewImageAuthorizeState返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ReverseShellEventDescription(AbstractModel): """运行时容器反弹shell事件描述信息 """ def __init__(self): r""" :param Description: 描述信息 :type Description: str :param Solution: 解决方案 :type Solution: str :param Remark: 事件备注信息 注意:此字段可能返回 null,表示取不到有效值。 :type Remark: str :param DstAddress: 目标地址 :type DstAddress: str """ self.Description = None self.Solution = None self.Remark = None self.DstAddress = None def _deserialize(self, params): self.Description = params.get("Description") self.Solution = params.get("Solution") self.Remark = params.get("Remark") self.DstAddress = params.get("DstAddress") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ReverseShellEventInfo(AbstractModel): """容器安全运行时高危系统调用信息 """ def __init__(self): r""" :param ProcessName: 进程名称 :type ProcessName: str :param ProcessPath: 进程路径 :type ProcessPath: str :param ImageId: 镜像id :type ImageId: str :param ContainerId: 容器id :type ContainerId: str :param ImageName: 镜像名 :type ImageName: str :param ContainerName: 容器名 :type ContainerName: str :param FoundTime: 生成时间 :type FoundTime: str :param Solution: 事件解决方案 :type Solution: str :param Description: 事件详细描述 :type Description: str :param Status: 状态,EVENT_UNDEAL:事件未处理 EVENT_DEALED:事件已经处理 EVENT_INGNORE:事件已经忽略 EVENT_ADD_WHITE:时间已经加白 :type Status: str :param EventId: 事件id :type EventId: str :param Remark: 备注 :type Remark: str :param PProcessName: 父进程名 :type PProcessName: str :param EventCount: 事件数量 :type EventCount: int :param LatestFoundTime: 最近生成时间 :type LatestFoundTime: str :param DstAddress: 目标地址 :type DstAddress: str """ self.ProcessName = None self.ProcessPath = None self.ImageId = None self.ContainerId = None self.ImageName = None self.ContainerName = None self.FoundTime = None self.Solution = None self.Description = None self.Status = None self.EventId = None self.Remark = None self.PProcessName = None self.EventCount = None self.LatestFoundTime = None self.DstAddress = None def _deserialize(self, params): self.ProcessName = params.get("ProcessName") self.ProcessPath = params.get("ProcessPath") self.ImageId = params.get("ImageId") self.ContainerId = params.get("ContainerId") self.ImageName = params.get("ImageName") self.ContainerName = params.get("ContainerName") self.FoundTime = params.get("FoundTime") self.Solution = params.get("Solution") self.Description = params.get("Description") self.Status = params.get("Status") self.EventId = params.get("EventId") self.Remark = params.get("Remark") self.PProcessName = params.get("PProcessName") self.EventCount = params.get("EventCount") self.LatestFoundTime = params.get("LatestFoundTime") self.DstAddress = params.get("DstAddress") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ReverseShellWhiteListBaseInfo(AbstractModel): """反弹shell白名单信息 """ def __init__(self): r""" :param Id: 白名单id :type Id: str :param ImageCount: 镜像数量 :type ImageCount: int :param ProcessName: 连接进程名字 :type ProcessName: str :param DstIp: 目标地址ip :type DstIp: str :param CreateTime: 创建时间 :type CreateTime: str :param UpdateTime: 更新时间 :type UpdateTime: str :param DstPort: 目标端口 :type DstPort: str :param IsGlobal: 是否是全局白名单,true全局 :type IsGlobal: bool :param ImageIds: 镜像id数组,为空代表全部 :type ImageIds: list of str """ self.Id = None self.ImageCount = None self.ProcessName = None self.DstIp = None self.CreateTime = None self.UpdateTime = None self.DstPort = None self.IsGlobal = None self.ImageIds = None def _deserialize(self, params): self.Id = params.get("Id") self.ImageCount = params.get("ImageCount") self.ProcessName = params.get("ProcessName") self.DstIp = params.get("DstIp") self.CreateTime = params.get("CreateTime") self.UpdateTime = params.get("UpdateTime") self.DstPort = params.get("DstPort") self.IsGlobal = params.get("IsGlobal") self.ImageIds = params.get("ImageIds") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ReverseShellWhiteListInfo(AbstractModel): """反弹shell白名单信息 """ def __init__(self): r""" :param DstIp: 目标IP :type DstIp: str :param DstPort: 目标端口 :type DstPort: str :param ProcessName: 目标进程 :type ProcessName: str :param ImageIds: 镜像id数组,为空代表全部 :type ImageIds: list of str :param Id: 白名单id,如果新建则id为空 :type Id: str """ self.DstIp = None self.DstPort = None self.ProcessName = None self.ImageIds = None self.Id = None def _deserialize(self, params): self.DstIp = params.get("DstIp") self.DstPort = params.get("DstPort") self.ProcessName = params.get("ProcessName") self.ImageIds = params.get("ImageIds") self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RiskSyscallEventDescription(AbstractModel): """运行时容器高危系统调用事件描述信息 """ def __init__(self): r""" :param Description: 描述信息 :type Description: str :param Solution: 解决方案 :type Solution: str :param Remark: 事件备注信息 注意:此字段可能返回 null,表示取不到有效值。 :type Remark: str :param SyscallName: 系统调用名称 :type SyscallName: str """ self.Description = None self.Solution = None self.Remark = None self.SyscallName = None def _deserialize(self, params): self.Description = params.get("Description") self.Solution = params.get("Solution") self.Remark = params.get("Remark") self.SyscallName = params.get("SyscallName") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RiskSyscallEventInfo(AbstractModel): """容器安全运行时高危系统调用信息 """ def __init__(self): r""" :param ProcessName: 进程名称 :type ProcessName: str :param ProcessPath: 进程路径 :type ProcessPath: str :param ImageId: 镜像id :type ImageId: str :param ContainerId: 容器id :type ContainerId: str :param ImageName: 镜像名 :type ImageName: str :param ContainerName: 容器名 :type ContainerName: str :param FoundTime: 生成时间 :type FoundTime: str :param Solution: 事件解决方案 :type Solution: str :param Description: 事件详细描述 :type Description: str :param SyscallName: 系统调用名称 :type SyscallName: str :param Status: 状态,EVENT_UNDEAL:事件未处理 EVENT_DEALED:事件已经处理 EVENT_INGNORE:事件已经忽略 EVENT_ADD_WHITE:时间已经加白 :type Status: str :param EventId: 事件id :type EventId: str :param NodeName: 节点名称 :type NodeName: str :param PodName: pod(实例)的名字 :type PodName: str :param Remark: 备注 :type Remark: str :param RuleExist: 系统监控名称是否存在 :type RuleExist: bool :param EventCount: 事件数量 :type EventCount: int :param LatestFoundTime: 最近生成时间 :type LatestFoundTime: str """ self.ProcessName = None self.ProcessPath = None self.ImageId = None self.ContainerId = None self.ImageName = None self.ContainerName = None self.FoundTime = None self.Solution = None self.Description = None self.SyscallName = None self.Status = None self.EventId = None self.NodeName = None self.PodName = None self.Remark = None self.RuleExist = None self.EventCount = None self.LatestFoundTime = None def _deserialize(self, params): self.ProcessName = params.get("ProcessName") self.ProcessPath = params.get("ProcessPath") self.ImageId = params.get("ImageId") self.ContainerId = params.get("ContainerId") self.ImageName = params.get("ImageName") self.ContainerName = params.get("ContainerName") self.FoundTime = params.get("FoundTime") self.Solution = params.get("Solution") self.Description = params.get("Description") self.SyscallName = params.get("SyscallName") self.Status = params.get("Status") self.EventId = params.get("EventId") self.NodeName = params.get("NodeName") self.PodName = params.get("PodName") self.Remark = params.get("Remark") self.RuleExist = params.get("RuleExist") self.EventCount = params.get("EventCount") self.LatestFoundTime = params.get("LatestFoundTime") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RiskSyscallWhiteListBaseInfo(AbstractModel): """高危系统调用白名单信息 """ def __init__(self): r""" :param Id: 白名单id :type Id: str :param ImageCount: 镜像数量 :type ImageCount: int :param ProcessPath: 连接进程路径 :type ProcessPath: str :param SyscallNames: 系统调用名称列表 :type SyscallNames: list of str :param CreateTime: 创建时间 :type CreateTime: str :param UpdateTime: 更新时间 :type UpdateTime: str :param IsGlobal: 是否是全局白名单,true全局 :type IsGlobal: bool :param ImageIds: 镜像id数组 :type ImageIds: list of str """ self.Id = None self.ImageCount = None self.ProcessPath = None self.SyscallNames = None self.CreateTime = None self.UpdateTime = None self.IsGlobal = None self.ImageIds = None def _deserialize(self, params): self.Id = params.get("Id") self.ImageCount = params.get("ImageCount") self.ProcessPath = params.get("ProcessPath") self.SyscallNames = params.get("SyscallNames") self.CreateTime = params.get("CreateTime") self.UpdateTime = params.get("UpdateTime") self.IsGlobal = params.get("IsGlobal") self.ImageIds = params.get("ImageIds") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RiskSyscallWhiteListInfo(AbstractModel): """高危系统调用白名单信息 """ def __init__(self): r""" :param ImageIds: 镜像id数组,为空代表全部 :type ImageIds: list of str :param SyscallNames: 系统调用名称,通过DescribeRiskSyscallNames接口获取枚举列表 :type SyscallNames: list of str :param ProcessPath: 目标进程 :type ProcessPath: str :param Id: 白名单id,如果新建则id为空 :type Id: str """ self.ImageIds = None self.SyscallNames = None self.ProcessPath = None self.Id = None def _deserialize(self, params): self.ImageIds = params.get("ImageIds") self.SyscallNames = params.get("SyscallNames") self.ProcessPath = params.get("ProcessPath") self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RuleBaseInfo(AbstractModel): """运行时安全,策略基本信息 """ def __init__(self): r""" :param IsDefault: true: 默认策略,false:自定义策略 :type IsDefault: bool :param EffectImageCount: 策略生效镜像数量 :type EffectImageCount: int :param RuleId: 策略Id :type RuleId: str :param UpdateTime: 策略更新时间, 存在为空的情况 注意:此字段可能返回 null,表示取不到有效值。 :type UpdateTime: str :param RuleName: 策略名字 :type RuleName: str :param EditUserName: 编辑用户名称 :type EditUserName: str :param IsEnable: true: 策略启用,false:策略禁用 :type IsEnable: bool """ self.IsDefault = None self.EffectImageCount = None self.RuleId = None self.UpdateTime = None self.RuleName = None self.EditUserName = None self.IsEnable = None def _deserialize(self, params): self.IsDefault = params.get("IsDefault") self.EffectImageCount = params.get("EffectImageCount") self.RuleId = params.get("RuleId") self.UpdateTime = params.get("UpdateTime") self.RuleName = params.get("RuleName") self.EditUserName = params.get("EditUserName") self.IsEnable = params.get("IsEnable") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RunTimeEventBaseInfo(AbstractModel): """运行时安全事件基本信息 """ def __init__(self): r""" :param EventId: 事件唯一ID :type EventId: str :param FoundTime: 事件发现时间 :type FoundTime: str :param ContainerId: 容器id :type ContainerId: str :param ContainerName: 容器名称 :type ContainerName: str :param ImageId: 镜像id :type ImageId: str :param ImageName: 镜像名称 :type ImageName: str :param NodeName: 节点名称 :type NodeName: str :param PodName: Pod名称 :type PodName: str :param Status: 状态, “EVENT_UNDEAL”:事件未处理 "EVENT_DEALED":事件已经处理 "EVENT_INGNORE":事件已经忽略 :type Status: str :param EventName: 事件名称: 宿主机文件访问逃逸、 Syscall逃逸、 MountNamespace逃逸、 程序提权逃逸、 特权容器启动逃逸、 敏感路径挂载 恶意进程启动 文件篡改 :type EventName: str :param EventType: 事件类型 ESCAPE_HOST_ACESS_FILE:宿主机文件访问逃逸 ESCAPE_MOUNT_NAMESPACE:MountNamespace逃逸 ESCAPE_PRIVILEDGE:程序提权逃逸 ESCAPE_PRIVILEDGE_CONTAINER_START:特权容器启动逃逸 ESCAPE_MOUNT_SENSITIVE_PTAH:敏感路径挂载 ESCAPE_SYSCALL:Syscall逃逸 :type EventType: str :param EventCount: 事件数量 :type EventCount: int :param LatestFoundTime: 最近生成时间 :type LatestFoundTime: str :param HostIP: 内网ip 注意:此字段可能返回 null,表示取不到有效值。 :type HostIP: str :param ClientIP: 外网ip 注意:此字段可能返回 null,表示取不到有效值。 :type ClientIP: str """ self.EventId = None self.FoundTime = None self.ContainerId = None self.ContainerName = None self.ImageId = None self.ImageName = None self.NodeName = None self.PodName = None self.Status = None self.EventName = None self.EventType = None self.EventCount = None self.LatestFoundTime = None self.HostIP = None self.ClientIP = None def _deserialize(self, params): self.EventId = params.get("EventId") self.FoundTime = params.get("FoundTime") self.ContainerId = params.get("ContainerId") self.ContainerName = params.get("ContainerName") self.ImageId = params.get("ImageId") self.ImageName = params.get("ImageName") self.NodeName = params.get("NodeName") self.PodName = params.get("PodName") self.Status = params.get("Status") self.EventName = params.get("EventName") self.EventType = params.get("EventType") self.EventCount = params.get("EventCount") self.LatestFoundTime = params.get("LatestFoundTime") self.HostIP = params.get("HostIP") self.ClientIP = params.get("ClientIP") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RunTimeFilters(AbstractModel): """容器安全 描述键值对过滤器,用于条件过滤查询。例如过滤ID、名称、状态等 若存在多个Filter时,Filter间的关系为逻辑与(AND)关系。 若同一个Filter存在多个Values,同一Filter下Values间的关系为逻辑或(OR)关系。 """ def __init__(self): r""" :param Name: 过滤键的名称 :type Name: str :param Values: 一个或者多个过滤值。 :type Values: list of str :param ExactMatch: 是否模糊查询 :type ExactMatch: bool """ self.Name = None self.Values = None self.ExactMatch = None def _deserialize(self, params): self.Name = params.get("Name") self.Values = params.get("Values") self.ExactMatch = params.get("ExactMatch") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RunTimeRiskInfo(AbstractModel): """运行时风险信息 """ def __init__(self): r""" :param Cnt: 数量 :type Cnt: int :param Level: 风险等级: CRITICAL: 严重 HIGH: 高 MEDIUM:中 LOW: 低 :type Level: str """ self.Cnt = None self.Level = None def _deserialize(self, params): self.Cnt = params.get("Cnt") self.Level = params.get("Level") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class RunTimeTendencyInfo(AbstractModel): """运行时趋势信息 """ def __init__(self): r""" :param CurTime: 当天时间 :type CurTime: str :param Cnt: 当前数量 :type Cnt: int """ self.CurTime = None self.Cnt = None def _deserialize(self, params): self.CurTime = params.get("CurTime") self.Cnt = params.get("Cnt") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ScanComplianceAssetsByPolicyItemRequest(AbstractModel): """ScanComplianceAssetsByPolicyItem请求参数结构体 """ def __init__(self): r""" :param CustomerPolicyItemId: 指定的检测项的ID :type CustomerPolicyItemId: int :param CustomerAssetIdSet: 要重新扫描的客户资产项ID的列表。 :type CustomerAssetIdSet: list of int non-negative """ self.CustomerPolicyItemId = None self.CustomerAssetIdSet = None def _deserialize(self, params): self.CustomerPolicyItemId = params.get("CustomerPolicyItemId") self.CustomerAssetIdSet = params.get("CustomerAssetIdSet") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ScanComplianceAssetsByPolicyItemResponse(AbstractModel): """ScanComplianceAssetsByPolicyItem返回参数结构体 """ def __init__(self): r""" :param TaskId: 返回重新检测任务的ID。 :type TaskId: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskId = None self.RequestId = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.RequestId = params.get("RequestId") class ScanComplianceAssetsRequest(AbstractModel): """ScanComplianceAssets请求参数结构体 """ def __init__(self): r""" :param CustomerAssetIdSet: 要重新扫描的客户资产项ID的列表。 :type CustomerAssetIdSet: list of int non-negative """ self.CustomerAssetIdSet = None def _deserialize(self, params): self.CustomerAssetIdSet = params.get("CustomerAssetIdSet") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ScanComplianceAssetsResponse(AbstractModel): """ScanComplianceAssets返回参数结构体 """ def __init__(self): r""" :param TaskId: 返回重新检测任务的ID。 :type TaskId: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskId = None self.RequestId = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.RequestId = params.get("RequestId") class ScanCompliancePolicyItemsRequest(AbstractModel): """ScanCompliancePolicyItems请求参数结构体 """ def __init__(self): r""" :param CustomerPolicyItemIdSet: 要重新扫描的客户检测项的列表。 :type CustomerPolicyItemIdSet: list of int non-negative """ self.CustomerPolicyItemIdSet = None def _deserialize(self, params): self.CustomerPolicyItemIdSet = params.get("CustomerPolicyItemIdSet") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ScanCompliancePolicyItemsResponse(AbstractModel): """ScanCompliancePolicyItems返回参数结构体 """ def __init__(self): r""" :param TaskId: 返回重新检测任务的ID。 :type TaskId: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskId = None self.RequestId = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.RequestId = params.get("RequestId") class ScanComplianceScanFailedAssetsRequest(AbstractModel): """ScanComplianceScanFailedAssets请求参数结构体 """ def __init__(self): r""" :param CustomerAssetIdSet: 要重新扫描的客户资产项ID的列表。 :type CustomerAssetIdSet: list of int non-negative """ self.CustomerAssetIdSet = None def _deserialize(self, params): self.CustomerAssetIdSet = params.get("CustomerAssetIdSet") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ScanComplianceScanFailedAssetsResponse(AbstractModel): """ScanComplianceScanFailedAssets返回参数结构体 """ def __init__(self): r""" :param TaskId: 返回重新检测任务的ID。 :type TaskId: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.TaskId = None self.RequestId = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.RequestId = params.get("RequestId") class SecTendencyEventInfo(AbstractModel): """运行时安全事件趋势信息 """ def __init__(self): r""" :param EventSet: 趋势列表 :type EventSet: list of RunTimeTendencyInfo :param EventType: 事件类型: ET_ESCAPE : 容器逃逸 ET_REVERSE_SHELL: 反弹shell ET_RISK_SYSCALL:高危系统调用 ET_ABNORMAL_PROCESS: 异常进程 ET_ACCESS_CONTROL 文件篡改 :type EventType: str """ self.EventSet = None self.EventType = None def _deserialize(self, params): if params.get("EventSet") is not None: self.EventSet = [] for item in params.get("EventSet"): obj = RunTimeTendencyInfo() obj._deserialize(item) self.EventSet.append(obj) self.EventType = params.get("EventType") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class ServiceInfo(AbstractModel): """容器安全服务信息列表 """ def __init__(self): r""" :param ServiceID: 服务id :type ServiceID: str :param HostID: 主机id :type HostID: str :param HostIP: 主机ip :type HostIP: str :param ContainerName: 容器名 :type ContainerName: str :param Type: 服务名 例如nginx/redis :type Type: str :param Version: 版本 :type Version: str :param RunAs: 账号 :type RunAs: str :param Listen: 监听端口 :type Listen: list of str :param Config: 配置 :type Config: str :param ProcessCnt: 关联进程数 :type ProcessCnt: int :param AccessLog: 访问日志 :type AccessLog: str :param ErrorLog: 错误日志 :type ErrorLog: str :param DataPath: 数据目录 :type DataPath: str :param WebRoot: web目录 :type WebRoot: str :param Pids: 关联的进程id :type Pids: list of int non-negative :param MainType: 服务类型 app,web,db :type MainType: str :param Exe: 执行文件 :type Exe: str :param Parameter: 服务命令行参数 :type Parameter: str :param ContainerId: 容器id :type ContainerId: str :param HostName: 主机名称 :type HostName: str :param PublicIp: 外网ip :type PublicIp: str """ self.ServiceID = None self.HostID = None self.HostIP = None self.ContainerName = None self.Type = None self.Version = None self.RunAs = None self.Listen = None self.Config = None self.ProcessCnt = None self.AccessLog = None self.ErrorLog = None self.DataPath = None self.WebRoot = None self.Pids = None self.MainType = None self.Exe = None self.Parameter = None self.ContainerId = None self.HostName = None self.PublicIp = None def _deserialize(self, params): self.ServiceID = params.get("ServiceID") self.HostID = params.get("HostID") self.HostIP = params.get("HostIP") self.ContainerName = params.get("ContainerName") self.Type = params.get("Type") self.Version = params.get("Version") self.RunAs = params.get("RunAs") self.Listen = params.get("Listen") self.Config = params.get("Config") self.ProcessCnt = params.get("ProcessCnt") self.AccessLog = params.get("AccessLog") self.ErrorLog = params.get("ErrorLog") self.DataPath = params.get("DataPath") self.WebRoot = params.get("WebRoot") self.Pids = params.get("Pids") self.MainType = params.get("MainType") self.Exe = params.get("Exe") self.Parameter = params.get("Parameter") self.ContainerId = params.get("ContainerId") self.HostName = params.get("HostName") self.PublicIp = params.get("PublicIp") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class SetCheckModeRequest(AbstractModel): """SetCheckMode请求参数结构体 """ def __init__(self): r""" :param ClusterIds: 要设置的集群ID列表 :type ClusterIds: list of str :param ClusterCheckMode: 集群检查模式(正常模式"Cluster_Normal"、主动模式"Cluster_Actived"、不设置"Cluster_Unset") :type ClusterCheckMode: str :param ClusterAutoCheck: 0不设置 1打开 2关闭 :type ClusterAutoCheck: int """ self.ClusterIds = None self.ClusterCheckMode = None self.ClusterAutoCheck = None def _deserialize(self, params): self.ClusterIds = params.get("ClusterIds") self.ClusterCheckMode = params.get("ClusterCheckMode") self.ClusterAutoCheck = params.get("ClusterAutoCheck") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class SetCheckModeResponse(AbstractModel): """SetCheckMode返回参数结构体 """ def __init__(self): r""" :param SetCheckResult: "Succ"表示设置成功,"Failed"表示设置失败 :type SetCheckResult: str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.SetCheckResult = None self.RequestId = None def _deserialize(self, params): self.SetCheckResult = params.get("SetCheckResult") self.RequestId = params.get("RequestId") class SoftQuotaDayInfo(AbstractModel): """后付费详情 """ def __init__(self): r""" :param PayTime: 扣费时间 :type PayTime: str :param CoresCnt: 计费核数 :type CoresCnt: int """ self.PayTime = None self.CoresCnt = None def _deserialize(self, params): self.PayTime = params.get("PayTime") self.CoresCnt = params.get("CoresCnt") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class StopVirusScanTaskRequest(AbstractModel): """StopVirusScanTask请求参数结构体 """ def __init__(self): r""" :param TaskId: 任务ID :type TaskId: str :param ContainerIds: 需要停止的容器id 为空默认停止整个任务 :type ContainerIds: list of str """ self.TaskId = None self.ContainerIds = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.ContainerIds = params.get("ContainerIds") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class StopVirusScanTaskResponse(AbstractModel): """StopVirusScanTask返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class SyncAssetImageRegistryAssetRequest(AbstractModel): """SyncAssetImageRegistryAsset请求参数结构体 """ class SyncAssetImageRegistryAssetResponse(AbstractModel): """SyncAssetImageRegistryAsset返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class UpdateAssetImageRegistryRegistryDetailRequest(AbstractModel): """UpdateAssetImageRegistryRegistryDetail请求参数结构体 """ def __init__(self): r""" :param Name: 仓库名 :type Name: str :param Username: 用户名 :type Username: str :param Password: 密码 :type Password: str :param Url: 仓库url :type Url: str :param RegistryType: 仓库类型,列表:harbor :type RegistryType: str :param NetType: 网络类型,列表:public(公网) :type NetType: str :param RegistryVersion: 仓库版本 :type RegistryVersion: str :param RegistryRegion: 区域,列表:default(默认) :type RegistryRegion: str :param SpeedLimit: 限速 :type SpeedLimit: int :param Insecure: 安全模式(证书校验):0(默认) 非安全模式(跳过证书校验):1 :type Insecure: int """ self.Name = None self.Username = None self.Password = None self.Url = None self.RegistryType = None self.NetType = None self.RegistryVersion = None self.RegistryRegion = None self.SpeedLimit = None self.Insecure = None def _deserialize(self, params): self.Name = params.get("Name") self.Username = params.get("Username") self.Password = params.get("Password") self.Url = params.get("Url") self.RegistryType = params.get("RegistryType") self.NetType = params.get("NetType") self.RegistryVersion = params.get("RegistryVersion") self.RegistryRegion = params.get("RegistryRegion") self.SpeedLimit = params.get("SpeedLimit") self.Insecure = params.get("Insecure") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class UpdateAssetImageRegistryRegistryDetailResponse(AbstractModel): """UpdateAssetImageRegistryRegistryDetail返回参数结构体 """ def __init__(self): r""" :param HealthCheckErr: 连接错误信息 注意:此字段可能返回 null,表示取不到有效值。 :type HealthCheckErr: str :param NameRepeatErr: 名称错误信息 注意:此字段可能返回 null,表示取不到有效值。 :type NameRepeatErr: str :param RegistryId: 仓库唯一id 注意:此字段可能返回 null,表示取不到有效值。 :type RegistryId: int :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.HealthCheckErr = None self.NameRepeatErr = None self.RegistryId = None self.RequestId = None def _deserialize(self, params): self.HealthCheckErr = params.get("HealthCheckErr") self.NameRepeatErr = params.get("NameRepeatErr") self.RegistryId = params.get("RegistryId") self.RequestId = params.get("RequestId") class UpdateImageRegistryTimingScanTaskRequest(AbstractModel): """UpdateImageRegistryTimingScanTask请求参数结构体 """ def __init__(self): r""" :param ScanPeriod: 定时扫描周期 :type ScanPeriod: int :param Enable: 定时扫描开关 :type Enable: bool :param ScanTime: 定时扫描的时间 :type ScanTime: str :param ScanType: 扫描木马类型数组 :type ScanType: list of str :param Images: 扫描镜像 :type Images: list of ImageInfo :param All: 是否扫描所有 :type All: bool :param Id: 扫描镜像Id :type Id: list of int non-negative """ self.ScanPeriod = None self.Enable = None self.ScanTime = None self.ScanType = None self.Images = None self.All = None self.Id = None def _deserialize(self, params): self.ScanPeriod = params.get("ScanPeriod") self.Enable = params.get("Enable") self.ScanTime = params.get("ScanTime") self.ScanType = params.get("ScanType") if params.get("Images") is not None: self.Images = [] for item in params.get("Images"): obj = ImageInfo() obj._deserialize(item) self.Images.append(obj) self.All = params.get("All") self.Id = params.get("Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class UpdateImageRegistryTimingScanTaskResponse(AbstractModel): """UpdateImageRegistryTimingScanTask返回参数结构体 """ def __init__(self): r""" :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class VirusInfo(AbstractModel): """运行时木马列表信息 """ def __init__(self): r""" :param FileName: 文件名称 :type FileName: str :param FilePath: 文件路径 :type FilePath: str :param VirusName: 病毒名称 :type VirusName: str :param CreateTime: 创建时间 :type CreateTime: str :param ModifyTime: 更新时间 :type ModifyTime: str :param ContainerName: 容器名称 :type ContainerName: str :param ContainerId: 容器id :type ContainerId: str :param ContainerStatus: 容器状态,CS_RUNING:运行, CS_PAUSE:暂停,CS_STOP:停止, CS_CREATE:已经创建, CS_DESTORY:销毁 :type ContainerStatus: str :param ImageName: 镜像名称 :type ImageName: str :param ImageId: 镜像id :type ImageId: str :param Status: DEAL_NONE:文件待处理 DEAL_IGNORE:已经忽略 DEAL_ADD_WHITELIST:加白 DEAL_DEL:文件已经删除 DEAL_ISOLATE:已经隔离 DEAL_ISOLATING:隔离中 DEAL_ISOLATE_FAILED:隔离失败 DEAL_RECOVERING:恢复中 DEAL_RECOVER_FAILED: 恢复失败 :type Status: str :param Id: 事件id :type Id: str :param HarmDescribe: 事件描述 :type HarmDescribe: str :param SuggestScheme: 建议方案 :type SuggestScheme: str :param SubStatus: 失败子状态: FILE_NOT_FOUND:文件不存在 FILE_ABNORMAL:文件异常 FILE_ABNORMAL_DEAL_RECOVER:恢复文件时,文件异常 BACKUP_FILE_NOT_FOUND:备份文件不存在 CONTAINER_NOT_FOUND_DEAL_ISOLATE:隔离时,容器不存在 CONTAINER_NOT_FOUND_DEAL_RECOVER:恢复时,容器不存在 TIMEOUT: 超时 TOO_MANY: 任务过多 OFFLINE: 离线 INTERNAL: 服务内部错误 VALIDATION: 参数非法 :type SubStatus: str """ self.FileName = None self.FilePath = None self.VirusName = None self.CreateTime = None self.ModifyTime = None self.ContainerName = None self.ContainerId = None self.ContainerStatus = None self.ImageName = None self.ImageId = None self.Status = None self.Id = None self.HarmDescribe = None self.SuggestScheme = None self.SubStatus = None def _deserialize(self, params): self.FileName = params.get("FileName") self.FilePath = params.get("FilePath") self.VirusName = params.get("VirusName") self.CreateTime = params.get("CreateTime") self.ModifyTime = params.get("ModifyTime") self.ContainerName = params.get("ContainerName") self.ContainerId = params.get("ContainerId") self.ContainerStatus = params.get("ContainerStatus") self.ImageName = params.get("ImageName") self.ImageId = params.get("ImageId") self.Status = params.get("Status") self.Id = params.get("Id") self.HarmDescribe = params.get("HarmDescribe") self.SuggestScheme = params.get("SuggestScheme") self.SubStatus = params.get("SubStatus") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class VirusTaskInfo(AbstractModel): """运行时文件查杀任务容器列表信息 """ def __init__(self): r""" :param ContainerName: 容器名称 :type ContainerName: str :param ContainerId: 容器id :type ContainerId: str :param ImageName: 镜像名称 :type ImageName: str :param ImageId: 镜像Id :type ImageId: str :param HostName: 主机名称 :type HostName: str :param HostIp: 主机ip :type HostIp: str :param Status: 扫描状态: WAIT: 等待扫描 FAILED: 失败 SCANNING: 扫描中 FINISHED: 结束 CANCELING: 取消中 CANCELED: 已取消 CANCEL_FAILED: 取消失败 :type Status: str :param StartTime: 检测开始时间 :type StartTime: str :param EndTime: 检测结束时间 :type EndTime: str :param RiskCnt: 风险个数 :type RiskCnt: int :param Id: 事件id :type Id: str :param ErrorMsg: 错误原因: SEND_SUCCESSED: 下发成功 SCAN_WAIT: agent排队扫描等待中 OFFLINE: 离线 SEND_FAILED:下发失败 TIMEOUT: 超时 LOW_AGENT_VERSION: 客户端版本过低 AGENT_NOT_FOUND: 镜像所属客户端版不存在 TOO_MANY: 任务过多 VALIDATION: 参数非法 INTERNAL: 服务内部错误 MISC: 其他错误 UNAUTH: 所在镜像未授权 SEND_CANCEL_SUCCESSED:下发成功 :type ErrorMsg: str """ self.ContainerName = None self.ContainerId = None self.ImageName = None self.ImageId = None self.HostName = None self.HostIp = None self.Status = None self.StartTime = None self.EndTime = None self.RiskCnt = None self.Id = None self.ErrorMsg = None def _deserialize(self, params): self.ContainerName = params.get("ContainerName") self.ContainerId = params.get("ContainerId") self.ImageName = params.get("ImageName") self.ImageId = params.get("ImageId") self.HostName = params.get("HostName") self.HostIp = params.get("HostIp") self.Status = params.get("Status") self.StartTime = params.get("StartTime") self.EndTime = params.get("EndTime") self.RiskCnt = params.get("RiskCnt") self.Id = params.get("Id") self.ErrorMsg = params.get("ErrorMsg") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class WarningRule(AbstractModel): """告警配置策略 """ def __init__(self): r""" :param Type: 告警事件类型: 镜像仓库安全-木马:IMG_REG_VIRUS 镜像仓库安全-漏洞:IMG_REG_VUL 镜像仓库安全-敏感信息:IMG_REG_RISK 镜像安全-木马:IMG_VIRUS 镜像安全-漏洞:IMG_VUL 镜像安全-敏感信息:IMG_RISK 镜像安全-镜像拦截:IMG_INTERCEPT 运行时安全-容器逃逸:RUNTIME_ESCAPE 运行时安全-异常进程:RUNTIME_FILE 运行时安全-异常文件访问:RUNTIME_PROCESS 运行时安全-高危系统调用:RUNTIME_SYSCALL 运行时安全-反弹Shell:RUNTIME_REVERSE_SHELL 运行时安全-木马:RUNTIME_VIRUS :type Type: str :param Switch: 开关状态: 打开:ON 关闭:OFF :type Switch: str :param BeginTime: 告警开始时间,格式: HH:mm :type BeginTime: str :param EndTime: 告警结束时间,格式: HH:mm :type EndTime: str :param ControlBits: 告警等级策略控制,二进制位每位代表一个含义,值以字符串类型传递 控制开关分为高、中、低,则二进制位分别为:第1位:低,第2位:中,第3位:高,0表示关闭、1表示打开。 如:高危和中危打开告警,低危关闭告警,则二进制值为:110 告警类型不区分等级控制,则传1。 :type ControlBits: str """ self.Type = None self.Switch = None self.BeginTime = None self.EndTime = None self.ControlBits = None def _deserialize(self, params): self.Type = params.get("Type") self.Switch = params.get("Switch") self.BeginTime = params.get("BeginTime") self.EndTime = params.get("EndTime") self.ControlBits = params.get("ControlBits") memeber_set = set(params.keys()) for name, value in vars(self).items(): if name in memeber_set: memeber_set.remove(name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set))<|fim▁end|>
""" self.CustomerAssetId = None
<|file_name|>Font.js<|end_file_name|><|fim▁begin|>lychee.define('Font').exports(function(lychee) { var Class = function(spriteOrImages, settings) { this.settings = lychee.extend({}, this.defaults, settings); if (this.settings.kerning > this.settings.spacing) { this.settings.kerning = this.settings.spacing; } this.__cache = {}; this.__images = null; this.__sprite = null; if (Object.prototype.toString.call(spriteOrImages) === '[object Array]') { this.__images = spriteOrImages; } else { this.__sprite = spriteOrImages; } this.__init(); }; Class.prototype = { defaults: { // default charset from 32-126 charset: ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~', baseline: 0, spacing: 0, kerning: 0, map: null }, __init: function() { // Single Image Mode if (this.__images !== null) { this.__initImages(); // Sprite Image Mode } else if (this.__sprite !== null) { if (Object.prototype.toString.call(this.settings.map) === '[object Array]') { var test = this.settings.map[0]; if (Object.prototype.toString.call(test) === '[object Object]') { this.__initSpriteXY(); } else if (typeof test === 'number') { this.__initSpriteX(); } } } }, __initImages: function() { for (var c = 0, l = this.settings.charset.length; c < l; c++) { var image = this.__images[c] || null; if (image === null) continue; var chr = { id: this.settings.charset[c], image: image, width: image.width, height: image.height, x: 0, y: 0 }; this.__cache[chr.id] = chr; } }, __initSpriteX: function() { var offset = this.settings.spacing; for (var c = 0, l = this.settings.charset.length; c < l; c++) { var chr = { id: this.settings.charset[c], width: this.settings.map[c] + this.settings.spacing * 2, height: this.__sprite.height, real: this.settings.map[c], x: offset - this.settings.spacing, y: 0 }; offset += chr.width; this.__cache[chr.id] = chr; } }, __initSpriteXY: function() { <|fim▁hole|> var frame = this.settings.map[c]; var chr = { id: this.settings.charset[c], width: frame.width + this.settings.spacing * 2, height: frame.height, real: frame.width, x: frame.x - this.settings.spacing, y: frame.y }; this.__cache[chr.id] = chr; } }, get: function(id) { if (this.__cache[id] !== undefined) { return this.__cache[id]; } return null; }, getSettings: function() { return this.settings; }, getSprite: function() { return this.__sprite; } }; return Class; });<|fim▁end|>
for (var c = 0, l = this.settings.charset.length; c < l; c++) {
<|file_name|>test_bigaddrspace.py<|end_file_name|><|fim▁begin|>from test import support from test.support import bigaddrspacetest, MAX_Py_ssize_t import unittest import operator import sys class StrTest(unittest.TestCase): @bigaddrspacetest def test_concat(self): s1 = 'x' * MAX_Py_ssize_t self.assertRaises(OverflowError, operator.add, s1, '?') @bigaddrspacetest def test_optimized_concat(self): x = 'x' * MAX_Py_ssize_t try: x = x + '?' # this statement uses a fast path in ceval.c except OverflowError: pass else: self.fail("should have raised OverflowError") try:<|fim▁hole|> self.fail("should have raised OverflowError") self.assertEquals(len(x), MAX_Py_ssize_t) ### the following test is pending a patch # (http://mail.python.org/pipermail/python-dev/2006-July/067774.html) #@bigaddrspacetest #def test_repeat(self): # self.assertRaises(OverflowError, operator.mul, 'x', MAX_Py_ssize_t + 1) def test_main(): support.run_unittest(StrTest) if __name__ == '__main__': if len(sys.argv) > 1: support.set_memlimit(sys.argv[1]) test_main()<|fim▁end|>
x += '?' # this statement uses a fast path in ceval.c except OverflowError: pass else:
<|file_name|>meshconvert.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Module for converting various mesh formats.""" # Copyright (C) 2006 Anders Logg # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # DOLFIN 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 Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with DOLFIN. If not, see <http://www.gnu.org/licenses/>. # # Modified by Garth N. Wells (gmsh function) # Modified by Alexander H. Jarosch (gmsh fix) # Modified by Angelo Simone (Gmsh and Medit fix) # Modified by Andy R. Terrel (gmsh fix and triangle function) # Modified by Magnus Vikstrom (metis and scotch function) # Modified by Bartosz Sawicki (diffpack function) # Modified by Gideon Simpson (Exodus II function) # Modified by Kent-Andre Mardal (Star-CD function) # Modified by Nuno Lopes (fix for emc2 mesh format (medit version 0)) # Modified by Neilen Marais (add gmsh support for reading physical region) # Modified by Evan Lezar (add support for reading gmsh physical regions on facets) # Modified by Jan Blechta (add triangle support for marker on edges and attributes on triangles) # # Last changed: 2014-02-06 # NOTE: This module does not depend on (py)dolfin beeing installed. # NOTE: If future additions need that please import dolfin in a try: except: # NOTE: clause and tell the user to install dolfin if it is not installed. from __future__ import print_function import getopt import sys from instant import get_status_output import re import warnings import os.path import numpy import six from . import abaqus from . import xml_writer def format_from_suffix(suffix): "Return format for given suffix" if suffix == "xml": return "xml" elif suffix == "mesh": return "mesh" elif suffix == "gmsh": return "gmsh" elif suffix == "msh": return "gmsh" elif suffix == "gra": return "metis" elif suffix == "grf": return "scotch" elif suffix == "grid": return "diffpack" elif suffix == "inp": return "abaqus" elif suffix == "ncdf": return "NetCDF" elif suffix =="exo": return "ExodusII" elif suffix =="e": return "ExodusII" elif suffix == "vrt" or suffix == "cel": return "StarCD" elif suffix == "ele" or suffix == "node": return "Triangle" else: _error("Sorry, unknown suffix %s." % suffix) def mesh2xml(ifilename, ofilename): """Convert between .mesh and .xml, parser implemented as a state machine: 0 = read 'Vertices' 1 = read number of vertices 2 = read next vertex 3 = read 'Triangles' or 'Tetrahedra' 4 = read number of cells 5 = read next cell 6 = done """ print("Converting from Medit format (.mesh) to DOLFIN XML format") # Open files ifile = open(ifilename, "r") ofile = open(ofilename, "w") # Scan file for cell type cell_type = None dim = 0 while 1: # Read next line line = ifile.readline() if not line: break # Remove newline line = line.strip(" \n\r").split(" ") # Read dimension either on same line or following line if line[0] == "Dimension": if (len(line) == 2): line = line[1] else: line = ifile.readline() num_dims = int(line) if num_dims == 2: cell_type = "triangle" dim = 2 elif num_dims == 3: cell_type = "tetrahedron" dim = 3 break # Check that we got the cell type if cell_type == None: _error("Unable to find cell type.") # Step to beginning of file ifile.seek(0) # Write header xml_writer.write_header_mesh(ofile, cell_type, dim) # Current state state = 0 # Write data num_vertices_read = 0 num_cells_read = 0 while 1: # Read next line line = ifile.readline() if not line: break # Skip comments if line[0] == '#': continue # Remove newline line = line.rstrip("\n\r") if state == 0: if line == "Vertices" or line == " Vertices": state += 1 elif state == 1: num_vertices = int(line) xml_writer.write_header_vertices(ofile, num_vertices) state +=1 elif state == 2: if num_dims == 2: (x, y, tmp) = line.split() x = float(x) y = float(y) z = 0.0 elif num_dims == 3: (x, y, z, tmp) = line.split() x = float(x) y = float(y) z = float(z) xml_writer.write_vertex(ofile, num_vertices_read, x, y, z) num_vertices_read +=1 if num_vertices == num_vertices_read: xml_writer.write_footer_vertices(ofile) state += 1 elif state == 3: if (line == "Triangles" or line == " Triangles") and num_dims == 2: state += 1 if line == "Tetrahedra" and num_dims == 3: state += 1 elif state == 4: num_cells = int(line) xml_writer.write_header_cells(ofile, num_cells) state +=1 elif state == 5: if num_dims == 2: (n0, n1, n2, tmp) = line.split() n0 = int(n0) - 1 n1 = int(n1) - 1 n2 = int(n2) - 1 xml_writer.write_cell_triangle(ofile, num_cells_read, n0, n1, n2) elif num_dims == 3: (n0, n1, n2, n3, tmp) = line.split() n0 = int(n0) - 1 n1 = int(n1) - 1 n2 = int(n2) - 1 n3 = int(n3) - 1 xml_writer.write_cell_tetrahedron(ofile, num_cells_read, n0, n1, n2, n3) num_cells_read +=1 if num_cells == num_cells_read: xml_writer.write_footer_cells(ofile) state += 1 elif state == 6: break # Check that we got all data if state == 6: print("Conversion done") else: _error("Missing data, unable to convert") # Write footer xml_writer.write_footer_mesh(ofile) # Close files ifile.close() ofile.close() def gmsh2xml(ifilename, handler): """Convert between .gmsh v2.0 format (http://www.geuz.org/gmsh/) and .xml, parser implemented as a state machine: 0 = read 'MeshFormat' 1 = read mesh format data 2 = read 'EndMeshFormat' 3 = read 'Nodes' 4 = read number of vertices 5 = read vertices 6 = read 'EndNodes' 7 = read 'Elements' 8 = read number of cells 9 = read cells 10 = done Afterwards, extract physical region numbers if they are defined in the mesh file as a mesh function. """ print("Converting from Gmsh format (.msh, .gmsh) to DOLFIN XML format") # The dimension of the gmsh element types supported here as well as the dolfin cell types for each dimension gmsh_dim = {15: 0, 1: 1, 2: 2, 4: 3} cell_type_for_dim = {1: "interval", 2: "triangle", 3: "tetrahedron" } # the gmsh element types supported for conversion supported_gmsh_element_types = [1, 2, 4, 15] # Open files ifile = open(ifilename, "r") # Scan file for cell type cell_type = None highest_dim = 0 line = ifile.readline() while line: # Remove newline line = line.rstrip("\n\r") # Read dimension if line.find("$Elements") == 0:<|fim▁hole|> line = ifile.readline() num_elements = int(line) if num_elements == 0: _error("No elements found in gmsh file.") line = ifile.readline() # Now iterate through elements to find largest dimension. Gmsh # format might include elements of lower dimensions in the element list. # We also need to count number of elements of correct dimensions. # Also determine which vertices are not used. dim_count = {0: 0, 1: 0, 2: 0, 3: 0} vertices_used_for_dim = {0: [], 1: [], 2: [], 3: []} # Array used to store gmsh tags for 1D (type 1/line), 2D (type 2/triangular) elements and 3D (type 4/tet) elements tags_for_dim = {0: [], 1: [], 2: [], 3: []} while line.find("$EndElements") == -1: element = line.split() elem_type = int(element[1]) num_tags = int(element[2]) if elem_type in supported_gmsh_element_types: dim = gmsh_dim[elem_type] if highest_dim < dim: highest_dim = dim node_num_list = [int(node) for node in element[3 + num_tags:]] vertices_used_for_dim[dim].extend(node_num_list) if num_tags > 0: tags_for_dim[dim].append(tuple(int(tag) for tag in element[3:3+num_tags])) dim_count[dim] += 1 else: #TODO: output a warning here. "gmsh element type %d not supported" % elem_type pass line = ifile.readline() else: # Read next line line = ifile.readline() # Check that we got the cell type and set num_cells_counted if highest_dim == 0: _error("Unable to find cells of supported type.") num_cells_counted = dim_count[highest_dim] vertex_set = set(vertices_used_for_dim[highest_dim]) vertices_used_for_dim[highest_dim] = None vertex_dict = {} for n,v in enumerate(vertex_set): vertex_dict[v] = n # Step to beginning of file ifile.seek(0) # Set mesh type handler.set_mesh_type(cell_type_for_dim[highest_dim], highest_dim) # Initialise node list (gmsh does not export all vertexes in order) nodelist = {} # Current state state = 0 # Write data num_vertices_read = 0 num_cells_read = 0 # Only import the dolfin objects if facet markings exist process_facets = False if len(tags_for_dim[highest_dim-1]) > 0: # first construct the mesh try: from dolfin import MeshEditor, Mesh except ImportError: _error("DOLFIN must be installed to handle Gmsh boundary regions") mesh = Mesh() mesh_editor = MeshEditor () mesh_editor.open( mesh, highest_dim, highest_dim ) process_facets = True else: # TODO: Output a warning or an error here me = None while state != 10: # Read next line line = ifile.readline() if not line: break # Skip comments if line[0] == '#': continue # Remove newline line = line.rstrip("\n\r") if state == 0: if line == "$MeshFormat": state = 1 elif state == 1: (version, file_type, data_size) = line.split() state = 2 elif state == 2: if line == "$EndMeshFormat": state = 3 elif state == 3: if line == "$Nodes": state = 4 elif state == 4: num_vertices = len(vertex_dict) handler.start_vertices(num_vertices) if process_facets: mesh_editor.init_vertices_global(num_vertices, num_vertices) state = 5 elif state == 5: (node_no, x, y, z) = line.split() node_no = int(node_no) x,y,z = [float(xx) for xx in (x,y,z)] if node_no in vertex_dict: node_no = vertex_dict[node_no] else: continue nodelist[int(node_no)] = num_vertices_read handler.add_vertex(num_vertices_read, [x, y, z]) if process_facets: if highest_dim == 1: coords = numpy.array([x]) elif highest_dim == 2: coords = numpy.array([x, y]) elif highest_dim == 3: coords = numpy.array([x, y, z]) mesh_editor.add_vertex(num_vertices_read, coords) num_vertices_read +=1 if num_vertices == num_vertices_read: handler.end_vertices() state = 6 elif state == 6: if line == "$EndNodes": state = 7 elif state == 7: if line == "$Elements": state = 8 elif state == 8: handler.start_cells(num_cells_counted) if process_facets: mesh_editor.init_cells_global(num_cells_counted, num_cells_counted) state = 9 elif state == 9: element = line.split() elem_type = int(element[1]) num_tags = int(element[2]) if elem_type in supported_gmsh_element_types: dim = gmsh_dim[elem_type] else: dim = 0 if dim == highest_dim: node_num_list = [vertex_dict[int(node)] for node in element[3 + num_tags:]] for node in node_num_list: if not node in nodelist: _error("Vertex %d of %s %d not previously defined." % (node, cell_type_for_dim[dim], num_cells_read)) cell_nodes = [nodelist[n] for n in node_num_list] handler.add_cell(num_cells_read, cell_nodes) if process_facets: cell_nodes = numpy.array([nodelist[n] for n in node_num_list], dtype=numpy.uintp) mesh_editor.add_cell(num_cells_read, cell_nodes) num_cells_read +=1 if num_cells_counted == num_cells_read: handler.end_cells() if process_facets: mesh_editor.close() state = 10 elif state == 10: break # Write mesh function based on the Physical Regions defined by # gmsh, but only if they are not all zero. All zero physical # regions indicate that no physical regions were defined. if highest_dim not in [1,2,3]: _error("Gmsh tags not supported for dimension %i. Probably a bug" % dim) tags = tags_for_dim[highest_dim] physical_regions = tuple(tag[0] for tag in tags) if not all(tag == 0 for tag in physical_regions): handler.start_meshfunction("physical_region", dim, num_cells_counted) for i, physical_region in enumerate(physical_regions): handler.add_entity_meshfunction(i, physical_region) handler.end_meshfunction() # Now process the facet markers tags = tags_for_dim[highest_dim-1] if (len(tags) > 0) and (mesh is not None): physical_regions = tuple(tag[0] for tag in tags) if not all(tag == 0 for tag in physical_regions): mesh.init(highest_dim-1,0) # Get the facet-node connectivity information (reshape as a row of node indices per facet) if highest_dim==1: # for 1d meshes the mesh topology returns the vertex to vertex map, which isn't what we want # as facets are vertices facets_as_nodes = numpy.array([[i] for i in range(mesh.num_facets())]) else: facets_as_nodes = mesh.topology()(highest_dim-1,0)().reshape ( mesh.num_facets(), highest_dim ) # Build the reverse map nodes_as_facets = {} for facet in range(mesh.num_facets()): nodes_as_facets[tuple(facets_as_nodes[facet,:])] = facet data = [int(0*k) for k in range(mesh.num_facets()) ] for i, physical_region in enumerate(physical_regions): nodes = [n-1 for n in vertices_used_for_dim[highest_dim-1][highest_dim*i:(highest_dim*i+highest_dim)]] nodes.sort() if physical_region != 0: try: index = nodes_as_facets[tuple(nodes)] data[index] = physical_region except IndexError: raise Exception ( "The facet (%d) was not found to mark: %s" % (i, nodes) ) # Create and initialise the mesh function handler.start_meshfunction("facet_region", highest_dim-1, mesh.num_facets() ) for index, physical_region in enumerate ( data ): handler.add_entity_meshfunction(index, physical_region) handler.end_meshfunction() # Check that we got all data if state == 10: print("Conversion done") else: _error("Missing data, unable to convert \n\ Did you use version 2.0 of the gmsh file format?") # Close files ifile.close() def triangle2xml(ifilename, ofilename): """Convert between triangle format (http://www.cs.cmu.edu/~quake/triangle.html) and .xml. The given ifilename should be the prefix for the corresponding .node, and .ele files. """ def get_next_line (fp): """Helper function for skipping comments and blank lines""" line = fp.readline() if line == '': _error("Hit end of file prematurely.") line = line.strip() if not (line.startswith('#') or line == ''): return line return get_next_line(fp) print("Converting from Triangle format {.node, .ele} to DOLFIN XML format") # Open files for suffix in [".node", ".ele"]: if suffix in ifilename and ifilename[-len(suffix):] == suffix: ifilename = ifilename.replace(suffix, "") node_file = open(ifilename+".node", "r") ele_file = open(ifilename+".ele", "r") ofile = open(ofilename, "w") try: edge_file = open(ifilename+".edge", "r") print("Found .edge file") except IOError: edge_file = None # Read all the nodes nodes = {} num_nodes, dim, attr, bound = list(map(int, get_next_line(node_file).split())) while len(nodes) < num_nodes: node, x, y = get_next_line(node_file).split()[:3] nodes[int(node)] = (float(x), float(y)) # Read all the triangles tris = {} tri_attrs = {} num_tris, n_per_tri, attrs = list(map(int, get_next_line(ele_file).split())) while len(tris) < num_tris: line = get_next_line(ele_file).split() tri, n1, n2, n3 = list(map(int, line[:4])) # vertices are ordered according to current UFC ordering scheme - # - may change in future! tris[tri] = tuple(sorted((n1, n2, n3))) tri_attrs[tri] = tuple(map(float, line[4:4+attrs])) # Read all the boundary markers from edges edge_markers_global = {} edge_markers_local = [] got_negative_edge_markers = False if edge_file is not None: num_edges, num_edge_markers = list(map(int, get_next_line(edge_file).split())) if num_edge_markers == 1: while len(edge_markers_global) < num_edges: edge, v1, v2, marker = list(map(int, get_next_line(edge_file).split())) if marker < 0: got_negative_edge_markers = True edge_markers_global[tuple(sorted((v1, v2)))] = marker if got_negative_edge_markers: print("Some edge markers are negative! dolfin will increase "\ "them by probably 2**32 when loading xml. "\ "Consider using non-negative edge markers only.") for tri, vertices in six.iteritems(tris): v0, v1, v2 = sorted((vertices[0:3])) try: edge_markers_local.append((tri, 0, \ edge_markers_global[(v1, v2)])) edge_markers_local.append((tri, 1, \ edge_markers_global[(v0, v2)])) edge_markers_local.append((tri, 2, \ edge_markers_global[(v0, v1)])) except IndexError: raise Exception("meshconvert.py: The facet was not found.") elif num_edge_markers == 0: print("...but no markers in it. Ignoring it") else: print("...but %d markers specified in it. It won't be processed."\ %num_edge_markers) # Write everything out xml_writer.write_header_mesh(ofile, "triangle", 2) xml_writer.write_header_vertices(ofile, num_nodes) node_off = 0 if 0 in nodes else -1 for node, node_t in six.iteritems(nodes): xml_writer.write_vertex(ofile, node+node_off, node_t[0], node_t[1], 0.0) xml_writer.write_footer_vertices(ofile) xml_writer.write_header_cells(ofile, num_tris) tri_off = 0 if 0 in tris else -1 for tri, tri_t in six.iteritems(tris): xml_writer.write_cell_triangle(ofile, tri+tri_off, tri_t[0] + node_off, tri_t[1] + node_off, tri_t[2] + node_off) xml_writer.write_footer_cells(ofile) if len(edge_markers_local) > 0: xml_writer.write_header_domains(ofile) xml_writer.write_header_meshvaluecollection(ofile, \ "edge markers", 1, len(edge_markers_local), "uint") for tri, local_edge, marker in edge_markers_local: xml_writer.write_entity_meshvaluecollection(ofile, \ 1, tri+tri_off, marker, local_edge) xml_writer.write_footer_meshvaluecollection(ofile) xml_writer.write_footer_domains(ofile) xml_writer.write_footer_mesh(ofile) for i in range(attrs): afilename = ofilename.replace(".xml", ".attr"+str(i)+".xml") afile = open(afilename, "w") xml_writer.write_header_meshfunction2(afile) xml_writer.write_header_meshvaluecollection(afile, \ "triangle attribs "+str(i), 2, num_tris, "double") for tri, tri_a in six.iteritems(tri_attrs): xml_writer.write_entity_meshvaluecollection(afile, \ 2, tri+tri_off, tri_a[i], 0) xml_writer.write_footer_meshvaluecollection(afile) xml_writer.write_footer_meshfunction(afile) print("triangle attributes from .ele file written to "+afilename) afile.close() # Close files node_file.close() ele_file.close() if edge_file is not None: edge_file.close() ofile.close() def xml_old2xml(ifilename, ofilename): "Convert from old DOLFIN XML format to new." print("Converting from old (pre DOLFIN 0.6.2) to new DOLFIN XML format...") # Open files ifile = open(ifilename, "r") ofile = open(ofilename, "w") # Scan file for cell type (assuming there is just one) cell_type = None dim = 0 while 1: # Read next line line = ifile.readline() if not line: break # Read dimension if "<triangle" in line: cell_type = "triangle" dim = 2 break elif "<tetrahedron" in line: cell_type = "tetrahedron" dim = 3 break # Step to beginning of file ifile.seek(0) # Read lines and make changes while 1: # Read next line line = ifile.readline() if not line: break # Modify line if "xmlns" in line: line = "<dolfin xmlns:dolfin=\"http://fenicsproject.org\">\n" if "<mesh>" in line: line = " <mesh celltype=\"%s\" dim=\"%d\">\n" % (cell_type, dim) if dim == 2 and " z=\"0.0\"" in line: line = line.replace(" z=\"0.0\"", "") if " name=" in line: line = line.replace(" name=", " index=") if " name =" in line: line = line.replace(" name =", " index=") if "n0" in line: line = line.replace("n0", "v0") if "n1" in line: line = line.replace("n1", "v1") if "n2" in line: line = line.replace("n2", "v2") if "n3" in line: line = line.replace("n3", "v3") # Write line ofile.write(line) # Close files ifile.close(); ofile.close(); print("Conversion done") def metis_graph2graph_xml(ifilename, ofilename): "Convert from Metis graph format to DOLFIN Graph XML." print("Converting from Metis graph format to DOLFIN Graph XML.") # Open files ifile = open(ifilename, "r") ofile = open(ofilename, "w") # Read number of vertices and edges line = ifile.readline() if not line: _error("Empty file") (num_vertices, num_edges) = line.split() xml_writer.write_header_graph(ofile, "directed") xml_writer.write_header_vertices(ofile, int(num_vertices)) for i in range(int(num_vertices)): line = ifile.readline() edges = line.split() xml_writer.write_graph_vertex(ofile, i, len(edges)) xml_writer.write_footer_vertices(ofile) xml_writer.write_header_edges(ofile, 2*int(num_edges)) # Step to beginning of file and skip header info ifile.seek(0) ifile.readline() for i in range(int(num_vertices)): print("vertex %g", i) line = ifile.readline() edges = line.split() for e in edges: xml_writer.write_graph_edge(ofile, i, int(e)) xml_writer.write_footer_edges(ofile) xml_writer.write_footer_graph(ofile) # Close files ifile.close(); ofile.close(); def scotch_graph2graph_xml(ifilename, ofilename): "Convert from Scotch graph format to DOLFIN Graph XML." print("Converting from Scotch graph format to DOLFIN Graph XML.") # Open files ifile = open(ifilename, "r") ofile = open(ofilename, "w") # Skip graph file version number ifile.readline() # Read number of vertices and edges line = ifile.readline() if not line: _error("Empty file") (num_vertices, num_edges) = line.split() # Read start index and numeric flag # Start index is 0 or 1 (C/Fortran) # Numeric flag is 3 bits where bit 1 enables vertex labels # bit 2 enables edge weights and bit 3 enables vertex weights line = ifile.readline() (start_index, numeric_flag) = line.split() # Handling not implented if not numeric_flag == "000": _error("Handling of scotch vertex labels, edge- and vertex weights not implemented") xml_writer.write_header_graph(ofile, "undirected") xml_writer.write_header_vertices(ofile, int(num_vertices)) # Read vertices and edges, first number gives number of edges from this vertex (not used) for i in range(int(num_vertices)): line = ifile.readline() edges = line.split() xml_writer.write_graph_vertex(ofile, i, len(edges)-1) xml_writer.write_footer_vertices(ofile) xml_writer.write_header_edges(ofile, int(num_edges)) # Step to beginning of file and skip header info ifile.seek(0) ifile.readline() ifile.readline() ifile.readline() for i in range(int(num_vertices)): line = ifile.readline() edges = line.split() for j in range(1, len(edges)): xml_writer.write_graph_edge(ofile, i, int(edges[j])) xml_writer.write_footer_edges(ofile) xml_writer.write_footer_graph(ofile) # Close files ifile.close(); ofile.close(); def diffpack2xml(ifilename, ofilename): "Convert from Diffpack tetrahedral/triangle grid format to DOLFIN XML." print(diffpack2xml.__doc__) # Format strings for MeshFunction XML files meshfunction_header = """\ <?xml version="1.0" encoding="UTF-8"?>\n <dolfin xmlns:dolfin="http://www.fenics.org/dolfin/"> <mesh_function type="uint" dim="%d" size="%d">\n""" meshfunction_entity = " <entity index=\"%d\" value=\"%d\"/>\n" meshfunction_footer = " </mesh_function>\n</dolfin>" # Open files ifile = open(ifilename, "r") ofile = open(ofilename, "w") # Read and analyze header while 1: line = ifile.readline() if not line: _error("Empty file") if line[0] == "#": break if re.search(r"Number of elements", line): num_cells = int(re.match(r".*\s(\d+).*", line).group(1)) if re.search(r"Number of nodes", line): num_vertices = int(re.match(r".*\s(\d+).*", line).group(1)) if re.search(r"Number of space dim.", line): num_dims = int(re.match(r".*\s(\d+).*", line).group(1)) if num_dims == 3: xml_writer.write_header_mesh(ofile, "tetrahedron", 3) elem_type = "ElmT4n3D" write_cell_func = xml_writer.write_cell_tetrahedron else: xml_writer.write_header_mesh(ofile, "triangle", 2) elem_type = "ElmT3n2D" write_cell_func = xml_writer.write_cell_triangle xml_writer.write_header_vertices(ofile, num_vertices) # Read & write vertices and collect markers for vertices vertex_markers = [] unique_vertex_markers = set() for i in range(num_vertices): line = ifile.readline() m = re.match(r"^.*\(\s*(.*)\s*\).*\](.*)$", line) x = list(map(float, re.split("[\s,]+", m.group(1)))) xml_writer.write_vertex(ofile, i, *x) markers = list(map(int, m.group(2).split())) vertex_markers.append(markers) unique_vertex_markers.update(markers) xml_writer.write_footer_vertices(ofile) xml_writer.write_header_cells(ofile, num_cells) # Output unique vertex markers as individual VertexFunctions unique_vertex_markers.difference_update([0]) for unique_marker in unique_vertex_markers: ofile_marker = open(ofilename.replace(".xml", "") + \ "_marker_" + str(unique_marker)+".xml", "w") xml_writer.write_header_meshfunction(ofile_marker, 0, num_vertices) for ind, markers in enumerate(vertex_markers): if unique_marker in markers: xml_writer.write_entity_meshfunction(ofile_marker, ind, unique_marker) else: xml_writer.write_entity_meshfunction(ofile_marker, ind, 0) xml_writer.write_footer_meshfunction(ofile_marker) # Ignore comment lines while 1: line = ifile.readline() if not line: _error("Empty file") if line[0] == "#": break # Read & write cells and collect cell and face markers cell_markers = [] facet_markers = [] facet_to_vert = [[1,2,3], [0,2,3], [0,1,3], [0,1,2]] vert_to_facet = facet_to_vert # The same! cell_ind = 0 while cell_ind < num_cells: line = ifile.readline() v = line.split() if not v: continue if v[1] != elem_type: _error("Only tetrahedral (ElmT4n3D) and triangular (ElmT3n2D) elements are implemented.") # Store Cell markers cell_markers.append(int(v[2])) # Sort vertex indices cell_indices = sorted([int(x)-1 for x in v[3:]]) write_cell_func(ofile, cell_ind, *cell_indices) if num_dims == 2: cell_ind += 1 continue # Check Facet info process_facet = set(range(4)) for local_vert_ind, global_vert_ind in enumerate(cell_indices): # If no marker is included for vertex skip corresponding facet if not vertex_markers[global_vert_ind]: process_facet.difference_update(facet_to_vert[local_vert_ind]) # Process facets for local_facet in process_facet: # Start with markers from first vertex global_first_vertex = cell_indices[facet_to_vert[local_facet][0]] marker_intersection = set(vertex_markers[global_first_vertex]) # Process the other vertices for local_vert in facet_to_vert[local_facet][1:]: marker_intersection.intersection_update(\ vertex_markers[cell_indices[local_vert]]) if not marker_intersection: break # If not break we have a marker on local_facet else: assert(len(marker_intersection)==1) facet_markers.append((cell_ind, local_facet, \ marker_intersection.pop())) # Bump cell_ind cell_ind += 1 xml_writer.write_footer_cells(ofile) xml_writer.write_header_domains(ofile) # Write facet markers if any if facet_markers: xml_writer.write_header_meshvaluecollection(ofile, "m", 2, \ len(facet_markers), "uint") for cell, local_facet, marker in facet_markers: xml_writer.write_entity_meshvaluecollection(ofile, 2, cell, \ marker, local_facet) xml_writer.write_footer_meshvaluecollection(ofile) xml_writer.write_header_meshvaluecollection(ofile, "m", num_dims, \ len(cell_markers), "uint") for cell, marker in enumerate(cell_markers): xml_writer.write_entity_meshvaluecollection(ofile, num_dims, cell, \ marker) xml_writer.write_footer_meshvaluecollection(ofile) xml_writer.write_footer_domains(ofile) xml_writer.write_footer_mesh(ofile) # Close files ifile.close() ofile.close() class ParseError(Exception): """ Error encountered in source file. """ class DataHandler(object): """ Baseclass for handlers of mesh data. The actual handling of mesh data encountered in the source file is delegated to a polymorfic object. Typically, the delegate will write the data to XML. @ivar _state: the state which the handler is in, one of State_*. @ivar _cell_type: cell type in mesh. One of CellType_*. @ivar _dim: mesh dimensions. """ State_Invalid, State_Init, State_Vertices, State_Cells, \ State_MeshFunction, State_MeshValueCollection = list(range(6)) CellType_Tetrahedron, CellType_Triangle, CellType_Interval = list(range(3)) def __init__(self): self._state = self.State_Invalid def set_mesh_type(self, cell_type, dim): assert self._state == self.State_Invalid self._state = self.State_Init if cell_type == "tetrahedron": self._cell_type = self.CellType_Tetrahedron elif cell_type == "triangle": self._cell_type = self.CellType_Triangle elif cell_type == "interval": self._cell_type = self.CellType_Interval self._dim = dim def start_vertices(self, num_vertices): assert self._state == self.State_Init self._state = self.State_Vertices def add_vertex(self, vertex, coords): assert self._state == self.State_Vertices def end_vertices(self): assert self._state == self.State_Vertices self._state = self.State_Init def start_cells(self, num_cells): assert self._state == self.State_Init self._state = self.State_Cells def add_cell(self, cell, nodes): assert self._state == self.State_Cells def end_cells(self): assert self._state == self.State_Cells self._state = self.State_Init def start_domains(self): assert self._state == self.State_Init def end_domains(self): self._state = self.State_Init def start_meshfunction(self, name, dim, size): assert self._state == self.State_Init self._state = self.State_MeshFunction def add_entity_meshfunction(self, index, value): assert self._state == self.State_MeshFunction def end_meshfunction(self): assert self._state == self.State_MeshFunction self._state = self.State_Init def start_mesh_value_collection(self, name, dim, size, etype): assert self._state == self.State_Init self._state = self.State_MeshValueCollection def add_entity_mesh_value_collection(self, dim, index, value, local_entity=0): assert self._state == self.State_MeshValueCollection def end_mesh_value_collection(self): assert self._state == self.State_MeshValueCollection self._state = self.State_Init def warn(self, msg): """ Issue warning during parse. """ warnings.warn(msg) def error(self, msg): """ Raise error during parse. This method is expected to raise ParseError. """ raise ParseError(msg) def close(self): self._state = self.State_Invalid class XmlHandler(DataHandler): """ Data handler class which writes to Dolfin XML. """ def __init__(self, ofilename): DataHandler.__init__(self) self._ofilename = ofilename self.__ofile = open(ofilename, "w") self.__ofile_meshfunc = None def ofile(self): return self.__ofile def set_mesh_type(self, cell_type, dim): DataHandler.set_mesh_type(self, cell_type, dim) xml_writer.write_header_mesh(self.__ofile, cell_type, dim) def start_vertices(self, num_vertices): DataHandler.start_vertices(self, num_vertices) xml_writer.write_header_vertices(self.__ofile, num_vertices) def add_vertex(self, vertex, coords): DataHandler.add_vertex(self, vertex, coords) xml_writer.write_vertex(self.__ofile, vertex, *coords) def end_vertices(self): DataHandler.end_vertices(self) xml_writer.write_footer_vertices(self.__ofile) def start_cells(self, num_cells): DataHandler.start_cells(self, num_cells) xml_writer.write_header_cells(self.__ofile, num_cells) def add_cell(self, cell, nodes): DataHandler.add_cell(self, cell, nodes) if self._cell_type == self.CellType_Tetrahedron: func = xml_writer.write_cell_tetrahedron elif self._cell_type == self.CellType_Triangle: func = xml_writer.write_cell_triangle elif self._cell_type == self.CellType_Interval: func = xml_writer.write_cell_interval func(self.__ofile, cell, *nodes) def end_cells(self): DataHandler.end_cells(self) xml_writer.write_footer_cells(self.__ofile) def start_meshfunction(self, name, dim, size): DataHandler.start_meshfunction(self, name, dim, size) fname = os.path.splitext(self.__ofile.name)[0] self.__ofile_meshfunc = open("%s_%s.xml" % (fname, name), "w") xml_writer.write_header_meshfunction(self.__ofile_meshfunc, dim, size) def add_entity_meshfunction(self, index, value): DataHandler.add_entity_meshfunction(self, index, value) xml_writer.write_entity_meshfunction(self.__ofile_meshfunc, index, value) def end_meshfunction(self): DataHandler.end_meshfunction(self) xml_writer.write_footer_meshfunction(self.__ofile_meshfunc) self.__ofile_meshfunc.close() self.__ofile_meshfunc = None def start_domains(self): #DataHandler.start_domains(self) xml_writer.write_header_domains(self.__ofile) def end_domains(self): #DataHandler.end_domains(self) xml_writer.write_footer_domains(self.__ofile) def start_mesh_value_collection(self, name, dim, size, etype): DataHandler.start_mesh_value_collection(self, name, dim, size, etype) xml_writer.write_header_meshvaluecollection(self.__ofile, name, dim, size, etype) def add_entity_mesh_value_collection(self, dim, index, value, local_entity=0): DataHandler.add_entity_mesh_value_collection(self, dim, index, value) xml_writer.write_entity_meshvaluecollection(self.__ofile, dim, index, value, local_entity=local_entity) def end_mesh_value_collection(self): DataHandler.end_mesh_value_collection(self) xml_writer.write_footer_meshvaluecollection(self.__ofile) def close(self): DataHandler.close(self) if self.__ofile.closed: return xml_writer.write_footer_mesh(self.__ofile) self.__ofile.close() if self.__ofile_meshfunc is not None: self.__ofile_meshfunc.close() def netcdf2xml(ifilename,ofilename): "Convert from NetCDF format to DOLFIN XML." print("Converting from NetCDF format (.ncdf) to DOLFIN XML format") # Open files ifile = open(ifilename, "r") ofile = open(ofilename, "w") cell_type = None dim = 0 # Scan file for dimension, number of nodes, number of elements while 1: line = ifile.readline() if not line: _error("Empty file") if re.search(r"num_dim.*=", line): dim = int(re.match(".*\s=\s(\d+)\s;",line).group(1)) if re.search(r"num_nodes.*=", line): num_vertices = int(re.match(".*\s=\s(\d+)\s;",line).group(1)) if re.search(r"num_elem.*=", line): num_cells = int(re.match(".*\s=\s(\d+)\s;",line).group(1)) if re.search(r"connect1 =",line): break num_dims=dim # Set cell type if dim == 2: cell_type = "triangle" if dim == 3: cell_type = "tetrahedron" # Check that we got the cell type if cell_type == None: _error("Unable to find cell type.") # Write header xml_writer.write_header_mesh(ofile, cell_type, dim) xml_writer.write_header_cells(ofile, num_cells) num_cells_read = 0 # Read and write cells while 1: # Read next line line = ifile.readline() if not line: break connect=re.split("[,;]",line) if num_dims == 2: n0 = int(connect[0])-1 n1 = int(connect[1])-1 n2 = int(connect[2])-1 xml_writer.write_cell_triangle(ofile, num_cells_read, n0, n1, n2) elif num_dims == 3: n0 = int(connect[0])-1 n1 = int(connect[1])-1 n2 = int(connect[2])-1 n3 = int(connect[3])-1 xml_writer.write_cell_tetrahedron(ofile, num_cells_read, n0, n1, n2, n3) num_cells_read +=1 if num_cells == num_cells_read: xml_writer.write_footer_cells(ofile) xml_writer.write_header_vertices(ofile, num_vertices) break num_vertices_read = 0 coords = [[],[],[]] coord = -1 while 1: line = ifile.readline() if not line: _error("Missing data") if re.search(r"coord =",line): break # Read vertices while 1: line = ifile.readline() if not line: break if re.search(r"\A\s\s\S+,",line): coord+=1 print("Found x_"+str(coord)+" coordinates") coords[coord] += line.split() if re.search(r";",line): break # Write vertices for i in range(num_vertices): if num_dims == 2: x = float(re.split(",",coords[0].pop(0))[0]) y = float(re.split(",",coords[1].pop(0))[0]) z = 0 if num_dims == 3: x = float(re.split(",",coords[0].pop(0))[0]) y = float(re.split(",",coords[1].pop(0))[0]) z = float(re.split(",",coords[2].pop(0))[0]) xml_writer.write_vertex(ofile, i, x, y, z) # Write footer xml_writer.write_footer_vertices(ofile) xml_writer.write_footer_mesh(ofile) # Close files ifile.close() ofile.close() def exodus2xml(ifilename,ofilename): "Convert from Exodus II format to DOLFIN XML." print("Converting from Exodus II format to NetCDF format") name = ifilename.split(".")[0] netcdffilename = name +".ncdf" status, output = get_status_output('ncdump '+ifilename + ' > '+netcdffilename) if status != 0: raise IOError("Something wrong while executing ncdump. Is ncdump "\ "installed on the system?") netcdf2xml(netcdffilename, ofilename) def _error(message): "Write an error message" for line in message.split("\n"): print("*** %s" % line) sys.exit(2) def convert2xml(ifilename, ofilename, iformat=None): """ Convert a file to the DOLFIN XML format. """ convert(ifilename, XmlHandler(ofilename), iformat=iformat) def convert(ifilename, handler, iformat=None): """ Convert a file using a provided data handler. Note that handler.close is called when this function finishes. @param ifilename: Name of input file. @param handler: The data handler (instance of L{DataHandler}). @param iformat: Format of input file. """ if iformat is None: iformat = format_from_suffix(os.path.splitext(ifilename)[1][1:]) # XXX: Backwards-compat if hasattr(handler, "_ofilename"): ofilename = handler._ofilename # Choose conversion if iformat == "mesh": # Convert from mesh to xml format mesh2xml(ifilename, ofilename) elif iformat == "gmsh": # Convert from gmsh to xml format gmsh2xml(ifilename, handler) elif iformat == "Triangle": # Convert from Triangle to xml format triangle2xml(ifilename, ofilename) elif iformat == "xml-old": # Convert from old to new xml format xml_old2xml(ifilename, ofilename) elif iformat == "metis": # Convert from metis graph to dolfin graph xml format metis_graph2graph_xml(ifilename, ofilename) elif iformat == "scotch": # Convert from scotch graph to dolfin graph xml format scotch_graph2graph_xml(ifilename, ofilename) elif iformat == "diffpack": # Convert from Diffpack tetrahedral grid format to xml format diffpack2xml(ifilename, ofilename) elif iformat == "abaqus": # Convert from abaqus to xml format abaqus.convert(ifilename, handler) elif iformat == "NetCDF": # Convert from NetCDF generated from ExodusII format to xml format netcdf2xml(ifilename, ofilename) elif iformat =="ExodusII": # Convert from ExodusII format to xml format via NetCDF exodus2xml(ifilename, ofilename) elif iformat == "StarCD": # Convert from Star-CD tetrahedral grid format to xml format starcd2xml(ifilename, ofilename) else: _error("Sorry, cannot convert between %s and DOLFIN xml file formats." % iformat) # XXX: handler.close messes things for other input formats than abaqus or gmsh if iformat in ("abaqus", "gmsh"): handler.close() def starcd2xml(ifilename, ofilename): "Convert from Star-CD tetrahedral grid format to DOLFIN XML." print(starcd2xml.__doc__) if not os.path.isfile(ifilename[:-3] + "vrt") or not os.path.isfile(ifilename[:-3] + "cel"): print("StarCD format requires one .vrt file and one .cel file") sys.exit(2) # open output file ofile = open(ofilename, "w") # Open file, the vertices are in a .vrt file ifile = open(ifilename[:-3] + "vrt", "r") write_header_mesh(ofile, "tetrahedron", 3) # Read & write vertices # first, read all lines (need to sweep to times through the file) lines = ifile.readlines() # second, find the number of vertices num_vertices = -1 counter = 0 # nodenr_map is needed because starcd support node numbering like 1,2,4 (ie 3 is missing) nodenr_map = {} for line in lines: nodenr = int(line[0:15]) nodenr_map[nodenr] = counter counter += 1 num_vertices = counter # third, run over all vertices xml_writer.write_header_vertices(ofile, num_vertices) for line in lines: nodenr = int(line[0:15]) vertex0 = float(line[15:31]) vertex1 = float(line[31:47]) vertex2 = float(line[47:63]) xml_writer.write_vertex(ofile, nodenr_map[nodenr], float(vertex0), float(vertex1), float(vertex2)) xml_writer.write_footer_vertices(ofile) # Open file, the cells are in a .cel file ifile = open(ifilename[:-3] + "cel", "r") # Read & write cells # first, read all lines (need to sweep to times through the file) lines = ifile.readlines() # second, find the number of cells num_cells = -1 counter = 0 for line in lines: l = [int(a) for a in line.split()] cellnr, node0, node1, node2, node3, node4, node5, node6, node7, tmp1, tmp2 = l if node4 > 0: if node2 == node3 and node4 == node5 and node5 == node6 and node6 == node7: # these nodes should be equal counter += 1 else: print("The file does contain cells that are not tetraheders. The cell number is ", cellnr, " the line read was ", line) else: # triangles on the surface # print "The file does contain cells that are not tetraheders node4==0. The cell number is ", cellnr, " the line read was ", line #sys.exit(2) pass num_cells = counter # third, run over all cells xml_writer.write_header_cells(ofile, num_cells) counter = 0 for line in lines: l = [int(a) for a in line.split()] cellnr, node0, node1, node2, node3, node4, node5, node6, node7, tmp1, tmp2 = l if (node4 > 0): if node2 == node3 and node4 == node5 and node5 == node6 and node6 == node7: # these nodes should be equal xml_writer.write_cell_tetrahedron(ofile, counter, nodenr_map[node0], nodenr_map[node1], nodenr_map[node2], nodenr_map[node4]) counter += 1 xml_writer.write_footer_cells(ofile) xml_writer.write_footer_mesh(ofile) # Close files ifile.close() ofile.close()<|fim▁end|>
<|file_name|>PoissonGeneratorTest.java<|end_file_name|><|fim▁begin|>// ============================================================================ // Copyright 2006-2012 Daniel W. Dyer // // 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.uncommons.maths.random; import java.util.Random; import org.testng.annotations.Test; import org.uncommons.maths.Maths; import org.uncommons.maths.number.AdjustableNumberGenerator; import org.uncommons.maths.number.NumberGenerator; import org.uncommons.maths.statistics.DataSet; /** * Unit test for the Poisson number generator. * @author Daniel Dyer */ public class PoissonGeneratorTest { private final Random rng = new MersenneTwisterRNG(); /** * Check that the observed mean and standard deviation are consistent<|fim▁hole|> public void testDistribution() { final double mean = 19; NumberGenerator<Integer> generator = new PoissonGenerator(mean, rng); checkDistribution(generator, mean); } @Test(groups = "non-deterministic") public void testDynamicParameters() { final double initialMean = 19; AdjustableNumberGenerator<Double> meanGenerator = new AdjustableNumberGenerator<Double>(initialMean); NumberGenerator<Integer> generator = new PoissonGenerator(meanGenerator, rng); checkDistribution(generator, initialMean); // Adjust parameters and ensure that the generator output conforms to this new // distribution. final double adjustedMean = 13; meanGenerator.setValue(adjustedMean); checkDistribution(generator, adjustedMean); } /** * The mean must be greater than zero to be useful. This test ensures * that an appropriate exception is thrown if the mean is not positive. Not * throwing an exception is an error because it permits undetected bugs in * programs that use {@link PoissonGenerator}. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testMeanTooLow() { new PoissonGenerator(0d, rng); } private void checkDistribution(NumberGenerator<Integer> generator, double expectedMean) { // Variance of a Possion distribution equals its mean. final double expectedStandardDeviation = Math.sqrt(expectedMean); final int iterations = 10000; DataSet data = new DataSet(iterations); for (int i = 0; i < iterations; i++) { int value = generator.nextValue(); assert value >= 0 : "Value must be non-negative: " + value; data.addValue(value); } assert Maths.approxEquals(data.getArithmeticMean(), expectedMean, 0.02) : "Observed mean outside acceptable range: " + data.getArithmeticMean(); assert Maths.approxEquals(data.getSampleStandardDeviation(), expectedStandardDeviation, 0.02) : "Observed standard deviation outside acceptable range: " + data.getSampleStandardDeviation(); } }<|fim▁end|>
* with the specified distribution parameters. */ @Test(groups = "non-deterministic")
<|file_name|>test_pt_stop_calc_dockwidget.py<|end_file_name|><|fim▁begin|># coding=utf-8 """DockWidget test. .. note:: This program 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. """ __author__ = 'sirneeraj@gmail.com' __date__ = '2016-12-20' __copyright__ = 'Copyright 2016, neeraj' import unittest from PyQt4.QtGui import QDockWidget from pt_stop_calc_dockwidget import PTStopCalcDockWidget from utilities import get_qgis_app <|fim▁hole|> class PTStopCalcDockWidgetTest(unittest.TestCase): """Test dockwidget works.""" def setUp(self): """Runs before each test.""" self.dockwidget = PTStopCalcDockWidget(None) def tearDown(self): """Runs after each test.""" self.dockwidget = None def test_dockwidget_ok(self): """Test we can click OK.""" pass if __name__ == "__main__": suite = unittest.makeSuite(PTStopCalcDialogTest) runner = unittest.TextTestRunner(verbosity=2) runner.run(suite)<|fim▁end|>
QGIS_APP = get_qgis_app()
<|file_name|>get_test.py<|end_file_name|><|fim▁begin|>import os import requests import json import pandas as pd import numpy as np import time from datetime import datetime TMDB_KEY = "60027f35df522f00e57a79b9d3568423" """ def get_tmdb_id_list(): #function to get all Tmdb_id between 06-16 import requests import json # from year 1996-2016 year = range(2006,2017) ## 50 pages page_num = range(1,50) id_list = [] tmdb_id_query = "https://api.themoviedb.org/3/discover/movie?" \ + "api_key=%s" \ + "&language=en-US&sort_by=release_date.asc" \ + "&include_adult=false&include_video=false" \ + "&page=%d" \ + "&primary_release_year=%d" for n in page_num: for yr in year: rq = requests.get(tmdb_id_query % (TMDB_KEY,n,yr)).json() for item in rq['results']: id_list.append(item['id']) return id_list start = time.time() ID_LIST = get_tmdb_id_list()<|fim▁hole|>query = "https://api.themoviedb.org/3/movie/%d?" \ +"api_key=%s" \ +"&language=en-US" movie_id = 78 request = requests.get(query %(movie_id,TMDB_KEY)).json()<|fim▁end|>
stop = time.time() print(ID_LIST) print(stop - start) """
<|file_name|>debug_unassigned_email.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import from sentry.models import Activity from .mail import ActivityMailDebugView class DebugUnassignedEmailView(ActivityMailDebugView):<|fim▁hole|> return {"type": Activity.UNASSIGNED, "user": request.user}<|fim▁end|>
def get_activity(self, request, event):
<|file_name|>form.js<|end_file_name|><|fim▁begin|>export default { "_id": "60228e64f2e20ca84010999a", "type": "form", "components": [{ "label": "Form", "tableView": true, "useOriginalRevision": false, "components": [{ "label": "Text Field Child", "tableView": true, "key": "textFieldChild", "type": "textfield", "input": true }, { "label": "Time Child", "inputType": "text", "tableView": true, "key": "timeChild", "type": "time", "input": true, "inputMask": "99:99" }, { "title": "Panel Child", "collapsible": false, "key": "panelChild", "type": "panel", "label": "Panel", "input": false, "tableView": false, "components": [{ "label": "Number Inside Child Panel", "mask": false, "spellcheck": true, "tableView": false, "delimiter": false, "requireDecimal": false, "inputFormat": "plain", "key": "numberInsideChildPanel", "type": "number", "input": true }] }, { "label": "Data Grid Child", "reorder": false, "addAnotherPosition": "bottom", "layoutFixed": false, "enableRowGroups": false, "initEmpty": false, "tableView": false, "defaultValue": [{}], "key": "dataGridChild", "type": "datagrid", "input": true, "components": [{ "label": "Text Area Inside Child DataGrid", "autoExpand": false, "tableView": true, "key": "textAreaInsideChildDataGrid", "type": "textarea", "input": true }] }], "key": "form", "type": "form", "input": true, "form": "6034b4ef914866a81c060533" }, { "label": "Text Field", "tableView": true, "key": "textField", "type": "textfield", "input": true }, { "label": "Text Area", "autoExpand": false, "tableView": true, "key": "textArea", "type": "textarea", "input": true }, { "label": "Number", "mask": false, "spellcheck": true, "tableView": false, "delimiter": false, "requireDecimal": false, "inputFormat": "plain", "key": "number", "type": "number", "input": true }, { "label": "Password", "tableView": false, "key": "password", "type": "password", "input": true, "protected": true }, { "label": "Checkbox", "tableView": false, "key": "checkbox", "type": "checkbox", "input": true }, { "label": "Select Boxes", "optionsLabelPosition": "right", "tableView": false, "values": [{ "label": "a", "value": "a", "shortcut": "" }, { "label": "b", "value": "b", "shortcut": "" }, { "label": "c", "value": "c", "shortcut": "" }], "validate": { "onlyAvailableItems": false }, "key": "selectBoxes", "type": "selectboxes", "input": true, "inputType": "checkbox", }, { "label": "Select", "widget": "choicesjs", "tableView": true, "data": { "values": [{ "label": "A", "value": "a" }, { "label": "B", "value": "b" }, { "label": "C", "value": "c" }] }, "selectThreshold": 0.3, "validate": { "onlyAvailableItems": false }, "key": "select", "type": "select", "indexeddb": { "filter": {} }, "input": true }, { "label": "Radio", "optionsLabelPosition": "right", "inline": false, "tableView": false, "values": [{ "label": "a", "value": "a", "shortcut": "" }, { "label": "b", "value": "b", "shortcut": "" }, { "label": "c", "value": "c", "shortcut": "" }], "validate": { "onlyAvailableItems": false }, "key": "radio", "type": "radio", "input": true }, { "label": "Email", "tableView": true, "key": "email", "type": "email", "input": true }, { "label": "Url", "tableView": true, "key": "url", "type": "url", "input": true }, { "label": "Phone Number", "tableView": true, "key": "phoneNumber", "type": "phoneNumber", "input": true }, { "label": "Tags", "tableView": false, "key": "tags", "type": "tags", "input": true }, { "label": "Address", "tableView": false, "provider": "nominatim", "key": "address", "type": "address", "providerOptions": { "params": { "autocompleteOptions": {} } }, "input": true, "components": [{ "label": "Address 1", "tableView": false, "key": "address1", "type": "textfield", "input": true, "customConditional": "show = _.get(instance, 'parent.manualMode', false);" }, { "label": "Address 2", "tableView": false, "key": "address2", "type": "textfield", "input": true, "customConditional": "show = _.get(instance, 'parent.manualMode', false);" }, { "label": "City", "tableView": false, "key": "city", "type": "textfield", "input": true, "customConditional": "show = _.get(instance, 'parent.manualMode', false);" }, { "label": "State", "tableView": false, "key": "state", "type": "textfield", "input": true, "customConditional": "show = _.get(instance, 'parent.manualMode', false);" }, { "label": "Country", "tableView": false, "key": "country", "type": "textfield", "input": true, "customConditional": "show = _.get(instance, 'parent.manualMode', false);" }, { "label": "Zip Code", "tableView": false, "key": "zip", "type": "textfield", "input": true, "customConditional": "show = _.get(instance, 'parent.manualMode', false);" }] }, { "label": "Date / Time", "tableView": false, "enableMinDateInput": false, "datePicker": { "disableWeekends": false, "disableWeekdays": false }, "enableMaxDateInput": false, "key": "dateTime", "type": "datetime", "input": true, "widget": { "type": "calendar", "displayInTimezone": "viewer", "locale": "en", "useLocaleSettings": false, "allowInput": true, "mode": "single", "enableTime": true, "noCalendar": false, "format": "yyyy-MM-dd hh:mm a", "hourIncrement": 1, "minuteIncrement": 1, "time_24hr": false, "minDate": null, "disableWeekends": false, "disableWeekdays": false, "maxDate": null } }, { "label": "Day", "hideInputLabels": false, "inputsLabelPosition": "top", "useLocaleSettings": false, "tableView": false, "fields": { "day": { "hide": false }, "month": { "hide": false }, "year": { "hide": false } }, "key": "day", "type": "day", "input": true, "defaultValue": "00/00/0000" }, { "label": "Time", "tableView": true, "key": "time", "type": "time", "input": true, "inputMask": "99:99" }, { "label": "Currency", "mask": false, "spellcheck": true, "tableView": false, "currency": "USD", "inputFormat": "plain", "key": "currency", "type": "currency", "input": true, "delimiter": true }, { "label": "Survey", "tableView": false, "questions": [{ "label": "Question 1", "value": "question1" }, { "label": "Question 2", "value": "question2" }], "values": [{ "label": "yes", "value": "yes" }, { "label": "no", "value": "no" }], "key": "survey", "type": "survey", "input": true }, { "label": "Signature", "tableView": false, "key": "signature", "type": "signature", "input": true }, { "label": "HTML", "attrs": [{ "attr": "", "value": "" }], "content": "some test HTML content", "refreshOnChange": false, "key": "html", "type": "htmlelement", "input": false, "tableView": false }, { "html": "<p>some text content</p>", "label": "Content", "refreshOnChange": false, "key": "content", "type": "content", "input": false, "tableView": false }, { "label": "Columns", "columns": [{ "components": [{ "label": "Number Column", "mask": false, "spellcheck": true, "tableView": false, "delimiter": false, "requireDecimal": false, "inputFormat": "plain", "key": "numberColumn", "type": "number", "input": true, "hideOnChildrenHidden": false }], "width": 6, "offset": 0, "push": 0, "pull": 0, "size": "md" }, { "components": [{ "label": "Text Field Column", "tableView": true, "key": "textFieldColumn", "type": "textfield", "input": true, "hideOnChildrenHidden": false }], "width": 6, "offset": 0, "push": 0, "pull": 0, "size": "md" }], "key": "columns", "type": "columns", "input": false, "tableView": false }, { "legend": "test legend", "key": "fieldset", "type": "fieldset", "label": "test legend", "input": false, "tableView": false, "components": [{ "label": "Number Fieldset", "mask": false, "spellcheck": true, "tableView": false, "delimiter": false, "requireDecimal": false, "inputFormat": "plain", "key": "numberFieldset", "type": "number", "input": true }] }, { "collapsible": false, "key": "panel", "type": "panel", "label": "Panel", "input": false, "tableView": false, "components": [{ "label": "Number Panel", "mask": false, "spellcheck": true, "tableView": false, "delimiter": false, "requireDecimal": false, "inputFormat": "plain", "key": "numberPanel", "type": "number", "input": true }] }, { "label": "Table", "cellAlignment": "left", "key": "table", "type": "table", "numRows": 2, "numCols": 2, "input": false, "tableView": false, "rows": [ [{ "components": [{ "label": "Select Table", "widget": "choicesjs", "tableView": true, "data": { "values": [{ "label": "one", "value": "one" }, { "label": "two", "value": "two" }] }, "selectThreshold": 0.3, "validate": { "onlyAvailableItems": false }, "key": "selectTable", "type": "select", "indexeddb": { "filter": {} }, "input": true }] }, { "components": [{ "label": "Checkbox Table", "tableView": false, "key": "checkboxTable", "type": "checkbox", "input": true, "defaultValue": false }] }], [{ "components": [{ "label": "Date / Time Table", "tableView": false, "enableMinDateInput": false, "datePicker": { "disableWeekends": false, "disableWeekdays": false }, "enableMaxDateInput": false, "key": "dateTimeTable", "type": "datetime", "input": true, "widget": { "type": "calendar", "displayInTimezone": "viewer", "locale": "en", "useLocaleSettings": false, "allowInput": true, "mode": "single", "enableTime": true, "noCalendar": false, "format": "yyyy-MM-dd hh:mm a", "hourIncrement": 1, "minuteIncrement": 1, "time_24hr": false, "minDate": null, "disableWeekends": false, "disableWeekdays": false, "maxDate": null } }] }, { "components": [{ "label": "Currency Table", "mask": false, "spellcheck": true, "tableView": false, "currency": "USD", "inputFormat": "plain", "key": "currencyTable", "type": "currency", "input": true, "delimiter": true }] }] ] }, { "label": "Tabs", "components": [{ "label": "Tab 1", "key": "tab1", "components": [{ "label": "Number Tab", "mask": false, "spellcheck": true, "tableView": false, "delimiter": false, "requireDecimal": false, "inputFormat": "plain", "key": "numberTab", "type": "number", "input": true }] }, { "label": "Tab 2", "key": "tab2", "components": [{ "label": "Text Field Tab", "tableView": true, "key": "textFieldTab", "type": "textfield", "input": true }] }], "key": "tabs", "type": "tabs", "input": false, "tableView": false }, { "label": "Well", "key": "well", "type": "well", "input": false, "tableView": false, "components": [{ "label": "Text Field Well", "tableView": true, "key": "textFieldWell", "type": "textfield", "input": true }] }, { "label": "Hidden", "key": "hidden", "type": "hidden", "input": true, "tableView": false }, { "label": "Container", "tableView": false, "key": "container", "type": "container", "hideLabel": false, "input": true, "components": [{ "label": "Text Field Container", "tableView": true, "key": "textFieldContainer", "type": "textfield", "input": true }] }, { "label": "Data Map", "tableView": false, "key": "dataMap", "type": "datamap", "input": true, "valueComponent": { "type": "textfield", "key": "key", "label": "Value", "input": true, "hideLabel": true, "tableView": true } }, { "label": "Data Grid", "reorder": false, "addAnotherPosition": "bottom", "layoutFixed": false, "enableRowGroups": false, "initEmpty": false, "tableView": false, "defaultValue": [{}], "key": "dataGrid", "type": "datagrid", "input": true, "components": [{ "label": "Text Field DataGrid", "tableView": true, "key": "textFieldDataGrid", "type": "textfield", "input": true }] }, { "label": "Edit Grid", "tableView": false,<|fim▁hole|> "components": [{ "label": "Text Field EditGrid", "tableView": true, "key": "textFieldEditGrid", "type": "textfield", "input": true }] }, { "label": "Tree", "tableView": false, "key": "tree", "type": "tree", "input": true, "tree": true, "components": [{ "label": "Text Field Tree", "tableView": true, "key": "textFieldTree", "type": "textfield", "input": true }] }, { "label": "Upload", "tableView": false, "storage": "base64", "webcam": false, "fileTypes": [{ "label": "", "value": "" }], "key": "file", "type": "file", "input": true }, { "type": "button", "label": "Submit", "key": "submit", "input": true, "tableView": false } ], "title": "form for automated tests", "display": "form", "name": "formForAutomatedTests", "path": "formforautomatedtests", }<|fim▁end|>
"rowDrafts": false, "key": "editGrid", "type": "editgrid", "input": true,
<|file_name|>closest_sum_pair_to_x.cpp<|end_file_name|><|fim▁begin|>#include "common_header.h" namespace { using ArrayType = std::vector<int>; /** Given a sorted array and a number x, find the pair in array whose sum is closest to x * * @reference https://www.geeksforgeeks.org/given-sorted-array-number-x-find-pair-array-whose-sum-closest-x/ * * Given a sorted array and a number x, find a pair in array whose sum is closest to x. * * @reference 2 Sum Closest * https://aaronice.gitbook.io/lintcode/high_frequency/2sum_closest * * Given an array nums of n integers, find two integers in nums such that the sum is * closest to a given number, target. Return the difference between the sum of the two * integers and the target. * * @reference Two elements whose sum is closest to zero * https://www.geeksforgeeks.org/two-elements-whose-sum-is-closest-to-zero/ */ auto ClosestSumPair_Sorted_TwoPointer(const ArrayType &elements, const ArrayType::value_type x) { assert(std::is_sorted(elements.cbegin(), elements.cend())); auto diff = std::numeric_limits<ArrayType::value_type>::max(); std::pair<ArrayType::value_type, ArrayType::value_type> output; if (not elements.empty()) {<|fim▁hole|> auto right = std::prev(elements.cend()); while (left != right and diff) { const auto sum = *left + *right; const auto new_diff = std::abs(sum - x); if (new_diff < diff) { diff = new_diff; output = std::pair(*left, *right); } if (sum < x) { ++left; } else { --right; } } } return output; } inline auto ClosestSumPair_Sort(ArrayType elements, const ArrayType::value_type x) { std::sort(elements.begin(), elements.end()); return ClosestSumPair_Sorted_TwoPointer(elements, x); } /** * @reference 3Sum Closest * https://leetcode.com/problems/3sum-closest/ * * Given an array nums of n integers and an integer target, find three integers in nums * such that the sum is closest to target. Return the sum of the three integers. You may * assume that each input would have exactly one solution. */ auto ThreeSum(ArrayType nums, const int target) { std::sort(nums.begin(), nums.end()); int min_diff = INT_MAX; int result = 0; for (std::size_t i = 0; i < nums.size() and min_diff; ++i) { int left = i + 1; int right = nums.size() - 1; while (left < right) { const int sum = nums[i] + nums[left] + nums[right]; if (std::abs(target - sum) < min_diff) { min_diff = std::abs(target - sum); result = sum; } if (sum < target) { ++left; } else { --right; } } } return result; } /** * @reference Two Sum Less Than K * https://wentao-shao.gitbook.io/leetcode/two-pointers/1099.two-sum-less-than-k * * Given an array A of integers and integer K, return the maximum S such that there * exists i < j with A[i] + A[j] = S and S < K. If no i, j exist satisfying this * equation, return -1. */ auto TwoSumLessThan(ArrayType nums, const int K) { std::sort(nums.begin(), nums.end()); int left = 0; int right = nums.size() - 1; int result = -1; while (left < right) { const auto sum = nums[left] + nums[right]; if (sum >= K) { --right; } else { result = std::max(result, sum); ++left; } } return result; } }//namespace const ArrayType SAMPLE1 = {10, 22, 28, 29, 30, 40}; const ArrayType SAMPLE2 = {1, 3, 4, 7, 10}; const ArrayType SAMPLE3 = {1, 60, -10, 70, -80, 85}; THE_BENCHMARK(ClosestSumPair_Sorted_TwoPointer, SAMPLE1, 54); SIMPLE_TEST(ClosestSumPair_Sorted_TwoPointer, TestSample1, std::pair(22, 30), SAMPLE1, 54); SIMPLE_TEST(ClosestSumPair_Sorted_TwoPointer, TestSample2, std::pair(4, 10), SAMPLE2, 15); SIMPLE_TEST(ClosestSumPair_Sort, TestSample3, std::pair(-80, 85), SAMPLE3, 0); const ArrayType SAMPLE4 = {-1, 2, 1, -4}; THE_BENCHMARK(ThreeSum, SAMPLE4, 1); SIMPLE_TEST(ThreeSum, TestSample4, 2, SAMPLE4, 1); const ArrayType SAMPLE1L = {34, 23, 1, 24, 75, 33, 54, 8}; const ArrayType SAMPLE2L = {10, 20, 30}; THE_BENCHMARK(TwoSumLessThan, SAMPLE1L, 60); SIMPLE_TEST(TwoSumLessThan, TestSample1, 58, SAMPLE1L, 60); SIMPLE_TEST(TwoSumLessThan, TestSample2, -1, SAMPLE2L, 15);<|fim▁end|>
auto left = elements.cbegin();
<|file_name|>tcp_client.rs<|end_file_name|><|fim▁begin|>use std::{fmt, io}; use std::sync::Arc; use std::net::SocketAddr; use std::marker::PhantomData; use BindClient; use tokio_core::reactor::Handle; use tokio_core::net::{TcpStream, TcpStreamNew}; use futures::{Future, Poll, Async}; // TODO: add configuration, e.g.: // - connection timeout // - multiple addresses // - request timeout // TODO: consider global event loop handle, so that providing one in the builder // is optional /// Builds client connections to external services. /// /// To connect to a service, you need a *client protocol* implementation; see /// the crate documentation for guidance. ///<|fim▁hole|> _kind: PhantomData<Kind>, proto: Arc<P>, } /// A future for establishing a client connection. /// /// Yields a service for interacting with the server. pub struct Connect<Kind, P> { _kind: PhantomData<Kind>, proto: Arc<P>, socket: TcpStreamNew, handle: Handle, } impl<Kind, P> Future for Connect<Kind, P> where P: BindClient<Kind, TcpStream> { type Item = P::BindClient; type Error = io::Error; fn poll(&mut self) -> Poll<P::BindClient, io::Error> { let socket = try_ready!(self.socket.poll()); Ok(Async::Ready(self.proto.bind_client(&self.handle, socket))) } } impl<Kind, P> TcpClient<Kind, P> where P: BindClient<Kind, TcpStream> { /// Create a builder for the given client protocol. /// /// To connect to a service, you need a *client protocol* implementation; /// see the crate documentation for guidance. pub fn new(protocol: P) -> TcpClient<Kind, P> { TcpClient { _kind: PhantomData, proto: Arc::new(protocol) } } /// Establish a connection to the given address. /// /// # Return value /// /// Returns a future for the establishment of the connection. When the /// future completes, it yields an instance of `Service` for interacting /// with the server. pub fn connect(&self, addr: &SocketAddr, handle: &Handle) -> Connect<Kind, P> { Connect { _kind: PhantomData, proto: self.proto.clone(), socket: TcpStream::connect(addr, handle), handle: handle.clone(), } } } impl<Kind, P> fmt::Debug for Connect<Kind, P> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Connect {{ ... }}") } }<|fim▁end|>
/// At the moment, this builder offers minimal configuration, but more will be /// added over time. #[derive(Debug)] pub struct TcpClient<Kind, P> {
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::io; // io::stdin().read_line(&mut <String>) fn get_input() -> String { let mut input = String::new(); match io::stdin().read_line(&mut input) { Ok(string) => string, Err(err) => panic!("Error: {}", err), }; input } fn main() { let pairs: isize = get_input() .trim() .parse::<isize>().expect("Error: can't parse input"); let mut answers: Vec<isize> = Vec::new(); for _ in 0..pairs { answers.push(get_input() .trim()<|fim▁hole|> } println!(""); for ans in answers { print!("{} ", ans); } println!(""); }<|fim▁end|>
.split_whitespace() .map(|s| s.parse::<isize>().expect("Error: can't parse input")) .sum() );
<|file_name|>win32spawn.py<|end_file_name|><|fim▁begin|>import os import threading import Queue # Windows import import win32file import win32pipe import win32api import win32con import win32security import win32process import win32event class Win32Spawn(object): def __init__(self, cmd, shell=False): self.queue = Queue.Queue() self.is_terminated = False self.wake_up_event = win32event.CreateEvent(None, 0, 0, None) exec_dir = os.getcwd() comspec = os.environ.get("COMSPEC", "cmd.exe") cmd = comspec + ' /c ' + cmd win32event.ResetEvent(self.wake_up_event) currproc = win32api.GetCurrentProcess() sa = win32security.SECURITY_ATTRIBUTES() sa.bInheritHandle = 1 child_stdout_rd, child_stdout_wr = win32pipe.CreatePipe(sa, 0) child_stdout_rd_dup = win32api.DuplicateHandle(currproc, child_stdout_rd, currproc, 0, 0, win32con.DUPLICATE_SAME_ACCESS) win32file.CloseHandle(child_stdout_rd) child_stderr_rd, child_stderr_wr = win32pipe.CreatePipe(sa, 0) child_stderr_rd_dup = win32api.DuplicateHandle(currproc, child_stderr_rd, currproc, 0, 0, win32con.DUPLICATE_SAME_ACCESS) win32file.CloseHandle(child_stderr_rd) child_stdin_rd, child_stdin_wr = win32pipe.CreatePipe(sa, 0) child_stdin_wr_dup = win32api.DuplicateHandle(currproc, child_stdin_wr, currproc, 0, 0, win32con.DUPLICATE_SAME_ACCESS) win32file.CloseHandle(child_stdin_wr) startup_info = win32process.STARTUPINFO() startup_info.hStdInput = child_stdin_rd startup_info.hStdOutput = child_stdout_wr startup_info.hStdError = child_stderr_wr startup_info.dwFlags = win32process.STARTF_USESTDHANDLES cr_flags = 0 cr_flags = win32process.CREATE_NEW_PROCESS_GROUP env = os.environ.copy() self.h_process, h_thread, dw_pid, dw_tid = win32process.CreateProcess(None, cmd, None, None, 1, cr_flags, env, os.path.abspath(exec_dir), startup_info) win32api.CloseHandle(h_thread) win32file.CloseHandle(child_stdin_rd) win32file.CloseHandle(child_stdout_wr) win32file.CloseHandle(child_stderr_wr) self.__child_stdout = child_stdout_rd_dup self.__child_stderr = child_stderr_rd_dup self.__child_stdin = child_stdin_wr_dup self.exit_code = -1 def close(self): win32file.CloseHandle(self.__child_stdout) win32file.CloseHandle(self.__child_stderr) win32file.CloseHandle(self.__child_stdin) win32api.CloseHandle(self.h_process) win32api.CloseHandle(self.wake_up_event) def kill_subprocess(): win32event.SetEvent(self.wake_up_event) def sleep(secs): win32event.ResetEvent(self.wake_up_event) timeout = int(1000 * secs) val = win32event.WaitForSingleObject(self.wake_up_event, timeout) if val == win32event.WAIT_TIMEOUT: return True else: # The wake_up_event must have been signalled return False def get(self, block=True, timeout=None): return self.queue.get(block=block, timeout=timeout) def qsize(self): return self.queue.qsize() def __wait_for_child(self): # kick off threads to read from stdout and stderr of the child process threading.Thread(target=self.__do_read, args=(self.__child_stdout, )).start() threading.Thread(target=self.__do_read, args=(self.__child_stderr, )).start() while True: # block waiting for the process to finish or the interrupt to happen handles = (self.wake_up_event, self.h_process) val = win32event.WaitForMultipleObjects(handles, 0, win32event.INFINITE) if val >= win32event.WAIT_OBJECT_0 and val < win32event.WAIT_OBJECT_0 + len(handles): handle = handles[val - win32event.WAIT_OBJECT_0] if handle == self.wake_up_event: win32api.TerminateProcess(self.h_process, 1) win32event.ResetEvent(self.wake_up_event) return False elif handle == self.h_process: # the process has ended naturally return True else: assert False, "Unknown handle fired" else: assert False, "Unexpected return from WaitForMultipleObjects" # Wait for job to finish. Since this method blocks, it can to be called from another thread. # If the application wants to kill the process, it should call kill_subprocess(). def wait(self): if not self.__wait_for_child(): # it's been killed result = False else: # normal termination self.exit_code = win32process.GetExitCodeProcess(self.h_process) result = self.exit_code == 0 self.close() self.is_terminated = True return result # This method gets called on a worker thread to read from either a stderr # or stdout thread from the child process. def __do_read(self, handle): bytesToRead = 1024 while 1: try: finished = 0 hr, data = win32file.ReadFile(handle, bytesToRead, None) if data: self.queue.put_nowait(data) except win32api.error: finished = 1 if finished: return <|fim▁hole|> def start_pipe(self): def worker(pipe): return pipe.wait() thrd = threading.Thread(target=worker, args=(self, )) thrd.start()<|fim▁end|>
<|file_name|>BountyCoin_hi_IN.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="hi_IN" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About BitBlock</source> <translation>बिटकोइन के संबंध में</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;BitBlock&lt;/b&gt; version</source> <translation>बिटकोइन वर्सन</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>कापीराइट</translation> </message> <message> <location line="+0"/> <source>Dr. Kimoto Chan</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>पता पुस्तक</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>दो बार क्लिक करे पता या लेबल संपादन करने के लिए !</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>नया पता लिखिए !</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>चुनिन्दा पते को सिस्टम क्लिपबोर्ड पर कापी करे !</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;नया पता</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your BitBlock 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 type="unfinished"/> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;पता कॉपी करे</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a BitBlock address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified BitBlock address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;मिटाए !!</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your BitBlock addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>&amp;लेबल कॉपी करे </translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;एडिट</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation type="unfinished"/> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>पता पुस्तक का डेटा एक्सपोर्ट (निर्यात) करे !</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma separated file (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>ग़लतियाँ एक्सपोर्ट (निर्यात) करे!</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>फाइल में लिख नही सके %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>लेबल</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>पता</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(कोई लेबल नही !)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>पहचान शब्द/अक्षर डालिए !</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>नया पहचान शब्द/अक्षर डालिए !</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>दोबारा नया पहचान शब्द/अक्षर डालिए !</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>नया पहचान शब्द/अक्षर वॉलेट मे डालिए ! &lt;br/&gt; कृपा करके पहचान शब्द में &lt;br&gt; 10 से ज़्यादा अक्षॉरों का इस्तेमाल करे &lt;/b&gt;,या &lt;b&gt;आठ या उससे से ज़्यादा शब्दो का इस्तेमाल करे&lt;/b&gt; !</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>एनक्रिप्ट वॉलेट !</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>वॉलेट खोलने के आपका वॉलेट पहचान शब्द्‌/अक्षर चाईए !</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>वॉलेट खोलिए</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>वॉलेट डीक्रिप्ट( विकोड) करने के लिए आपका वॉलेट पहचान शब्द्‌/अक्षर चाईए !</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation> डीक्रिप्ट वॉलेट</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>पहचान शब्द/अक्षर बदलिये !</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>कृपा करके पुराना एवं नया पहचान शब्द/अक्षर वॉलेट में डालिए !</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>वॉलेट एनक्रिपशन को प्रमाणित कीजिए !</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITBLOCKS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>वॉलेट एनक्रिप्ट हो गया !</translation> </message> <message> <location line="-56"/> <source>BitBlock will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your BitBlocks from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>वॉलेट एनक्रिप्ट नही हुआ!</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>वॉलेट एनक्रिपशन नाकाम हो गया इंटर्नल एरर की वजह से! आपका वॉलेट एनक्रीपत नही हुआ है!</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>आपके द्वारा डाले गये पहचान शब्द/अक्षर मिलते नही है !</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>वॉलेट का लॉक नही खुला !</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>वॉलेट डीक्रिप्ट करने के लिए जो पहचान शब्द/अक्षर डाले गये है वो सही नही है!</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>वॉलेट का डीक्रिप्ट-ष्ण असफल !</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitBlockGUI</name> <message> <location filename="../BitBlockgui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation type="unfinished"/> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>नेटवर्क से समकालिक (मिल) रहा है ...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;विवरण</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>वॉलेट का सामानया विवरण दिखाए !</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp; लेन-देन </translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>देखिए पुराने लेन-देन के विवरण !</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>स्टोर किए हुए पते और लेबलओ को बदलिए !</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>पते की सूची दिखाए जिन्हे भुगतान करना है !</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>बाहर जायें</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>अप्लिकेशन से बाहर निकलना !</translation> </message> <message> <location line="+4"/> <source>Show information about BitBlock</source> <translation>बीटकोइन के बारे में जानकारी !</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;विकल्प</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;बैकप वॉलेट</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation type="unfinished"/> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation type="unfinished"/> </message> <message> <location line="-347"/> <source>Send coins to a BitBlock address</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Modify configuration options for BitBlock</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>पहचान शब्द/अक्षर जो वॉलेट एनक्रिपशन के लिए इस्तेमाल किया है उसे बदलिए!</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation type="unfinished"/> </message> <message> <location line="-165"/> <location line="+530"/> <source>BitBlock</source> <translation>बीटकोइन</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>वॉलेट</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>&amp;About BitBlock</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Sign messages with your BitBlock addresses to prove you own them</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified BitBlock addresses</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;फाइल</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;सेट्टिंग्स</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;मदद</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>टैबस टूलबार</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[टेस्टनेट]</translation> </message> <message> <location line="+47"/> <source>BitBlock client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to BitBlock network</source> <translation><numerusform>%n सक्रिया संपर्क बीटकोइन नेटवर्क से</numerusform><numerusform>%n सक्रिया संपर्क बीटकोइन नेटवर्क से</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n घंटा</numerusform><numerusform>%n घंटे</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n दिन</numerusform><numerusform>%n दिनो</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n हफ़्ता</numerusform><numerusform>%n हफ्ते</numerusform></translation> <|fim▁hole|> <source>%1 behind</source> <translation>%1 पीछे</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Error</source> <translation>भूल</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>चेतावनी</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>जानकारी</translation> </message> <message> <location line="+70"/> <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"/> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>नवीनतम</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation type="unfinished"/> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>भेजी ट्रांजक्शन</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>प्राप्त हुई ट्रांजक्शन</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>तारीख: %1\n राशि: %2\n टाइप: %3\n पता:%4\n</translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid BitBlock address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>वॉलेट एन्क्रिप्टेड है तथा अभी लॉक्ड नहीं है</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>वॉलेट एन्क्रिप्टेड है तथा अभी लॉक्ड है</translation> </message> <message> <location filename="../BitBlock.cpp" line="+111"/> <source>A fatal error occurred. BitBlock can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>पता एडिट करना</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;लेबल</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>इस एड्रेस बुक से जुड़ा एड्रेस</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;पता</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>इस एड्रेस बुक से जुड़ी प्रविष्टि केवल भेजने वाले addresses के लिए बदली जा सकती है|</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>नया स्वीकार्य पता</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>नया भेजने वाला पता</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>एडिट स्वीकार्य पता </translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>एडिट भेजने वाला पता</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>डाला गया पता &quot;%1&quot; एड्रेस बुक में पहले से ही मोजूद है|</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid BitBlock address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>वॉलेट को unlock नहीं किया जा सकता|</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>नयी कुंजी का निर्माण असफल रहा|</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>BitBlock-Qt</source> <translation>बीटकोइन-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>संस्करण</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>खपत :</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>विकल्प</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation type="unfinished"/> </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.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start BitBlock after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start BitBlock on system login</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the BitBlock client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Connect to the BitBlock network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting BitBlock.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show BitBlock addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;ओके</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;कैन्सल</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation type="unfinished"/> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>चेतावनी</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting BitBlock.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>फार्म</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the BitBlock network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>बाकी रकम :</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>अपुष्ट :</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>वॉलेट</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;हाल का लेन-देन&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>आपका चालू बॅलेन्स</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>लेन देन की पुष्टि अभी नहीं हुई है, इसलिए इन्हें अभी मोजुदा बैलेंस में गिना नहीं गया है|</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation type="unfinished"/> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start BitBlock: click-to-pay handler</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>भुगतान का अनुरोध</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>राशि :</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>लेबल :</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation type="unfinished"/> </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"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>लागू नही </translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation type="unfinished"/> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the BitBlock-Qt help message to get a list with possible BitBlock command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"/> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>BitBlock - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>BitBlock Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the BitBlock debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the BitBlock RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>सिक्के भेजें|</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>एक साथ कई प्राप्तकर्ताओं को भेजें</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>बाकी रकम :</translation> </message> <message> <location line="+10"/> <source>123.456 MEC</source> <translation>123.456 MEC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>भेजने की पुष्टि करें</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; से %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>सिक्के भेजने की पुष्टि करें</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>क्या आप %1 भेजना चाहते हैं?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>और</translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>भेजा गया अमाउंट शुन्य से अधिक होना चाहिए|</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </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"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>फार्म</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>अमाउंट:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>प्राप्तकर्ता:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation type="unfinished"/> </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>आपकी एड्रेस बुक में इस एड्रेस के लिए एक लेबल लिखें</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>लेबल:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation type="unfinished"/> </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>Clipboard से एड्रेस paste करें</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>प्राप्तकर्ता हटायें</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a BitBlock address (e.g. MNS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>BitBlock एड्रेस लिखें (उदाहरण: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <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 type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt-A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>Clipboard से एड्रेस paste करें</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 type="unfinished"/> </message> <message> <location line="+7"/> <source>Signature</source> <translation>हस्ताक्षर</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this BitBlock address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <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 type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified BitBlock address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a BitBlock address (e.g. MNS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>BitBlock एड्रेस लिखें (उदाहरण: 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter BitBlock signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>Dr. Kimoto Chan</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>खुला है जबतक %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/अपुष्ट</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 पुष्टियाँ</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>taareek</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 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 &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation>राशि</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>सही</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>ग़लत</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, अभी तक सफलतापूर्वक प्रसारित नहीं किया गया है</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>अज्ञात</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>लेन-देन का विवरण</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation> ये खिड़की आपको लेन-देन का विस्तृत विवरण देगी !</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>taareek</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>टाइप</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>पता</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>राशि</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>खुला है जबतक %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>ऑफलाइन ( %1 पक्का करना)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>अपुष्ट ( %1 मे %2 पक्के )</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>पक्के ( %1 पक्का करना)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>यह ब्लॉक किसी भी और नोड को मिला नही है ! शायद यह ब्लॉक कोई भी नोड स्वीकारे गा नही !</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>जेनरेट किया गया किंतु स्वीकारा नही गया !</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>स्वीकारा गया</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>स्वीकार्य ओर से</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>भेजा गया</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>भेजा खुद को भुगतान</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>माइंड</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(लागू नहीं)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>ट्रांसेक्शन स्तिथि| पुष्टियों की संख्या जानने के लिए इस जगह पर माउस लायें|</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>तारीख तथा समय जब ये ट्रांसेक्शन प्राप्त हुई थी|</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>ट्रांसेक्शन का प्रकार|</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>ट्रांसेक्शन की मंजिल का पता|</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>अमाउंट बैलेंस से निकला या जमा किया गया |</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>सभी</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>आज</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>इस हफ्ते</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>इस महीने</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>पिछले महीने</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>इस साल</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>विस्तार...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>स्वीकार करना</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>भेजा गया</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>अपनेआप को</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>माइंड</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>अन्य</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>ढूँदने के लिए कृपा करके पता या लेबल टाइप करे !</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>लघुत्तम राशि</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>पता कॉपी करे</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>लेबल कॉपी करे </translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>कॉपी राशि</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>एडिट लेबल</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>लेन-देन का डेटा निर्यात करे !</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma separated file (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>पक्का</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>taareek</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>टाइप</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>लेबल</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>पता</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>राशि</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>ग़लतियाँ एक्सपोर्ट (निर्यात) करे!</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>फाइल में लिख नही सके %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>विस्तार:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>तक</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>बैकप वॉलेट</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>वॉलेट डेटा (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>बैकप असफल</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"/> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>बैकप सफल</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitBlock-core</name> <message> <location filename="../BitBlockstrings.cpp" line="+94"/> <source>BitBlock version</source> <translation>बीटकोइन संस्करण</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>खपत :</translation> </message> <message> <location line="-29"/> <source>Send command to -server or BitBlockd</source> <translation>-server या BitBlockd को कमांड भेजें</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>commands की लिस्ट बनाएं</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>किसी command के लिए मदद लें</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>विकल्प:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: BitBlock.conf)</source> <translation>configuraion की फाइल का विवरण दें (default: BitBlock.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: BitBlockd.pid)</source> <translation>pid फाइल का विवरण दें (default: BitBlock.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"/> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 7951 or testnet: 17951)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation type="unfinished"/> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 7950 or testnet: 17950)</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation type="unfinished"/> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=BitBlockrpc 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 &quot;BitBlock Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. BitBlock is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <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"/> </message> <message> <location line="+4"/> <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"/> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <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"/> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong BitBlock will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <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 type="unfinished"/> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>ब्लॉक्स जाँचे जा रहा है...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>वॉलेट जाँचा जा रहा है...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation type="unfinished"/> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation>जानकारी</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>SSL options: (see the BitBlock Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>System error: </source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Warning</source> <translation>चेतावनी</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation type="unfinished"/> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation type="unfinished"/> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation type="unfinished"/> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+165"/> <source>This help message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>पता पुस्तक आ रही है...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of BitBlock</source> <translation type="unfinished"/> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart BitBlock to complete</source> <translation type="unfinished"/> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>राशि ग़लत है</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>ब्लॉक इंडेक्स आ रहा है...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. BitBlock is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>वॉलेट आ रहा है...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>रि-स्केनी-इंग...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>लोड हो गया|</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation type="unfinished"/> </message> <message> <location line="-74"/> <source>Error</source> <translation>भूल</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation type="unfinished"/> </message> </context> </TS><|fim▁end|>
</message> <message> <location line="+4"/>
<|file_name|>edit-profile.route.js<|end_file_name|><|fim▁begin|>(function(){ 'use strict'; angular .module('app') .config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { $stateProvider .state('edit-profile', {<|fim▁hole|> url:'/edit-profile/:id', templateUrl: 'edit-profile-state/edit-profile.view.html', controller: 'EditProfileController', controllerAs: 'vm', permissions: { only: 'isAuthorized' } }) }]) })();<|fim▁end|>
<|file_name|>Packages.js<|end_file_name|><|fim▁begin|>const Packages = [<|fim▁hole|> title: 'The Book', price: 1000, desc: ` - The Book - 14 chapters - 100s of examples - Access to GitHub Repo + Source ` }, { id: 'bookAndVideos', title: 'The Book and Videos', price: 1000, desc: ` - The book - Screencasts on - Building this site - Building a TODOMVC React app - And more! *Note*: May not be available until launch. ` }, { id: 'all', title: 'All the things!', price: 1000, desc: ` - The Book + videos - Bonus Chapters - React Native Intro - Building a Chat App - Building a Static Blog Site *Note*: May not be available until launch. ` } ]; export default Packages;<|fim▁end|>
{ id: 'book',
<|file_name|>service.effects.ts<|end_file_name|><|fim▁begin|>/** * Copyright 2017 The Mifos Initiative. * * 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. */ import {Injectable} from '@angular/core'; import {Actions, Effect} from '@ngrx/effects'; import {Observable} from 'rxjs/Observable';<|fim▁hole|>import {of} from 'rxjs/observable/of'; import * as taskActions from '../customer-task.actions'; import {CustomerService} from '../../../../services/customer/customer.service'; @Injectable() export class CustomerTasksApiEffects { @Effect() loadAll$: Observable<Action> = this.actions$ .ofType(taskActions.LOAD_ALL) .debounceTime(300) .map((action: taskActions.LoadAllAction) => action.payload) .switchMap(id => { const nextSearch$ = this.actions$.ofType(taskActions.LOAD_ALL).skip(1); return this.customerService.fetchProcessSteps(id) .takeUntil(nextSearch$) .map(processSteps => new taskActions.LoadAllCompleteAction(processSteps)) .catch(() => of(new taskActions.LoadAllCompleteAction([]))); }); @Effect() executeTask: Observable<Action> = this.actions$ .ofType(taskActions.EXECUTE_TASK) .map((action: taskActions.ExecuteTaskAction) => action.payload) .mergeMap(payload => this.customerService.markTaskAsExecuted(payload.customerId, payload.taskId) .map(() => new taskActions.ExecuteTaskSuccessAction(payload)) .catch((error) => of(new taskActions.ExecuteTaskFailAction(error))) ); @Effect() executeCommand: Observable<Action> = this.actions$ .ofType(taskActions.EXECUTE_COMMAND) .map((action: taskActions.ExecuteCommandAction) => action.payload) .mergeMap(payload => this.customerService.executeCustomerCommand(payload.customerId, payload.command) .map(() => new taskActions.ExecuteCommandSuccessAction(payload)) .catch((error) => of(new taskActions.ExecuteCommandFailAction(error))) ); constructor(private actions$: Actions, private customerService: CustomerService) { } }<|fim▁end|>
import {Action} from '@ngrx/store';
<|file_name|>perfmon_tab.py<|end_file_name|><|fim▁begin|># pandas and numpy for data manipulation import pandas as pd import numpy as np import sqlite3 from bokeh.plotting import Figure<|fim▁hole|> ColumnDataSource, Panel, FuncTickFormatter, SingleIntervalTicker, LinearAxis, ) from bokeh.models import Legend from bokeh.models.widgets import ( CheckboxGroup, Slider, RangeSlider, Tabs, CheckboxButtonGroup, TableColumn, DataTable, Select, ) from bokeh.layouts import column, row, WidgetBox import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import matplotlib.colors as colors def perfmon_tab(db): def make_dataset(perfmon_list): newdf = perfmon[perfmon_list] # Convert dataframe to column data source return ColumnDataSource(newdf) def make_plot(src): # Blank plot with correct labels p = Figure( plot_width=1024, plot_height=768, x_axis_type="datetime", title="perfmon", output_backend="webgl", ) cm = plt.get_cmap("gist_rainbow") numlines = len(perfmon.columns) mypal = [cm(1.0 * i / numlines) for i in range(numlines)] mypal = list(map(lambda x: colors.rgb2hex(x), mypal)) col = 0 legenditems = [] for key in src.data.keys(): if key == "datetime": continue l = key + " " col = col + 1 cline = p.line( perfmon.index.values, perfmon[key], line_width=1, alpha=0.8, color=mypal[col], ) legenditems += [(key, [cline])] p.legend.click_policy = "hide" legend = Legend(items=legenditems, location=(0, 0)) p.add_layout(legend, "below") return p def update(attr, old, new): perfmons_to_plot = [ perfmon_selection.labels[i] for i in perfmon_selection.active ] new_src = make_dataset(perfmons_to_plot) plot = make_plot(new_src) # TODO:crude hack in lack of a better solution so far layout.children[1] = plot # get data from DB, setup index cur = db.cursor() cur.execute( "SELECT name FROM sqlite_master WHERE type='table' AND name=?", ["perfmon"] ) if len(cur.fetchall()) == 0: return None perfmon = pd.read_sql_query("select * from perfmon", db) perfmon.index = pd.to_datetime(perfmon["datetime"]) perfmon = perfmon.drop(["datetime"], axis=1) perfmon.index.name = "datetime" perfmon_selection = CheckboxGroup( labels=list(perfmon.columns), active=[0, 5], width=300, height=800, sizing_mode="fixed", ) perfmon_list = [perfmon_selection.labels[i] for i in perfmon_selection.active] src = make_dataset(perfmon_list) plot = make_plot(src) perfmon_selection.on_change("active", update) controls = WidgetBox(perfmon_selection, width=300, height=800, sizing_mode="fixed") layout = row(controls, plot) tab = Panel(child=layout, title="perfmon") return tab<|fim▁end|>
from bokeh.models import ( CategoricalColorMapper, HoverTool,
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import { combineReducers } from 'redux'; import PostsReducer from './reducer-posts'; import { reducer as formReducer } from 'redux-form'; const rootReducer = combineReducers({ posts: PostsReducer, form: formReducer }); <|fim▁hole|>export default rootReducer;<|fim▁end|>
<|file_name|>simplify_tables.py<|end_file_name|><|fim▁begin|>from typing import List, Tuple, Union import fwdpy11._fwdpy11 import fwdpy11._types import numpy as np def simplify(pop, samples): """ Simplify a TableCollection stored in a Population. :param pop: A :class:`fwdpy11.DiploidPopulation` :param samples: A list of samples (node indexes). :return: The simplified tables and array mapping input sample IDs to output IDS :rtype: tuple Note that the samples argument is agnostic with respect to the time of the nodes in the input tables. Thus, you may do things like simplify to a set of "currently-alive" nodes plus some or all ancient samples by including some node IDs from :attr:`fwdpy11.DiploidPopulation.ancient_sample_metadata`. <|fim▁hole|> then you need to include their IDs in the samples argument. .. note:: Due to node ID remapping, the metadata corresponding to nodes becomes a bit more difficult to look up. You need to use the output ID map, the original IDs, and the population's metadata containers. .. deprecated:: 0.3.0 Prefer :func:`fwdpy11.simplify_tables` .. versionchanged:: 0.3.0 Ancient samples are no longer kept by default .. versionchanged:: 0.5.0 No longer requires a :class:`MutationVector` argument. """ import warnings warnings.warn( "This function is deprecated and will be removed soon. Please use fwdpy11.simplify_tables instead", category=FutureWarning, ) ll_t, idmap = fwdpy11._fwdpy11._simplify(pop, samples) return fwdpy11._types.TableCollection(ll_t), idmap def simplify_tables( tables: fwdpy11._types.TableCollection, samples: Union[List, np.ndarray] ) -> Tuple[fwdpy11._types.TableCollection, np.ndarray]: """ Simplify a TableCollection. :param pop: A table collection. :type pop: :class:`fwdpy11.TableCollection` :param samples: list of samples :type list: list-like or array-like :returns: A simplified TableCollection and an array containing remapped sample ids. :rtype: tuple .. versionadded:: 0.3.0 """ ll_t, idmap = fwdpy11._fwdpy11._simplify_tables(tables, samples) return fwdpy11._types.TableCollection(ll_t), idmap<|fim▁end|>
If the input contains ancient samples, and you wish to include them in the output,
<|file_name|>test_default_pricing.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import pytest from django.conf import settings from shoop.core.pricing import get_pricing_module from shoop.core.pricing.default_pricing import DefaultPricingModule from shoop.testing.factories import ( create_product, create_random_person, get_default_customer_group,<|fim▁hole|>from shoop.testing.utils import apply_request_middleware original_pricing_module = settings.SHOOP_PRICING_MODULE def setup_module(module): settings.SHOOP_PRICING_MODULE = "default_pricing" def teardown_module(module): settings.SHOOP_PRICING_MODULE = original_pricing_module def get_shop_with_tax(include_tax): shop = get_default_shop() shop.prices_include_tax = include_tax shop.save() return shop def initialize_test(rf, include_tax=False): shop = get_shop_with_tax(include_tax=include_tax) group = get_default_customer_group() customer = create_random_person() customer.groups.add(group) customer.save() request = rf.get("/") request.shop = shop apply_request_middleware(request) request.customer = customer return request, shop, group def test_module_is_active(): # this test is because we want to make sure `SimplePricing` is active module = get_pricing_module() assert isinstance(module, DefaultPricingModule) @pytest.mark.django_db def test_default_price_none_allowed(rf): request, shop, group = initialize_test(rf, False) shop = get_default_shop() product = create_product("test-product", shop=shop, default_price=None) assert product.get_price(request) == shop.create_price(0) @pytest.mark.django_db def test_default_price_zero_allowed(rf): request, shop, group = initialize_test(rf, False) shop = get_default_shop() product = create_product("test-product", shop=shop, default_price=0) assert product.get_price(request) == shop.create_price(0) @pytest.mark.django_db def test_default_price_value_allowed(rf): request, shop, group = initialize_test(rf, False) shop = get_default_shop() product = create_product("test-product", shop=shop, default_price=100) assert product.get_price(request) == shop.create_price(100) @pytest.mark.django_db def test_non_one_quantity(rf): request, shop, group = initialize_test(rf, False) shop = get_default_shop() product = create_product("test-product", shop=shop, default_price=100) assert product.get_price(request, quantity=5) == shop.create_price(500)<|fim▁end|>
get_default_shop )
<|file_name|>testPriority.rs<|end_file_name|><|fim▁begin|>extern mod extra; use std::rt::io::*; use std::rt::io::net::ip::SocketAddr; use std::io::println; use std::cell::Cell; use std::{os, str, io, run, uint}; use extra::arc; use std::comm::*; use extra::priority_queue::PriorityQueue; use std::rt::io::net::ip::*; use std::hashmap::HashMap; struct sched_msg { ip: IpAddr, filesize: Option<uint>, //filesize added to store file size } fn main() { let mut opt1 : Option<uint> = Some(10u); let mut opt2 : Option<uint> = Some(3u); let mut opt3 : Option<uint> = Some(20u); let mut local: IpAddr = std::rt::io::net::ip::Ipv4Addr(128, 143, -1, -1); let mut local2: IpAddr = std::rt::io::net::ip::Ipv4Addr(137, 54, -1, -1); let mut other: IpAddr = std::rt::io::net::ip::Ipv4Addr(-1, -1, -1, -1); let msg: sched_msg = sched_msg{ip: local, filesize : opt1 }; let msg2: sched_msg = sched_msg{ ip: other, filesize: opt2}; let msg3: sched_msg = sched_msg{ip: local2, filesize: opt3}; let mut req_vec : PriorityQueue<sched_msg> = PriorityQueue::new(); req_vec.push(msg); req_vec.push(msg2); req_vec.push(msg3); println(req_vec.pop().filesize.to_str()); println(req_vec.pop().filesize.to_str()); println(req_vec.pop().filesize.to_str()); } impl Ord for sched_msg { fn lt(&self, other: &sched_msg) -> bool { let selfIP: IpAddr = self.ip; let otherIP: IpAddr = other.ip; let selfSize : Option<uint> = self.filesize; let mut sSize: uint = 0; match selfSize{ Some(i) => { sSize=i;}, None => {return true;} } let otherSize : Option<uint> = other.filesize; let mut oSize: uint = 0; match otherSize{ Some(k) => { oSize=k;}, None => {return true;} } let mut sIP : bool = false; let mut oIP : bool = false; match selfIP { Ipv4Addr(a , b, c, d) => { if ((a == 128 && b == 143) || (a == 137 && b == 54)){ sIP = true; } }, Ipv6Addr(a, b, c, d, e, f, g, h) => { if ((a == 128 && b == 143) || (a == 137 && b == 54)){ sIP = true; } } } match otherIP { Ipv4Addr(a , b, c, d) => { if ((a == 128 && b == 143) || (a == 137 && b == 54)){ oIP = true; } }, Ipv6Addr(a, b, c, d, e, f, g, h) => { if ((a == 128 && b == 143) || (a == 137 && b == 54)){ oIP = true; } } } if(sIP && oIP){ if(sSize < oSize){ return false; }else { return true; } }else if(sIP){<|fim▁hole|> }else if (oIP){ return true; }else if(sSize < oSize){ return false; }else { return true; } } }<|fim▁end|>
return false;
<|file_name|>plot_index_loop_seasonal.py<|end_file_name|><|fim▁begin|>import os import numpy as np import matplotlib.pyplot as plt from matplotlib import cm, colors<|fim▁hole|>nlon = 30 # Dimensions L = 1.5e7 c0 = 2 timeDim = L / c0 / (60. * 60. * 24) H = 200 tau_0 = 1.0922666667e-2 delta_T = 1. sampFreq = 0.35 / 0.06 * 12 # (in year^-1) # Case definition muRng = np.array([2.1, 2.5, 2.7, 2.75, 2.8, 2.85, 2.9, 2.95, 3., 3.1, 3.3, 3.7]) #amu0Rng = np.arange(0.1, 0.51, 0.1) #amu0Rng = np.array([0.2]) amu0Rng = np.array([0.75, 1.]) #epsRng = np.arange(0., 0.11, 0.05) epsRng = np.array([0.]) sNoise = 'without noise' # spinup = int(sampFreq * 10) # timeWin = np.array([0, -1]) spinup = 0 timeWin = np.array([0, int(sampFreq * 1000)]) neof = 1 prefix = 'zc' simType = '_%deof_seasonal' % (neof,) indicesDir = '../observables/' field_h = (1, 'Thermocline depth', r'$h$', 'm', H, r'$h^2$') field_T = (2, 'SST', 'T', r'$^\circ C$', delta_T, r'$(^\circ C)^2$') #field_u_A = (3, 'Wind stress due to coupling', r'$u_A$', 'm/s', tau_0) #field_taux = (4, 'External wind-stress', 'taux', 'm/s', tau_0) # Indices definition # Nino3 #nino3Def = ('NINO3', 'nino3') nino3Def = ('Eastern', 'nino3') # Nino4 #nino4Def = ('NINO4', 'nino4') nino4Def = ('Western', 'nino4') # Field and index choice fieldDef = field_T indexDef = nino3Def #fieldDef = field_h #indexDef = nino4Def #fieldDef = field_u_A #indexDef = nino4Def #fieldDef = field_taux #indexDef = nino4Def fs_default = 'x-large' fs_latex = 'xx-large' fs_xlabel = fs_default fs_ylabel = fs_default fs_xticklabels = fs_default fs_yticklabels = fs_default fs_legend_title = fs_default fs_legend_labels = fs_default fs_cbar_label = fs_default # figFormat = 'eps' figFormat = 'png' dpi = 300 for eps in epsRng: for amu0 in amu0Rng: for mu in muRng: postfix = '_mu%04d_amu0%04d_eps%04d' \ % (np.round(mu * 1000, 1), np.round(amu0 * 1000, 1), np.round(eps * 1000, 1)) resDir = '%s%s%s/' % (prefix, simType, postfix) indicesPath = '%s/%s' % (indicesDir, resDir) pltDir = resDir os.system('mkdir %s %s 2> /dev/null' % (pltDir, indicesPath)) # Read dataset indexData = np.loadtxt('%s/%s.txt' % (indicesPath, indexDef[1])) timeND = indexData[:, 0] timeFull = timeND * timeDim / 365 indexFull = indexData[:, fieldDef[0]] * fieldDef[4] # Remove spinup index = indexFull[spinup:] time = timeFull[spinup:] nt = time.shape[0] # Plot time-series linewidth = 2 fig = plt.figure() ax = fig.add_subplot(111) ax.plot(time[timeWin[0]:timeWin[1]], index[timeWin[0]:timeWin[1]], linewidth=linewidth) # plt.title('Time-series of %s averaged over %s\nfor mu = %.4f and eps = %.4f' % (fieldDef[1], indexDef[0], mu, eps)) ax.set_xlabel('years', fontsize=fs_latex) ax.set_ylabel('%s %s (%s)' \ % (indexDef[0], fieldDef[1], fieldDef[3]), fontsize=fs_latex) # ax.set_xlim(0, 250) # ax.set_ylim(29.70, 30.) plt.setp(ax.get_xticklabels(), fontsize=fs_xticklabels) plt.setp(ax.get_yticklabels(), fontsize=fs_yticklabels) fig.savefig('%s/%s%s%s.png' % (pltDir, indexDef[1], fieldDef[2], postfix), bbox_inches='tight') # Get periodogram of zonal wind stress averaged over index nRAVG = 1 window = np.hamming(nt) # Get nearest larger power of 2 if np.log2(nt) != int(np.log2(nt)): nfft = 2**(int(np.log2(nt)) + 1) else: nfft = nt # Get frequencies and shift zero frequency to center freq = np.fft.fftfreq(nfft, d=1./sampFreq) freq = np.fft.fftshift(freq) ts = index - index.mean(0) # Apply window tsWindowed = ts * window # Fourier transform and shift zero frequency to center fts = np.fft.fft(tsWindowed, nfft, 0) fts = np.fft.fftshift(fts) # Get periodogram perio = np.abs(fts / nt)**2 # Apply running average perioRAVG = perio.copy() for iavg in np.arange(nRAVG/2, nfft-nRAVG/2): perioRAVG[iavg] = perio[iavg-nRAVG/2:iavg+nRAVG/2 + 1].mean()\ / nRAVG # Plot fig = plt.figure() ax = fig.add_subplot(1,1,1) ax.plot(freq, np.log10(perioRAVG), '-k') # ax.set_xscale('log') # ax.set_yscale('log') ax.set_xlim(0, 4) #ax.set_ylim(0, vmax) ax.set_xlabel(r'years$^{-1}$', fontsize=fs_latex) ax.set_ylabel(fieldDef[5], fontsize=fs_latex) plt.setp(ax.get_xticklabels(), fontsize=fs_xticklabels) plt.setp(ax.get_yticklabels(), fontsize=fs_yticklabels) xlim = ax.get_xlim() ylim = ax.get_ylim() ax.text(xlim[0] + 0.2 * (xlim[1] - xlim[0]), ylim[0] + 0.1 * (ylim[1] - ylim[0]), r'$\mu = %.3f$ %s' % (mu, sNoise), fontsize=32) # plt.title('Periodogram of %s averaged over %s\nfor mu = %.1f and eps = %.2f' % (fieldDef[1], indexDef[0], mu, eps)) fig.savefig('%s/%s%sPerio%s.%s' \ % (pltDir, indexDef[1], fieldDef[2], postfix, figFormat), bbox_inches='tight', dpi=dpi)<|fim▁end|>
initDir = '../init/' nlat = 31
<|file_name|>bootstrap.Spec.js<|end_file_name|><|fim▁begin|>var expect = chai.expect; describe("sails", function() {<|fim▁hole|><|fim▁end|>
beforeEach(function() { }); afterEach(function() { }); it('should not fail', function() { expect(true).to.be.true; }); });
<|file_name|>file_test.go<|end_file_name|><|fim▁begin|>// Copyright 2013 com authors<|fim▁hole|>// 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 com import ( "testing" . "github.com/smartystreets/goconvey/convey" ) func TestIsFile(t *testing.T) { if !IsFile("file.go") { t.Errorf("IsExist:\n Expect => %v\n Got => %v\n", true, false) } if IsFile("testdata") { t.Errorf("IsExist:\n Expect => %v\n Got => %v\n", false, true) } if IsFile("files.go") { t.Errorf("IsExist:\n Expect => %v\n Got => %v\n", false, true) } } func TestIsExist(t *testing.T) { Convey("Check if file or directory exists", t, func() { Convey("Pass a file name that exists", func() { So(IsExist("file.go"), ShouldEqual, true) }) Convey("Pass a directory name that exists", func() { So(IsExist("testdata"), ShouldEqual, true) }) Convey("Pass a directory name that does not exist", func() { So(IsExist(".hg"), ShouldEqual, false) }) }) } func BenchmarkIsFile(b *testing.B) { for i := 0; i < b.N; i++ { IsFile("file.go") } } func BenchmarkIsExist(b *testing.B) { for i := 0; i < b.N; i++ { IsExist("file.go") } }<|fim▁end|>
// // 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
<|file_name|>TeleportEvent.java<|end_file_name|><|fim▁begin|>/* ComJail - A jail plugin for Minecraft servers Copyright (C) 2015 comdude2 (Matt Armer) This program 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 3 of the License, or <|fim▁hole|> This program 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 this program. If not, see <http://www.gnu.org/licenses/>. Contact: admin@mcviral.net */ package net.mcviral.dev.plugins.comjail.events; import org.bukkit.ChatColor; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.plugin.Plugin; import net.mcviral.dev.plugins.comjail.main.JailController; public class TeleportEvent implements Listener{ @SuppressWarnings("unused") private Plugin plugin; private JailController jailcontroller; public TeleportEvent(Plugin mplugin, JailController mjailcontroller){ plugin = mplugin; jailcontroller = mjailcontroller; } @EventHandler(priority = EventPriority.HIGHEST) public void onPlayerTeleport(PlayerTeleportEvent event){ if (jailcontroller.isJailed(event.getPlayer().getUniqueId())){ if (!event.getPlayer().hasPermission("jail.override")){ event.setCancelled(true); event.getPlayer().sendMessage("[" + ChatColor.BLUE + "GUARD" + ChatColor.WHITE + "] " + ChatColor.RED + "You are jailed, you may not teleport."); } } } }<|fim▁end|>
(at your option) any later version.
<|file_name|>python_requirement_library.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.python.python_requirement import PythonRequirement from pants.base.payload import Payload from pants.base.payload_field import PythonRequirementsField from pants.base.validation import assert_list from pants.build_graph.target import Target <|fim▁hole|>class PythonRequirementLibrary(Target): """A set of pip requirements. :API: public """ def __init__(self, payload=None, requirements=None, **kwargs): """ :param requirements: pip requirements as `python_requirement <#python_requirement>`_\s. :type requirements: List of python_requirement calls """ payload = payload or Payload() assert_list(requirements, expected_type=PythonRequirement, key_arg='requirements') payload.add_fields({ 'requirements': PythonRequirementsField(requirements or []), }) super(PythonRequirementLibrary, self).__init__(payload=payload, **kwargs) self.add_labels('python') @property def requirements(self): return self.payload.requirements<|fim▁end|>
<|file_name|>6603.cpp<|end_file_name|><|fim▁begin|>#include <cstdio> #include <vector> using namespace std; int k; int s[13], result[6]; void dfs(int start, int depth) { if (depth == 6) { // 숫자 6개를 선택했을 때 for (int i = 0; i < 6; i++) { printf("%d ", result[i]); } printf("\n"); return; } for (int i = start; i < k; i++) { // 숫자 선택 result[depth] = s[i]; dfs(i + 1, depth + 1); } }<|fim▁hole|>int main() { while (scanf("%d", &k) && k) { for (int i = 0; i < k; i++) { scanf("%d", &s[i]); } dfs(0, 0); printf("\n"); } }<|fim▁end|>
<|file_name|>file.spec.js<|end_file_name|><|fim▁begin|>const expect = require('chai').expect const includeMimeType = require('../src/file').includeMimeType const findInFile = require('../src/file').findInFile describe('file : includeMimeType', () => { it('MIME_TYPES_IGNORED contain this mime type', () => { expect(includeMimeType('test/directoryTest/file2.png')).to.be.true }) it('MIME_TYPES_IGNORED not contain this mime type', () => { expect(includeMimeType('test/directoryTest/file1.js')).to.be.false }) }) describe('file : findInFile', () => { it('will some results (string)', () => { const results = findInFile('foo', 'test/directoryTest/file1.js') expect(results).to.be.eql({ 1: [5], 2: [12], 3: [5, 18] }) }) it('will some results (regExp)', () => { const results = findInFile(/foo/, 'test/directoryTest/file1.js') expect(results).to.be.eql({ 1: [5], 2: [12], 3: [5, 18]<|fim▁hole|> const results = findInFile('nothing', 'test/directoryTest/file1.js') expect(results).to.be.eql({}) }) it('will nothing (regExp)', () => { const results = findInFile(/nothing/, 'test/directoryTest/file1.js') expect(results).to.be.eql({}) }) })<|fim▁end|>
}) }) it('will nothing (string)', () => {
<|file_name|>DistributedQueue.java<|end_file_name|><|fim▁begin|>package me.littlepanda.dadbear.core.queue; <|fim▁hole|> /** * @author 张静波 myplaylife@icloud.com * */ public interface DistributedQueue<T> extends Queue<T> { /** * <p>如果使用无参构造函数,需要先调用这个方法,队列才能使用</p> * @param queue_name * @param clazz */ abstract public void init(String queue_name, Class<T> clazz); }<|fim▁end|>
import java.util.Queue;
<|file_name|>atom_data.py<|end_file_name|><|fim▁begin|># Copyright 2013-2015 Lenna X. Peterson. All rights reserved. from .meta import classproperty class AtomData(object): # Maximum ASA for each residue # from Miller et al. 1987, JMB 196: 641-656 total_asa = { 'A': 113.0, 'R': 241.0, 'N': 158.0, 'D': 151.0, 'C': 140.0, 'Q': 189.0, 'E': 183.0, 'G': 85.0, 'H': 194.0, 'I': 182.0, 'L': 180.0, 'K': 211.0, 'M': 204.0, 'F': 218.0, 'P': 143.0, 'S': 122.0, 'T': 146.0, 'W': 259.0, 'Y': 229.0, 'V': 160.0, } @classmethod def is_surface(cls, resn, asa, total_asa=None, cutoff=0.1): """Return True if ratio of residue ASA to max ASA >= cutoff""" if total_asa is None: total_asa = cls.total_asa resn = resn.upper() if len(resn) == 3: resn = cls.three_to_one[resn] return float(asa) / total_asa[resn] >= cutoff three_to_full = { 'Val': 'Valine', 'Ile': 'Isoleucine', 'Leu': 'Leucine', 'Glu': 'Glutamic acid', 'Gln': 'Glutamine', 'Asp': 'Aspartic acid', 'Asn': 'Asparagine', 'His': 'Histidine', 'Trp': 'Tryptophan', 'Phe': 'Phenylalanine', 'Tyr': 'Tyrosine', 'Arg': 'Arginine', 'Lys': 'Lysine', 'Ser': 'Serine', 'Thr': 'Threonine', 'Met': 'Methionine', 'Ala': 'Alanine', 'Gly': 'Glycine', 'Pro': 'Proline', 'Cys': 'Cysteine'} three_to_one = { 'VAL': 'V', 'ILE': 'I', 'LEU': 'L', 'GLU': 'E', 'GLN': 'Q', 'ASP': 'D', 'ASN': 'N', 'HIS': 'H', 'TRP': 'W', 'PHE': 'F', 'TYR': 'Y', 'ARG': 'R', 'LYS': 'K', 'SER': 'S', 'THR': 'T', 'MET': 'M', 'ALA': 'A', 'GLY': 'G', 'PRO': 'P', 'CYS': 'C'} one_to_three = {o: t for t, o in three_to_one.iteritems()} @classproperty def one_to_full(cls): """ This can't see three_to_full unless explicitly passed because dict comprehensions create their own local scope """ return {o: cls.three_to_full[t.title()] for t, o in cls.three_to_one.iteritems()} res_atom_list = dict( ALA=['C', 'CA', 'CB', 'N', 'O'], ARG=['C', 'CA', 'CB', 'CD', 'CG', 'CZ', 'N', 'NE', 'NH1', 'NH2', 'O'], ASN=['C', 'CA', 'CB', 'CG', 'N', 'ND2', 'O', 'OD1'], ASP=['C', 'CA', 'CB', 'CG', 'N', 'O', 'OD1', 'OD2'], CYS=['C', 'CA', 'CB', 'N', 'O', 'SG'], GLN=['C', 'CA', 'CB', 'CD', 'CG', 'N', 'NE2', 'O', 'OE1'], GLU=['C', 'CA', 'CB', 'CD', 'CG', 'N', 'O', 'OE1', 'OE2'], GLY=['C', 'CA', 'N', 'O'], HIS=['C', 'CA', 'CB', 'CD2', 'CE1', 'CG', 'N', 'ND1', 'NE2', 'O'], ILE=['C', 'CA', 'CB', 'CD1', 'CG1', 'CG2', 'N', 'O'], LEU=['C', 'CA', 'CB', 'CD1', 'CD2', 'CG', 'N', 'O'], LYS=['C', 'CA', 'CB', 'CD', 'CE', 'CG', 'N', 'NZ', 'O'], MET=['C', 'CA', 'CB', 'CE', 'CG', 'N', 'O', 'SD'], PHE=['C', 'CA', 'CB', 'CD1', 'CD2', 'CE1', 'CE2', 'CG', 'CZ', 'N', 'O'], PRO=['C', 'CA', 'CB', 'CD', 'CG', 'N', 'O'], SER=['C', 'CA', 'CB', 'N', 'O', 'OG'], THR=['C', 'CA', 'CB', 'CG2', 'N', 'O', 'OG1'], TRP=['C', 'CA', 'CB', 'CD1', 'CD2', 'CE2', 'CE3', 'CG', 'CH2', 'CZ2', 'CZ3', 'N', 'NE1', 'O'], TYR=['C', 'CA', 'CB', 'CD1', 'CD2', 'CE1', 'CE2', 'CG', 'CZ', 'N', 'O', 'OH'], VAL=['C', 'CA', 'CB', 'CG1', 'CG2', 'N', 'O'], ) all_chi = dict(<|fim▁hole|> chi1=dict( ARG=['N', 'CA', 'CB', 'CG'], ASN=['N', 'CA', 'CB', 'CG'], ASP=['N', 'CA', 'CB', 'CG'], CYS=['N', 'CA', 'CB', 'SG'], GLN=['N', 'CA', 'CB', 'CG'], GLU=['N', 'CA', 'CB', 'CG'], HIS=['N', 'CA', 'CB', 'CG'], ILE=['N', 'CA', 'CB', 'CG1'], LEU=['N', 'CA', 'CB', 'CG'], LYS=['N', 'CA', 'CB', 'CG'], MET=['N', 'CA', 'CB', 'CG'], PHE=['N', 'CA', 'CB', 'CG'], PRO=['N', 'CA', 'CB', 'CG'], SER=['N', 'CA', 'CB', 'OG'], THR=['N', 'CA', 'CB', 'OG1'], TRP=['N', 'CA', 'CB', 'CG'], TYR=['N', 'CA', 'CB', 'CG'], VAL=['N', 'CA', 'CB', 'CG1'], ), chi2=dict( ARG=['CA', 'CB', 'CG', 'CD'], ASN=['CA', 'CB', 'CG', 'OD1'], ASP=['CA', 'CB', 'CG', 'OD1'], GLN=['CA', 'CB', 'CG', 'CD'], GLU=['CA', 'CB', 'CG', 'CD'], HIS=['CA', 'CB', 'CG', 'ND1'], ILE=['CA', 'CB', 'CG1', 'CD1'], LEU=['CA', 'CB', 'CG', 'CD1'], LYS=['CA', 'CB', 'CG', 'CD'], MET=['CA', 'CB', 'CG', 'SD'], PHE=['CA', 'CB', 'CG', 'CD1'], PRO=['CA', 'CB', 'CG', 'CD'], TRP=['CA', 'CB', 'CG', 'CD1'], TYR=['CA', 'CB', 'CG', 'CD1'], ), chi3=dict( ARG=['CB', 'CG', 'CD', 'NE'], GLN=['CB', 'CG', 'CD', 'OE1'], GLU=['CB', 'CG', 'CD', 'OE1'], LYS=['CB', 'CG', 'CD', 'CE'], MET=['CB', 'CG', 'SD', 'CE'], ), chi4=dict( ARG=['CG', 'CD', 'NE', 'CZ'], LYS=['CG', 'CD', 'CE', 'NZ'], ), chi5=dict( ARG=['CD', 'NE', 'CZ', 'NH1'], ), ) alt_chi = dict( chi1=dict( VAL=['N', 'CA', 'CB', 'CG2'], ), chi2=dict( ASP=['CA', 'CB', 'CG', 'OD2'], LEU=['CA', 'CB', 'CG', 'CD2'], PHE=['CA', 'CB', 'CG', 'CD2'], TYR=['CA', 'CB', 'CG', 'CD2'], ), ) chi_atoms = dict( ARG=set(['CB', 'CA', 'CG', 'NE', 'N', 'CZ', 'NH1', 'CD']), ASN=set(['CB', 'CA', 'N', 'CG', 'OD1']), ASP=set(['CB', 'CA', 'N', 'CG', 'OD1', 'OD2']), CYS=set(['CB', 'CA', 'SG', 'N']), GLN=set(['CB', 'CA', 'CG', 'N', 'CD', 'OE1']), GLU=set(['CB', 'CA', 'CG', 'N', 'CD', 'OE1']), HIS=set(['ND1', 'CB', 'CA', 'CG', 'N']), ILE=set(['CG1', 'CB', 'CA', 'CD1', 'N']), LEU=set(['CB', 'CA', 'CG', 'CD1', 'CD2', 'N']), LYS=set(['CB', 'CA', 'CG', 'CE', 'N', 'NZ', 'CD']), MET=set(['CB', 'CA', 'CG', 'CE', 'N', 'SD']), PHE=set(['CB', 'CA', 'CG', 'CD1', 'CD2', 'N']), PRO=set(['CB', 'CA', 'N', 'CG', 'CD']), SER=set(['OG', 'CB', 'CA', 'N']), THR=set(['CB', 'CA', 'OG1', 'N']), TRP=set(['CB', 'CA', 'CG', 'CD1', 'N']), TYR=set(['CB', 'CA', 'CG', 'CD1', 'CD2', 'N']), VAL=set(['CG1', 'CG2', 'CB', 'CA', 'N']), )<|fim▁end|>
<|file_name|>stderr.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
process.stderr.write('Test');
<|file_name|>generic_methods.hpp<|end_file_name|><|fim▁begin|>/* * This program 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. * * This program 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 this program; if not, write to the Free Software<|fim▁hole|> * (c)Copyright 2006 Hewlett-Packard Development Company, LP. * */ #ifndef _GENERIC_METHODS_HPP_ #define _GENERIC_METHODS_HPP_ #include "C_ProtocolFrame.hpp" extern "C" int sys_time_secs (T_pValueData P_msgPart, T_pValueData P_args, T_pValueData P_result); extern "C" int sys_time_unsig_sec (T_pValueData P_msgPart, T_pValueData P_args, T_pValueData P_result); #endif // _GENERIC_METHODS_HPP_<|fim▁end|>
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
<|file_name|>mmio.rs<|end_file_name|><|fim▁begin|>// This file is part of zinc64. // Copyright (c) 2016-2019 Sebastian Jastrzebski. All rights reserved. // Licensed under the GPLv3. See LICENSE file in the project root for full license text. use zinc64_core::{AddressableFaded, Chip, Ram, Shared}; pub struct Mmio { cia_1: Shared<dyn Chip>, cia_2: Shared<dyn Chip>, color_ram: Shared<Ram>, expansion_port: Shared<dyn AddressableFaded>, sid: Shared<dyn Chip>, vic: Shared<dyn Chip>, } impl Mmio { pub fn new( cia_1: Shared<dyn Chip>, cia_2: Shared<dyn Chip>, color_ram: Shared<Ram>, expansion_port: Shared<dyn AddressableFaded>, sid: Shared<dyn Chip>, vic: Shared<dyn Chip>, ) -> Self { Self { cia_1, cia_2, color_ram, expansion_port, sid, vic, } } pub fn read(&self, address: u16) -> u8 { match address { 0xd000..=0xd3ff => self.vic.borrow_mut().read((address & 0x003f) as u8),<|fim▁hole|> 0xde00..=0xdfff => self.expansion_port.borrow_mut().read(address).unwrap_or(0), _ => panic!("invalid address 0x{:x}", address), } } pub fn write(&mut self, address: u16, value: u8) { match address { 0xd000..=0xd3ff => self.vic.borrow_mut().write((address & 0x003f) as u8, value), 0xd400..=0xd7ff => self.sid.borrow_mut().write((address & 0x001f) as u8, value), 0xd800..=0xdbff => self.color_ram.borrow_mut().write(address - 0xd800, value), 0xdc00..=0xdcff => self .cia_1 .borrow_mut() .write((address & 0x000f) as u8, value), 0xdd00..=0xddff => self .cia_2 .borrow_mut() .write((address & 0x000f) as u8, value), 0xde00..=0xdfff => self.expansion_port.borrow_mut().write(address, value), _ => panic!("invalid address 0x{:x}", address), } } }<|fim▁end|>
0xd400..=0xd7ff => self.sid.borrow_mut().read((address & 0x001f) as u8), 0xd800..=0xdbff => self.color_ram.borrow().read(address - 0xd800), 0xdc00..=0xdcff => self.cia_1.borrow_mut().read((address & 0x000f) as u8), 0xdd00..=0xddff => self.cia_2.borrow_mut().read((address & 0x000f) as u8),
<|file_name|>realign.py<|end_file_name|><|fim▁begin|>"""Perform realignment of BAM files around indels using the GATK toolkit. """ import os import shutil from contextlib import closing<|fim▁hole|> import pysam from bcbio import bam, broad from bcbio.bam import ref from bcbio.log import logger from bcbio.utils import file_exists from bcbio.distributed.transaction import file_transaction, tx_tmpdir from bcbio.pipeline.shared import subset_bam_by_region, subset_variant_regions from bcbio.provenance import do # ## GATK realignment def gatk_realigner_targets(runner, align_bam, ref_file, config, dbsnp=None, region=None, out_file=None, deep_coverage=False, variant_regions=None, known_vrns=None): """Generate a list of interval regions for realignment around indels. """ if not known_vrns: known_vrns = {} if out_file: out_file = "%s.intervals" % os.path.splitext(out_file)[0] else: out_file = "%s-realign.intervals" % os.path.splitext(align_bam)[0] # check only for file existence; interval files can be empty after running # on small chromosomes, so don't rerun in those cases if not os.path.exists(out_file): with file_transaction(config, out_file) as tx_out_file: logger.debug("GATK RealignerTargetCreator: %s %s" % (os.path.basename(align_bam), region)) params = ["-T", "RealignerTargetCreator", "-I", align_bam, "-R", ref_file, "-o", tx_out_file, "-l", "INFO", ] region = subset_variant_regions(variant_regions, region, tx_out_file) if region: params += ["-L", region, "--interval_set_rule", "INTERSECTION"] if known_vrns.get("train_indels"): params += ["--known", known_vrns["train_indels"]] if deep_coverage: params += ["--mismatchFraction", "0.30", "--maxIntervalSize", "650"] runner.run_gatk(params, memscale={"direction": "decrease", "magnitude": 2}) return out_file def gatk_indel_realignment_cl(runner, align_bam, ref_file, intervals, tmp_dir, region=None, deep_coverage=False, known_vrns=None): """Prepare input arguments for GATK indel realignment. """ if not known_vrns: known_vrns = {} params = ["-T", "IndelRealigner", "-I", align_bam, "-R", ref_file, "-targetIntervals", intervals, ] if region: params += ["-L", region] if known_vrns.get("train_indels"): params += ["--knownAlleles", known_vrns["train_indels"]] if deep_coverage: params += ["--maxReadsInMemory", "300000", "--maxReadsForRealignment", str(int(5e5)), "--maxReadsForConsensuses", "500", "--maxConsensuses", "100"] return runner.cl_gatk(params, tmp_dir) # ## Utilities def has_aligned_reads(align_bam, region=None): """Check if the aligned BAM file has any reads in the region. region can be a chromosome string ("chr22"), a tuple region (("chr22", 1, 100)) or a file of regions. """ import pybedtools if region is not None: if isinstance(region, basestring) and os.path.isfile(region): regions = [tuple(r) for r in pybedtools.BedTool(region)] else: regions = [region] with closing(pysam.Samfile(align_bam, "rb")) as cur_bam: if region is not None: for region in regions: if isinstance(region, basestring): for item in cur_bam.fetch(str(region)): return True else: for item in cur_bam.fetch(str(region[0]), int(region[1]), int(region[2])): return True else: for item in cur_bam: if not item.is_unmapped: return True return False<|fim▁end|>
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license (see the COPYING file).<|fim▁hole|>""" This package contains the qibuild actions. """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function<|fim▁end|>
<|file_name|>AHRS_Test.cpp<|end_file_name|><|fim▁begin|>// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- // // Simple test for the AP_AHRS interface // #include <AP_AHRS/AP_AHRS.h> #include <AP_HAL/AP_HAL.h> const AP_HAL::HAL& hal = AP_HAL::get_HAL(); // INS and Baro declaration AP_InertialSensor ins; Compass compass; AP_GPS gps; AP_Baro baro; AP_SerialManager serial_manager; // choose which AHRS system to use AP_AHRS_DCM ahrs(ins, baro, gps); <|fim▁hole|>#define LOW 0 void setup(void) { ins.init(AP_InertialSensor::RATE_100HZ); ahrs.init(); serial_manager.init(); if( compass.init() ) { hal.console->printf("Enabling compass\n"); ahrs.set_compass(&compass); } else { hal.console->printf("No compass detected\n"); } gps.init(NULL, serial_manager); } void loop(void) { static uint16_t counter; static uint32_t last_t, last_print, last_compass; uint32_t now = AP_HAL::micros(); float heading = 0; if (last_t == 0) { last_t = now; return; } last_t = now; if (now - last_compass > 100*1000UL && compass.read()) { heading = compass.calculate_heading(ahrs.get_dcm_matrix()); // read compass at 10Hz last_compass = now; #if WITH_GPS g_gps->update(); #endif } ahrs.update(); counter++; if (now - last_print >= 100000 /* 100ms : 10hz */) { Vector3f drift = ahrs.get_gyro_drift(); hal.console->printf( "r:%4.1f p:%4.1f y:%4.1f " "drift=(%5.1f %5.1f %5.1f) hdg=%.1f rate=%.1f\n", ToDeg(ahrs.roll), ToDeg(ahrs.pitch), ToDeg(ahrs.yaw), ToDeg(drift.x), ToDeg(drift.y), ToDeg(drift.z), compass.use_for_yaw() ? ToDeg(heading) : 0.0f, (1.0e6f*counter)/(now-last_print)); last_print = now; counter = 0; } } AP_HAL_MAIN();<|fim▁end|>
#define HIGH 1
<|file_name|>grafana_dashboard.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Thierry Sallé (@seuf) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function ANSIBLE_METADATA = { 'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.1' } DOCUMENTATION = ''' --- module: grafana_dashboard author: - Thierry Sallé (@seuf) version_added: "2.5" short_description: Manage Grafana dashboards description: - Create, update, delete, export Grafana dashboards via API. options: url: description: - The Grafana URL. required: true aliases: [ grafana_url ] version_added: 2.7 url_username: description: - The Grafana API user. default: admin aliases: [ grafana_user ] version_added: 2.7 url_password: description: - The Grafana API password. default: admin aliases: [ grafana_password ] version_added: 2.7 grafana_api_key: description: - The Grafana API key. - If set, I(grafana_user) and I(grafana_password) will be ignored. org_id: description: - The Grafana Organisation ID where the dashboard will be imported / exported. - Not used when I(grafana_api_key) is set, because the grafana_api_key only belongs to one organisation.. default: 1 state: description: - State of the dashboard. required: true choices: [ absent, export, present ] default: present slug: description: - Deprecated since Grafana 5. Use grafana dashboard uid instead. - slug of the dashboard. It's the friendly url name of the dashboard. - When C(state) is C(present), this parameter can override the slug in the meta section of the json file. - If you want to import a json dashboard exported directly from the interface (not from the api), you have to specify the slug parameter because there is no meta section in the exported json. uid: version_added: 2.7 description: - uid of the dasboard to export when C(state) is C(export) or C(absent). path: description: - The path to the json file containing the Grafana dashboard to import or export. overwrite: description: - Override existing dashboard when state is present. type: bool default: 'no' message: description: - Set a commit message for the version history. - Only used when C(state) is C(present). validate_certs: description: - If C(no), SSL certificates will not be validated. - This should only be used on personally controlled sites using self-signed certificates. type: bool default: 'yes' client_cert: description: - PEM formatted certificate chain file to be used for SSL client authentication. - This file can also include the key as well, and if the key is included, client_key is not required version_added: 2.7 client_key: description: - PEM formatted file that contains your private key to be used for SSL client - authentication. If client_cert contains both the certificate and key, this option is not required version_added: 2.7 use_proxy: description: - Boolean of whether or not to use proxy. default: 'yes' type: bool version_added: 2.7 ''' EXAMPLES = ''' - hosts: localhost connection: local tasks: - name: Import Grafana dashboard foo grafana_dashboard: grafana_url: http://grafana.company.com grafana_api_key: "{{ grafana_api_key }}" state: present message: Updated by ansible overwrite: yes path: /path/to/dashboards/foo.json - name: Export dashboard grafana_dashboard: grafana_url: http://grafana.company.com grafana_user: "admin" grafana_password: "{{ grafana_password }}" org_id: 1 state: export uid: "000000653" path: "/path/to/dashboards/000000653.json" ''' RETURN = ''' --- uid: description: uid or slug of the created / deleted / exported dashboard. returned: success type: string sample: 000000063 ''' import json from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.urls import fetch_url, url_argument_spec from ansible.module_utils._text import to_native __metaclass__ = type class GrafanaAPIException(Exception): pass class GrafanaMalformedJson(Exception): pass class GrafanaExportException(Exception): pass class GrafanaDeleteException(Exception): pass def grafana_switch_organisation(module, grafana_url, org_id, headers): r, info = fetch_url(module, '%s/api/user/using/%s' % (grafana_url, org_id), headers=headers, method='POST') if info['status'] != 200: raise GrafanaAPIException('Unable to switch to organization %s : %s' % (org_id, info)) def grafana_headers(module, data): headers = {'content-type': 'application/json; charset=utf8'} if 'grafana_api_key' in data and data['grafana_api_key']: headers['Authorization'] = "Bearer %s" % data['grafana_api_key'] else: module.params['force_basic_auth'] = True grafana_switch_organisation(module, data['grafana_url'], data['org_id'], headers) return headers def get_grafana_version(module, grafana_url, headers): grafana_version = None r, info = fetch_url(module, '%s/api/frontend/settings' % grafana_url, headers=headers, method='GET') if info['status'] == 200: try: settings = json.loads(r.read()) grafana_version = str.split(settings['buildInfo']['version'], '.')[0] except Exception as e: raise GrafanaAPIException(e) else: raise GrafanaAPIException('Unable to get grafana version : %s' % info) return int(grafana_version) def grafana_dashboard_exists(module, grafana_url, uid, headers): dashboard_exists = False dashboard = {} grafana_version = get_grafana_version(module, grafana_url, headers) if grafana_version >= 5: r, info = fetch_url(module, '%s/api/dashboards/uid/%s' % (grafana_url, uid), headers=headers, method='GET') else: r, info = fetch_url(module, '%s/api/dashboards/db/%s' % (grafana_url, uid), headers=headers, method='GET') if info['status'] == 200: dashboard_exists = True try: dashboard = json.loads(r.read()) except Exception as e: raise GrafanaAPIException(e) elif info['status'] == 404: dashboard_exists = False else: raise GrafanaAPIException('Unable to get dashboard %s : %s' % (uid, info)) return dashboard_exists, dashboard def grafana_create_dashboard(module, data): # define data payload for grafana API try: with open(data['path'], 'r') as json_file: payload = json.load(json_file) except Exception as e: raise GrafanaAPIException("Can't load json file %s" % to_native(e)) # define http header headers = grafana_headers(module, data) grafana_version = get_grafana_version(module, data['grafana_url'], headers) if grafana_version < 5: if data.get('slug'): uid = data['slug'] elif 'meta' in payload and 'slug' in payload['meta']: uid = payload['meta']['slug'] else: raise GrafanaMalformedJson('No slug found in json. Needed with grafana < 5') else: if data.get('uid'): uid = data['uid'] elif 'uid' in payload['dashboard']: uid = payload['dashboard']['uid'] else: uid = None # test if dashboard already exists dashboard_exists, dashboard = grafana_dashboard_exists(module, data['grafana_url'], uid, headers=headers) result = {} if dashboard_exists is True: if dashboard == payload: # unchanged result['uid'] = uid result['msg'] = "Dashboard %s unchanged." % uid result['changed'] = False else: # update if 'overwrite' in data and data['overwrite']: payload['overwrite'] = True if 'message' in data and data['message']: payload['message'] = data['message'] r, info = fetch_url(module, '%s/api/dashboards/db' % data['grafana_url'], data=json.dumps(payload), headers=headers, method='POST') if info['status'] == 200: if grafana_version >= 5: try: dashboard = json.loads(r.read()) uid = dashboard['uid'] except Exception as e: raise GrafanaAPIException(e) result['uid'] = uid result['msg'] = "Dashboard %s updated" % uid result['changed'] = True else: body = json.loads(info['body']) raise GrafanaAPIException('Unable to update the dashboard %s : %s' % (uid, body['message'])) else: # create if 'dashboard' not in payload: payload = {'dashboard': payload} r, info = fetch_url(module, '%s/api/dashboards/db' % data['grafana_url'], data=json.dumps(payload), headers=headers, method='POST') if info['status'] == 200: result['msg'] = "Dashboard %s created" % uid result['changed'] = True if grafana_version >= 5: try: dashboard = json.loads(r.read()) uid = dashboard['uid'] except Exception as e: raise GrafanaAPIException(e) result['uid'] = uid else: raise GrafanaAPIException('Unable to create the new dashboard %s : %s - %s.' % (uid, info['status'], info)) return result def grafana_delete_dashboard(module, data): # define http headers headers = grafana_headers(module, data) grafana_version = get_grafana_version(module, data['grafana_url'], headers) if grafana_version < 5: if data.get('slug'): uid = data['slug'] else: raise GrafanaMalformedJson('No slug parameter. Needed with grafana < 5') else: if data.get('uid'): uid = data['uid'] else: raise GrafanaDeleteException('No uid specified %s') # test if dashboard already exists dashboard_exists, dashboard = grafana_dashboard_exists(module, data['grafana_url'], uid, headers=headers) result = {} if dashboard_exists is True: # delete if grafana_version < 5: r, info = fetch_url(module, '%s/api/dashboards/db/%s' % (data['grafana_url'], uid), headers=headers, method='DELETE') else: r, info = fetch_url(module, '%s/api/dashboards/uid/%s' % (data['grafana_url'], uid), headers=headers, method='DELETE') if info['status'] == 200: result['msg'] = "Dashboard %s deleted" % uid result['changed'] = True result['uid'] = uid else: raise GrafanaAPIException('Unable to update the dashboard %s : %s' % (uid, info)) else: # dashboard does not exist, do nothing result = {'msg': "Dashboard %s does not exist." % uid, 'changed': False, 'uid': uid} return result def grafana_export_dashboard(module, data): # define http headers headers = grafana_headers(module, data) grafana_version = get_grafana_version(module, data['grafana_url'], headers) if grafana_version < 5: if data.get('slug'): uid = data['slug'] else: raise GrafanaMalformedJson('No slug parameter. Needed with grafana < 5') else: if data.get('uid'): uid = data['uid'] else: raise GrafanaExportException('No uid specified') # test if dashboard already exists dashboard_exists, dashboard = grafana_dashboard_exists(module, data['grafana_url'], uid, headers=headers) if dashboard_exists is True: try: with open(data['path'], 'w') as f: f.write(json.dumps(dashboard)) except Exception as e: raise GrafanaExportException("Can't write json file : %s" % to_native(e)) result = {'msg': "Dashboard %s exported to %s" % (uid, data['path']), 'uid': uid, 'changed': True} else: result = {'msg': "Dashboard %s does not exist." % uid, 'uid': uid, 'changed': False} return result def main(): # use the predefined argument spec for url argument_spec = url_argument_spec() # remove unnecessary arguments del argument_spec['force'] del argument_spec['force_basic_auth'] del argument_spec['http_agent'] argument_spec.update( state=dict(choices=['present', 'absent', 'export'], default='present'), url=dict(aliases=['grafana_url'], required=True), url_username=dict(aliases=['grafana_user'], default='admin'), url_password=dict(aliases=['grafana_password'], default='admin', no_log=True), grafana_api_key=dict(type='str', no_log=True), org_id=dict(default=1, type='int'), uid=dict(type='str'), slug=dict(type='str'), path=dict(type='str'), overwrite=dict(type='bool', default=False), message=dict(type='str'), ) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=False, required_together=[['url_username', 'url_password', 'org_id']], mutually_exclusive=[['grafana_user', 'grafana_api_key'], ['uid', 'slug']], ) try: if module.params['state'] == 'present': result = grafana_create_dashboard(module, module.params) elif module.params['state'] == 'absent': result = grafana_delete_dashboard(module, module.params) else: result = grafana_export_dashboard(module, module.params) except GrafanaAPIException as e: module.fail_json( failed=True, msg="error : %s" % to_native(e) ) return except GrafanaMalformedJson as e: module.fail_json( failed=True, msg="error : json file does not contain a meta section with a slug parameter, or you did'nt specify the slug parameter" ) return except GrafanaDeleteException as e: module.fail_json( failed=True, msg="error : Can't delete dashboard : %s" % to_native(e) ) return except GrafanaExportException as e: module.fail_json( failed=True, msg="error : Can't export dashboard : %s" % to_native(e) ) return module.exit_json(<|fim▁hole|> **result ) return if __name__ == '__main__': main()<|fim▁end|>
failed=False,
<|file_name|>fft.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python <|fim▁hole|># 8 band Audio equaliser from wav file # import alsaaudio as aa # import smbus from struct import unpack import numpy as np import wave from time import sleep import sys ADDR = 0x20 #The I2C address of MCP23017 DIRA = 0x00 #PortA I/O direction, by pin. 0=output, 1=input DIRB = 0x01 #PortB I/O direction, by pin. 0=output, 1=input BANKA = 0x12 #Register address for Bank A BANKB = 0x13 #Register address for Bank B # bus=smbus.SMBus(0) #Use '1' for newer Pi boards; # #Set up the 23017 for 16 output pins # bus.write_byte_data(ADDR, DIRA, 0); #all zeros = all outputs on Bank A # bus.write_byte_data(ADDR, DIRB, 0); #all zeros = all outputs on Bank B # def TurnOffLEDS (): # bus.write_byte_data(ADDR, BANKA, 0xFF) #set all columns high # bus.write_byte_data(ADDR, BANKB, 0x00) #set all rows low # def Set_Column(row, col): # bus.write_byte_data(ADDR, BANKA, col) # bus.write_byte_data(ADDR, BANKB, row) # # Initialise matrix # TurnOffLEDS() matrix = [0,0,0,0,0,0,0,0] power = [] # weighting = [2,2,8,8,16,32,64,64] # Change these according to taste weighting = [2,2,2,2,4,4,8,8] # Change these according to taste # Set up audio #wavfile = wave.open('test_stereo_16000Hz_16bit_PCM.wav','r') #wavfile = wave.open('Media-Convert_test5_PCM_Stereo_VBR_8SS_44100Hz.wav','r') wavfile = wave.open('Media-Convert_test2_PCM_Mono_VBR_8SS_48000Hz.wav','r') sample_rate = wavfile.getframerate() no_channels = wavfile.getnchannels() chunk = 4096 # Use a multiple of 8 # output = aa.PCM(aa.PCM_PLAYBACK, aa.PCM_NORMAL) # output.setchannels(no_channels) # output.setrate(sample_rate) # output.setformat(aa.PCM_FORMAT_S16_LE) # output.setperiodsize(chunk) # Return power array index corresponding to a particular frequency def piff(val): return int(2*chunk*val/sample_rate) def print_intensity(matrix): levelFull = "||||||||"; levelEmpty = " "; levelStr = ""; for level in matrix: #level = 0; levelStr += levelFull[0: level] + levelEmpty [0:8-(level)] + " "; sys.stdout.write("\rlevel: " + levelStr); sys.stdout.flush(); def calculate_levels(data, chunk, sample_rate): #print ("[calculate_levels] chunk=%s, sample_rate: %s, len(data)=%s" % (chunk, sample_rate, len(data))); if(len(data) != chunk): print ("\n[calculate_levels] skiping: chunk=%s != len(data)=%s" % (chunk, len(data))); return None; global matrix # Convert raw data (ASCII string) to numpy array data = unpack("%dh"%(len(data)/2),data) data = np.array(data, dtype='h') # Apply FFT - real data fourier=np.fft.rfft(data) # Remove last element in array to make it the same size as chunk fourier=np.delete(fourier,len(fourier)-1) # Find average 'amplitude' for specific frequency ranges in Hz power = np.abs(fourier) matrix[0]= int(np.mean(power[piff(0) :piff(156):1])) matrix[1]= int(np.mean(power[piff(156) :piff(313):1])) matrix[2]= int(np.mean(power[piff(313) :piff(625):1])) matrix[3]= int(np.mean(power[piff(625) :piff(1250):1])) matrix[4]= int(np.mean(power[piff(1250) :piff(2500):1])) matrix[5]= int(np.mean(power[piff(2500) :piff(5000):1])) matrix[6]= int(np.mean(power[piff(5000) :piff(10000):1])) # Produces error, I guess to low sampling rate of the audio file # matrix[7]= int(np.mean(power[piff(10000):piff(20000):1])) # Tidy up column values for the LED matrix matrix=np.divide(np.multiply(matrix,weighting),1000000) # Set floor at 0 and ceiling at 8 for LED matrix matrix=matrix.clip(0,8) return matrix # Process audio file print "Processing....." data = wavfile.readframes(chunk) while data != '': # output.write(data) matrix = calculate_levels(data, chunk,sample_rate) if matrix == None: next; print_intensity(matrix); # for i in range (0,8): # Set_Column((1<<matrix[i])-1,0xFF^(1<<i)) sleep(0.1); data = wavfile.readframes(chunk) # TurnOffLEDS() # =========================<|fim▁end|>
<|file_name|>__init__.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<|fim▁hole|>from .metrics import ( MetricsHandler, MetricsTimelineHandler ) from .topology import ( TopologyExceptionSummaryHandler, ListTopologiesJsonHandler, TopologyLogicalPlanJsonHandler, TopologyPackingPlanJsonHandler, TopologyPhysicalPlanJsonHandler, TopologySchedulerLocationJsonHandler, TopologyExecutionStateJsonHandler, TopologyExceptionsJsonHandler, PidHandler, JstackHandler, MemoryHistogramHandler, JmapHandler )<|fim▁end|>
# specific language governing permissions and limitations # under the License. ''' api module '''
<|file_name|>presented_job_state.go<|end_file_name|><|fim▁begin|>package drain import ( "encoding/json" boshas "github.com/cloudfoundry/bosh-agent/agent/applier/applyspec" bosherr "github.com/cloudfoundry/bosh-agent/internal/github.com/cloudfoundry/bosh-utils/errors" )<|fim▁hole|>// presentedJobState exposes only limited subset of apply spec to drain scripts. // New fields should only be exposed once concrete use cases develop. type presentedJobState struct { applySpec *boshas.V1ApplySpec } type presentedJobStateEnvelope struct { // PersistentDisk is exposed to determine if data needs to be migrated off // when disk is completely removed or shrinks in size PersistentDisk int `json:"persistent_disk"` } func newPresentedJobState(applySpec *boshas.V1ApplySpec) presentedJobState { return presentedJobState{applySpec: applySpec} } func (js presentedJobState) MarshalToJSONString() (string, error) { if js.applySpec == nil { return "", nil } envelope := presentedJobStateEnvelope{ PersistentDisk: js.applySpec.PersistentDisk, } bytes, err := json.Marshal(envelope) if err != nil { return "", bosherr.WrapError(err, "Marshalling job state") } return string(bytes), nil }<|fim▁end|>
<|file_name|>lc587-erect-the-fence.py<|end_file_name|><|fim▁begin|># coding=utf-8 import unittest """587. Erect the Fence https://leetcode.com/problems/erect-the-fence/description/ There are some trees, where each tree is represented by (x,y) coordinate in a two-dimensional garden. Your job is to fence the entire garden using the **minimum length** of rope as it is expensive. The garden is well fenced only if all the trees are enclosed. Your task is to help find the coordinates of trees which are exactly located on the fence perimeter. **Example 1:** **Input:** [[1,1],[2,2],[2,0],[2,4],[3,3],[4,2]] **Output:** [[1,1],[2,0],[4,2],[3,3],[2,4]] **Explanation:** ![](/static/images/problemset/erect_the_fence_1.png) **Example 2:** **Input:** [[1,2],[2,2],[4,2]] **Output:** [[1,2],[2,2],[4,2]] **Explanation:** ![](/static/images/problemset/erect_the_fence_2.png) Even you only have trees in a line, you need to use rope to enclose them. Note: 1. All trees should be enclosed together. You cannot cut the rope to enclose trees that will separate them in more than one group. 2. All input integers will range from 0 to 100. 3. The garden has at least one tree. 4. All coordinates are distinct. 5. Input points have **NO** order. No order required for output. Similar Questions: """ # Definition for a point. # class Point(object): # def __init__(self, a=0, b=0): # self.x = a <|fim▁hole|># self.y = b class Solution(object): def outerTrees(self, points): """ :type points: List[Point] :rtype: List[Point] """ def test(self): pass if __name__ == "__main__": unittest.main()<|fim▁end|>
<|file_name|>rpc.py<|end_file_name|><|fim▁begin|># ============================================================================= # Copyright [2013] [Kevin Carter] # License Information : # This software has no warranty, it is provided 'as is'. It is your # responsibility to validate the behavior of the routines and its accuracy # using the code provided. Consult the GNU General Public license for further # details (see GNU General Public License). # http://www.gnu.org/licenses/gpl.html # ============================================================================= import json import logging import traceback import kombu from kombu.utils import debug from tribble.common import system_config CONFIG = system_config.ConfigurationSetup() RPC_CFG = CONFIG.config_args('rpc') LOG = logging.getLogger('tribble-common') def rpc_logging_service(log_level, handlers): """Setup an RPC logger. :param log_level: ``object`` :param handlers: ``object`` """ debug.setup_logging(loglevel=log_level, loggers=handlers) def load_queues(connection): """Load queues off of the set topic. :param connection: ``object`` :return: ``object`` """ if connection is False: return False _routing_key = get_routing_key() _exchange = _load_exchange(connection) return declare_queue(_routing_key, connection, _exchange) def _load_exchange(connection): """Load RPC exchange. :param connection: ``object`` :return: ``object`` """ return exchange(conn=connection) def connect(): """Create the connection the AMQP. :return: ``object`` """ if not RPC_CFG: return False return kombu.Connection( hostname=RPC_CFG.get('host', '127.0.0.1'), port=RPC_CFG.get('port', 5672), userid=RPC_CFG.get('userid', 'guest'), password=RPC_CFG.get('password', 'guest'), virtual_host=RPC_CFG.get('virtual_host', '/') ) def exchange(conn): """Bind a connection to an exchange. :param conn: ``object`` :return: ``object`` """ return kombu.Exchange( RPC_CFG.get('control_exchange', 'tribble'),<|fim▁hole|> channel=conn.channel() ) def declare_queue(routing_key, conn, topic_exchange): """Declare working queue. :param routing_key: ``str`` :param conn: ``object`` :param topic_exchange: ``str`` :return: ``object`` """ return_queue = kombu.Queue( name=routing_key, routing_key=routing_key, exchange=topic_exchange, channel=conn.channel(), durable=RPC_CFG.get('durable_queues', False), ) return_queue.declare() return return_queue def publisher(message, topic_exchange, routing_key): """Publish Messages into AMQP. :param message: ``str`` :param topic_exchange: ``str`` :param routing_key: ``str`` """ try: msg_new = topic_exchange.Message( json.dumps(message), content_type='application/json' ) topic_exchange.publish(msg_new, routing_key) except Exception: LOG.error(traceback.format_exc()) def get_routing_key(routing_key='control_exchange'): """Return the routing Key from config. :param routing_key: ``str`` :return: ``str`` """ return '%s.info' % RPC_CFG.get(routing_key) def default_publisher(message): """Publish an RPC message. :param message: ``dict`` """ conn = connect() _exchange = exchange(conn) _routing_key = get_routing_key() publisher( message=message, topic_exchange=_exchange, routing_key=_routing_key )<|fim▁end|>
type='topic', durable=RPC_CFG.get('durable_queues', False),
<|file_name|>predefined.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """Copyright (C) 2009,2010 Wolfgang Rohdewald <wolfgang@rohdewald.de> kajongg is free software you can redistribute it and/or modifys 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. This program 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 this program if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. """ # See the user manual for a description of how to define rulesets. # Names and descriptions must be english and may only contain ascii chars. # Because kdecore.i18n() only accepts 8bit characters, no unicode. # The KDE translation teams will "automatically" translate name and # description into many languages. from rule import Rule, PredefinedRuleset from util import m18nE, m18n class ClassicalChinese(PredefinedRuleset): """classical chinese rules, standard rules. Serves as a basis for local variants. This should be defined such that the sum of the differences to the local variants is minimized.""" def __init__(self, name=None): PredefinedRuleset.__init__(self, name or m18nE('Classical Chinese standard')) def initRuleset(self): """sets the description""" self.description = m18n('Classical Chinese') def addManualRules(self): """those are actually winner rules but in the kajongg scoring mode they must be selected manually""" # applicable only if we have a concealed meld and a declared kong: self.winnerRules.add(Rule('Last Tile Taken from Dead Wall', 'FLastTileFromDeadWall||Olastsource=e', doubles=1, description=m18n('The dead wall is also called kong box: The last 16 tiles of the wall ' 'used as source of replacement tiles'))) self.winnerRules.add(Rule('Last Tile is Last Tile of Wall', 'FIsLastTileFromWall||Olastsource=z', doubles=1, description=m18n('Winner said Mah Jong with the last tile taken from the living end of the wall'))) self.winnerRules.add(Rule('Last Tile is Last Tile of Wall Discarded', 'FIsLastTileFromWallDiscarded||Olastsource=Z', doubles=1, description=m18n('Winner said Mah Jong by claiming the last tile taken from the living end of the ' 'wall, discarded by another player'))) self.winnerRules.add(Rule('Robbing the Kong', r'FRobbingKong||Olastsource=k', doubles=1, description=m18n('Winner said Mah Jong by claiming the 4th tile of a kong another player ' 'just declared'), debug=True)) self.winnerRules.add(Rule('Mah Jongg with Original Call', 'FMahJonggWithOriginalCall||Odeclaration=a', doubles=1, description=m18n( 'Just before the first discard, a player can declare Original Call meaning she needs only one ' 'tile to complete the hand and announces she will not alter the hand in any way (except bonus tiles)'))) self.winnerRules.add(Rule('Dangerous Game', 'FDangerousGame||Opayforall', description=m18n('In some situations discarding a tile that has a high chance to help somebody to win ' 'is declared to be dangerous, and if that tile actually makes somebody win, the discarder ' 'pays the winner for all'))) self.winnerRules.add(Rule('Twofold Fortune', 'FTwofoldFortune||Odeclaration=t', limits=1, description=m18n('Kong after Kong: Declare Kong and a second Kong with the replacement ' 'tile and Mah Jong with the second replacement tile'))) # limit hands: self.winnerRules.add(Rule('Blessing of Heaven', 'FBlessingOfHeaven||Olastsource=1', limits=1, description=m18n('East says Mah Jong with the unmodified dealt tiles'))) self.winnerRules.add(Rule('Blessing of Earth', 'FBlessingOfEarth||Olastsource=1', limits=1, description=m18n('South, West or North says Mah Jong with the first tile discarded by East'))) # the next rule is never proposed, the program applies it when appropriate. Do not change the XEAST9X. # XEAST9X is meant to never match a hand, and the program will identify this rule by searching for XEAST9X self.winnerRules.add(Rule('East won nine times in a row', r'XEAST9X||Oabsolute', limits=1, description=m18n('If that happens, East gets a limit score and the winds rotate'))) def addPenaltyRules(self): """as the name says""" self.penaltyRules.add(Rule( 'False Naming of Discard, Claimed for Mah Jongg and False Declaration of Mah Jongg', 'Oabsolute payers=2 payees=2', points = -300)) def addHandRules(self): """as the name says""" self.handRules.add(Rule('Own Flower and Own Season', 'FOwnFlowerOwnSeason', doubles=1)) self.handRules.add(Rule('All Flowers', 'FAllFlowers', doubles=1)) self.handRules.add(Rule('All Seasons', 'FAllSeasons', doubles=1)) self.handRules.add(Rule('Three Concealed Pongs', 'FThreeConcealedPongs', doubles=1)) self.handRules.add(Rule('Long Hand', r'FLongHand||Oabsolute', points=0, description=m18n('The hand contains too many tiles'))) def addParameterRules(self): """as the name says""" self.parameterRules.add(Rule('Points Needed for Mah Jongg', 'intminMJPoints||Omandatory', parameter=0)) self.parameterRules.add(Rule('Minimum number of doubles needed for Mah Jongg', 'intminMJDoubles||OMandatory', parameter=0)) self.parameterRules.add(Rule('Points for a Limit Hand', 'intlimit||Omandatory||Omin=1', parameter=500)) # TODO: we are in string freeze, so for now we just add this option but make it noneditable msg = '' self.parameterRules.add(Rule(msg, 'boolroofOff||Omandatory', parameter=False)) self.parameterRules.add(Rule('Claim Timeout', 'intclaimTimeout||Omandatory', parameter=10)) self.parameterRules.add(Rule('Size of Kong Box', 'intkongBoxSize||Omandatory', parameter=16, description=m18n('The Kong Box is used for replacement tiles when declaring kongs'))) self.parameterRules.add(Rule('Play with Bonus Tiles', 'boolwithBonusTiles||OMandatory', parameter=True, description=m18n('Bonus tiles increase the luck factor'))) self.parameterRules.add(Rule('Minimum number of rounds in game', 'intminRounds||OMandatory', parameter=4)) self.parameterRules.add(Rule('number of allowed chows', 'intmaxChows||Omandatory', parameter=4, description=m18n('The number of chows a player may build'))) self.parameterRules.add(Rule('must declare calling hand', 'boolmustDeclareCallingHand||Omandatory', parameter=False, description=m18n('Mah Jongg is only allowed after having declared to have a calling hand'))) def loadRules(self): """define the rules""" self.addParameterRules() # must be first! self.addPenaltyRules() self.addHandRules() self.addManualRules() self.winnerRules.add(Rule('Last Tile Completes Pair of 2..8', 'FLastTileCompletesPairMinor', points=2)) self.winnerRules.add(Rule('Last Tile Completes Pair of Terminals or Honors', 'FLastTileCompletesPairMajor', points=4)) self.winnerRules.add(Rule('Last Tile is Only Possible Tile', 'FLastOnlyPossible', points=4)) self.winnerRules.add(Rule('Won with Last Tile Taken from Wall', 'FLastFromWall', points=2)) self.winnerRules.add(Rule('Zero Point Hand', 'FZeroPointHand', doubles=1, description=m18n('The hand has 0 basis points excluding bonus tiles'))) self.winnerRules.add(Rule('No Chow', 'FNoChow', doubles=1)) self.winnerRules.add(Rule('Only Concealed Melds', 'FOnlyConcealedMelds', doubles=1)) self.winnerRules.add(Rule('False Color Game', 'FFalseColorGame', doubles=1, description=m18n('Only same-colored tiles (only bamboo/stone/character) ' 'plus any number of winds and dragons'))) self.winnerRules.add(Rule('True Color Game', 'FTrueColorGame', doubles=3, description=m18n('Only same-colored tiles (only bamboo/stone/character)'))) self.winnerRules.add(Rule('Concealed True Color Game', 'FConcealedTrueColorGame', limits=1, description=m18n('All tiles concealed and of the same suit, no honors'))) self.winnerRules.add(Rule('Only Terminals and Honors', 'FOnlyMajors', doubles=1, description=m18n('Only winds, dragons, 1 and 9'))) self.winnerRules.add(Rule('Only Honors', 'FOnlyHonors', limits=1, description=m18n('Only winds and dragons'))) self.winnerRules.add(Rule('Hidden Treasure', 'FHiddenTreasure', limits=1, description=m18n('Only hidden Pungs or Kongs, last tile from wall'))) self.winnerRules.add(Rule('Heads and Tails', 'FAllTerminals', limits=1, description=m18n('Only 1 and 9'))) self.winnerRules.add(Rule('Fourfold Plenty', 'FFourfoldPlenty', limits=1, description=m18n('4 Kongs'))) self.winnerRules.add(Rule('Three Great Scholars', 'FThreeGreatScholars', limits=1, description=m18n('3 Pungs or Kongs of dragons'))) self.winnerRules.add(Rule('Four Blessings Hovering Over the Door', 'FFourBlessingsHoveringOverTheDoor', limits=1, description=m18n('4 Pungs or Kongs of winds'))) self.winnerRules.add(Rule('All Greens', 'FAllGreen', limits=1, description=m18n('Only green tiles: Green dragon and Bamboo 2,3,4,6,8'))) self.winnerRules.add(Rule('Gathering the Plum Blossom from the Roof', 'FGatheringPlumBlossomFromRoof', limits=1, description=m18n('Mah Jong with stone 5 from the dead wall'))) self.winnerRules.add(Rule('Plucking the Moon from the Bottom of the Sea', 'FPluckingMoon', limits=1, description=m18n('Mah Jong with the last tile from the wall being a stone 1'))) self.winnerRules.add(Rule('Scratching a Carrying Pole', 'FScratchingPole', limits=1, description=m18n('Robbing the Kong of bamboo 2'))) # only hands matching an mjRule can win. Keep this list as short as # possible. If a special hand matches the standard pattern, do not put it here # All mjRule functions must have a winningTileCandidates() method self.mjRules.add(Rule('Standard Mah Jongg', 'FStandardMahJongg', points=20)) self.mjRules.add(Rule('Nine Gates', 'FGatesOfHeaven||OlastExtra', limits=1, description=m18n('All tiles concealed of same color: Values 1-1-1-2-3-4-5-6-7-8-9-9-9 completed ' 'with another tile of the same color (from wall or discarded)'))) self.mjRules.add(Rule('Thirteen Orphans', 'FThirteenOrphans||Omayrobhiddenkong', limits=1, description=m18n('13 single tiles: All dragons, winds, 1, 9 and a 14th tile building a pair ' 'with one of them'))) # doubling melds: self.meldRules.add(Rule('Pung/Kong of Dragons', 'FDragonPungKong', doubles=1)) self.meldRules.add(Rule('Pung/Kong of Own Wind', 'FOwnWindPungKong', doubles=1)) self.meldRules.add(Rule('Pung/Kong of Round Wind', 'FRoundWindPungKong', doubles=1)) # exposed melds: self.meldRules.add(Rule('Exposed Kong', 'FExposedMinorKong', points=8)) self.meldRules.add(Rule('Exposed Kong of Terminals', 'FExposedTerminalsKong', points=16)) self.meldRules.add(Rule('Exposed Kong of Honors', 'FExposedHonorsKong', points=16)) self.meldRules.add(Rule('Exposed Pung', 'FExposedMinorPung', points=2)) self.meldRules.add(Rule('Exposed Pung of Terminals', 'FExposedTerminalsPung', points=4)) self.meldRules.add(Rule('Exposed Pung of Honors', 'FExposedHonorsPung', points=4)) # concealed melds: self.meldRules.add(Rule('Concealed Kong', 'FConcealedMinorKong', points=16)) self.meldRules.add(Rule('Concealed Kong of Terminals', 'FConcealedTerminalsKong', points=32)) self.meldRules.add(Rule('Concealed Kong of Honors', 'FConcealedHonorsKong', points=32)) self.meldRules.add(Rule('Concealed Pung', 'FConcealedMinorPung', points=4)) self.meldRules.add(Rule('Concealed Pung of Terminals', 'FConcealedTerminalsPung', points=8)) self.meldRules.add(Rule('Concealed Pung of Honors', 'FConcealedHonorsPung', points=8)) self.meldRules.add(Rule('Pair of Own Wind', 'FOwnWindPair', points=2)) self.meldRules.add(Rule('Pair of Round Wind', 'FRoundWindPair', points=2)) self.meldRules.add(Rule('Pair of Dragons', 'FDragonPair', points=2)) # bonus tiles: self.meldRules.add(Rule('Flower', 'FFlower', points=4)) self.meldRules.add(Rule('Season', 'FSeason', points=4)) class ClassicalChineseDMJL(ClassicalChinese): """classical chinese rules, German rules""" def __init__(self, name=None): ClassicalChinese.__init__(self, name or m18nE('Classical Chinese DMJL')) def initRuleset(self): """sets the description""" ClassicalChinese.initRuleset(self) self.description = m18n('Classical Chinese as defined by the Deutsche Mah Jongg Liga (DMJL) e.V.') def loadRules(self): ClassicalChinese.loadRules(self) # the squirming snake is only covered by standard mahjongg rule if tiles are ordered self.mjRules.add(Rule('Squirming Snake', 'FSquirmingSnake', limits=1, description=m18n('All tiles of same color. Pung or Kong of 1 and 9, pair of 2, 5 or 8 and two ' 'Chows of the remaining values'))) self.handRules.add(Rule('Little Three Dragons', 'FLittleThreeDragons', doubles=1,<|fim▁hole|> self.handRules.add(Rule('Big Three Dragons', 'FBigThreeDragons', doubles=2, description=m18n('3 Pungs or Kongs of dragons'))) self.handRules.add(Rule('Little Four Joys', 'FLittleFourJoys', doubles=1, description=m18n('3 Pungs or Kongs of winds and 1 pair of winds'))) self.handRules.add(Rule('Big Four Joys', 'FBigFourJoys', doubles=2, description=m18n('4 Pungs or Kongs of winds'))) self.winnerRules['Only Honors'].doubles = 2 self.penaltyRules.add(Rule('False Naming of Discard, Claimed for Chow', points = -50)) self.penaltyRules.add(Rule('False Naming of Discard, Claimed for Pung/Kong', points = -100)) self.penaltyRules.add(Rule('False Declaration of Mah Jongg by One Player', 'Oabsolute payees=3', points = -300)) self.penaltyRules.add(Rule('False Declaration of Mah Jongg by Two Players', 'Oabsolute payers=2 payees=2', points = -300)) self.penaltyRules.add(Rule('False Declaration of Mah Jongg by Three Players', 'Oabsolute payers=3', points = -300)) self.penaltyRules.add(Rule('False Naming of Discard, Claimed for Mah Jongg', 'Oabsolute payees=3', points = -300)) class ClassicalChineseBMJA(ClassicalChinese): """classical chinese rules, British rules""" def __init__(self, name=None): ClassicalChinese.__init__(self, name or m18nE('Classical Chinese BMJA')) def initRuleset(self): """sets the description""" ClassicalChinese.initRuleset(self) self.description = m18n('Classical Chinese as defined by the British Mah-Jong Association') def addParameterRules(self): """those differ for BMJA from standard""" ClassicalChinese.addParameterRules(self) self.parameterRules['Size of Kong Box'].parameter = 14 self.parameterRules['number of allowed chows'].parameter = 1 self.parameterRules['Points for a Limit Hand'].parameter = 1000 self.parameterRules['must declare calling hand'].parameter = True def loadRules(self): # TODO: we need a separate part for any number of announcements. Both r for robbing kong and a for # Original Call can be possible together. ClassicalChinese.loadRules(self) del self.winnerRules['Zero Point Hand'] originalCall = self.winnerRules.pop('Mah Jongg with Original Call') originalCall.name = m18n('Original Call') self.handRules.add(originalCall) del self.mjRules['Nine Gates'] self.mjRules.add(Rule('Gates of Heaven', 'FGatesOfHeaven||Opair28', limits=1, description=m18n('All tiles concealed of same color: Values 1-1-1-2-3-4-5-6-7-8-9-9-9 and ' 'another tile 2..8 of the same color'))) self.mjRules.add(Rule('Wriggling Snake', 'FWrigglingSnake', limits=1, description=m18n('Pair of 1s and a run from 2 to 9 in the same suit with each of the winds'))) self.mjRules.add(Rule('Triple Knitting', 'FTripleKnitting', limits=0.5, description=m18n('Four sets of three tiles in the different suits and a pair: No Winds or Dragons'))) self.mjRules.add(Rule('Knitting', 'FKnitting', limits=0.5, description=m18n('7 pairs of tiles in any 2 out of 3 suits; no Winds or Dragons'))) self.mjRules.add(Rule('All pair honors', 'FAllPairHonors', limits=0.5, description=m18n('7 pairs of 1s/9s/Winds/Dragons'))) del self.handRules['Own Flower and Own Season'] del self.handRules['Three Concealed Pongs'] self.handRules.add(Rule('Own Flower', 'FOwnFlower', doubles=1)) self.handRules.add(Rule('Own Season', 'FOwnSeason', doubles=1)) del self.winnerRules['Last Tile Taken from Dead Wall'] del self.winnerRules['Hidden Treasure'] del self.winnerRules['False Color Game'] del self.winnerRules['Concealed True Color Game'] del self.winnerRules['East won nine times in a row'] del self.winnerRules['Last Tile Completes Pair of 2..8'] del self.winnerRules['Last Tile Completes Pair of Terminals or Honors'] del self.winnerRules['Last Tile is Only Possible Tile'] self.winnerRules.add(Rule('Buried Treasure', 'FBuriedTreasure', limits=1, description=m18n('Concealed pungs of one suit with winds/dragons and a pair'))) del self.winnerRules['True Color Game'] self.winnerRules.add(Rule('Purity', 'FPurity', doubles=3, description=m18n('Only same-colored tiles (no chows, dragons or winds)'))) self.winnerRules['All Greens'].name = m18n('Imperial Jade') self.mjRules['Thirteen Orphans'].name = m18n('The 13 Unique Wonders') del self.winnerRules['Three Great Scholars'] self.winnerRules.add(Rule('Three Great Scholars', 'FThreeGreatScholars||Onochow', limits=1, description=m18n('3 Pungs or Kongs of dragons plus any pung/kong and a pair'))) self.handRules['All Flowers'].score.doubles = 2 self.handRules['All Seasons'].score.doubles = 2 self.penaltyRules.add(Rule('False Naming of Discard, Claimed for Chow/Pung/Kong', points = -50)) self.penaltyRules.add(Rule('False Declaration of Mah Jongg by One Player', 'Oabsolute payees=3', limits = -0.5)) self.winnerRules.add(Rule('False Naming of Discard, Claimed for Mah Jongg', 'FFalseDiscardForMJ||Opayforall')) self.loserRules.add(Rule('Calling for Only Honors', 'FCallingHand||Ohand=OnlyHonors', limits=0.4)) self.loserRules.add(Rule('Calling for Wriggling Snake', 'FCallingHand||Ohand=WrigglingSnake', limits=0.4)) self.loserRules.add(Rule('Calling for Triple Knitting', 'FCallingHand||Ohand=TripleKnitting', limits=0.2)) self.loserRules.add(Rule('Calling for Gates of Heaven', 'FCallingHand||Ohand=GatesOfHeaven||Opair28', limits=0.4)) self.loserRules.add(Rule('Calling for Knitting', 'FCallingHand||Ohand=Knitting', limits=0.2)) self.loserRules.add(Rule('Calling for Imperial Jade', 'FCallingHand||Ohand=AllGreen', limits=0.4)) self.loserRules.add(Rule('Calling for 13 Unique Wonders', 'FCallingHand||Ohand=ThirteenOrphans', limits=0.4)) self.loserRules.add(Rule('Calling for Three Great Scholars', 'FCallingHand||Ohand=ThreeGreatScholars', limits=0.4)) self.loserRules.add(Rule('Calling for All pair honors', 'FCallingHand||Ohand=AllPairHonors', limits=0.2)) self.loserRules.add(Rule('Calling for Heads and Tails', 'FCallingHand||Ohand=AllTerminals', limits=0.4)) self.loserRules.add(Rule('Calling for Four Blessings Hovering over the Door', 'FCallingHand||Ohand=FourBlessingsHoveringOverTheDoor', limits=0.4)) self.loserRules.add(Rule('Calling for Buried Treasure', 'FCallingHand||Ohand=BuriedTreasure', limits=0.4)) self.loserRules.add(Rule('Calling for Fourfold Plenty', 'FCallingHand||Ohand=FourfoldPlenty', limits=0.4)) self.loserRules.add(Rule('Calling for Purity', 'FCallingHand||Ohand=Purity', doubles=3)) def loadPredefinedRulesets(): """add new predefined rulesets here""" if not PredefinedRuleset.classes: PredefinedRuleset.classes.add(ClassicalChineseDMJL) PredefinedRuleset.classes.add(ClassicalChineseBMJA)<|fim▁end|>
description=m18n('2 Pungs or Kongs of dragons and 1 pair of dragons')))
<|file_name|>Content.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'; import '../Layout.scss'; import './Content.scss'; import { TextUpload } from '../../../components/molecules/TextUpload'; export interface ContentProps { readonly content: string; readonly onChange?: (content: string) => void; readonly onFileNameChange?: (fileName: string) => void; } export class Content extends React.Component<ContentProps, undefined> { render() { return ( <section className="content"> <h2>Content</h2> <form> <TextUpload className="text-upload" buttonClassName="button-secondary" placeholder="Content" text={this.props.content} onChange={this.props.onChange} onFileNameChange={this.props.onFileNameChange} /> </form> </section> ) }<|fim▁hole|><|fim▁end|>
}
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>package com.example.jmtransfers.jmtransfer; import android.content.SharedPreferences; import android.support.v7.app.ActionBar; import android.widget.TextView; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.os.CountDownTimer; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.Menu; import android.view.MenuItem; import android.widget.ImageView; import android.widget.LinearLayout; public class MainActivity extends AppCompatActivity { ProgressDialog progress ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(false); getSupportActionBar().setDisplayShowTitleEnabled(false); getSupportActionBar().setDisplayHomeAsUpEnabled(false); getSupportActionBar().setDisplayShowTitleEnabled(false); progress = new ProgressDialog(this); progress.setTitle("Loading"); progress.setMessage("Wait while loading..."); progress.show(); new CountDownTimer(2000, 1000) { public void onTick(long millisUntilFinished) { } public void onFinish() { progress.dismiss(); Intent intent = new Intent(MainActivity.this, Dashboard.class); startActivity(intent); } }.start(); ImageView logo = (ImageView) findViewById(R.id.logo); logo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, Dashboard.class); startActivity(intent); } }); } <|fim▁hole|> }<|fim▁end|>
<|file_name|>im_export.py<|end_file_name|><|fim▁begin|># -* coding: utf-8 *- from PyQt4 import QtGui from collector.ui.gen.im_export import Ui_Dialog from collector.ui.views import Dialog from collector.ui.helpers.customtoolbar import CustomToolbar from collector.core.controller import get_manager from collector.core.plugin import PluginExporter, PluginImporter import logging class BaseDialog(QtGui.QDialog, Ui_Dialog): """ BaseDialog ---------- Common parts for ImportDialog and ExportDialog """ def __init__(self, parent=None): super(BaseDialog, self).__init__(parent) self.setupUi(self) self.customize() def customize(self): self.label_noplugins.hide() plugins = self.get_plugins() man = get_manager('plugin') items = [] for i in plugins: plugin = man.get(i) items.append( {'class': 'link', 'name': plugin.get_name(), 'path': 'plugin/' + plugin.get_id(), 'image': plugin.icon} ) # Toolbar items.append({'class': 'spacer'}) CustomToolbar(self.toolbar, items, self.select_plugin) if not len(plugins): self.toolbar.hide()<|fim▁hole|> self.label_noplugins.show() def select_plugin(self, uri): """Select plugin callback""" params = self.parent().collector_uri_call(uri) if params is not None: plugin = params.get('plugin', None) if plugin is not None: man = get_manager('plugin') self.hide() try: man.get(plugin).run() self.done(1) except Exception as exc: logging.exception(exc) self.done(-1) def get_plugins(self): plugins = get_manager('plugin').filter(self.filter_) return plugins class ExportDialog(BaseDialog): """ ExportDialog ------------ """ # TODO filter_ = PluginExporter def customize(self): super(ExportDialog, self).customize() self.setWindowTitle(self.tr("Export")) class ImportDialog(BaseDialog): """ ImportDialog ------------ """ filter_ = PluginImporter def customize(self): super(ImportDialog, self).customize() self.setWindowTitle(self.tr("Import")) class ImportView(Dialog): """Properties view""" def get_widget(self, params): return ImportDialog(self.parent) class ExportView(Dialog): """Properties view""" def get_widget(self, params): return ExportDialog(self.parent)<|fim▁end|>
<|file_name|>mappingsPage.py<|end_file_name|><|fim▁begin|>## mappingsPage.py - show selinux mappings ## Copyright (C) 2006 Red Hat, Inc. ## This program 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. ## This program 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 this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ## Author: Dan Walsh import string import gtk import gtk.glade import os import gobject import sys import seobject ## ## I18N ## PROGNAME = "policycoreutils" try: import gettext kwargs = {} if sys.version_info < (3,): kwargs['unicode'] = True gettext.install(PROGNAME, localedir="/usr/share/locale", codeset='utf-8', **kwargs) except: try: import builtins builtins.__dict__['_'] = str except ImportError:<|fim▁hole|>class loginsPage: def __init__(self, xml): self.xml = xml self.view = xml.get_widget("mappingsView") self.store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING) self.store.set_sort_column_id(0, gtk.SORT_ASCENDING) self.view.set_model(self.store) self.login = loginRecords() dict = self.login.get_all(0) for k in sorted(dict.keys()): print("%-25s %-25s %-25s" % (k, dict[k][0], translate(dict[k][1])))<|fim▁end|>
import __builtin__ __builtin__.__dict__['_'] = unicode
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate xml; extern crate clap; mod polyfill; mod emitter; use emitter::Emitter; use std::fs::File; use std::io::BufReader; use xml::reader::{EventReader, XmlEvent}; use clap::{Arg, App}; fn matching_element_id<'a>(ids: &str, attr: &'a Vec<xml::attribute::OwnedAttribute>) -> Option<&'a str> { let id_attr = match attr.iter().find(|ref a| a.name.local_name == "id") { Some(a) => a, None => return None }; if ids.is_empty() || ids.split(',').any(|i| id_attr.value == i) { Some(&id_attr.value) } else { None } } fn main() { let app: App = App::new("grayfx") .version("0.1.0") .author("Nigel Baillie <metreckk@gmail.com>") .about("Converts Inkscape SVGs into C++ rendering and/or physics code for Gray") .arg(Arg::with_name("input") .help("the svg file to parse") .short("f") .index(1) .takes_value(true) .required(true)) .arg(Arg::with_name("ids") .short("i") .help("comma-separated ids of the elements to process") .takes_value(true) .required(false)) .arg(Arg::with_name("color") .short("c") .help("expression to use for color") .takes_value(true) .required(false)) .arg(Arg::with_name("drawvar") .short("d") .help("generate rendering code with this variable name") .takes_value(true) .required(false)) .arg(Arg::with_name("physicsvar") .short("p") .help("generate physics setup code with this variable name") .takes_value(true) .required(false)); let matches = app.get_matches(); let filename = matches.value_of("input").unwrap(); let file = File::open(filename).unwrap(); let file = BufReader::new(file); let ids = matches.value_of("ids").unwrap_or(""); let color = matches.value_of("color"); let ids_count = if ids.is_empty() { 0 } else { ids.chars().fold(1, |n, c| if c == ',' { n + 1 } else { n }) }; // === Parse XML === let mut emitter = Emitter::new(); let parser = EventReader::new(file); 'parse_xml: for xmlevent in parser { match xmlevent { // elements: Ok(XmlEvent::StartElement { name, attributes, .. }) => { if let Some(id) = matching_element_id(ids, &attributes) { emitter.add_shape(id, &name.local_name, &attributes); // Duck out early if possible if ids_count > 0 && emitter.len() >= ids_count { break 'parse_xml; } } } /* Ok(XmlEvent::EndElement { name }) => { println!("END {}", name); } */ Err(e) => { println!("// Error: {}", e); break; } _ => {} } } // TODO TODO TODO // Next step is to parse color from style and tag collision shapes appropriately // TODO TODO TODO // === Now process elements that matched, in specified order === let draw_var = matches.value_of("drawvar"); let phys_var = matches.value_of("physicsvar"); if ids_count > 0 { let each_id = ids.split(','); for id in each_id {<|fim▁hole|> if !emitter.emit(&id_str, draw_var, phys_var, color) { panic!("ID \"{}\" not found in {}", id_str, filename); } } } else { emitter.emit_all(draw_var, phys_var, color); } }<|fim▁end|>
let id_str = id.to_owned();
<|file_name|>Stack.java<|end_file_name|><|fim▁begin|>package jp.teraparser.transition; import java.util.Arrays; /** * Resizable-array implementation of Deque which works like java.util.ArrayDeque * * jp.teraparser.util * * @author Hiroki Teranishi */ public class Stack implements Cloneable { private static final int MIN_INITIAL_CAPACITY = 8; private int[] elements; private int head; private int tail; /** * Allocates empty array to hold the given number of elements. */ private void allocateElements(int numElements) { int initialCapacity = MIN_INITIAL_CAPACITY; // Find the best power of two to hold elements. // Tests "<=" because arrays aren't kept full. if (numElements >= initialCapacity) { initialCapacity = numElements; initialCapacity |= (initialCapacity >>> 1); initialCapacity |= (initialCapacity >>> 2); initialCapacity |= (initialCapacity >>> 4); initialCapacity |= (initialCapacity >>> 8); initialCapacity |= (initialCapacity >>> 16); initialCapacity++; if (initialCapacity < 0) { // Too many elements, must back off initialCapacity >>>= 1;// Good luck allocating 2 ^ 30 elements } } elements = new int[initialCapacity]; } /** * Doubles the capacity of this deque. Call only when full, i.e., * when head and tail have wrapped around to become equal. */ private void doubleCapacity() { assert head == tail; int p = head; int n = elements.length; int r = n - p; // number of elements to the right of p int newCapacity = n << 1; if (newCapacity < 0) { throw new IllegalStateException("Sorry, deque too big"); } int[] a = new int[newCapacity]; System.arraycopy(elements, p, a, 0, r); System.arraycopy(elements, 0, a, r, p); elements = a; head = 0; tail = n; } public Stack() { elements = new int[16]; } public Stack(int numElements) { allocateElements(numElements); } public void push(int e) { elements[head = (head - 1) & (elements.length - 1)] = e; if (head == tail) { doubleCapacity(); } } public int pop() { int h = head; int result = elements[h]; elements[h] = 0; head = (h + 1) & (elements.length - 1); return result; } public int top() { return elements[head]; } public int getFirst() { return top(); } public int get(int position, int defaultValue) { if (position < 0 || position >= size()) { return defaultValue; } int mask = elements.length - 1; int h = head; for (int i = 0; i < position; i++) { h = (h + 1) & mask; } return elements[h]; } public int size() { return (tail - head) & (elements.length - 1);<|fim▁hole|> public boolean isEmpty() { return head == tail; } public Stack clone() { try { Stack result = (Stack) super.clone(); result.elements = Arrays.copyOf(elements, elements.length); return result; } catch (CloneNotSupportedException e) { throw new AssertionError(); } } }<|fim▁end|>
}
<|file_name|>test_v3.py<|end_file_name|><|fim▁begin|># Copyright 2013 OpenStack Foundation # # 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. import datetime import uuid from oslo_config import cfg from oslo_serialization import jsonutils from oslo_utils import timeutils from testtools import matchers from keystone import auth from keystone.common import authorization from keystone.common import cache from keystone import exception from keystone import middleware from keystone.policy.backends import rules from keystone.tests import unit from keystone.tests.unit import rest CONF = cfg.CONF DEFAULT_DOMAIN_ID = 'default' TIME_FORMAT = unit.TIME_FORMAT class AuthTestMixin(object): """To hold auth building helper functions.""" def build_auth_scope(self, project_id=None, project_name=None, project_domain_id=None, project_domain_name=None, domain_id=None, domain_name=None, trust_id=None, unscoped=None): scope_data = {} if unscoped: scope_data['unscoped'] = {} if project_id or project_name: scope_data['project'] = {} if project_id: scope_data['project']['id'] = project_id else: scope_data['project']['name'] = project_name if project_domain_id or project_domain_name: project_domain_json = {} if project_domain_id: project_domain_json['id'] = project_domain_id else: project_domain_json['name'] = project_domain_name scope_data['project']['domain'] = project_domain_json if domain_id or domain_name: scope_data['domain'] = {} if domain_id: scope_data['domain']['id'] = domain_id else: scope_data['domain']['name'] = domain_name if trust_id: scope_data['OS-TRUST:trust'] = {} scope_data['OS-TRUST:trust']['id'] = trust_id return scope_data <|fim▁hole|> def build_password_auth(self, user_id=None, username=None, user_domain_id=None, user_domain_name=None, password=None): password_data = {'user': {}} if user_id: password_data['user']['id'] = user_id else: password_data['user']['name'] = username if user_domain_id or user_domain_name: password_data['user']['domain'] = {} if user_domain_id: password_data['user']['domain']['id'] = user_domain_id else: password_data['user']['domain']['name'] = user_domain_name password_data['user']['password'] = password return password_data def build_token_auth(self, token): return {'id': token} def build_authentication_request(self, token=None, user_id=None, username=None, user_domain_id=None, user_domain_name=None, password=None, kerberos=False, **kwargs): """Build auth dictionary. It will create an auth dictionary based on all the arguments that it receives. """ auth_data = {} auth_data['identity'] = {'methods': []} if kerberos: auth_data['identity']['methods'].append('kerberos') auth_data['identity']['kerberos'] = {} if token: auth_data['identity']['methods'].append('token') auth_data['identity']['token'] = self.build_token_auth(token) if user_id or username: auth_data['identity']['methods'].append('password') auth_data['identity']['password'] = self.build_password_auth( user_id, username, user_domain_id, user_domain_name, password) if kwargs: auth_data['scope'] = self.build_auth_scope(**kwargs) return {'auth': auth_data} class RestfulTestCase(unit.SQLDriverOverrides, rest.RestfulTestCase, AuthTestMixin): def config_files(self): config_files = super(RestfulTestCase, self).config_files() config_files.append(unit.dirs.tests_conf('backend_sql.conf')) return config_files def get_extensions(self): extensions = set(['revoke']) if hasattr(self, 'EXTENSION_NAME'): extensions.add(self.EXTENSION_NAME) return extensions def generate_paste_config(self): new_paste_file = None try: new_paste_file = unit.generate_paste_config(self.EXTENSION_TO_ADD) except AttributeError: # no need to report this error here, as most tests will not have # EXTENSION_TO_ADD defined. pass finally: return new_paste_file def remove_generated_paste_config(self): try: unit.remove_generated_paste_config(self.EXTENSION_TO_ADD) except AttributeError: pass def setUp(self, app_conf='keystone'): """Setup for v3 Restful Test Cases. """ new_paste_file = self.generate_paste_config() self.addCleanup(self.remove_generated_paste_config) if new_paste_file: app_conf = 'config:%s' % (new_paste_file) super(RestfulTestCase, self).setUp(app_conf=app_conf) self.empty_context = {'environment': {}} # Initialize the policy engine and allow us to write to a temp # file in each test to create the policies rules.reset() # drop the policy rules self.addCleanup(rules.reset) def load_backends(self): # ensure the cache region instance is setup cache.configure_cache_region(cache.REGION) super(RestfulTestCase, self).load_backends() def load_fixtures(self, fixtures): self.load_sample_data() def _populate_default_domain(self): if CONF.database.connection == unit.IN_MEM_DB_CONN_STRING: # NOTE(morganfainberg): If an in-memory db is being used, be sure # to populate the default domain, this is typically done by # a migration, but the in-mem db uses model definitions to create # the schema (no migrations are run). try: self.resource_api.get_domain(DEFAULT_DOMAIN_ID) except exception.DomainNotFound: domain = {'description': (u'Owns users and tenants (i.e. ' u'projects) available on Identity ' u'API v2.'), 'enabled': True, 'id': DEFAULT_DOMAIN_ID, 'name': u'Default'} self.resource_api.create_domain(DEFAULT_DOMAIN_ID, domain) def load_sample_data(self): self._populate_default_domain() self.domain_id = uuid.uuid4().hex self.domain = self.new_domain_ref() self.domain['id'] = self.domain_id self.resource_api.create_domain(self.domain_id, self.domain) self.project_id = uuid.uuid4().hex self.project = self.new_project_ref( domain_id=self.domain_id) self.project['id'] = self.project_id self.resource_api.create_project(self.project_id, self.project) self.user = self.new_user_ref(domain_id=self.domain_id) password = self.user['password'] self.user = self.identity_api.create_user(self.user) self.user['password'] = password self.user_id = self.user['id'] self.default_domain_project_id = uuid.uuid4().hex self.default_domain_project = self.new_project_ref( domain_id=DEFAULT_DOMAIN_ID) self.default_domain_project['id'] = self.default_domain_project_id self.resource_api.create_project(self.default_domain_project_id, self.default_domain_project) self.default_domain_user = self.new_user_ref( domain_id=DEFAULT_DOMAIN_ID) password = self.default_domain_user['password'] self.default_domain_user = ( self.identity_api.create_user(self.default_domain_user)) self.default_domain_user['password'] = password self.default_domain_user_id = self.default_domain_user['id'] # create & grant policy.json's default role for admin_required self.role_id = uuid.uuid4().hex self.role = self.new_role_ref() self.role['id'] = self.role_id self.role['name'] = 'admin' self.role_api.create_role(self.role_id, self.role) self.assignment_api.add_role_to_user_and_project( self.user_id, self.project_id, self.role_id) self.assignment_api.add_role_to_user_and_project( self.default_domain_user_id, self.default_domain_project_id, self.role_id) self.assignment_api.add_role_to_user_and_project( self.default_domain_user_id, self.project_id, self.role_id) self.region_id = uuid.uuid4().hex self.region = self.new_region_ref() self.region['id'] = self.region_id self.catalog_api.create_region( self.region.copy()) self.service_id = uuid.uuid4().hex self.service = self.new_service_ref() self.service['id'] = self.service_id self.catalog_api.create_service( self.service_id, self.service.copy()) self.endpoint_id = uuid.uuid4().hex self.endpoint = self.new_endpoint_ref(service_id=self.service_id) self.endpoint['id'] = self.endpoint_id self.endpoint['region_id'] = self.region['id'] self.catalog_api.create_endpoint( self.endpoint_id, self.endpoint.copy()) # The server adds 'enabled' and defaults to True. self.endpoint['enabled'] = True def new_ref(self): """Populates a ref with attributes common to some API entities.""" return unit.new_ref() def new_region_ref(self): return unit.new_region_ref() def new_service_ref(self): return unit.new_service_ref() def new_endpoint_ref(self, service_id, interface='public', **kwargs): return unit.new_endpoint_ref( service_id, interface=interface, default_region_id=self.region_id, **kwargs) def new_domain_ref(self): return unit.new_domain_ref() def new_project_ref(self, domain_id=None, parent_id=None, is_domain=False): return unit.new_project_ref(domain_id=domain_id, parent_id=parent_id, is_domain=is_domain) def new_user_ref(self, domain_id, project_id=None): return unit.new_user_ref(domain_id, project_id=project_id) def new_group_ref(self, domain_id): return unit.new_group_ref(domain_id) def new_credential_ref(self, user_id, project_id=None, cred_type=None): return unit.new_credential_ref(user_id, project_id=project_id, cred_type=cred_type) def new_role_ref(self): return unit.new_role_ref() def new_policy_ref(self): return unit.new_policy_ref() def new_trust_ref(self, trustor_user_id, trustee_user_id, project_id=None, impersonation=None, expires=None, role_ids=None, role_names=None, remaining_uses=None, allow_redelegation=False): return unit.new_trust_ref( trustor_user_id, trustee_user_id, project_id=project_id, impersonation=impersonation, expires=expires, role_ids=role_ids, role_names=role_names, remaining_uses=remaining_uses, allow_redelegation=allow_redelegation) def create_new_default_project_for_user(self, user_id, domain_id, enable_project=True): ref = self.new_project_ref(domain_id=domain_id) ref['enabled'] = enable_project r = self.post('/projects', body={'project': ref}) project = self.assertValidProjectResponse(r, ref) # set the user's preferred project body = {'user': {'default_project_id': project['id']}} r = self.patch('/users/%(user_id)s' % { 'user_id': user_id}, body=body) self.assertValidUserResponse(r) return project def get_unscoped_token(self): """Convenience method so that we can test authenticated requests.""" r = self.admin_request( method='POST', path='/v3/auth/tokens', body={ 'auth': { 'identity': { 'methods': ['password'], 'password': { 'user': { 'name': self.user['name'], 'password': self.user['password'], 'domain': { 'id': self.user['domain_id'] } } } } } }) return r.headers.get('X-Subject-Token') def get_scoped_token(self): """Convenience method so that we can test authenticated requests.""" r = self.admin_request( method='POST', path='/v3/auth/tokens', body={ 'auth': { 'identity': { 'methods': ['password'], 'password': { 'user': { 'name': self.user['name'], 'password': self.user['password'], 'domain': { 'id': self.user['domain_id'] } } } }, 'scope': { 'project': { 'id': self.project['id'], } } } }) return r.headers.get('X-Subject-Token') def get_domain_scoped_token(self): """Convenience method for requesting domain scoped token.""" r = self.admin_request( method='POST', path='/v3/auth/tokens', body={ 'auth': { 'identity': { 'methods': ['password'], 'password': { 'user': { 'name': self.user['name'], 'password': self.user['password'], 'domain': { 'id': self.user['domain_id'] } } } }, 'scope': { 'domain': { 'id': self.domain['id'], } } } }) return r.headers.get('X-Subject-Token') def get_requested_token(self, auth): """Request the specific token we want.""" r = self.v3_authenticate_token(auth) return r.headers.get('X-Subject-Token') def v3_authenticate_token(self, auth, expected_status=201): return self.admin_request(method='POST', path='/v3/auth/tokens', body=auth, expected_status=expected_status) def v3_noauth_request(self, path, **kwargs): # request does not require auth token header path = '/v3' + path return self.admin_request(path=path, **kwargs) def v3_request(self, path, **kwargs): # check to see if caller requires token for the API call. if kwargs.pop('noauth', None): return self.v3_noauth_request(path, **kwargs) # Check if the caller has passed in auth details for # use in requesting the token auth_arg = kwargs.pop('auth', None) if auth_arg: token = self.get_requested_token(auth_arg) else: token = kwargs.pop('token', None) if not token: token = self.get_scoped_token() path = '/v3' + path return self.admin_request(path=path, token=token, **kwargs) def get(self, path, **kwargs): r = self.v3_request(method='GET', path=path, **kwargs) if 'expected_status' not in kwargs: self.assertResponseStatus(r, 200) return r def head(self, path, **kwargs): r = self.v3_request(method='HEAD', path=path, **kwargs) if 'expected_status' not in kwargs: self.assertResponseStatus(r, 204) self.assertEqual('', r.body) return r def post(self, path, **kwargs): r = self.v3_request(method='POST', path=path, **kwargs) if 'expected_status' not in kwargs: self.assertResponseStatus(r, 201) return r def put(self, path, **kwargs): r = self.v3_request(method='PUT', path=path, **kwargs) if 'expected_status' not in kwargs: self.assertResponseStatus(r, 204) return r def patch(self, path, **kwargs): r = self.v3_request(method='PATCH', path=path, **kwargs) if 'expected_status' not in kwargs: self.assertResponseStatus(r, 200) return r def delete(self, path, **kwargs): r = self.v3_request(method='DELETE', path=path, **kwargs) if 'expected_status' not in kwargs: self.assertResponseStatus(r, 204) return r def assertValidErrorResponse(self, r): resp = r.result self.assertIsNotNone(resp.get('error')) self.assertIsNotNone(resp['error'].get('code')) self.assertIsNotNone(resp['error'].get('title')) self.assertIsNotNone(resp['error'].get('message')) self.assertEqual(int(resp['error']['code']), r.status_code) def assertValidListLinks(self, links, resource_url=None): self.assertIsNotNone(links) self.assertIsNotNone(links.get('self')) self.assertThat(links['self'], matchers.StartsWith('http://localhost')) if resource_url: self.assertThat(links['self'], matchers.EndsWith(resource_url)) self.assertIn('next', links) if links['next'] is not None: self.assertThat(links['next'], matchers.StartsWith('http://localhost')) self.assertIn('previous', links) if links['previous'] is not None: self.assertThat(links['previous'], matchers.StartsWith('http://localhost')) def assertValidListResponse(self, resp, key, entity_validator, ref=None, expected_length=None, keys_to_check=None, resource_url=None): """Make assertions common to all API list responses. If a reference is provided, it's ID will be searched for in the response, and asserted to be equal. """ entities = resp.result.get(key) self.assertIsNotNone(entities) if expected_length is not None: self.assertEqual(expected_length, len(entities)) elif ref is not None: # we're at least expecting the ref self.assertNotEmpty(entities) # collections should have relational links self.assertValidListLinks(resp.result.get('links'), resource_url=resource_url) for entity in entities: self.assertIsNotNone(entity) self.assertValidEntity(entity, keys_to_check=keys_to_check) entity_validator(entity) if ref: entity = [x for x in entities if x['id'] == ref['id']][0] self.assertValidEntity(entity, ref=ref, keys_to_check=keys_to_check) entity_validator(entity, ref) return entities def assertValidResponse(self, resp, key, entity_validator, *args, **kwargs): """Make assertions common to all API responses.""" entity = resp.result.get(key) self.assertIsNotNone(entity) keys = kwargs.pop('keys_to_check', None) self.assertValidEntity(entity, keys_to_check=keys, *args, **kwargs) entity_validator(entity, *args, **kwargs) return entity def assertValidEntity(self, entity, ref=None, keys_to_check=None): """Make assertions common to all API entities. If a reference is provided, the entity will also be compared against the reference. """ if keys_to_check is not None: keys = keys_to_check else: keys = ['name', 'description', 'enabled'] for k in ['id'] + keys: msg = '%s unexpectedly None in %s' % (k, entity) self.assertIsNotNone(entity.get(k), msg) self.assertIsNotNone(entity.get('links')) self.assertIsNotNone(entity['links'].get('self')) self.assertThat(entity['links']['self'], matchers.StartsWith('http://localhost')) self.assertIn(entity['id'], entity['links']['self']) if ref: for k in keys: msg = '%s not equal: %s != %s' % (k, ref[k], entity[k]) self.assertEqual(ref[k], entity[k]) return entity # auth validation def assertValidISO8601ExtendedFormatDatetime(self, dt): try: return timeutils.parse_strtime(dt, fmt=TIME_FORMAT) except Exception: msg = '%s is not a valid ISO 8601 extended format date time.' % dt raise AssertionError(msg) self.assertIsInstance(dt, datetime.datetime) def assertValidTokenResponse(self, r, user=None): self.assertTrue(r.headers.get('X-Subject-Token')) token = r.result['token'] self.assertIsNotNone(token.get('expires_at')) expires_at = self.assertValidISO8601ExtendedFormatDatetime( token['expires_at']) self.assertIsNotNone(token.get('issued_at')) issued_at = self.assertValidISO8601ExtendedFormatDatetime( token['issued_at']) self.assertTrue(issued_at < expires_at) self.assertIn('user', token) self.assertIn('id', token['user']) self.assertIn('name', token['user']) self.assertIn('domain', token['user']) self.assertIn('id', token['user']['domain']) if user is not None: self.assertEqual(user['id'], token['user']['id']) self.assertEqual(user['name'], token['user']['name']) self.assertEqual(user['domain_id'], token['user']['domain']['id']) return token def assertValidUnscopedTokenResponse(self, r, *args, **kwargs): token = self.assertValidTokenResponse(r, *args, **kwargs) self.assertNotIn('roles', token) self.assertNotIn('catalog', token) self.assertNotIn('project', token) self.assertNotIn('domain', token) return token def assertValidScopedTokenResponse(self, r, *args, **kwargs): require_catalog = kwargs.pop('require_catalog', True) endpoint_filter = kwargs.pop('endpoint_filter', False) ep_filter_assoc = kwargs.pop('ep_filter_assoc', 0) token = self.assertValidTokenResponse(r, *args, **kwargs) if require_catalog: endpoint_num = 0 self.assertIn('catalog', token) if isinstance(token['catalog'], list): # only test JSON for service in token['catalog']: for endpoint in service['endpoints']: self.assertNotIn('enabled', endpoint) self.assertNotIn('legacy_endpoint_id', endpoint) self.assertNotIn('service_id', endpoint) endpoint_num += 1 # sub test for the OS-EP-FILTER extension enabled if endpoint_filter: self.assertEqual(ep_filter_assoc, endpoint_num) else: self.assertNotIn('catalog', token) self.assertIn('roles', token) self.assertTrue(token['roles']) for role in token['roles']: self.assertIn('id', role) self.assertIn('name', role) return token def assertValidProjectScopedTokenResponse(self, r, *args, **kwargs): token = self.assertValidScopedTokenResponse(r, *args, **kwargs) self.assertIn('project', token) self.assertIn('id', token['project']) self.assertIn('name', token['project']) self.assertIn('domain', token['project']) self.assertIn('id', token['project']['domain']) self.assertIn('name', token['project']['domain']) self.assertEqual(self.role_id, token['roles'][0]['id']) return token def assertValidProjectTrustScopedTokenResponse(self, r, *args, **kwargs): token = self.assertValidProjectScopedTokenResponse(r, *args, **kwargs) trust = token.get('OS-TRUST:trust') self.assertIsNotNone(trust) self.assertIsNotNone(trust.get('id')) self.assertIsInstance(trust.get('impersonation'), bool) self.assertIsNotNone(trust.get('trustor_user')) self.assertIsNotNone(trust.get('trustee_user')) self.assertIsNotNone(trust['trustor_user'].get('id')) self.assertIsNotNone(trust['trustee_user'].get('id')) def assertValidDomainScopedTokenResponse(self, r, *args, **kwargs): token = self.assertValidScopedTokenResponse(r, *args, **kwargs) self.assertIn('domain', token) self.assertIn('id', token['domain']) self.assertIn('name', token['domain']) return token def assertEqualTokens(self, a, b): """Assert that two tokens are equal. Compare two tokens except for their ids. This also truncates the time in the comparison. """ def normalize(token): del token['token']['expires_at'] del token['token']['issued_at'] return token a_expires_at = self.assertValidISO8601ExtendedFormatDatetime( a['token']['expires_at']) b_expires_at = self.assertValidISO8601ExtendedFormatDatetime( b['token']['expires_at']) self.assertCloseEnoughForGovernmentWork(a_expires_at, b_expires_at) a_issued_at = self.assertValidISO8601ExtendedFormatDatetime( a['token']['issued_at']) b_issued_at = self.assertValidISO8601ExtendedFormatDatetime( b['token']['issued_at']) self.assertCloseEnoughForGovernmentWork(a_issued_at, b_issued_at) return self.assertDictEqual(normalize(a), normalize(b)) # catalog validation def assertValidCatalogResponse(self, resp, *args, **kwargs): self.assertEqual(set(['catalog', 'links']), set(resp.json.keys())) self.assertValidCatalog(resp.json['catalog']) self.assertIn('links', resp.json) self.assertIsInstance(resp.json['links'], dict) self.assertEqual(['self'], list(resp.json['links'].keys())) self.assertEqual( 'http://localhost/v3/auth/catalog', resp.json['links']['self']) def assertValidCatalog(self, entity): self.assertIsInstance(entity, list) self.assertTrue(len(entity) > 0) for service in entity: self.assertIsNotNone(service.get('id')) self.assertIsNotNone(service.get('name')) self.assertIsNotNone(service.get('type')) self.assertNotIn('enabled', service) self.assertTrue(len(service['endpoints']) > 0) for endpoint in service['endpoints']: self.assertIsNotNone(endpoint.get('id')) self.assertIsNotNone(endpoint.get('interface')) self.assertIsNotNone(endpoint.get('url')) self.assertNotIn('enabled', endpoint) self.assertNotIn('legacy_endpoint_id', endpoint) self.assertNotIn('service_id', endpoint) # region validation def assertValidRegionListResponse(self, resp, *args, **kwargs): # NOTE(jaypipes): I have to pass in a blank keys_to_check parameter # below otherwise the base assertValidEntity method # tries to find a "name" and an "enabled" key in the # returned ref dicts. The issue is, I don't understand # how the service and endpoint entity assertions below # actually work (they don't raise assertions), since # AFAICT, the service and endpoint tables don't have # a "name" column either... :( return self.assertValidListResponse( resp, 'regions', self.assertValidRegion, keys_to_check=[], *args, **kwargs) def assertValidRegionResponse(self, resp, *args, **kwargs): return self.assertValidResponse( resp, 'region', self.assertValidRegion, keys_to_check=[], *args, **kwargs) def assertValidRegion(self, entity, ref=None): self.assertIsNotNone(entity.get('description')) if ref: self.assertEqual(ref['description'], entity['description']) return entity # service validation def assertValidServiceListResponse(self, resp, *args, **kwargs): return self.assertValidListResponse( resp, 'services', self.assertValidService, *args, **kwargs) def assertValidServiceResponse(self, resp, *args, **kwargs): return self.assertValidResponse( resp, 'service', self.assertValidService, *args, **kwargs) def assertValidService(self, entity, ref=None): self.assertIsNotNone(entity.get('type')) self.assertIsInstance(entity.get('enabled'), bool) if ref: self.assertEqual(ref['type'], entity['type']) return entity # endpoint validation def assertValidEndpointListResponse(self, resp, *args, **kwargs): return self.assertValidListResponse( resp, 'endpoints', self.assertValidEndpoint, *args, **kwargs) def assertValidEndpointResponse(self, resp, *args, **kwargs): return self.assertValidResponse( resp, 'endpoint', self.assertValidEndpoint, *args, **kwargs) def assertValidEndpoint(self, entity, ref=None): self.assertIsNotNone(entity.get('interface')) self.assertIsNotNone(entity.get('service_id')) self.assertIsInstance(entity['enabled'], bool) # this is intended to be an unexposed implementation detail self.assertNotIn('legacy_endpoint_id', entity) if ref: self.assertEqual(ref['interface'], entity['interface']) self.assertEqual(ref['service_id'], entity['service_id']) if ref.get('region') is not None: self.assertEqual(ref['region_id'], entity.get('region_id')) return entity # domain validation def assertValidDomainListResponse(self, resp, *args, **kwargs): return self.assertValidListResponse( resp, 'domains', self.assertValidDomain, *args, **kwargs) def assertValidDomainResponse(self, resp, *args, **kwargs): return self.assertValidResponse( resp, 'domain', self.assertValidDomain, *args, **kwargs) def assertValidDomain(self, entity, ref=None): if ref: pass return entity # project validation def assertValidProjectListResponse(self, resp, *args, **kwargs): return self.assertValidListResponse( resp, 'projects', self.assertValidProject, *args, **kwargs) def assertValidProjectResponse(self, resp, *args, **kwargs): return self.assertValidResponse( resp, 'project', self.assertValidProject, *args, **kwargs) def assertValidProject(self, entity, ref=None): self.assertIsNotNone(entity.get('domain_id')) if ref: self.assertEqual(ref['domain_id'], entity['domain_id']) return entity # user validation def assertValidUserListResponse(self, resp, *args, **kwargs): return self.assertValidListResponse( resp, 'users', self.assertValidUser, *args, **kwargs) def assertValidUserResponse(self, resp, *args, **kwargs): return self.assertValidResponse( resp, 'user', self.assertValidUser, *args, **kwargs) def assertValidUser(self, entity, ref=None): self.assertIsNotNone(entity.get('domain_id')) self.assertIsNotNone(entity.get('email')) self.assertIsNone(entity.get('password')) self.assertNotIn('tenantId', entity) if ref: self.assertEqual(ref['domain_id'], entity['domain_id']) self.assertEqual(ref['email'], entity['email']) if 'default_project_id' in ref: self.assertIsNotNone(ref['default_project_id']) self.assertEqual(ref['default_project_id'], entity['default_project_id']) return entity # group validation def assertValidGroupListResponse(self, resp, *args, **kwargs): return self.assertValidListResponse( resp, 'groups', self.assertValidGroup, *args, **kwargs) def assertValidGroupResponse(self, resp, *args, **kwargs): return self.assertValidResponse( resp, 'group', self.assertValidGroup, *args, **kwargs) def assertValidGroup(self, entity, ref=None): self.assertIsNotNone(entity.get('name')) if ref: self.assertEqual(ref['name'], entity['name']) return entity # credential validation def assertValidCredentialListResponse(self, resp, *args, **kwargs): return self.assertValidListResponse( resp, 'credentials', self.assertValidCredential, keys_to_check=['blob', 'user_id', 'type'], *args, **kwargs) def assertValidCredentialResponse(self, resp, *args, **kwargs): return self.assertValidResponse( resp, 'credential', self.assertValidCredential, keys_to_check=['blob', 'user_id', 'type'], *args, **kwargs) def assertValidCredential(self, entity, ref=None): self.assertIsNotNone(entity.get('user_id')) self.assertIsNotNone(entity.get('blob')) self.assertIsNotNone(entity.get('type')) if ref: self.assertEqual(ref['user_id'], entity['user_id']) self.assertEqual(ref['blob'], entity['blob']) self.assertEqual(ref['type'], entity['type']) self.assertEqual(ref.get('project_id'), entity.get('project_id')) return entity # role validation def assertValidRoleListResponse(self, resp, *args, **kwargs): return self.assertValidListResponse( resp, 'roles', self.assertValidRole, keys_to_check=['name'], *args, **kwargs) def assertValidRoleResponse(self, resp, *args, **kwargs): return self.assertValidResponse( resp, 'role', self.assertValidRole, keys_to_check=['name'], *args, **kwargs) def assertValidRole(self, entity, ref=None): self.assertIsNotNone(entity.get('name')) if ref: self.assertEqual(ref['name'], entity['name']) return entity # role assignment validation def assertValidRoleAssignmentListResponse(self, resp, expected_length=None, resource_url=None): entities = resp.result.get('role_assignments') if expected_length: self.assertEqual(expected_length, len(entities)) # Collections should have relational links self.assertValidListLinks(resp.result.get('links'), resource_url=resource_url) for entity in entities: self.assertIsNotNone(entity) self.assertValidRoleAssignment(entity) return entities def assertValidRoleAssignment(self, entity, ref=None): # A role should be present self.assertIsNotNone(entity.get('role')) self.assertIsNotNone(entity['role'].get('id')) # Only one of user or group should be present if entity.get('user'): self.assertIsNone(entity.get('group')) self.assertIsNotNone(entity['user'].get('id')) else: self.assertIsNotNone(entity.get('group')) self.assertIsNotNone(entity['group'].get('id')) # A scope should be present and have only one of domain or project self.assertIsNotNone(entity.get('scope')) if entity['scope'].get('project'): self.assertIsNone(entity['scope'].get('domain')) self.assertIsNotNone(entity['scope']['project'].get('id')) else: self.assertIsNotNone(entity['scope'].get('domain')) self.assertIsNotNone(entity['scope']['domain'].get('id')) # An assignment link should be present self.assertIsNotNone(entity.get('links')) self.assertIsNotNone(entity['links'].get('assignment')) if ref: links = ref.pop('links') try: self.assertDictContainsSubset(ref, entity) self.assertIn(links['assignment'], entity['links']['assignment']) finally: if links: ref['links'] = links def assertRoleAssignmentInListResponse(self, resp, ref, expected=1): found_count = 0 for entity in resp.result.get('role_assignments'): try: self.assertValidRoleAssignment(entity, ref=ref) except Exception: # It doesn't match, so let's go onto the next one pass else: found_count += 1 self.assertEqual(expected, found_count) def assertRoleAssignmentNotInListResponse(self, resp, ref): self.assertRoleAssignmentInListResponse(resp, ref=ref, expected=0) # policy validation def assertValidPolicyListResponse(self, resp, *args, **kwargs): return self.assertValidListResponse( resp, 'policies', self.assertValidPolicy, *args, **kwargs) def assertValidPolicyResponse(self, resp, *args, **kwargs): return self.assertValidResponse( resp, 'policy', self.assertValidPolicy, *args, **kwargs) def assertValidPolicy(self, entity, ref=None): self.assertIsNotNone(entity.get('blob')) self.assertIsNotNone(entity.get('type')) if ref: self.assertEqual(ref['blob'], entity['blob']) self.assertEqual(ref['type'], entity['type']) return entity # trust validation def assertValidTrustListResponse(self, resp, *args, **kwargs): return self.assertValidListResponse( resp, 'trusts', self.assertValidTrustSummary, keys_to_check=['trustor_user_id', 'trustee_user_id', 'impersonation'], *args, **kwargs) def assertValidTrustResponse(self, resp, *args, **kwargs): return self.assertValidResponse( resp, 'trust', self.assertValidTrust, keys_to_check=['trustor_user_id', 'trustee_user_id', 'impersonation'], *args, **kwargs) def assertValidTrustSummary(self, entity, ref=None): return self.assertValidTrust(entity, ref, summary=True) def assertValidTrust(self, entity, ref=None, summary=False): self.assertIsNotNone(entity.get('trustor_user_id')) self.assertIsNotNone(entity.get('trustee_user_id')) self.assertIsNotNone(entity.get('impersonation')) self.assertIn('expires_at', entity) if entity['expires_at'] is not None: self.assertValidISO8601ExtendedFormatDatetime(entity['expires_at']) if summary: # Trust list contains no roles, but getting a specific # trust by ID provides the detailed response containing roles self.assertNotIn('roles', entity) self.assertIn('project_id', entity) else: for role in entity['roles']: self.assertIsNotNone(role) self.assertValidEntity(role, keys_to_check=['name']) self.assertValidRole(role) self.assertValidListLinks(entity.get('roles_links')) # always disallow role xor project_id (neither or both is allowed) has_roles = bool(entity.get('roles')) has_project = bool(entity.get('project_id')) self.assertFalse(has_roles ^ has_project) if ref: self.assertEqual(ref['trustor_user_id'], entity['trustor_user_id']) self.assertEqual(ref['trustee_user_id'], entity['trustee_user_id']) self.assertEqual(ref['project_id'], entity['project_id']) if entity.get('expires_at') or ref.get('expires_at'): entity_exp = self.assertValidISO8601ExtendedFormatDatetime( entity['expires_at']) ref_exp = self.assertValidISO8601ExtendedFormatDatetime( ref['expires_at']) self.assertCloseEnoughForGovernmentWork(entity_exp, ref_exp) else: self.assertEqual(ref.get('expires_at'), entity.get('expires_at')) return entity def build_external_auth_request(self, remote_user, remote_domain=None, auth_data=None, kerberos=False): context = {'environment': {'REMOTE_USER': remote_user, 'AUTH_TYPE': 'Negotiate'}} if remote_domain: context['environment']['REMOTE_DOMAIN'] = remote_domain if not auth_data: auth_data = self.build_authentication_request( kerberos=kerberos)['auth'] no_context = None auth_info = auth.controllers.AuthInfo.create(no_context, auth_data) auth_context = {'extras': {}, 'method_names': []} return context, auth_info, auth_context class VersionTestCase(RestfulTestCase): def test_get_version(self): pass # NOTE(gyee): test AuthContextMiddleware here instead of test_middleware.py # because we need the token class AuthContextMiddlewareTestCase(RestfulTestCase): def _mock_request_object(self, token_id): class fake_req(object): headers = {middleware.AUTH_TOKEN_HEADER: token_id} environ = {} return fake_req() def test_auth_context_build_by_middleware(self): # test to make sure AuthContextMiddleware successful build the auth # context from the incoming auth token admin_token = self.get_scoped_token() req = self._mock_request_object(admin_token) application = None middleware.AuthContextMiddleware(application).process_request(req) self.assertEqual( self.user['id'], req.environ.get(authorization.AUTH_CONTEXT_ENV)['user_id']) def test_auth_context_override(self): overridden_context = 'OVERRIDDEN_CONTEXT' # this token should not be used token = uuid.uuid4().hex req = self._mock_request_object(token) req.environ[authorization.AUTH_CONTEXT_ENV] = overridden_context application = None middleware.AuthContextMiddleware(application).process_request(req) # make sure overridden context take precedence self.assertEqual(overridden_context, req.environ.get(authorization.AUTH_CONTEXT_ENV)) def test_admin_token_auth_context(self): # test to make sure AuthContextMiddleware does not attempt to build # auth context if the incoming auth token is the special admin token req = self._mock_request_object(CONF.admin_token) application = None middleware.AuthContextMiddleware(application).process_request(req) self.assertDictEqual(req.environ.get(authorization.AUTH_CONTEXT_ENV), {}) def test_unscoped_token_auth_context(self): unscoped_token = self.get_unscoped_token() req = self._mock_request_object(unscoped_token) application = None middleware.AuthContextMiddleware(application).process_request(req) for key in ['project_id', 'domain_id', 'domain_name']: self.assertNotIn( key, req.environ.get(authorization.AUTH_CONTEXT_ENV)) def test_project_scoped_token_auth_context(self): project_scoped_token = self.get_scoped_token() req = self._mock_request_object(project_scoped_token) application = None middleware.AuthContextMiddleware(application).process_request(req) self.assertEqual( self.project['id'], req.environ.get(authorization.AUTH_CONTEXT_ENV)['project_id']) def test_domain_scoped_token_auth_context(self): # grant the domain role to user path = '/domains/%s/users/%s/roles/%s' % ( self.domain['id'], self.user['id'], self.role['id']) self.put(path=path) domain_scoped_token = self.get_domain_scoped_token() req = self._mock_request_object(domain_scoped_token) application = None middleware.AuthContextMiddleware(application).process_request(req) self.assertEqual( self.domain['id'], req.environ.get(authorization.AUTH_CONTEXT_ENV)['domain_id']) self.assertEqual( self.domain['name'], req.environ.get(authorization.AUTH_CONTEXT_ENV)['domain_name']) class JsonHomeTestMixin(object): """JSON Home test Mixin this class to provide a test for the JSON-Home response for an extension. The base class must set JSON_HOME_DATA to a dict of relationship URLs (rels) to the JSON-Home data for the relationship. The rels and associated data must be in the response. """ def test_get_json_home(self): resp = self.get('/', convert=False, headers={'Accept': 'application/json-home'}) self.assertThat(resp.headers['Content-Type'], matchers.Equals('application/json-home')) resp_data = jsonutils.loads(resp.body) # Check that the example relationships are present. for rel in self.JSON_HOME_DATA: self.assertThat(resp_data['resources'][rel], matchers.Equals(self.JSON_HOME_DATA[rel])) class AssignmentTestMixin(object): """To hold assignment helper functions.""" def build_role_assignment_query_url(self, effective=False, **filters): """Build and return a role assignment query url with provided params. Available filters are: domain_id, project_id, user_id, group_id, role_id and inherited_to_projects. """ query_params = '?effective' if effective else '' for k, v in filters.items(): query_params += '?' if not query_params else '&' if k == 'inherited_to_projects': query_params += 'scope.OS-INHERIT:inherited_to=projects' else: if k in ['domain_id', 'project_id']: query_params += 'scope.' elif k not in ['user_id', 'group_id', 'role_id']: raise ValueError( 'Invalid key \'%s\' in provided filters.' % k) query_params += '%s=%s' % (k.replace('_', '.'), v) return '/role_assignments%s' % query_params def build_role_assignment_link(self, **attribs): """Build and return a role assignment link with provided attributes. Provided attributes are expected to contain: domain_id or project_id, user_id or group_id, role_id and, optionally, inherited_to_projects. """ if attribs.get('domain_id'): link = '/domains/' + attribs['domain_id'] else: link = '/projects/' + attribs['project_id'] if attribs.get('user_id'): link += '/users/' + attribs['user_id'] else: link += '/groups/' + attribs['group_id'] link += '/roles/' + attribs['role_id'] if attribs.get('inherited_to_projects'): return '/OS-INHERIT%s/inherited_to_projects' % link return link def build_role_assignment_entity(self, link=None, **attribs): """Build and return a role assignment entity with provided attributes. Provided attributes are expected to contain: domain_id or project_id, user_id or group_id, role_id and, optionally, inherited_to_projects. """ entity = {'links': {'assignment': ( link or self.build_role_assignment_link(**attribs))}} if attribs.get('domain_id'): entity['scope'] = {'domain': {'id': attribs['domain_id']}} else: entity['scope'] = {'project': {'id': attribs['project_id']}} if attribs.get('user_id'): entity['user'] = {'id': attribs['user_id']} if attribs.get('group_id'): entity['links']['membership'] = ('/groups/%s/users/%s' % (attribs['group_id'], attribs['user_id'])) else: entity['group'] = {'id': attribs['group_id']} entity['role'] = {'id': attribs['role_id']} if attribs.get('inherited_to_projects'): entity['scope']['OS-INHERIT:inherited_to'] = 'projects' return entity<|fim▁end|>
<|file_name|>signup-form.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, NgZone } from '@angular/core' import { Router } from '@angular/router' import { FormBuilder, FormGroup, Validators } from '@angular/forms' import { name, forceMail, passwd } from '/lib/validate' import { RegisterUser } from '/both/models/user.model' import { Accounts } from 'meteor/accounts-base' import { MeteorObservable } from 'meteor-rxjs' import template from './signup-form.component.html' @Component({ selector: 'signup-form', template }) export class SignupFormComponent implements OnInit { signupForm : FormGroup captchaRes : boolean = false constructor( private zone : NgZone, private formBuilder : FormBuilder, private router : Router ) {} ngOnInit() { this.printSignup() } private printSignup() { this.signupForm = this.formBuilder.group({ email: ['', forceMail], confirmEmail : ['', forceMail], password: ['', passwd], confirmPassword : ['', passwd],<|fim▁hole|> private checkEmail() { if (this.signupForm.value.email == this.signupForm.value.confirmEmail) return true else { alert('Emails are not sames') return false } } private checkPassword() { if (this.signupForm.value.password == this.signupForm.value.password) return true else { alert('Passwords are not sames') return false } } private checkConfirm() { return this.checkPassword() && this.checkEmail() } signup():void { if (this.signupForm.valid && this.captchaRes && this.checkConfirm()) { MeteorObservable.call('registerUserFrom', this.signupForm.value) .subscribe((newNinja: RegisterUser) => { if (newNinja) { Accounts.createUser({ email: newNinja.email, password: newNinja.password, username: newNinja.username }, (err) => { if (err) { console.log('err signup router') } else { this.router.navigate(['/']) } }) } this.signupForm.reset() }, (err) => { alert(`You cannot been register cause ${err}`) }) } } handleResult(res : boolean) { this.captchaRes = res } }<|fim▁end|>
username: ['', name], }) }
<|file_name|>convert_ssh.go<|end_file_name|><|fim▁begin|>// +build dfssh package dockerfile2llb import ( "github.com/moby/buildkit/client/llb" "github.com/moby/buildkit/frontend/dockerfile/instructions" "github.com/pkg/errors" ) func dispatchSSH(m *instructions.Mount) (llb.RunOption, error) { if m.Source != "" { return nil, errors.Errorf("ssh does not support source") } opts := []llb.SSHOption{llb.SSHID(m.CacheID)}<|fim▁hole|> if m.Target != "" { // TODO(AkihiroSuda): support specifying permission bits opts = append(opts, llb.SSHSocketTarget(m.Target)) } if !m.Required { opts = append(opts, llb.SSHOptional) } return llb.AddSSHSocket(opts...), nil }<|fim▁end|>
<|file_name|>gettags.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ################################################## ## DEPENDENCIES import sys import os import os.path try: import builtins as builtin except ImportError: import __builtin__ as builtin from os.path import getmtime, exists import time import types from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple from Cheetah.Template import Template from Cheetah.DummyTransaction import * from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList from Cheetah.CacheRegion import CacheRegion import Cheetah.Filters as Filters import Cheetah.ErrorCatchers as ErrorCatchers ################################################## ## MODULE CONSTANTS VFFSL=valueFromFrameOrSearchList VFSL=valueFromSearchList VFN=valueForName currentTime=time.time __CHEETAH_version__ = '2.4.4' __CHEETAH_versionTuple__ = (2, 4, 4, 'development', 0) __CHEETAH_genTime__ = 1406885498.501688 __CHEETAH_genTimestamp__ = 'Fri Aug 1 18:31:38 2014' __CHEETAH_src__ = '/home/wslee2/models/5-wo/force1plus/openpli3.0/build-force1plus/tmp/work/mips32el-oe-linux/enigma2-plugin-extensions-openwebif-1+git5+3c0c4fbdb28d7153bf2140459b553b3d5cdd4149-r0/git/plugin/controllers/views/web/gettags.tmpl' __CHEETAH_srcLastModified__ = 'Fri Aug 1 18:30:05 2014' __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine' if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple: raise AssertionError( 'This template was compiled with Cheetah version' ' %s. Templates compiled before version %s must be recompiled.'%( __CHEETAH_version__, RequiredCheetahVersion)) ################################################## ## CLASSES class gettags(Template): ################################################## ## CHEETAH GENERATED METHODS def __init__(self, *args, **KWs): super(gettags, self).__init__(*args, **KWs) if not self._CHEETAH__instanceInitialized: cheetahKWArgs = {} allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split() for k,v in KWs.items(): if k in allowedKWs: cheetahKWArgs[k] = v self._initCheetahInstance(**cheetahKWArgs) def respond(self, trans=None): ## CHEETAH: main method generated for this template if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): trans = self.transaction # is None unless self.awake() was called if not trans: trans = DummyTransaction() _dummyTrans = True else: _dummyTrans = False write = trans.response().write SL = self._CHEETAH__searchList _filter = self._CHEETAH__currentFilter ######################################## ## START - generated method body _orig_filter_91099948 = _filter filterName = u'WebSafe' if self._CHEETAH__filters.has_key("WebSafe"): _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName] else: _filter = self._CHEETAH__currentFilter = \ self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter write(u'''<?xml version="1.0" encoding="UTF-8"?> <e2tags> ''') for tag in VFFSL(SL,"tags",True): # generated from line 4, col 2 write(u'''\t\t<e2tag>''')<|fim▁hole|> write(u'''</e2tag> ''') write(u'''</e2tags> ''') _filter = self._CHEETAH__currentFilter = _orig_filter_91099948 ######################################## ## END - generated method body return _dummyTrans and trans.response().getvalue() or "" ################################################## ## CHEETAH GENERATED ATTRIBUTES _CHEETAH__instanceInitialized = False _CHEETAH_version = __CHEETAH_version__ _CHEETAH_versionTuple = __CHEETAH_versionTuple__ _CHEETAH_genTime = __CHEETAH_genTime__ _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__ _CHEETAH_src = __CHEETAH_src__ _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__ _mainCheetahMethod_for_gettags= 'respond' ## END CLASS DEFINITION if not hasattr(gettags, '_initCheetahAttributes'): templateAPIClass = getattr(gettags, '_CHEETAH_templateClass', Template) templateAPIClass._addCheetahPlumbingCodeToClass(gettags) # CHEETAH was developed by Tavis Rudd and Mike Orr # with code, advice and input from many other volunteers. # For more information visit http://www.CheetahTemplate.org/ ################################################## ## if run from command line: if __name__ == '__main__': from Cheetah.TemplateCmdLineIface import CmdLineIface CmdLineIface(templateObj=gettags()).run()<|fim▁end|>
_v = VFFSL(SL,"tag",True) # u'$tag' on line 5, col 10 if _v is not None: write(_filter(_v, rawExpr=u'$tag')) # from line 5, col 10.
<|file_name|>CommentResult.java<|end_file_name|><|fim▁begin|>// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2016.10.09 at 10:10:23 AM CST // package com.elong.nb.model.elong; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import java.util.List; import com.alibaba.fastjson.annotation.JSONField; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for CommentResult complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="CommentResult"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Count" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;element name="Comments" type="{}ArrayOfCommentInfo" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CommentResult", propOrder = { "count", "comments" }) public class CommentResult { @JSONField(name = "Count") protected int count; @JSONField(name = "Comments") protected List<CommentInfo> comments; /** * Gets the value of the count property. * */ public int getCount() { return count; } /**<|fim▁hole|> * */ public void setCount(int value) { this.count = value; } /** * Gets the value of the comments property. * * @return * possible object is * {@link List<CommentInfo> } * */ public List<CommentInfo> getComments() { return comments; } /** * Sets the value of the comments property. * * @param value * allowed object is * {@link List<CommentInfo> } * */ public void setComments(List<CommentInfo> value) { this.comments = value; } }<|fim▁end|>
* Sets the value of the count property.
<|file_name|>CacheInterceptor.java<|end_file_name|><|fim▁begin|>/* * Copyright 2002-2011 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.interceptor; import java.io.Serializable; import java.lang.reflect.Method; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; /** * AOP Alliance MethodInterceptor for declarative cache * management using the common Spring caching infrastructure * ({@link org.springframework.cache.Cache}). * * <p>Derives from the {@link CacheAspectSupport} class which * contains the integration with Spring's underlying caching API.<|fim▁hole|> * * @author Costin Leau * @author Juergen Hoeller * @since 3.1 */ @SuppressWarnings("serial") public class CacheInterceptor extends CacheAspectSupport implements MethodInterceptor, Serializable { private static class ThrowableWrapper extends RuntimeException { private final Throwable original; ThrowableWrapper(Throwable original) { this.original = original; } } public Object invoke(final MethodInvocation invocation) throws Throwable { Method method = invocation.getMethod(); Invoker aopAllianceInvoker = new Invoker() { public Object invoke() { try { return invocation.proceed(); } catch (Throwable ex) { throw new ThrowableWrapper(ex); } } }; try { return execute(aopAllianceInvoker, invocation.getThis(), method, invocation.getArguments()); } catch (ThrowableWrapper th) { throw th.original; } } }<|fim▁end|>
* CacheInterceptor simply calls the relevant superclass methods * in the correct order. * * <p>CacheInterceptors are thread-safe.
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # feeluown documentation build configuration file, created by # sphinx-quickstart on Fri Oct 2 20:55:54 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys import os import shlex # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('../../src')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.viewcode', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = 'feeluown' copyright = '2015, cosven' author = 'cosven' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '1.0' # The full version, including alpha/beta/rc tags. release = '4.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = 'cn' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. #html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Language to be used for generating the HTML full-text search index. # Sphinx supports the following languages: # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' #html_search_language = 'en' # A dictionary with options for the search language support, empty by default. # Now only 'ja' uses this config value #html_search_options = {'type': 'default'} # The name of a javascript file (relative to the configuration directory) that # implements a search results scorer. If empty, the default will be used. #html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. htmlhelp_basename = 'feeluowndoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', # Latex figure (float) alignment #'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'feeluown.tex', 'feeluown Documentation', 'cosven', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'feeluown', 'feeluown Documentation', [author], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'feeluown', 'feeluown Documentation', author, 'feeluown', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu.<|fim▁hole|><|fim▁end|>
#texinfo_no_detailmenu = False
<|file_name|>weaktuple.py<|end_file_name|><|fim▁begin|>"""tuple sub-class which holds weak references to objects""" import weakref class WeakTuple( tuple ): """tuple sub-class holding weakrefs to items The weak reference tuple is intended to allow you to store references to a list of objects without needing to manage weak references directly. For the most part, the WeakTuple operates just like a tuple object, in that it allows for all of the standard tuple operations. The difference is that the WeakTuple class only stores weak references to its items. As a result, adding an object to the tuple does not necessarily mean that it will still be there later on during execution (if the referent has been garbage collected). Because WeakTuple's are static (their membership doesn't change), they will raise ReferenceError when a sub-item is missing rather than skipping missing items as does the WeakList. This can occur for basically _any_ use of the tuple.<|fim▁hole|> """ def __init__( self, sequence=() ): """Initialize the tuple The WeakTuple will store weak references to objects within the sequence. """ super( WeakTuple, self).__init__( map( self.wrap, sequence)) def valid( self ): """Explicit validity check for the tuple Checks whether all references can be resolved, basically just sees whether calling list(self) raises a ReferenceError """ try: list( self ) return 1 except weakref.ReferenceError: return 0 def wrap( self, item ): """Wrap an individual item in a weak-reference If the item is already a weak reference, we store a reference to the original item. We use approximately the same weak reference callback mechanism as the standard weakref.WeakKeyDictionary object. """ if isinstance( item, weakref.ReferenceType ): item = item() return weakref.ref( item ) def unwrap( self, item ): """Unwrap an individual item This is a fairly trivial operation at the moment, it merely calls the item with no arguments and returns the result. """ ref = item() if ref is None: raise weakref.ReferenceError( """%s instance no longer valid (item %s has been collected)"""%( self.__class__.__name__, item)) return ref def __iter__( self ): """Iterate over the tuple, yielding strong references""" index = 0 while index < len(self): yield self[index] index += 1 def __getitem__( self, index ): """Get the item at the given index""" return self.unwrap(super (WeakTuple,self).__getitem__( index )) def __getslice__( self, start, stop ): """Get the items in the range start to stop""" return map( self.unwrap, super (WeakTuple,self).__getslice__( start, stop) ) def __contains__( self, item ): """Return boolean indicating whether the item is in the tuple""" for node in self: if item is node: return 1 return 0 def count( self, item ): """Return integer count of instances of item in tuple""" count = 0 for node in self: if item is node: count += 1 return count def index( self, item ): """Return integer index of item in tuple""" count = 0 for node in self: if item is node: return count count += 1 return -1 def __add__(self, other): """Return a new path with other as tail""" return tuple(self) + other def __eq__( self, sequence ): """Compare the tuple to another (==)""" return list(self) == sequence def __ge__( self, sequence ): """Compare the tuple to another (>=)""" return list(self) >= sequence def __gt__( self, sequence ): """Compare the tuple to another (>)""" return list(self) > sequence def __le__( self, sequence ): """Compare the tuple to another (<=)""" return list(self) <= sequence def __lt__( self, sequence ): """Compare the tuple to another (<)""" return list(self) < sequence def __ne__( self, sequence ): """Compare the tuple to another (!=)""" return list(self) != sequence def __repr__( self ): """Return a code-like representation of the weak tuple""" return """%s( %s )"""%( self.__class__.__name__, super(WeakTuple,self).__repr__())<|fim▁end|>
<|file_name|>size_of.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use script::test::size_of; // Macro so that we can stringify type names // I'd really prefer the tests themselves to be run at plugin time, // however rustc::middle doesn't have access to the full type data macro_rules! sizeof_checker ( ($testname: ident, $t: ident, $known_size: expr) => ( #[test] fn $testname() { let new = size_of::$t(); let old = $known_size; if new < old { panic!("Your changes have decreased the stack size of commonly used DOM struct {} from {} to {}. \ Good work! Please update the size in tests/unit/script/size_of.rs.", stringify!($t), old, new) } else if new > old { panic!("Your changes have increased the stack size of commonly used DOM struct {} from {} to {}. \ These structs are present in large quantities in the DOM, and increasing the size \ may dramatically affect our memory footprint. Please consider choosing a design which \ avoids this increase. If you feel that the increase is necessary, \ update to the new size in tests/unit/script/size_of.rs.", stringify!($t), old, new) } }); ); // Update the sizes here sizeof_checker!(size_event_target, EventTarget, 56); sizeof_checker!(size_node, Node, 184); sizeof_checker!(size_element, Element, 392); sizeof_checker!(size_htmlelement, HTMLElement, 408); sizeof_checker!(size_div, HTMLDivElement, 408); sizeof_checker!(size_span, HTMLSpanElement, 408); sizeof_checker!(size_text, Text, 216);<|fim▁hole|><|fim▁end|>
sizeof_checker!(size_characterdata, CharacterData, 216);
<|file_name|>split.hpp<|end_file_name|><|fim▁begin|># /* ************************************************************************** # * * # * (C) Copyright Paul Mensonides 2002. # * Distributed under the Boost Software License, Version 1.0. (See # * accompanying file LICENSE_1_0.txt or copy at # * http://www.boost.org/LICENSE_1_0.txt) # * * # ************************************************************************** */ # # /* Revised by Edward Diener (2020) */ # # /* See http://www.boost.org for most recent version. */ # # ifndef BOOST_PREPROCESSOR_SEQ_DETAIL_SPLIT_HPP # define BOOST_PREPROCESSOR_SEQ_DETAIL_SPLIT_HPP # # include <boost/preprocessor/config/config.hpp> # # /* BOOST_PP_SEQ_SPLIT */ # # define BOOST_PP_SEQ_SPLIT(n, seq) BOOST_PP_SEQ_SPLIT_D(n, seq) # # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC() # define BOOST_PP_SEQ_SPLIT_D(n, seq) (BOOST_PP_SEQ_SPLIT_ ## n seq) # else # define BOOST_PP_SEQ_SPLIT_D(n, seq) (BOOST_PP_SEQ_SPLIT_ ## n ## seq) # endif # # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT() # # define BOOST_PP_SEQ_SPLIT_1(x) (x), # define BOOST_PP_SEQ_SPLIT_2(x) (x) BOOST_PP_SEQ_SPLIT_1 # define BOOST_PP_SEQ_SPLIT_3(x) (x) BOOST_PP_SEQ_SPLIT_2 # define BOOST_PP_SEQ_SPLIT_4(x) (x) BOOST_PP_SEQ_SPLIT_3 # define BOOST_PP_SEQ_SPLIT_5(x) (x) BOOST_PP_SEQ_SPLIT_4 # define BOOST_PP_SEQ_SPLIT_6(x) (x) BOOST_PP_SEQ_SPLIT_5 # define BOOST_PP_SEQ_SPLIT_7(x) (x) BOOST_PP_SEQ_SPLIT_6 # define BOOST_PP_SEQ_SPLIT_8(x) (x) BOOST_PP_SEQ_SPLIT_7 # define BOOST_PP_SEQ_SPLIT_9(x) (x) BOOST_PP_SEQ_SPLIT_8 # define BOOST_PP_SEQ_SPLIT_10(x) (x) BOOST_PP_SEQ_SPLIT_9 # define BOOST_PP_SEQ_SPLIT_11(x) (x) BOOST_PP_SEQ_SPLIT_10 # define BOOST_PP_SEQ_SPLIT_12(x) (x) BOOST_PP_SEQ_SPLIT_11 # define BOOST_PP_SEQ_SPLIT_13(x) (x) BOOST_PP_SEQ_SPLIT_12 # define BOOST_PP_SEQ_SPLIT_14(x) (x) BOOST_PP_SEQ_SPLIT_13 # define BOOST_PP_SEQ_SPLIT_15(x) (x) BOOST_PP_SEQ_SPLIT_14 # define BOOST_PP_SEQ_SPLIT_16(x) (x) BOOST_PP_SEQ_SPLIT_15 # define BOOST_PP_SEQ_SPLIT_17(x) (x) BOOST_PP_SEQ_SPLIT_16 # define BOOST_PP_SEQ_SPLIT_18(x) (x) BOOST_PP_SEQ_SPLIT_17 # define BOOST_PP_SEQ_SPLIT_19(x) (x) BOOST_PP_SEQ_SPLIT_18 # define BOOST_PP_SEQ_SPLIT_20(x) (x) BOOST_PP_SEQ_SPLIT_19 # define BOOST_PP_SEQ_SPLIT_21(x) (x) BOOST_PP_SEQ_SPLIT_20 # define BOOST_PP_SEQ_SPLIT_22(x) (x) BOOST_PP_SEQ_SPLIT_21 # define BOOST_PP_SEQ_SPLIT_23(x) (x) BOOST_PP_SEQ_SPLIT_22 # define BOOST_PP_SEQ_SPLIT_24(x) (x) BOOST_PP_SEQ_SPLIT_23 # define BOOST_PP_SEQ_SPLIT_25(x) (x) BOOST_PP_SEQ_SPLIT_24 # define BOOST_PP_SEQ_SPLIT_26(x) (x) BOOST_PP_SEQ_SPLIT_25 # define BOOST_PP_SEQ_SPLIT_27(x) (x) BOOST_PP_SEQ_SPLIT_26 # define BOOST_PP_SEQ_SPLIT_28(x) (x) BOOST_PP_SEQ_SPLIT_27 # define BOOST_PP_SEQ_SPLIT_29(x) (x) BOOST_PP_SEQ_SPLIT_28 # define BOOST_PP_SEQ_SPLIT_30(x) (x) BOOST_PP_SEQ_SPLIT_29 # define BOOST_PP_SEQ_SPLIT_31(x) (x) BOOST_PP_SEQ_SPLIT_30 # define BOOST_PP_SEQ_SPLIT_32(x) (x) BOOST_PP_SEQ_SPLIT_31 # define BOOST_PP_SEQ_SPLIT_33(x) (x) BOOST_PP_SEQ_SPLIT_32 # define BOOST_PP_SEQ_SPLIT_34(x) (x) BOOST_PP_SEQ_SPLIT_33 # define BOOST_PP_SEQ_SPLIT_35(x) (x) BOOST_PP_SEQ_SPLIT_34 # define BOOST_PP_SEQ_SPLIT_36(x) (x) BOOST_PP_SEQ_SPLIT_35 # define BOOST_PP_SEQ_SPLIT_37(x) (x) BOOST_PP_SEQ_SPLIT_36 # define BOOST_PP_SEQ_SPLIT_38(x) (x) BOOST_PP_SEQ_SPLIT_37 # define BOOST_PP_SEQ_SPLIT_39(x) (x) BOOST_PP_SEQ_SPLIT_38 # define BOOST_PP_SEQ_SPLIT_40(x) (x) BOOST_PP_SEQ_SPLIT_39 # define BOOST_PP_SEQ_SPLIT_41(x) (x) BOOST_PP_SEQ_SPLIT_40 # define BOOST_PP_SEQ_SPLIT_42(x) (x) BOOST_PP_SEQ_SPLIT_41 # define BOOST_PP_SEQ_SPLIT_43(x) (x) BOOST_PP_SEQ_SPLIT_42 # define BOOST_PP_SEQ_SPLIT_44(x) (x) BOOST_PP_SEQ_SPLIT_43 # define BOOST_PP_SEQ_SPLIT_45(x) (x) BOOST_PP_SEQ_SPLIT_44 # define BOOST_PP_SEQ_SPLIT_46(x) (x) BOOST_PP_SEQ_SPLIT_45 # define BOOST_PP_SEQ_SPLIT_47(x) (x) BOOST_PP_SEQ_SPLIT_46 # define BOOST_PP_SEQ_SPLIT_48(x) (x) BOOST_PP_SEQ_SPLIT_47 # define BOOST_PP_SEQ_SPLIT_49(x) (x) BOOST_PP_SEQ_SPLIT_48 # define BOOST_PP_SEQ_SPLIT_50(x) (x) BOOST_PP_SEQ_SPLIT_49 # define BOOST_PP_SEQ_SPLIT_51(x) (x) BOOST_PP_SEQ_SPLIT_50 # define BOOST_PP_SEQ_SPLIT_52(x) (x) BOOST_PP_SEQ_SPLIT_51 # define BOOST_PP_SEQ_SPLIT_53(x) (x) BOOST_PP_SEQ_SPLIT_52 # define BOOST_PP_SEQ_SPLIT_54(x) (x) BOOST_PP_SEQ_SPLIT_53 # define BOOST_PP_SEQ_SPLIT_55(x) (x) BOOST_PP_SEQ_SPLIT_54 # define BOOST_PP_SEQ_SPLIT_56(x) (x) BOOST_PP_SEQ_SPLIT_55 # define BOOST_PP_SEQ_SPLIT_57(x) (x) BOOST_PP_SEQ_SPLIT_56 # define BOOST_PP_SEQ_SPLIT_58(x) (x) BOOST_PP_SEQ_SPLIT_57 # define BOOST_PP_SEQ_SPLIT_59(x) (x) BOOST_PP_SEQ_SPLIT_58 # define BOOST_PP_SEQ_SPLIT_60(x) (x) BOOST_PP_SEQ_SPLIT_59 # define BOOST_PP_SEQ_SPLIT_61(x) (x) BOOST_PP_SEQ_SPLIT_60 # define BOOST_PP_SEQ_SPLIT_62(x) (x) BOOST_PP_SEQ_SPLIT_61 # define BOOST_PP_SEQ_SPLIT_63(x) (x) BOOST_PP_SEQ_SPLIT_62 # define BOOST_PP_SEQ_SPLIT_64(x) (x) BOOST_PP_SEQ_SPLIT_63 # define BOOST_PP_SEQ_SPLIT_65(x) (x) BOOST_PP_SEQ_SPLIT_64 # define BOOST_PP_SEQ_SPLIT_66(x) (x) BOOST_PP_SEQ_SPLIT_65 # define BOOST_PP_SEQ_SPLIT_67(x) (x) BOOST_PP_SEQ_SPLIT_66 # define BOOST_PP_SEQ_SPLIT_68(x) (x) BOOST_PP_SEQ_SPLIT_67 # define BOOST_PP_SEQ_SPLIT_69(x) (x) BOOST_PP_SEQ_SPLIT_68 # define BOOST_PP_SEQ_SPLIT_70(x) (x) BOOST_PP_SEQ_SPLIT_69<|fim▁hole|># define BOOST_PP_SEQ_SPLIT_72(x) (x) BOOST_PP_SEQ_SPLIT_71 # define BOOST_PP_SEQ_SPLIT_73(x) (x) BOOST_PP_SEQ_SPLIT_72 # define BOOST_PP_SEQ_SPLIT_74(x) (x) BOOST_PP_SEQ_SPLIT_73 # define BOOST_PP_SEQ_SPLIT_75(x) (x) BOOST_PP_SEQ_SPLIT_74 # define BOOST_PP_SEQ_SPLIT_76(x) (x) BOOST_PP_SEQ_SPLIT_75 # define BOOST_PP_SEQ_SPLIT_77(x) (x) BOOST_PP_SEQ_SPLIT_76 # define BOOST_PP_SEQ_SPLIT_78(x) (x) BOOST_PP_SEQ_SPLIT_77 # define BOOST_PP_SEQ_SPLIT_79(x) (x) BOOST_PP_SEQ_SPLIT_78 # define BOOST_PP_SEQ_SPLIT_80(x) (x) BOOST_PP_SEQ_SPLIT_79 # define BOOST_PP_SEQ_SPLIT_81(x) (x) BOOST_PP_SEQ_SPLIT_80 # define BOOST_PP_SEQ_SPLIT_82(x) (x) BOOST_PP_SEQ_SPLIT_81 # define BOOST_PP_SEQ_SPLIT_83(x) (x) BOOST_PP_SEQ_SPLIT_82 # define BOOST_PP_SEQ_SPLIT_84(x) (x) BOOST_PP_SEQ_SPLIT_83 # define BOOST_PP_SEQ_SPLIT_85(x) (x) BOOST_PP_SEQ_SPLIT_84 # define BOOST_PP_SEQ_SPLIT_86(x) (x) BOOST_PP_SEQ_SPLIT_85 # define BOOST_PP_SEQ_SPLIT_87(x) (x) BOOST_PP_SEQ_SPLIT_86 # define BOOST_PP_SEQ_SPLIT_88(x) (x) BOOST_PP_SEQ_SPLIT_87 # define BOOST_PP_SEQ_SPLIT_89(x) (x) BOOST_PP_SEQ_SPLIT_88 # define BOOST_PP_SEQ_SPLIT_90(x) (x) BOOST_PP_SEQ_SPLIT_89 # define BOOST_PP_SEQ_SPLIT_91(x) (x) BOOST_PP_SEQ_SPLIT_90 # define BOOST_PP_SEQ_SPLIT_92(x) (x) BOOST_PP_SEQ_SPLIT_91 # define BOOST_PP_SEQ_SPLIT_93(x) (x) BOOST_PP_SEQ_SPLIT_92 # define BOOST_PP_SEQ_SPLIT_94(x) (x) BOOST_PP_SEQ_SPLIT_93 # define BOOST_PP_SEQ_SPLIT_95(x) (x) BOOST_PP_SEQ_SPLIT_94 # define BOOST_PP_SEQ_SPLIT_96(x) (x) BOOST_PP_SEQ_SPLIT_95 # define BOOST_PP_SEQ_SPLIT_97(x) (x) BOOST_PP_SEQ_SPLIT_96 # define BOOST_PP_SEQ_SPLIT_98(x) (x) BOOST_PP_SEQ_SPLIT_97 # define BOOST_PP_SEQ_SPLIT_99(x) (x) BOOST_PP_SEQ_SPLIT_98 # define BOOST_PP_SEQ_SPLIT_100(x) (x) BOOST_PP_SEQ_SPLIT_99 # define BOOST_PP_SEQ_SPLIT_101(x) (x) BOOST_PP_SEQ_SPLIT_100 # define BOOST_PP_SEQ_SPLIT_102(x) (x) BOOST_PP_SEQ_SPLIT_101 # define BOOST_PP_SEQ_SPLIT_103(x) (x) BOOST_PP_SEQ_SPLIT_102 # define BOOST_PP_SEQ_SPLIT_104(x) (x) BOOST_PP_SEQ_SPLIT_103 # define BOOST_PP_SEQ_SPLIT_105(x) (x) BOOST_PP_SEQ_SPLIT_104 # define BOOST_PP_SEQ_SPLIT_106(x) (x) BOOST_PP_SEQ_SPLIT_105 # define BOOST_PP_SEQ_SPLIT_107(x) (x) BOOST_PP_SEQ_SPLIT_106 # define BOOST_PP_SEQ_SPLIT_108(x) (x) BOOST_PP_SEQ_SPLIT_107 # define BOOST_PP_SEQ_SPLIT_109(x) (x) BOOST_PP_SEQ_SPLIT_108 # define BOOST_PP_SEQ_SPLIT_110(x) (x) BOOST_PP_SEQ_SPLIT_109 # define BOOST_PP_SEQ_SPLIT_111(x) (x) BOOST_PP_SEQ_SPLIT_110 # define BOOST_PP_SEQ_SPLIT_112(x) (x) BOOST_PP_SEQ_SPLIT_111 # define BOOST_PP_SEQ_SPLIT_113(x) (x) BOOST_PP_SEQ_SPLIT_112 # define BOOST_PP_SEQ_SPLIT_114(x) (x) BOOST_PP_SEQ_SPLIT_113 # define BOOST_PP_SEQ_SPLIT_115(x) (x) BOOST_PP_SEQ_SPLIT_114 # define BOOST_PP_SEQ_SPLIT_116(x) (x) BOOST_PP_SEQ_SPLIT_115 # define BOOST_PP_SEQ_SPLIT_117(x) (x) BOOST_PP_SEQ_SPLIT_116 # define BOOST_PP_SEQ_SPLIT_118(x) (x) BOOST_PP_SEQ_SPLIT_117 # define BOOST_PP_SEQ_SPLIT_119(x) (x) BOOST_PP_SEQ_SPLIT_118 # define BOOST_PP_SEQ_SPLIT_120(x) (x) BOOST_PP_SEQ_SPLIT_119 # define BOOST_PP_SEQ_SPLIT_121(x) (x) BOOST_PP_SEQ_SPLIT_120 # define BOOST_PP_SEQ_SPLIT_122(x) (x) BOOST_PP_SEQ_SPLIT_121 # define BOOST_PP_SEQ_SPLIT_123(x) (x) BOOST_PP_SEQ_SPLIT_122 # define BOOST_PP_SEQ_SPLIT_124(x) (x) BOOST_PP_SEQ_SPLIT_123 # define BOOST_PP_SEQ_SPLIT_125(x) (x) BOOST_PP_SEQ_SPLIT_124 # define BOOST_PP_SEQ_SPLIT_126(x) (x) BOOST_PP_SEQ_SPLIT_125 # define BOOST_PP_SEQ_SPLIT_127(x) (x) BOOST_PP_SEQ_SPLIT_126 # define BOOST_PP_SEQ_SPLIT_128(x) (x) BOOST_PP_SEQ_SPLIT_127 # define BOOST_PP_SEQ_SPLIT_129(x) (x) BOOST_PP_SEQ_SPLIT_128 # define BOOST_PP_SEQ_SPLIT_130(x) (x) BOOST_PP_SEQ_SPLIT_129 # define BOOST_PP_SEQ_SPLIT_131(x) (x) BOOST_PP_SEQ_SPLIT_130 # define BOOST_PP_SEQ_SPLIT_132(x) (x) BOOST_PP_SEQ_SPLIT_131 # define BOOST_PP_SEQ_SPLIT_133(x) (x) BOOST_PP_SEQ_SPLIT_132 # define BOOST_PP_SEQ_SPLIT_134(x) (x) BOOST_PP_SEQ_SPLIT_133 # define BOOST_PP_SEQ_SPLIT_135(x) (x) BOOST_PP_SEQ_SPLIT_134 # define BOOST_PP_SEQ_SPLIT_136(x) (x) BOOST_PP_SEQ_SPLIT_135 # define BOOST_PP_SEQ_SPLIT_137(x) (x) BOOST_PP_SEQ_SPLIT_136 # define BOOST_PP_SEQ_SPLIT_138(x) (x) BOOST_PP_SEQ_SPLIT_137 # define BOOST_PP_SEQ_SPLIT_139(x) (x) BOOST_PP_SEQ_SPLIT_138 # define BOOST_PP_SEQ_SPLIT_140(x) (x) BOOST_PP_SEQ_SPLIT_139 # define BOOST_PP_SEQ_SPLIT_141(x) (x) BOOST_PP_SEQ_SPLIT_140 # define BOOST_PP_SEQ_SPLIT_142(x) (x) BOOST_PP_SEQ_SPLIT_141 # define BOOST_PP_SEQ_SPLIT_143(x) (x) BOOST_PP_SEQ_SPLIT_142 # define BOOST_PP_SEQ_SPLIT_144(x) (x) BOOST_PP_SEQ_SPLIT_143 # define BOOST_PP_SEQ_SPLIT_145(x) (x) BOOST_PP_SEQ_SPLIT_144 # define BOOST_PP_SEQ_SPLIT_146(x) (x) BOOST_PP_SEQ_SPLIT_145 # define BOOST_PP_SEQ_SPLIT_147(x) (x) BOOST_PP_SEQ_SPLIT_146 # define BOOST_PP_SEQ_SPLIT_148(x) (x) BOOST_PP_SEQ_SPLIT_147 # define BOOST_PP_SEQ_SPLIT_149(x) (x) BOOST_PP_SEQ_SPLIT_148 # define BOOST_PP_SEQ_SPLIT_150(x) (x) BOOST_PP_SEQ_SPLIT_149 # define BOOST_PP_SEQ_SPLIT_151(x) (x) BOOST_PP_SEQ_SPLIT_150 # define BOOST_PP_SEQ_SPLIT_152(x) (x) BOOST_PP_SEQ_SPLIT_151 # define BOOST_PP_SEQ_SPLIT_153(x) (x) BOOST_PP_SEQ_SPLIT_152 # define BOOST_PP_SEQ_SPLIT_154(x) (x) BOOST_PP_SEQ_SPLIT_153 # define BOOST_PP_SEQ_SPLIT_155(x) (x) BOOST_PP_SEQ_SPLIT_154 # define BOOST_PP_SEQ_SPLIT_156(x) (x) BOOST_PP_SEQ_SPLIT_155 # define BOOST_PP_SEQ_SPLIT_157(x) (x) BOOST_PP_SEQ_SPLIT_156 # define BOOST_PP_SEQ_SPLIT_158(x) (x) BOOST_PP_SEQ_SPLIT_157 # define BOOST_PP_SEQ_SPLIT_159(x) (x) BOOST_PP_SEQ_SPLIT_158 # define BOOST_PP_SEQ_SPLIT_160(x) (x) BOOST_PP_SEQ_SPLIT_159 # define BOOST_PP_SEQ_SPLIT_161(x) (x) BOOST_PP_SEQ_SPLIT_160 # define BOOST_PP_SEQ_SPLIT_162(x) (x) BOOST_PP_SEQ_SPLIT_161 # define BOOST_PP_SEQ_SPLIT_163(x) (x) BOOST_PP_SEQ_SPLIT_162 # define BOOST_PP_SEQ_SPLIT_164(x) (x) BOOST_PP_SEQ_SPLIT_163 # define BOOST_PP_SEQ_SPLIT_165(x) (x) BOOST_PP_SEQ_SPLIT_164 # define BOOST_PP_SEQ_SPLIT_166(x) (x) BOOST_PP_SEQ_SPLIT_165 # define BOOST_PP_SEQ_SPLIT_167(x) (x) BOOST_PP_SEQ_SPLIT_166 # define BOOST_PP_SEQ_SPLIT_168(x) (x) BOOST_PP_SEQ_SPLIT_167 # define BOOST_PP_SEQ_SPLIT_169(x) (x) BOOST_PP_SEQ_SPLIT_168 # define BOOST_PP_SEQ_SPLIT_170(x) (x) BOOST_PP_SEQ_SPLIT_169 # define BOOST_PP_SEQ_SPLIT_171(x) (x) BOOST_PP_SEQ_SPLIT_170 # define BOOST_PP_SEQ_SPLIT_172(x) (x) BOOST_PP_SEQ_SPLIT_171 # define BOOST_PP_SEQ_SPLIT_173(x) (x) BOOST_PP_SEQ_SPLIT_172 # define BOOST_PP_SEQ_SPLIT_174(x) (x) BOOST_PP_SEQ_SPLIT_173 # define BOOST_PP_SEQ_SPLIT_175(x) (x) BOOST_PP_SEQ_SPLIT_174 # define BOOST_PP_SEQ_SPLIT_176(x) (x) BOOST_PP_SEQ_SPLIT_175 # define BOOST_PP_SEQ_SPLIT_177(x) (x) BOOST_PP_SEQ_SPLIT_176 # define BOOST_PP_SEQ_SPLIT_178(x) (x) BOOST_PP_SEQ_SPLIT_177 # define BOOST_PP_SEQ_SPLIT_179(x) (x) BOOST_PP_SEQ_SPLIT_178 # define BOOST_PP_SEQ_SPLIT_180(x) (x) BOOST_PP_SEQ_SPLIT_179 # define BOOST_PP_SEQ_SPLIT_181(x) (x) BOOST_PP_SEQ_SPLIT_180 # define BOOST_PP_SEQ_SPLIT_182(x) (x) BOOST_PP_SEQ_SPLIT_181 # define BOOST_PP_SEQ_SPLIT_183(x) (x) BOOST_PP_SEQ_SPLIT_182 # define BOOST_PP_SEQ_SPLIT_184(x) (x) BOOST_PP_SEQ_SPLIT_183 # define BOOST_PP_SEQ_SPLIT_185(x) (x) BOOST_PP_SEQ_SPLIT_184 # define BOOST_PP_SEQ_SPLIT_186(x) (x) BOOST_PP_SEQ_SPLIT_185 # define BOOST_PP_SEQ_SPLIT_187(x) (x) BOOST_PP_SEQ_SPLIT_186 # define BOOST_PP_SEQ_SPLIT_188(x) (x) BOOST_PP_SEQ_SPLIT_187 # define BOOST_PP_SEQ_SPLIT_189(x) (x) BOOST_PP_SEQ_SPLIT_188 # define BOOST_PP_SEQ_SPLIT_190(x) (x) BOOST_PP_SEQ_SPLIT_189 # define BOOST_PP_SEQ_SPLIT_191(x) (x) BOOST_PP_SEQ_SPLIT_190 # define BOOST_PP_SEQ_SPLIT_192(x) (x) BOOST_PP_SEQ_SPLIT_191 # define BOOST_PP_SEQ_SPLIT_193(x) (x) BOOST_PP_SEQ_SPLIT_192 # define BOOST_PP_SEQ_SPLIT_194(x) (x) BOOST_PP_SEQ_SPLIT_193 # define BOOST_PP_SEQ_SPLIT_195(x) (x) BOOST_PP_SEQ_SPLIT_194 # define BOOST_PP_SEQ_SPLIT_196(x) (x) BOOST_PP_SEQ_SPLIT_195 # define BOOST_PP_SEQ_SPLIT_197(x) (x) BOOST_PP_SEQ_SPLIT_196 # define BOOST_PP_SEQ_SPLIT_198(x) (x) BOOST_PP_SEQ_SPLIT_197 # define BOOST_PP_SEQ_SPLIT_199(x) (x) BOOST_PP_SEQ_SPLIT_198 # define BOOST_PP_SEQ_SPLIT_200(x) (x) BOOST_PP_SEQ_SPLIT_199 # define BOOST_PP_SEQ_SPLIT_201(x) (x) BOOST_PP_SEQ_SPLIT_200 # define BOOST_PP_SEQ_SPLIT_202(x) (x) BOOST_PP_SEQ_SPLIT_201 # define BOOST_PP_SEQ_SPLIT_203(x) (x) BOOST_PP_SEQ_SPLIT_202 # define BOOST_PP_SEQ_SPLIT_204(x) (x) BOOST_PP_SEQ_SPLIT_203 # define BOOST_PP_SEQ_SPLIT_205(x) (x) BOOST_PP_SEQ_SPLIT_204 # define BOOST_PP_SEQ_SPLIT_206(x) (x) BOOST_PP_SEQ_SPLIT_205 # define BOOST_PP_SEQ_SPLIT_207(x) (x) BOOST_PP_SEQ_SPLIT_206 # define BOOST_PP_SEQ_SPLIT_208(x) (x) BOOST_PP_SEQ_SPLIT_207 # define BOOST_PP_SEQ_SPLIT_209(x) (x) BOOST_PP_SEQ_SPLIT_208 # define BOOST_PP_SEQ_SPLIT_210(x) (x) BOOST_PP_SEQ_SPLIT_209 # define BOOST_PP_SEQ_SPLIT_211(x) (x) BOOST_PP_SEQ_SPLIT_210 # define BOOST_PP_SEQ_SPLIT_212(x) (x) BOOST_PP_SEQ_SPLIT_211 # define BOOST_PP_SEQ_SPLIT_213(x) (x) BOOST_PP_SEQ_SPLIT_212 # define BOOST_PP_SEQ_SPLIT_214(x) (x) BOOST_PP_SEQ_SPLIT_213 # define BOOST_PP_SEQ_SPLIT_215(x) (x) BOOST_PP_SEQ_SPLIT_214 # define BOOST_PP_SEQ_SPLIT_216(x) (x) BOOST_PP_SEQ_SPLIT_215 # define BOOST_PP_SEQ_SPLIT_217(x) (x) BOOST_PP_SEQ_SPLIT_216 # define BOOST_PP_SEQ_SPLIT_218(x) (x) BOOST_PP_SEQ_SPLIT_217 # define BOOST_PP_SEQ_SPLIT_219(x) (x) BOOST_PP_SEQ_SPLIT_218 # define BOOST_PP_SEQ_SPLIT_220(x) (x) BOOST_PP_SEQ_SPLIT_219 # define BOOST_PP_SEQ_SPLIT_221(x) (x) BOOST_PP_SEQ_SPLIT_220 # define BOOST_PP_SEQ_SPLIT_222(x) (x) BOOST_PP_SEQ_SPLIT_221 # define BOOST_PP_SEQ_SPLIT_223(x) (x) BOOST_PP_SEQ_SPLIT_222 # define BOOST_PP_SEQ_SPLIT_224(x) (x) BOOST_PP_SEQ_SPLIT_223 # define BOOST_PP_SEQ_SPLIT_225(x) (x) BOOST_PP_SEQ_SPLIT_224 # define BOOST_PP_SEQ_SPLIT_226(x) (x) BOOST_PP_SEQ_SPLIT_225 # define BOOST_PP_SEQ_SPLIT_227(x) (x) BOOST_PP_SEQ_SPLIT_226 # define BOOST_PP_SEQ_SPLIT_228(x) (x) BOOST_PP_SEQ_SPLIT_227 # define BOOST_PP_SEQ_SPLIT_229(x) (x) BOOST_PP_SEQ_SPLIT_228 # define BOOST_PP_SEQ_SPLIT_230(x) (x) BOOST_PP_SEQ_SPLIT_229 # define BOOST_PP_SEQ_SPLIT_231(x) (x) BOOST_PP_SEQ_SPLIT_230 # define BOOST_PP_SEQ_SPLIT_232(x) (x) BOOST_PP_SEQ_SPLIT_231 # define BOOST_PP_SEQ_SPLIT_233(x) (x) BOOST_PP_SEQ_SPLIT_232 # define BOOST_PP_SEQ_SPLIT_234(x) (x) BOOST_PP_SEQ_SPLIT_233 # define BOOST_PP_SEQ_SPLIT_235(x) (x) BOOST_PP_SEQ_SPLIT_234 # define BOOST_PP_SEQ_SPLIT_236(x) (x) BOOST_PP_SEQ_SPLIT_235 # define BOOST_PP_SEQ_SPLIT_237(x) (x) BOOST_PP_SEQ_SPLIT_236 # define BOOST_PP_SEQ_SPLIT_238(x) (x) BOOST_PP_SEQ_SPLIT_237 # define BOOST_PP_SEQ_SPLIT_239(x) (x) BOOST_PP_SEQ_SPLIT_238 # define BOOST_PP_SEQ_SPLIT_240(x) (x) BOOST_PP_SEQ_SPLIT_239 # define BOOST_PP_SEQ_SPLIT_241(x) (x) BOOST_PP_SEQ_SPLIT_240 # define BOOST_PP_SEQ_SPLIT_242(x) (x) BOOST_PP_SEQ_SPLIT_241 # define BOOST_PP_SEQ_SPLIT_243(x) (x) BOOST_PP_SEQ_SPLIT_242 # define BOOST_PP_SEQ_SPLIT_244(x) (x) BOOST_PP_SEQ_SPLIT_243 # define BOOST_PP_SEQ_SPLIT_245(x) (x) BOOST_PP_SEQ_SPLIT_244 # define BOOST_PP_SEQ_SPLIT_246(x) (x) BOOST_PP_SEQ_SPLIT_245 # define BOOST_PP_SEQ_SPLIT_247(x) (x) BOOST_PP_SEQ_SPLIT_246 # define BOOST_PP_SEQ_SPLIT_248(x) (x) BOOST_PP_SEQ_SPLIT_247 # define BOOST_PP_SEQ_SPLIT_249(x) (x) BOOST_PP_SEQ_SPLIT_248 # define BOOST_PP_SEQ_SPLIT_250(x) (x) BOOST_PP_SEQ_SPLIT_249 # define BOOST_PP_SEQ_SPLIT_251(x) (x) BOOST_PP_SEQ_SPLIT_250 # define BOOST_PP_SEQ_SPLIT_252(x) (x) BOOST_PP_SEQ_SPLIT_251 # define BOOST_PP_SEQ_SPLIT_253(x) (x) BOOST_PP_SEQ_SPLIT_252 # define BOOST_PP_SEQ_SPLIT_254(x) (x) BOOST_PP_SEQ_SPLIT_253 # define BOOST_PP_SEQ_SPLIT_255(x) (x) BOOST_PP_SEQ_SPLIT_254 # define BOOST_PP_SEQ_SPLIT_256(x) (x) BOOST_PP_SEQ_SPLIT_255 # # else # # include <boost/preprocessor/config/limits.hpp> # # if BOOST_PP_LIMIT_SEQ == 256 # include <boost/preprocessor/seq/detail/limits/split_256.hpp> # elif BOOST_PP_LIMIT_SEQ == 512 # include <boost/preprocessor/seq/detail/limits/split_256.hpp> # include <boost/preprocessor/seq/detail/limits/split_512.hpp> # elif BOOST_PP_LIMIT_SEQ == 1024 # include <boost/preprocessor/seq/detail/limits/split_256.hpp> # include <boost/preprocessor/seq/detail/limits/split_512.hpp> # include <boost/preprocessor/seq/detail/limits/split_1024.hpp> # else # error Incorrect value for the BOOST_PP_LIMIT_SEQ limit # endif # # endif # # endif<|fim▁end|>
# define BOOST_PP_SEQ_SPLIT_71(x) (x) BOOST_PP_SEQ_SPLIT_70
<|file_name|>JvR.py<|end_file_name|><|fim▁begin|># Chess Analyses by Jan van Reek # http://www.endgame.nl/index.html JvR_links = ( ("http://www.endgame.nl/match.htm", "http://www.endgame.nl/MATCHPGN.ZIP"), ("http://www.endgame.nl/bad1870.htm", "http://www.endgame.nl/bad1870.pgn"), ("http://www.endgame.nl/wfairs.htm", "http://www.endgame.nl/wfairs.pgn"), ("http://www.endgame.nl/russia.html", "http://www.endgame.nl/Russia.pgn"), ("http://www.endgame.nl/wien.htm", "http://www.endgame.nl/wien.pgn"), ("http://www.endgame.nl/london1883.htm", "http://www.endgame.nl/london.pgn"), ("http://www.endgame.nl/neur1896.htm", "http://www.endgame.nl/neur1896.pgn"), ("http://www.endgame.nl/newyork.htm", "http://www.endgame.nl/newy.pgn"), ("http://www.endgame.nl/seaside.htm", "http://www.endgame.nl/seaside.pgn"), ("http://www.endgame.nl/CSpr1904.htm", "http://www.endgame.nl/cs1904.pgn"), ("http://www.endgame.nl/stpeter.htm", "http://www.endgame.nl/stp1909.pgn"), ("http://www.endgame.nl/stpeter.htm", "http://www.endgame.nl/stp1914.pgn"), ("http://www.endgame.nl/berlin1928.htm", "http://www.endgame.nl/berlin.pgn"), ("http://www.endgame.nl/bad.htm", "http://www.endgame.nl/bad.pgn"),<|fim▁hole|> ("http://www.endgame.nl/mostrau.htm", "http://www.endgame.nl/mostrau.pgn"), ("http://www.endgame.nl/early.htm", "http://www.endgame.nl/early.pgn"), ("http://www.endgame.nl/bled1931.htm", "http://www.endgame.nl/Alekhine.pgn"), ("http://www.endgame.nl/nott1936.htm", "http://www.endgame.nl/nott1936.pgn"), ("http://www.endgame.nl/wbm.htm", "http://www.endgame.nl/wbm.pgn"), ("http://www.endgame.nl/AVRO1938.htm", "http://www.endgame.nl/avro1938.pgn"), ("http://www.endgame.nl/salz1942.htm", "http://www.endgame.nl/salz1942.pgn"), ("http://www.endgame.nl/itct.html", "http://www.endgame.nl/itct.pgn"), ("http://www.endgame.nl/zurich1953.htm", "http://www.endgame.nl/zurich.pgn"), ("http://www.endgame.nl/spassky.htm", "http://www.endgame.nl/SPASSKY.ZIP"), ("http://www.endgame.nl/dallas1957.htm", "http://www.endgame.nl/dallas57.pgn"), ("http://www.endgame.nl/capamem.htm", "http://www.endgame.nl/capamem.pgn"), ("http://www.endgame.nl/kortschnoj.htm", "http://www.endgame.nl/korchnoi.pgn"), ("http://www.endgame.nl/planinc.htm", "http://www.endgame.nl/Planinc.pgn"), ("http://www.endgame.nl/planinc.htm", "http://www.endgame.nl/memorial.pgn"), ("http://www.endgame.nl/Piatigorsky.htm", "http://www.endgame.nl/piatigorsky.pgn"), ("http://www.endgame.nl/ussr7079.htm", "http://www.endgame.nl/ussr6591.pgn"), ("http://www.endgame.nl/tilburg.htm", "http://www.endgame.nl/tilburg.pgn"), ("http://www.endgame.nl/dglory.htm", "http://www.endgame.nl/dglory.pgn"), ("http://www.endgame.nl/bugojno.htm", "http://www.endgame.nl/Bugojno.pgn"), ("http://www.endgame.nl/montreal.htm", "http://www.endgame.nl/mon1979.pgn"), ("http://www.endgame.nl/moscow88.htm", "http://www.endgame.nl/ussr88.pgn"), ("http://www.endgame.nl/skelleftea.htm", "http://www.endgame.nl/skel1989.pgn"), ("http://www.endgame.nl/vsb.htm", "http://www.endgame.nl/vsb.pgn"), ("http://www.endgame.nl/dortmund.htm", "http://www.endgame.nl/dortmund.pgn"), ("http://www.endgame.nl/Barca.html", "http://www.endgame.nl/Barca.pgn"), ("http://www.endgame.nl/Madrid.html", "http://www.endgame.nl/Madrid.pgn"), ("http://www.endgame.nl/costa_del_sol.html", "http://www.endgame.nl/Costa.pgn"), ("http://www.endgame.nl/Palma.html", "http://www.endgame.nl/Palma.pgn"), ("http://www.endgame.nl/olot.html", "http://www.endgame.nl/Olot.pgn"), ("http://www.endgame.nl/LasPalmas.html", "http://www.endgame.nl/lpalm96.pgn"), ("http://www.endgame.nl/DosH.htm", "http://www.endgame.nl/DosH.pgn"), ("http://www.endgame.nl/wijk.htm", "http://www.endgame.nl/corus.pgn"), ("http://www.endgame.nl/tal.html", "http://www.endgame.nl/Tal.pgn"), ("http://www.endgame.nl/cc.htm", "http://www.endgame.nl/cc.pgn"), ("http://www.endgame.nl/sofia.htm", "http://www.endgame.nl/sofia.pgn"), ("http://www.endgame.nl/linares.htm", "http://www.endgame.nl/linares.pgn"), ("http://www.endgame.nl/Bilbao.html", "http://www.endgame.nl/Bilbao.pgn"), ("http://www.endgame.nl/nanjing.html", "http://www.endgame.nl/Nanjing.pgn"), ("http://www.endgame.nl/dchamps.htm", "http://www.endgame.nl/dch.pgn"), ("http://www.endgame.nl/dsb.htm", "http://www.endgame.nl/dsb.pgn"), ("http://www.endgame.nl/cc-history.htm", "http://www.endgame.nl/cc-history.pgn"), ("http://www.endgame.nl/hastings.htm", "http://www.endgame.nl/hastings.pgn"), ("http://www.endgame.nl/ibm.htm", "http://www.endgame.nl/IBM.pgn"), ("http://www.endgame.nl/gambits.htm", "http://www.endgame.nl/gambit.pgn"), ("http://www.endgame.nl/trebitsch.htm", "http://www.endgame.nl/Trebitsch.pgn"), ("http://www.endgame.nl/cloister.htm", "http://www.endgame.nl/TerApel.pgn"), ("http://www.endgame.nl/Biel.html", "http://www.endgame.nl/Biel.pgn"), ("http://www.endgame.nl/USA.html", "http://www.endgame.nl/USA.pgn"), ("http://www.endgame.nl/uk.html", "http://www.endgame.nl/UK.pgn"), ("http://www.endgame.nl/olympiads.html", "http://www.endgame.nl/olympiads.pgn"), ("http://www.endgame.nl/lone_pine.html", "http://www.endgame.nl/lonepine.pgn"), ("http://www.endgame.nl/staunton.html", "http://www.endgame.nl/Staunton.pgn"), ("http://www.endgame.nl/Hoogeveen.html", "http://www.endgame.nl/crown.pgn"), ("http://www.endgame.nl/paoli.html", "http://www.endgame.nl/Paoli.pgn"), ("http://www.endgame.nl/endgame.htm", "http://www.endgame.nl/endgame.pgn"), ("http://www.endgame.nl/estrin.html", "http://www.endgame.nl/Estrin.pgn"), ("http://www.endgame.nl/Argentina.html", "http://www.endgame.nl/Argentina.pgn"), ("http://www.endgame.nl/comeback.html", "http://www.endgame.nl/comeback.pgn"), ("http://www.endgame.nl/strategy.htm", "http://www.endgame.nl/strategy.pgn"), ("http://www.endgame.nl/computer.html", "http://www.endgame.nl/computer.pgn"), ("http://www.endgame.nl/correspondence.html", "http://www.endgame.nl/gambitnimzo.pgn"), ("http://web.inter.nl.net/hcc/rekius/buckle.htm", "http://web.inter.nl.net/hcc/rekius/buckle.pgn"), ("http://web.inter.nl.net/hcc/rekius/euwe.htm", "http://web.inter.nl.net/hcc/rekius/euwem.pgn"), ) JvR = [] for item in JvR_links: JvR.append((item[0], "https://raw.githubusercontent.com/gbtami/JvR-archive/master/%s" % item[1][7:]))<|fim▁end|>
("http://www.endgame.nl/nimzowitsch.htm", "http://www.endgame.nl/nimzowitsch.pgn"),
<|file_name|>normal_gamma.py<|end_file_name|><|fim▁begin|>""" Normal-Gamma density.""" import numpy as np from scipy.special import gammaln, psi class NormalGamma(object): """Normal-Gamma density. <|fim▁hole|> Attributes ---------- mu : numpy.ndarray Mean of the Gaussian density. kappa : float Factor of the precision matrix. alpha : float Shape parameter of the Gamma density. beta : numpy.ndarray Rate parameters of the Gamma density. Methods ------- expLogPrecision() Expected value of the logarithm of the precision. expPrecision() Expected value of the precision. KL(self, pdf) KL divergence between the current and the given densities. newPosterior(self, stats) Create a new Normal-Gamma density. """ def __init__(self, mu, kappa, alpha, beta): self.mu = mu self.kappa = kappa self.alpha = alpha self.beta = beta def expLogPrecision(self): '''Expected value of the logarithm of the precision. Returns ------- E_log_prec : numpy.ndarray Log precision. ''' return psi(self.alpha) - np.log(self.beta) def expPrecision(self): """Expected value of the precision. Returns ------- E_prec : numpy.ndarray Precision. """ return self.alpha/self.beta def KL(self, q): """KL divergence between the current and the given densities. Returns ------- KL : float KL divergence. """ p = self exp_lambda = p.expPrecision() exp_log_lambda = p.expLogPrecision() return (.5 * (np.log(p.kappa) - np.log(q.kappa)) - .5 * (1 - q.kappa * (1./p.kappa + exp_lambda * (p.mu - q.mu)**2)) - (gammaln(p.alpha) - gammaln(q.alpha)) + (p.alpha * np.log(p.beta) - q.alpha * np.log(q.beta)) + exp_log_lambda * (p.alpha - q.alpha) - exp_lambda * (p.beta - q.beta)).sum() def newPosterior(self, stats): """Create a new Normal-Gamma density. Create a new Normal-Gamma density given the parameters of the current model and the statistics provided. Parameters ---------- stats : :class:MultivariateGaussianDiagCovStats Accumulated sufficient statistics for the update. Returns ------- post : :class:NormalGamma New Dirichlet density. """ # stats[0]: counts # stats[1]: sum(x) # stats[2]: sum(x**2) kappa_n = self.kappa + stats[0] mu_n = (self.kappa * self.mu + stats[1]) / kappa_n alpha_n = self.alpha + .5 * stats[0] v = (self.kappa * self.mu + stats[1])**2 v /= (self.kappa + stats[0]) beta_n = self.beta + 0.5*(-v + stats[2] + self.kappa * self.mu**2) return NormalGamma(mu_n, kappa_n, alpha_n, beta_n)<|fim▁end|>
<|file_name|>during.rs<|end_file_name|><|fim▁begin|>use crate::{cmd, Command}; use ql2::term::TermType; <|fim▁hole|> impl Arg for Command { fn arg(self) -> cmd::Arg<()> { Self::new(TermType::During).with_arg(self).into_arg() } }<|fim▁end|>
pub trait Arg { fn arg(self) -> cmd::Arg<()>; }
<|file_name|>arroyo_2010.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2014-2022 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # OpenQuake 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 Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with OpenQuake. If not, see <http://www.gnu.org/licenses/>. """ Module exports :class:'ArroyoEtAl2010SInter' """ import numpy as np from scipy.constants import g from scipy.special import exp1 from openquake.hazardlib.gsim.base import GMPE, CoeffsTable from openquake.hazardlib import const from openquake.hazardlib.imt import PGA, SA def _compute_mean(C, g, ctx): """ Compute mean according to equation 8a, page 773. """ mag = ctx.mag dis = ctx.rrup # computing r02 parameter and the average distance to the fault surface ro2 = 1.4447e-5 * np.exp(2.3026 * mag) avg = np.sqrt(dis ** 2 + ro2) # computing fourth term of Eq. 8a, page 773. trm4 = (exp1(C['c4'] * dis) - exp1(C['c4'] * avg)) / ro2 # computing the mean mean = C['c1'] + C['c2'] * mag + C['c3'] * np.log(trm4)<|fim▁hole|> mean = np.log(np.exp(mean) * 1e-2 / g) return mean def _get_stddevs(C): """ Return standard deviations as defined in table 2, page 776. """ stds = np.array([C['s_t'], C['s_e'], C['s_r']]) return stds class ArroyoEtAl2010SInter(GMPE): """ Implements GMPE developed by Arroyo et al. (2010) for Mexican subduction interface events and published as: Arroyo D., García D., Ordaz M., Mora M. A., and Singh S. K. (2010) "Strong ground-motion relations for Mexican interplate earhquakes", J. Seismol., 14:769-785. The original formulation predict peak ground acceleration (PGA), in cm/s**2, and 5% damped pseudo-acceleration response spectra (PSA) in cm/s**2 for the geometric average of the maximum component of the two horizontal component of ground motion. The GMPE predicted values for Mexican interplate events at rock sites (NEHRP B site condition) in the forearc region. """ #: Supported tectonic region type is subduction interface, #: given that the equations have been derived using Mexican interface #: events. DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.SUBDUCTION_INTERFACE #: Supported intensity measure types are spectral acceleration, #: and peak ground acceleration. See Table 2 in page 776. DEFINED_FOR_INTENSITY_MEASURE_TYPES = {PGA, SA} #: Supported intensity measure component is the geometric average of # the maximum of the two horizontal components. DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.GEOMETRIC_MEAN #: Supported standard deviation types are inter-event, intra-event #: and total. See Table 2, page 776. DEFINED_FOR_STANDARD_DEVIATION_TYPES = { const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT} #: No site parameters required REQUIRES_SITES_PARAMETERS = {'vs30'} #: Required rupture parameter is the magnitude REQUIRES_RUPTURE_PARAMETERS = {'mag'} #: Required distance measure is Rrup (closest distance to fault surface) REQUIRES_DISTANCES = {'rrup'} def compute(self, ctx: np.recarray, imts, mean, sig, tau, phi): """ See :meth:`superclass method <.base.GroundShakingIntensityModel.compute>` for spec of input and result values. """ for m, imt in enumerate(imts): C = self.COEFFS[imt] mean[m] = _compute_mean(C, g, ctx) sig[m], tau[m], phi[m] = _get_stddevs(C) #: Equation coefficients for geometric average of the maximum of the two #: horizontal components, as described in Table 2 on page 776. COEFFS = CoeffsTable(sa_damping=5, table="""\ IMT c1 c2 c3 c4 g_e bias s_t s_e s_r 0.040 3.8123 0.8636 0.5578 0.0150 0.3962 -0.0254 0.8228 0.5179 0.6394 0.045 4.0440 0.8489 0.5645 0.0150 0.3874 -0.0285 0.8429 0.5246 0.6597 0.050 4.1429 0.8580 0.5725 0.0150 0.3731 -0.0181 0.8512 0.5199 0.6740 0.055 4.3092 0.8424 0.5765 0.0150 0.3746 0.0004 0.8583 0.5253 0.6788 0.060 4.3770 0.8458 0.5798 0.0150 0.4192 -0.0120 0.8591 0.5563 0.6547 0.065 4.5185 0.8273 0.5796 0.0150 0.3888 -0.0226 0.8452 0.5270 0.6607 0.070 4.4591 0.8394 0.5762 0.0150 0.3872 -0.0346 0.8423 0.5241 0.6594 0.075 4.5939 0.8313 0.5804 0.0150 0.3775 -0.0241 0.8473 0.5205 0.6685 0.080 4.4832 0.8541 0.5792 0.0150 0.3737 -0.0241 0.8421 0.5148 0.6664 0.085 4.5062 0.8481 0.5771 0.0150 0.3757 -0.0138 0.8344 0.5115 0.6593 0.090 4.4648 0.8536 0.5742 0.0150 0.4031 -0.0248 0.8304 0.5273 0.6415 0.095 4.3940 0.8580 0.5712 0.0150 0.4097 0.0040 0.8294 0.5309 0.6373 0.100 4.3391 0.8620 0.5666 0.0150 0.3841 -0.0045 0.8254 0.5116 0.6477 0.120 4.0505 0.8933 0.5546 0.0150 0.3589 -0.0202 0.7960 0.4768 0.6374 0.140 3.5599 0.9379 0.5350 0.0150 0.3528 -0.0293 0.7828 0.4650 0.6298 0.160 3.1311 0.9736 0.5175 0.0150 0.3324 -0.0246 0.7845 0.4523 0.6409 0.180 2.7012 1.0030 0.4985 0.0150 0.3291 -0.0196 0.7717 0.4427 0.6321 0.200 2.5485 0.9988 0.4850 0.0150 0.3439 -0.0250 0.7551 0.4428 0.6116 0.220 2.2699 1.0125 0.4710 0.0150 0.3240 -0.0205 0.7431 0.4229 0.6109 0.240 1.9130 1.0450 0.4591 0.0150 0.3285 -0.0246 0.7369 0.4223 0.6039 0.260 1.7181 1.0418 0.4450 0.0150 0.3595 -0.0220 0.7264 0.4356 0.5814 0.280 1.4039 1.0782 0.4391 0.0150 0.3381 -0.0260 0.7209 0.4191 0.5865 0.300 1.1080 1.1038 0.4287 0.0150 0.3537 -0.0368 0.7198 0.4281 0.5787 0.320 1.0652 1.0868 0.4208 0.0150 0.3702 -0.0345 0.7206 0.4384 0.5719 0.340 0.8319 1.1088 0.4142 0.0150 0.3423 -0.0381 0.7264 0.4250 0.5891 0.360 0.4965 1.1408 0.4044 0.0150 0.3591 -0.0383 0.7255 0.4348 0.5808 0.380 0.3173 1.1388 0.3930 0.0150 0.3673 -0.0264 0.7292 0.4419 0.5800 0.400 0.2735 1.1533 0.4067 0.0134 0.3956 -0.0317 0.7272 0.4574 0.5653 0.450 0.0990 1.1662 0.4127 0.0117 0.3466 -0.0267 0.7216 0.4249 0.5833 0.500 -0.0379 1.2206 0.4523 0.0084 0.3519 -0.0338 0.7189 0.4265 0.5788 0.550 -0.3512 1.2445 0.4493 0.0076 0.3529 -0.0298 0.7095 0.4215 0.5707 0.600 -0.6897 1.2522 0.4421 0.0067 0.3691 -0.0127 0.7084 0.4304 0.5627 0.650 -0.6673 1.2995 0.4785 0.0051 0.3361 -0.0192 0.7065 0.4096 0.5756 0.700 -0.7154 1.3263 0.5068 0.0034 0.3200 -0.0243 0.7070 0.3999 0.5830 0.750 -0.7015 1.2994 0.5056 0.0029 0.3364 -0.0122 0.7092 0.4113 0.5778 0.800 -0.8581 1.3205 0.5103 0.0023 0.3164 -0.0337 0.6974 0.3923 0.5766 0.850 -0.9712 1.3375 0.5201 0.0018 0.3435 -0.0244 0.6906 0.4047 0.5596 0.900 -1.0970 1.3532 0.5278 0.0012 0.3306 -0.0275 0.6923 0.3980 0.5665 0.950 -1.2346 1.3687 0.5345 0.0007 0.3264 -0.0306 0.6863 0.3921 0.5632 1.000 -1.2600 1.3652 0.5426 0.0001 0.3194 -0.0183 0.6798 0.3842 0.5608 1.100 -1.7687 1.4146 0.5342 0.0001 0.3336 -0.0229 0.6701 0.3871 0.5471 1.200 -2.1339 1.4417 0.5263 0.0001 0.3445 -0.0232 0.6697 0.3931 0.5422 1.300 -2.4122 1.4577 0.5201 0.0001 0.3355 -0.0231 0.6801 0.3939 0.5544 1.400 -2.5442 1.4618 0.5242 0.0001 0.3759 -0.0039 0.6763 0.4146 0.5343 1.500 -2.8509 1.4920 0.5220 0.0001 0.3780 -0.0122 0.6765 0.4159 0.5335 1.600 -3.0887 1.5157 0.5215 0.0001 0.3937 -0.0204 0.6674 0.4187 0.5197 1.700 -3.4884 1.5750 0.5261 0.0001 0.4130 -0.0208 0.6480 0.4164 0.4965 1.800 -3.7195 1.5966 0.5255 0.0001 0.3967 -0.0196 0.6327 0.3985 0.4914 1.900 -4.0141 1.6162 0.5187 0.0001 0.4248 -0.0107 0.6231 0.4062 0.4726 2.000 -4.1908 1.6314 0.5199 0.0001 0.3967 -0.0133 0.6078 0.3828 0.4721 2.500 -5.1104 1.7269 0.5277 0.0001 0.4302 -0.0192 0.6001 0.3936 0.4530 3.000 -5.5926 1.7515 0.5298 0.0001 0.4735 -0.0319 0.6029 0.4148 0.4375 3.500 -6.1202 1.8077 0.5402 0.0001 0.4848 -0.0277 0.6137 0.4273 0.4405 4.000 -6.5318 1.8353 0.5394 0.0001 0.5020 -0.0368 0.6201 0.4393 0.4376 4.500 -6.9744 1.8685 0.5328 0.0001 0.5085 -0.0539 0.6419 0.4577 0.4500 5.000 -7.1389 1.8721 0.5376 0.0001 0.5592 -0.0534 0.6701 0.5011 0.4449 pga 2.4862 0.9392 0.5061 0.0150 0.3850 -0.0181 0.7500 0.4654 0.5882 """)<|fim▁end|>
# convert from cm/s**2 to 'g'
<|file_name|>Callout.Props.ts<|end_file_name|><|fim▁begin|>import * as React from 'react'; import { Callout } from './Callout'; import { CalloutContent } from './CalloutContent'; import { DirectionalHint } from '../../common/DirectionalHint'; import { IPoint, IRectangle } from '../../Utilities'; export interface ICallout { } export interface ICalloutProps extends React.Props<Callout | CalloutContent> { /** * Optional callback to access the ICallout interface. Use this instead of ref for accessing * the public methods and properties of the component. */ componentRef?: (component: ICallout) => void; /** * The target that the Callout should try to position itself based on. * It can be either an HTMLElement a querySelector string of a valid HTMLElement * or a MouseEvent. If MouseEvent is given then the origin point of the event will be used. */ target?: HTMLElement | string | MouseEvent; /** * How the element should be positioned * @default DirectionalHint.BottomAutoEdge */ directionalHint?: DirectionalHint; /** * The gap between the Callout and the target * @default 0 */ gapSpace?: number; /** * The width of the beak. * @default 16 */ beakWidth?: number; /** * The background color of the Callout in hex format ie. #ffffff. * @default $ms-color-white */ backgroundColor?: string; /** * The bounding rectangle for which the contextual menu can appear in. */ bounds?: IRectangle; /** * The minimum distance the callout will be away from the edge of the screen. * @default 8 */ minPagePadding?: number; /** * If true use a point rather than rectangle to position the Callout. * For example it can be used to position based on a click. */ useTargetPoint?: boolean; /** * Point used to position the Callout */ targetPoint?: IPoint; /** * If true then the beak is visible. If false it will not be shown. * @default false */ isBeakVisible?: boolean; /** * If true then the onClose will not not dismiss on scroll * @default false */ preventDismissOnScroll?: boolean; /** * If true the position returned will have the menu element cover the target. * If false then it will position next to the target; * @default false */ coverTarget?: boolean; /** * Aria role assigned to the callout (Eg. dialog, alertdialog). */ role?: string; /** * Defines the element id referencing the element containing label text for callout. */ ariaLabelledBy?: string; /** * Defines the element id referencing the element containing the description for the callout.<|fim▁hole|> /** * CSS class to apply to the callout. * @default null */ className?: string; /** * Optional callback when the layer content has mounted. */ onLayerMounted?: () => void; /** * Optional callback that is called once the callout has been correctly positioned. */ onPositioned?: () => void; /** * Callback when the Callout tries to close. */ onDismiss?: (ev?: any) => void; /** * If true do not render on a new layer. If false render on a new layer. */ doNotLayer?: boolean; /** * If true the position will not change sides in an attempt to fit the callout within bounds. * It will still attempt to align it to whatever bounds are given. * @default false */ directionalHintFixed?: boolean; /** * If true then the callout will attempt to focus the first focusable element that it contains. * If it doesn't find an element, no focus will be set and the method will return false. * This means that it's the contents responsibility to either set focus or have * focusable items. * @returns True if focus was set, false if it was not. */ setInitialFocus?: boolean; /** * Deprecated at v0.59.1, to be removed at >= v1.0.0. Pass in a beakWidth to dictate size. * @deprecated */ beakStyle?: string; /** * Deprecated at v0.72.1 and will no longer exist after 1.0 use target instead. * @deprecated */ targetElement?: HTMLElement; }<|fim▁end|>
*/ ariaDescribedBy?: string;
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export default {<|fim▁hole|> update: 'Aktualisieren', complete: 'Komplett', delete: 'Löschen', cancel: 'Stornieren', new: 'Neu', list: 'Liste', search: 'Suche', confirmDelete: 'Bestätigung der Löschung', }, }<|fim▁end|>
actions: { label: 'Aktionen', edit: 'Bearbeiten', save: 'Speichern',
<|file_name|>phones.service.spec.ts<|end_file_name|><|fim▁begin|>// #docregion import {describe, beforeEachProviders, it, inject} from 'angular2/testing'; import {HTTP_PROVIDERS} from 'angular2/http'; import {Phones} from '../../app/js/core/phones.service'; describe('Phones', () => { // load providers beforeEachProviders(() => [Phones, HTTP_PROVIDERS]); <|fim▁hole|> expect(phones).toBeDefined(); })); });<|fim▁end|>
// Test service availability it('check the existence of Phones', inject([Phones], (phones) => {
<|file_name|>windows.rs<|end_file_name|><|fim▁begin|>use std::sync::mpsc::{channel, Sender, Receiver, TryRecvError, sync_channel, SyncSender}; use std::io::{Read, Write}; use std::{io, thread}; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use named_pipe::{PipeOptions, OpenMode, PipeClient}; use libc; fn run<F: FnOnce(&SyncSender<()>) -> io::Result<()> + Send + 'static>(_: &'static str, f: F) { let (sync_tx, sync_rx) = sync_channel(0); thread::spawn(move || { match f(&sync_tx) { Ok(_) => {}, Err(_) => { sync_tx.try_send(()).ok(); //println!("MIPC {} thread failed with {:?}", name, e); } }; }); sync_rx.recv().unwrap(); } pub struct IpcClient { send: Sender<Vec<u8>>, recv: Receiver<Vec<u8>>, } struct S<T>(T); unsafe impl<T> Send for S<T> {} impl IpcClient { pub fn send(&self, message: Vec<u8>) -> bool { self.send.send(message).is_ok() } pub fn recv(&self) -> Option<Vec<u8>> { self.recv.recv().ok() } pub fn try_recv(&self) -> Option<Option<Vec<u8>>> { match self.recv.try_recv() { Ok(buf) => Some(Some(buf)), Err(TryRecvError::Empty) => Some(None), Err(TryRecvError::Disconnected) => None } } pub fn open_server(name: &str) -> io::Result<IpcClient> { let (send_tx, send_rx) = channel::<Vec<u8>>(); let (recv_tx, recv_rx) = channel::<Vec<u8>>(); let pid = unsafe { libc::getpid() as u32 }; let path = format!("\\\\.\\pipe\\messageipc_{}_{}", name, pid); let mut servers = try!(PipeOptions::new(path).open_mode(OpenMode::Duplex).multiple(2)); let read_server = S(servers.pop().unwrap()); let write_server = S(servers.pop().unwrap()); // Read thread run("server-read", move |sync| { sync.send(()).unwrap(); let mut read_server = try!(read_server.0.wait()); // Write thread run("server-write", move |sync| { let mut write_server = try!(write_server.0.wait()); sync.send(()).unwrap(); while let Ok(buffer) = send_rx.recv() { let size = buffer.len() as u32; try!(write_server.write_u32::<LittleEndian>(size)); try!(write_server.write_all(&buffer[..])); } Ok(()) }); loop { let bytes = try!(read_server.read_u32::<LittleEndian>()); let mut buffer = vec![0; bytes as usize]; try!(read_server.read_exact(&mut buffer[..])); if let Err(_) = recv_tx.send(buffer) { return Ok(()); } } <|fim▁hole|> send: send_tx, recv: recv_rx, }) } pub fn open_client(name: &str, pid: u32) -> io::Result<IpcClient> { let (send_tx, send_rx) = channel::<Vec<u8>>(); let (recv_tx, recv_rx) = channel::<Vec<u8>>(); let read_path = format!("\\\\.\\pipe\\messageipc_{}_{}", name, pid); let write_path = format!("\\\\.\\pipe\\messageipc_{}_{}", name, pid); // Read thread run("client-read", move |sync| { let mut read_client = try!(PipeClient::connect(read_path)); // Write thread run("client-write", move |sync| { let mut write_client = try!(PipeClient::connect(write_path)); sync.send(()).unwrap(); while let Ok(buffer) = send_rx.recv() { let size = buffer.len() as u32; try!(write_client.write_u32::<LittleEndian>(size)); try!(write_client.write_all(&buffer[..])); } Ok(()) }); sync.send(()).unwrap(); loop { let bytes = try!(read_client.read_u32::<LittleEndian>()); let mut buffer = vec![0; bytes as usize]; try!(read_client.read_exact(&mut buffer[..])); if let Err(_) = recv_tx.send(buffer) { return Ok(()); } } }); Ok(IpcClient { send: send_tx, recv: recv_rx, }) } }<|fim▁end|>
}); Ok(IpcClient {
<|file_name|>testLock2.py<|end_file_name|><|fim▁begin|><|fim▁hole|>with portalocker.Lock('text.txt', timeout=5) as fh: fh.write("Sono in testLoxk2.py") """ from lockfile import LockFile lock = LockFile('text.txt') with lock: print lock.path, 'is locked.' with open('text.txt', "a") as file: file.write("Sono in testLock2.py")<|fim▁end|>
"""import portalocker
<|file_name|>network.py<|end_file_name|><|fim▁begin|>import threading, time, Queue, os, sys, shutil, random from util import user_dir, appdata_dir, print_error, print_msg from bitcoin import * import interface from blockchain import Blockchain DEFAULT_PORTS = {'t':'50011', 's':'50012', 'h':'8181', 'g':'8282'} DEFAULT_SERVERS = { 'server.electrum-exe.org': DEFAULT_PORTS, 'electrum.execoin.org': DEFAULT_PORTS, 'electrum.execoin.net': DEFAULT_PORTS, 'stealth.electrum-exe.org': DEFAULT_PORTS, } def parse_servers(result): """ parse servers list into dict format""" from version import PROTOCOL_VERSION servers = {} for item in result: host = item[1] out = {} version = None pruning_level = '-' if len(item) > 2: for v in item[2]: if re.match("[stgh]\d*", v): protocol, port = v[0], v[1:] if port == '': port = DEFAULT_PORTS[protocol] out[protocol] = port elif re.match("v(.?)+", v): version = v[1:] elif re.match("p\d*", v): pruning_level = v[1:] if pruning_level == '': pruning_level = '0' try: is_recent = float(version)>=float(PROTOCOL_VERSION) except Exception: is_recent = False if out and is_recent: out['pruning'] = pruning_level servers[host] = out return servers def filter_protocol(servers, p): l = [] for k, protocols in servers.items(): if p in protocols: l.append( ':'.join([k, protocols[p], p]) ) return l def pick_random_server(p='s'): return random.choice( filter_protocol(DEFAULT_SERVERS,p) ) from simple_config import SimpleConfig class Network(threading.Thread): def __init__(self, config = {}): threading.Thread.__init__(self) self.daemon = True self.config = SimpleConfig(config) if type(config) == type({}) else config self.lock = threading.Lock() self.num_server = 8 if not self.config.get('oneserver') else 0 self.blockchain = Blockchain(self.config, self) self.interfaces = {} self.queue = Queue.Queue() self.callbacks = {} self.protocol = self.config.get('protocol','s') self.running = False # Server for addresses and transactions self.default_server = self.config.get('server') if not self.default_server: self.default_server = pick_random_server(self.protocol) self.irc_servers = [] # returned by interface (list from irc) self.pending_servers = set([]) self.disconnected_servers = set([]) self.recent_servers = self.config.get('recent_servers',[]) # successful connections self.banner = '' self.interface = None self.proxy = self.config.get('proxy') self.heights = {} self.merkle_roots = {} self.utxo_roots = {} self.server_lag = 0 dir_path = os.path.join( self.config.path, 'certs') if not os.path.exists(dir_path): os.mkdir(dir_path) # default subscriptions self.subscriptions = {} self.subscriptions[self.on_banner] = [('server.banner',[])] self.subscriptions[self.on_peers] = [('server.peers.subscribe',[])] self.pending_transactions_for_notifications = [] def is_connected(self): return self.interface and self.interface.is_connected def is_up_to_date(self): return self.interface.is_up_to_date() def main_server(self): return self.interface.server def send_subscriptions(self): for cb, sub in self.subscriptions.items(): self.interface.send(sub, cb) def subscribe(self, messages, callback): with self.lock: if self.subscriptions.get(callback) is None: self.subscriptions[callback] = [] for message in messages: if message not in self.subscriptions[callback]: self.subscriptions[callback].append(message) if self.is_connected(): self.interface.send( messages, callback ) def send(self, messages, callback): if self.is_connected(): self.interface.send( messages, callback ) return True else: return False def register_callback(self, event, callback): with self.lock: if not self.callbacks.get(event): self.callbacks[event] = [] self.callbacks[event].append(callback) def trigger_callback(self, event): with self.lock: callbacks = self.callbacks.get(event,[])[:] if callbacks: [callback() for callback in callbacks] def random_server(self): choice_list = [] l = filter_protocol(self.get_servers(), self.protocol) for s in l: if s in self.pending_servers or s in self.disconnected_servers or s in self.interfaces.keys(): continue else: choice_list.append(s) if not choice_list: if not self.interfaces: # we are probably offline, retry later self.disconnected_servers = set([]) return server = random.choice( choice_list ) return server def get_servers(self): if self.irc_servers: out = self.irc_servers else: out = DEFAULT_SERVERS for s in self.recent_servers: host, port, protocol = s.split(':') if host not in out: out[host] = { protocol:port } return out def start_interface(self, server): if server in self.interfaces.keys(): return i = interface.Interface(server, self.config) self.pending_servers.add(server) i.start(self.queue) return i def start_random_interface(self): server = self.random_server() if server: self.start_interface(server) def start_interfaces(self): self.interface = self.start_interface(self.default_server) for i in range(self.num_server): self.start_random_interface() def start(self, wait=False): self.start_interfaces() threading.Thread.start(self) if wait: return self.wait_until_connected() def wait_until_connected(self): "wait until connection status is known" if self.config.get('auto_cycle'): # self.random_server() returns None if all servers have been tried while not self.is_connected() and self.random_server(): time.sleep(0.1) else: self.interface.connect_event.wait() return self.interface.is_connected def set_parameters(self, host, port, protocol, proxy, auto_connect): self.config.set_key('auto_cycle', auto_connect, True) self.config.set_key("proxy", proxy, True) self.config.set_key("protocol", protocol, True) server = ':'.join([ host, port, protocol ]) self.config.set_key("server", server, True) if self.proxy != proxy or self.protocol != protocol: self.proxy = proxy self.protocol = protocol for i in self.interfaces.values(): i.stop() if auto_connect: #self.interface = None return if auto_connect: if not self.interface.is_connected: self.switch_to_random_interface() else: if self.server_lag > 0: self.stop_interface() else: self.set_server(server) def switch_to_random_interface(self): if self.interfaces: self.switch_to_interface(random.choice(self.interfaces.values())) def switch_to_interface(self, interface): assert not self.interface.is_connected server = interface.server print_error("switching to", server) self.interface = interface h = self.heights.get(server) if h: self.server_lag = self.blockchain.height() - h self.config.set_key('server', server, False) self.default_server = server self.send_subscriptions() self.trigger_callback('connected') def stop_interface(self): self.interface.stop() def set_server(self, server): if self.default_server == server and self.interface.is_connected: return if self.protocol != server.split(':')[2]: return # stop the interface in order to terminate subscriptions if self.interface.is_connected: self.stop_interface() # notify gui self.trigger_callback('disconnecting') # start interface self.default_server = server self.config.set_key("server", server, True) if server in self.interfaces.keys(): self.switch_to_interface( self.interfaces[server] ) else: self.interface = self.start_interface(server) def add_recent_server(self, i): # list is ordered s = i.server if s in self.recent_servers: self.recent_servers.remove(s) self.recent_servers.insert(0,s) self.recent_servers = self.recent_servers[0:20] self.config.set_key('recent_servers', self.recent_servers) def new_blockchain_height(self, blockchain_height, i): if self.is_connected(): h = self.heights.get(self.interface.server) if h: self.server_lag = blockchain_height - h if self.server_lag > 1: print_error( "Server is lagging", blockchain_height, h) if self.config.get('auto_cycle'): self.set_server(i.server) else: print_error('no height for main interface') self.trigger_callback('updated') def run(self): self.blockchain.start() with self.lock: self.running = True while self.is_running(): try: i = self.queue.get(timeout = 30 if self.interfaces else 3) except Queue.Empty: if len(self.interfaces) < self.num_server: self.start_random_interface() continue if i.server in self.pending_servers: self.pending_servers.remove(i.server) if i.is_connected: #if i.server in self.interfaces: raise self.interfaces[i.server] = i self.add_recent_server(i) i.send([ ('blockchain.headers.subscribe',[])], self.on_header) if i == self.interface: print_error('sending subscriptions to', self.interface.server) self.send_subscriptions() self.trigger_callback('connected') else: self.disconnected_servers.add(i.server) if i.server in self.interfaces: self.interfaces.pop(i.server) if i.server in self.heights: self.heights.pop(i.server) if i == self.interface: #self.interface = None self.trigger_callback('disconnected') if not self.interface.is_connected and self.config.get('auto_cycle'): self.switch_to_random_interface() def on_stealth_tx(self, i, r): if r.get('error', None) is not None: print_error("server", i.server, "does not support stealth tx") return result = r.get('result', []) print_error("new stealth_tx", result) def on_header(self, i, r): result = r.get('result') if not result: return height = result.get('block_height') self.heights[i.server] = height self.merkle_roots[i.server] = result.get('merkle_root') self.utxo_roots[i.server] = result.get('utxo_root') # notify blockchain about the new height self.blockchain.queue.put((i,result)) if i == self.interface: self.server_lag = self.blockchain.height() - height if self.server_lag > 1 and self.config.get('auto_cycle'): print_error( "Server lagging, stopping interface") self.stop_interface() self.trigger_callback('updated') <|fim▁hole|> def on_banner(self, i, r): self.banner = r.get('result') self.trigger_callback('banner') def stop(self): with self.lock: self.running = False def is_running(self): with self.lock: return self.running def synchronous_get(self, requests, timeout=100000000): return self.interface.synchronous_get(requests) def get_header(self, tx_height): return self.blockchain.read_header(tx_height) def get_local_height(self): return self.blockchain.height() #def retrieve_transaction(self, tx_hash, tx_height=0): # import transaction # r = self.synchronous_get([ ('blockchain.transaction.get',[tx_hash, tx_height]) ])[0] # if r: # return transaction.Transaction(r) if __name__ == "__main__": network = NetworkProxy({}) network.start() print network.get_servers() q = Queue.Queue() network.send([('blockchain.headers.subscribe',[])], q.put) while True: r = q.get(timeout=10000) print r<|fim▁end|>
def on_peers(self, i, r): if not r: return self.irc_servers = parse_servers(r.get('result')) self.trigger_callback('peers')
<|file_name|>volume.go<|end_file_name|><|fim▁begin|>/* Copyright 2014 Google Inc. 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 volume import ( "errors" "os" "path" "github.com/GoogleCloudPlatform/kubernetes/pkg/api" ) var ErrUnsupportedVolumeType = errors.New("unsupported volume type") // Interface is a directory used by pods or hosts. Interface implementations // must be idempotent. type Interface interface { // SetUp prepares and mounts/unpacks the volume to a directory path. SetUp() error <|fim▁hole|> GetPath() string // TearDown unmounts the volume and removes traces of the SetUp procedure. TearDown() error } // Host Directory volumes represent a bare host directory mount. // The directory in Path will be directly exposed to the container. type HostDirectory struct { Path string } // Host directory mounts require no setup or cleanup, but still // need to fulfill the interface definitions. func (hostVol *HostDirectory) SetUp() error { return nil } func (hostVol *HostDirectory) TearDown() error { return nil } func (hostVol *HostDirectory) GetPath() string { return hostVol.Path } // EmptyDirectory volumes are temporary directories exposed to the pod. // These do not persist beyond the lifetime of a pod. type EmptyDirectory struct { Name string PodID string RootDir string } // SetUp creates the new directory. func (emptyDir *EmptyDirectory) SetUp() error { path := emptyDir.GetPath() err := os.MkdirAll(path, 0750) if err != nil { return err } return nil } // TODO(jonesdl) when we can properly invoke TearDown(), we should delete // the directory created by SetUp. func (emptyDir *EmptyDirectory) TearDown() error { return nil } func (emptyDir *EmptyDirectory) GetPath() string { return path.Join(emptyDir.RootDir, emptyDir.PodID, "volumes", "empty", emptyDir.Name) } // Interprets API volume as a HostDirectory func createHostDirectory(volume *api.Volume) *HostDirectory { return &HostDirectory{volume.Source.HostDirectory.Path} } // Interprets API volume as an EmptyDirectory func createEmptyDirectory(volume *api.Volume, podID string, rootDir string) *EmptyDirectory { return &EmptyDirectory{volume.Name, podID, rootDir} } // CreateVolume returns an Interface capable of mounting a volume described by an // *api.Volume and whether or not it is mounted, or an error. func CreateVolume(volume *api.Volume, podID string, rootDir string) (Interface, error) { source := volume.Source // TODO(jonesdl) We will want to throw an error here when we no longer // support the default behavior. if source == nil { return nil, nil } var vol Interface // TODO(jonesdl) We should probably not check every pointer and directly // resolve these types instead. if source.HostDirectory != nil { vol = createHostDirectory(volume) } else if source.EmptyDirectory != nil { vol = createEmptyDirectory(volume, podID, rootDir) } else { return nil, ErrUnsupportedVolumeType } return vol, nil }<|fim▁end|>
// GetPath returns the directory path the volume is mounted to.
<|file_name|>create_buildpack.go<|end_file_name|><|fim▁begin|>package buildpack import ( "fmt" "strconv" "code.cloudfoundry.org/cli/cf/flags" . "code.cloudfoundry.org/cli/cf/i18n" "code.cloudfoundry.org/cli/cf" "code.cloudfoundry.org/cli/cf/api" "code.cloudfoundry.org/cli/cf/commandregistry" "code.cloudfoundry.org/cli/cf/errors" "code.cloudfoundry.org/cli/cf/models" "code.cloudfoundry.org/cli/cf/requirements" "code.cloudfoundry.org/cli/cf/terminal" ) type CreateBuildpack struct { ui terminal.UI buildpackRepo api.BuildpackRepository buildpackBitsRepo api.BuildpackBitsRepository } func init() { commandregistry.Register(&CreateBuildpack{}) } func (cmd *CreateBuildpack) MetaData() commandregistry.CommandMetadata { fs := make(map[string]flags.FlagSet) fs["enable"] = &flags.BoolFlag{Name: "enable", Usage: T("Enable the buildpack to be used for staging")} fs["disable"] = &flags.BoolFlag{Name: "disable", Usage: T("Disable the buildpack from being used for staging")} return commandregistry.CommandMetadata{ Name: "create-buildpack", Description: T("Create a buildpack"), Usage: []string{ T("CF_NAME create-buildpack BUILDPACK PATH POSITION [--enable|--disable]"), T("\n\nTIP:\n"), T(" Path should be a zip file, a url to a zip file, or a local directory. Position is a positive integer, sets priority, and is sorted from lowest to highest."), }, Flags: fs, TotalArgs: 3, } } func (cmd *CreateBuildpack) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) ([]requirements.Requirement, error) { if len(fc.Args()) != 3 { cmd.ui.Failed(T("Incorrect Usage. Requires buildpack_name, path and position as arguments\n\n") + commandregistry.Commands.CommandUsage("create-buildpack")) return nil, fmt.Errorf("Incorrect usage: %d arguments of %d required", len(fc.Args()), 3) } reqs := []requirements.Requirement{ requirementsFactory.NewLoginRequirement(), } return reqs, nil } func (cmd *CreateBuildpack) SetDependency(deps commandregistry.Dependency, pluginCall bool) commandregistry.Command { cmd.ui = deps.UI cmd.buildpackRepo = deps.RepoLocator.GetBuildpackRepository() cmd.buildpackBitsRepo = deps.RepoLocator.GetBuildpackBitsRepository() return cmd } func (cmd *CreateBuildpack) Execute(c flags.FlagContext) error { buildpackName := c.Args()[0] buildpackFile, buildpackFileName, err := cmd.buildpackBitsRepo.CreateBuildpackZipFile(c.Args()[1]) if err != nil { cmd.ui.Warn(T("Failed to create a local temporary zip file for the buildpack")) return err } cmd.ui.Say(T("Creating buildpack {{.BuildpackName}}...", map[string]interface{}{"BuildpackName": terminal.EntityNameColor(buildpackName)})) buildpack, err := cmd.createBuildpack(buildpackName, c) if err != nil { if httpErr, ok := err.(errors.HTTPError); ok && httpErr.ErrorCode() == errors.BuildpackNameTaken { cmd.ui.Ok() cmd.ui.Warn(T("Buildpack {{.BuildpackName}} already exists", map[string]interface{}{"BuildpackName": buildpackName})) cmd.ui.Say(T("TIP: use '{{.CfUpdateBuildpackCommand}}' to update this buildpack", map[string]interface{}{"CfUpdateBuildpackCommand": terminal.CommandColor(cf.Name + " " + "update-buildpack")})) } else if httpErr, ok := err.(errors.HTTPError); ok && httpErr.ErrorCode() == errors.StackUnique { cmd.ui.Ok() cmd.ui.Warn(T("Buildpack {{.BuildpackName}} already exists without a stack", map[string]interface{}{"BuildpackName": buildpackName})) cmd.ui.Say(T("TIP: use '{{.CfDeleteBuildpackCommand}}' to delete buildpack {{.BuildpackName}} without a stack", map[string]interface{}{"CfDeleteBuildpackCommand": terminal.CommandColor(cf.Name + " " + "delete-buildpack"), "BuildpackName": buildpackName})) } else { return err } return nil } cmd.ui.Ok() cmd.ui.Say("") cmd.ui.Say(T("Uploading buildpack {{.BuildpackName}}...", map[string]interface{}{"BuildpackName": terminal.EntityNameColor(buildpackName)})) err = cmd.buildpackBitsRepo.UploadBuildpack(buildpack, buildpackFile, buildpackFileName) if err != nil { if httpErr, ok := err.(errors.HTTPError); ok && httpErr.ErrorCode() == errors.BuildpackNameStackTaken { cmd.ui.Ok() cmd.ui.Warn(httpErr.Error()) cmd.ui.Say(T("TIP: use '{{.CfUpdateBuildpackCommand}}' to update this buildpack", map[string]interface{}{"CfUpdateBuildpackCommand": terminal.CommandColor(cf.Name + " " + "update-buildpack")})) } else { return err } return nil } cmd.ui.Ok() return nil } func (cmd CreateBuildpack) createBuildpack(buildpackName string, c flags.FlagContext) (buildpack models.Buildpack, apiErr error) { position, err := strconv.Atoi(c.Args()[2]) if err != nil { apiErr = fmt.Errorf(T("Error {{.ErrorDescription}} is being passed in as the argument for 'Position' but 'Position' requires an integer. For more syntax help, see `cf create-buildpack -h`.", map[string]interface{}{"ErrorDescription": c.Args()[2]})) return } enabled := c.Bool("enable") disabled := c.Bool("disable") if enabled && disabled { apiErr = errors.New(T("Cannot specify both {{.Enabled}} and {{.Disabled}}.", map[string]interface{}{ "Enabled": "enabled", "Disabled": "disabled", })) return } var enableOption *bool if enabled { enableOption = &enabled } if disabled { disabled = false<|fim▁hole|> } buildpack, apiErr = cmd.buildpackRepo.Create(buildpackName, &position, enableOption, nil) return }<|fim▁end|>
enableOption = &disabled
<|file_name|>script.js<|end_file_name|><|fim▁begin|>/** * @file * A JavaScript file for the theme. * * In order for this JavaScript to be loaded on pages, see the instructions in * the README.txt next to this file. */ // JavaScript should be made compatible with libraries other than jQuery by<|fim▁hole|> $(document).ready( function(){ if($("#block-nice-menus-1").length > 0){ $('#block-nice-menus-1').meanmenu({ meanMenuContainer: '.region-header', meanScreenWidth: "1100", meanRemoveAttrs: true, meanDisplay: "table", meanMenuOpen: "<span></span><span></span><span></span>", meanRevealPosition: "left", meanMenuClose: "<span></span><span></span><span></span>" }); jQuery("#block-block-10 .social-icon .search").click(function(event){ event.preventDefault(); jQuery("#block-search-form").fadeToggle("fast"); }); } jQuery('#toggle-text').click(function () { if(jQuery('#content-text').hasClass('.open')){ jQuery('#content-text').hide('slow').removeClass('.open'); jQuery('#toggle-text').html('Read More'); }else{ jQuery('#content-text').addClass('.open').show('slow'); jQuery('#toggle-text').html('Read Less'); } }); }); // Place your code here. })(jQuery, Drupal, this, this.document);<|fim▁end|>
// wrapping it with an "anonymous closure". See: // - http://drupal.org/node/1446420 // - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth (function($, Drupal, window, document, undefined) {
<|file_name|>pla.rs<|end_file_name|><|fim▁begin|>/* Copyright (c) 2016-2017, Robert Ou <rqou@robertou.com> and contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ //! Contains functions pertaining to the PLA use crate::*; /// Represents one single AND term in the PLA. Each AND term can perform an AND function on any subset of its inputs /// and the complement of those inputs. The index for each input is the corresponding ZIA row. #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Serialize, Deserialize)] pub struct XC2PLAAndTerm { /// Indicates whether a particular ZIA row output is a part of this AND term. /// /// `true` = part of and, `false` = not part of and input: [u8; INPUTS_PER_ANDTERM / 8], /// Indicates whether the complement of a particular ZIA row output is a part of this AND term. /// /// `true` = part of and, `false` = not part of and input_b: [u8; INPUTS_PER_ANDTERM / 8], } impl Default for XC2PLAAndTerm { /// Returns a "default" AND term. The default state is for none of the inputs to be selected. fn default() -> Self { XC2PLAAndTerm { input: [0u8; INPUTS_PER_ANDTERM / 8], input_b: [0u8; INPUTS_PER_ANDTERM / 8], } } } impl XC2PLAAndTerm { /// Internal function that reads one single AND term from a block of fuses using logical fuse indexing pub fn from_jed(fuses: &[bool], block_idx: usize, term_idx: usize) -> XC2PLAAndTerm { let mut input = [0u8; INPUTS_PER_ANDTERM / 8]; let mut input_b = [0u8; INPUTS_PER_ANDTERM / 8]; for i in 0..INPUTS_PER_ANDTERM { if !fuses[block_idx + term_idx * INPUTS_PER_ANDTERM * 2 + i * 2 + 0] { input[i / 8] |= 1 << (i % 8); } if !fuses[block_idx + term_idx * INPUTS_PER_ANDTERM * 2 + i * 2 + 1] { input_b[i / 8] |= 1 << (i % 8); } } XC2PLAAndTerm { input, input_b, }<|fim▁hole|> /// Returns `true` if the `i`th input is used in this AND term pub fn get(&self, i: usize) -> bool { self.input[i / 8] & (1 << (i % 8)) != 0 } /// Returns `true` if the `i`th input complement is used in this AND term pub fn get_b(&self, i: usize) -> bool { self.input_b[i / 8] & (1 << (i % 8)) != 0 } /// Sets whether the `i`th input is used in this AND term pub fn set(&mut self, i: usize, val: bool) { if !val { self.input[i / 8] &= !(1 << (i % 8)); } else { self.input[i / 8] |= 1 << (i % 8); } } /// Sets whether the `i`th input complement is used in this AND term pub fn set_b(&mut self, i: usize, val: bool) { if !val { self.input_b[i / 8] &= !(1 << (i % 8)); } else { self.input_b[i / 8] |= 1 << (i % 8); } } } /// Represents one single OR term in the PLA. Each OR term can perform an OR function on any subset of its inputs. /// The index for each input is the index of the corresponding AND term in the same PLA. #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Serialize, Deserialize)] pub struct XC2PLAOrTerm { /// Indicates whether a particular PLA AND term is a part of this OR term. /// /// `true` = part of or, `false` = not part of or input: [u8; ANDTERMS_PER_FB / 8], } impl Default for XC2PLAOrTerm { /// Returns a "default" OR term. The default state is for none of the inputs to be selected. fn default() -> Self { XC2PLAOrTerm { input: [0u8; ANDTERMS_PER_FB / 8], } } } impl XC2PLAOrTerm { /// Internal function that reads one single OR term from a block of fuses using logical fuse indexing pub fn from_jed(fuses: &[bool], block_idx: usize, term_idx: usize) -> XC2PLAOrTerm { let mut input = [0u8; ANDTERMS_PER_FB / 8]; for i in 0..ANDTERMS_PER_FB { if !fuses[block_idx + term_idx +i * MCS_PER_FB] { input[i / 8] |= 1 << (i % 8); } } XC2PLAOrTerm { input, } } /// Returns `true` if the `i`th AND term is used in this OR term pub fn get(&self, i: usize) -> bool { self.input[i / 8] & (1 << (i % 8)) != 0 } /// Sets whether the `i`th AND term is used in this OR term pub fn set(&mut self, i: usize, val: bool) { if !val { self.input[i / 8] &= !(1 << (i % 8)); } else { self.input[i / 8] |= 1 << (i % 8); } } }<|fim▁end|>
}
<|file_name|>Anchor.js<|end_file_name|><|fim▁begin|>import { createPlugin } from 'draft-extend'; // TODO(mime): can't we just use LINK? i forget why we're using ANCHOR separately..., something with images probably :-/ const ENTITY_TYPE = 'ANCHOR'; // TODO(mime): one day, maybe switch wholesale to draft-extend. for now, we have a weird hybrid // of draft-extend/draft-convert/draft-js-plugins export default createPlugin({<|fim▁hole|> return create(ENTITY_TYPE, mutable, { href, target }); } }, entityToHTML: (entity, originalText) => { if (entity.type === ENTITY_TYPE) { const { href } = entity.data; return `<a href="${href}" target="_blank" rel="noopener noreferrer">${originalText}</a>`; } return originalText; }, }); export const AnchorDecorator = (props) => { const { href } = props.contentState.getEntity(props.entityKey).getData(); return ( <a href={href} target="_blank" rel="noopener noreferrer"> {props.children} </a> ); }; export function anchorStrategy(contentBlock, callback, contentState) { contentBlock.findEntityRanges((character) => { const entityKey = character.getEntity(); return entityKey !== null && contentState.getEntity(entityKey).getType() === ENTITY_TYPE; }, callback); }<|fim▁end|>
htmlToEntity: (nodeName, node, create) => { if (nodeName === 'a') { const mutable = node.firstElementChild?.nodeName === 'IMG' ? 'IMMUTABLE' : 'MUTABLE'; const { href, target } = node;
<|file_name|>kbxSlider.py<|end_file_name|><|fim▁begin|>############################################################################################## # Copyright 2014-2015 Cloud Media Sdn. Bhd. # # This file is part of Xuan Application Development SDK. # # Xuan Application Development SDK 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 3 of the License, or # (at your option) any later version. <|fim▁hole|># 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 Xuan Application Development SDK. If not, see <http://www.gnu.org/licenses/>. ############################################################################################## from com.cloudMedia.theKuroBox.sdk.paramComponents.kbxParamComponent import KBXParamComponent from com.cloudMedia.theKuroBox.sdk.paramTypes.kbxRange import KBXRange from com.cloudMedia.theKuroBox.sdk.util.logger import Logger from com.cloudMedia.theKuroBox.sdk.util.util import Util class KBXSlider(KBXRange, KBXParamComponent): COM_NAME = "kbxSlider" def __init__(self, kbxParamName, kbxParamMinValue, kbxParamMaxValue, kbxParamIsRequired=True, kbxParamDecimal=0, kbxParamStep=1, kbxParamDefaultValue=None, kbxParamLabel=None, kbxParamDesc=None, **kbxParamProps): pass def set_kbx_param_default_value(self, value): pass<|fim▁end|>
# # Xuan Application Development SDK is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of
<|file_name|>ResponseParameters.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<|fim▁hole|># # 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 . import ObjectCreationParameters __author__ = 'Shamal Faily' class ResponseParameters(ObjectCreationParameters.ObjectCreationParameters): def __init__(self,respName,respRisk,tags,cProps,rType): ObjectCreationParameters.ObjectCreationParameters.__init__(self) self.theName = respName self.theTags = tags self.theRisk = respRisk self.theEnvironmentProperties = cProps self.theResponseType = rType def name(self): return self.theName def tags(self): return self.theTags def risk(self): return self.theRisk def environmentProperties(self): return self.theEnvironmentProperties def responseType(self): return self.theResponseType<|fim▁end|>
# "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at
<|file_name|>cursor.py<|end_file_name|><|fim▁begin|>from django.conf import settings from .locals import get_cid DEFAULT_CID_SQL_COMMENT_TEMPLATE = 'cid: {cid}' class CidCursorWrapper:<|fim▁hole|> """ def __init__(self, cursor): self.cursor = cursor def __getattr__(self, attr): if attr in self.__dict__: return self.__dict__[attr] return getattr(self.cursor, attr) def __iter__(self): return iter(self.cursor) def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): self.close() def add_comment(self, sql): cid_sql_template = getattr( settings, 'CID_SQL_COMMENT_TEMPLATE', DEFAULT_CID_SQL_COMMENT_TEMPLATE ) cid = get_cid() if not cid: return sql # FIXME (dbaty): we could use "--" prefixed comments so that # we would not have to bother with escaping the cid (assuming # it does not contain newline characters). cid = cid.replace('/*', r'\/\*').replace('*/', r'\*\/') return "/* {} */\n{}".format(cid_sql_template.format(cid=cid), sql) # The following methods cannot be implemented in __getattr__, because the # code must run when the method is invoked, not just when it is accessed. def callproc(self, procname, params=None): return self.cursor.callproc(procname, params) def execute(self, sql, params=None): sql = self.add_comment(sql) return self.cursor.execute(sql, params) def executemany(self, sql, param_list): sql = self.add_comment(sql) return self.cursor.executemany(sql, param_list)<|fim▁end|>
""" A cursor wrapper that attempts to add a cid comment to each query
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python # -*- coding: utf-8 -*- # created by restran on 2016/1/2 from __future__ import unicode_literals, absolute_import<|fim▁hole|>from django.utils.translation import ugettext_lazy as _ from .models import * from common.forms import BaseModelForm logger = logging.getLogger(__name__) class ClientForm(BaseModelForm): class Meta: model = Client fields = ('name', 'memo', 'enable', "app_id", 'secret_key', 'login_auth_url', 'access_token_ex', 'refresh_token_ex', 'sms_login_auth_url', 'change_password_url', 'sms_change_password_url') def clean_refresh_token_ex(self): access_token_ex = self.cleaned_data['access_token_ex'] refresh_token_ex = self.cleaned_data['refresh_token_ex'] if access_token_ex >= refresh_token_ex: raise forms.ValidationError(_('refresh_token 的过期时间不能小于 access_token')) return refresh_token_ex ClientForm.base_fields.keyOrder = [ 'name', 'memo', 'url', 'enable', 'app_id', 'secret_key', 'login_auth_url', 'access_token_ex', 'refresh_token_ex', 'sms_login_auth_url', 'sms_change_password_url', 'change_password_url' ] # # class ClientEndpointForm(BaseModelForm): # class Meta: # model = Client # fields = ('name', 'memo', 'enable', 'access_key', 'secret_key') class EndpointForm(BaseModelForm): def __init__(self, *args, **kwargs): super(EndpointForm, self).__init__(*args, **kwargs) class Meta: model = Endpoint fields = ('name', 'is_builtin', 'url', 'unique_name', 'enable_acl', 'version', 'async_http_connect_timeout', 'async_http_request_timeout', 'enable_hmac', 'memo', 'require_login') def clean_url(self): is_builtin = self.cleaned_data['is_builtin'] url = self.cleaned_data['url'] if not is_builtin and (url is None or url == ''): raise forms.ValidationError(_('Endpoint URL 不能为空')) else: return url def clean_unique_name(self): unique_name = self.cleaned_data['unique_name'] if self.instance is not None: sites = Endpoint.objects.filter(unique_name=unique_name).values('id') for t in sites: if t['id'] != self.instance.id: raise forms.ValidationError(_('已存在相同名称的 Endpoint')) else: sites = Endpoint.objects.filter(unique_name=unique_name).values('id') if len(sites) > 0: raise forms.ValidationError(_('已存在相同名称的 Endpoint')) return unique_name EndpointForm.base_fields.keyOrder = [ 'name', 'unique_name', 'is_builtin', 'url', 'prefix_uri', 'enable_acl', 'async_http_connect_timeout', 'async_http_request_timeout', 'enable_hmac', 'memo', 'require_login'] class ACLRuleForm(BaseModelForm): class Meta: model = ACLRule fields = ('re_uri', 'is_permit')<|fim▁end|>
from django import forms
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![recursion_limit = "160"] // 150 was too low in rust 1.15 use std::result; mod operand; use operand::Operand; extern crate r68k_common; use r68k_common::ops::*; use r68k_common::constants::*; mod constants; use constants::*; #[macro_use] extern crate pest; pub mod memory; pub mod assembler; pub mod disassembler; pub mod srecords; use memory::Memory; // type alias for exception handling pub type Result<T> = result::Result<T, Exception>; type OpcodeValidator = fn(u16) -> bool; type OperandDecoder = fn(u16, Size, PC, &Memory) -> (Words, Vec<Operand>); type InstructionEncoder = fn(&OpcodeInstance, u16, PC, &mut Memory) -> PC; type InstructionSelector = fn(&OpcodeInstance) -> bool; #[derive(Clone, Copy, Debug, PartialEq)] pub struct PC(pub u32); #[derive(Clone, Copy, Debug, PartialEq)] pub struct Words(pub u8); use std::ops::Sub; use std::ops::Add; impl Sub for PC { type Output = PC; fn sub(self, rhs: PC) -> PC { PC(self.0 - rhs.0) } } impl Add for PC { type Output = PC; fn add(self, rhs: PC) -> PC { PC(self.0 + rhs.0) } } impl Add<u32> for PC { type Output = PC; fn add(self, rhs: u32) -> PC { PC(self.0 + rhs) } } impl Add<i32> for PC { type Output = PC; fn add(self, rhs: i32) -> PC { PC((self.0 as i32 + rhs) as u32) } } impl Add<Words> for PC { type Output = PC; fn add(self, rhs: Words) -> <Self as Add<Words>>::Output { PC(self.0 + (rhs.0 * 2) as u32) } } impl Add for Words { type Output = Words; fn add(self, rhs: Words) -> Words { Words(self.0 + rhs.0) } } impl PC { fn is_odd(&self) -> bool { self.0 % 2 == 1 } } impl From<PC> for usize { fn from(pc: PC) -> Self { pc.0 as usize } } impl PartialEq<PC> for u32 { fn eq(&self, other: &PC) -> bool { *self == other.0 } } impl PartialEq<u32> for PC { fn eq(&self, other: &u32) -> bool { self.0 == *other } } impl std::fmt::LowerHex for PC { fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { write!(f, "{:06x}", self.0) } } impl std::fmt::UpperHex for PC { fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { write!(f, "{:06X}", self.0) } } #[derive(Debug)] pub enum Exception { IllegalInstruction(u16, PC), // ir, pc } #[derive(Clone, Copy, Debug, PartialEq)] pub enum Size { Unsized, Byte, Word, Long } impl fmt::Display for Size { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { Size::Unsized => write!(f, ""), Size::Byte => write!(f, ".B"), Size::Word => write!(f, ".W"), Size::Long => write!(f, ".L"), } } } // #[derive(Clone, Copy)] pub struct OpcodeInfo<'a> { mask: u32, matching: u32, size: Size, validator: OpcodeValidator, decoder: OperandDecoder, mnemonic: &'a str, synonym: Option<&'a str>, encoder: InstructionEncoder, selector: InstructionSelector, } #[derive(Clone, Debug, PartialEq)] pub struct OpcodeInstance<'a> { pub mnemonic: &'a str, pub size: Size, pub operands: Vec<Operand>, } use std::fmt; use std::fmt::Formatter; impl<'a> fmt::Debug for OpcodeInfo<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { _ => write!(f, "[some fn]"), } } } impl<'a> fmt::Display for OpcodeInstance<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.operands.len() { 0 => write!(f, "{}{}", self.mnemonic, self.size), 1 => write!(f, "{}{}\t{}", self.mnemonic, self.size, self.operands[0]), 2 => write!(f, "{}{}\t{},{}", self.mnemonic, self.size, self.operands[0], self.operands[1]), _ => panic!("more than two operands {:?}", self) } } } macro_rules! instruction { ($mask:expr, $matching:expr, $size:expr, $mnemonic:expr, $validator:ident, $decoder:ident) => (OpcodeInfo { mask: $mask, matching: $matching, size: $size, mnemonic: $mnemonic, synonym: None, validator: disassembler::$validator, decoder: disassembler::$decoder, encoder: assembler::nop_encoder, selector: assembler::nop_selector}); ($mask:expr, $matching:expr, $size:expr, $mnemonic:expr, $validator:ident, $decoder:ident, $selector:ident, $encoder:ident) => (OpcodeInfo { mask: $mask, matching: $matching, size: $size, mnemonic: $mnemonic, synonym: None, validator: disassembler::$validator, decoder: disassembler::$decoder, encoder: assembler::$encoder, selector: assembler::$selector}); ($mask:expr, $matching:expr, $size:expr, $mnemonic:expr, $synonym:expr, $validator:ident, $decoder:ident, $selector:ident, $encoder:ident) => (OpcodeInfo { mask: $mask, matching: $matching, size: $size, mnemonic: $mnemonic, synonym: Some($synonym), validator: disassembler::$validator, decoder: disassembler::$decoder, encoder: assembler::$encoder, selector: assembler::$selector}); } fn generate<'a>() -> Vec<OpcodeInfo<'a>> { vec![ instruction!(MASK_OUT_X_Y, OP_ABCD | BYTE_SIZED | RR_MODE, Size::Byte, "ABCD", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_ABCD | BYTE_SIZED | MM_MODE, Size::Byte, "ABCD", always, decode_pdx_pdy, is_pd_pd, encode_pdx_pdy), instruction!(MASK_OUT_X_Y, OP_SBCD | BYTE_SIZED | RR_MODE, Size::Byte, "SBCD", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SBCD | BYTE_SIZED | MM_MODE, Size::Byte, "SBCD", always, decode_pdx_pdy, is_pd_pd, encode_pdx_pdy), instruction!(MASK_OUT_EA, OP_NBCD, Size::Byte, "NBCD", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_X_EA, OP_ADD | BYTE_SIZED | DEST_DX, Size::Byte, "ADD", ea_all_except_an, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_ADD | BYTE_SIZED | DEST_EA, Size::Byte, "ADD", ea_memory_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_X_EA, OP_ADD | WORD_SIZED | DEST_DX, Size::Word, "ADD", ea_all, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_ADD | WORD_SIZED | DEST_EA, Size::Word, "ADD", ea_memory_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_X_EA, OP_ADD | LONG_SIZED | DEST_DX, Size::Long, "ADD", ea_all, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_ADD | LONG_SIZED | DEST_EA, Size::Long, "ADD", ea_memory_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_X_EA, OP_ADD | DEST_AX_WORD, Size::Word, "ADDA", ea_all, decode_ea_ax, is_ea_an, encode_ea_ax), instruction!(MASK_OUT_X_EA, OP_ADD | DEST_AX_LONG, Size::Long, "ADDA", ea_all, decode_ea_ax, is_ea_an, encode_ea_ax), instruction!(MASK_OUT_X_EA, OP_ADDQ | BYTE_SIZED, Size::Byte, "ADDQ", ea_alterable_except_an, decode_quick_ea, is_imm_ea, encode_quick_ea), instruction!(MASK_OUT_X_EA, OP_ADDQ | WORD_SIZED, Size::Word, "ADDQ", ea_alterable, decode_quick_ea, is_imm_ea, encode_quick_ea), instruction!(MASK_OUT_X_EA, OP_ADDQ | LONG_SIZED, Size::Long, "ADDQ", ea_alterable, decode_quick_ea, is_imm_ea, encode_quick_ea), instruction!(MASK_OUT_EA, OP_ADDI | BYTE_SIZED, Size::Byte, "ADDI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_EA, OP_ADDI | WORD_SIZED, Size::Word, "ADDI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_EA, OP_ADDI | LONG_SIZED, Size::Long, "ADDI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_X_Y, OP_ADDX | BYTE_SIZED | RR_MODE, Size::Byte, "ADDX", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_ADDX | BYTE_SIZED | MM_MODE, Size::Byte, "ADDX", always, decode_pdx_pdy, is_pd_pd, encode_pdx_pdy), instruction!(MASK_OUT_X_Y, OP_ADDX | WORD_SIZED | RR_MODE, Size::Word, "ADDX", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_ADDX | WORD_SIZED | MM_MODE, Size::Word, "ADDX", always, decode_pdx_pdy, is_pd_pd, encode_pdx_pdy), instruction!(MASK_OUT_X_Y, OP_ADDX | LONG_SIZED | RR_MODE, Size::Long, "ADDX", always, decode_dx_dy, is_dn_dn, encode_dx_dy),<|fim▁hole|> instruction!(MASK_OUT_X_EA, OP_AND | BYTE_SIZED | DEST_EA, Size::Byte, "AND", ea_memory_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_X_EA, OP_AND | WORD_SIZED | DEST_DX, Size::Word, "AND", ea_data, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_AND | WORD_SIZED | DEST_EA, Size::Word, "AND", ea_memory_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_X_EA, OP_AND | LONG_SIZED | DEST_DX, Size::Long, "AND", ea_data, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_AND | LONG_SIZED | DEST_EA, Size::Long, "AND", ea_memory_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_EXACT, OP_ANDI | BYTE_SIZED | DEST_SR, Size::Byte, "ANDI", always, decode_imm_ccr, is_imm_ccr, encode_just_imm), instruction!(MASK_EXACT, OP_ANDI | WORD_SIZED | DEST_SR, Size::Word, "ANDI", always, decode_imm_sr, is_imm_sr, encode_just_imm), instruction!(MASK_OUT_EA, OP_ANDI | BYTE_SIZED, Size::Byte, "ANDI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_EA, OP_ANDI | WORD_SIZED, Size::Word, "ANDI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_EA, OP_ANDI | LONG_SIZED, Size::Long, "ANDI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_X_EA, OP_OR | BYTE_SIZED | DEST_DX, Size::Byte, "OR", ea_data, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_OR | BYTE_SIZED | DEST_EA, Size::Byte, "OR", ea_memory_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_X_EA, OP_OR | WORD_SIZED | DEST_DX, Size::Word, "OR", ea_data, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_OR | WORD_SIZED | DEST_EA, Size::Word, "OR", ea_memory_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_X_EA, OP_OR | LONG_SIZED | DEST_DX, Size::Long, "OR", ea_data, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_OR | LONG_SIZED | DEST_EA, Size::Long, "OR", ea_memory_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_EXACT, OP_ORI | BYTE_SIZED | DEST_SR, Size::Byte, "ORI", always, decode_imm_ccr, is_imm_ccr, encode_just_imm), instruction!(MASK_EXACT, OP_ORI | WORD_SIZED | DEST_SR, Size::Word, "ORI", always, decode_imm_sr, is_imm_sr, encode_just_imm), instruction!(MASK_OUT_EA, OP_ORI | BYTE_SIZED, Size::Byte, "ORI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_EA, OP_ORI | WORD_SIZED, Size::Word, "ORI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_EA, OP_ORI | LONG_SIZED, Size::Long, "ORI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_X_EA, OP_EOR | BYTE_SIZED | DEST_EA, Size::Byte, "EOR", ea_data_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_X_EA, OP_EOR | WORD_SIZED | DEST_EA, Size::Word, "EOR", ea_data_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_X_EA, OP_EOR | LONG_SIZED | DEST_EA, Size::Long, "EOR", ea_data_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_EXACT, OP_EORI | BYTE_SIZED | DEST_SR, Size::Byte, "EORI", always, decode_imm_ccr, is_imm_ccr, encode_just_imm), instruction!(MASK_EXACT, OP_EORI | WORD_SIZED | DEST_SR, Size::Word, "EORI", always, decode_imm_sr, is_imm_sr, encode_just_imm), instruction!(MASK_OUT_EA, OP_EORI | BYTE_SIZED, Size::Byte, "EORI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_EA, OP_EORI | WORD_SIZED, Size::Word, "EORI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_EA, OP_EORI | LONG_SIZED, Size::Long, "EORI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_X_EA, OP_MOVE | WORD_MOVE | MOVE_TO_AN, Size::Word, "MOVEA", ea_all, decode_ea_ea, is_ea_ea, encode_ea_ea), instruction!(MASK_OUT_X_EA, OP_MOVE | LONG_MOVE | MOVE_TO_AN, Size::Long, "MOVEA", ea_all, decode_ea_ea, is_ea_ea, encode_ea_ea), instruction!(MASK_OUT_EA, OP_MOVE2 | MOVE_FROM_SR, Size::Word, "MOVE", ea_data_alterable, decode_sr_ea, is_sr_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_MOVE2 | MOVE_TO_SR, Size::Word, "MOVE", ea_data, decode_ea_sr, is_ea_sr, encode_just_ea), instruction!(MASK_OUT_EA, OP_MOVE2 | MOVE_TO_CCR, Size::Word, "MOVE", ea_data, decode_ea_ccr, is_ea_ccr, encode_just_ea), instruction!(MASK_OUT_Y, OP_MOVE2 | MOVE_USP | TO_AN, Size::Long, "MOVE", always, decode_usp_ay, is_usp_an, encode_just_ay), instruction!(MASK_OUT_Y, OP_MOVE2 | MOVE_USP | FROM_AN, Size::Long, "MOVE", always, decode_ay_usp, is_an_usp, encode_just_ay), instruction!(MASK_LO3NIB, OP_MOVE | BYTE_MOVE, Size::Byte, "MOVE", ea_all_except_an_to_data_alterable, decode_ea_ea, is_ea_ea, encode_ea_ea), instruction!(MASK_LO3NIB, OP_MOVE | WORD_MOVE, Size::Word, "MOVE", ea_all_to_data_alterable, decode_ea_ea, is_ea_ea, encode_ea_ea), instruction!(MASK_LO3NIB, OP_MOVE | LONG_MOVE, Size::Long, "MOVE", ea_all_to_data_alterable, decode_ea_ea, is_ea_ea, encode_ea_ea), instruction!(MASK_LOBYTX, OP_MOVEQ, Size::Long, "MOVEQ", always, decode_moveq, is_moveq, encode_moveq), instruction!(MASK_OUT_EA, OP_MOVEM | REGISTER_TO_MEMORY | WORD_TRANSFER, Size::Word, "MOVEM", ea_control_alterable_or_pd, decode_movem_ea, is_movem_ea, encode_movem_ea), instruction!(MASK_OUT_EA, OP_MOVEM | MEMORY_TO_REGISTER | WORD_TRANSFER, Size::Word, "MOVEM", ea_control_or_pi, decode_ea_movem, is_ea_movem, encode_ea_movem), instruction!(MASK_OUT_EA, OP_MOVEM | REGISTER_TO_MEMORY | LONG_TRANSFER, Size::Long, "MOVEM", ea_control_alterable_or_pd, decode_movem_ea, is_movem_ea, encode_movem_ea), instruction!(MASK_OUT_EA, OP_MOVEM | MEMORY_TO_REGISTER | LONG_TRANSFER, Size::Long, "MOVEM", ea_control_or_pi, decode_ea_movem, is_ea_movem, encode_ea_movem), instruction!(MASK_OUT_X_Y, OP_MOVEP | WORD_TRANSFER | MOVEP_MEMORY_TO_REGISTER, Size::Word, "MOVEP", always, decode_diy_dx, is_di_dn, encode_diy_dx), instruction!(MASK_OUT_X_Y, OP_MOVEP | WORD_TRANSFER | MOVEP_REGISTER_TO_MEMORY, Size::Word, "MOVEP", always, decode_dx_diy, is_dn_di, encode_dx_diy), instruction!(MASK_OUT_X_Y, OP_MOVEP | LONG_TRANSFER | MOVEP_MEMORY_TO_REGISTER, Size::Long, "MOVEP", always, decode_diy_dx, is_di_dn, encode_diy_dx), instruction!(MASK_OUT_X_Y, OP_MOVEP | LONG_TRANSFER | MOVEP_REGISTER_TO_MEMORY, Size::Long, "MOVEP", always, decode_dx_diy, is_dn_di, encode_dx_diy), instruction!(MASK_OUT_X_EA, OP_LEA, Size::Long, "LEA", ea_control, decode_ea_ax, is_ea_an, encode_ea_ax), instruction!(MASK_OUT_EA, OP_PEA, Size::Long, "PEA", ea_control, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_Y, OP_LINK, Size::Word, "LINK", always, decode_ay_imm16, is_an_imm16, encode_ay_imm16), instruction!(MASK_OUT_Y, OP_UNLK, Size::Unsized, "UNLK", always, decode_just_ay, is_an, encode_just_ay), instruction!(MASK_LOBYTE, OP_BRANCH | IF_HI, Size::Byte, "BHI", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_LS, Size::Byte, "BLS", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_CC, Size::Byte, "BCC", "BHS", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_CS, Size::Byte, "BCS", "BLO", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_NE, Size::Byte, "BNE", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_EQ, Size::Byte, "BEQ", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_VC, Size::Byte, "BVC", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_VS, Size::Byte, "BVS", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_PL, Size::Byte, "BPL", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_MI, Size::Byte, "BMI", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_GE, Size::Byte, "BGE", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_LT, Size::Byte, "BLT", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_GT, Size::Byte, "BGT", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_LE, Size::Byte, "BLE", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_T , Size::Byte, "BRA", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_LOBYTE, OP_BRANCH | IF_F , Size::Byte, "BSR", valid_byte_displacement, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_HI | DISPLACEMENT_16, Size::Word, "BHI", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_LS | DISPLACEMENT_16, Size::Word, "BLS", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_CC | DISPLACEMENT_16, Size::Word, "BCC", "BHS", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_CS | DISPLACEMENT_16, Size::Word, "BCS", "BLO", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_NE | DISPLACEMENT_16, Size::Word, "BNE", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_EQ | DISPLACEMENT_16, Size::Word, "BEQ", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_VC | DISPLACEMENT_16, Size::Word, "BVC", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_VS | DISPLACEMENT_16, Size::Word, "BVS", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_PL | DISPLACEMENT_16, Size::Word, "BPL", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_MI | DISPLACEMENT_16, Size::Word, "BMI", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_GE | DISPLACEMENT_16, Size::Word, "BGE", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_LT | DISPLACEMENT_16, Size::Word, "BLT", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_GT | DISPLACEMENT_16, Size::Word, "BGT", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_LE | DISPLACEMENT_16, Size::Word, "BLE", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_T | DISPLACEMENT_16, Size::Word, "BRA", always, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_F | DISPLACEMENT_16, Size::Word, "BSR", always, decode_branch, is_branch, encode_branch), // 'never' means we never accept these instructions (long branch isn't supported on 68000) instruction!(MASK_EXACT, OP_BRANCH | IF_HI | DISPLACEMENT_32, Size::Long, "BHI", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_LS | DISPLACEMENT_32, Size::Long, "BLS", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_CC | DISPLACEMENT_32, Size::Long, "BCC", "BHS", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_CS | DISPLACEMENT_32, Size::Long, "BCS", "BLO", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_NE | DISPLACEMENT_32, Size::Long, "BNE", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_EQ | DISPLACEMENT_32, Size::Long, "BEQ", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_VC | DISPLACEMENT_32, Size::Long, "BVC", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_VS | DISPLACEMENT_32, Size::Long, "BVS", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_PL | DISPLACEMENT_32, Size::Long, "BPL", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_MI | DISPLACEMENT_32, Size::Long, "BMI", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_GE | DISPLACEMENT_32, Size::Long, "BGE", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_LT | DISPLACEMENT_32, Size::Long, "BLT", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_GT | DISPLACEMENT_32, Size::Long, "BGT", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_LE | DISPLACEMENT_32, Size::Long, "BLE", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_T | DISPLACEMENT_32, Size::Long, "BRA", never, decode_branch, is_branch, encode_branch), instruction!(MASK_EXACT, OP_BRANCH | IF_F | DISPLACEMENT_32, Size::Long, "BSR", never, decode_branch, is_branch, encode_branch), instruction!(MASK_OUT_X_EA, OP_CMP | DEST_AX_WORD, Size::Word, "CMPA", ea_all, decode_ea_ax, is_ea_an, encode_ea_ax), instruction!(MASK_OUT_X_EA, OP_CMP | DEST_AX_LONG, Size::Long, "CMPA", ea_all, decode_ea_ax, is_ea_an, encode_ea_ax), instruction!(MASK_OUT_X_EA, OP_CMP | BYTE_SIZED, Size::Byte, "CMP", ea_all_except_an, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_CMP | WORD_SIZED, Size::Word, "CMP", ea_all, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_CMP | LONG_SIZED, Size::Long, "CMP", ea_all, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_EA, OP_CMPI | BYTE_SIZED, Size::Byte, "CMPI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_EA, OP_CMPI | WORD_SIZED, Size::Word, "CMPI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_EA, OP_CMPI | LONG_SIZED, Size::Long, "CMPI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_X_Y, OP_CMPM | BYTE_SIZED | MM_MODE, Size::Byte, "CMPM", always, decode_pix_piy, is_pi_pi, encode_pix_piy), instruction!(MASK_OUT_X_Y, OP_CMPM | WORD_SIZED | MM_MODE, Size::Word, "CMPM", always, decode_pix_piy, is_pi_pi, encode_pix_piy), instruction!(MASK_OUT_X_Y, OP_CMPM | LONG_SIZED | MM_MODE, Size::Long, "CMPM", always, decode_pix_piy, is_pi_pi, encode_pix_piy), instruction!(MASK_OUT_EA, OP_CLR | BYTE_SIZED, Size::Byte, "CLR", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_CLR | WORD_SIZED, Size::Word, "CLR", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_CLR | LONG_SIZED, Size::Long, "CLR", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_X_EA, OP_CHK | WORD_OP, Size::Word, "CHK", ea_data, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_EA, OP_NOT | BYTE_SIZED, Size::Byte, "NOT", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_NOT | WORD_SIZED, Size::Word, "NOT", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_NOT | LONG_SIZED, Size::Long, "NOT", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_NEG | BYTE_SIZED, Size::Byte, "NEG", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_NEG | WORD_SIZED, Size::Word, "NEG", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_NEG | LONG_SIZED, Size::Long, "NEG", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_NEGX | BYTE_SIZED, Size::Byte, "NEGX", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_NEGX | WORD_SIZED, Size::Word, "NEGX", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_NEGX | LONG_SIZED, Size::Long, "NEGX", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_BITOPS | BIT_TST | SRC_IMM, Size::Byte, "BTST", ea_data_except_dn, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_X_EA, OP_BITOPS | BIT_TST | SRC_REG, Size::Byte, "BTST", ea_data_except_dn, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_Y, OP_BITOPS | BIT_TST | SRC_IMM | OPER_DN, Size::Long, "BTST", ea_dn, decode_imm8_dy, is_imm8_dn, encode_imm8_dy), instruction!(MASK_OUT_X_Y, OP_BITOPS | BIT_TST | SRC_REG | OPER_DN, Size::Long, "BTST", ea_dn, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_EA, OP_BITOPS | BIT_SET | SRC_IMM, Size::Byte, "BSET", ea_data_alterable_except_dn, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_X_EA, OP_BITOPS | BIT_SET | SRC_REG, Size::Byte, "BSET", ea_data_alterable_except_dn, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_Y, OP_BITOPS | BIT_SET | SRC_IMM | OPER_DN, Size::Long, "BSET", ea_dn, decode_imm8_dy, is_imm8_dn, encode_imm8_dy), instruction!(MASK_OUT_X_Y, OP_BITOPS | BIT_SET | SRC_REG | OPER_DN, Size::Long, "BSET", ea_dn, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_EA, OP_BITOPS | BIT_CLR | SRC_IMM, Size::Byte, "BCLR", ea_data_alterable_except_dn, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_X_EA, OP_BITOPS | BIT_CLR | SRC_REG, Size::Byte, "BCLR", ea_data_alterable_except_dn, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_Y, OP_BITOPS | BIT_CLR | SRC_IMM | OPER_DN, Size::Long, "BCLR", ea_dn, decode_imm8_dy, is_imm8_dn, encode_imm8_dy), instruction!(MASK_OUT_X_Y, OP_BITOPS | BIT_CLR | SRC_REG | OPER_DN, Size::Long, "BCLR", ea_dn, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_EA, OP_BITOPS | BIT_CHG | SRC_IMM, Size::Byte, "BCHG", ea_data_alterable_except_dn, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_X_EA, OP_BITOPS | BIT_CHG | SRC_REG, Size::Byte, "BCHG", ea_data_alterable_except_dn, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_Y, OP_BITOPS | BIT_CHG | SRC_IMM | OPER_DN, Size::Long, "BCHG", ea_dn, decode_imm8_dy, is_imm8_dn, encode_imm8_dy), instruction!(MASK_OUT_X_Y, OP_BITOPS | BIT_CHG | SRC_REG | OPER_DN, Size::Long, "BCHG", ea_dn, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_EXACT, OP_RTS, Size::Unsized, "RTS", always, decode_none, is_none, encode_none), instruction!(MASK_EXACT, OP_RTR, Size::Unsized, "RTR", always, decode_none, is_none, encode_none), instruction!(MASK_EXACT, OP_RTE, Size::Unsized, "RTE", always, decode_none, is_none, encode_none), instruction!(MASK_OUT_EA, OP_JSR, Size::Unsized, "JSR", ea_control, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_JMP, Size::Unsized, "JMP", ea_control, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_Y, OP_DBCC | IF_T, Size::Word, "DBT", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_F, Size::Word, "DBF", "DBRA", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_HI, Size::Word, "DBHI", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_LS, Size::Word, "DBLS", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_CC, Size::Word, "DBCC", "DBHS", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_CS, Size::Word, "DBCS", "DBLO", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_NE, Size::Word, "DBNE", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_EQ, Size::Word, "DBEQ", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_VC, Size::Word, "DBVC", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_VS, Size::Word, "DBVS", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_PL, Size::Word, "DBPL", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_MI, Size::Word, "DBMI", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_GE, Size::Word, "DBGE", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_LT, Size::Word, "DBLT", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_GT, Size::Word, "DBGT", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_Y, OP_DBCC | IF_LE, Size::Word, "DBLE", always, decode_dy_branch, is_dn_branch, encode_dy_branch), instruction!(MASK_OUT_EA, OP_SUBI | BYTE_SIZED, Size::Byte, "SUBI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_EA, OP_SUBI | WORD_SIZED, Size::Word, "SUBI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_EA, OP_SUBI | LONG_SIZED, Size::Long, "SUBI", ea_data_alterable, decode_imm_ea, is_imm_ea, encode_imm_ea), instruction!(MASK_OUT_X_EA, OP_SUBQ | BYTE_SIZED, Size::Byte, "SUBQ", ea_alterable_except_an, decode_quick_ea, is_imm_ea, encode_quick_ea), instruction!(MASK_OUT_X_EA, OP_SUBQ | WORD_SIZED, Size::Word, "SUBQ", ea_alterable, decode_quick_ea, is_imm_ea, encode_quick_ea), instruction!(MASK_OUT_X_EA, OP_SUBQ | LONG_SIZED, Size::Long, "SUBQ", ea_alterable, decode_quick_ea, is_imm_ea, encode_quick_ea), instruction!(MASK_OUT_X_EA, OP_SUB | BYTE_SIZED | DEST_DX, Size::Byte, "SUB", ea_all_except_an, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_SUB | BYTE_SIZED | DEST_EA, Size::Byte, "SUB", ea_memory_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_X_EA, OP_SUB | WORD_SIZED | DEST_DX, Size::Word, "SUB", ea_all, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_SUB | WORD_SIZED | DEST_EA, Size::Word, "SUB", ea_memory_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_X_EA, OP_SUB | LONG_SIZED | DEST_DX, Size::Long, "SUB", ea_all, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_SUB | LONG_SIZED | DEST_EA, Size::Long, "SUB", ea_memory_alterable, decode_dx_ea, is_dn_ea, encode_dx_ea), instruction!(MASK_OUT_X_EA, OP_SUB | DEST_AX_WORD, Size::Word, "SUBA", ea_all, decode_ea_ax, is_ea_an, encode_ea_ax), instruction!(MASK_OUT_X_EA, OP_SUB | DEST_AX_LONG, Size::Long, "SUBA", ea_all, decode_ea_ax, is_ea_an, encode_ea_ax), instruction!(MASK_OUT_X_Y, OP_SUBX | BYTE_SIZED | RR_MODE, Size::Byte, "SUBX", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SUBX | BYTE_SIZED | MM_MODE, Size::Byte, "SUBX", always, decode_pdx_pdy, is_pd_pd, encode_pdx_pdy), instruction!(MASK_OUT_X_Y, OP_SUBX | WORD_SIZED | RR_MODE, Size::Word, "SUBX", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SUBX | WORD_SIZED | MM_MODE, Size::Word, "SUBX", always, decode_pdx_pdy, is_pd_pd, encode_pdx_pdy), instruction!(MASK_OUT_X_Y, OP_SUBX | LONG_SIZED | RR_MODE, Size::Long, "SUBX", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SUBX | LONG_SIZED | MM_MODE, Size::Long, "SUBX", always, decode_pdx_pdy, is_pd_pd, encode_pdx_pdy), instruction!(MASK_OUT_Y, OP_SWAP | WORD_SIZED | OPER_DN, Size::Word, "SWAP", always, decode_just_dy, is_dn, encode_just_dy), instruction!(MASK_OUT_EA, OP_SCC | IF_T, Size::Byte, "ST", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_F, Size::Byte, "SF", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_HI, Size::Byte, "SHI", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_LS, Size::Byte, "SLS", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_CC, Size::Byte, "SCC", "SHS", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_CS, Size::Byte, "SCS", "SLO", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_NE, Size::Byte, "SNE", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_EQ, Size::Byte, "SEQ", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_VC, Size::Byte, "SVC", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_VS, Size::Byte, "SVS", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_PL, Size::Byte, "SPL", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_MI, Size::Byte, "SMI", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_GE, Size::Byte, "SGE", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_LT, Size::Byte, "SLT", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_GT, Size::Byte, "SGT", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_SCC | IF_LE, Size::Byte, "SLE", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | BYTE_SIZED | ROTA_REG_SHIFT | IMM_COUNT, Size::Byte, "ROL", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | WORD_SIZED | ROTA_REG_SHIFT | IMM_COUNT, Size::Word, "ROL", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | LONG_SIZED | ROTA_REG_SHIFT | IMM_COUNT, Size::Long, "ROL", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | BYTE_SIZED | ROTA_REG_SHIFT | REG_COUNT, Size::Byte, "ROL", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | WORD_SIZED | ROTA_REG_SHIFT | REG_COUNT, Size::Word, "ROL", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | LONG_SIZED | ROTA_REG_SHIFT | REG_COUNT, Size::Long, "ROL", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_EA, OP_SHIFT | SHIFT_LEFT | WORD_SIZED | ROTA_MEM_SHIFT, Size::Word, "ROL", ea_memory_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | BYTE_SIZED | ROTA_REG_SHIFT | IMM_COUNT, Size::Byte, "ROR", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | WORD_SIZED | ROTA_REG_SHIFT | IMM_COUNT, Size::Word, "ROR", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | LONG_SIZED | ROTA_REG_SHIFT | IMM_COUNT, Size::Long, "ROR", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | BYTE_SIZED | ROTA_REG_SHIFT | REG_COUNT, Size::Byte, "ROR", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | WORD_SIZED | ROTA_REG_SHIFT | REG_COUNT, Size::Word, "ROR", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | LONG_SIZED | ROTA_REG_SHIFT | REG_COUNT, Size::Long, "ROR", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_EA, OP_SHIFT | SHIFT_RIGHT | WORD_SIZED | ROTA_MEM_SHIFT, Size::Word, "ROR", ea_memory_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | BYTE_SIZED | ROTX_REG_SHIFT | IMM_COUNT, Size::Byte, "ROXL", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | WORD_SIZED | ROTX_REG_SHIFT | IMM_COUNT, Size::Word, "ROXL", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | LONG_SIZED | ROTX_REG_SHIFT | IMM_COUNT, Size::Long, "ROXL", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | BYTE_SIZED | ROTX_REG_SHIFT | REG_COUNT, Size::Byte, "ROXL", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | WORD_SIZED | ROTX_REG_SHIFT | REG_COUNT, Size::Word, "ROXL", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | LONG_SIZED | ROTX_REG_SHIFT | REG_COUNT, Size::Long, "ROXL", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_EA, OP_SHIFT | SHIFT_LEFT | WORD_SIZED | ROTX_MEM_SHIFT, Size::Word, "ROXL", ea_memory_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | BYTE_SIZED | ROTX_REG_SHIFT | IMM_COUNT, Size::Byte, "ROXR", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | WORD_SIZED | ROTX_REG_SHIFT | IMM_COUNT, Size::Word, "ROXR", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | LONG_SIZED | ROTX_REG_SHIFT | IMM_COUNT, Size::Long, "ROXR", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | BYTE_SIZED | ROTX_REG_SHIFT | REG_COUNT, Size::Byte, "ROXR", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | WORD_SIZED | ROTX_REG_SHIFT | REG_COUNT, Size::Word, "ROXR", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | LONG_SIZED | ROTX_REG_SHIFT | REG_COUNT, Size::Long, "ROXR", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_EA, OP_SHIFT | SHIFT_RIGHT | WORD_SIZED | ROTX_MEM_SHIFT, Size::Word, "ROXR", ea_memory_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | BYTE_SIZED | LOGI_REG_SHIFT | IMM_COUNT, Size::Byte, "LSL", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | WORD_SIZED | LOGI_REG_SHIFT | IMM_COUNT, Size::Word, "LSL", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | LONG_SIZED | LOGI_REG_SHIFT | IMM_COUNT, Size::Long, "LSL", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | BYTE_SIZED | LOGI_REG_SHIFT | REG_COUNT, Size::Byte, "LSL", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | WORD_SIZED | LOGI_REG_SHIFT | REG_COUNT, Size::Word, "LSL", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | LONG_SIZED | LOGI_REG_SHIFT | REG_COUNT, Size::Long, "LSL", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_EA, OP_SHIFT | SHIFT_LEFT | WORD_SIZED | LOGI_MEM_SHIFT, Size::Word, "LSL", ea_memory_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | BYTE_SIZED | LOGI_REG_SHIFT | IMM_COUNT, Size::Byte, "LSR", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | WORD_SIZED | LOGI_REG_SHIFT | IMM_COUNT, Size::Word, "LSR", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | LONG_SIZED | LOGI_REG_SHIFT | IMM_COUNT, Size::Long, "LSR", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | BYTE_SIZED | LOGI_REG_SHIFT | REG_COUNT, Size::Byte, "LSR", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | WORD_SIZED | LOGI_REG_SHIFT | REG_COUNT, Size::Word, "LSR", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | LONG_SIZED | LOGI_REG_SHIFT | REG_COUNT, Size::Long, "LSR", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_EA, OP_SHIFT | SHIFT_RIGHT | WORD_SIZED | LOGI_MEM_SHIFT, Size::Word, "LSR", ea_memory_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | BYTE_SIZED | ARIT_REG_SHIFT | IMM_COUNT, Size::Byte, "ASL", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | WORD_SIZED | ARIT_REG_SHIFT | IMM_COUNT, Size::Word, "ASL", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | LONG_SIZED | ARIT_REG_SHIFT | IMM_COUNT, Size::Long, "ASL", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | BYTE_SIZED | ARIT_REG_SHIFT | REG_COUNT, Size::Byte, "ASL", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | WORD_SIZED | ARIT_REG_SHIFT | REG_COUNT, Size::Word, "ASL", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_LEFT | LONG_SIZED | ARIT_REG_SHIFT | REG_COUNT, Size::Long, "ASL", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_EA, OP_SHIFT | SHIFT_LEFT | WORD_SIZED | ARIT_MEM_SHIFT, Size::Word, "ASL", ea_memory_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | BYTE_SIZED | ARIT_REG_SHIFT | IMM_COUNT, Size::Byte, "ASR", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | WORD_SIZED | ARIT_REG_SHIFT | IMM_COUNT, Size::Word, "ASR", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | LONG_SIZED | ARIT_REG_SHIFT | IMM_COUNT, Size::Long, "ASR", always, decode_quick_dy, is_quick_dn, encode_quick_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | BYTE_SIZED | ARIT_REG_SHIFT | REG_COUNT, Size::Byte, "ASR", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | WORD_SIZED | ARIT_REG_SHIFT | REG_COUNT, Size::Word, "ASR", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_SHIFT | SHIFT_RIGHT | LONG_SIZED | ARIT_REG_SHIFT | REG_COUNT, Size::Long, "ASR", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_EA, OP_SHIFT | SHIFT_RIGHT | WORD_SIZED | ARIT_MEM_SHIFT, Size::Word, "ASR", ea_memory_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_X_EA, OP_MULU, Size::Word, "MULU", ea_data, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_MULS, Size::Word, "MULS", ea_data, decode_ea_dx, is_ea_dn, encode_ea_dx), // PRM says data alterable instruction!(MASK_OUT_X_EA, OP_DIVU, Size::Word, "DIVU", ea_data, decode_ea_dx, is_ea_dn, encode_ea_dx), instruction!(MASK_OUT_X_EA, OP_DIVS, Size::Word, "DIVS", ea_data, decode_ea_dx, is_ea_dn, encode_ea_dx), // PRM says data alterable instruction!(MASK_OUT_EA, OP_TAS | BYTE_SIZED, Size::Byte, "TAS", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_TST | BYTE_SIZED, Size::Byte, "TST", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_TST | WORD_SIZED, Size::Word, "TST", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_OUT_EA, OP_TST | LONG_SIZED, Size::Long, "TST", ea_data_alterable, decode_just_ea, is_ea, encode_just_ea), instruction!(MASK_LONIB, OP_TRAP, Size::Unsized, "TRAP", always, decode_just_imm4, is_imm4, encode_just_imm4), instruction!(MASK_EXACT, OP_TRAPV, Size::Unsized, "TRAPV", always, decode_none, is_none, encode_none), instruction!(MASK_OUT_X_Y, OP_EXG | EXG_DATA_DATA, Size::Long, "EXG", always, decode_dx_dy, is_dn_dn, encode_dx_dy), instruction!(MASK_OUT_X_Y, OP_EXG | EXG_ADDR_ADDR, Size::Long, "EXG", always, decode_ax_ay, is_an_an, encode_ax_ay), instruction!(MASK_OUT_X_Y, OP_EXG | EXG_DATA_ADDR, Size::Long, "EXG", always, decode_dx_ay, is_dn_an, encode_dx_ay), instruction!(MASK_OUT_Y, OP_EXT | BYTE_TO_WORD, Size::Word, "EXT", always, decode_just_dy, is_dn, encode_just_dy), instruction!(MASK_OUT_Y, OP_EXT | WORD_TO_LONG, Size::Long, "EXT", always, decode_just_dy, is_dn, encode_just_dy), instruction!(MASK_EXACT, OP_STOP, Size::Unsized, "STOP", always, decode_just_imm16, is_imm16, encode_just_imm16), instruction!(MASK_EXACT, OP_RESET, Size::Unsized, "RESET", always, decode_none, is_none, encode_none), instruction!(MASK_EXACT, OP_ILLEGAL, Size::Unsized, "ILLEGAL", always, decode_none, is_none, encode_none), instruction!(MASK_EXACT, OP_NOP, Size::Unsized, "NOP", always, decode_none, is_none, encode_none), ] } #[cfg(test)] mod tests { use memory::{MemoryVec, Memory}; use assembler::Assembler; use disassembler::{Disassembler, disassemble, disassemble_first}; use super::Exception; use PC; #[test] fn roundtrips_from_opcode() { let opcode = 0xd511; let mem = &mut MemoryVec::new16(PC(0), vec![opcode]); let asm = { let (pc, inst) = disassemble_first(mem); format!(" {}", inst) }; let pc = PC(0); let a = Assembler::new(); let inst = a.parse_assembler(asm.as_str()); let new_pc = a.encode_instruction(asm.as_str(), &inst, pc, mem); assert_eq!(PC(2), new_pc); assert_eq!(opcode, mem.read_word(pc)); } #[test] fn roundtrips_from_asm() { let mem = &mut MemoryVec::new(); let pc = PC(0); let asm = " ADD.B\tD2,(A1)"; let a = Assembler::new(); let inst = a.parse_assembler(asm); a.encode_instruction(asm, &inst, pc, mem); let (pc, inst) = disassemble_first(mem); assert_eq!(asm, format!(" {}", inst)); } #[test] fn synonyms_bcs_blo_byte() { synonymous("BCS.B", "BLO.B", "$10") } #[test] fn synonyms_bcc_bhs_byte() { synonymous("BCC.B", "BHS.B", "$10") } #[test] fn synonyms_bcs_blo_word() { synonymous("BCS.W", "BLO.W", "$10") } #[test] fn synonyms_bcc_bhs_word() { synonymous("BCC.W", "BHS.W", "$10") } #[test] fn synonyms_scs_slo_byte() { synonymous("SCS.B", "SLO.B", "$10") } #[test] fn synonyms_scc_shs_byte() { synonymous("SCC.B", "SHS.B", "$10") } #[test] fn synonyms_dbcs_dblo_word() { synonymous("DBCS.W", "DBLO.W", "D0,$10") } #[test] fn synonyms_dbcc_dbhs_word() { synonymous("DBCC.W", "DBHS.W", "D0,$10") } #[test] fn synonyms_dbf_dbra_word() { synonymous("DBF.W", "DBRA.W", "D0,$10") } fn synonymous(one: &str, two: &str, ops: &str) { let one = assemble_one(&format!(" {}\t{}", one, ops)); let two = assemble_one(&format!(" {}\t{}", two, ops)); assert_eq!(one.data(), two.data()); } fn assemble_one(asm: &str) -> MemoryVec { let mut mem = MemoryVec::new(); let pc = PC(0); let a = Assembler::new(); let inst = a.parse_assembler(asm); let inst = a.adjust_size(&inst); a.encode_instruction(asm, &inst, pc, &mut mem); mem } #[test] // #[ignore] fn roundtrips() { let a = Assembler::new(); let d = Disassembler::new(); let mut valid = 0; for opcode in 0x0000..0xffff { let mut pc = PC(0x1000); let extension_word_mask = 0b1111_1000_1111_1111; // bits 8-10 should always be zero in the ea extension word // as we don't know which word will be seen as the ea extension word // (as opposed to immediate operand values) just make sure these aren't set. let dasm_mem = &mut MemoryVec::new16(pc, vec![opcode, 0x001f, 0x00a4, 0x1234 & extension_word_mask, 0x5678 & extension_word_mask]); // println!("PREDASM {:04x}", opcode); match d.disassemble(pc, dasm_mem) { Err(Exception::IllegalInstruction(_opcode, _)) => (), //println!("{:04x}:\t\tinvalid", opcode), Ok((new_pc, dis_inst)) => { valid += 1; let asm_text = format!("\t{}", dis_inst); // println!("PREPARSE {:04x} disassembled as{}\n\t{:?}", opcode, asm_text, dis_inst); let unsized_inst = a.parse_assembler(asm_text.as_str()); // println!("PREADJ {:04x} disassembled as{}\n\t{:?}, parsed as\n\t{:?}", opcode, asm_text, dis_inst, unsized_inst); let sized_inst = a.adjust_size(&unsized_inst); let mut asm_mem = &mut MemoryVec::new(); // println!("PREENC {:04x} disassembled as{}\n\t{:?}, parsed as\n\t{:?}, sized to\n\t{:?}", opcode, asm_text, dis_inst, unsized_inst, sized_inst); let asm_pc = a.encode_instruction(asm_text.as_str(), &sized_inst, pc, asm_mem); let new_opcode = asm_mem.read_word(pc); if opcode != new_opcode { panic!("{:04x}: disassembled as{}\n\t{:?}, parsed as\n\t{:?}, sized to\n\t{:?}, assembled to {:04x}", opcode, asm_text, dis_inst, unsized_inst, sized_inst, new_opcode); } else { // println!("{:04x}: disassembled as{}\n\t{:?}, parsed as\n\t{:?}, sized to\n\t{:?}, assembled to {:04x}", opcode, asm_text, dis_inst, unsized_inst, sized_inst, new_opcode); // println!("{:04x}: disassembled as {}", opcode, asm_text); } if new_pc != asm_pc { println!("{:04x}: disassembled as{}\n\t{:?}, parsed as\n\t{:?}, sized to\n\t{:?}, assembled to {:04x}", opcode, asm_text, dis_inst, unsized_inst, sized_inst, new_opcode); println!("disassembled pc {} differ from assembled pc {}", new_pc.0, asm_pc.0); }; while pc.0 < new_pc.0 { let read_word = dasm_mem.read_word(pc); let wrote_word = asm_mem.read_word(pc); assert!(read_word == wrote_word, format!("mismatching extension word @{:02x}: read {:04x}, wrote {:04x}", pc.0, read_word, wrote_word)); pc = pc + 2; } } } }; println!("{} opcodes roundtripped ({:.2}% done)", valid, valid as f32 / (540.07f32 - 81.92f32)); } }<|fim▁end|>
instruction!(MASK_OUT_X_Y, OP_ADDX | LONG_SIZED | MM_MODE, Size::Long, "ADDX", always, decode_pdx_pdy, is_pd_pd, encode_pdx_pdy), instruction!(MASK_OUT_X_EA, OP_AND | BYTE_SIZED | DEST_DX, Size::Byte, "AND", ea_data, decode_ea_dx, is_ea_dn, encode_ea_dx),
<|file_name|>ClassNode.java<|end_file_name|><|fim▁begin|>/** * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */<|fim▁hole|> public class ClassNode extends AbstractReportNode { private String className; public ClassNode(String className) { this.className = className; } public String getClassName() { return className; } public boolean equalsNode(AbstractReportNode arg0) { if (!(arg0 instanceof ClassNode)) { return false; } return ((ClassNode) arg0).getClassName().equals(className); } }<|fim▁end|>
package net.sourceforge.pmd.lang.dfa.report;
<|file_name|>bitcoin_lv_LV.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="lv_LV" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Hirocoin</source> <translation>Par Hirocoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Hirocoin&lt;/b&gt; version</source> <translation>&lt;b&gt;Hirocoin&lt;/b&gt; versija</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The Hirocoin developers</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Adrešu grāmata</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Adresi vai nosaukumu rediģē ar dubultklikšķi</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Izveidot jaunu adresi</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopēt iezīmēto adresi uz starpliktuvi</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Jauna adrese</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Hirocoin 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 type="unfinished"/> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Kopēt adresi</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Parādīt &amp;QR kodu</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Hirocoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Hirocoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Dzēst</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Hirocoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Kopēt &amp;Nosaukumu</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Rediģēt</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation type="unfinished"/> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Eksportēt adreses</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Fails ar komatu kā atdalītāju (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Kļūda eksportējot</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Nevar ierakstīt failā %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Nosaukums</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adrese</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(bez nosaukuma)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Paroles dialogs</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Ierakstiet paroli</translation> </message> <message> <location line="+14"/><|fim▁hole|> <source>New passphrase</source> <translation>Jauna parole</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Jaunā parole vēlreiz</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Ierakstiet maciņa jauno paroli.&lt;br/&gt;Lūdzu izmantojiet &lt;b&gt;10 vai vairāk nejauši izvēlētas zīmes&lt;/b&gt;, vai &lt;b&gt;astoņus un vairāk vārdus&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Šifrēt maciņu</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Lai veikto šo darbību, maciņš jāatslēdz ar paroli.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Atslēgt maciņu</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Šai darbībai maciņš jāatšifrē ar maciņa paroli.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Atšifrēt maciņu</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Mainīt paroli</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Ierakstiet maciņa veco un jauno paroli.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Apstiprināt maciņa šifrēšanu</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR HIROCOINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </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 type="unfinished"/> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Maciņš nošifrēts</translation> </message> <message> <location line="-56"/> <source>Hirocoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your hirocoins from being stolen by malware infecting your computer.</source> <translation>Hirocoin aizvērsies, lai pabeigtu šifrēšanu. Atcerieties, ka maciņa šifrēšana nevar pilnībā novērst bitkoinu zādzību, ko veic datorā ieviesušās kaitīgas programmas.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Maciņa šifrēšana neizdevās</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Maciņa šifrēšana neizdevās programmas kļūdas dēļ. Jūsu maciņš netika šifrēts.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>Ievadītās paroles nav vienādas.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Maciņu atšifrēt neizdevās</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Maciņa atšifrēšanai ievadītā parole nav pareiza.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Maciņu neizdevās atšifrēt</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>Parakstīt &amp;ziņojumu...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Sinhronizācija ar tīklu...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;Pārskats</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Rādīt vispārēju maciņa pārskatu</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Transakcijas</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Skatīt transakciju vēsturi</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Rediģēt saglabātās adreses un nosaukumus</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Rādīt maksājumu saņemšanas adreses</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>&amp;Iziet</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Aizvērt programmu</translation> </message> <message> <location line="+4"/> <source>Show information about Hirocoin</source> <translation>Parādīt informāciju par Hirocoin</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Par &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Parādīt informāciju par Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Iespējas</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>Š&amp;ifrēt maciņu...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Izveidot maciņa rezerves kopiju</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Mainīt paroli</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation type="unfinished"/> </message> <message> <location line="-347"/> <source>Send coins to a Hirocoin address</source> <translation>Nosūtīt bitkoinus uz Hirocoin adresi</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Hirocoin</source> <translation>Mainīt Hirocoin konfigurācijas uzstādījumus</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Izveidot maciņa rezerves kopiju citur</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Mainīt maciņa šifrēšanas paroli</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>&amp;Debug logs</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Atvērt atkļūdošanas un diagnostikas konsoli</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Pārbaudīt ziņojumu...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>Hirocoin</source> <translation type="unfinished"/> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Maciņš</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>&amp;About Hirocoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Sign messages with your Hirocoin addresses to prove you own them</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Hirocoin addresses</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Fails</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Uzstādījumi</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Palīdzība</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Ciļņu rīkjosla</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>Hirocoin client</source> <translation>Hirocoin klients</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Hirocoin network</source> <translation><numerusform>%n aktīvu savienojumu ar Hirocoin tīklu</numerusform><numerusform>%n aktīvs savienojums ar Hirocoin tīklu</numerusform><numerusform>%n aktīvu savienojumu as Hirocoin tīklu</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Error</source> <translation>Kļūda</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Brīdinājums</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+70"/> <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"/> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Sinhronizēts</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Sinhronizējos...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Apstiprināt transakcijas maksu</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Transakcija nosūtīta</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Ienākoša transakcija</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Datums: %1 Daudzums: %2 Tips: %3 Adrese: %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Hirocoin address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Maciņš ir &lt;b&gt;šifrēts&lt;/b&gt; un pašlaik &lt;b&gt;atslēgts&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Maciņš ir &lt;b&gt;šifrēts&lt;/b&gt; un pašlaik &lt;b&gt;slēgts&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Hirocoin can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Tīkla brīdinājums</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Mainīt adrese</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Nosaukums</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>Adrešu grāmatas ieraksta nosaukums</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Adrese</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>Adrese adrešu grāmatas ierakstā. To var mainīt tikai nosūtīšanas adresēm.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Jauna saņemšanas adrese</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Jauna nosūtīšanas adrese</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Mainīt saņemšanas adresi</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Mainīt nosūtīšanas adresi</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Nupat ierakstītā adrese &quot;%1&quot; jau atrodas adrešu grāmatā.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Hirocoin address.</source> <translation>Ierakstītā adrese &quot;%1&quot; nav derīga Hirocoin adrese.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Nav iespējams atslēgt maciņu.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Neizdevās ģenerēt jaunu atslēgu.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Hirocoin-Qt</source> <translation>Hirocoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>versija</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Lietojums:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>komandrindas izvēles</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>Lietotāja interfeisa izvēlnes</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Uzstādiet valodu, piemēram &quot;de_DE&quot; (pēc noklusēšanas: sistēmas lokāle)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Sākt minimizētu</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Uzsākot, parādīt programmas informācijas logu (pēc noklusēšanas: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Iespējas</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Galvenais</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.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>&amp;Maksāt par transakciju</translation> </message> <message> <location line="+31"/> <source>Automatically start Hirocoin after logging in to the system.</source> <translation>Automātiski sākt Hirocoin pēc pieteikšanās sistēmā.</translation> </message> <message> <location line="+3"/> <source>&amp;Start Hirocoin on system login</source> <translation>&amp;Sākt Hirocoin reizē ar sistēmu</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;Tīkls</translation> </message> <message> <location line="+6"/> <source>Automatically open the Hirocoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Uz rūtera automātiski atvērt Hirocoin klienta portu. Tas strādā tikai tad, ja rūteris atbalsta UPnP un tas ir ieslēgts.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Kartēt portu, izmantojot &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Hirocoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Savienoties caur SOCKS proxy:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>Proxy &amp;IP:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>proxy IP adrese (piem. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Ports:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Proxy ports (piem. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS &amp;Versija:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>proxy SOCKS versija (piem. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Logs</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Pēc loga minimizācijas rādīt tikai ikonu sistēmas teknē.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimizēt uz sistēmas tekni, nevis rīkjoslu</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>Logu aizverot, minimizēt, nevis beigt darbu. Kad šī izvēlne iespējota, programma aizvērsies tikai pēc Beigt komandas izvēlnē.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimizēt aizverot</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Izskats</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>Lietotāja interfeiss un &amp;valoda:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Hirocoin.</source> <translation>Šeit var iestatīt lietotāja valodu. Iestatījums aktivizēsies pēc Hirocoin pārstartēšanas.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Vienības, kurās attēlot daudzumus:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Izvēlēties dalījuma vienību pēc noklusēšanas, ko izmantot interfeisā un nosūtot bitkoinus.</translation> </message> <message> <location line="+9"/> <source>Whether to show Hirocoin addresses in the transaction list or not.</source> <translation>Rādīt vai nē Hirocoin adreses transakciju sarakstā.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Attēlot adreses transakciju sarakstā</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Atcelt</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Pielietot</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>pēc noklusēšanas</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Brīdinājums</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Hirocoin.</source> <translation>Iestatījums aktivizēsies pēc Bitkoin pārstartēšanas.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Norādītā proxy adrese nav derīga.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Forma</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Hirocoin network after a connection is established, but this process has not completed yet.</source> <translation>Attēlotā informācija var būt novecojusi. Jūsu maciņš pēc savienojuma izveides automātiski sinhronizējas ar Hirocoin tīklu, taču šis process vēl nav beidzies.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Bilance:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Neapstiprinātas:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Maciņš</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Pēdējās transakcijas&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Jūsu tekošā bilance</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Kopējā apstiprināmo transakciju vērtība, vēl nav ieskaitīta kopējā bilancē</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>nav sinhronizēts</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start hirocoin: click-to-pay handler</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>QR koda dialogs</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Pieprasīt maksājumu</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Daudzums:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Nosaukums:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Ziņojums:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Saglabāt kā...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Kļūda kodējot URI QR kodā.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>Rezultāta URI pārāk garš, mēģiniet saīsināt nosaukumu vai ziņojumu. </translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Saglabāt QR kodu</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG attēli (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Klienta vārds</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"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>N/A</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Klienta versija</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informācija</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Sākuma laiks</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Tīkls</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Savienojumu skaits</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Testa tīklā</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Bloku virkne</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Pašreizējais bloku skaits</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Bloku skaita novērtējums</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Pēdējā bloka laiks</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Atvērt</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the Hirocoin-Qt help message to get a list with possible Hirocoin command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Konsole</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Kompilācijas datums</translation> </message> <message> <location line="-104"/> <source>Hirocoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Hirocoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the Hirocoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Notīrīt konsoli</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Hirocoin RPC console.</source> <translation>Laipni lūgti Hirocoin RPC konsolē.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Izmantojiet bultiņas uz augšu un leju, lai pārvietotos pa vēsturi, un &lt;b&gt;Ctrl-L&lt;/b&gt; ekrāna notīrīšanai.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Ierakstiet &lt;b&gt;help&lt;/b&gt; lai iegūtu pieejamo komandu sarakstu.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Sūtīt bitkoinus</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Sūtīt vairākiem saņēmējiem uzreiz</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Dzēst visus transakcijas laukus</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>&amp;Notīrīt visu</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Bilance:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123,456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Apstiprināt nosūtīšanu</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; līdz %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Apstiprināt bitkoinu sūtīšanu</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Vai tiešām vēlaties nosūtīt %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>un</translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Nosūtāmajai summai jābūt lielākai par 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Daudzums pārsniedz pieejamo.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Kopsumma pārsniedz pieejamo, ja pieskaitīta %1 transakcijas maksa.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Atrastas divas vienādas adreses, vienā nosūtīšanas reizē uz katru adresi var sūtīt tikai vienreiz.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </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>Kļūda: transakcija tika atteikta. Tā var gadīties, ja kāds no maciņā esošiem bitkoiniem jau iztērēts, piemēram, izmantojot wallet.dat kopiju, kurā nav atzīmēti iztērētie bitkoini.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Forma</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>Apjo&amp;ms</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>&amp;Saņēmējs:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</source> <translation type="unfinished"/> </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>Lai pievienotu adresi adrešu grāmatai, tai jādod nosaukums</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Nosaukums:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Izvēlēties adresi no adrešu grāmatas</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>ielīmēt adresi no starpliktuves</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>Dzēst šo saņēmēju</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Hirocoin address (e.g. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</source> <translation>Ierakstiet Hirocoin adresi (piem. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <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 type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>ielīmēt adresi no starpliktuves</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 type="unfinished"/> </message> <message> <location line="+7"/> <source>Signature</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Hirocoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>&amp;Notīrīt visu</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <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 type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Hirocoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Hirocoin address (e.g. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</source> <translation>Ierakstiet Hirocoin adresi (piem. H7QEPyCg1Yv3UZUALDha9bNYXuYbfMe9Lp)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter Hirocoin signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Hirocoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Atvērts līdz %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/neapstiprinātas</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 apstiprinājumu</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Datums</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 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 &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Daudzums</translation> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, vēl nav veiksmīgi izziņots</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>nav zināms</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Transakcijas detaļas</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Šis panelis parāda transakcijas detaļas</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Datums</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Tips</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adrese</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Daudzums</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Atvērts līdz %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Nav pieslēgts (%1 apstiprinājumu)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Nav apstiprināts (%1 no %2 apstiprinājumu)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Apstiprināts (%1 apstiprinājumu)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Neviens cits mezgls šo bloku nav saņēmis un droši vien netiks akceptēts!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Ģenerēts, taču nav akceptēts</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Saņemts ar</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Saņemts no</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Nosūtīts</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Maksājums sev</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Atrasts</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(nav pieejams)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Transakcijas statuss. Turiet peli virs šī lauka, lai redzētu apstiprinājumu skaitu.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Transakcijas saņemšanas datums un laiks.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Transakcijas tips.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Transakcijas mērķa adrese.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Bilancei pievienotais vai atņemtais daudzums.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Visi</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Šodien</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Šonedēļ</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Šomēnes</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Pēdējais mēnesis</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Šogad</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Diapazons...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Saņemts ar</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Nosūtīts</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Sev</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Atrasts</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Cits</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Ierakstiet meklējamo nosaukumu vai adresi</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Minimālais daudzums</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Kopēt adresi</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopēt nosaukumu</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopēt daudzumu</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Mainīt nosaukumu</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Rādīt transakcijas detaļas</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Eksportēt transakcijas datus</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Fails ar komatu kā atdalītāju (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Apstiprināts</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Datums</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Tips</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Nosaukums</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Adrese</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Daudzums</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Eksportēšanas kļūda</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Nevar ierakstīt failā %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Diapazons:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Izveidot maciņa rezerves kopiju</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Maciņa dati (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Rezerves kopēšana neizdevās</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Kļūda, saglabājot maciņu jaunajā vietā.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Hirocoin version</source> <translation>Hirocoin versija</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Lietojums:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or hirocoind</source> <translation>Nosūtīt komantu uz -server vai hirocoind</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Komandu saraksts</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Palīdzība par komandu</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Iespējas:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: hirocoin.conf)</source> <translation>Norādiet konfigurācijas failu (pēc noklusēšanas: hirocoin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: hirocoind.pid)</source> <translation>Norādiet pid failu (pēc noklusēšanas: hirocoind.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Norādiet datu direktoriju</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Uzstādiet datu bāzes bufera izmēru megabaitos (pēc noklusēšanas: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9348 or testnet: 19348)</source> <translation>Gaidīt savienojumus portā &lt;port&gt; (pēc noklusēšanas: 9348 vai testnet: 19348)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Uzturēt līdz &lt;n&gt; savienojumiem ar citiem mezgliem(pēc noklusēšanas: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Pievienoties mezglam, lai iegūtu citu mezglu adreses, un atvienoties</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Norādiet savu publisko adresi</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Slieksnis pārkāpējmezglu atvienošanai (pēc noklusēšanas: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Sekundes, cik ilgi atturēt pārkāpējmezglus no atkārtotas pievienošanās (pēc noklusēšanas: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9347 or testnet: 19347)</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Pieņemt komandrindas un JSON-RPC komandas</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Darbināt fonā kā servisu un pieņemt komandas</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Izmantot testa tīklu</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=hirocoinrpc 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 &quot;Hirocoin Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Hirocoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <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"/> </message> <message> <location line="+4"/> <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"/> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <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"/> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Hirocoin will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <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 type="unfinished"/> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation type="unfinished"/> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Debug izvadei sākumā pievienot laika zīmogu</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the Hirocoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Debug/trace informāciju izvadīt konsolē, nevis debug.log failā</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Debug/trace informāciju izvadīt debug programmai</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>System error: </source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>JSON-RPC savienojumu lietotājvārds</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Brīdinājums</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>JSON-RPC savienojumu parole</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Atļaut JSON-RPC savienojumus no norādītās IP adreses</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Nosūtīt komandas mezglam, kas darbojas adresē &lt;ip&gt; (pēc noklusēšanas: 127.0.0.1)</translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Izpildīt komandu, kad labāk atbilstošais bloks izmainās (%s cmd aizvieto ar bloka hešu)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Atjaunot maciņa formātu uz jaunāko</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Uzstādīt atslēgu bufera izmēru uz &lt;n&gt; (pēc noklusēšanas: 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Atkārtoti skanēt bloku virkni, meklējot trūkstošās maciņa transakcijas</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>JSON-RPC savienojumiem izmantot OpenSSL (https)</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Servera sertifikāta fails (pēc noklusēšanas: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Servera privātā atslēga (pēc noklusēšanas: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Pieņemamie šifri (pēc noklusēšanas: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Šis palīdzības paziņojums</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Nevar pievienoties pie %s šajā datorā (pievienošanās atgrieza kļūdu %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Savienoties caurs socks proxy</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Atļaut DNS uzmeklēšanu priekš -addnode, -seednode un -connect</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Ielādē adreses...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Nevar ielādēt wallet.dat: maciņš bojāts</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Hirocoin</source> <translation>Nevar ielādēt wallet.dat: maciņa atvēršanai nepieciešama jaunāka Hirocoin versija</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Hirocoin to complete</source> <translation>Bija nepieciešams pārstartēt maciņu: pabeigšanai pārstartējiet Hirocoin</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Kļūda ielādējot wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Nederīga -proxy adrese: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>-onlynet komandā norādīts nepazīstams tīkls: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Pieprasīta nezināma -socks proxy versija: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Nevar uzmeklēt -bind adresi: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Nevar atrisināt -externalip adresi: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Nederīgs daudzums priekš -paytxfree=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Nederīgs daudzums</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Nepietiek bitkoinu</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Ielādē bloku indeksu...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Pievienot mezglu, kam pievienoties un turēt savienojumu atvērtu</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Hirocoin is probably already running.</source> <translation>Nevar pievienoties %s uz šī datora. Hirocoin droši vien jau darbojas.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Maksa par KB, ko pievienot nosūtāmajām transakcijām</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Ielādē maciņu...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Nevar maciņa formātu padarīt vecāku</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Nevar ierakstīt adresi pēc noklusēšanas</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Skanēju no jauna...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Ielāde pabeigta</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Izmantot opciju %s</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Kļūda</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Konfigurācijas failā jāuzstāda rpcpassword=&lt;password&gt;: %s Ja fails neeksistē, izveidojiet to ar atļauju lasīšanai tikai īpašniekam.</translation> </message> </context> </TS><|fim▁end|>
<|file_name|>menu.py<|end_file_name|><|fim▁begin|>from django.utils.translation import ugettext_lazy as _<|fim▁hole|>navbar_links_registry = MenuRegistry(_("Navigation Bar Menu"))<|fim▁end|>
from oioioi.base.menu import MenuRegistry
<|file_name|>PrimaryKeyCache.java<|end_file_name|><|fim▁begin|>/***************************************************************************** * * * This file is part of the tna framework distribution. * * Documentation and updates may be get from biaoping.yin the author of * * this framework * * * * Sun Public License Notice: * * * * The contents of this file are subject to the Sun Public License Version * * 1.0 (the "License"); you may not use this file except in compliance with * * the License. A copy of the License is available at http://www.sun.com * * * * The Original Code is tag. The Initial Developer of the Original * * Code is biaoping yin. Portions created by biaoping yin are Copyright * * (C) 2000. All Rights Reserved. * * * * GNU Public License Notice: * * * * Alternatively, the contents of this file may be used under the terms of * * the GNU Lesser General Public License (the "LGPL"), in which case the * * provisions of LGPL are applicable instead of those above. If you wish to * * allow use of your version of this file only under the terms of the LGPL * * and not to allow others to use your version of this file under the SPL, * * indicate your decision by deleting the provisions above and replace * * them with the notice and other provisions required by the LGPL. If you * * do not delete the provisions above, a recipient may use your version of * * this file under either the SPL or the LGPL. * * * * biaoping.yin (yin-bp@163.com) * * * *****************************************************************************/ package com.frameworkset.common.poolman.sql; import java.sql.Connection; import java.util.HashMap; import java.util.Map; import org.apache.log4j.Logger; import com.frameworkset.common.poolman.management.BaseTableManager; /** * 缓冲数据库的主键信息 * * @author biaoping.yin created on 2005-3-29 version 1.0 */ public class PrimaryKeyCache { private static Logger log = Logger.getLogger(PrimaryKeyCache.class); // 数据库链接池名称 private String dbname; // private static PrimaryKeyCache primaryKeyCache; private Map id_tables; /** * 没有在tableinfo中存放主键的信息的表的主键信息用NULL_来替换 */ private static final PrimaryKey NULL_ = new PrimaryKey(); public PrimaryKeyCache(String dbname) { this.dbname = dbname; id_tables = new java.util.concurrent.ConcurrentHashMap(new HashMap()); } // public static PrimaryKeyCache getInstance() // { // if(primaryKeyCache == null) // primaryKeyCache = new PrimaryKeyCache(); // return primaryKeyCache; // } public void addIDTable(PrimaryKey primaryKey) { if (!id_tables.containsKey(primaryKey.getTableName())) id_tables.put(primaryKey.getTableName(), primaryKey); } public PrimaryKey getIDTable(String tableName) { return getIDTable(null,tableName); } public PrimaryKey getIDTable(Connection con,String tableName) { PrimaryKey key = (PrimaryKey) id_tables.get(tableName.toLowerCase()); if (key != null) { if(key == NULL_) return null; return key; } else { key = loaderPrimaryKey(con,tableName); return key; } } /** * @return Returns the dbname. */ public String getDbname() { return dbname; } /** * 动态增加表的主键信息到系统缓冲中 * @param tableName * @return */ public PrimaryKey loaderPrimaryKey(String tableName) { return loaderPrimaryKey(null,tableName); } /** * 动态增加表的主键信息到系统缓冲中 * @param tableName * @return */ public PrimaryKey loaderPrimaryKey(Connection con,String tableName) { try { log.debug("开始装载表【" + tableName +"】的主键信息到缓冲。"); // PrimaryKey key = this.getIDTable(tableName); // if(key != null) // { // System.out.println("表【" + tableName +"】的主键信息已经存在,无需装载!"); // return key; // } PrimaryKey key = BaseTableManager.getPoolTableInfo(dbname,con, tableName); if (key != null) { id_tables.put(key.getTableName().trim().toLowerCase(), key);<|fim▁hole|> } else { id_tables.put(tableName.trim().toLowerCase(),NULL_); log.debug("完成装载表【" + tableName +"】的主键信息,NULL_,"); } return key; } catch (Exception ex) { // ex.printStackTrace(); log.error(ex.getMessage(),ex); } return null; } public void destroy() { if(id_tables != null) { id_tables.clear(); id_tables = null; } } public void reset() { if(id_tables != null) { id_tables.clear(); // id_tables = null; } } }<|fim▁end|>
log.debug("完成装载表【" + tableName +"】的主键信息。");