blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 616 | content_id stringlengths 40 40 | detected_licenses listlengths 0 69 | license_type stringclasses 2 values | repo_name stringlengths 5 118 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 63 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 2.91k 686M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 220 values | src_encoding stringclasses 30 values | language stringclasses 1 value | is_vendor bool 2 classes | is_generated bool 2 classes | length_bytes int64 2 10.3M | extension stringclasses 257 values | content stringlengths 2 10.3M | authors listlengths 1 1 | author_id stringlengths 0 212 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e46865e6e239349fffa18b9574668b6cca909684 | 1515b2047f38a3202c1ab15d5d41809c80709d51 | /0_DataCollection/.ipynb_checkpoints/3_sittings-checkpoint.py | b80076f2f4954997206db5399f91cc733548ebc2 | [
"MIT"
] | permissive | lukas-pkl/explaining_parliamentary_defection | 177b832bf270261dbf7f693d02ce5a79fc0f5fb8 | f53a7fbe1855348d55b0d57b3271b16414e7d3dc | refs/heads/main | 2023-02-28T13:40:29.640082 | 2021-02-13T12:25:37 | 2021-02-13T12:25:37 | 335,680,827 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,785 | py | # -*- coding: utf-8 -*-
"""
Created: 19 06 2019
Edited: 06 02 2021
Author: LukasP
Script collects the parliamentary sittings' data from LRS website
"""
import requests
import time
from tqdm import tqdm
import json
from bs4 import BeautifulSoup
from utils import db_conn
#Read parameters from `CONSTANTS.jsos` file
with open("CONSTANTS.json" , "r") as file :
constants = json.loads( file.read() )
#Initialise/Connect to DB
cnxn, cursor=db_conn( constants["DB_name"])
# Get seesion IDs from DB
query = "SELECT session_id FROM sessions"
cursor.execute(query)
session_ids = [row[0] for row in cursor.fetchall()]
#Call API; Get sittings for each session
xmls = []
sittings_url = "http://apps.lrs.lt/sip/p2b.ad_seimo_posedziai?sesijos_id="
for ids in tqdm(session_ids):
result = requests.get(sittings_url + ids)
xmls.append(result.text)
time.sleep(0.2)
#Parse XMLs; Transfrom data to a list of dicts
data = []
for index, item in enumerate(xmls):
session_id = session_ids[index]
soup = BeautifulSoup(item, "html.parser")
sittings = soup.find_all("seimoposėdis")
for sitting in sittings:
sitting_id = sitting["posėdžio_id"]
sitting_number = sitting["numeris"]
sitting_start_time = sitting["pradžia"]
sitting_end_time = sitting["pabaiga"]
sitting_type = sitting["tipas"]
d ={"sitting_id" : sitting_id,
"sitting_number" : sitting_number,
"sitting_start_time" : sitting_start_time,
"sitting_end_time" : sitting_end_time,
"sitting_type" : sitting_type,
"session_id" : session_id}
data.append(d)
#Create blank sittings table
query1 = "DROP TABLE IF EXISTS sittings"
cursor.execute(query1)
cnxn.commit()
query="""
CREATE TABLE sittings (
id INTEGER PRIMARY KEY AUTOINCREMENT ,
sitting_id TEXT NULL,
sitting_number TEXT NULL,
sitting_start_time TEXT NULL,
sitting_end_time TEXT NULL,
sitting_type TEXT NULL,
session_id TEXT NULL
);
"""
cursor.execute(query)
cnxn.commit()
#Insert Data
query="""INSERT INTO sittings (
sitting_id ,
sitting_number ,
sitting_start_time ,
sitting_end_time ,
sitting_type,
session_id
)
VALUES (?, ?, ?, ?, ?, ?)"""
for item in tqdm(data):
t=(item['sitting_id'],
item['sitting_number'],
item['sitting_start_time'],
item['sitting_end_time'],
item['sitting_type'],
item['session_id'] )
cursor.execute(query, t)
cnxn.commit()
#Close DB connection
cnxn.close()
| [
"lukas.pukelis@ppmi.lt"
] | lukas.pukelis@ppmi.lt |
8bd226b0073ab95598772736794839e0f088bf37 | b365e0a65ce204708b52959f08da0ae7605e69c2 | /python/modules/deep_learning/inference/CFactory.py | 601e0c42d1a3469bc2a4367282d38dc1b20160ea | [
"MIT"
] | permissive | darwinbeing/deepdriving-tensorflow | af500f2caf6ffb9cc1f019fbdb79878e6a468a96 | 036a83871f3515b2c041bc3cd5e845f6d8f7b3b7 | refs/heads/master | 2021-06-26T15:41:18.031684 | 2017-08-23T13:11:37 | 2017-08-23T13:11:37 | 103,213,437 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,889 | py | # The MIT license:
#
# Copyright 2017 Andre Netzeband
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
# to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of
# the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# Note: The DeepDriving project on this repository is derived from the DeepDriving project devloped by the princeton
# university (http://deepdriving.cs.princeton.edu/). The above license only applies to the parts of the code, which
# were not a derivative of the original DeepDriving project. For the derived parts, the original license and
# copyright is still valid. Keep this in mind, when using code from this project.
from ..internal import CBaseFactory
from .CInference import CInference
from .. import helpers
class CFactory(CBaseFactory):
def __init__(self, InferenceClass):
super().__init__(InferenceClass, CInference)
def create(self, Network, Reader, Settings = None):
return self._Class(Network, Reader, Settings) | [
"andre.netzeband@hm.edu"
] | andre.netzeband@hm.edu |
72721e2dfbccc6dececea4c8ac0a61f4e0b841a8 | 11e63e9ad23e46810ed77d1a0eb2483fe7b1794a | /blogCV/settings.py | 0392a5c6e8ec120ad55c9c00d861cbd05ab11fdb | [] | no_license | benblackcake/blogCV | a1ddf416aa8eb4c7f431c4d060c4e06765af3f31 | ed991d039acdea7a9a91fbc491cabca50fa89acf | refs/heads/master | 2022-12-09T12:10:30.683323 | 2019-03-24T14:13:04 | 2019-03-24T14:13:04 | 177,192,509 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,617 | py | """
Django settings for blogCV project.
Generated by 'django-admin startproject' using Django 2.0.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '=c9wf83fp9c=t5zax0%a-uq#t7fciz1a#0s*e=dt3y#&ymp^qp'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'django_filters',
'blog',
'blogPost',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'blogCV.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR),'templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'blogCV.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'blogCV',
'USER': 'mysqldbuser@benchang-mysqldbserver',
'PASSWORD': 'andrewchangcn_An$drew88',
'HOST': 'benchang-mysqldbserver.mysql.database.azure.com',
'PORT': '3306',
'OPTIONS': {
'init_command': "SET foreign_key_checks = 0;"
}
}
}
# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_ROOT=os.path.join(os.path.dirname(BASE_DIR),'blogCV')
TEMPLATE_DIRS = (os.path.join(BASE_DIR, 'blog/templates'),)
| [
"ben.chang@aiesec.net"
] | ben.chang@aiesec.net |
9ab93c832db906fed9e4ff56af7e1ea622bdafa1 | d2a4b10d0e26f8c090df00ca0569ebc913af3e2d | /sample.py | a6819cc6e2d98650069b00c80c7db5e601ff52ec | [] | no_license | anton87andersson/between_two_dates_plugin | e3b61bf2162c241feb48915fc98970d4051755ec | 329b3034218b0c5bf14780a1bfc3b3057dd52fbd | refs/heads/master | 2023-03-19T05:59:20.251543 | 2021-03-10T16:35:29 | 2021-03-10T16:35:29 | 346,420,006 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 252 | py | from between_two_dates_plugin import days_between_two_dates
'''
Sample-file how to use the plugin.
The result will be return as a list.
'''
sample_start = "2021-01-01"
sample_end = "2021-02-02"
print(days_between_two_dates(sample_start, sample_end)) | [
"anton87.andersson@gmail.com"
] | anton87.andersson@gmail.com |
cccc0b1b9e9f7890e02b4cb8c76f155726f79272 | f68af89d67bfcf4e8a81265ae7198b7b3ad8b196 | /csv_utils/__init__.py | 5f534bb941fcfffdf2946af1fe374444fb11ba23 | [
"MIT"
] | permissive | dmorand17/csv_utils | ce1cced5e0563eff2aee14647603cab501404c04 | 32c6cacdcf941480b73f846705b1e84468fdba5b | refs/heads/master | 2021-07-07T01:10:59.712407 | 2020-11-18T17:25:04 | 2020-11-18T17:25:04 | 207,801,275 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 106 | py | #from .csv_handler import CSVHandler
#from .csv_handler import InputDelim
#from .csv_jinja import CSVJinja | [
"doug@commure.com"
] | doug@commure.com |
2c34a90dcbb3d9d2bfbe303918ad6a9bcbdfc0f1 | a0c60d2d6abe51877bbd4a2058925f2fe47d3854 | /main.py | 244ae5e2a7a0af0396fb4403dff6f5813bcad9a0 | [] | no_license | FrankWan27/SnakeAI | 9147a8ce684713fd9c8b74c930d97144d3578eff | 82448edb2d5536041e9d34c81717f1e80343f191 | refs/heads/master | 2022-11-11T14:34:21.868553 | 2020-06-30T17:53:51 | 2020-06-30T17:53:51 | 244,834,089 | 6 | 0 | null | null | null | null | UTF-8 | Python | false | false | 149 | py | import random
import snakeAI as SnakeAI
import sys
random.seed(0)
if len(sys.argv) > 1:
SnakeAI.startGame(sys.argv[1])
else:
SnakeAI.startGame()
| [
"frankwan27@gmail.com"
] | frankwan27@gmail.com |
9c47159651e9c6fdafe463538fc91b52c74619cd | 3f09e77f169780968eb4bd5dc24b6927ed87dfa2 | /src/Problems/Unique_Paths_II.py | 99924d8912f90f3e4316559a40514a8aff937e3d | [] | no_license | zouyuanrenren/Leetcode | ad921836256c31e31cf079cf8e671a8f865c0660 | 188b104b81e6c73792f7c803c0fa025f9413a484 | refs/heads/master | 2020-12-24T16:59:12.464615 | 2015-01-19T21:59:15 | 2015-01-19T21:59:15 | 26,719,111 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,660 | py | '''
Created on 22 Nov 2014
@author: zouyuanrenren
'''
'''
Follow up for "Unique Paths":
Now consider if some obstacles are added to the grids. How many unique paths would there be?
An obstacle and empty space is marked as 1 and 0 respectively in the grid.
For example,
There is one obstacle in the middle of a 3x3 grid as illustrated below.
[
[0,0,0],
[0,1,0],
[0,0,0]
]
The total number of unique paths is 2.
Note: m and n will be at most 100.
'''
'''
The basic idea is still dynamic programming, similar to Unique_Path.
The only difference is to consider the obstacle, the unique path to a obstacle is 0
'''
class Solution:
# @param obstacleGrid, a list of lists of integers
# @return an integer
def uniquePathsWithObstacles(self, obstacleGrid):
matrix = []
row = len(obstacleGrid)
col = len(obstacleGrid[0])
if obstacleGrid[0][0] != 1:
matrix.append([1])
else:
return 0
for i in range(1, col):
if obstacleGrid[0][i] == 0:
matrix[0].append(matrix[0][i-1])
else:
matrix[0].append(0)
for i in range(1, row):
if obstacleGrid[i][0] == 0:
matrix.append([matrix[i-1][0]])
else:
matrix.append([0])
for j in range(1, col):
if obstacleGrid[i][j] == 0:
matrix[i].append(matrix[i-1][j]+matrix[i][j-1])
else:
matrix[i].append(0)
return matrix[row-1][col-1]
matrix = [
[0,0,0],
[0,1,0],
[0,0,0]
]
print Solution().uniquePathsWithObstacles(matrix)
| [
"y.ren@abdn.ac.uk"
] | y.ren@abdn.ac.uk |
d4cd24e7419f0cc2781f01fd9621cf1d12343c45 | d9de0a1ff270ae0b78556af2beaa68c0e171ad07 | /Motion_Generation_Python/switch_electromagnet.py | 521f164d3b06666869381bba2a5b51f63abd8243 | [] | no_license | amank94/ME102B | 971fdc6124febb0b4cd01b1be01feddf9d8fd930 | 8e66f10fb0ebaabfe15c608946321d396524fdf7 | refs/heads/master | 2021-08-22T21:01:49.617531 | 2017-12-01T08:46:58 | 2017-12-01T08:46:58 | 101,688,927 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 55 | py | def switch_electromagnet(state):
GPIO.output(7, state) | [
"32251255+ethanca@users.noreply.github.com"
] | 32251255+ethanca@users.noreply.github.com |
e014de7e7badf81f4bea689e0a0fc068651d7d1b | a806a36cc8f634976a067496cd2a84c7086f703f | /tech-project/tests_app/code/clients/mysql_orm_client/models.py | 0bb6c946981c4eaa82eb3b71c8a8125c83c842a6 | [] | no_license | ElonMax/2020-2-Atom-QA-Python-M-Skorokhodov | cf9594837ac2f7cc06fd815a2e1ada273511705d | fa2ead63fcb8fa196db620c22b4cde153c8fb90c | refs/heads/master | 2023-03-26T08:16:14.617323 | 2021-03-25T07:07:05 | 2021-03-25T07:07:05 | 299,398,789 | 0 | 0 | null | 2021-03-25T07:07:07 | 2020-09-28T18:33:49 | Python | UTF-8 | Python | false | false | 622 | py | from sqlalchemy import Column, String, Integer, DateTime
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class TestUsers(Base):
__tablename__ = 'test_users'
__table_args__ = {'mysql_charset': 'utf8'}
id = Column(Integer, autoincrement=True, primary_key=True)
username = Column(String(16), default=None, unique=True)
password = Column(String(255), nullable=False)
email = Column(String(64), nullable=False, unique=True)
access = Column(Integer, default=None)
active = Column(Integer, default=None)
start_active_time = Column(DateTime, default=None)
| [
"cappukan@gmail.com"
] | cappukan@gmail.com |
b95cf8f40f8137b8a138594b03d4dffc359b4f54 | 45b1b601b11bc299a32aa9eac774a5868809b254 | /calc_demo.py | 16c10692a37108cd2995fea7b20007188b7a9d2e | [] | no_license | L00162772/jenkins-python-demo | 0b5800ad15a0b4683036738790a8e684855661d7 | 0ac568a1b024f8ce1cd5e51a8f05e8644bf3496e | refs/heads/main | 2023-07-10T04:45:46.136142 | 2021-08-19T22:08:07 | 2021-08-19T22:08:07 | 398,085,376 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 175 | py | #!/usr/local/bin/python
num_1 = 2
num_2 = 4
print('{0} + {1} = '.format(num_1, num_2))
print(num_1 + num_2)
print('{0} * {1} = '.format(num_1, num_2))
print(num_1 * num_2)
| [
"noreply@github.com"
] | L00162772.noreply@github.com |
650ae2260d45097b8160c5a8e332d7be6a280eb9 | 33f1c49920201e21adaf794c826148d0330db4a1 | /python/binary search/141_sqrt_x.py | 688a4f77400111f7206db6c0513756dfcec4b3c1 | [] | no_license | zsmountain/lintcode | 18767289566ccef84f9b32fbf50f16b2a4bf3b21 | 09e53dbcf3b3dc2b51dfb343bf77799632efd219 | refs/heads/master | 2020-04-04T21:35:07.740575 | 2019-03-16T20:43:31 | 2019-03-16T20:43:31 | 156,291,884 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 919 | py | '''
Implement int sqrt(int x).
Compute and return the square root of x.
Have you met this question in a real interview?
Example
sqrt(3) = 1
sqrt(4) = 2
sqrt(5) = 2
sqrt(10) = 3
'''
class Solution:
"""
@param x: An integer
@return: The sqrt of x
"""
def sqrt(self, x):
# write your code here
if x < 0:
raise Exception('Invalid Input!')
if x < 2:
return x
start, end = 1, x
while start + 1 < end:
mid = (start + end) // 2
if mid * mid < x:
start = mid
elif mid * mid > x:
end = mid
else:
return mid
if end * end < x:
return end
else:
return start
s = Solution()
print(s.sqrt(2147483647))
print(s.sqrt(3))
print(s.sqrt(4))
print(s.sqrt(5))
print(s.sqrt(10))
| [
"zsmountain27@gmail.com"
] | zsmountain27@gmail.com |
3820c1ebca739ddcbf3a383b1261c29d5ee8035d | 3aed9cf9a6af9a0747d54e2dbf54ee328f4eeb38 | /merge_range_Yi.py | 0a64e608f51d77c9595d2c418f6a3af3cb62c5ae | [] | no_license | guyiyiapply/cs229 | 309121fe2a137d8968683e5e20338e6ecc312f64 | bdc1b93e048ffd2a7e07731897e93c8764fe70da | refs/heads/master | 2020-03-27T12:24:43.576724 | 2018-09-27T20:52:35 | 2018-09-27T20:52:35 | 146,545,049 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,239 | py | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 11 11:46:08 2018
@author: guyia
"""
# given [(0,1),(0,5),(4,8),(10,12),(9,10)]
#return [(0, 8), (9, 12)] like schdele a meeting
#Time complexity: O(nlogn), sorted
#space:O(n)
def mergeranges(meetings):
#sort the meeting with start time
sorted_meetings = sorted(meetings)
#save the first one as a start of the merged meeting range
merged_meetings = [sorted_meetings[0]]
#current_meeting is the one we decide to merge, last is the one already merged
#as initial, the last is the (0,1), the current is (0,5)
for current_meeting_start, current_meeting_end in sorted_meetings[1:]:
last_meeting_start,last_meeting_end = merged_meetings[-1]
#if they have overlap, save the bigger one of two tests
if last_meeting_end >= current_meeting_start:
merged_meetings[-1] = (last_meeting_start,max(current_meeting_end,last_meeting_end))
#no overlap, just append
else:
merged_meetings.append((current_meeting_start,current_meeting_end))
return merged_meetings
print(mergeranges([(0,1),(0,5),(4,8),(10,12),(9,10)]))
| [
"noreply@github.com"
] | guyiyiapply.noreply@github.com |
4663e8bb637ea7f24b8c6adb3a3437b8f73ee561 | 3778075aeec812b6f80d0d25bc12a7d4a0fc4f9b | /delta_home_try.py | 9f8f1a1dbabf5c8d8ebac32375485cf8c9da1bde | [] | no_license | DhanyaRaghu95/green-cluster-scheduling | dbb8af153f446af2231bc03d8433a04696b35b3c | 6f85eb626d26fb2226563caa1de621af9c24b6ed | refs/heads/master | 2020-03-19T01:19:11.377714 | 2018-05-31T05:47:42 | 2018-05-31T05:47:42 | 135,537,101 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,127 | py | import pickle
import math
import threading
import time
machine_dict = {}
threads = []
jobc_obj = pickle.load(open("jobc_obj.p", "r"))
machinec_obj = pickle.load(open("machinec_obj.p", "r"))
machine_allocated = []
all_machine_clusters = [] # holds all the cluster numbers for the machines. [0,1,2]
for mc in machinec_obj:
all_machine_clusters.append(mc)
# print "AMC",all_machine_clusters
'''
free_machines1 = machinec_obj[2]
for i in free_machines1:
machine_dict[i] = []
machine_dict[i].append(0)
'''
machine_dict = dict() # key : mach and val : c No.
for mc in machinec_obj:
for m in machinec_obj[mc]:
machine_dict[m] = mc
job_q = []
clusterwiseTime = dict()
for i in jobc_obj:
job_q.extend(jobc_obj[i])
clusterwiseTime[i] = sum([j.totalTime for j in jobc_obj[i]]) / float(len(jobc_obj[i]))
job_q.sort(key=lambda x: x.getStartTime())
pickle.dump(job_q, open("final_q.p", "wb"))
jobCentroids = pickle.load(open("centroids_job.p", "r"))
machineCentroids = pickle.load(open("centroids_machine.p", "r"))
max_dist_list = []
max_j = 0
max_m = 0
for p, j in enumerate(jobCentroids):
max_dist = 999
for q, m in enumerate(machineCentroids):
dist = math.sqrt(
(j[0] - m[0]) ** 2 + (j[1] - m[1]) ** 2) # ## Euclidean distance - to find dist btw a jobC and a machineC
if dist < max_dist:
max_dist = dist
max_j = j
max_m = m
max_dist_list.append(
[p, q, max_j, max_m]) # ## for each jobC - a machineC is assigned ( along with jobC-id and machineC-id )
# ##
max_dist_list1 = []
jobsMachine = dict()
for p, j in enumerate(jobCentroids): # ## Ratio distance - btw a jobC and machineC
jRatio = j[0] / j[1] # ## ratio - mem : cpu
min_dist = 999
for q, m in enumerate(machineCentroids):
mRatio = m[0] / m[1]
if m[0] >= j[0] and m[1] >= j[1] and (
abs(jRatio - mRatio) < min_dist): # ## !!! what if just ratio is bigger !!!
min_dist = jRatio - mRatio
max_j = j # ##can be put outside inner loop
max_m = m
max_dist_list1.append([p, q, max_j, max_m]) # ## for every jobC
jobsMachine[p] = q
dominates = ""
count = 0
i = 0
done_jobs_count = 1 # CHECK ThiS ONCE
sum_time = 0.0
machine_allocated = []
time_machine_allocation = []
start_time = time.time()
job_machine = dict()
machine_job = dict()
deltaMachines = dict()
job_pending = []
print "DELTA M:", deltaMachines
for job in job_q: # each job is a job object
global deltaMachines
# get the avg running time for all the done jobs
sum_time += (job.endTime - job.startTime)
# print "sum time: ", sum_time
avg_time = sum_time / done_jobs_count # ## can be put outside the loop
# cluster centroid metrics
c_num = job.getClusterNumber()
c_mem = jobCentroids[c_num][0]
c_cpu = jobCentroids[c_num][1]
min_mem = 999
min_cpu = 999
# Select a machine from the machine-cluster assigned to the job-cluster to which the job belongs to
# print jobsMachine[c_num],"HIHI"
free_machines = machinec_obj[jobsMachine[c_num]] # we have machines from that cluster
# print [i.machineID for i in free_machines[:5]]
# exit()
global free_machines
# free_machines_temp = []
# print "a"
temp_delta_machines = deltaMachines
#print "DELTA LEN:",len(list(deltaMachines))
for dm in list(deltaMachines):
if deltaMachines[dm] <= job.startTime:
for k in machine_job[dm]:
#print k.endTime,"$$$$$$$$$$$$$$$",k.jobID
if k.endTime <= job.startTime:
print "############ IN!"
dm.setCurrCpu(dm.getCurrCpu() + k.getCpuUtil())
dm.setCurrMem(dm.getCurrMem() + k.getMemUtil())
temp_delta_machines.pop(dm)
free_machines.append(dm)
## free the resources!
print "DELTA MACHINE FREED"
deltaMachines = temp_delta_machines
# print "b"
# free the resources after completion of the job
global machine_allocated
global machine_job
for i, m in enumerate(machine_allocated):
# m[0] - job, m[1] = mac
del_el = m[0].jobID
if job.startTime > m[0].endTime:
m[1].setCurrCpu(m[1].getCurrCpu() + m[0].getCpuUtil())
m[1].setCurrMem(m[1].getCurrMem() + m[0].getMemUtil())
#print type(m[0]), type(machine_job[m[1]])
print machine_job[m[1]]
print "LEN OF MACHINE JOB 1",len(machine_job[m[1]])
# del_el = m[0].jobID
for k, j in enumerate(machine_job[m[1]]):
if j.jobID == del_el:
print "DELETED!"
del machine_job[m[1]][k]
break
# machine_job[m[1]].remove(m[0]) # freeing the machine of the job completed.
if len(machine_job[m[1]]) > 0:
print "b", m[1], m[0], machine_job[m[1]]
# ##change job_machine also
if m[1] not in free_machines and m[1].cpu == m[1].getCurrCpu and m[1].mem == m[1].getCurrMem:
print "GETTING ADDED TO FREE MACHINES"
free_machines.append(m[1])
# print "c"
mac = None
min_ratio_dist = 999
free_machines_temp = free_machines
for tempMac in free_machines:
if tempMac.getCurrCpu() <= 0 or tempMac.getCurrMem() <= 0:
# print [i.machineID for i in deltaMachines.keys()]
time = []
## not entering
continue
# free_machines_temp.append(tempMac)
# diff_mem = abs(tempMac.getCurrMem() - job.getRemMem()) # mem < 0
# diff_cpu = abs(tempMac.getCurrCpu() - job.getRemCpu())
# ## -ve means they dont have space, should this machine be considered if we are doing only one job to one machine?? ( abs take out! )
# ;;; if 1 job gets many machines, then, in this loop itself keep subtracting resource requrements from the job and keep collecting machines for this job until the requirements are satisfied
if job.getRemCpu() <= 0:
jobRatio = 0
else:
jobRatio = job.getRemMem() / job.getRemCpu()
if tempMac.getCurrCpu <= 0:
machineRatio = tempMac.getCurrMem() / tempMac.getCurrCpu()
else:
machineRatio = 0
if tempMac.getCurrCpu() >= job.getRemCpu() and tempMac.getCurrMem() >= job.getRemMem() and (
abs(jobRatio - machineRatio) < min_ratio_dist):
min_ratio_dist = abs(jobRatio - machineRatio)
mac = tempMac
free_machines_temp.remove(mac)
# print "GETTING ADDED TO DELTA", len(deltaMachines.keys()), tempMac.machineID
deltaMachines[tempMac] = clusterwiseTime[job.getClusterNumber()] + job.startTime
# print "d"
free_machines = free_machines_temp
if mac:
machine_allocated.append([job, mac])
# print "a",job,mac
mac.setCurrCpu(mac.getCurrCpu() - job.getRemCpu())
mac.setCurrMem(mac.getCurrMem() - job.getRemMem())
job_machine[job] = mac # ##keeps track for a job, which machine it got allocated to
if mac in machine_job:
machine_job[mac].append(job) ###keeps track for a machine, all the jobs it has got allocated
else:
machine_job[mac] = [job]
end_time = time.time()
avg_time = sum_time / done_jobs_count
sum_time = sum(time_machine_allocation)
final_time_taken = sum_time # * len(machine_allocated)
print "FINAL: ", final_time_taken
print "COUNT", count
print "AVERAGE TIME:",avg_time
print "TIME END START: ",end_time-start_time
machine_dict_final = {}
"""
for mach in machine_dict:
temp_time = sum_time
time = machine_dict[mach]
temp_time = temp_time - time
machine_dict[mach][0] = temp_time
print "final time taken by machine 0: ", machine_dict
"""
| [
"noreply@github.com"
] | DhanyaRaghu95.noreply@github.com |
581bf352fa4c5a344db7f21115e7a43e8fb465e5 | 9f8230d6cccfb0b854cafccbbeafc7b723aba75c | /ch02/ch03_df.py | c7d34e40ac5719f092f9cdcb6c44409d709d3853 | [] | no_license | RjUst729/CIDM5310 | 68e2d42ed1f806c6e734e2f014586d0a90f5fedc | 2d16b6fe421d6617194f3034dbbf0cd3aa8a7b9c | refs/heads/master | 2023-06-13T05:31:29.402683 | 2021-07-05T02:51:48 | 2021-07-05T02:51:48 | 377,151,241 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 273 | py | import numpy as np
import pandas as pd
df = pd.read_csv('data/earthquakes.csv')
#print(df.empty)
#print(df.shape)
#print(df.head())
#print(df.tail(3))
#print(df.info())
#print(df.describe())
print(df.describe(include=object))
#print(df[['mag', 'title']][100:105])
| [
"rwjustice1@buffs.wtamu.edu"
] | rwjustice1@buffs.wtamu.edu |
6c4cb98af5d594354e9b699ab12c4e3621299e22 | d2f93ff36dc8e4cd4466e228ccf08729ffa0481a | /typeErr.py | 68316118298eb5305f1fe155733e032eda90b345 | [] | no_license | java131313/MyGitHubT | 9dc6b45a1cbfb8a861c91764c016d631a1d8e3ea | bb1ba6e2436d1b7ff1b571a9a7213de4170612d5 | refs/heads/master | 2020-04-15T21:14:51.912989 | 2019-01-11T07:08:34 | 2019-01-11T07:08:34 | 165,026,044 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 136 | py | #-*- coding:utf-8 -*-
print("hello world")
age = 18
print("age的变量里的值是%d"%age)
name = "李怼"
print("姓名是:%s"%name)
| [
"java131313@gmail.com"
] | java131313@gmail.com |
247b4c8efc832cf17b1b0215bfcb79ede8627b6a | d3c850349ef788d1743a8a7ecf2e3d96b54bceb1 | /dashboard/migrations/0001_initial.py | 0c9f43ea9806f492fe2cf7cf3b022a5d8223e41a | [] | no_license | vjhameed/social-analysis-app | 3927b43a64579a083029d80c1cc773d22d0343f3 | 5e82ff82ccd2b209310ad9f67ab663231dbe8145 | refs/heads/master | 2022-12-27T18:45:50.307942 | 2019-04-09T17:07:35 | 2019-04-09T17:07:35 | 176,908,317 | 0 | 0 | null | 2022-05-25T03:13:07 | 2019-03-21T09:05:28 | JavaScript | UTF-8 | Python | false | false | 1,521 | py | # Generated by Django 2.1.5 on 2019-03-08 07:06
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Pagetoken',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('page_access_token', models.CharField(max_length=255)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Project',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=255)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
),
migrations.CreateModel(
name='Usertoken',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('access_token', models.CharField(max_length=255)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
| [
"vjhameed3@gmail.com"
] | vjhameed3@gmail.com |
6588b9fe3061b83e4c1c428f27244a0a784cdca2 | f13350eaf5d84a46d875357c5d0a1dd4139ef1f6 | /venv/bin/easy_install | c8753856ed8049709a3df2c5854626671ad58908 | [] | no_license | lssdeveloper/datafresh | bb07f97d7737133242da30ea99f34527ffce1dcc | 5e1f52afb32188543d1abcde8408e7f130e5d912 | refs/heads/master | 2020-03-18T22:46:08.640515 | 2018-05-29T10:54:30 | 2018-05-29T10:54:30 | 129,455,482 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 258 | #!/home/lserra/datafresh/venv/bin/python3.3
# -*- coding: utf-8 -*-
import re
import sys
from setuptools.command.easy_install import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
| [
"leandro.serra.10@gmail.com"
] | leandro.serra.10@gmail.com | |
3b23e16e50ca0f47fef9667521ed3075d96d58e2 | 1f6212fab177fb8b84258f297928f5d6b97908d4 | /apps/CMDB/model/idc_models.py | 6bce6d2afca8721001a890b7cae21920a613b25d | [] | no_license | logan0709/roe | 9773ca058e017648bc9a9c05abf1597268a9759a | 3f87cfb08471f0e307c08fe0d5de064b4ea8e35b | refs/heads/master | 2020-04-08T22:00:51.851184 | 2018-11-29T10:37:30 | 2018-11-29T10:37:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,986 | py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
IDCType = (
('DX', u'电信'),
('LT', u'联通'),
('YD', u'移动'),
('ZJ', u'自建'),
('BGP', u'BGP')
)
#IDC 机房信息
class Idc(models.Model):
name = models.CharField(u"机房名称", max_length=30, null=True)
type = models.CharField(choices=IDCType, max_length=20, verbose_name=u'机房类型', default='BGP')
address = models.CharField(u"机房地址", max_length=100, null=True,blank=True)
tel = models.CharField(u"机房电话", max_length=30, null=True,blank=True)
contact = models.CharField(u"客户经理", max_length=30, null=True,blank=True)
contact_phone = models.CharField(u"移动电话", max_length=30, null=True,blank=True)
jigui = models.CharField(u"机柜信息", max_length=30, null=True,blank=True)
ip_range = models.CharField(u"IP范围", max_length=30, null=True,blank=True)
bandwidth = models.CharField(u"接入带宽", max_length=30, null=True,blank=True)
start_date = models.DateField(null=True, blank=True, verbose_name=u'租赁日期')
end_date = models.DateField(null=True, blank=True, verbose_name=u'到期日期')
cost = models.CharField(blank=True, max_length=20, verbose_name=u'租赁费用')
def __unicode__(self):
return self.name
class Meta:
db_table=u'IDC'
verbose_name = u'IDC'
verbose_name_plural = verbose_name
class Zone_Assets(models.Model):
zone_name = models.CharField(max_length=100, unique=True)
zone_contact = models.CharField(max_length=100, blank=True, null=True, verbose_name='机房联系人')
zone_number = models.CharField(max_length=100, blank=True, null=True, verbose_name='联系人号码')
zone_network = models.CharField(max_length=100, blank=True, null=True, verbose_name='机房网段')
'''自定义权限'''
class Meta:
db_table = 'opsmanage_zone_assets'
permissions = (
("can_read_zone_assets", "读取机房资产权限"),
("can_change_zone_assets", "更改机房资产权限"),
("can_add_zone_assets", "添加机房资产权限"),
("can_delete_zone_assets", "删除机房资产权限"),
)
verbose_name = '机房资产表'
verbose_name_plural = '机房资产表'
class Line_Assets(models.Model):
line_name = models.CharField(max_length=100, unique=True)
'''自定义权限'''
class Meta:
db_table = 'opsmanage_line_assets'
permissions = (
("can_read_line_assets", "读取出口线路资产权限"),
("can_change_line_assetss", "更改出口线路资产权限"),
("can_add_line_assets", "添加出口线路资产权限"),
("can_delete_line_assets", "删除出口线路资产权限"),
)
verbose_name = '出口线路资产表'
verbose_name_plural = '出口线路资产表'
| [
"flc009@163.com"
] | flc009@163.com |
c3eb725e534fc75e317d57e2c555513424eaded4 | eed0730f0b6b9ef0c424b27f38be5970b12e1d44 | /workfront/workfront.py | f748fa2126b779cf9c4ae8bfb77ba998fb3ab610 | [] | no_license | leqnam/workfront-sdk-pymod | 4836a0ccd2b7d881788cec6e8a1b46f003ecfc0c | 6ba528a5b03131a77705eb08fb919e197bc3658c | refs/heads/master | 2020-06-30T11:09:33.787052 | 2019-08-07T07:04:01 | 2019-08-07T07:04:01 | 200,809,612 | 0 | 0 | null | 2019-10-30T15:41:54 | 2019-08-06T08:29:33 | Python | UTF-8 | Python | false | false | 12,242 | py | from __future__ import absolute_import
from collections import OrderedDict
from requests import session
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
from workfront.exceptions import WFException, raise_if_not_ok
import datetime as dt
from urllib import urlencode as urlencode
class WFEventType:
CREATE = "CREATE"
DELETE = "DELETE"
UPDATE = "UPDATE"
SHARE = "SHARE"
class Workfront(object):
'''
@summary: A workfront service object that is used to interact with the
Workfront API.
Config
======
Having a Workfront service object like :
from workfront.workfront import Workfront
wf = wf = Workfront('myuser@email.com', 'mysecret', 'my.workfront.com')
Some parameters can be configured:
* wf.refresh_session_time : Time in minutes after the session is recycled.
After the given time, and before making another call, the WF service object
will automatically re-login. Default is 25 minutes.
* wf.on_retry_status : List of status on which the WF service object will
retry a call before returnig the error response.
Default value : [500, 401]
* wf.relogin_retries : (integer) number of times that the WF service object
will try to excecute a call after it was failed with an unauthorized(401)
error. After every fail, it will try to re-login before trying again.
Default value is 2
NOTE: There are 2 types of retries:
* relogin retries : when it returns 401, the object will re-login and call
the endpoint again (with new credentials).
This type of retry is affected by *relogin_retries* parameter.
* urllib retries : when requests urllib internally retries after a failure
call. This retry has a backoff policy and it will try 3 times.
This type of retry is affected by *on_retry_status* parameter.
'''
def_wf_domain = "thebridgecorp.my.workfront.com"
ON_RETRY_STATUS = [500, 401]
RELOGIN_RETRIES = 2
def __init__(self, user, passw, wf_domain=def_wf_domain):
'''
@param user: user used to login into WF (probably email)
@param passw: password for the given user
@param wf_domain: domain of the workfront instance. Probably something
like corporation.my.workfront.com
'''
self.refresh_session_time = 25 # in minutes
self.sess = None
self.user = user
self.passw = passw
self._wf_last_connect = dt.datetime.now() - dt.timedelta(weeks=65)
self.sess_id = None
self.url_base = "https://{}/attask/api/v7.0/".format(wf_domain)
self.on_retry_status = self.ON_RETRY_STATUS
self.relogin_retries = self.RELOGIN_RETRIES
def __create_session(self, retries=3):
'''
@return return a tunned request session object with some specific retry
capabilities
'''
ss = session()
retry = Retry(total=retries, read=retries, connect=retries,
backoff_factor=0.2,
status_forcelist=self.on_retry_status,
raise_on_status=False)
adapter = HTTPAdapter(max_retries=retry)
ss.mount('https://', adapter)
return ss
def get_api_url(self):
return self.url_base
@property
def sess(self):
# Force the service to reconnect after refresh_session_time to avoid
# expired sessions
tdiff = dt.datetime.now() - self._wf_last_connect
if tdiff > dt.timedelta(minutes=self.refresh_session_time) or\
self._sess is None:
self.login()
return self._sess
@sess.setter
def sess(self, value):
self._sess = value
def login(self):
'''
@summary: login against the WF API and save the session for future
requests. If there is an active session, logout from it before login in
again.
'''
if self._sess is not None:
self.__logout(self._sess)
ss = self.__create_session()
url = self.url_base + "login?username=%s&password=%s"
r = ss.post(url % (self.user, self.passw))
if r.status_code is not 200:
e = "Could not log in to Workfront: {}".format(r.json())
raise WFException(e)
self.sess_id = r.json()["data"]["sessionID"]
self._wf_last_connect = dt.datetime.now()
ss.headers.update({"SessionID": self.sess_id})
self.sess = ss
def __logout(self, ss):
'''
@summary: Log out from workfront, calling the logout endpoint
@param ss: requests session object
'''
u = self.url_base + "logout"
try:
ss.get(u)
except Exception:
pass
self.sess = None
self.sess_id = None
def logout(self):
'''
@summary: logout, invalidating the current session id
'''
self.__logout(self.sess)
def __should_retry(self, req, relogin_retry):
'''
@return: True if the request should be retried.
@note: This method calls to login, to re-login when it returns True.
@param req: request object that has been made
@param relogin_retry: amount of times that should retry. Or None.
'''
if req.status_code == 401:
if relogin_retry is None:
relogin_retry = self.relogin_retries
if relogin_retry > 0:
self.login()
return True, relogin_retry
return False, 0
def _post(self, url, js, relogin_retry=None):
'''
@param url: url part of the object being posted (not the url base)
@param js: json body to be send
'''
u = self.url_base + url
r = self.sess.post(u, json=js)
should_retry, relogin_retry = self.__should_retry(r, relogin_retry)
if should_retry:
return self._post(url, js, relogin_retry=relogin_retry - 1)
return r
def _put(self, url, js=None, relogin_retry=None):
'''
@param url: url part of the object being put (not the url base)
@param js: dictionary to be send as json body.
'''
u = self.url_base + url
if js is not None:
r = self.sess.put(u, json=js)
else:
r = self.sess.put(u)
should_retry, relogin_retry = self.__should_retry(r, relogin_retry)
if should_retry:
return self._put(url, js, relogin_retry=relogin_retry - 1)
return r
def _get(self, url, relogin_retry=None):
'''
@param url: url part of the object being get (not the url base)
'''
u = self.url_base + url
r = self.sess.get(u)
should_retry, relogin_retry = self.__should_retry(r, relogin_retry)
if should_retry:
return self._get(url, relogin_retry=relogin_retry - 1)
return r
def _delete(self, url, relogin_retry=None):
'''
@param url: url part of the object being put (not the url base)
'''
u = self.url_base + url
r = self.sess.delete(u)
should_retry, relogin_retry = self.__should_retry(r, relogin_retry)
if should_retry:
return self._delete(url, relogin_retry=relogin_retry - 1)
return r
def search_objects(self, obj, param_dict, fields=[], order_by=None,
from_index=None, limit=None):
"""
@summary: Do a search of the objects restricted by the fields given in
the param_dict
@param obj: object code being searched
@param param_dict: dictionary of query strings (key = value)
@param fields: fields being retrieved for the object
@type order_by: OrderedDict
@param order_by: Order by parameters. The order insertion determines
the order by priority.
(default: {"entryDate":"desc"})
Ex: order = OrderedDict()
order["name"] = "asc"
order["entryDate"] = "desc"
the order priority will be: by name asc and then entryDate desc
@type from_index: int
@param from_index: specify the first result index that should be
returned (start at 0)
@type limit: int
@param limit: specify the maximum amount results that should be
returned
@rtype: dict
@return: A dictionary with WF Projects
"""
parameters = param_dict.copy()
if from_index is not None and limit is not None:
parameters.update({"$$FIRST": from_index, "$$LIMIT": limit})
if isinstance(order_by, OrderedDict):
index = 0
for key, value in order_by.iteritems():
index += 1
parameters[key + "_" + str(index) + "_Sort"] = value
url = "%s/search" % obj
if len(parameters) > 0:
# TODO: bug if a parameter contains "&"
qs = ["{}={}".format(k, v) for k, v in parameters.items()]
if len(fields) > 0:
# TODO: bug if a parameter contains "&"
qs.append("fields={}".format(",".join(fields)))
qs = "&".join(qs)
url = url + "?" + qs
return self._get(url)
def count_objects(self, obj, filters):
"""
@summary: Do a count of the objects restricted by the fields given in
the filters dictionary
@param obj: object code being searched
@param filters: dictionary of filter for query
"""
url = "%s/count" % obj
if len(filters) > 0:
qs = urlencode(filters.items())
url = url + "?" + qs
return self._get(url)
def get_object(self, obj, idd, fields=[]):
'''
@param obj: object code being retrieved
@param idd: WF id of the object
@param fields: list of fields being retrieved for the given object. If
not given, the fields retrieved will be the custom one.
'''
url = "%s/%s" % (obj, idd)
if len(fields):
url = url + "?fields=%s" % ",".join(fields)
return self._get(url)
def put_object(self, obj, idd, param_dict={}):
'''
@summary: Do a put object
@param obj: obj code
@param idd: WF id of the object being put
@param param_dict: dictionary of query strings (key = value)
'''
url = "%s/%s" % (obj, idd)
qs = urlencode(param_dict.items())
url = url + "?" + qs
return self._put(url)
def post_object(self, obj, param_dict={}):
'''
@summary: Do a post object
@param obj: obj code
@param param_dict: dictionary of query strings (key = value)
'''
r = self._post(obj, param_dict)
raise_if_not_ok(r, obj)
return r
def action(self, obj, idd, action, param_dict):
'''
@summary: Perform an action for the object given.
@param obj: obj code
@param idd: WF id of the object being put
@param action: action being done for the given object
@param param_dict: dictionary of query strings (key = value)
'''
param_dict["action"] = action
return self.put_object(obj, idd, param_dict)
def bulk_action(self, obj, action, param_dict):
'''
@summary: Perform an action for the object given.
@param obj: obj code
@param action: action being done for the given type of object
@param param_dict: json with fields required by the action
'''
url = "{}?action={}".format(obj, action)
return self._put(url, js=param_dict)
def get_api_key(self):
'''
@summary: Get a Workfront API key.
'''
u = self.url_base + "USER?action=getApiKey&username=%s&password=%s"
u = u % (self.user, self.passw)
return self.sess.put(u).json()["data"]["result"]
def gen_api_key(self):
'''
@summary: Generate a Workfront API key.
'''
u = self.url_base + "USER/generateApiKey?username=%s&password=%s"
u = u % (self.user, self.passw)
return self.sess.put(u).json()["data"]["result"]
| [
"leqnam@live.com"
] | leqnam@live.com |
501d4cf8849c45dc852caa7e9a3fb497fe0a3152 | fe6a130f46707ab6f0fe7b3b753f1fb355d27cc2 | /tasks/start.py | 2e6ba9f575378040bd001a3af1412a55a14369a5 | [
"Apache-2.0"
] | permissive | mistio/amqp-middleware-blueprints | c64f943738e358b62eeaf1efda1f77dea64070fe | de12a535585e2bac28f42e13a33392d6d5f94310 | refs/heads/master | 2021-01-01T19:18:18.836464 | 2017-12-04T18:30:51 | 2017-12-04T18:30:51 | 98,559,885 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 560 | py | from cloudify import ctx
import os
import sys
ctx.download_resource(
os.path.join('tasks', 'utils.py'),
os.path.join(os.path.dirname(__file__), 'utils.py')
)
try:
from utils import SystemController
except ImportError:
sys.path.append(os.path.dirname(__file__))
from utils import SystemController
systemctl = SystemController('amqp-middleware')
systemctl.execute('start')
systemctl.execute('status')
ctx.logger.info('AMQP Middleware is up and running!')
ctx.logger.info('Execute "cfy local outputs" and browse to the returned URL!')
| [
"pollalis.ch@gmail.com"
] | pollalis.ch@gmail.com |
c34d97eb2acbb1dd9c533be3c7abd270ae555e3c | cad941a8189258bb57d6ec218b10c8d38be76799 | /main.py | 111eebcf5aa1cfc259fd99b16cb9b459d350b20a | [] | no_license | iccprashant/desktop-weather-notifier | c555f09d896564384ad54a5ef0959518989075e5 | 95a33f3c724e1911f202604e57abe3cbd0d0e8f3 | refs/heads/master | 2022-12-18T08:42:11.895320 | 2020-09-14T09:47:53 | 2020-09-14T09:47:53 | 295,318,609 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 845 | py | #install and import
#libraries
import requests
from pynotifier import Notification
url = "http://api.openweathermap.org/data/2.5/weather?q="
#enter your city
cityname = ""
#enter your api key
api_key = ''
data = requests.get(url+cityname+'&appid='+api_key).json()
#define
city = data['name']
country = data['sys']['country']
temperature = data['main']['temp_max'] -273.15
weather = data['weather'][0]['main']
wind_speed = float (data['wind']['speed'])
humidity = data['main']['humidity']
pressure = data['main']['pressure']
if data["cod"] != "404":
Notification(
title = city+","+country,
description = f'{temperature},°C {weather}\n Wind Speed {wind_speed}\n Humidity {humidity}\n Pressure {pressure}',
duration= 100,
urgency= Notification.URGENCY_CRITICAL).send()
else:
print("City Not Found !!") | [
"www.thetranquil@gmail.com"
] | www.thetranquil@gmail.com |
39221dbead5fa56ab60b62b790b52637218391a3 | 29b50139faf9703a662a2ef4177018b088f00125 | /main.py | f893deb70b1c7e01735cd4856d1e72a75693d72f | [] | no_license | bstormy40/web-caesar | 254c41259d895a5e708ac47fe3e09882d874f5bb | 62ffd6b1b643d04601f1167deac136cea856f10f | refs/heads/master | 2021-01-18T23:34:08.952445 | 2017-04-03T20:10:11 | 2017-04-03T20:10:11 | 87,116,130 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,077 | py | import webapp2
import caesar
import string
import cgi
def build_page(textarea_content):
rot_label = "<label>Rotate by:</label>"
rotation_input = "<input type='number' name='rotation'/>"
message_label = "<label>Type a message:</label>"
textarea = "<textarea name='message'>" + textarea_content + "</textarea>"
submit = "<input type='submit'/>"
form = ("<form method='post'>" + rot_label + rotation_input + "<br>" + message_label + textarea + "<br>" + submit + "</form>")
header = "<h2>Web Caesar</h2>"
return header + form
class MainHandler(webapp2.RequestHandler):
def get(self):
content = build_page("")
self.response.write(content)
def post(self):
message=self.request.get("message")
rotation = int(self.request.get("rotation"))
encrypted_message = caesar.encrypt(message, rotation)
escaped_message = cgi.escape(encrypted_message)
content = build_page(escaped_message)
self.response.write(content)
app = webapp2.WSGIApplication([
('/', MainHandler)
], debug=True)
| [
"chrx@chrx.com"
] | chrx@chrx.com |
fb7d85d1bd48d9b0deed57d50595f49a229960e3 | 9beaadedbe588ceb51f6f3f2909499d69dd79d2a | /api/migrations/0004_auto_20160904_1214.py | 141146aa3a5843197c7628a51a2505f0584cbfba | [
"Apache-2.0"
] | permissive | kushsharma/GotAPI | 8c348dcdab7363a88107cc0a696fd87c35cb7d2e | d9712550c1498354e75ce1e2d018b9b71a5989ec | refs/heads/master | 2020-12-25T14:14:43.578066 | 2016-09-04T17:17:19 | 2016-09-04T17:17:19 | 67,357,903 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,420 | py | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-04 06:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0003_auto_20160904_1201'),
]
operations = [
migrations.AddField(
model_name='battle',
name='attacker_1',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='attacker_2',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='attacker_3',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='attacker_4',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='attacker_commander',
field=models.CharField(default='null', max_length=150),
),
migrations.AddField(
model_name='battle',
name='attacker_king',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='attacker_outcome',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='attacker_size',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='battle_type',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='defender_1',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='defender_2',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='defender_3',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='defender_4',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='defender_commander',
field=models.CharField(default='null', max_length=150),
),
migrations.AddField(
model_name='battle',
name='defender_king',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='defender_size',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='location',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='major_capture',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='major_death',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='note',
field=models.CharField(default='null', max_length=250),
),
migrations.AddField(
model_name='battle',
name='region',
field=models.CharField(default='null', max_length=50),
),
migrations.AddField(
model_name='battle',
name='summer',
field=models.CharField(default='null', max_length=10),
),
migrations.AlterField(
model_name='battle',
name='id',
field=models.IntegerField(primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='battle',
name='name',
field=models.CharField(default='null', max_length=100),
),
]
| [
"kush.darknight@gmail.com"
] | kush.darknight@gmail.com |
e577ecad7dd739f19d5d4c54911877c6f273475d | cc128e9804ce0cb659421d2b7c98ff4bfbb9d90b | /train_mnist.py | 1b0d31c2e9272ae7e592fb1a42f457db483d3fe7 | [] | no_license | hope-yao/robust_attention | 6beb2de2c3b849c66e79ec71ae81ed127cee3079 | 905a32f02bb8d4709666036f6a6e1f82684f8716 | refs/heads/master | 2020-04-02T08:52:48.430423 | 2018-10-30T00:13:55 | 2018-10-30T00:13:55 | 154,265,498 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,507 | py | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from model_mnist import Model_madry, Model_att, Model_crop
from pgd_attack import *
from viz2 import *
import os
import numpy as np
from pgd_attack import LinfPGDAttack
from utils import creat_dir
from tqdm import tqdm
slim = tf.contrib.slim
def main(cfg):
img_size = cfg['img_size']
batch_size = cfg['batch_size']
num_glimpse = cfg['num_glimpse']
glimpse_size = cfg['glimpse_size']
lr = cfg['lr']
input_images = tf.placeholder(tf.float32,shape=(batch_size, img_size, img_size, 1))
input_label = tf.placeholder(tf.int64,shape=(batch_size))
# build classifier
#model = Model_att(input_images, input_label, glimpse_size, num_glimpse)
# model = Model_madry(input_images, input_label)
model = Model_crop(input_images, input_label)
# setup attacker
attack = LinfPGDAttack(model, epsilon=0.3, k=40, a=0.01, random_start=True, loss_func='xent')
## OPTIMIZER ##
learning_rate = tf.Variable(lr) # learning rate for optimizer
optimizer=tf.train.AdamOptimizer(learning_rate, beta1=0.5)
grads=optimizer.compute_gradients(model.xent)
train_op=optimizer.apply_gradients(grads)
saver = tf.train.Saver()
## training starts ###
FLAGS = tf.app.flags.FLAGS
tfconfig = tf.ConfigProto(
allow_soft_placement=True,
log_device_placement=True,
)
tfconfig.gpu_options.allow_growth = True
sess = tf.Session(config=tfconfig)
init = tf.global_variables_initializer()
sess.run(init)
mnist = input_data.read_data_sets('MNIST_data', one_hot=False)
hist = {'train_acc': [],
'train_adv_acc': [],
'test_acc': [],
'test_adv_acc': [],
'train_loss': [],
'test_loss': [],
'train_adv_loss': [],
'test_adv_loss': []}
train_iters=500000
for itr in tqdm(range(train_iters)):
x_batch_train, y_batch_train = mnist.train.next_batch(batch_size)
x_batch_train_adv = attack.perturb(x_batch_train.reshape(batch_size, img_size, img_size, 1), y_batch_train, sess)
adv_dict_train = {input_images: x_batch_train_adv.reshape(batch_size, img_size, img_size, 1),
input_label: y_batch_train}
nat_dict_train = {input_images: x_batch_train.reshape(batch_size, img_size, img_size, 1),
input_label: y_batch_train}
sess.run(train_op, feed_dict=adv_dict_train)
if itr % 100 == 0:
y_pred, train_loss_i = sess.run([model.y_pred, model.xent], feed_dict=nat_dict_train)
counts = np.asarray([np.argmax(np.bincount(y_pred[:,i])) for i in range(batch_size)])
train_acc_i = np.mean(counts == nat_dict_train[input_label])
x_batch_test, y_batch_test = mnist.test.next_batch(batch_size)
nat_dict_test = {input_images: x_batch_test.reshape(batch_size, img_size, img_size, 1),
input_label: y_batch_test}
y_pred, test_loss_i = sess.run([model.y_pred, model.xent], feed_dict=nat_dict_test)
counts = np.asarray([np.argmax(np.bincount(y_pred[:,i])) for i in range(batch_size)])
test_acc_i = np.mean(counts == nat_dict_test[input_label])
print("iter: {}, train_acc:{} test_acc:{} train_loss:{} test_loss:{} "
.format(itr, train_acc_i, test_acc_i, train_loss_i, test_loss_i))
x_batch_train_adv = attack.perturb(x_batch_train.reshape(batch_size, img_size, img_size, 1), y_batch_train, sess)
adv_dict_train = {input_images: x_batch_train_adv.reshape(batch_size, img_size, img_size, 1),
input_label: y_batch_train}
y_pred, train_adv_loss_i = sess.run([model.y_pred, model.xent], feed_dict=adv_dict_train)
counts = np.asarray([np.argmax(np.bincount(y_pred[:,i])) for i in range(batch_size)])
train_adv_acc_i = np.mean(counts == adv_dict_train[input_label])
x_batch_test_adv = attack.perturb(x_batch_test.reshape(batch_size, img_size, img_size, 1), y_batch_test, sess)
adv_dict_test = {input_images: x_batch_test_adv.reshape(batch_size, img_size, img_size, 1),
input_label: y_batch_test}
y_pred, test_adv_loss_i = sess.run([model.y_pred, model.xent], feed_dict=adv_dict_test)
counts = np.asarray([np.argmax(np.bincount(y_pred[:,i])) for i in range(batch_size)])
test_adv_acc_i = np.mean(counts == adv_dict_test[input_label])
print("iter: {}, train_adv_acc:{} test_adv_acc:{} train_adv_loss:{} test_adv_loss:{} "
.format(itr, train_adv_acc_i, test_adv_acc_i, train_adv_loss_i, test_adv_loss_i))
hist['train_acc'] += [train_acc_i]
hist['train_adv_acc'] += [train_adv_acc_i]
hist['test_acc'] += [test_acc_i]
hist['test_adv_acc'] += [test_adv_acc_i]
hist['train_loss'] += [train_loss_i]
hist['test_loss'] += [test_loss_i]
hist['train_adv_loss'] += [train_adv_loss_i]
hist['test_adv_loss'] += [test_adv_loss_i]
np.save('hist',hist)
saver.save(sess,'crop_ckpt')
print('done')
if __name__ == "__main__":
cfg = {'batch_size': 32,
'img_dim': 2,
'img_size': 28,
'num_glimpse': 5,
'glimpse_size': 20,
'lr': 1e-4
}
main(cfg)
| [
"hope-yao@asu.edu"
] | hope-yao@asu.edu |
0c508135d6bb714cd37dc7b90d89215c6f472f0b | 638a4aec4eeacfda5914057730ee586fe8cc537c | /scrapy_CrawlSpider/youGuoWang/youGuoWang/middlewares.py | 81367760135b21d2fc510c77a3aee5b8d59b9e9f | [] | no_license | aini626204777/spider | 948a7186414be62cbb90e62eb29c2510e0e7ee75 | 841cad4bf84c6e3af98a32f4f33ebda62055680c | refs/heads/master | 2020-03-22T05:23:27.320852 | 2019-02-28T02:16:11 | 2019-02-28T02:16:11 | 139,562,320 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,100 | py | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class YouguowangSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy acts as if the spider middleware does not modify the
# passed objects.
@classmethod
def from_crawler(cls, crawler):
# This method is used by Scrapy to create your spiders.
s = cls()
crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
return s
def process_spider_input(self, response, spider):
# Called for each response that goes through the spider
# middleware and into the spider.
# Should return None or raise an exception.
return None
def process_spider_output(self, response, result, spider):
# Called with the results returned from the Spider, after
# it has processed the response.
# Must return an iterable of Request, dict or Item objects.
for i in result:
yield i
def process_spider_exception(self, response, exception, spider):
# Called when a spider or process_spider_input() method
# (from other spider middleware) raises an exception.
# Should return either None or an iterable of Response, dict
# or Item objects.
pass
def process_start_requests(self, start_requests, spider):
# Called with the start requests of the spider, and works
# similarly to the process_spider_output() method, except
# that it doesn’t have a response associated.
# Must return only requests (not items).
for r in start_requests:
yield r
def spider_opened(self, spider):
spider.logger.info('Spider opened: %s' % spider.name)
class YouguowangDownloaderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy acts as if the downloader middleware does not modify the
# passed objects.
@classmethod
def from_crawler(cls, crawler):
# This method is used by Scrapy to create your spiders.
s = cls()
crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
return s
def process_request(self, request, spider):
# Called for each request that goes through the downloader
# middleware.
# Must either:
# - return None: continue processing this request
# - or return a Response object
# - or return a Request object
# - or raise IgnoreRequest: process_exception() methods of
# installed downloader middleware will be called
return None
def process_response(self, request, response, spider):
# Called with the response returned from the downloader.
# Must either;
# - return a Response object
# - return a Request object
# - or raise IgnoreRequest
return response
def process_exception(self, request, exception, spider):
# Called when a download handler or a process_request()
# (from other downloader middleware) raises an exception.
# Must either:
# - return None: continue processing this exception
# - return a Response object: stops process_exception() chain
# - return a Request object: stops process_exception() chain
pass
def spider_opened(self, spider):
spider.logger.info('Spider opened: %s' % spider.name)
class UserAgentDownloadMiddlerware(object):
def process_request(self,request,spider):
"""
所有的request在交给下载器之前,都会经过这个方法
:param request:
:param spider:
:return:
"""
from fake_useragent import UserAgent
userAgent = UserAgent()
random_ua = userAgent.random
if random_ua:
print('经过了UA中间件',random_ua)
request.headers['User-Agent'] = random_ua | [
"626204777@qq.com"
] | 626204777@qq.com |
09b7c43974c452aa558771ff82d39277a2a70b12 | 56b4021d59f79abdc9d7a3a8a66adcf43fb62645 | /2021/8/solve.py | 6b8f04b3831447e0f9fd887a638aa0ea3628f5f2 | [] | no_license | ConnorJEckert/AOC | fe59a7a10a5365a77f9b60050d1e338b612bf2ee | 605c028000f27f337d61d5db548bdb621560f6ab | refs/heads/master | 2021-12-15T01:33:29.019781 | 2021-12-08T22:30:17 | 2021-12-08T22:30:17 | 225,894,091 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,161 | py |
def decode(s, en):
dlen = {2:1, 4:4, 3:7, 7:8}
dlett = {2:'', 4:'', 3:''}
if dlen.get(len(s)):
return dlen[len(s)]
for d in dlett.keys():
dlett[d] = set([x for x in en if len(x) == d][0])
ss = set(s)
if len(ss) == 6:
if not dlett[2].issubset(ss):
return 6
else:
if dlett[4].issubset(ss):
return 9
else:
return 0
if dlett[2].issubset(ss):
return 3
else:
if len(dlett[4]-ss) == 2:
return 2
else:
return 5
def star1():
with open("input.txt") as fp:
inputs = [x.replace(' | ',' ').split() for x in fp.readlines()]
outputs = sum([x[-4:] for x in inputs],[])
outputs1478 = [x for x in outputs if len(x) != 5 and len(x) != 6]
print(len(outputs1478))
def star2():
with open("input.txt") as fp:
inputs = [x.replace(' | ',' ').split() for x in fp.readlines()]
sum = 0
for num in inputs:
for i in range(4):
sum += decode(num[-i-1],num)*(10**i)
print(sum)
star2() | [
"connor.j.eckert.mil@mail.mil"
] | connor.j.eckert.mil@mail.mil |
18bee3e39997b492a3bb50164a812f1f93977c73 | 754cb00a3ba822983c505b791d867d1fc72d0085 | /media.py | 8f6661eba94e17ee4bab0ba48084e4feaddd0312 | [] | no_license | RadhaBhavaniGowd/ud036_StarterCode | ccfb589dd08a81613cd1e892fa552d3a848230b9 | c023995bad338e4d28747550e696acaa5cae19e9 | refs/heads/master | 2020-03-12T05:47:08.898908 | 2018-04-22T15:30:38 | 2018-04-22T15:30:38 | 130,470,962 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 338 | py | # Movie Class which stores Title, Image Url and Youtube Trailer Url
class Movie():
"""This class provides a way to store movie related information"""
def __init__(self, movie_title, image_url, trailer_url):
self.title = movie_title
self.poster_image_url = image_url
self.trailer_youtube_url = trailer_url
| [
"radha.p@samsung.com"
] | radha.p@samsung.com |
0558d89f2a0fe543a3f573641e48fc56298584ab | cb091db276e611e1eb9694fb97c67c0badf2c8f5 | /book/models.py | 8cf88eede61314582af83f22dfbfa4a9e072deb6 | [] | no_license | maorjuela73/booksapp | 62f3b7fbcd6d5f348c762f2aed3ac0210aad523e | e2a539489e485805c8a329006f9c8275bde61ae8 | refs/heads/master | 2023-01-24T11:40:10.577642 | 2020-11-24T19:53:07 | 2020-11-24T19:53:07 | 315,737,992 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 360 | py | from django.db import models
class Book(models.Model):
name = models.CharField(max_length=50)
picture = models.ImageField()
author = models.CharField(max_length=50, default='No me acuerdo')
email = models.EmailField(blank=True)
describe = models.TextField(default='Libro muy interesante')
def __str__(self):
return self.name
| [
"ma.orjuela73@gmail.com"
] | ma.orjuela73@gmail.com |
59e4c55b2897dd0b53023ff4f9d09f5f2807abb4 | 118c08d9aa40c634e5a23570e4d3d7ee62161d80 | /blog/migrations/0001_initial.py | 6253ea0e6428e292382c6c90bf0010506a14c134 | [] | no_license | anosike-ikenna/suorganiser | 86b63bc838e3f6e6e30282cd90936d6b42c8945f | 57c61b61dab97a8f980cb1f35cfb1e3165321cbc | refs/heads/main | 2023-07-22T18:45:31.959094 | 2021-09-02T11:32:00 | 2021-09-02T11:32:00 | 402,384,117 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,173 | py | # Generated by Django 2.2.3 on 2019-07-11 21:07
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('organiser', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=63)),
('slug', models.SlugField(help_text='A label for URL config.', max_length=63, unique_for_month='pub_date')),
('text', models.TextField()),
('pub_date', models.DateField(auto_now_add=True, verbose_name='date published')),
('startups', models.ManyToManyField(related_name='blog_posts', to='organiser.Startup')),
('tags', models.ManyToManyField(related_name='blog_posts', to='organiser.Tag')),
],
options={
'verbose_name': 'blog post',
'ordering': ['-pub_date', 'title'],
'get_latest_by': 'pub_date',
},
),
]
| [
"anosike212@gmail.com"
] | anosike212@gmail.com |
829235b93de366e3851468e05c0bfb9c2ecbbd6d | 0a36ba4f64a33e983f52139ac3e8e58dc8bfadfb | /venv/bin/easy_install | 09e2b8c29ef7e3e1e30797842df1c578f4e01b43 | [] | no_license | giorgos321/a_small_platform_game | 1997ef3fba74213dba4504e7bdd73f223f7625d5 | 0d43934fe46f7a118eb37a361050f72fa5e1359f | refs/heads/master | 2021-03-23T12:51:46.729256 | 2020-08-29T18:17:21 | 2020-08-29T18:17:21 | 247,455,667 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 439 | #!/home/lame/PycharmProjects/untitled/venv/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.1.0','console_scripts','easy_install'
__requires__ = 'setuptools==39.1.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('setuptools==39.1.0', 'console_scripts', 'easy_install')()
)
| [
"lame.giorgos@gmail.com"
] | lame.giorgos@gmail.com | |
7b31bad1de6c37f144e0dc67290952fd10d7ec0f | 447e9c533733097cc94bebb8aa9bd2a50a14e93a | /src/day14.py | db3de915efab260f86312f0780914f7c9f0fa4e9 | [
"MIT"
] | permissive | johan-eriksson/advent-of-code-2018 | 7c449e0c96e71cc4e2562104547dafa6db7a0767 | b57291ef9aacd78c39814a144385a923c5f37ebb | refs/heads/master | 2021-10-10T11:45:58.523676 | 2019-01-10T14:00:55 | 2019-01-10T14:00:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 987 | py | import pdb
import collections
def rot_right(to, recipes):
return to%len(recipes)
def tick(recipes, elves):
new_recipe = 0
for e in elves:
new_recipe += recipes[e]
str_recipe = str(new_recipe)
for c in str_recipe:
recipes.append(int(c))
for i, e in enumerate(elves):
to = e + recipes[e] + 1
elves[i] = rot_right(to, recipes)
def solve(goal, num_elves):
elves = [n for n in range(num_elves)]
recipes = [3, 7]
while(len(recipes)<goal+10):
tick(recipes, elves)
return recipes
def solvepart1():
goal = 890691
recipes = solve(goal, 2)
ans = "".join(map(str, recipes[goal:goal+10]))
return ans
def solvepart2():
goal = "890691"
goal_len = len(goal)
elves = [n for n in range(2)]
recipes = [3, 7]
checked = 0
while True:
tick(recipes, elves)
while(len(recipes)>goal_len+checked):
if ''.join(map(str, recipes[checked:checked+goal_len]))==goal:
return checked
checked += 1
if __name__=='__main__':
print solvepart1()
print solvepart2()
| [
"imoxus@gmail.com"
] | imoxus@gmail.com |
3a42041f303d1582f30966936a42b62c72a04fab | d2bf9dd996c5345a5fe795a45d13d9e21952a78c | /ex00/first_class.py | a7a4906b31d0205083b7ee817cc42ce56ed73614 | [] | no_license | AVerteC/OOP-Python | df815b0ddc910e1e44b7b50566fbfc45759e8078 | 258f8b4d6a220493ff51b024aa39284d4c4fc6d5 | refs/heads/master | 2020-03-20T22:34:09.783726 | 2018-06-29T21:25:10 | 2018-06-29T21:25:10 | 137,804,785 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 72 | py | class FirstClass:
def __init__(self):
print("Hello World")
| [
"alan.r.chen@gmail.com"
] | alan.r.chen@gmail.com |
b37800cd2a76db5f6141ff890971a44e81db7256 | fd287b82a0ccb142098b671123d3ec84bcd54779 | /app.py | 0a3769324c8d8297abf5d5cb80f2d31ca7e468d9 | [] | no_license | dproctor/visual-qa-streamlit | 803448cbb4bcf4eb2fec46f18bc4468ebf4035a6 | 19445c254a5552a757e45e86b03bba133149c152 | refs/heads/master | 2022-12-20T21:04:42.849797 | 2020-09-29T01:15:06 | 2020-09-29T01:15:06 | 299,470,801 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 3,011 | py | import model
import streamlit as st
import utils
from visualizing_image import SingleImageViz
URL = "https://vqa.cloudcv.org/media/test2014/COCO_test2014_000000262567.jpg"
OBJ_URL = "https://raw.githubusercontent.com/airsplay/py-bottom-up-attention/master/demo/data/genome/1600-400-20/objects_vocab.txt"
ATTR_URL = "https://raw.githubusercontent.com/airsplay/py-bottom-up-attention/master/demo/data/genome/1600-400-20/attributes_vocab.txt"
VQA_URL = "https://raw.githubusercontent.com/airsplay/lxmert/master/data/vqa/trainval_label2ans.json"
# load object, attribute, and answer labels
objids = utils.get_data(OBJ_URL)
attrids = utils.get_data(ATTR_URL)
vqa_answers = utils.get_data(VQA_URL)
@st.cache(allow_output_mutation=True)
def load_model():
return model.Model()
@st.cache(allow_output_mutation=True)
def process_image(url):
# image viz
frcnn_visualizer = SingleImageViz(url, id2obj=objids, id2attr=attrids)
# run frcnn
images, sizes, scales_yx = qa_model.image_preprocess(url)
output_dict = qa_model.cnn(
images,
sizes,
scales_yx=scales_yx,
padding="max_detections",
max_detections=qa_model.config.max_detections,
return_tensors="pt",
)
# add boxes and labels to the image
frcnn_visualizer.draw_boxes(
output_dict.get("boxes"),
output_dict.pop("obj_ids"),
output_dict.pop("obj_probs"),
output_dict.pop("attr_ids"),
output_dict.pop("attr_probs"),
)
# Very important that the boxes are normalized
normalized_boxes = output_dict.get("normalized_boxes")
features = output_dict.get("roi_features")
return {"normalized_boxes": normalized_boxes, "features": features}
st.title("Visual Question Answering")
st.markdown(
"Based on [LXMERT: Learning Cross-Modality Encoder Representations from Transformers (Hao Tan, Mohit Bansal)](https://arxiv.org/abs/1908.07490)"
)
image_url = st.sidebar.text_input("Image url", URL)
if image_url:
st.image(image_url, width=640)
qa_model = load_model()
image_features = process_image(image_url)
# run lxmert
question = st.text_input("Ask a question")
if question and question != "":
inputs = qa_model.tokenizer(
question,
padding="max_length",
max_length=20,
truncation=True,
return_token_type_ids=True,
return_attention_mask=True,
add_special_tokens=True,
return_tensors="pt",
)
output_vqa = qa_model.vqa(
input_ids=inputs.input_ids,
attention_mask=inputs.attention_mask,
visual_feats=image_features["features"],
visual_pos=image_features["normalized_boxes"],
token_type_ids=inputs.token_type_ids,
return_dict=True,
output_attentions=False,
)
# get prediction
pred_vqa = output_vqa["question_answering_score"].argmax(-1)
st.text(vqa_answers[pred_vqa])
| [
"devon.proctor@gmail.com"
] | devon.proctor@gmail.com |
31293892611c10cb6f78d5d022590cb0fd1f5d9c | 56ade096db1fe376ee43d38c96b43651ee07f217 | /326. Power of Three/Python/Solution.py | c065d49b669d5e5476e90c9150b003991cc8f091 | [] | no_license | xiaole0310/leetcode | c08649c3f9a9b04579635ee7e768fe3378c04900 | 7a501cf84cfa46b677d9c9fced18deacb61de0e8 | refs/heads/master | 2020-03-17T05:46:41.102580 | 2018-04-20T13:05:32 | 2018-04-20T13:05:32 | 133,328,416 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 201 | py | class Solution(object):
def isPowerOfThree(self, n):
"""
:type n: int
:rtype: bool
"""
if n <= 0:
return False
return (3 ** 19) % n == 0
| [
"zhantong1994@163.com"
] | zhantong1994@163.com |
d1edf5eddbfe11bfe3e79129267a11560bd4cb23 | 0fc3a883d9c56efb3208baf5bda6669b8c5c28ff | /blog/views.py | fbb11a5f0deb4bfba9f4ba86856bb8e726050564 | [] | no_license | USN484259/mooc_site | 90fcd493d5aa7a1b7ecba785fab094ad7309344d | 52501033e0fdd60bf58219109a0c778c6aaf4cc3 | refs/heads/master | 2020-07-08T08:38:29.394126 | 2019-09-20T01:56:10 | 2019-09-20T01:56:10 | 203,620,827 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,417 | py | from django.shortcuts import render_to_response, get_object_or_404, render,redirect
from django.core.paginator import Paginator
from django.contrib.contenttypes.models import ContentType
from .models import Blog#, BlogType
from .forms import *
from comment.models import Comment
from course.models import *
from user_profile.models import *
from utils import check_user
# def blog_list(request):
# blogs_all_list = Blog.objects.all()
# page_num = request.GET.get('page',1) #获取url的页面参数(GET请求)
# paginator = Paginator(blogs_all_list,10) #每10页进行分页
# page_of_blogs = paginator.get_page(page_num) # 自动识别页码符号以及无效处理
# context = {}
# context['page_of_blogs'] = page_of_blogs
# #context['blog_types'] = BlogType.objects.all()
# context['blogs_count'] = Blog.objects.all().count()
# return render(request, 'blog/blog_list.html', context)
def blog_detail(request, blog_pk):
res=check_user(request)
if res:
return res
blog = get_object_or_404(Blog, pk = blog_pk)
course=blog.reference
#course=get_object_or_404(CourseModel,pk=blog_pk)
if course.teacher!=request.user:
get_object_or_404(SelectionModel,student=request.user,course=course)
blog_content_type = ContentType.objects.get_for_model(blog)
comments = Comment.objects.filter(content_type = blog_content_type, object_id = blog.pk)
context = {}
context['blog'] = blog
context['user'] = request.user
context['comments'] = comments
#response = render(request, 'blog/blog_detail.html', context) # 响应
return render(request, 'blog/blog_detail.html', context)
def blog_course(req,id):
res=check_user(req)
if res:
return res
course=get_object_or_404(CourseModel,pk=id)
if course.teacher!=req.user:
get_object_or_404(SelectionModel,student=req.user,course=course)
blogs=Blog.objects.filter(reference=course)
page_num = req.GET.get('page',1) #获取url的页面参数(GET请求)
paginator = Paginator(blogs,10) #每10页进行分页
page_of_blogs = paginator.get_page(page_num) # 自动识别页码符号以及无效处理
context = {"course":course}
context['page_of_blogs'] = page_of_blogs
#context['blog_types'] = BlogType.objects.all()
context['blogs_count'] = blogs.count()
return render(req,"blog/blog_list.html",context)
def blog_new(req,id):
res=check_user(req)
if res:
return res
course=get_object_or_404(CourseModel,pk=id)
if course.teacher!=req.user:
get_object_or_404(SelectionModel,student=req.user,course=course)
if req.method=="POST":
form=BlogForm(req.POST)
if form.is_valid():
blog=form.save(commit=False)
blog.reference=course
blog.author=req.user
blog.save()
return redirect(blog_detail,blog.pk)
else:
form=BlogForm()
return render(req,"blog/blog_new.html",{"form":form})
# def blogs_with_type(request, blog_type_pk):
# context = {}
# blog_type = get_object_or_404(BlogType, pk = blog_type_pk)
# context['blog_type'] = blog_type
# context['blogs'] = Blog.objects.filter(blog_type = blog_type)
# context['blog_types'] = BlogType.objects.all()
# return render(request, 'blog/blogs_with_type.html', context)
| [
"USN484259@outlook.com"
] | USN484259@outlook.com |
61bcea20d831ee5bb2e6490975fb165d775ffadd | 9567dffdc1a41d60e932b7f07e2ea1af766348ae | /quicksort.py | 4244fc76deb0d1134e8a40bcb4dc79f568783111 | [] | no_license | zengfancy/outbrain | ecdbbd913f95b4c79feef2e4fd85ddfeb4292cb0 | 2cdb3aad3baebba5ab8fd185699fd992f1a995a9 | refs/heads/master | 2020-12-24T12:28:34.114158 | 2016-12-05T10:13:20 | 2016-12-05T10:13:20 | 73,001,843 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,102 | py |
def partition(l, start, end):
pivot = l[end]
bottom = start-1
top = end
done = 0
while not done:
while not done:
bottom = bottom + 1
if bottom == top:
done = 1
break
if l[bottom][0] > pivot[0]:
l[top] = l[bottom]
break
while not done:
top = top - 1
if top == bottom:
done = 1
break
if l[top][0] < pivot[0]:
l[bottom] = l[top]
break
l[top] = pivot
return top
def quicksort(l, start, end):
if start < end:
split = partition(l, start, end)
quicksort(l, start, split - 1)
quicksort(l, split + 1, end)
else:
return
'''
@param result: [[ctr, clicked]....]
'''
def quick_sort(result):
quicksort(result, 0, len(result) - 1)
if __name__ == '__main__':
l = [[0.4, 0], [0.3, 1], [0.8, 0], [0.1, 1], [0.9, 1], [0.6, 0], [0.4, 1], [0.2, 1], [0.7, 0]]
print(l)
quick_sort(l)
print(l)
| [
"zengfancy@126.com"
] | zengfancy@126.com |
d28c6704316729bd44db8199afdad8c93315706c | 71e79cd355fc4a78ed20b92e9c76e35e6c51eb8a | /FLAPPYBIRD/Flappybird.py | 11b60d8fba29a55cac7809e35008ac1d24b170b4 | [] | no_license | Rbr23/FlappyBird | 5512c2f213200c3387436184fcb9f21253fb1e4e | 142593ad41b55a6f9d1338a951ba7b257ada1180 | refs/heads/master | 2023-08-11T09:23:10.618576 | 2021-09-20T15:09:25 | 2021-09-20T15:09:25 | 408,490,174 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,227 | py | import pygame
import os
import random
import neat
ia = True
geracao = 0
LARGURA_T = 500
ALTURA_T = 700
CANO_IMG = pygame.transform.scale2x(pygame.image.load(os.path.join('imgs', 'pipe.png')))
CHAO_IMG = pygame.transform.scale2x(pygame.image.load(os.path.join('imgs', 'base.png')))
BACKGROUD_IMG = pygame.transform.scale2x(pygame.image.load(os.path.join('imgs', 'bg.png')))
PASSARO_IMG = [
pygame.transform.scale2x(pygame.image.load(os.path.join('imgs', 'bird1.png'))),
pygame.transform.scale2x(pygame.image.load(os.path.join('imgs', 'bird2.png'))),
pygame.transform.scale2x(pygame.image.load(os.path.join('imgs', 'bird3.png'))),
]
pygame.font.init()
PONTOS_FONTE = pygame.font.SysFont('arial', 50)
class Cano:
DISTANCIA = 200
VELOCIDADE = 5
def __init__(self, x):
self.x = x
self.altura = 0
self.pos_topo = 0
self.pos_base = 0
self.CANO_TOPO = pygame.transform.flip(CANO_IMG, False, True)
self.CANO_BASE = CANO_IMG
self.passou = False
self.definir_altura()
def definir_altura(self):
self.altura = random.randrange(50, 450)
self.pos_topo = self.altura - self.CANO_TOPO.get_height()
self.pos_base = self.altura + self.DISTANCIA
def mover(self):
self.x -= self.VELOCIDADE
def desenhar(self, tela):
tela.blit(self.CANO_TOPO, (self.x, self.pos_topo))
tela.blit(self.CANO_BASE, (self.x, self.pos_base))
def colidir(self, passaro):
passaro_mask = passaro.get_mask()
topo_mask = pygame.mask.from_surface(self.CANO_TOPO)
base_mask = pygame.mask.from_surface(self.CANO_BASE)
distancia_topo = (self.x - passaro.x, self.pos_topo - round(passaro.y))
distancia_base = (self.x - passaro.x, self.pos_base - round(passaro.y))
topo_ponto = passaro_mask.overlap(topo_mask, distancia_topo)
base_ponto = passaro_mask.overlap(base_mask, distancia_base)
if base_ponto or topo_ponto:
return True
else:
return False
class Passaro :
IMGS = PASSARO_IMG
#animações da rotação
ROTACAO_MAXIMA = 25
VELOCIDADE_ROTACAO = 20
TEMPO_ANIMACAO = 5
def __init__(self, x, y):
self.x = x
self.y = y
self.angulo = 0
self.velocidade = 0
self.altura = self.y
self.tempo = 0
self.imagem_contagem = 0
self.imagem = self.IMGS[0]
def pular(self):
self.velocidade = -10.5
self.tempo = 0
self.altura = self.y
def mover(self):
#calcular o deslocamento
self.tempo += 1
deslocamento = 1.5 * (self.tempo**2) + self.velocidade * self.tempo
#restringir o deslocamento
if deslocamento > 16:
deslocamento = 16
elif deslocamento < 0:
deslocamento -= 2
self.y += deslocamento
# o angulo do pássaro
if deslocamento < 0 or self.y < (self.altura + 50):
if self.angulo < self.ROTACAO_MAXIMA:
self.angulo = self.ROTACAO_MAXIMA
else:
if self.angulo > -90:
self.angulo -= self.VELOCIDADE_ROTACAO
def desenhar(self, tela):
# definir imagem do pássaro que vai usar
self.imagem_contagem += 1
if self.imagem_contagem < self.TEMPO_ANIMACAO:
self.imagem = self.IMGS[0]
elif self.imagem_contagem < self.TEMPO_ANIMACAO*2:
self.imagem = self.IMGS[1]
elif self.imagem_contagem < self.TEMPO_ANIMACAO*3:
self.imagem = self.IMGS[2]
elif self.imagem_contagem < self.TEMPO_ANIMACAO*4:
self.imagem = self.IMGS[1]
elif self.imagem_contagem >= self.TEMPO_ANIMACAO*4 + 1:
self.imagem = self.IMGS[0]
self.imagem_contagem = 0
# se o pássaro estiver caindo, não vou bater asa
if self.angulo <= -80:
self.imagem = self.IMGS[1]
self.contagem_imagem = self.TEMPO_ANIMACAO*2
# desenhar a imagem
imagem_rotacionada = pygame.transform.rotate(self.imagem, self.angulo)
pos_centro_imagem = self.imagem.get_rect(topleft=(self.x, self.y)).center
retangulo = imagem_rotacionada.get_rect(center=pos_centro_imagem)
tela.blit(imagem_rotacionada, retangulo.topleft)
def get_mask(self):
return pygame.mask.from_surface(self.imagem)
class Chao:
VELOCIDADE = 5
LARGURA = CHAO_IMG.get_width()
IMAGEM = CHAO_IMG
def __init__(self, y):
self.y = y
self.x1 = 0
self.x2 = self.LARGURA
def mover(self):
self.x1 -= self.VELOCIDADE
self.x2 -= self.VELOCIDADE
if self.x1 + self.LARGURA < 0:
self.x1 = self.x2 + self.LARGURA
if self.x2 + self.LARGURA < 0:
self.x2 = self.x1 + self.LARGURA
def desenhar(self, tela):
tela.blit(self.IMAGEM, (self.x1, self.y))
tela.blit(self.IMAGEM, (self.x2, self.y))
def criar_tela(tela, passaros, canos, chao, pontos):
tela.blit(BACKGROUD_IMG, (0, 0))
for passaro in passaros:
passaro.desenhar(tela)
for cano in canos:
cano.desenhar(tela)
texto = PONTOS_FONTE.render(f"Pontuação: {pontos}", 1, (255, 255, 255))
tela.blit(texto, (LARGURA_T - 10 - texto.get_width(), 10))
if ia:
texto = PONTOS_FONTE.render(f"Geração: {geracao}", 1, (255, 255, 255))
tela.blit(texto, (10, 10))
chao.desenhar(tela)
pygame.display.update()
def main(genomas, config):
global geracao
geracao += 1
if ia:
redes = []
listas_genomas = []
passaros = []
for _, genoma in genomas:
rede = neat.nn.FeedForwardNetwork.create(genoma, config)
redes.append(rede)
genoma.fitness = 0
listas_genomas.append(genoma)
passaros.append(Passaro(130, 150))
else:
passaros = [Passaro(130, 150)]
chao = Chao(630)
canos = [Cano(600)]
tela = pygame.display.set_mode((LARGURA_T, ALTURA_T))
pontos = 0
relogio = pygame.time.Clock()
rodando = True
while rodando:
relogio.tick(30)
#interação com o usuário
for evento in pygame.event.get():
if evento.type == pygame.QUIT:
rodando = False
pygame.quit()
quit()
if not ia:
if evento.type == pygame.KEYDOWN:
if evento.key == pygame.K_SPACE:
for passaro in passaros:
passaro.pular()
indice_cano = 0
if len(passaros) > 0:
if len(canos) > 1 and passaros[0].x > (canos[0].x + canos[0].CANO_TOPO.get_width()):
indice_cano = 1
else:
rodando = False
break
#mover as coisas
for i, passaro in enumerate(passaros):
passaro.mover()
listas_genomas[i].fitness += 0.1
output = redes[i].activate((passaro.y,
abs(passaro.y - canos[indice_cano].altura),
abs(passaro.y - canos[indice_cano].pos_base)))
if output[0] > 0.5:
passaro.pular()
chao.mover()
adicionar_cano = False
remover_canos = []
for cano in canos:
for i, passaro in enumerate(passaros):
if cano.colidir(passaro):
passaros.pop(i)
if ia:
listas_genomas[i].fitness -= 1
listas_genomas.pop(i)
redes.pop(i)
if not cano.passou and passaro.x > cano.x:
cano.passou = True
adicionar_cano = True
cano.mover()
if cano.x + cano.CANO_TOPO.get_width() < 0:
remover_canos.append(cano)
if adicionar_cano:
pontos += 1
canos.append(Cano(600))
for genoma in listas_genomas:
genoma.fitness += 5
for cano in remover_canos:
canos.remove(cano)
for i, passaro in enumerate(passaros):
if(passaro.y + passaro.imagem.get_height())>chao.y or passaro.y < 0:
passaros.pop(i)
if ia:
listas_genomas.pop(i)
redes.pop(i)
criar_tela(tela, passaros, canos, chao, pontos)
def rodar(caminho_config):
config = neat.config.Config(neat.DefaultGenome,
neat.DefaultReproduction,
neat.DefaultSpeciesSet,
neat.DefaultStagnation,
caminho_config)
populacao = neat.Population(config)
populacao.add_reporter(neat.StdOutReporter(True))
populacao.add_reporter(neat.StatisticsReporter())
if ia:
populacao.run(main, 50)
else:
main(None, None)
if __name__ == '__main__':
caminho = os.path.dirname(__file__)
caminho_config = os.path.join(caminho, 'config.txt')
rodar(caminho_config) | [
"roberto.ribeiro@al.infnet.edu.br"
] | roberto.ribeiro@al.infnet.edu.br |
c321ff81f92bb3395f0e4dba6fc0c8587be08646 | b1cdbb08b51ce0edfc97351ea07f10166624e5cc | /src/rocks-pylib/rocks/commands/dump/appliance/attr/__init__.py | 6c6ac6efa9a4ddd893b4f02fb1a4175d1e36d338 | [] | no_license | tcooper/core | 2453220bdc305a4532fd6f0bda9fdb22560add21 | 61d2512146f34f71d09f817a3d07a56c979d1bf9 | refs/heads/master | 2021-08-22T17:17:20.080481 | 2017-11-30T19:33:53 | 2017-11-30T19:33:53 | 105,914,127 | 0 | 0 | null | 2017-10-05T16:32:48 | 2017-10-05T16:32:48 | null | UTF-8 | Python | false | false | 4,555 | py | # $Id: __init__.py,v 1.9 2012/11/27 00:48:14 phil Exp $
#
# @Copyright@
#
# Rocks(r)
# www.rocksclusters.org
# version 6.2 (SideWindwer)
# version 7.0 (Manzanita)
#
# Copyright (c) 2000 - 2017 The Regents of the University of California.
# 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 unmodified and in its entirety, this list of conditions and the
# following disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# 3. All advertising and press materials, printed or electronic, mentioning
# features or use of this software must display the following acknowledgement:
#
# "This product includes software developed by the Rocks(r)
# Cluster Group at the San Diego Supercomputer Center at the
# University of California, San Diego and its contributors."
#
# 4. Except as permitted for the purposes of acknowledgment in paragraph 3,
# neither the name or logo of this software nor the names of its
# authors may be used to endorse or promote products derived from this
# software without specific prior written permission. The name of the
# software includes the following terms, and any derivatives thereof:
# "Rocks", "Rocks Clusters", and "Avalanche Installer". For licensing of
# the associated name, interested parties should contact Technology
# Transfer & Intellectual Property Services, University of California,
# San Diego, 9500 Gilman Drive, Mail Code 0910, La Jolla, CA 92093-0910,
# Ph: (858) 534-5815, FAX: (858) 534-7345, E-MAIL:invent@ucsd.edu
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
#
# @Copyright@
#
# $Log: __init__.py,v $
# Revision 1.9 2012/11/27 00:48:14 phil
# Copyright Storm for Emerald Boa
#
# Revision 1.8 2012/05/06 05:48:23 phil
# Copyright Storm for Mamba
#
# Revision 1.7 2011/07/23 02:30:28 phil
# Viper Copyright
#
# Revision 1.6 2010/09/15 18:45:23 bruno
# don't yak if an attribute doesn't have a value. and if an attribute doesn't
# have a value, then don't dump it.
#
# Revision 1.5 2010/09/07 23:52:52 bruno
# star power for gb
#
# Revision 1.4 2009/11/18 23:34:49 bruno
# cleanup help section
#
# Revision 1.3 2009/06/19 21:07:28 mjk
# - added dumpHostname to dump commands (use localhost for frontend)
# - added add commands for attrs
# - dump uses add for attr (does not overwrite installer set attrs)A
# - do not dump public or private interfaces for the frontend
# - do not dump os/arch host attributes
# - fix various self.about() -> self.abort()
#
# Revision 1.2 2009/05/01 19:06:56 mjk
# chimi con queso
#
# Revision 1.1 2008/12/23 00:14:05 mjk
# - moved build and eval of cond strings into cond.py
# - added dump appliance,host attrs (and plugins)
# - cond values are typed (bool, int, float, string)
# - everything works for client nodes
# - random 80 col fixes in code (and CVS logs)
#
import sys
import socket
import rocks.commands
import string
class Command(rocks.commands.dump.appliance.command):
"""
Dump the set of attributes for appliances.
<arg optional='1' type='string' name='appliance'>
Name of appliance
</arg>
<example cmd='dump appliance attr compute'>
List the attributes for compute appliances
</example>
"""
def run(self, params, args):
for appliance in self.newdb.getApplianceNames(args):
for attr in self.newdb.getCategoryAttrs('appliance', appliance.name):
v = self.quote(attr.value)
if v:
self.dump('add appliance attr %s %s %s'
% (appliance.name, attr.attr, v))
| [
"ppapadopoulos@ucsd.edu"
] | ppapadopoulos@ucsd.edu |
2e21a7b0ef29b525bf0e8862398fb730784ead92 | 911193aef851ab2ec7827e3eca4764ee712dcc2c | /test/path_test.py | de391d1831a0f58c72626c2b2ee42a6180898d02 | [
"MIT"
] | permissive | tsolakidis/gluish | 2c1e213bc6580c2e829782071b51968360942e51 | 19b513f2ad3adb38dc094cbe2f057bb2edaca78e | refs/heads/master | 2020-12-13T23:31:07.611041 | 2015-06-17T16:54:20 | 2015-06-17T16:54:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,929 | py | # coding: utf-8
from gluish.path import (unlink, size_fmt, wc, filehash, touch, which,
findfiles, fileage, copyregions, random_tmp_path)
import unittest
import tempfile
import os
import stat
import errno
class PathTest(unittest.TestCase):
def test_unlink(self):
""" Should not raise any exception on non-existent file. """
path = tempfile.mktemp()
self.assertFalse(os.path.exists(path))
exception_raised = False
try:
os.unlink(path)
except OSError as err:
exception_raised = True
self.assertEquals(errno.ENOENT, err.errno)
self.assertTrue(exception_raised)
exception_raised = False
try:
unlink(path)
except Exception as exc:
exception_raised = True
self.assertFalse(exception_raised)
def test_size_fmt(self):
self.assertEquals('1.0b', size_fmt(1))
self.assertEquals('1.0K', size_fmt(1024 ** 1))
self.assertEquals('1.0M', size_fmt(1024 ** 2))
self.assertEquals('1.0G', size_fmt(1024 ** 3))
self.assertEquals('1.0T', size_fmt(1024 ** 4))
self.assertEquals('1.0P', size_fmt(1024 ** 5))
self.assertEquals('1.0E', size_fmt(1024 ** 6))
self.assertEquals('1023.0b', size_fmt(1023))
self.assertEquals('184.7G', size_fmt(198273879123))
def test_wc(self):
with tempfile.NamedTemporaryFile(delete=False) as handle:
handle.write('Line 1\n')
handle.write('Line 2\n')
handle.write('Line 3\n')
self.assertEquals(3, wc(handle.name))
def test_filehash(self):
with tempfile.NamedTemporaryFile(delete=False) as handle:
handle.write('0123456789\n')
self.assertEquals('3a30948f8cd5655fede389d73b5fecd91251df4a',
filehash(handle.name))
def test_touch(self):
path = tempfile.mktemp()
self.assertFalse(os.path.exists(path))
touch(path)
self.assertTrue(os.path.exists(path))
def test_which(self):
self.assertTrue(which('ls') is not None)
self.assertTrue(which('ls').endswith('bin/ls'))
self.assertTrue(which('veryunlikely1234') is None)
def test_findfiles(self):
directory = tempfile.mkdtemp()
subdir = tempfile.mkdtemp(dir=directory)
touch(os.path.join(directory, '1.jpg'))
touch(os.path.join(subdir, '2-1.txt'))
touch(os.path.join(subdir, '2-2.txt'))
pathlist = sorted(list(findfiles(directory)))
self.assertEquals(3, len(pathlist))
self.assertEquals(['1.jpg', '2-1.txt', '2-2.txt'],
map(os.path.basename, pathlist))
self.assertEquals('{0}/1.jpg'.format(directory), pathlist[0])
self.assertEquals('{0}/2-1.txt'.format(subdir), pathlist[1])
self.assertEquals('{0}/2-2.txt'.format(subdir), pathlist[2])
pathlist = list(findfiles(directory, fun=lambda path: path.endswith('jpg')))
self.assertEquals(1, len(pathlist))
self.assertEquals('{0}/1.jpg'.format(directory), pathlist[0])
def test_fileage(self):
""" Assume we can `touch` within 2000ms. """
path = tempfile.mktemp()
self.assertFalse(os.path.exists(path))
touch(path)
self.assertTrue(os.path.exists(path))
self.assertTrue(0 < fileage(path) < 2)
def test_copyregions(self):
with tempfile.NamedTemporaryFile(delete=False) as handle:
handle.write('0123456789\n')
with open(handle.name) as src:
with tempfile.NamedTemporaryFile(delete=False) as dst:
copyregions(src, dst, [(3, 2)])
with open(dst.name) as handle:
self.assertEquals("34", handle.read())
def test_random_tmp_path(self):
path = random_tmp_path()
self.assertEquals(23, len(os.path.basename(path)))
| [
"martin.czygan@gmail.com"
] | martin.czygan@gmail.com |
4c0f18d348e88d197d5493b644f23756d160e822 | 29c04332964b171d397bdb62aad6fb3491dbb088 | /src/sales/models.py | 4045a9ee025ede77e51b76c38e0997811b39365c | [] | no_license | TodorToshev/Djano-Sales-Report-App | a1db838ddb8ecda83663b77b55ed03c3761a1748 | a8e695c503bdc7e4f917c77fd37a598dcf57c004 | refs/heads/main | 2023-07-10T10:03:48.004025 | 2021-08-24T16:29:03 | 2021-08-24T16:29:03 | 394,754,590 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,072 | py | from sales.utils import generate_code
from profiles.models import Profile
from django.db import models
from products.models import Product
from customers.models import Customer
from django.utils import timezone
from django.shortcuts import reverse
# Create your models here.
class Position(models.Model):
product = models.ForeignKey(Product, on_delete=models.CASCADE)
quantity = models.PositiveIntegerField()
price = models.FloatField(blank=True)
created = models.DateTimeField(blank=True)
def __str__(self):
return f"id: {self.id}, product: {self.product.name}, quantity: {self.quantity}"
def save(self, *args, **kwargs):
self.price = self.product.price * self.quantity
return super().save(*args, **kwargs)
def get_sales_id(self):
sale_obj = self.sale_set.first()
return sale_obj.id
class Sale(models.Model):
transaction_id = models.CharField(max_length=12, blank=True)
positions = models.ManyToManyField(Position)
total_price = models.FloatField(blank=True, null=True)
customer = models.ForeignKey(Customer, on_delete=models.CASCADE)
salesman = models.ForeignKey(Profile, on_delete=models.CASCADE)
created = models.DateTimeField(blank=True)
updated = models.DateTimeField(auto_now=True)
def __str__(self):
return f"Sales for the amount of {self.total_price}"
def save(self, *args, **kwargs):
if self.transaction_id == "":
self.transaction_id = generate_code()
if self.created is None:
self.crated = timezone.now()
return super().save(*args, **kwargs)
def get_positions(self):
return self.positions.all()
def get_absolute_url(self):
return reverse("sales:detail", kwargs={'pk': self.pk})
class CSV(models.Model):
file_name = models.FileField(upload_to="csvs")
activated = models.BooleanField(default=False)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
def __str__(self):
return self.file_name
| [
"t.toshev95@gmail.com"
] | t.toshev95@gmail.com |
0264c17eab58426d488eb8d9162610f5733a8445 | fcbddb18a15d01566d08659e979d1d2c6b6d4a61 | /chapter_10/ques2.py | a89b3cf34f0313a0d73a480968fea7ecf1b9a894 | [] | no_license | IshitaSharma3101/Python | 17afe4ea5f1e4b52bcd7f2af4b95f6165369121f | 83d95f90e4b1dfa80fa81b2de4bc77b6ffb862a0 | refs/heads/main | 2023-07-02T23:43:19.122499 | 2021-08-06T21:24:52 | 2021-08-06T21:24:52 | 381,369,717 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 321 | py | class Calculator:
def __init__(self, n):
self.num = n
def square(self):
print(f"Square is {self.num **2}")
def squareRoot(self):
print(f"Square root is {self.num **0.5}")
def cube(self):
print(f"Cube is {self.num **3}")
a = Calculator(25)
a.square()
a.squareRoot()
a.cube() | [
"72185572+IshitaSharma3101@users.noreply.github.com"
] | 72185572+IshitaSharma3101@users.noreply.github.com |
868c1789bc6bc77c91840dc6e12b566bb2534ce2 | 2dbcea415ce05b32514e7c67dc8131cce32dfb13 | /rpi/testMotion/tilt_sweep.py | 8b8127f470dc7a8750ae12698f3e3b29f7b0b526 | [] | no_license | WeiXie03/quiXtinguish | f881ce6df2e15c6adffa2e6616998b7cb1061789 | 54f217a8969afa2aafb3b8bf158fc2e232670743 | refs/heads/master | 2022-04-29T20:46:34.624528 | 2022-04-08T03:09:38 | 2022-04-08T03:09:38 | 169,194,910 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 559 | py | import pigpio as pig
import testServo as servo
from time import sleep
def sweep(servo):
print('turning')
servo.turn(90.0)
sleep(0.5)
servo.turn(120.0)
sleep(0.5)
if __name__ == "__main__":
pi = pig.pi()
PIN = int(input('Enter the RPi pin number the servo is connected to according to Broadcom\'s numbering.\t'))
FREQUENCY = 72
tilt = servo.Servo(pi, PIN, FREQUENCY, min_bound=650, max_bound=1140)
tilt.close()
try:
sweep(tilt)
finally:
print('ending')
tilt.close()
pi.stop()
| [
"wei.tom.xie@gmail.com"
] | wei.tom.xie@gmail.com |
f6171dc1f166c4cd9ff4f0b36b306a411c732578 | 6dc04a9889d5b83e1335431a644325235e4102f7 | /wallGui/__init__.py | f8b14becc563aa921dc061ea643910ff7be189c9 | [
"MIT"
] | permissive | Jelloeater/forgeLandWallGUI | c7790f10a105927f083ebe8aba9cf6d5f86b5e48 | 4fa0d436377f84971279fee21cb935e2d6e59095 | refs/heads/master | 2020-03-30T17:15:30.307402 | 2014-06-15T18:15:57 | 2014-06-15T18:15:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 20 | py | __author__ = 'Jesse' | [
"jelloeater@gmail.com"
] | jelloeater@gmail.com |
f3b978edc5a1825ce40e6be943823819d557c71a | 5b21010a60849b173f19e5a35eb3b1be425902cb | /meeting/views/pilot.py | c975f71a7fb04cc766b7c2853da36c5cf3cefd60 | [
"MIT"
] | permissive | UlmBlois/website | de89a0218041d3ff60f5eaaa77f5e272d89450ea | 01e652dd0c9c5b7026efe2a923ea3c4668d5a5b4 | refs/heads/master | 2021-07-01T09:21:55.628605 | 2020-10-11T10:56:28 | 2020-10-11T10:56:28 | 150,215,856 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 11,016 | py | # django
from django.shortcuts import redirect
from django.http import Http404, HttpResponseRedirect
from django.urls import reverse
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views.generic.edit import (UpdateView, DeleteView, CreateView,)
from django.views.generic.list import ListView
from django.views.generic.edit import FormView
from django.views.generic.detail import DetailView
from django.contrib import messages
from django.contrib.auth import update_session_auth_hash
from django.contrib.auth.mixins import UserPassesTestMixin
from django.utils.translation import gettext_lazy as _
# python
import uuid
import logging
# Third party
from extra_views import ModelFormSetView
# owned
from meeting.models import Pilot, ULM, Reservation, Meeting
from meeting.form import (ReservationForm, UserEditMultiForm,
ULMForm, ULMFormSetHelper, BaseULMForm,
PilotPasswordChangeForm)
from meeting.views.utils import PAGINATED_BY
logger = logging.getLogger(__name__)
# TODO: move this view to Core?
@method_decorator(login_required, name='dispatch')
class PilotChangePassword(FormView):
form_class = PilotPasswordChangeForm
template_name = 'base_logged_form.html'
def get_success_url(self):
return reverse('pilot', kwargs={'pk': self.request.user.pilot.pk})
def get_form_kwargs(self):
kwargs = super().get_form_kwargs()
kwargs['user'] = self.request.user
return kwargs
def form_valid(self, form):
form.save()
update_session_auth_hash(self.request, self.request.user) # Important!
messages.add_message(self.request, messages.INFO,
_('str_message_password_updated'))
return super().form_valid(form)
@method_decorator(login_required, name='dispatch')
class DetailPilot(DetailView):
model = Pilot
pk_url_kwarg = 'pk'
context_object_name = 'pilot'
template_name = 'pilot_profile.html'
def get_queryset(self):
queryset = super().get_queryset()
return queryset.filter(pk=self.kwargs.get('pk'))
def get_object(self, queryset=None):
obj = super(DetailPilot, self).get_object()
if not obj.user == self.request.user:
raise Http404
return obj
@method_decorator(login_required, name='dispatch')
class UpdateUserPilotView(UpdateView):
model = Pilot
pk_url_kwarg = 'pk'
form_class = UserEditMultiForm
template_name = 'base_logged_form.html'
def get_success_url(self):
return reverse('pilot', kwargs={'pk': self.object.pk})
def get_form_kwargs(self):
kwargs = super(UpdateUserPilotView, self).get_form_kwargs()
kwargs.update(instance={
'user_form': self.object.user,
'pilot_form': self.object,
})
return kwargs
def get_queryset(self):
queryset = super().get_queryset()
return queryset.filter(pk=self.kwargs.get('pk', None))
def get_object(self, queryset=None):
obj = super(UpdateUserPilotView, self).get_object()
if not obj.user == self.request.user:
raise Http404
return obj
def form_valid(self, form):
form['user_form'].save()
form['pilot_form'].save()
return redirect(self.get_success_url())
###############################################################################
# ULM related View
###############################################################################
@method_decorator(login_required, name='dispatch')
class PilotULMList(ListView):
model = ULM
context_object_name = 'ulm_list'
template_name = 'pilot_ulm_list.html'
paginate_by = PAGINATED_BY
def get_queryset(self):
queryset = super().get_queryset()
return queryset.filter(pilot=self.request.user.pilot).order_by(
'-imatriculation')
@method_decorator(login_required, name='dispatch')
class DeletePilotULM(DeleteView):
model = ULM
template_name = 'logged_delete_form.html'
# Translators: This contain the ulm name acces by %(ulm)s
success_message = _("str_message_ulm_deleted")
# Translators: This contain the ulm name acces by %(ulm)s
error_message = _('str_message_delete_ulm_link_to_reservation')
def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)
context['cancel_url'] = reverse('pilot_ulm_list')
return context
def get_object(self, queryset=None):
obj = super(DeletePilotULM, self).get_object()
if not obj.pilot == self.request.user.pilot:
raise Http404
return obj
def get_success_url(self):
return reverse('pilot_ulm_list')
def delete(self, request, *args, **kwargs):
obj = self.get_object()
if obj.reservations.actives().filter(canceled=False):
messages.error(
self.request,
self.error_message % {'ulm': obj.radio_id})
return redirect(reverse('pilot_ulm_list'))
else:
messages.success(
self.request,
self.success_message % {'ulm': obj.radio_id})
return super().delete(request, *args, **kwargs)
@method_decorator(login_required, name='dispatch')
class CreatePilotULM(CreateView):
model = ULM
form_class = ULMForm
template_name = 'base_logged_form.html'
def get_success_url(self):
return reverse('pilot_ulm_list')
def form_valid(self, form):
model = form.save(commit=False)
model.pilot = self.request.user.pilot
model.save()
return redirect(self.get_success_url())
@method_decorator(login_required, name='dispatch')
class UpdatePilotULM(UpdateView):
model = ULM
form_class = ULMForm
pk_url_kwarg = 'pk'
context_object_name = 'ulm'
template_name = 'base_logged_form.html'
def get_success_url(self):
return reverse('pilot_ulm_list')
def get_queryset(self):
queryset = super().get_queryset()
return queryset.filter(pilot=self.request.user.pilot)
def form_valid(self, form):
ulm = form.save(commit=False)
ulm.save()
return redirect(self.get_success_url())
###############################################################################
# Reservation related View
###############################################################################
@method_decorator(login_required, name='dispatch')
class PilotReservationList(ListView):
model = Reservation
context_object_name = 'reservation_list'
template_name = 'pilot_reservation_list.html'
paginate_by = PAGINATED_BY
def get_queryset(self):
queryset = super().get_queryset()
return queryset.filter(pilot=self.request.user.pilot).order_by(
'-reservation_number')
def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)
context['meeting'] = Meeting.objects.active()
return context
@method_decorator(login_required, name='dispatch')
class CreatePilotReservation(UserPassesTestMixin, CreateView):
model = Reservation
form_class = ReservationForm
template_name = 'base_logged_form.html'
def test_func(self):
meeting = Meeting.objects.active()
if meeting:
return meeting.registration_aviable
return False
def get_success_url(self):
return reverse('pilot_reservation')
def get_form_kwargs(self):
kwargs = super(CreatePilotReservation, self).get_form_kwargs()
kwargs.update({'pilot': self.request.user.pilot})
return kwargs
def form_valid(self, form):
res = form.save(commit=False)
key = uuid.uuid4().hex[:6].upper()
while Reservation.objects.filter(reservation_number=key).exists():
key = uuid.uuid4().hex[:6].upper()
res.reservation_number = key
res.meeting = res.time_slot.meeting
res.pilot = res.ulm.pilot
res.save()
return redirect(self.get_success_url())
@method_decorator(login_required, name='dispatch')
class UpdatePilotReservation(UpdateView):
model = Reservation
form_class = ReservationForm
pk_url_kwarg = 'pk'
context_object_name = 'reservation'
template_name = 'base_logged_form.html'
def get_success_url(self):
return reverse('pilot_reservation')
def get_form_kwargs(self):
kwargs = super(UpdatePilotReservation, self).get_form_kwargs()
kwargs.update({'pilot': self.request.user.pilot})
return kwargs
def get_queryset(self):
queryset = super().get_queryset()
return queryset.filter(pilot=self.request.user.pilot)
def form_valid(self, form):
res = form.save(commit=False)
res.canceled = False
res.save()
return redirect(self.get_success_url())
###############################################################################
# Reservation wizard
###############################################################################
@method_decorator(login_required, name='dispatch')
class ReservationWizardStep1(UpdateUserPilotView):
def get_success_url(self):
return reverse('reservation_wizard_step2',
kwargs={'pilot': self.object.pk})
@method_decorator(login_required, name='dispatch')
class ReservationWizardStep2(ModelFormSetView):
pilot = None
model = ULM
form_class = BaseULMForm
template_name = 'base_logged_form.html'
factory_kwargs = {'extra': 1}
def get_success_url(self):
return reverse('pilot_create_reservation')
def get_queryset(self):
self.pilot = self.kwargs.get('pilot', None)
queryset = super().get_queryset()
return queryset.filter(pilot=self.pilot)
def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)
helper = ULMFormSetHelper()
helper.form_tag = False
context['helper'] = helper
return context
def formset_valid(self, formset):
"""
If the formset is valid redirect to the supplied URL
"""
for form in formset:
if form.has_changed():
ulm = form.save(commit=False)
ulm.pilot = Pilot.objects.get(pk=self.pilot)
ulm.save()
return HttpResponseRedirect(self.get_success_url())
def formset_invalid(self, formset):
"""
If the formset is invalid, re-render the context data with the
data-filled formset and errors.
"""
logger.debug("formset " + str(len(formset)))
for form in formset:
logger.debug("form is valid: " + str(form.is_valid()))
logger.debug(str(form.cleaned_data))
logger.debug(form.errors)
return self.render_to_response(self.get_context_data(formset=formset))
| [
"serrette.nicola@gmail.com"
] | serrette.nicola@gmail.com |
89154813eb3ff9f4e9c50e0d31da866ddf5a105f | 1617a9a9c92146bcdac89b5efb1ef0d18408160b | /cont6lab/36/generator.py | 0977a7c5fc92dad574ae123ad1808f554c15b4d0 | [] | no_license | LitRidl/checker-content | 1b1329b4462b87731e0755ab33480ff063a94a00 | b5d0456c8d4d28db6e6022e272a95a385f253797 | refs/heads/master | 2023-08-17T18:08:07.377680 | 2018-02-04T11:16:34 | 2018-02-04T11:16:34 | 120,077,784 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,056 | py | from __future__ import print_function
from random import shuffle, randint, choice
from numpy import base_repr
import sys
HEX_DIGITS = '0123456789ABCDEF'
def rnd(l, r, base=10):
return base_repr(randint(l, r), base=base)
def rnd_word(length, prefix=' ', alphabet=HEX_DIGITS):
word = ''.join(choice(alphabet) for _ in range(length))
word = word.lstrip('0') or '0'
return (choice(prefix) + word).lstrip(' ') or '0'
def generate_test1(params):
a = rnd_word(randint(*params['word_len'][0]),
alphabet=HEX_DIGITS[:params['word_radix'][0]],
prefix=params['word_prefix'][0])
if not params['leading_zero']:
a = a.lstrip('0')
return '{0}'.format(a)
def generate_test2(params):
l1 = randint(*params['word_len'][0])
l2 = l1 # randint(*params['word_len'][1])
a = rnd_word(l1, alphabet=HEX_DIGITS[:params['word_radix'][0]],
prefix=params['word_prefix'][0])
b = rnd_word(l2, alphabet=HEX_DIGITS[:params['word_radix'][1]],
prefix=params['word_prefix'][0])
if not params['leading_zero']:
a, b = a.lstrip('0'), b.lstrip('0')
return '{0} {1}'.format(a, b)
def generate_test2_par(params):
while True:
_a = randint(*(params['word_len'][0]))
_b = randint(*(params['word_len'][1]))
if _a > _b:
break
a = _a
b = _b
return '{0} {1}'.format(a, b)
def seq_tests1(var1_bounds, var2_bounds, base=10):
test_idx = 2
for a in range(*var1_bounds):
with open('tests/{0:03d}.dat'.format(test_idx), 'w') as f:
res = '{0}'.format(base_repr(a, base))
f.write(res)
test_idx += 1
return test_idx
def seq_tests2(var1_bounds, var2_bounds, base=10):
test_idx = 2
for a in range(*var1_bounds):
for b in range(*var2_bounds):
with open('tests/{0:03d}.dat'.format(test_idx), 'w') as f:
res = '{0} {1}'.format(base_repr(a, base), base_repr(b, base))
f.write(res)
test_idx += 1
return test_idx
def rnd_tests(test_first=66, nums=2, tests=40, base=10):
params = {
'word_len': [(8, 12), (8, 12)],
'word_radix': [base, base],
'word_prefix': [' ', ' '], # can be ' +-', for example
'leading_zero': True
}
for test_idx in range(test_first, test_first + tests):
with open('tests/{0:03d}.dat'.format(test_idx), 'w') as f:
if nums == 1:
f.write(generate_test1(params))
elif nums == 2:
f.write(generate_test2(params))
NUMS = 1
BASE = 2
TESTS = 100 # 40
if __name__ == '__main__':
test_idx = 42 # SPECIFY!!!
if 's' in sys.argv[1]:
if NUMS == 1:
test_idx = seq_tests1([0, 40], [0, 0], base=BASE)
if NUMS == 2:
test_idx = seq_tests2([0, 8], [0, 8], base=BASE)
print('Seq tests until {0}'.format(test_idx))
if 'r' in sys.argv[1]:
rnd_tests(test_first=test_idx, nums=NUMS, tests=TESTS, base=BASE)
| [
"tutkarma@gmail.com"
] | tutkarma@gmail.com |
8976e7aa9725897cff291e560d65e0e1e1d00039 | ac0ff6b7179cc8002f87704553a35290325da69d | /app/test_app.py | 064ac449f113470034ef3e5c21b38c53c7a0b9c2 | [] | no_license | amaotone/fastapi-example | 87ce2b065672b5e74bc049d6ca84bd2ee91d340f | 726a452305a57243dcea98b557880e042fea0d30 | refs/heads/master | 2023-02-23T03:22:55.297487 | 2021-01-28T06:05:48 | 2021-01-28T06:05:48 | 333,622,702 | 18 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,269 | py | from fastapi.testclient import TestClient
from palmerpenguins import load_penguins
from main import app
client = TestClient(app)
models = ["randomforest", "decisiontree"]
example_body = {
"model": "randomforest",
"bill_length": 40,
"bill_depth": 20,
"flipoper_length": 200,
"body_mass": 4000,
}
def test_predict():
"""テスト用データセットはどれを投げても結果が返ってくる"""
data, _ = load_penguins(return_X_y=True, drop_na=True)
for row in data.values:
for model in models:
body = {
"model": model,
"bill_length": row[0],
"bill_depth": row[1],
"flipper_length": row[2],
"body_mass": row[3],
}
response = client.post("/predict", json=body)
assert response.status_code == 200
def test_invalid_model_name():
"""存在しないモデルは指定できない"""
body = example_body.update({"model": "invalidmodel"})
response = client.post("/predict", json=body)
assert response.status_code == 422
def test_invalid_endpoint():
"""変なエンドポイントは404が返る"""
response = client.get("/invalid")
assert response.status_code == 404
| [
"amane.suzu@gmail.com"
] | amane.suzu@gmail.com |
aaa99d433e458c0bf78570f0f35b6291c7790175 | a9a27cd7a3c3d6ccf80d71acfd1bf568f3c3969d | /records/views.py | 6b75b8ee3175337f7a31efd1c25ee54a53c2483f | [] | no_license | Resurfed/timerweb | 1ee62fba70c82ff4b70ed0afcb8af4597ff2709e | 448697cd64948bffa1b6a7de1ef40a19c225bdda | refs/heads/master | 2021-10-10T00:34:41.320733 | 2018-03-03T20:16:14 | 2018-03-03T20:16:14 | 114,939,784 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 449 | py | from django.shortcuts import render
from rest_framework import generics
from .models import Time
from .serializers import TimeSerializer
from .filters import TimeFilter
class TimeList(generics.ListCreateAPIView):
queryset = Time.objects.all()
serializer_class = TimeSerializer
filter_class = TimeFilter
class TimeDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Time.objects.all()
serializer_class = TimeSerializer
| [
"20483150+mvonsm@users.noreply.github.com"
] | 20483150+mvonsm@users.noreply.github.com |
f4adbaf1b2964ff6c99e4ebc11725555d3d8b479 | d6589ff7cf647af56938a9598f9e2e674c0ae6b5 | /sas-20181203/alibabacloud_sas20181203/client.py | 9b1b8966fd4890d8d6945e6c7403bff1b32e9637 | [
"Apache-2.0"
] | permissive | hazho/alibabacloud-python-sdk | 55028a0605b1509941269867a043f8408fa8c296 | cddd32154bb8c12e50772fec55429a9a97f3efd9 | refs/heads/master | 2023-07-01T17:51:57.893326 | 2021-08-02T08:55:22 | 2021-08-02T08:55:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 360,248 | py | # -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from typing import Dict
from Tea.core import TeaCore
from alibabacloud_tea_openapi.client import Client as OpenApiClient
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_tea_util.client import Client as UtilClient
from alibabacloud_endpoint_util.client import Client as EndpointUtilClient
from alibabacloud_sas20181203 import models as sas_20181203_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_openapi_util.client import Client as OpenApiUtilClient
class Client(OpenApiClient):
"""
*\
"""
def __init__(
self,
config: open_api_models.Config,
):
super().__init__(config)
self._endpoint_rule = 'regional'
self._endpoint_map = {
'cn-hangzhou': 'tds.aliyuncs.com',
'ap-southeast-3': 'tds.ap-southeast-3.aliyuncs.com',
'ap-northeast-1': 'tds.aliyuncs.com',
'ap-northeast-2-pop': 'tds.aliyuncs.com',
'ap-south-1': 'tds.aliyuncs.com',
'ap-southeast-1': 'tds.ap-southeast-1.aliyuncs.com',
'ap-southeast-2': 'tds.aliyuncs.com',
'ap-southeast-5': 'tds.aliyuncs.com',
'cn-beijing': 'tds.aliyuncs.com',
'cn-beijing-finance-1': 'tds.aliyuncs.com',
'cn-beijing-finance-pop': 'tds.aliyuncs.com',
'cn-beijing-gov-1': 'tds.aliyuncs.com',
'cn-beijing-nu16-b01': 'tds.aliyuncs.com',
'cn-chengdu': 'tds.aliyuncs.com',
'cn-edge-1': 'tds.aliyuncs.com',
'cn-fujian': 'tds.aliyuncs.com',
'cn-haidian-cm12-c01': 'tds.aliyuncs.com',
'cn-hangzhou-bj-b01': 'tds.aliyuncs.com',
'cn-hangzhou-finance': 'tds.aliyuncs.com',
'cn-hangzhou-internal-prod-1': 'tds.aliyuncs.com',
'cn-hangzhou-internal-test-1': 'tds.aliyuncs.com',
'cn-hangzhou-internal-test-2': 'tds.aliyuncs.com',
'cn-hangzhou-internal-test-3': 'tds.aliyuncs.com',
'cn-hangzhou-test-306': 'tds.aliyuncs.com',
'cn-hongkong': 'tds.aliyuncs.com',
'cn-hongkong-finance-pop': 'tds.aliyuncs.com',
'cn-huhehaote': 'tds.aliyuncs.com',
'cn-huhehaote-nebula-1': 'tds.aliyuncs.com',
'cn-north-2-gov-1': 'tds.aliyuncs.com',
'cn-qingdao': 'tds.aliyuncs.com',
'cn-qingdao-nebula': 'tds.aliyuncs.com',
'cn-shanghai': 'tds.aliyuncs.com',
'cn-shanghai-et15-b01': 'tds.aliyuncs.com',
'cn-shanghai-et2-b01': 'tds.aliyuncs.com',
'cn-shanghai-finance-1': 'tds.aliyuncs.com',
'cn-shanghai-inner': 'tds.aliyuncs.com',
'cn-shanghai-internal-test-1': 'tds.aliyuncs.com',
'cn-shenzhen': 'tds.aliyuncs.com',
'cn-shenzhen-finance-1': 'tds.aliyuncs.com',
'cn-shenzhen-inner': 'tds.aliyuncs.com',
'cn-shenzhen-st4-d01': 'tds.aliyuncs.com',
'cn-shenzhen-su18-b01': 'tds.aliyuncs.com',
'cn-wuhan': 'tds.aliyuncs.com',
'cn-wulanchabu': 'tds.aliyuncs.com',
'cn-yushanfang': 'tds.aliyuncs.com',
'cn-zhangbei': 'tds.aliyuncs.com',
'cn-zhangbei-na61-b01': 'tds.aliyuncs.com',
'cn-zhangjiakou': 'tds.aliyuncs.com',
'cn-zhangjiakou-na62-a01': 'tds.aliyuncs.com',
'cn-zhengzhou-nebula-1': 'tds.aliyuncs.com',
'eu-central-1': 'tds.aliyuncs.com',
'eu-west-1': 'tds.aliyuncs.com',
'eu-west-1-oxs': 'tds.aliyuncs.com',
'me-east-1': 'tds.aliyuncs.com',
'rus-west-1-pop': 'tds.aliyuncs.com',
'us-east-1': 'tds.aliyuncs.com',
'us-west-1': 'tds.aliyuncs.com'
}
self.check_config(config)
self._endpoint = self.get_endpoint('sas', self._region_id, self._endpoint_rule, self._network, self._suffix, self._endpoint_map, self._endpoint)
def get_endpoint(
self,
product_id: str,
region_id: str,
endpoint_rule: str,
network: str,
suffix: str,
endpoint_map: Dict[str, str],
endpoint: str,
) -> str:
if not UtilClient.empty(endpoint):
return endpoint
if not UtilClient.is_unset(endpoint_map) and not UtilClient.empty(endpoint_map.get(region_id)):
return endpoint_map.get(region_id)
return EndpointUtilClient.get_endpoint_rules(product_id, region_id, endpoint_rule, network, suffix)
def add_vpc_honey_pot_with_options(
self,
request: sas_20181203_models.AddVpcHoneyPotRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.AddVpcHoneyPotResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.AddVpcHoneyPotResponse(),
self.do_rpcrequest('AddVpcHoneyPot', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def add_vpc_honey_pot_with_options_async(
self,
request: sas_20181203_models.AddVpcHoneyPotRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.AddVpcHoneyPotResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.AddVpcHoneyPotResponse(),
await self.do_rpcrequest_async('AddVpcHoneyPot', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def add_vpc_honey_pot(
self,
request: sas_20181203_models.AddVpcHoneyPotRequest,
) -> sas_20181203_models.AddVpcHoneyPotResponse:
runtime = util_models.RuntimeOptions()
return self.add_vpc_honey_pot_with_options(request, runtime)
async def add_vpc_honey_pot_async(
self,
request: sas_20181203_models.AddVpcHoneyPotRequest,
) -> sas_20181203_models.AddVpcHoneyPotResponse:
runtime = util_models.RuntimeOptions()
return await self.add_vpc_honey_pot_with_options_async(request, runtime)
def check_quara_file_id_with_options(
self,
request: sas_20181203_models.CheckQuaraFileIdRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CheckQuaraFileIdResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CheckQuaraFileIdResponse(),
self.do_rpcrequest('CheckQuaraFileId', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def check_quara_file_id_with_options_async(
self,
request: sas_20181203_models.CheckQuaraFileIdRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CheckQuaraFileIdResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CheckQuaraFileIdResponse(),
await self.do_rpcrequest_async('CheckQuaraFileId', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def check_quara_file_id(
self,
request: sas_20181203_models.CheckQuaraFileIdRequest,
) -> sas_20181203_models.CheckQuaraFileIdResponse:
runtime = util_models.RuntimeOptions()
return self.check_quara_file_id_with_options(request, runtime)
async def check_quara_file_id_async(
self,
request: sas_20181203_models.CheckQuaraFileIdRequest,
) -> sas_20181203_models.CheckQuaraFileIdResponse:
runtime = util_models.RuntimeOptions()
return await self.check_quara_file_id_with_options_async(request, runtime)
def check_security_event_id_with_options(
self,
request: sas_20181203_models.CheckSecurityEventIdRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CheckSecurityEventIdResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CheckSecurityEventIdResponse(),
self.do_rpcrequest('CheckSecurityEventId', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def check_security_event_id_with_options_async(
self,
request: sas_20181203_models.CheckSecurityEventIdRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CheckSecurityEventIdResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CheckSecurityEventIdResponse(),
await self.do_rpcrequest_async('CheckSecurityEventId', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def check_security_event_id(
self,
request: sas_20181203_models.CheckSecurityEventIdRequest,
) -> sas_20181203_models.CheckSecurityEventIdResponse:
runtime = util_models.RuntimeOptions()
return self.check_security_event_id_with_options(request, runtime)
async def check_security_event_id_async(
self,
request: sas_20181203_models.CheckSecurityEventIdRequest,
) -> sas_20181203_models.CheckSecurityEventIdResponse:
runtime = util_models.RuntimeOptions()
return await self.check_security_event_id_with_options_async(request, runtime)
def create_anti_brute_force_rule_with_options(
self,
request: sas_20181203_models.CreateAntiBruteForceRuleRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateAntiBruteForceRuleResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateAntiBruteForceRuleResponse(),
self.do_rpcrequest('CreateAntiBruteForceRule', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def create_anti_brute_force_rule_with_options_async(
self,
request: sas_20181203_models.CreateAntiBruteForceRuleRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateAntiBruteForceRuleResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateAntiBruteForceRuleResponse(),
await self.do_rpcrequest_async('CreateAntiBruteForceRule', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def create_anti_brute_force_rule(
self,
request: sas_20181203_models.CreateAntiBruteForceRuleRequest,
) -> sas_20181203_models.CreateAntiBruteForceRuleResponse:
runtime = util_models.RuntimeOptions()
return self.create_anti_brute_force_rule_with_options(request, runtime)
async def create_anti_brute_force_rule_async(
self,
request: sas_20181203_models.CreateAntiBruteForceRuleRequest,
) -> sas_20181203_models.CreateAntiBruteForceRuleResponse:
runtime = util_models.RuntimeOptions()
return await self.create_anti_brute_force_rule_with_options_async(request, runtime)
def create_asset_with_options(
self,
request: sas_20181203_models.CreateAssetRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateAssetResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateAssetResponse(),
self.do_rpcrequest('CreateAsset', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def create_asset_with_options_async(
self,
request: sas_20181203_models.CreateAssetRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateAssetResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateAssetResponse(),
await self.do_rpcrequest_async('CreateAsset', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def create_asset(
self,
request: sas_20181203_models.CreateAssetRequest,
) -> sas_20181203_models.CreateAssetResponse:
runtime = util_models.RuntimeOptions()
return self.create_asset_with_options(request, runtime)
async def create_asset_async(
self,
request: sas_20181203_models.CreateAssetRequest,
) -> sas_20181203_models.CreateAssetResponse:
runtime = util_models.RuntimeOptions()
return await self.create_asset_with_options_async(request, runtime)
def create_backup_policy_with_options(
self,
tmp_req: sas_20181203_models.CreateBackupPolicyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateBackupPolicyResponse:
UtilClient.validate_model(tmp_req)
request = sas_20181203_models.CreateBackupPolicyShrinkRequest()
OpenApiUtilClient.convert(tmp_req, request)
if not UtilClient.is_unset(tmp_req.policy):
request.policy_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.policy, 'Policy', 'json')
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateBackupPolicyResponse(),
self.do_rpcrequest('CreateBackupPolicy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def create_backup_policy_with_options_async(
self,
tmp_req: sas_20181203_models.CreateBackupPolicyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateBackupPolicyResponse:
UtilClient.validate_model(tmp_req)
request = sas_20181203_models.CreateBackupPolicyShrinkRequest()
OpenApiUtilClient.convert(tmp_req, request)
if not UtilClient.is_unset(tmp_req.policy):
request.policy_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.policy, 'Policy', 'json')
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateBackupPolicyResponse(),
await self.do_rpcrequest_async('CreateBackupPolicy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def create_backup_policy(
self,
request: sas_20181203_models.CreateBackupPolicyRequest,
) -> sas_20181203_models.CreateBackupPolicyResponse:
runtime = util_models.RuntimeOptions()
return self.create_backup_policy_with_options(request, runtime)
async def create_backup_policy_async(
self,
request: sas_20181203_models.CreateBackupPolicyRequest,
) -> sas_20181203_models.CreateBackupPolicyResponse:
runtime = util_models.RuntimeOptions()
return await self.create_backup_policy_with_options_async(request, runtime)
def create_or_update_asset_group_with_options(
self,
request: sas_20181203_models.CreateOrUpdateAssetGroupRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateOrUpdateAssetGroupResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateOrUpdateAssetGroupResponse(),
self.do_rpcrequest('CreateOrUpdateAssetGroup', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def create_or_update_asset_group_with_options_async(
self,
request: sas_20181203_models.CreateOrUpdateAssetGroupRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateOrUpdateAssetGroupResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateOrUpdateAssetGroupResponse(),
await self.do_rpcrequest_async('CreateOrUpdateAssetGroup', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def create_or_update_asset_group(
self,
request: sas_20181203_models.CreateOrUpdateAssetGroupRequest,
) -> sas_20181203_models.CreateOrUpdateAssetGroupResponse:
runtime = util_models.RuntimeOptions()
return self.create_or_update_asset_group_with_options(request, runtime)
async def create_or_update_asset_group_async(
self,
request: sas_20181203_models.CreateOrUpdateAssetGroupRequest,
) -> sas_20181203_models.CreateOrUpdateAssetGroupResponse:
runtime = util_models.RuntimeOptions()
return await self.create_or_update_asset_group_with_options_async(request, runtime)
def create_restore_job_with_options(
self,
request: sas_20181203_models.CreateRestoreJobRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateRestoreJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateRestoreJobResponse(),
self.do_rpcrequest('CreateRestoreJob', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def create_restore_job_with_options_async(
self,
request: sas_20181203_models.CreateRestoreJobRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateRestoreJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateRestoreJobResponse(),
await self.do_rpcrequest_async('CreateRestoreJob', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def create_restore_job(
self,
request: sas_20181203_models.CreateRestoreJobRequest,
) -> sas_20181203_models.CreateRestoreJobResponse:
runtime = util_models.RuntimeOptions()
return self.create_restore_job_with_options(request, runtime)
async def create_restore_job_async(
self,
request: sas_20181203_models.CreateRestoreJobRequest,
) -> sas_20181203_models.CreateRestoreJobResponse:
runtime = util_models.RuntimeOptions()
return await self.create_restore_job_with_options_async(request, runtime)
def create_sas_order_with_options(
self,
request: sas_20181203_models.CreateSasOrderRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateSasOrderResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateSasOrderResponse(),
self.do_rpcrequest('CreateSasOrder', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def create_sas_order_with_options_async(
self,
request: sas_20181203_models.CreateSasOrderRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateSasOrderResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateSasOrderResponse(),
await self.do_rpcrequest_async('CreateSasOrder', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def create_sas_order(
self,
request: sas_20181203_models.CreateSasOrderRequest,
) -> sas_20181203_models.CreateSasOrderResponse:
runtime = util_models.RuntimeOptions()
return self.create_sas_order_with_options(request, runtime)
async def create_sas_order_async(
self,
request: sas_20181203_models.CreateSasOrderRequest,
) -> sas_20181203_models.CreateSasOrderResponse:
runtime = util_models.RuntimeOptions()
return await self.create_sas_order_with_options_async(request, runtime)
def create_service_linked_role_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateServiceLinkedRoleResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.CreateServiceLinkedRoleResponse(),
self.do_rpcrequest('CreateServiceLinkedRole', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def create_service_linked_role_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateServiceLinkedRoleResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.CreateServiceLinkedRoleResponse(),
await self.do_rpcrequest_async('CreateServiceLinkedRole', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def create_service_linked_role(self) -> sas_20181203_models.CreateServiceLinkedRoleResponse:
runtime = util_models.RuntimeOptions()
return self.create_service_linked_role_with_options(runtime)
async def create_service_linked_role_async(self) -> sas_20181203_models.CreateServiceLinkedRoleResponse:
runtime = util_models.RuntimeOptions()
return await self.create_service_linked_role_with_options_async(runtime)
def create_similar_security_events_query_task_with_options(
self,
request: sas_20181203_models.CreateSimilarSecurityEventsQueryTaskRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateSimilarSecurityEventsQueryTaskResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateSimilarSecurityEventsQueryTaskResponse(),
self.do_rpcrequest('CreateSimilarSecurityEventsQueryTask', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def create_similar_security_events_query_task_with_options_async(
self,
request: sas_20181203_models.CreateSimilarSecurityEventsQueryTaskRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.CreateSimilarSecurityEventsQueryTaskResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.CreateSimilarSecurityEventsQueryTaskResponse(),
await self.do_rpcrequest_async('CreateSimilarSecurityEventsQueryTask', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def create_similar_security_events_query_task(
self,
request: sas_20181203_models.CreateSimilarSecurityEventsQueryTaskRequest,
) -> sas_20181203_models.CreateSimilarSecurityEventsQueryTaskResponse:
runtime = util_models.RuntimeOptions()
return self.create_similar_security_events_query_task_with_options(request, runtime)
async def create_similar_security_events_query_task_async(
self,
request: sas_20181203_models.CreateSimilarSecurityEventsQueryTaskRequest,
) -> sas_20181203_models.CreateSimilarSecurityEventsQueryTaskResponse:
runtime = util_models.RuntimeOptions()
return await self.create_similar_security_events_query_task_with_options_async(request, runtime)
def delete_asset_with_options(
self,
request: sas_20181203_models.DeleteAssetRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteAssetResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteAssetResponse(),
self.do_rpcrequest('DeleteAsset', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def delete_asset_with_options_async(
self,
request: sas_20181203_models.DeleteAssetRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteAssetResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteAssetResponse(),
await self.do_rpcrequest_async('DeleteAsset', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def delete_asset(
self,
request: sas_20181203_models.DeleteAssetRequest,
) -> sas_20181203_models.DeleteAssetResponse:
runtime = util_models.RuntimeOptions()
return self.delete_asset_with_options(request, runtime)
async def delete_asset_async(
self,
request: sas_20181203_models.DeleteAssetRequest,
) -> sas_20181203_models.DeleteAssetResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_asset_with_options_async(request, runtime)
def delete_backup_policy_with_options(
self,
request: sas_20181203_models.DeleteBackupPolicyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteBackupPolicyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteBackupPolicyResponse(),
self.do_rpcrequest('DeleteBackupPolicy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def delete_backup_policy_with_options_async(
self,
request: sas_20181203_models.DeleteBackupPolicyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteBackupPolicyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteBackupPolicyResponse(),
await self.do_rpcrequest_async('DeleteBackupPolicy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def delete_backup_policy(
self,
request: sas_20181203_models.DeleteBackupPolicyRequest,
) -> sas_20181203_models.DeleteBackupPolicyResponse:
runtime = util_models.RuntimeOptions()
return self.delete_backup_policy_with_options(request, runtime)
async def delete_backup_policy_async(
self,
request: sas_20181203_models.DeleteBackupPolicyRequest,
) -> sas_20181203_models.DeleteBackupPolicyResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_backup_policy_with_options_async(request, runtime)
def delete_backup_policy_machine_with_options(
self,
request: sas_20181203_models.DeleteBackupPolicyMachineRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteBackupPolicyMachineResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteBackupPolicyMachineResponse(),
self.do_rpcrequest('DeleteBackupPolicyMachine', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def delete_backup_policy_machine_with_options_async(
self,
request: sas_20181203_models.DeleteBackupPolicyMachineRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteBackupPolicyMachineResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteBackupPolicyMachineResponse(),
await self.do_rpcrequest_async('DeleteBackupPolicyMachine', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def delete_backup_policy_machine(
self,
request: sas_20181203_models.DeleteBackupPolicyMachineRequest,
) -> sas_20181203_models.DeleteBackupPolicyMachineResponse:
runtime = util_models.RuntimeOptions()
return self.delete_backup_policy_machine_with_options(request, runtime)
async def delete_backup_policy_machine_async(
self,
request: sas_20181203_models.DeleteBackupPolicyMachineRequest,
) -> sas_20181203_models.DeleteBackupPolicyMachineResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_backup_policy_machine_with_options_async(request, runtime)
def delete_group_with_options(
self,
request: sas_20181203_models.DeleteGroupRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteGroupResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteGroupResponse(),
self.do_rpcrequest('DeleteGroup', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def delete_group_with_options_async(
self,
request: sas_20181203_models.DeleteGroupRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteGroupResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteGroupResponse(),
await self.do_rpcrequest_async('DeleteGroup', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def delete_group(
self,
request: sas_20181203_models.DeleteGroupRequest,
) -> sas_20181203_models.DeleteGroupResponse:
runtime = util_models.RuntimeOptions()
return self.delete_group_with_options(request, runtime)
async def delete_group_async(
self,
request: sas_20181203_models.DeleteGroupRequest,
) -> sas_20181203_models.DeleteGroupResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_group_with_options_async(request, runtime)
def delete_login_base_config_with_options(
self,
request: sas_20181203_models.DeleteLoginBaseConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteLoginBaseConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteLoginBaseConfigResponse(),
self.do_rpcrequest('DeleteLoginBaseConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def delete_login_base_config_with_options_async(
self,
request: sas_20181203_models.DeleteLoginBaseConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteLoginBaseConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteLoginBaseConfigResponse(),
await self.do_rpcrequest_async('DeleteLoginBaseConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def delete_login_base_config(
self,
request: sas_20181203_models.DeleteLoginBaseConfigRequest,
) -> sas_20181203_models.DeleteLoginBaseConfigResponse:
runtime = util_models.RuntimeOptions()
return self.delete_login_base_config_with_options(request, runtime)
async def delete_login_base_config_async(
self,
request: sas_20181203_models.DeleteLoginBaseConfigRequest,
) -> sas_20181203_models.DeleteLoginBaseConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_login_base_config_with_options_async(request, runtime)
def delete_strategy_with_options(
self,
request: sas_20181203_models.DeleteStrategyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteStrategyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteStrategyResponse(),
self.do_rpcrequest('DeleteStrategy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def delete_strategy_with_options_async(
self,
request: sas_20181203_models.DeleteStrategyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteStrategyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteStrategyResponse(),
await self.do_rpcrequest_async('DeleteStrategy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def delete_strategy(
self,
request: sas_20181203_models.DeleteStrategyRequest,
) -> sas_20181203_models.DeleteStrategyResponse:
runtime = util_models.RuntimeOptions()
return self.delete_strategy_with_options(request, runtime)
async def delete_strategy_async(
self,
request: sas_20181203_models.DeleteStrategyRequest,
) -> sas_20181203_models.DeleteStrategyResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_strategy_with_options_async(request, runtime)
def delete_tag_with_uuid_with_options(
self,
request: sas_20181203_models.DeleteTagWithUuidRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteTagWithUuidResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteTagWithUuidResponse(),
self.do_rpcrequest('DeleteTagWithUuid', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def delete_tag_with_uuid_with_options_async(
self,
request: sas_20181203_models.DeleteTagWithUuidRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteTagWithUuidResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteTagWithUuidResponse(),
await self.do_rpcrequest_async('DeleteTagWithUuid', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def delete_tag_with_uuid(
self,
request: sas_20181203_models.DeleteTagWithUuidRequest,
) -> sas_20181203_models.DeleteTagWithUuidResponse:
runtime = util_models.RuntimeOptions()
return self.delete_tag_with_uuid_with_options(request, runtime)
async def delete_tag_with_uuid_async(
self,
request: sas_20181203_models.DeleteTagWithUuidRequest,
) -> sas_20181203_models.DeleteTagWithUuidResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_tag_with_uuid_with_options_async(request, runtime)
def delete_vpc_honey_pot_with_options(
self,
request: sas_20181203_models.DeleteVpcHoneyPotRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteVpcHoneyPotResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteVpcHoneyPotResponse(),
self.do_rpcrequest('DeleteVpcHoneyPot', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def delete_vpc_honey_pot_with_options_async(
self,
request: sas_20181203_models.DeleteVpcHoneyPotRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DeleteVpcHoneyPotResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DeleteVpcHoneyPotResponse(),
await self.do_rpcrequest_async('DeleteVpcHoneyPot', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def delete_vpc_honey_pot(
self,
request: sas_20181203_models.DeleteVpcHoneyPotRequest,
) -> sas_20181203_models.DeleteVpcHoneyPotResponse:
runtime = util_models.RuntimeOptions()
return self.delete_vpc_honey_pot_with_options(request, runtime)
async def delete_vpc_honey_pot_async(
self,
request: sas_20181203_models.DeleteVpcHoneyPotRequest,
) -> sas_20181203_models.DeleteVpcHoneyPotResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_vpc_honey_pot_with_options_async(request, runtime)
def describe_accesskey_leak_list_with_options(
self,
request: sas_20181203_models.DescribeAccesskeyLeakListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAccesskeyLeakListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAccesskeyLeakListResponse(),
self.do_rpcrequest('DescribeAccesskeyLeakList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_accesskey_leak_list_with_options_async(
self,
request: sas_20181203_models.DescribeAccesskeyLeakListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAccesskeyLeakListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAccesskeyLeakListResponse(),
await self.do_rpcrequest_async('DescribeAccesskeyLeakList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_accesskey_leak_list(
self,
request: sas_20181203_models.DescribeAccesskeyLeakListRequest,
) -> sas_20181203_models.DescribeAccesskeyLeakListResponse:
runtime = util_models.RuntimeOptions()
return self.describe_accesskey_leak_list_with_options(request, runtime)
async def describe_accesskey_leak_list_async(
self,
request: sas_20181203_models.DescribeAccesskeyLeakListRequest,
) -> sas_20181203_models.DescribeAccesskeyLeakListResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_accesskey_leak_list_with_options_async(request, runtime)
def describe_affected_malicious_file_images_with_options(
self,
request: sas_20181203_models.DescribeAffectedMaliciousFileImagesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAffectedMaliciousFileImagesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAffectedMaliciousFileImagesResponse(),
self.do_rpcrequest('DescribeAffectedMaliciousFileImages', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_affected_malicious_file_images_with_options_async(
self,
request: sas_20181203_models.DescribeAffectedMaliciousFileImagesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAffectedMaliciousFileImagesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAffectedMaliciousFileImagesResponse(),
await self.do_rpcrequest_async('DescribeAffectedMaliciousFileImages', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_affected_malicious_file_images(
self,
request: sas_20181203_models.DescribeAffectedMaliciousFileImagesRequest,
) -> sas_20181203_models.DescribeAffectedMaliciousFileImagesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_affected_malicious_file_images_with_options(request, runtime)
async def describe_affected_malicious_file_images_async(
self,
request: sas_20181203_models.DescribeAffectedMaliciousFileImagesRequest,
) -> sas_20181203_models.DescribeAffectedMaliciousFileImagesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_affected_malicious_file_images_with_options_async(request, runtime)
def describe_alarm_event_detail_with_options(
self,
request: sas_20181203_models.DescribeAlarmEventDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAlarmEventDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAlarmEventDetailResponse(),
self.do_rpcrequest('DescribeAlarmEventDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_alarm_event_detail_with_options_async(
self,
request: sas_20181203_models.DescribeAlarmEventDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAlarmEventDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAlarmEventDetailResponse(),
await self.do_rpcrequest_async('DescribeAlarmEventDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_alarm_event_detail(
self,
request: sas_20181203_models.DescribeAlarmEventDetailRequest,
) -> sas_20181203_models.DescribeAlarmEventDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_alarm_event_detail_with_options(request, runtime)
async def describe_alarm_event_detail_async(
self,
request: sas_20181203_models.DescribeAlarmEventDetailRequest,
) -> sas_20181203_models.DescribeAlarmEventDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_alarm_event_detail_with_options_async(request, runtime)
def describe_alarm_event_list_with_options(
self,
request: sas_20181203_models.DescribeAlarmEventListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAlarmEventListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAlarmEventListResponse(),
self.do_rpcrequest('DescribeAlarmEventList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_alarm_event_list_with_options_async(
self,
request: sas_20181203_models.DescribeAlarmEventListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAlarmEventListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAlarmEventListResponse(),
await self.do_rpcrequest_async('DescribeAlarmEventList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_alarm_event_list(
self,
request: sas_20181203_models.DescribeAlarmEventListRequest,
) -> sas_20181203_models.DescribeAlarmEventListResponse:
runtime = util_models.RuntimeOptions()
return self.describe_alarm_event_list_with_options(request, runtime)
async def describe_alarm_event_list_async(
self,
request: sas_20181203_models.DescribeAlarmEventListRequest,
) -> sas_20181203_models.DescribeAlarmEventListResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_alarm_event_list_with_options_async(request, runtime)
def describe_alarm_event_stack_info_with_options(
self,
request: sas_20181203_models.DescribeAlarmEventStackInfoRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAlarmEventStackInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAlarmEventStackInfoResponse(),
self.do_rpcrequest('DescribeAlarmEventStackInfo', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_alarm_event_stack_info_with_options_async(
self,
request: sas_20181203_models.DescribeAlarmEventStackInfoRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAlarmEventStackInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAlarmEventStackInfoResponse(),
await self.do_rpcrequest_async('DescribeAlarmEventStackInfo', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_alarm_event_stack_info(
self,
request: sas_20181203_models.DescribeAlarmEventStackInfoRequest,
) -> sas_20181203_models.DescribeAlarmEventStackInfoResponse:
runtime = util_models.RuntimeOptions()
return self.describe_alarm_event_stack_info_with_options(request, runtime)
async def describe_alarm_event_stack_info_async(
self,
request: sas_20181203_models.DescribeAlarmEventStackInfoRequest,
) -> sas_20181203_models.DescribeAlarmEventStackInfoResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_alarm_event_stack_info_with_options_async(request, runtime)
def describe_all_entity_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAllEntityResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeAllEntityResponse(),
self.do_rpcrequest('DescribeAllEntity', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_all_entity_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAllEntityResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeAllEntityResponse(),
await self.do_rpcrequest_async('DescribeAllEntity', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_all_entity(self) -> sas_20181203_models.DescribeAllEntityResponse:
runtime = util_models.RuntimeOptions()
return self.describe_all_entity_with_options(runtime)
async def describe_all_entity_async(self) -> sas_20181203_models.DescribeAllEntityResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_all_entity_with_options_async(runtime)
def describe_all_groups_with_options(
self,
request: sas_20181203_models.DescribeAllGroupsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAllGroupsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAllGroupsResponse(),
self.do_rpcrequest('DescribeAllGroups', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_all_groups_with_options_async(
self,
request: sas_20181203_models.DescribeAllGroupsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAllGroupsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAllGroupsResponse(),
await self.do_rpcrequest_async('DescribeAllGroups', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_all_groups(
self,
request: sas_20181203_models.DescribeAllGroupsRequest,
) -> sas_20181203_models.DescribeAllGroupsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_all_groups_with_options(request, runtime)
async def describe_all_groups_async(
self,
request: sas_20181203_models.DescribeAllGroupsRequest,
) -> sas_20181203_models.DescribeAllGroupsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_all_groups_with_options_async(request, runtime)
def describe_all_regions_statistics_with_options(
self,
request: sas_20181203_models.DescribeAllRegionsStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAllRegionsStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAllRegionsStatisticsResponse(),
self.do_rpcrequest('DescribeAllRegionsStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_all_regions_statistics_with_options_async(
self,
request: sas_20181203_models.DescribeAllRegionsStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAllRegionsStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAllRegionsStatisticsResponse(),
await self.do_rpcrequest_async('DescribeAllRegionsStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_all_regions_statistics(
self,
request: sas_20181203_models.DescribeAllRegionsStatisticsRequest,
) -> sas_20181203_models.DescribeAllRegionsStatisticsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_all_regions_statistics_with_options(request, runtime)
async def describe_all_regions_statistics_async(
self,
request: sas_20181203_models.DescribeAllRegionsStatisticsRequest,
) -> sas_20181203_models.DescribeAllRegionsStatisticsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_all_regions_statistics_with_options_async(request, runtime)
def describe_anti_brute_force_rules_with_options(
self,
request: sas_20181203_models.DescribeAntiBruteForceRulesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAntiBruteForceRulesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAntiBruteForceRulesResponse(),
self.do_rpcrequest('DescribeAntiBruteForceRules', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_anti_brute_force_rules_with_options_async(
self,
request: sas_20181203_models.DescribeAntiBruteForceRulesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAntiBruteForceRulesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAntiBruteForceRulesResponse(),
await self.do_rpcrequest_async('DescribeAntiBruteForceRules', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_anti_brute_force_rules(
self,
request: sas_20181203_models.DescribeAntiBruteForceRulesRequest,
) -> sas_20181203_models.DescribeAntiBruteForceRulesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_anti_brute_force_rules_with_options(request, runtime)
async def describe_anti_brute_force_rules_async(
self,
request: sas_20181203_models.DescribeAntiBruteForceRulesRequest,
) -> sas_20181203_models.DescribeAntiBruteForceRulesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_anti_brute_force_rules_with_options_async(request, runtime)
def describe_asset_detail_by_uuid_with_options(
self,
request: sas_20181203_models.DescribeAssetDetailByUuidRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAssetDetailByUuidResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAssetDetailByUuidResponse(),
self.do_rpcrequest('DescribeAssetDetailByUuid', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_asset_detail_by_uuid_with_options_async(
self,
request: sas_20181203_models.DescribeAssetDetailByUuidRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAssetDetailByUuidResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAssetDetailByUuidResponse(),
await self.do_rpcrequest_async('DescribeAssetDetailByUuid', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_asset_detail_by_uuid(
self,
request: sas_20181203_models.DescribeAssetDetailByUuidRequest,
) -> sas_20181203_models.DescribeAssetDetailByUuidResponse:
runtime = util_models.RuntimeOptions()
return self.describe_asset_detail_by_uuid_with_options(request, runtime)
async def describe_asset_detail_by_uuid_async(
self,
request: sas_20181203_models.DescribeAssetDetailByUuidRequest,
) -> sas_20181203_models.DescribeAssetDetailByUuidResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_asset_detail_by_uuid_with_options_async(request, runtime)
def describe_asset_detail_by_uuids_with_options(
self,
request: sas_20181203_models.DescribeAssetDetailByUuidsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAssetDetailByUuidsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAssetDetailByUuidsResponse(),
self.do_rpcrequest('DescribeAssetDetailByUuids', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_asset_detail_by_uuids_with_options_async(
self,
request: sas_20181203_models.DescribeAssetDetailByUuidsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAssetDetailByUuidsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeAssetDetailByUuidsResponse(),
await self.do_rpcrequest_async('DescribeAssetDetailByUuids', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_asset_detail_by_uuids(
self,
request: sas_20181203_models.DescribeAssetDetailByUuidsRequest,
) -> sas_20181203_models.DescribeAssetDetailByUuidsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_asset_detail_by_uuids_with_options(request, runtime)
async def describe_asset_detail_by_uuids_async(
self,
request: sas_20181203_models.DescribeAssetDetailByUuidsRequest,
) -> sas_20181203_models.DescribeAssetDetailByUuidsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_asset_detail_by_uuids_with_options_async(request, runtime)
def describe_auto_del_config_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAutoDelConfigResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeAutoDelConfigResponse(),
self.do_rpcrequest('DescribeAutoDelConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_auto_del_config_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeAutoDelConfigResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeAutoDelConfigResponse(),
await self.do_rpcrequest_async('DescribeAutoDelConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_auto_del_config(self) -> sas_20181203_models.DescribeAutoDelConfigResponse:
runtime = util_models.RuntimeOptions()
return self.describe_auto_del_config_with_options(runtime)
async def describe_auto_del_config_async(self) -> sas_20181203_models.DescribeAutoDelConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_auto_del_config_with_options_async(runtime)
def describe_backup_clients_with_options(
self,
request: sas_20181203_models.DescribeBackupClientsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupClientsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupClientsResponse(),
self.do_rpcrequest('DescribeBackupClients', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_backup_clients_with_options_async(
self,
request: sas_20181203_models.DescribeBackupClientsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupClientsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupClientsResponse(),
await self.do_rpcrequest_async('DescribeBackupClients', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_backup_clients(
self,
request: sas_20181203_models.DescribeBackupClientsRequest,
) -> sas_20181203_models.DescribeBackupClientsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_backup_clients_with_options(request, runtime)
async def describe_backup_clients_async(
self,
request: sas_20181203_models.DescribeBackupClientsRequest,
) -> sas_20181203_models.DescribeBackupClientsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_backup_clients_with_options_async(request, runtime)
def describe_backup_dirs_with_options(
self,
request: sas_20181203_models.DescribeBackupDirsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupDirsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupDirsResponse(),
self.do_rpcrequest('DescribeBackupDirs', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_backup_dirs_with_options_async(
self,
request: sas_20181203_models.DescribeBackupDirsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupDirsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupDirsResponse(),
await self.do_rpcrequest_async('DescribeBackupDirs', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_backup_dirs(
self,
request: sas_20181203_models.DescribeBackupDirsRequest,
) -> sas_20181203_models.DescribeBackupDirsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_backup_dirs_with_options(request, runtime)
async def describe_backup_dirs_async(
self,
request: sas_20181203_models.DescribeBackupDirsRequest,
) -> sas_20181203_models.DescribeBackupDirsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_backup_dirs_with_options_async(request, runtime)
def describe_backup_files_with_options(
self,
request: sas_20181203_models.DescribeBackupFilesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupFilesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupFilesResponse(),
self.do_rpcrequest('DescribeBackupFiles', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_backup_files_with_options_async(
self,
request: sas_20181203_models.DescribeBackupFilesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupFilesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupFilesResponse(),
await self.do_rpcrequest_async('DescribeBackupFiles', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_backup_files(
self,
request: sas_20181203_models.DescribeBackupFilesRequest,
) -> sas_20181203_models.DescribeBackupFilesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_backup_files_with_options(request, runtime)
async def describe_backup_files_async(
self,
request: sas_20181203_models.DescribeBackupFilesRequest,
) -> sas_20181203_models.DescribeBackupFilesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_backup_files_with_options_async(request, runtime)
def describe_backup_machine_status_with_options(
self,
request: sas_20181203_models.DescribeBackupMachineStatusRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupMachineStatusResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupMachineStatusResponse(),
self.do_rpcrequest('DescribeBackupMachineStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_backup_machine_status_with_options_async(
self,
request: sas_20181203_models.DescribeBackupMachineStatusRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupMachineStatusResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupMachineStatusResponse(),
await self.do_rpcrequest_async('DescribeBackupMachineStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_backup_machine_status(
self,
request: sas_20181203_models.DescribeBackupMachineStatusRequest,
) -> sas_20181203_models.DescribeBackupMachineStatusResponse:
runtime = util_models.RuntimeOptions()
return self.describe_backup_machine_status_with_options(request, runtime)
async def describe_backup_machine_status_async(
self,
request: sas_20181203_models.DescribeBackupMachineStatusRequest,
) -> sas_20181203_models.DescribeBackupMachineStatusResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_backup_machine_status_with_options_async(request, runtime)
def describe_backup_policies_with_options(
self,
request: sas_20181203_models.DescribeBackupPoliciesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupPoliciesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupPoliciesResponse(),
self.do_rpcrequest('DescribeBackupPolicies', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_backup_policies_with_options_async(
self,
request: sas_20181203_models.DescribeBackupPoliciesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupPoliciesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupPoliciesResponse(),
await self.do_rpcrequest_async('DescribeBackupPolicies', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_backup_policies(
self,
request: sas_20181203_models.DescribeBackupPoliciesRequest,
) -> sas_20181203_models.DescribeBackupPoliciesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_backup_policies_with_options(request, runtime)
async def describe_backup_policies_async(
self,
request: sas_20181203_models.DescribeBackupPoliciesRequest,
) -> sas_20181203_models.DescribeBackupPoliciesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_backup_policies_with_options_async(request, runtime)
def describe_backup_policy_with_options(
self,
request: sas_20181203_models.DescribeBackupPolicyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupPolicyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupPolicyResponse(),
self.do_rpcrequest('DescribeBackupPolicy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_backup_policy_with_options_async(
self,
request: sas_20181203_models.DescribeBackupPolicyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupPolicyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupPolicyResponse(),
await self.do_rpcrequest_async('DescribeBackupPolicy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_backup_policy(
self,
request: sas_20181203_models.DescribeBackupPolicyRequest,
) -> sas_20181203_models.DescribeBackupPolicyResponse:
runtime = util_models.RuntimeOptions()
return self.describe_backup_policy_with_options(request, runtime)
async def describe_backup_policy_async(
self,
request: sas_20181203_models.DescribeBackupPolicyRequest,
) -> sas_20181203_models.DescribeBackupPolicyResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_backup_policy_with_options_async(request, runtime)
def describe_backup_restore_count_with_options(
self,
request: sas_20181203_models.DescribeBackupRestoreCountRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupRestoreCountResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupRestoreCountResponse(),
self.do_rpcrequest('DescribeBackupRestoreCount', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_backup_restore_count_with_options_async(
self,
request: sas_20181203_models.DescribeBackupRestoreCountRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBackupRestoreCountResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBackupRestoreCountResponse(),
await self.do_rpcrequest_async('DescribeBackupRestoreCount', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_backup_restore_count(
self,
request: sas_20181203_models.DescribeBackupRestoreCountRequest,
) -> sas_20181203_models.DescribeBackupRestoreCountResponse:
runtime = util_models.RuntimeOptions()
return self.describe_backup_restore_count_with_options(request, runtime)
async def describe_backup_restore_count_async(
self,
request: sas_20181203_models.DescribeBackupRestoreCountRequest,
) -> sas_20181203_models.DescribeBackupRestoreCountResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_backup_restore_count_with_options_async(request, runtime)
def describe_brute_force_summary_with_options(
self,
request: sas_20181203_models.DescribeBruteForceSummaryRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBruteForceSummaryResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBruteForceSummaryResponse(),
self.do_rpcrequest('DescribeBruteForceSummary', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_brute_force_summary_with_options_async(
self,
request: sas_20181203_models.DescribeBruteForceSummaryRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeBruteForceSummaryResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeBruteForceSummaryResponse(),
await self.do_rpcrequest_async('DescribeBruteForceSummary', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_brute_force_summary(
self,
request: sas_20181203_models.DescribeBruteForceSummaryRequest,
) -> sas_20181203_models.DescribeBruteForceSummaryResponse:
runtime = util_models.RuntimeOptions()
return self.describe_brute_force_summary_with_options(request, runtime)
async def describe_brute_force_summary_async(
self,
request: sas_20181203_models.DescribeBruteForceSummaryRequest,
) -> sas_20181203_models.DescribeBruteForceSummaryResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_brute_force_summary_with_options_async(request, runtime)
def describe_check_ecs_warnings_with_options(
self,
request: sas_20181203_models.DescribeCheckEcsWarningsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCheckEcsWarningsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeCheckEcsWarningsResponse(),
self.do_rpcrequest('DescribeCheckEcsWarnings', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_check_ecs_warnings_with_options_async(
self,
request: sas_20181203_models.DescribeCheckEcsWarningsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCheckEcsWarningsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeCheckEcsWarningsResponse(),
await self.do_rpcrequest_async('DescribeCheckEcsWarnings', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_check_ecs_warnings(
self,
request: sas_20181203_models.DescribeCheckEcsWarningsRequest,
) -> sas_20181203_models.DescribeCheckEcsWarningsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_check_ecs_warnings_with_options(request, runtime)
async def describe_check_ecs_warnings_async(
self,
request: sas_20181203_models.DescribeCheckEcsWarningsRequest,
) -> sas_20181203_models.DescribeCheckEcsWarningsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_check_ecs_warnings_with_options_async(request, runtime)
def describe_check_warning_detail_with_options(
self,
request: sas_20181203_models.DescribeCheckWarningDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCheckWarningDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeCheckWarningDetailResponse(),
self.do_rpcrequest('DescribeCheckWarningDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_check_warning_detail_with_options_async(
self,
request: sas_20181203_models.DescribeCheckWarningDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCheckWarningDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeCheckWarningDetailResponse(),
await self.do_rpcrequest_async('DescribeCheckWarningDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_check_warning_detail(
self,
request: sas_20181203_models.DescribeCheckWarningDetailRequest,
) -> sas_20181203_models.DescribeCheckWarningDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_check_warning_detail_with_options(request, runtime)
async def describe_check_warning_detail_async(
self,
request: sas_20181203_models.DescribeCheckWarningDetailRequest,
) -> sas_20181203_models.DescribeCheckWarningDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_check_warning_detail_with_options_async(request, runtime)
def describe_check_warnings_with_options(
self,
request: sas_20181203_models.DescribeCheckWarningsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCheckWarningsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeCheckWarningsResponse(),
self.do_rpcrequest('DescribeCheckWarnings', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_check_warnings_with_options_async(
self,
request: sas_20181203_models.DescribeCheckWarningsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCheckWarningsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeCheckWarningsResponse(),
await self.do_rpcrequest_async('DescribeCheckWarnings', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_check_warnings(
self,
request: sas_20181203_models.DescribeCheckWarningsRequest,
) -> sas_20181203_models.DescribeCheckWarningsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_check_warnings_with_options(request, runtime)
async def describe_check_warnings_async(
self,
request: sas_20181203_models.DescribeCheckWarningsRequest,
) -> sas_20181203_models.DescribeCheckWarningsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_check_warnings_with_options_async(request, runtime)
def describe_check_warning_summary_with_options(
self,
request: sas_20181203_models.DescribeCheckWarningSummaryRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCheckWarningSummaryResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeCheckWarningSummaryResponse(),
self.do_rpcrequest('DescribeCheckWarningSummary', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_check_warning_summary_with_options_async(
self,
request: sas_20181203_models.DescribeCheckWarningSummaryRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCheckWarningSummaryResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeCheckWarningSummaryResponse(),
await self.do_rpcrequest_async('DescribeCheckWarningSummary', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_check_warning_summary(
self,
request: sas_20181203_models.DescribeCheckWarningSummaryRequest,
) -> sas_20181203_models.DescribeCheckWarningSummaryResponse:
runtime = util_models.RuntimeOptions()
return self.describe_check_warning_summary_with_options(request, runtime)
async def describe_check_warning_summary_async(
self,
request: sas_20181203_models.DescribeCheckWarningSummaryRequest,
) -> sas_20181203_models.DescribeCheckWarningSummaryResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_check_warning_summary_with_options_async(request, runtime)
def describe_cloud_center_instances_with_options(
self,
request: sas_20181203_models.DescribeCloudCenterInstancesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCloudCenterInstancesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeCloudCenterInstancesResponse(),
self.do_rpcrequest('DescribeCloudCenterInstances', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_cloud_center_instances_with_options_async(
self,
request: sas_20181203_models.DescribeCloudCenterInstancesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCloudCenterInstancesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeCloudCenterInstancesResponse(),
await self.do_rpcrequest_async('DescribeCloudCenterInstances', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_cloud_center_instances(
self,
request: sas_20181203_models.DescribeCloudCenterInstancesRequest,
) -> sas_20181203_models.DescribeCloudCenterInstancesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_cloud_center_instances_with_options(request, runtime)
async def describe_cloud_center_instances_async(
self,
request: sas_20181203_models.DescribeCloudCenterInstancesRequest,
) -> sas_20181203_models.DescribeCloudCenterInstancesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_cloud_center_instances_with_options_async(request, runtime)
def describe_cloud_product_field_statistics_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCloudProductFieldStatisticsResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeCloudProductFieldStatisticsResponse(),
self.do_rpcrequest('DescribeCloudProductFieldStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_cloud_product_field_statistics_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCloudProductFieldStatisticsResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeCloudProductFieldStatisticsResponse(),
await self.do_rpcrequest_async('DescribeCloudProductFieldStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_cloud_product_field_statistics(self) -> sas_20181203_models.DescribeCloudProductFieldStatisticsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_cloud_product_field_statistics_with_options(runtime)
async def describe_cloud_product_field_statistics_async(self) -> sas_20181203_models.DescribeCloudProductFieldStatisticsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_cloud_product_field_statistics_with_options_async(runtime)
def describe_concern_necessity_with_options(
self,
request: sas_20181203_models.DescribeConcernNecessityRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeConcernNecessityResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeConcernNecessityResponse(),
self.do_rpcrequest('DescribeConcernNecessity', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_concern_necessity_with_options_async(
self,
request: sas_20181203_models.DescribeConcernNecessityRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeConcernNecessityResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeConcernNecessityResponse(),
await self.do_rpcrequest_async('DescribeConcernNecessity', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_concern_necessity(
self,
request: sas_20181203_models.DescribeConcernNecessityRequest,
) -> sas_20181203_models.DescribeConcernNecessityResponse:
runtime = util_models.RuntimeOptions()
return self.describe_concern_necessity_with_options(request, runtime)
async def describe_concern_necessity_async(
self,
request: sas_20181203_models.DescribeConcernNecessityRequest,
) -> sas_20181203_models.DescribeConcernNecessityResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_concern_necessity_with_options_async(request, runtime)
def describe_container_statistics_with_options(
self,
request: sas_20181203_models.DescribeContainerStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeContainerStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeContainerStatisticsResponse(),
self.do_rpcrequest('DescribeContainerStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_container_statistics_with_options_async(
self,
request: sas_20181203_models.DescribeContainerStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeContainerStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeContainerStatisticsResponse(),
await self.do_rpcrequest_async('DescribeContainerStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_container_statistics(
self,
request: sas_20181203_models.DescribeContainerStatisticsRequest,
) -> sas_20181203_models.DescribeContainerStatisticsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_container_statistics_with_options(request, runtime)
async def describe_container_statistics_async(
self,
request: sas_20181203_models.DescribeContainerStatisticsRequest,
) -> sas_20181203_models.DescribeContainerStatisticsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_container_statistics_with_options_async(request, runtime)
def describe_criteria_with_options(
self,
request: sas_20181203_models.DescribeCriteriaRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCriteriaResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeCriteriaResponse(),
self.do_rpcrequest('DescribeCriteria', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_criteria_with_options_async(
self,
request: sas_20181203_models.DescribeCriteriaRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeCriteriaResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeCriteriaResponse(),
await self.do_rpcrequest_async('DescribeCriteria', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_criteria(
self,
request: sas_20181203_models.DescribeCriteriaRequest,
) -> sas_20181203_models.DescribeCriteriaResponse:
runtime = util_models.RuntimeOptions()
return self.describe_criteria_with_options(request, runtime)
async def describe_criteria_async(
self,
request: sas_20181203_models.DescribeCriteriaRequest,
) -> sas_20181203_models.DescribeCriteriaResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_criteria_with_options_async(request, runtime)
def describe_dialog_messages_with_options(
self,
request: sas_20181203_models.DescribeDialogMessagesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeDialogMessagesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeDialogMessagesResponse(),
self.do_rpcrequest('DescribeDialogMessages', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_dialog_messages_with_options_async(
self,
request: sas_20181203_models.DescribeDialogMessagesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeDialogMessagesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeDialogMessagesResponse(),
await self.do_rpcrequest_async('DescribeDialogMessages', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_dialog_messages(
self,
request: sas_20181203_models.DescribeDialogMessagesRequest,
) -> sas_20181203_models.DescribeDialogMessagesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_dialog_messages_with_options(request, runtime)
async def describe_dialog_messages_async(
self,
request: sas_20181203_models.DescribeDialogMessagesRequest,
) -> sas_20181203_models.DescribeDialogMessagesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_dialog_messages_with_options_async(request, runtime)
def describe_ding_talk_with_options(
self,
request: sas_20181203_models.DescribeDingTalkRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeDingTalkResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeDingTalkResponse(),
self.do_rpcrequest('DescribeDingTalk', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_ding_talk_with_options_async(
self,
request: sas_20181203_models.DescribeDingTalkRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeDingTalkResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeDingTalkResponse(),
await self.do_rpcrequest_async('DescribeDingTalk', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_ding_talk(
self,
request: sas_20181203_models.DescribeDingTalkRequest,
) -> sas_20181203_models.DescribeDingTalkResponse:
runtime = util_models.RuntimeOptions()
return self.describe_ding_talk_with_options(request, runtime)
async def describe_ding_talk_async(
self,
request: sas_20181203_models.DescribeDingTalkRequest,
) -> sas_20181203_models.DescribeDingTalkResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_ding_talk_with_options_async(request, runtime)
def describe_domain_count_with_options(
self,
request: sas_20181203_models.DescribeDomainCountRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeDomainCountResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeDomainCountResponse(),
self.do_rpcrequest('DescribeDomainCount', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_domain_count_with_options_async(
self,
request: sas_20181203_models.DescribeDomainCountRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeDomainCountResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeDomainCountResponse(),
await self.do_rpcrequest_async('DescribeDomainCount', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_domain_count(
self,
request: sas_20181203_models.DescribeDomainCountRequest,
) -> sas_20181203_models.DescribeDomainCountResponse:
runtime = util_models.RuntimeOptions()
return self.describe_domain_count_with_options(request, runtime)
async def describe_domain_count_async(
self,
request: sas_20181203_models.DescribeDomainCountRequest,
) -> sas_20181203_models.DescribeDomainCountResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_domain_count_with_options_async(request, runtime)
def describe_domain_detail_with_options(
self,
request: sas_20181203_models.DescribeDomainDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeDomainDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeDomainDetailResponse(),
self.do_rpcrequest('DescribeDomainDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_domain_detail_with_options_async(
self,
request: sas_20181203_models.DescribeDomainDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeDomainDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeDomainDetailResponse(),
await self.do_rpcrequest_async('DescribeDomainDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_domain_detail(
self,
request: sas_20181203_models.DescribeDomainDetailRequest,
) -> sas_20181203_models.DescribeDomainDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_domain_detail_with_options(request, runtime)
async def describe_domain_detail_async(
self,
request: sas_20181203_models.DescribeDomainDetailRequest,
) -> sas_20181203_models.DescribeDomainDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_domain_detail_with_options_async(request, runtime)
def describe_domain_list_with_options(
self,
request: sas_20181203_models.DescribeDomainListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeDomainListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeDomainListResponse(),
self.do_rpcrequest('DescribeDomainList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_domain_list_with_options_async(
self,
request: sas_20181203_models.DescribeDomainListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeDomainListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeDomainListResponse(),
await self.do_rpcrequest_async('DescribeDomainList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_domain_list(
self,
request: sas_20181203_models.DescribeDomainListRequest,
) -> sas_20181203_models.DescribeDomainListResponse:
runtime = util_models.RuntimeOptions()
return self.describe_domain_list_with_options(request, runtime)
async def describe_domain_list_async(
self,
request: sas_20181203_models.DescribeDomainListRequest,
) -> sas_20181203_models.DescribeDomainListResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_domain_list_with_options_async(request, runtime)
def describe_emg_vul_item_with_options(
self,
request: sas_20181203_models.DescribeEmgVulItemRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeEmgVulItemResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeEmgVulItemResponse(),
self.do_rpcrequest('DescribeEmgVulItem', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_emg_vul_item_with_options_async(
self,
request: sas_20181203_models.DescribeEmgVulItemRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeEmgVulItemResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeEmgVulItemResponse(),
await self.do_rpcrequest_async('DescribeEmgVulItem', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_emg_vul_item(
self,
request: sas_20181203_models.DescribeEmgVulItemRequest,
) -> sas_20181203_models.DescribeEmgVulItemResponse:
runtime = util_models.RuntimeOptions()
return self.describe_emg_vul_item_with_options(request, runtime)
async def describe_emg_vul_item_async(
self,
request: sas_20181203_models.DescribeEmgVulItemRequest,
) -> sas_20181203_models.DescribeEmgVulItemResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_emg_vul_item_with_options_async(request, runtime)
def describe_exclude_system_path_with_options(
self,
request: sas_20181203_models.DescribeExcludeSystemPathRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExcludeSystemPathResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeExcludeSystemPathResponse(),
self.do_rpcrequest('DescribeExcludeSystemPath', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_exclude_system_path_with_options_async(
self,
request: sas_20181203_models.DescribeExcludeSystemPathRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExcludeSystemPathResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeExcludeSystemPathResponse(),
await self.do_rpcrequest_async('DescribeExcludeSystemPath', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_exclude_system_path(
self,
request: sas_20181203_models.DescribeExcludeSystemPathRequest,
) -> sas_20181203_models.DescribeExcludeSystemPathResponse:
runtime = util_models.RuntimeOptions()
return self.describe_exclude_system_path_with_options(request, runtime)
async def describe_exclude_system_path_async(
self,
request: sas_20181203_models.DescribeExcludeSystemPathRequest,
) -> sas_20181203_models.DescribeExcludeSystemPathResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_exclude_system_path_with_options_async(request, runtime)
def describe_export_info_with_options(
self,
request: sas_20181203_models.DescribeExportInfoRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExportInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeExportInfoResponse(),
self.do_rpcrequest('DescribeExportInfo', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_export_info_with_options_async(
self,
request: sas_20181203_models.DescribeExportInfoRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExportInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeExportInfoResponse(),
await self.do_rpcrequest_async('DescribeExportInfo', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_export_info(
self,
request: sas_20181203_models.DescribeExportInfoRequest,
) -> sas_20181203_models.DescribeExportInfoResponse:
runtime = util_models.RuntimeOptions()
return self.describe_export_info_with_options(request, runtime)
async def describe_export_info_async(
self,
request: sas_20181203_models.DescribeExportInfoRequest,
) -> sas_20181203_models.DescribeExportInfoResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_export_info_with_options_async(request, runtime)
def describe_exposed_instance_criteria_with_options(
self,
request: sas_20181203_models.DescribeExposedInstanceCriteriaRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExposedInstanceCriteriaResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeExposedInstanceCriteriaResponse(),
self.do_rpcrequest('DescribeExposedInstanceCriteria', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_exposed_instance_criteria_with_options_async(
self,
request: sas_20181203_models.DescribeExposedInstanceCriteriaRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExposedInstanceCriteriaResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeExposedInstanceCriteriaResponse(),
await self.do_rpcrequest_async('DescribeExposedInstanceCriteria', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_exposed_instance_criteria(
self,
request: sas_20181203_models.DescribeExposedInstanceCriteriaRequest,
) -> sas_20181203_models.DescribeExposedInstanceCriteriaResponse:
runtime = util_models.RuntimeOptions()
return self.describe_exposed_instance_criteria_with_options(request, runtime)
async def describe_exposed_instance_criteria_async(
self,
request: sas_20181203_models.DescribeExposedInstanceCriteriaRequest,
) -> sas_20181203_models.DescribeExposedInstanceCriteriaResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_exposed_instance_criteria_with_options_async(request, runtime)
def describe_exposed_instance_detail_with_options(
self,
request: sas_20181203_models.DescribeExposedInstanceDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExposedInstanceDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeExposedInstanceDetailResponse(),
self.do_rpcrequest('DescribeExposedInstanceDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_exposed_instance_detail_with_options_async(
self,
request: sas_20181203_models.DescribeExposedInstanceDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExposedInstanceDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeExposedInstanceDetailResponse(),
await self.do_rpcrequest_async('DescribeExposedInstanceDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_exposed_instance_detail(
self,
request: sas_20181203_models.DescribeExposedInstanceDetailRequest,
) -> sas_20181203_models.DescribeExposedInstanceDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_exposed_instance_detail_with_options(request, runtime)
async def describe_exposed_instance_detail_async(
self,
request: sas_20181203_models.DescribeExposedInstanceDetailRequest,
) -> sas_20181203_models.DescribeExposedInstanceDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_exposed_instance_detail_with_options_async(request, runtime)
def describe_exposed_instance_list_with_options(
self,
request: sas_20181203_models.DescribeExposedInstanceListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExposedInstanceListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeExposedInstanceListResponse(),
self.do_rpcrequest('DescribeExposedInstanceList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_exposed_instance_list_with_options_async(
self,
request: sas_20181203_models.DescribeExposedInstanceListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExposedInstanceListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeExposedInstanceListResponse(),
await self.do_rpcrequest_async('DescribeExposedInstanceList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_exposed_instance_list(
self,
request: sas_20181203_models.DescribeExposedInstanceListRequest,
) -> sas_20181203_models.DescribeExposedInstanceListResponse:
runtime = util_models.RuntimeOptions()
return self.describe_exposed_instance_list_with_options(request, runtime)
async def describe_exposed_instance_list_async(
self,
request: sas_20181203_models.DescribeExposedInstanceListRequest,
) -> sas_20181203_models.DescribeExposedInstanceListResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_exposed_instance_list_with_options_async(request, runtime)
def describe_exposed_statistics_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExposedStatisticsResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeExposedStatisticsResponse(),
self.do_rpcrequest('DescribeExposedStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_exposed_statistics_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExposedStatisticsResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeExposedStatisticsResponse(),
await self.do_rpcrequest_async('DescribeExposedStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_exposed_statistics(self) -> sas_20181203_models.DescribeExposedStatisticsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_exposed_statistics_with_options(runtime)
async def describe_exposed_statistics_async(self) -> sas_20181203_models.DescribeExposedStatisticsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_exposed_statistics_with_options_async(runtime)
def describe_exposed_statistics_detail_with_options(
self,
request: sas_20181203_models.DescribeExposedStatisticsDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExposedStatisticsDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeExposedStatisticsDetailResponse(),
self.do_rpcrequest('DescribeExposedStatisticsDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_exposed_statistics_detail_with_options_async(
self,
request: sas_20181203_models.DescribeExposedStatisticsDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeExposedStatisticsDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeExposedStatisticsDetailResponse(),
await self.do_rpcrequest_async('DescribeExposedStatisticsDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_exposed_statistics_detail(
self,
request: sas_20181203_models.DescribeExposedStatisticsDetailRequest,
) -> sas_20181203_models.DescribeExposedStatisticsDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_exposed_statistics_detail_with_options(request, runtime)
async def describe_exposed_statistics_detail_async(
self,
request: sas_20181203_models.DescribeExposedStatisticsDetailRequest,
) -> sas_20181203_models.DescribeExposedStatisticsDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_exposed_statistics_detail_with_options_async(request, runtime)
def describe_field_statistics_with_options(
self,
request: sas_20181203_models.DescribeFieldStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeFieldStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeFieldStatisticsResponse(),
self.do_rpcrequest('DescribeFieldStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_field_statistics_with_options_async(
self,
request: sas_20181203_models.DescribeFieldStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeFieldStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeFieldStatisticsResponse(),
await self.do_rpcrequest_async('DescribeFieldStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_field_statistics(
self,
request: sas_20181203_models.DescribeFieldStatisticsRequest,
) -> sas_20181203_models.DescribeFieldStatisticsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_field_statistics_with_options(request, runtime)
async def describe_field_statistics_async(
self,
request: sas_20181203_models.DescribeFieldStatisticsRequest,
) -> sas_20181203_models.DescribeFieldStatisticsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_field_statistics_with_options_async(request, runtime)
def describe_front_vul_patch_list_with_options(
self,
request: sas_20181203_models.DescribeFrontVulPatchListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeFrontVulPatchListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeFrontVulPatchListResponse(),
self.do_rpcrequest('DescribeFrontVulPatchList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_front_vul_patch_list_with_options_async(
self,
request: sas_20181203_models.DescribeFrontVulPatchListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeFrontVulPatchListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeFrontVulPatchListResponse(),
await self.do_rpcrequest_async('DescribeFrontVulPatchList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_front_vul_patch_list(
self,
request: sas_20181203_models.DescribeFrontVulPatchListRequest,
) -> sas_20181203_models.DescribeFrontVulPatchListResponse:
runtime = util_models.RuntimeOptions()
return self.describe_front_vul_patch_list_with_options(request, runtime)
async def describe_front_vul_patch_list_async(
self,
request: sas_20181203_models.DescribeFrontVulPatchListRequest,
) -> sas_20181203_models.DescribeFrontVulPatchListResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_front_vul_patch_list_with_options_async(request, runtime)
def describe_graph_4investigation_online_with_options(
self,
request: sas_20181203_models.DescribeGraph4InvestigationOnlineRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeGraph4InvestigationOnlineResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeGraph4InvestigationOnlineResponse(),
self.do_rpcrequest('DescribeGraph4InvestigationOnline', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_graph_4investigation_online_with_options_async(
self,
request: sas_20181203_models.DescribeGraph4InvestigationOnlineRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeGraph4InvestigationOnlineResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeGraph4InvestigationOnlineResponse(),
await self.do_rpcrequest_async('DescribeGraph4InvestigationOnline', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_graph_4investigation_online(
self,
request: sas_20181203_models.DescribeGraph4InvestigationOnlineRequest,
) -> sas_20181203_models.DescribeGraph4InvestigationOnlineResponse:
runtime = util_models.RuntimeOptions()
return self.describe_graph_4investigation_online_with_options(request, runtime)
async def describe_graph_4investigation_online_async(
self,
request: sas_20181203_models.DescribeGraph4InvestigationOnlineRequest,
) -> sas_20181203_models.DescribeGraph4InvestigationOnlineResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_graph_4investigation_online_with_options_async(request, runtime)
def describe_grouped_container_instances_with_options(
self,
request: sas_20181203_models.DescribeGroupedContainerInstancesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeGroupedContainerInstancesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeGroupedContainerInstancesResponse(),
self.do_rpcrequest('DescribeGroupedContainerInstances', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_grouped_container_instances_with_options_async(
self,
request: sas_20181203_models.DescribeGroupedContainerInstancesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeGroupedContainerInstancesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeGroupedContainerInstancesResponse(),
await self.do_rpcrequest_async('DescribeGroupedContainerInstances', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_grouped_container_instances(
self,
request: sas_20181203_models.DescribeGroupedContainerInstancesRequest,
) -> sas_20181203_models.DescribeGroupedContainerInstancesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_grouped_container_instances_with_options(request, runtime)
async def describe_grouped_container_instances_async(
self,
request: sas_20181203_models.DescribeGroupedContainerInstancesRequest,
) -> sas_20181203_models.DescribeGroupedContainerInstancesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_grouped_container_instances_with_options_async(request, runtime)
def describe_grouped_instances_with_options(
self,
request: sas_20181203_models.DescribeGroupedInstancesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeGroupedInstancesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeGroupedInstancesResponse(),
self.do_rpcrequest('DescribeGroupedInstances', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_grouped_instances_with_options_async(
self,
request: sas_20181203_models.DescribeGroupedInstancesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeGroupedInstancesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeGroupedInstancesResponse(),
await self.do_rpcrequest_async('DescribeGroupedInstances', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_grouped_instances(
self,
request: sas_20181203_models.DescribeGroupedInstancesRequest,
) -> sas_20181203_models.DescribeGroupedInstancesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_grouped_instances_with_options(request, runtime)
async def describe_grouped_instances_async(
self,
request: sas_20181203_models.DescribeGroupedInstancesRequest,
) -> sas_20181203_models.DescribeGroupedInstancesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_grouped_instances_with_options_async(request, runtime)
def describe_grouped_malicious_files_with_options(
self,
request: sas_20181203_models.DescribeGroupedMaliciousFilesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeGroupedMaliciousFilesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeGroupedMaliciousFilesResponse(),
self.do_rpcrequest('DescribeGroupedMaliciousFiles', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_grouped_malicious_files_with_options_async(
self,
request: sas_20181203_models.DescribeGroupedMaliciousFilesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeGroupedMaliciousFilesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeGroupedMaliciousFilesResponse(),
await self.do_rpcrequest_async('DescribeGroupedMaliciousFiles', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_grouped_malicious_files(
self,
request: sas_20181203_models.DescribeGroupedMaliciousFilesRequest,
) -> sas_20181203_models.DescribeGroupedMaliciousFilesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_grouped_malicious_files_with_options(request, runtime)
async def describe_grouped_malicious_files_async(
self,
request: sas_20181203_models.DescribeGroupedMaliciousFilesRequest,
) -> sas_20181203_models.DescribeGroupedMaliciousFilesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_grouped_malicious_files_with_options_async(request, runtime)
def describe_grouped_tags_with_options(
self,
request: sas_20181203_models.DescribeGroupedTagsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeGroupedTagsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeGroupedTagsResponse(),
self.do_rpcrequest('DescribeGroupedTags', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_grouped_tags_with_options_async(
self,
request: sas_20181203_models.DescribeGroupedTagsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeGroupedTagsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeGroupedTagsResponse(),
await self.do_rpcrequest_async('DescribeGroupedTags', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_grouped_tags(
self,
request: sas_20181203_models.DescribeGroupedTagsRequest,
) -> sas_20181203_models.DescribeGroupedTagsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_grouped_tags_with_options(request, runtime)
async def describe_grouped_tags_async(
self,
request: sas_20181203_models.DescribeGroupedTagsRequest,
) -> sas_20181203_models.DescribeGroupedTagsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_grouped_tags_with_options_async(request, runtime)
def describe_grouped_vul_with_options(
self,
request: sas_20181203_models.DescribeGroupedVulRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeGroupedVulResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeGroupedVulResponse(),
self.do_rpcrequest('DescribeGroupedVul', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_grouped_vul_with_options_async(
self,
request: sas_20181203_models.DescribeGroupedVulRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeGroupedVulResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeGroupedVulResponse(),
await self.do_rpcrequest_async('DescribeGroupedVul', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_grouped_vul(
self,
request: sas_20181203_models.DescribeGroupedVulRequest,
) -> sas_20181203_models.DescribeGroupedVulResponse:
runtime = util_models.RuntimeOptions()
return self.describe_grouped_vul_with_options(request, runtime)
async def describe_grouped_vul_async(
self,
request: sas_20181203_models.DescribeGroupedVulRequest,
) -> sas_20181203_models.DescribeGroupedVulResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_grouped_vul_with_options_async(request, runtime)
def describe_honey_pot_auth_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeHoneyPotAuthResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeHoneyPotAuthResponse(),
self.do_rpcrequest('DescribeHoneyPotAuth', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_honey_pot_auth_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeHoneyPotAuthResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeHoneyPotAuthResponse(),
await self.do_rpcrequest_async('DescribeHoneyPotAuth', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_honey_pot_auth(self) -> sas_20181203_models.DescribeHoneyPotAuthResponse:
runtime = util_models.RuntimeOptions()
return self.describe_honey_pot_auth_with_options(runtime)
async def describe_honey_pot_auth_async(self) -> sas_20181203_models.DescribeHoneyPotAuthResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_honey_pot_auth_with_options_async(runtime)
def describe_honey_pot_susp_statistics_with_options(
self,
request: sas_20181203_models.DescribeHoneyPotSuspStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeHoneyPotSuspStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeHoneyPotSuspStatisticsResponse(),
self.do_rpcrequest('DescribeHoneyPotSuspStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_honey_pot_susp_statistics_with_options_async(
self,
request: sas_20181203_models.DescribeHoneyPotSuspStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeHoneyPotSuspStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeHoneyPotSuspStatisticsResponse(),
await self.do_rpcrequest_async('DescribeHoneyPotSuspStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_honey_pot_susp_statistics(
self,
request: sas_20181203_models.DescribeHoneyPotSuspStatisticsRequest,
) -> sas_20181203_models.DescribeHoneyPotSuspStatisticsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_honey_pot_susp_statistics_with_options(request, runtime)
async def describe_honey_pot_susp_statistics_async(
self,
request: sas_20181203_models.DescribeHoneyPotSuspStatisticsRequest,
) -> sas_20181203_models.DescribeHoneyPotSuspStatisticsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_honey_pot_susp_statistics_with_options_async(request, runtime)
def describe_image_grouped_vul_list_with_options(
self,
request: sas_20181203_models.DescribeImageGroupedVulListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeImageGroupedVulListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeImageGroupedVulListResponse(),
self.do_rpcrequest('DescribeImageGroupedVulList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_image_grouped_vul_list_with_options_async(
self,
request: sas_20181203_models.DescribeImageGroupedVulListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeImageGroupedVulListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeImageGroupedVulListResponse(),
await self.do_rpcrequest_async('DescribeImageGroupedVulList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_image_grouped_vul_list(
self,
request: sas_20181203_models.DescribeImageGroupedVulListRequest,
) -> sas_20181203_models.DescribeImageGroupedVulListResponse:
runtime = util_models.RuntimeOptions()
return self.describe_image_grouped_vul_list_with_options(request, runtime)
async def describe_image_grouped_vul_list_async(
self,
request: sas_20181203_models.DescribeImageGroupedVulListRequest,
) -> sas_20181203_models.DescribeImageGroupedVulListResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_image_grouped_vul_list_with_options_async(request, runtime)
def describe_image_scan_auth_count_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeImageScanAuthCountResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeImageScanAuthCountResponse(),
self.do_rpcrequest('DescribeImageScanAuthCount', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_image_scan_auth_count_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeImageScanAuthCountResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeImageScanAuthCountResponse(),
await self.do_rpcrequest_async('DescribeImageScanAuthCount', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_image_scan_auth_count(self) -> sas_20181203_models.DescribeImageScanAuthCountResponse:
runtime = util_models.RuntimeOptions()
return self.describe_image_scan_auth_count_with_options(runtime)
async def describe_image_scan_auth_count_async(self) -> sas_20181203_models.DescribeImageScanAuthCountResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_image_scan_auth_count_with_options_async(runtime)
def describe_image_statistics_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeImageStatisticsResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeImageStatisticsResponse(),
self.do_rpcrequest('DescribeImageStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_image_statistics_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeImageStatisticsResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeImageStatisticsResponse(),
await self.do_rpcrequest_async('DescribeImageStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_image_statistics(self) -> sas_20181203_models.DescribeImageStatisticsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_image_statistics_with_options(runtime)
async def describe_image_statistics_async(self) -> sas_20181203_models.DescribeImageStatisticsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_image_statistics_with_options_async(runtime)
def describe_image_vul_list_with_options(
self,
request: sas_20181203_models.DescribeImageVulListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeImageVulListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeImageVulListResponse(),
self.do_rpcrequest('DescribeImageVulList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_image_vul_list_with_options_async(
self,
request: sas_20181203_models.DescribeImageVulListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeImageVulListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeImageVulListResponse(),
await self.do_rpcrequest_async('DescribeImageVulList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_image_vul_list(
self,
request: sas_20181203_models.DescribeImageVulListRequest,
) -> sas_20181203_models.DescribeImageVulListResponse:
runtime = util_models.RuntimeOptions()
return self.describe_image_vul_list_with_options(request, runtime)
async def describe_image_vul_list_async(
self,
request: sas_20181203_models.DescribeImageVulListRequest,
) -> sas_20181203_models.DescribeImageVulListResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_image_vul_list_with_options_async(request, runtime)
def describe_install_captcha_with_options(
self,
request: sas_20181203_models.DescribeInstallCaptchaRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeInstallCaptchaResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeInstallCaptchaResponse(),
self.do_rpcrequest('DescribeInstallCaptcha', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_install_captcha_with_options_async(
self,
request: sas_20181203_models.DescribeInstallCaptchaRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeInstallCaptchaResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeInstallCaptchaResponse(),
await self.do_rpcrequest_async('DescribeInstallCaptcha', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_install_captcha(
self,
request: sas_20181203_models.DescribeInstallCaptchaRequest,
) -> sas_20181203_models.DescribeInstallCaptchaResponse:
runtime = util_models.RuntimeOptions()
return self.describe_install_captcha_with_options(request, runtime)
async def describe_install_captcha_async(
self,
request: sas_20181203_models.DescribeInstallCaptchaRequest,
) -> sas_20181203_models.DescribeInstallCaptchaResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_install_captcha_with_options_async(request, runtime)
def describe_instance_anti_brute_force_rules_with_options(
self,
request: sas_20181203_models.DescribeInstanceAntiBruteForceRulesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeInstanceAntiBruteForceRulesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeInstanceAntiBruteForceRulesResponse(),
self.do_rpcrequest('DescribeInstanceAntiBruteForceRules', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_instance_anti_brute_force_rules_with_options_async(
self,
request: sas_20181203_models.DescribeInstanceAntiBruteForceRulesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeInstanceAntiBruteForceRulesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeInstanceAntiBruteForceRulesResponse(),
await self.do_rpcrequest_async('DescribeInstanceAntiBruteForceRules', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_instance_anti_brute_force_rules(
self,
request: sas_20181203_models.DescribeInstanceAntiBruteForceRulesRequest,
) -> sas_20181203_models.DescribeInstanceAntiBruteForceRulesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_instance_anti_brute_force_rules_with_options(request, runtime)
async def describe_instance_anti_brute_force_rules_async(
self,
request: sas_20181203_models.DescribeInstanceAntiBruteForceRulesRequest,
) -> sas_20181203_models.DescribeInstanceAntiBruteForceRulesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_instance_anti_brute_force_rules_with_options_async(request, runtime)
def describe_instance_statistics_with_options(
self,
request: sas_20181203_models.DescribeInstanceStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeInstanceStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeInstanceStatisticsResponse(),
self.do_rpcrequest('DescribeInstanceStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_instance_statistics_with_options_async(
self,
request: sas_20181203_models.DescribeInstanceStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeInstanceStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeInstanceStatisticsResponse(),
await self.do_rpcrequest_async('DescribeInstanceStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_instance_statistics(
self,
request: sas_20181203_models.DescribeInstanceStatisticsRequest,
) -> sas_20181203_models.DescribeInstanceStatisticsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_instance_statistics_with_options(request, runtime)
async def describe_instance_statistics_async(
self,
request: sas_20181203_models.DescribeInstanceStatisticsRequest,
) -> sas_20181203_models.DescribeInstanceStatisticsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_instance_statistics_with_options_async(request, runtime)
def describe_ip_info_with_options(
self,
request: sas_20181203_models.DescribeIpInfoRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeIpInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeIpInfoResponse(),
self.do_rpcrequest('DescribeIpInfo', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_ip_info_with_options_async(
self,
request: sas_20181203_models.DescribeIpInfoRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeIpInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeIpInfoResponse(),
await self.do_rpcrequest_async('DescribeIpInfo', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_ip_info(
self,
request: sas_20181203_models.DescribeIpInfoRequest,
) -> sas_20181203_models.DescribeIpInfoResponse:
runtime = util_models.RuntimeOptions()
return self.describe_ip_info_with_options(request, runtime)
async def describe_ip_info_async(
self,
request: sas_20181203_models.DescribeIpInfoRequest,
) -> sas_20181203_models.DescribeIpInfoResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_ip_info_with_options_async(request, runtime)
def describe_logstore_storage_with_options(
self,
request: sas_20181203_models.DescribeLogstoreStorageRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeLogstoreStorageResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeLogstoreStorageResponse(),
self.do_rpcrequest('DescribeLogstoreStorage', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_logstore_storage_with_options_async(
self,
request: sas_20181203_models.DescribeLogstoreStorageRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeLogstoreStorageResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeLogstoreStorageResponse(),
await self.do_rpcrequest_async('DescribeLogstoreStorage', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_logstore_storage(
self,
request: sas_20181203_models.DescribeLogstoreStorageRequest,
) -> sas_20181203_models.DescribeLogstoreStorageResponse:
runtime = util_models.RuntimeOptions()
return self.describe_logstore_storage_with_options(request, runtime)
async def describe_logstore_storage_async(
self,
request: sas_20181203_models.DescribeLogstoreStorageRequest,
) -> sas_20181203_models.DescribeLogstoreStorageResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_logstore_storage_with_options_async(request, runtime)
def describe_module_config_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeModuleConfigResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeModuleConfigResponse(),
self.do_rpcrequest('DescribeModuleConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_module_config_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeModuleConfigResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeModuleConfigResponse(),
await self.do_rpcrequest_async('DescribeModuleConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_module_config(self) -> sas_20181203_models.DescribeModuleConfigResponse:
runtime = util_models.RuntimeOptions()
return self.describe_module_config_with_options(runtime)
async def describe_module_config_async(self) -> sas_20181203_models.DescribeModuleConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_module_config_with_options_async(runtime)
def describe_notice_config_with_options(
self,
request: sas_20181203_models.DescribeNoticeConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeNoticeConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeNoticeConfigResponse(),
self.do_rpcrequest('DescribeNoticeConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_notice_config_with_options_async(
self,
request: sas_20181203_models.DescribeNoticeConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeNoticeConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeNoticeConfigResponse(),
await self.do_rpcrequest_async('DescribeNoticeConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_notice_config(
self,
request: sas_20181203_models.DescribeNoticeConfigRequest,
) -> sas_20181203_models.DescribeNoticeConfigResponse:
runtime = util_models.RuntimeOptions()
return self.describe_notice_config_with_options(request, runtime)
async def describe_notice_config_async(
self,
request: sas_20181203_models.DescribeNoticeConfigRequest,
) -> sas_20181203_models.DescribeNoticeConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_notice_config_with_options_async(request, runtime)
def describe_property_count_with_options(
self,
request: sas_20181203_models.DescribePropertyCountRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyCountResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyCountResponse(),
self.do_rpcrequest('DescribePropertyCount', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_property_count_with_options_async(
self,
request: sas_20181203_models.DescribePropertyCountRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyCountResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyCountResponse(),
await self.do_rpcrequest_async('DescribePropertyCount', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_property_count(
self,
request: sas_20181203_models.DescribePropertyCountRequest,
) -> sas_20181203_models.DescribePropertyCountResponse:
runtime = util_models.RuntimeOptions()
return self.describe_property_count_with_options(request, runtime)
async def describe_property_count_async(
self,
request: sas_20181203_models.DescribePropertyCountRequest,
) -> sas_20181203_models.DescribePropertyCountResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_property_count_with_options_async(request, runtime)
def describe_property_cron_detail_with_options(
self,
request: sas_20181203_models.DescribePropertyCronDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyCronDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyCronDetailResponse(),
self.do_rpcrequest('DescribePropertyCronDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_property_cron_detail_with_options_async(
self,
request: sas_20181203_models.DescribePropertyCronDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyCronDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyCronDetailResponse(),
await self.do_rpcrequest_async('DescribePropertyCronDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_property_cron_detail(
self,
request: sas_20181203_models.DescribePropertyCronDetailRequest,
) -> sas_20181203_models.DescribePropertyCronDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_property_cron_detail_with_options(request, runtime)
async def describe_property_cron_detail_async(
self,
request: sas_20181203_models.DescribePropertyCronDetailRequest,
) -> sas_20181203_models.DescribePropertyCronDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_property_cron_detail_with_options_async(request, runtime)
def describe_property_port_detail_with_options(
self,
request: sas_20181203_models.DescribePropertyPortDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyPortDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyPortDetailResponse(),
self.do_rpcrequest('DescribePropertyPortDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_property_port_detail_with_options_async(
self,
request: sas_20181203_models.DescribePropertyPortDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyPortDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyPortDetailResponse(),
await self.do_rpcrequest_async('DescribePropertyPortDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_property_port_detail(
self,
request: sas_20181203_models.DescribePropertyPortDetailRequest,
) -> sas_20181203_models.DescribePropertyPortDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_property_port_detail_with_options(request, runtime)
async def describe_property_port_detail_async(
self,
request: sas_20181203_models.DescribePropertyPortDetailRequest,
) -> sas_20181203_models.DescribePropertyPortDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_property_port_detail_with_options_async(request, runtime)
def describe_property_port_item_with_options(
self,
request: sas_20181203_models.DescribePropertyPortItemRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyPortItemResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyPortItemResponse(),
self.do_rpcrequest('DescribePropertyPortItem', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_property_port_item_with_options_async(
self,
request: sas_20181203_models.DescribePropertyPortItemRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyPortItemResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyPortItemResponse(),
await self.do_rpcrequest_async('DescribePropertyPortItem', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_property_port_item(
self,
request: sas_20181203_models.DescribePropertyPortItemRequest,
) -> sas_20181203_models.DescribePropertyPortItemResponse:
runtime = util_models.RuntimeOptions()
return self.describe_property_port_item_with_options(request, runtime)
async def describe_property_port_item_async(
self,
request: sas_20181203_models.DescribePropertyPortItemRequest,
) -> sas_20181203_models.DescribePropertyPortItemResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_property_port_item_with_options_async(request, runtime)
def describe_property_proc_detail_with_options(
self,
request: sas_20181203_models.DescribePropertyProcDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyProcDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyProcDetailResponse(),
self.do_rpcrequest('DescribePropertyProcDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_property_proc_detail_with_options_async(
self,
request: sas_20181203_models.DescribePropertyProcDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyProcDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyProcDetailResponse(),
await self.do_rpcrequest_async('DescribePropertyProcDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_property_proc_detail(
self,
request: sas_20181203_models.DescribePropertyProcDetailRequest,
) -> sas_20181203_models.DescribePropertyProcDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_property_proc_detail_with_options(request, runtime)
async def describe_property_proc_detail_async(
self,
request: sas_20181203_models.DescribePropertyProcDetailRequest,
) -> sas_20181203_models.DescribePropertyProcDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_property_proc_detail_with_options_async(request, runtime)
def describe_property_proc_item_with_options(
self,
request: sas_20181203_models.DescribePropertyProcItemRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyProcItemResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyProcItemResponse(),
self.do_rpcrequest('DescribePropertyProcItem', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_property_proc_item_with_options_async(
self,
request: sas_20181203_models.DescribePropertyProcItemRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyProcItemResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyProcItemResponse(),
await self.do_rpcrequest_async('DescribePropertyProcItem', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_property_proc_item(
self,
request: sas_20181203_models.DescribePropertyProcItemRequest,
) -> sas_20181203_models.DescribePropertyProcItemResponse:
runtime = util_models.RuntimeOptions()
return self.describe_property_proc_item_with_options(request, runtime)
async def describe_property_proc_item_async(
self,
request: sas_20181203_models.DescribePropertyProcItemRequest,
) -> sas_20181203_models.DescribePropertyProcItemResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_property_proc_item_with_options_async(request, runtime)
def describe_property_sca_detail_with_options(
self,
request: sas_20181203_models.DescribePropertyScaDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyScaDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyScaDetailResponse(),
self.do_rpcrequest('DescribePropertyScaDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_property_sca_detail_with_options_async(
self,
request: sas_20181203_models.DescribePropertyScaDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyScaDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyScaDetailResponse(),
await self.do_rpcrequest_async('DescribePropertyScaDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_property_sca_detail(
self,
request: sas_20181203_models.DescribePropertyScaDetailRequest,
) -> sas_20181203_models.DescribePropertyScaDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_property_sca_detail_with_options(request, runtime)
async def describe_property_sca_detail_async(
self,
request: sas_20181203_models.DescribePropertyScaDetailRequest,
) -> sas_20181203_models.DescribePropertyScaDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_property_sca_detail_with_options_async(request, runtime)
def describe_property_software_detail_with_options(
self,
request: sas_20181203_models.DescribePropertySoftwareDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertySoftwareDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertySoftwareDetailResponse(),
self.do_rpcrequest('DescribePropertySoftwareDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_property_software_detail_with_options_async(
self,
request: sas_20181203_models.DescribePropertySoftwareDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertySoftwareDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertySoftwareDetailResponse(),
await self.do_rpcrequest_async('DescribePropertySoftwareDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_property_software_detail(
self,
request: sas_20181203_models.DescribePropertySoftwareDetailRequest,
) -> sas_20181203_models.DescribePropertySoftwareDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_property_software_detail_with_options(request, runtime)
async def describe_property_software_detail_async(
self,
request: sas_20181203_models.DescribePropertySoftwareDetailRequest,
) -> sas_20181203_models.DescribePropertySoftwareDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_property_software_detail_with_options_async(request, runtime)
def describe_property_software_item_with_options(
self,
request: sas_20181203_models.DescribePropertySoftwareItemRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertySoftwareItemResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertySoftwareItemResponse(),
self.do_rpcrequest('DescribePropertySoftwareItem', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_property_software_item_with_options_async(
self,
request: sas_20181203_models.DescribePropertySoftwareItemRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertySoftwareItemResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertySoftwareItemResponse(),
await self.do_rpcrequest_async('DescribePropertySoftwareItem', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_property_software_item(
self,
request: sas_20181203_models.DescribePropertySoftwareItemRequest,
) -> sas_20181203_models.DescribePropertySoftwareItemResponse:
runtime = util_models.RuntimeOptions()
return self.describe_property_software_item_with_options(request, runtime)
async def describe_property_software_item_async(
self,
request: sas_20181203_models.DescribePropertySoftwareItemRequest,
) -> sas_20181203_models.DescribePropertySoftwareItemResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_property_software_item_with_options_async(request, runtime)
def describe_property_usage_newest_with_options(
self,
request: sas_20181203_models.DescribePropertyUsageNewestRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyUsageNewestResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyUsageNewestResponse(),
self.do_rpcrequest('DescribePropertyUsageNewest', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_property_usage_newest_with_options_async(
self,
request: sas_20181203_models.DescribePropertyUsageNewestRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyUsageNewestResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyUsageNewestResponse(),
await self.do_rpcrequest_async('DescribePropertyUsageNewest', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_property_usage_newest(
self,
request: sas_20181203_models.DescribePropertyUsageNewestRequest,
) -> sas_20181203_models.DescribePropertyUsageNewestResponse:
runtime = util_models.RuntimeOptions()
return self.describe_property_usage_newest_with_options(request, runtime)
async def describe_property_usage_newest_async(
self,
request: sas_20181203_models.DescribePropertyUsageNewestRequest,
) -> sas_20181203_models.DescribePropertyUsageNewestResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_property_usage_newest_with_options_async(request, runtime)
def describe_property_user_detail_with_options(
self,
request: sas_20181203_models.DescribePropertyUserDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyUserDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyUserDetailResponse(),
self.do_rpcrequest('DescribePropertyUserDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_property_user_detail_with_options_async(
self,
request: sas_20181203_models.DescribePropertyUserDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyUserDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyUserDetailResponse(),
await self.do_rpcrequest_async('DescribePropertyUserDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_property_user_detail(
self,
request: sas_20181203_models.DescribePropertyUserDetailRequest,
) -> sas_20181203_models.DescribePropertyUserDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_property_user_detail_with_options(request, runtime)
async def describe_property_user_detail_async(
self,
request: sas_20181203_models.DescribePropertyUserDetailRequest,
) -> sas_20181203_models.DescribePropertyUserDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_property_user_detail_with_options_async(request, runtime)
def describe_property_user_item_with_options(
self,
request: sas_20181203_models.DescribePropertyUserItemRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyUserItemResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyUserItemResponse(),
self.do_rpcrequest('DescribePropertyUserItem', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_property_user_item_with_options_async(
self,
request: sas_20181203_models.DescribePropertyUserItemRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribePropertyUserItemResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribePropertyUserItemResponse(),
await self.do_rpcrequest_async('DescribePropertyUserItem', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_property_user_item(
self,
request: sas_20181203_models.DescribePropertyUserItemRequest,
) -> sas_20181203_models.DescribePropertyUserItemResponse:
runtime = util_models.RuntimeOptions()
return self.describe_property_user_item_with_options(request, runtime)
async def describe_property_user_item_async(
self,
request: sas_20181203_models.DescribePropertyUserItemRequest,
) -> sas_20181203_models.DescribePropertyUserItemResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_property_user_item_with_options_async(request, runtime)
def describe_quara_file_download_info_with_options(
self,
request: sas_20181203_models.DescribeQuaraFileDownloadInfoRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeQuaraFileDownloadInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeQuaraFileDownloadInfoResponse(),
self.do_rpcrequest('DescribeQuaraFileDownloadInfo', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_quara_file_download_info_with_options_async(
self,
request: sas_20181203_models.DescribeQuaraFileDownloadInfoRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeQuaraFileDownloadInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeQuaraFileDownloadInfoResponse(),
await self.do_rpcrequest_async('DescribeQuaraFileDownloadInfo', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_quara_file_download_info(
self,
request: sas_20181203_models.DescribeQuaraFileDownloadInfoRequest,
) -> sas_20181203_models.DescribeQuaraFileDownloadInfoResponse:
runtime = util_models.RuntimeOptions()
return self.describe_quara_file_download_info_with_options(request, runtime)
async def describe_quara_file_download_info_async(
self,
request: sas_20181203_models.DescribeQuaraFileDownloadInfoRequest,
) -> sas_20181203_models.DescribeQuaraFileDownloadInfoResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_quara_file_download_info_with_options_async(request, runtime)
def describe_restore_jobs_with_options(
self,
request: sas_20181203_models.DescribeRestoreJobsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeRestoreJobsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeRestoreJobsResponse(),
self.do_rpcrequest('DescribeRestoreJobs', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_restore_jobs_with_options_async(
self,
request: sas_20181203_models.DescribeRestoreJobsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeRestoreJobsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeRestoreJobsResponse(),
await self.do_rpcrequest_async('DescribeRestoreJobs', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_restore_jobs(
self,
request: sas_20181203_models.DescribeRestoreJobsRequest,
) -> sas_20181203_models.DescribeRestoreJobsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_restore_jobs_with_options(request, runtime)
async def describe_restore_jobs_async(
self,
request: sas_20181203_models.DescribeRestoreJobsRequest,
) -> sas_20181203_models.DescribeRestoreJobsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_restore_jobs_with_options_async(request, runtime)
def describe_risk_check_item_result_with_options(
self,
request: sas_20181203_models.DescribeRiskCheckItemResultRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeRiskCheckItemResultResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeRiskCheckItemResultResponse(),
self.do_rpcrequest('DescribeRiskCheckItemResult', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_risk_check_item_result_with_options_async(
self,
request: sas_20181203_models.DescribeRiskCheckItemResultRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeRiskCheckItemResultResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeRiskCheckItemResultResponse(),
await self.do_rpcrequest_async('DescribeRiskCheckItemResult', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_risk_check_item_result(
self,
request: sas_20181203_models.DescribeRiskCheckItemResultRequest,
) -> sas_20181203_models.DescribeRiskCheckItemResultResponse:
runtime = util_models.RuntimeOptions()
return self.describe_risk_check_item_result_with_options(request, runtime)
async def describe_risk_check_item_result_async(
self,
request: sas_20181203_models.DescribeRiskCheckItemResultRequest,
) -> sas_20181203_models.DescribeRiskCheckItemResultResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_risk_check_item_result_with_options_async(request, runtime)
def describe_risk_check_result_with_options(
self,
request: sas_20181203_models.DescribeRiskCheckResultRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeRiskCheckResultResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeRiskCheckResultResponse(),
self.do_rpcrequest('DescribeRiskCheckResult', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_risk_check_result_with_options_async(
self,
request: sas_20181203_models.DescribeRiskCheckResultRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeRiskCheckResultResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeRiskCheckResultResponse(),
await self.do_rpcrequest_async('DescribeRiskCheckResult', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_risk_check_result(
self,
request: sas_20181203_models.DescribeRiskCheckResultRequest,
) -> sas_20181203_models.DescribeRiskCheckResultResponse:
runtime = util_models.RuntimeOptions()
return self.describe_risk_check_result_with_options(request, runtime)
async def describe_risk_check_result_async(
self,
request: sas_20181203_models.DescribeRiskCheckResultRequest,
) -> sas_20181203_models.DescribeRiskCheckResultResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_risk_check_result_with_options_async(request, runtime)
def describe_risk_check_summary_with_options(
self,
request: sas_20181203_models.DescribeRiskCheckSummaryRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeRiskCheckSummaryResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeRiskCheckSummaryResponse(),
self.do_rpcrequest('DescribeRiskCheckSummary', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_risk_check_summary_with_options_async(
self,
request: sas_20181203_models.DescribeRiskCheckSummaryRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeRiskCheckSummaryResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeRiskCheckSummaryResponse(),
await self.do_rpcrequest_async('DescribeRiskCheckSummary', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_risk_check_summary(
self,
request: sas_20181203_models.DescribeRiskCheckSummaryRequest,
) -> sas_20181203_models.DescribeRiskCheckSummaryResponse:
runtime = util_models.RuntimeOptions()
return self.describe_risk_check_summary_with_options(request, runtime)
async def describe_risk_check_summary_async(
self,
request: sas_20181203_models.DescribeRiskCheckSummaryRequest,
) -> sas_20181203_models.DescribeRiskCheckSummaryResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_risk_check_summary_with_options_async(request, runtime)
def describe_risk_item_type_with_options(
self,
request: sas_20181203_models.DescribeRiskItemTypeRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeRiskItemTypeResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeRiskItemTypeResponse(),
self.do_rpcrequest('DescribeRiskItemType', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_risk_item_type_with_options_async(
self,
request: sas_20181203_models.DescribeRiskItemTypeRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeRiskItemTypeResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeRiskItemTypeResponse(),
await self.do_rpcrequest_async('DescribeRiskItemType', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_risk_item_type(
self,
request: sas_20181203_models.DescribeRiskItemTypeRequest,
) -> sas_20181203_models.DescribeRiskItemTypeResponse:
runtime = util_models.RuntimeOptions()
return self.describe_risk_item_type_with_options(request, runtime)
async def describe_risk_item_type_async(
self,
request: sas_20181203_models.DescribeRiskItemTypeRequest,
) -> sas_20181203_models.DescribeRiskItemTypeResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_risk_item_type_with_options_async(request, runtime)
def describe_risk_list_check_result_with_options(
self,
request: sas_20181203_models.DescribeRiskListCheckResultRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeRiskListCheckResultResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeRiskListCheckResultResponse(),
self.do_rpcrequest('DescribeRiskListCheckResult', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_risk_list_check_result_with_options_async(
self,
request: sas_20181203_models.DescribeRiskListCheckResultRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeRiskListCheckResultResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeRiskListCheckResultResponse(),
await self.do_rpcrequest_async('DescribeRiskListCheckResult', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_risk_list_check_result(
self,
request: sas_20181203_models.DescribeRiskListCheckResultRequest,
) -> sas_20181203_models.DescribeRiskListCheckResultResponse:
runtime = util_models.RuntimeOptions()
return self.describe_risk_list_check_result_with_options(request, runtime)
async def describe_risk_list_check_result_async(
self,
request: sas_20181203_models.DescribeRiskListCheckResultRequest,
) -> sas_20181203_models.DescribeRiskListCheckResultResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_risk_list_check_result_with_options_async(request, runtime)
def describe_sas_asset_statistics_column_with_options(
self,
request: sas_20181203_models.DescribeSasAssetStatisticsColumnRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSasAssetStatisticsColumnResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSasAssetStatisticsColumnResponse(),
self.do_rpcrequest('DescribeSasAssetStatisticsColumn', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_sas_asset_statistics_column_with_options_async(
self,
request: sas_20181203_models.DescribeSasAssetStatisticsColumnRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSasAssetStatisticsColumnResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSasAssetStatisticsColumnResponse(),
await self.do_rpcrequest_async('DescribeSasAssetStatisticsColumn', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_sas_asset_statistics_column(
self,
request: sas_20181203_models.DescribeSasAssetStatisticsColumnRequest,
) -> sas_20181203_models.DescribeSasAssetStatisticsColumnResponse:
runtime = util_models.RuntimeOptions()
return self.describe_sas_asset_statistics_column_with_options(request, runtime)
async def describe_sas_asset_statistics_column_async(
self,
request: sas_20181203_models.DescribeSasAssetStatisticsColumnRequest,
) -> sas_20181203_models.DescribeSasAssetStatisticsColumnResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_sas_asset_statistics_column_with_options_async(request, runtime)
def describe_scan_task_progress_with_options(
self,
request: sas_20181203_models.DescribeScanTaskProgressRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeScanTaskProgressResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeScanTaskProgressResponse(),
self.do_rpcrequest('DescribeScanTaskProgress', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_scan_task_progress_with_options_async(
self,
request: sas_20181203_models.DescribeScanTaskProgressRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeScanTaskProgressResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeScanTaskProgressResponse(),
await self.do_rpcrequest_async('DescribeScanTaskProgress', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_scan_task_progress(
self,
request: sas_20181203_models.DescribeScanTaskProgressRequest,
) -> sas_20181203_models.DescribeScanTaskProgressResponse:
runtime = util_models.RuntimeOptions()
return self.describe_scan_task_progress_with_options(request, runtime)
async def describe_scan_task_progress_async(
self,
request: sas_20181203_models.DescribeScanTaskProgressRequest,
) -> sas_20181203_models.DescribeScanTaskProgressResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_scan_task_progress_with_options_async(request, runtime)
def describe_search_condition_with_options(
self,
request: sas_20181203_models.DescribeSearchConditionRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSearchConditionResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSearchConditionResponse(),
self.do_rpcrequest('DescribeSearchCondition', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_search_condition_with_options_async(
self,
request: sas_20181203_models.DescribeSearchConditionRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSearchConditionResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSearchConditionResponse(),
await self.do_rpcrequest_async('DescribeSearchCondition', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_search_condition(
self,
request: sas_20181203_models.DescribeSearchConditionRequest,
) -> sas_20181203_models.DescribeSearchConditionResponse:
runtime = util_models.RuntimeOptions()
return self.describe_search_condition_with_options(request, runtime)
async def describe_search_condition_async(
self,
request: sas_20181203_models.DescribeSearchConditionRequest,
) -> sas_20181203_models.DescribeSearchConditionResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_search_condition_with_options_async(request, runtime)
def describe_secure_suggestion_with_options(
self,
request: sas_20181203_models.DescribeSecureSuggestionRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSecureSuggestionResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSecureSuggestionResponse(),
self.do_rpcrequest('DescribeSecureSuggestion', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_secure_suggestion_with_options_async(
self,
request: sas_20181203_models.DescribeSecureSuggestionRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSecureSuggestionResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSecureSuggestionResponse(),
await self.do_rpcrequest_async('DescribeSecureSuggestion', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_secure_suggestion(
self,
request: sas_20181203_models.DescribeSecureSuggestionRequest,
) -> sas_20181203_models.DescribeSecureSuggestionResponse:
runtime = util_models.RuntimeOptions()
return self.describe_secure_suggestion_with_options(request, runtime)
async def describe_secure_suggestion_async(
self,
request: sas_20181203_models.DescribeSecureSuggestionRequest,
) -> sas_20181203_models.DescribeSecureSuggestionResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_secure_suggestion_with_options_async(request, runtime)
def describe_security_check_schedule_config_with_options(
self,
request: sas_20181203_models.DescribeSecurityCheckScheduleConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSecurityCheckScheduleConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSecurityCheckScheduleConfigResponse(),
self.do_rpcrequest('DescribeSecurityCheckScheduleConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_security_check_schedule_config_with_options_async(
self,
request: sas_20181203_models.DescribeSecurityCheckScheduleConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSecurityCheckScheduleConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSecurityCheckScheduleConfigResponse(),
await self.do_rpcrequest_async('DescribeSecurityCheckScheduleConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_security_check_schedule_config(
self,
request: sas_20181203_models.DescribeSecurityCheckScheduleConfigRequest,
) -> sas_20181203_models.DescribeSecurityCheckScheduleConfigResponse:
runtime = util_models.RuntimeOptions()
return self.describe_security_check_schedule_config_with_options(request, runtime)
async def describe_security_check_schedule_config_async(
self,
request: sas_20181203_models.DescribeSecurityCheckScheduleConfigRequest,
) -> sas_20181203_models.DescribeSecurityCheckScheduleConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_security_check_schedule_config_with_options_async(request, runtime)
def describe_security_event_operations_with_options(
self,
request: sas_20181203_models.DescribeSecurityEventOperationsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSecurityEventOperationsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSecurityEventOperationsResponse(),
self.do_rpcrequest('DescribeSecurityEventOperations', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_security_event_operations_with_options_async(
self,
request: sas_20181203_models.DescribeSecurityEventOperationsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSecurityEventOperationsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSecurityEventOperationsResponse(),
await self.do_rpcrequest_async('DescribeSecurityEventOperations', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_security_event_operations(
self,
request: sas_20181203_models.DescribeSecurityEventOperationsRequest,
) -> sas_20181203_models.DescribeSecurityEventOperationsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_security_event_operations_with_options(request, runtime)
async def describe_security_event_operations_async(
self,
request: sas_20181203_models.DescribeSecurityEventOperationsRequest,
) -> sas_20181203_models.DescribeSecurityEventOperationsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_security_event_operations_with_options_async(request, runtime)
def describe_security_event_operation_status_with_options(
self,
request: sas_20181203_models.DescribeSecurityEventOperationStatusRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSecurityEventOperationStatusResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSecurityEventOperationStatusResponse(),
self.do_rpcrequest('DescribeSecurityEventOperationStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_security_event_operation_status_with_options_async(
self,
request: sas_20181203_models.DescribeSecurityEventOperationStatusRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSecurityEventOperationStatusResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSecurityEventOperationStatusResponse(),
await self.do_rpcrequest_async('DescribeSecurityEventOperationStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_security_event_operation_status(
self,
request: sas_20181203_models.DescribeSecurityEventOperationStatusRequest,
) -> sas_20181203_models.DescribeSecurityEventOperationStatusResponse:
runtime = util_models.RuntimeOptions()
return self.describe_security_event_operation_status_with_options(request, runtime)
async def describe_security_event_operation_status_async(
self,
request: sas_20181203_models.DescribeSecurityEventOperationStatusRequest,
) -> sas_20181203_models.DescribeSecurityEventOperationStatusResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_security_event_operation_status_with_options_async(request, runtime)
def describe_security_stat_info_with_options(
self,
request: sas_20181203_models.DescribeSecurityStatInfoRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSecurityStatInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSecurityStatInfoResponse(),
self.do_rpcrequest('DescribeSecurityStatInfo', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_security_stat_info_with_options_async(
self,
request: sas_20181203_models.DescribeSecurityStatInfoRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSecurityStatInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSecurityStatInfoResponse(),
await self.do_rpcrequest_async('DescribeSecurityStatInfo', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_security_stat_info(
self,
request: sas_20181203_models.DescribeSecurityStatInfoRequest,
) -> sas_20181203_models.DescribeSecurityStatInfoResponse:
runtime = util_models.RuntimeOptions()
return self.describe_security_stat_info_with_options(request, runtime)
async def describe_security_stat_info_async(
self,
request: sas_20181203_models.DescribeSecurityStatInfoRequest,
) -> sas_20181203_models.DescribeSecurityStatInfoResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_security_stat_info_with_options_async(request, runtime)
def describe_service_linked_role_status_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeServiceLinkedRoleStatusResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeServiceLinkedRoleStatusResponse(),
self.do_rpcrequest('DescribeServiceLinkedRoleStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_service_linked_role_status_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeServiceLinkedRoleStatusResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeServiceLinkedRoleStatusResponse(),
await self.do_rpcrequest_async('DescribeServiceLinkedRoleStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_service_linked_role_status(self) -> sas_20181203_models.DescribeServiceLinkedRoleStatusResponse:
runtime = util_models.RuntimeOptions()
return self.describe_service_linked_role_status_with_options(runtime)
async def describe_service_linked_role_status_async(self) -> sas_20181203_models.DescribeServiceLinkedRoleStatusResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_service_linked_role_status_with_options_async(runtime)
def describe_similar_event_scenarios_with_options(
self,
request: sas_20181203_models.DescribeSimilarEventScenariosRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSimilarEventScenariosResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSimilarEventScenariosResponse(),
self.do_rpcrequest('DescribeSimilarEventScenarios', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_similar_event_scenarios_with_options_async(
self,
request: sas_20181203_models.DescribeSimilarEventScenariosRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSimilarEventScenariosResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSimilarEventScenariosResponse(),
await self.do_rpcrequest_async('DescribeSimilarEventScenarios', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_similar_event_scenarios(
self,
request: sas_20181203_models.DescribeSimilarEventScenariosRequest,
) -> sas_20181203_models.DescribeSimilarEventScenariosResponse:
runtime = util_models.RuntimeOptions()
return self.describe_similar_event_scenarios_with_options(request, runtime)
async def describe_similar_event_scenarios_async(
self,
request: sas_20181203_models.DescribeSimilarEventScenariosRequest,
) -> sas_20181203_models.DescribeSimilarEventScenariosResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_similar_event_scenarios_with_options_async(request, runtime)
def describe_similar_security_events_with_options(
self,
request: sas_20181203_models.DescribeSimilarSecurityEventsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSimilarSecurityEventsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSimilarSecurityEventsResponse(),
self.do_rpcrequest('DescribeSimilarSecurityEvents', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_similar_security_events_with_options_async(
self,
request: sas_20181203_models.DescribeSimilarSecurityEventsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSimilarSecurityEventsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSimilarSecurityEventsResponse(),
await self.do_rpcrequest_async('DescribeSimilarSecurityEvents', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_similar_security_events(
self,
request: sas_20181203_models.DescribeSimilarSecurityEventsRequest,
) -> sas_20181203_models.DescribeSimilarSecurityEventsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_similar_security_events_with_options(request, runtime)
async def describe_similar_security_events_async(
self,
request: sas_20181203_models.DescribeSimilarSecurityEventsRequest,
) -> sas_20181203_models.DescribeSimilarSecurityEventsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_similar_security_events_with_options_async(request, runtime)
def describe_snapshots_with_options(
self,
request: sas_20181203_models.DescribeSnapshotsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSnapshotsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSnapshotsResponse(),
self.do_rpcrequest('DescribeSnapshots', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_snapshots_with_options_async(
self,
request: sas_20181203_models.DescribeSnapshotsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSnapshotsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSnapshotsResponse(),
await self.do_rpcrequest_async('DescribeSnapshots', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_snapshots(
self,
request: sas_20181203_models.DescribeSnapshotsRequest,
) -> sas_20181203_models.DescribeSnapshotsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_snapshots_with_options(request, runtime)
async def describe_snapshots_async(
self,
request: sas_20181203_models.DescribeSnapshotsRequest,
) -> sas_20181203_models.DescribeSnapshotsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_snapshots_with_options_async(request, runtime)
def describe_strategy_with_options(
self,
request: sas_20181203_models.DescribeStrategyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeStrategyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeStrategyResponse(),
self.do_rpcrequest('DescribeStrategy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_strategy_with_options_async(
self,
request: sas_20181203_models.DescribeStrategyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeStrategyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeStrategyResponse(),
await self.do_rpcrequest_async('DescribeStrategy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_strategy(
self,
request: sas_20181203_models.DescribeStrategyRequest,
) -> sas_20181203_models.DescribeStrategyResponse:
runtime = util_models.RuntimeOptions()
return self.describe_strategy_with_options(request, runtime)
async def describe_strategy_async(
self,
request: sas_20181203_models.DescribeStrategyRequest,
) -> sas_20181203_models.DescribeStrategyResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_strategy_with_options_async(request, runtime)
def describe_strategy_exec_detail_with_options(
self,
request: sas_20181203_models.DescribeStrategyExecDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeStrategyExecDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeStrategyExecDetailResponse(),
self.do_rpcrequest('DescribeStrategyExecDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_strategy_exec_detail_with_options_async(
self,
request: sas_20181203_models.DescribeStrategyExecDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeStrategyExecDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeStrategyExecDetailResponse(),
await self.do_rpcrequest_async('DescribeStrategyExecDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_strategy_exec_detail(
self,
request: sas_20181203_models.DescribeStrategyExecDetailRequest,
) -> sas_20181203_models.DescribeStrategyExecDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_strategy_exec_detail_with_options(request, runtime)
async def describe_strategy_exec_detail_async(
self,
request: sas_20181203_models.DescribeStrategyExecDetailRequest,
) -> sas_20181203_models.DescribeStrategyExecDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_strategy_exec_detail_with_options_async(request, runtime)
def describe_strategy_process_with_options(
self,
request: sas_20181203_models.DescribeStrategyProcessRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeStrategyProcessResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeStrategyProcessResponse(),
self.do_rpcrequest('DescribeStrategyProcess', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_strategy_process_with_options_async(
self,
request: sas_20181203_models.DescribeStrategyProcessRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeStrategyProcessResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeStrategyProcessResponse(),
await self.do_rpcrequest_async('DescribeStrategyProcess', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_strategy_process(
self,
request: sas_20181203_models.DescribeStrategyProcessRequest,
) -> sas_20181203_models.DescribeStrategyProcessResponse:
runtime = util_models.RuntimeOptions()
return self.describe_strategy_process_with_options(request, runtime)
async def describe_strategy_process_async(
self,
request: sas_20181203_models.DescribeStrategyProcessRequest,
) -> sas_20181203_models.DescribeStrategyProcessResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_strategy_process_with_options_async(request, runtime)
def describe_strategy_target_with_options(
self,
request: sas_20181203_models.DescribeStrategyTargetRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeStrategyTargetResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeStrategyTargetResponse(),
self.do_rpcrequest('DescribeStrategyTarget', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_strategy_target_with_options_async(
self,
request: sas_20181203_models.DescribeStrategyTargetRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeStrategyTargetResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeStrategyTargetResponse(),
await self.do_rpcrequest_async('DescribeStrategyTarget', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_strategy_target(
self,
request: sas_20181203_models.DescribeStrategyTargetRequest,
) -> sas_20181203_models.DescribeStrategyTargetResponse:
runtime = util_models.RuntimeOptions()
return self.describe_strategy_target_with_options(request, runtime)
async def describe_strategy_target_async(
self,
request: sas_20181203_models.DescribeStrategyTargetRequest,
) -> sas_20181203_models.DescribeStrategyTargetResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_strategy_target_with_options_async(request, runtime)
def describe_summary_info_with_options(
self,
request: sas_20181203_models.DescribeSummaryInfoRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSummaryInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSummaryInfoResponse(),
self.do_rpcrequest('DescribeSummaryInfo', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_summary_info_with_options_async(
self,
request: sas_20181203_models.DescribeSummaryInfoRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSummaryInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSummaryInfoResponse(),
await self.do_rpcrequest_async('DescribeSummaryInfo', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_summary_info(
self,
request: sas_20181203_models.DescribeSummaryInfoRequest,
) -> sas_20181203_models.DescribeSummaryInfoResponse:
runtime = util_models.RuntimeOptions()
return self.describe_summary_info_with_options(request, runtime)
async def describe_summary_info_async(
self,
request: sas_20181203_models.DescribeSummaryInfoRequest,
) -> sas_20181203_models.DescribeSummaryInfoResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_summary_info_with_options_async(request, runtime)
def describe_support_region_with_options(
self,
request: sas_20181203_models.DescribeSupportRegionRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSupportRegionResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSupportRegionResponse(),
self.do_rpcrequest('DescribeSupportRegion', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_support_region_with_options_async(
self,
request: sas_20181203_models.DescribeSupportRegionRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSupportRegionResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSupportRegionResponse(),
await self.do_rpcrequest_async('DescribeSupportRegion', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_support_region(
self,
request: sas_20181203_models.DescribeSupportRegionRequest,
) -> sas_20181203_models.DescribeSupportRegionResponse:
runtime = util_models.RuntimeOptions()
return self.describe_support_region_with_options(request, runtime)
async def describe_support_region_async(
self,
request: sas_20181203_models.DescribeSupportRegionRequest,
) -> sas_20181203_models.DescribeSupportRegionResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_support_region_with_options_async(request, runtime)
def describe_susp_event_detail_with_options(
self,
request: sas_20181203_models.DescribeSuspEventDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSuspEventDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSuspEventDetailResponse(),
self.do_rpcrequest('DescribeSuspEventDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_susp_event_detail_with_options_async(
self,
request: sas_20181203_models.DescribeSuspEventDetailRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSuspEventDetailResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSuspEventDetailResponse(),
await self.do_rpcrequest_async('DescribeSuspEventDetail', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_susp_event_detail(
self,
request: sas_20181203_models.DescribeSuspEventDetailRequest,
) -> sas_20181203_models.DescribeSuspEventDetailResponse:
runtime = util_models.RuntimeOptions()
return self.describe_susp_event_detail_with_options(request, runtime)
async def describe_susp_event_detail_async(
self,
request: sas_20181203_models.DescribeSuspEventDetailRequest,
) -> sas_20181203_models.DescribeSuspEventDetailResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_susp_event_detail_with_options_async(request, runtime)
def describe_susp_event_quara_files_with_options(
self,
request: sas_20181203_models.DescribeSuspEventQuaraFilesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSuspEventQuaraFilesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSuspEventQuaraFilesResponse(),
self.do_rpcrequest('DescribeSuspEventQuaraFiles', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_susp_event_quara_files_with_options_async(
self,
request: sas_20181203_models.DescribeSuspEventQuaraFilesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSuspEventQuaraFilesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSuspEventQuaraFilesResponse(),
await self.do_rpcrequest_async('DescribeSuspEventQuaraFiles', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_susp_event_quara_files(
self,
request: sas_20181203_models.DescribeSuspEventQuaraFilesRequest,
) -> sas_20181203_models.DescribeSuspEventQuaraFilesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_susp_event_quara_files_with_options(request, runtime)
async def describe_susp_event_quara_files_async(
self,
request: sas_20181203_models.DescribeSuspEventQuaraFilesRequest,
) -> sas_20181203_models.DescribeSuspEventQuaraFilesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_susp_event_quara_files_with_options_async(request, runtime)
def describe_susp_events_with_options(
self,
request: sas_20181203_models.DescribeSuspEventsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSuspEventsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSuspEventsResponse(),
self.do_rpcrequest('DescribeSuspEvents', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_susp_events_with_options_async(
self,
request: sas_20181203_models.DescribeSuspEventsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeSuspEventsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeSuspEventsResponse(),
await self.do_rpcrequest_async('DescribeSuspEvents', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_susp_events(
self,
request: sas_20181203_models.DescribeSuspEventsRequest,
) -> sas_20181203_models.DescribeSuspEventsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_susp_events_with_options(request, runtime)
async def describe_susp_events_async(
self,
request: sas_20181203_models.DescribeSuspEventsRequest,
) -> sas_20181203_models.DescribeSuspEventsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_susp_events_with_options_async(request, runtime)
def describe_user_backup_machines_with_options(
self,
request: sas_20181203_models.DescribeUserBackupMachinesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeUserBackupMachinesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeUserBackupMachinesResponse(),
self.do_rpcrequest('DescribeUserBackupMachines', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_user_backup_machines_with_options_async(
self,
request: sas_20181203_models.DescribeUserBackupMachinesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeUserBackupMachinesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeUserBackupMachinesResponse(),
await self.do_rpcrequest_async('DescribeUserBackupMachines', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_user_backup_machines(
self,
request: sas_20181203_models.DescribeUserBackupMachinesRequest,
) -> sas_20181203_models.DescribeUserBackupMachinesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_user_backup_machines_with_options(request, runtime)
async def describe_user_backup_machines_async(
self,
request: sas_20181203_models.DescribeUserBackupMachinesRequest,
) -> sas_20181203_models.DescribeUserBackupMachinesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_user_backup_machines_with_options_async(request, runtime)
def describe_user_baseline_authorization_with_options(
self,
request: sas_20181203_models.DescribeUserBaselineAuthorizationRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeUserBaselineAuthorizationResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeUserBaselineAuthorizationResponse(),
self.do_rpcrequest('DescribeUserBaselineAuthorization', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_user_baseline_authorization_with_options_async(
self,
request: sas_20181203_models.DescribeUserBaselineAuthorizationRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeUserBaselineAuthorizationResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeUserBaselineAuthorizationResponse(),
await self.do_rpcrequest_async('DescribeUserBaselineAuthorization', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_user_baseline_authorization(
self,
request: sas_20181203_models.DescribeUserBaselineAuthorizationRequest,
) -> sas_20181203_models.DescribeUserBaselineAuthorizationResponse:
runtime = util_models.RuntimeOptions()
return self.describe_user_baseline_authorization_with_options(request, runtime)
async def describe_user_baseline_authorization_async(
self,
request: sas_20181203_models.DescribeUserBaselineAuthorizationRequest,
) -> sas_20181203_models.DescribeUserBaselineAuthorizationResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_user_baseline_authorization_with_options_async(request, runtime)
def describe_user_layout_authorization_with_options(
self,
request: sas_20181203_models.DescribeUserLayoutAuthorizationRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeUserLayoutAuthorizationResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeUserLayoutAuthorizationResponse(),
self.do_rpcrequest('DescribeUserLayoutAuthorization', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_user_layout_authorization_with_options_async(
self,
request: sas_20181203_models.DescribeUserLayoutAuthorizationRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeUserLayoutAuthorizationResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeUserLayoutAuthorizationResponse(),
await self.do_rpcrequest_async('DescribeUserLayoutAuthorization', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_user_layout_authorization(
self,
request: sas_20181203_models.DescribeUserLayoutAuthorizationRequest,
) -> sas_20181203_models.DescribeUserLayoutAuthorizationResponse:
runtime = util_models.RuntimeOptions()
return self.describe_user_layout_authorization_with_options(request, runtime)
async def describe_user_layout_authorization_async(
self,
request: sas_20181203_models.DescribeUserLayoutAuthorizationRequest,
) -> sas_20181203_models.DescribeUserLayoutAuthorizationResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_user_layout_authorization_with_options_async(request, runtime)
def describe_uuids_by_vul_names_with_options(
self,
request: sas_20181203_models.DescribeUuidsByVulNamesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeUuidsByVulNamesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeUuidsByVulNamesResponse(),
self.do_rpcrequest('DescribeUuidsByVulNames', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_uuids_by_vul_names_with_options_async(
self,
request: sas_20181203_models.DescribeUuidsByVulNamesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeUuidsByVulNamesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeUuidsByVulNamesResponse(),
await self.do_rpcrequest_async('DescribeUuidsByVulNames', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_uuids_by_vul_names(
self,
request: sas_20181203_models.DescribeUuidsByVulNamesRequest,
) -> sas_20181203_models.DescribeUuidsByVulNamesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_uuids_by_vul_names_with_options(request, runtime)
async def describe_uuids_by_vul_names_async(
self,
request: sas_20181203_models.DescribeUuidsByVulNamesRequest,
) -> sas_20181203_models.DescribeUuidsByVulNamesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_uuids_by_vul_names_with_options_async(request, runtime)
def describe_version_config_with_options(
self,
request: sas_20181203_models.DescribeVersionConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVersionConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeVersionConfigResponse(),
self.do_rpcrequest('DescribeVersionConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_version_config_with_options_async(
self,
request: sas_20181203_models.DescribeVersionConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVersionConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeVersionConfigResponse(),
await self.do_rpcrequest_async('DescribeVersionConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_version_config(
self,
request: sas_20181203_models.DescribeVersionConfigRequest,
) -> sas_20181203_models.DescribeVersionConfigResponse:
runtime = util_models.RuntimeOptions()
return self.describe_version_config_with_options(request, runtime)
async def describe_version_config_async(
self,
request: sas_20181203_models.DescribeVersionConfigRequest,
) -> sas_20181203_models.DescribeVersionConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_version_config_with_options_async(request, runtime)
def describe_vol_dingding_message_with_options(
self,
request: sas_20181203_models.DescribeVolDingdingMessageRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVolDingdingMessageResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeVolDingdingMessageResponse(),
self.do_rpcrequest('DescribeVolDingdingMessage', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_vol_dingding_message_with_options_async(
self,
request: sas_20181203_models.DescribeVolDingdingMessageRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVolDingdingMessageResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeVolDingdingMessageResponse(),
await self.do_rpcrequest_async('DescribeVolDingdingMessage', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_vol_dingding_message(
self,
request: sas_20181203_models.DescribeVolDingdingMessageRequest,
) -> sas_20181203_models.DescribeVolDingdingMessageResponse:
runtime = util_models.RuntimeOptions()
return self.describe_vol_dingding_message_with_options(request, runtime)
async def describe_vol_dingding_message_async(
self,
request: sas_20181203_models.DescribeVolDingdingMessageRequest,
) -> sas_20181203_models.DescribeVolDingdingMessageResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_vol_dingding_message_with_options_async(request, runtime)
def describe_vpc_honey_pot_criteria_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVpcHoneyPotCriteriaResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeVpcHoneyPotCriteriaResponse(),
self.do_rpcrequest('DescribeVpcHoneyPotCriteria', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_vpc_honey_pot_criteria_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVpcHoneyPotCriteriaResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeVpcHoneyPotCriteriaResponse(),
await self.do_rpcrequest_async('DescribeVpcHoneyPotCriteria', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_vpc_honey_pot_criteria(self) -> sas_20181203_models.DescribeVpcHoneyPotCriteriaResponse:
runtime = util_models.RuntimeOptions()
return self.describe_vpc_honey_pot_criteria_with_options(runtime)
async def describe_vpc_honey_pot_criteria_async(self) -> sas_20181203_models.DescribeVpcHoneyPotCriteriaResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_vpc_honey_pot_criteria_with_options_async(runtime)
def describe_vpc_honey_pot_list_with_options(
self,
request: sas_20181203_models.DescribeVpcHoneyPotListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVpcHoneyPotListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeVpcHoneyPotListResponse(),
self.do_rpcrequest('DescribeVpcHoneyPotList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_vpc_honey_pot_list_with_options_async(
self,
request: sas_20181203_models.DescribeVpcHoneyPotListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVpcHoneyPotListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeVpcHoneyPotListResponse(),
await self.do_rpcrequest_async('DescribeVpcHoneyPotList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_vpc_honey_pot_list(
self,
request: sas_20181203_models.DescribeVpcHoneyPotListRequest,
) -> sas_20181203_models.DescribeVpcHoneyPotListResponse:
runtime = util_models.RuntimeOptions()
return self.describe_vpc_honey_pot_list_with_options(request, runtime)
async def describe_vpc_honey_pot_list_async(
self,
request: sas_20181203_models.DescribeVpcHoneyPotListRequest,
) -> sas_20181203_models.DescribeVpcHoneyPotListResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_vpc_honey_pot_list_with_options_async(request, runtime)
def describe_vpc_list_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVpcListResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeVpcListResponse(),
self.do_rpcrequest('DescribeVpcList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_vpc_list_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVpcListResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
sas_20181203_models.DescribeVpcListResponse(),
await self.do_rpcrequest_async('DescribeVpcList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_vpc_list(self) -> sas_20181203_models.DescribeVpcListResponse:
runtime = util_models.RuntimeOptions()
return self.describe_vpc_list_with_options(runtime)
async def describe_vpc_list_async(self) -> sas_20181203_models.DescribeVpcListResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_vpc_list_with_options_async(runtime)
def describe_vul_details_with_options(
self,
request: sas_20181203_models.DescribeVulDetailsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVulDetailsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeVulDetailsResponse(),
self.do_rpcrequest('DescribeVulDetails', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_vul_details_with_options_async(
self,
request: sas_20181203_models.DescribeVulDetailsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVulDetailsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeVulDetailsResponse(),
await self.do_rpcrequest_async('DescribeVulDetails', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_vul_details(
self,
request: sas_20181203_models.DescribeVulDetailsRequest,
) -> sas_20181203_models.DescribeVulDetailsResponse:
runtime = util_models.RuntimeOptions()
return self.describe_vul_details_with_options(request, runtime)
async def describe_vul_details_async(
self,
request: sas_20181203_models.DescribeVulDetailsRequest,
) -> sas_20181203_models.DescribeVulDetailsResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_vul_details_with_options_async(request, runtime)
def describe_vul_list_with_options(
self,
request: sas_20181203_models.DescribeVulListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVulListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeVulListResponse(),
self.do_rpcrequest('DescribeVulList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_vul_list_with_options_async(
self,
request: sas_20181203_models.DescribeVulListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVulListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeVulListResponse(),
await self.do_rpcrequest_async('DescribeVulList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_vul_list(
self,
request: sas_20181203_models.DescribeVulListRequest,
) -> sas_20181203_models.DescribeVulListResponse:
runtime = util_models.RuntimeOptions()
return self.describe_vul_list_with_options(request, runtime)
async def describe_vul_list_async(
self,
request: sas_20181203_models.DescribeVulListRequest,
) -> sas_20181203_models.DescribeVulListResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_vul_list_with_options_async(request, runtime)
def describe_vul_whitelist_with_options(
self,
request: sas_20181203_models.DescribeVulWhitelistRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVulWhitelistResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeVulWhitelistResponse(),
self.do_rpcrequest('DescribeVulWhitelist', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_vul_whitelist_with_options_async(
self,
request: sas_20181203_models.DescribeVulWhitelistRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeVulWhitelistResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeVulWhitelistResponse(),
await self.do_rpcrequest_async('DescribeVulWhitelist', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_vul_whitelist(
self,
request: sas_20181203_models.DescribeVulWhitelistRequest,
) -> sas_20181203_models.DescribeVulWhitelistResponse:
runtime = util_models.RuntimeOptions()
return self.describe_vul_whitelist_with_options(request, runtime)
async def describe_vul_whitelist_async(
self,
request: sas_20181203_models.DescribeVulWhitelistRequest,
) -> sas_20181203_models.DescribeVulWhitelistResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_vul_whitelist_with_options_async(request, runtime)
def describe_warning_machines_with_options(
self,
request: sas_20181203_models.DescribeWarningMachinesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeWarningMachinesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeWarningMachinesResponse(),
self.do_rpcrequest('DescribeWarningMachines', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_warning_machines_with_options_async(
self,
request: sas_20181203_models.DescribeWarningMachinesRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeWarningMachinesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeWarningMachinesResponse(),
await self.do_rpcrequest_async('DescribeWarningMachines', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_warning_machines(
self,
request: sas_20181203_models.DescribeWarningMachinesRequest,
) -> sas_20181203_models.DescribeWarningMachinesResponse:
runtime = util_models.RuntimeOptions()
return self.describe_warning_machines_with_options(request, runtime)
async def describe_warning_machines_async(
self,
request: sas_20181203_models.DescribeWarningMachinesRequest,
) -> sas_20181203_models.DescribeWarningMachinesResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_warning_machines_with_options_async(request, runtime)
def describe_web_lock_bind_list_with_options(
self,
request: sas_20181203_models.DescribeWebLockBindListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeWebLockBindListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeWebLockBindListResponse(),
self.do_rpcrequest('DescribeWebLockBindList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_web_lock_bind_list_with_options_async(
self,
request: sas_20181203_models.DescribeWebLockBindListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeWebLockBindListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeWebLockBindListResponse(),
await self.do_rpcrequest_async('DescribeWebLockBindList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_web_lock_bind_list(
self,
request: sas_20181203_models.DescribeWebLockBindListRequest,
) -> sas_20181203_models.DescribeWebLockBindListResponse:
runtime = util_models.RuntimeOptions()
return self.describe_web_lock_bind_list_with_options(request, runtime)
async def describe_web_lock_bind_list_async(
self,
request: sas_20181203_models.DescribeWebLockBindListRequest,
) -> sas_20181203_models.DescribeWebLockBindListResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_web_lock_bind_list_with_options_async(request, runtime)
def describe_web_lock_config_list_with_options(
self,
request: sas_20181203_models.DescribeWebLockConfigListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeWebLockConfigListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeWebLockConfigListResponse(),
self.do_rpcrequest('DescribeWebLockConfigList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_web_lock_config_list_with_options_async(
self,
request: sas_20181203_models.DescribeWebLockConfigListRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.DescribeWebLockConfigListResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.DescribeWebLockConfigListResponse(),
await self.do_rpcrequest_async('DescribeWebLockConfigList', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_web_lock_config_list(
self,
request: sas_20181203_models.DescribeWebLockConfigListRequest,
) -> sas_20181203_models.DescribeWebLockConfigListResponse:
runtime = util_models.RuntimeOptions()
return self.describe_web_lock_config_list_with_options(request, runtime)
async def describe_web_lock_config_list_async(
self,
request: sas_20181203_models.DescribeWebLockConfigListRequest,
) -> sas_20181203_models.DescribeWebLockConfigListResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_web_lock_config_list_with_options_async(request, runtime)
def exec_strategy_with_options(
self,
request: sas_20181203_models.ExecStrategyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ExecStrategyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ExecStrategyResponse(),
self.do_rpcrequest('ExecStrategy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def exec_strategy_with_options_async(
self,
request: sas_20181203_models.ExecStrategyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ExecStrategyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ExecStrategyResponse(),
await self.do_rpcrequest_async('ExecStrategy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def exec_strategy(
self,
request: sas_20181203_models.ExecStrategyRequest,
) -> sas_20181203_models.ExecStrategyResponse:
runtime = util_models.RuntimeOptions()
return self.exec_strategy_with_options(request, runtime)
async def exec_strategy_async(
self,
request: sas_20181203_models.ExecStrategyRequest,
) -> sas_20181203_models.ExecStrategyResponse:
runtime = util_models.RuntimeOptions()
return await self.exec_strategy_with_options_async(request, runtime)
def export_record_with_options(
self,
request: sas_20181203_models.ExportRecordRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ExportRecordResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ExportRecordResponse(),
self.do_rpcrequest('ExportRecord', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def export_record_with_options_async(
self,
request: sas_20181203_models.ExportRecordRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ExportRecordResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ExportRecordResponse(),
await self.do_rpcrequest_async('ExportRecord', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def export_record(
self,
request: sas_20181203_models.ExportRecordRequest,
) -> sas_20181203_models.ExportRecordResponse:
runtime = util_models.RuntimeOptions()
return self.export_record_with_options(request, runtime)
async def export_record_async(
self,
request: sas_20181203_models.ExportRecordRequest,
) -> sas_20181203_models.ExportRecordResponse:
runtime = util_models.RuntimeOptions()
return await self.export_record_with_options_async(request, runtime)
def fix_check_warnings_with_options(
self,
request: sas_20181203_models.FixCheckWarningsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.FixCheckWarningsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.FixCheckWarningsResponse(),
self.do_rpcrequest('FixCheckWarnings', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def fix_check_warnings_with_options_async(
self,
request: sas_20181203_models.FixCheckWarningsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.FixCheckWarningsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.FixCheckWarningsResponse(),
await self.do_rpcrequest_async('FixCheckWarnings', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def fix_check_warnings(
self,
request: sas_20181203_models.FixCheckWarningsRequest,
) -> sas_20181203_models.FixCheckWarningsResponse:
runtime = util_models.RuntimeOptions()
return self.fix_check_warnings_with_options(request, runtime)
async def fix_check_warnings_async(
self,
request: sas_20181203_models.FixCheckWarningsRequest,
) -> sas_20181203_models.FixCheckWarningsResponse:
runtime = util_models.RuntimeOptions()
return await self.fix_check_warnings_with_options_async(request, runtime)
def get_backup_storage_count_with_options(
self,
request: sas_20181203_models.GetBackupStorageCountRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetBackupStorageCountResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetBackupStorageCountResponse(),
self.do_rpcrequest('GetBackupStorageCount', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def get_backup_storage_count_with_options_async(
self,
request: sas_20181203_models.GetBackupStorageCountRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetBackupStorageCountResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetBackupStorageCountResponse(),
await self.do_rpcrequest_async('GetBackupStorageCount', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def get_backup_storage_count(
self,
request: sas_20181203_models.GetBackupStorageCountRequest,
) -> sas_20181203_models.GetBackupStorageCountResponse:
runtime = util_models.RuntimeOptions()
return self.get_backup_storage_count_with_options(request, runtime)
async def get_backup_storage_count_async(
self,
request: sas_20181203_models.GetBackupStorageCountRequest,
) -> sas_20181203_models.GetBackupStorageCountResponse:
runtime = util_models.RuntimeOptions()
return await self.get_backup_storage_count_with_options_async(request, runtime)
def get_inc_iocs_with_options(
self,
request: sas_20181203_models.GetIncIOCsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetIncIOCsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetIncIOCsResponse(),
self.do_rpcrequest('GetIncIOCs', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def get_inc_iocs_with_options_async(
self,
request: sas_20181203_models.GetIncIOCsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetIncIOCsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetIncIOCsResponse(),
await self.do_rpcrequest_async('GetIncIOCs', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def get_inc_iocs(
self,
request: sas_20181203_models.GetIncIOCsRequest,
) -> sas_20181203_models.GetIncIOCsResponse:
runtime = util_models.RuntimeOptions()
return self.get_inc_iocs_with_options(request, runtime)
async def get_inc_iocs_async(
self,
request: sas_20181203_models.GetIncIOCsRequest,
) -> sas_20181203_models.GetIncIOCsResponse:
runtime = util_models.RuntimeOptions()
return await self.get_inc_iocs_with_options_async(request, runtime)
def get_iocs_with_options(
self,
request: sas_20181203_models.GetIOCsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetIOCsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetIOCsResponse(),
self.do_rpcrequest('GetIOCs', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def get_iocs_with_options_async(
self,
request: sas_20181203_models.GetIOCsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetIOCsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetIOCsResponse(),
await self.do_rpcrequest_async('GetIOCs', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def get_iocs(
self,
request: sas_20181203_models.GetIOCsRequest,
) -> sas_20181203_models.GetIOCsResponse:
runtime = util_models.RuntimeOptions()
return self.get_iocs_with_options(request, runtime)
async def get_iocs_async(
self,
request: sas_20181203_models.GetIOCsRequest,
) -> sas_20181203_models.GetIOCsResponse:
runtime = util_models.RuntimeOptions()
return await self.get_iocs_with_options_async(request, runtime)
def get_local_install_script_with_options(
self,
request: sas_20181203_models.GetLocalInstallScriptRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetLocalInstallScriptResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetLocalInstallScriptResponse(),
self.do_rpcrequest('GetLocalInstallScript', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def get_local_install_script_with_options_async(
self,
request: sas_20181203_models.GetLocalInstallScriptRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetLocalInstallScriptResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetLocalInstallScriptResponse(),
await self.do_rpcrequest_async('GetLocalInstallScript', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def get_local_install_script(
self,
request: sas_20181203_models.GetLocalInstallScriptRequest,
) -> sas_20181203_models.GetLocalInstallScriptResponse:
runtime = util_models.RuntimeOptions()
return self.get_local_install_script_with_options(request, runtime)
async def get_local_install_script_async(
self,
request: sas_20181203_models.GetLocalInstallScriptRequest,
) -> sas_20181203_models.GetLocalInstallScriptResponse:
runtime = util_models.RuntimeOptions()
return await self.get_local_install_script_with_options_async(request, runtime)
def get_local_uninstall_script_with_options(
self,
request: sas_20181203_models.GetLocalUninstallScriptRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetLocalUninstallScriptResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetLocalUninstallScriptResponse(),
self.do_rpcrequest('GetLocalUninstallScript', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def get_local_uninstall_script_with_options_async(
self,
request: sas_20181203_models.GetLocalUninstallScriptRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetLocalUninstallScriptResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetLocalUninstallScriptResponse(),
await self.do_rpcrequest_async('GetLocalUninstallScript', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def get_local_uninstall_script(
self,
request: sas_20181203_models.GetLocalUninstallScriptRequest,
) -> sas_20181203_models.GetLocalUninstallScriptResponse:
runtime = util_models.RuntimeOptions()
return self.get_local_uninstall_script_with_options(request, runtime)
async def get_local_uninstall_script_async(
self,
request: sas_20181203_models.GetLocalUninstallScriptRequest,
) -> sas_20181203_models.GetLocalUninstallScriptResponse:
runtime = util_models.RuntimeOptions()
return await self.get_local_uninstall_script_with_options_async(request, runtime)
def get_suspicious_statistics_with_options(
self,
request: sas_20181203_models.GetSuspiciousStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetSuspiciousStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetSuspiciousStatisticsResponse(),
self.do_rpcrequest('GetSuspiciousStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def get_suspicious_statistics_with_options_async(
self,
request: sas_20181203_models.GetSuspiciousStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetSuspiciousStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetSuspiciousStatisticsResponse(),
await self.do_rpcrequest_async('GetSuspiciousStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def get_suspicious_statistics(
self,
request: sas_20181203_models.GetSuspiciousStatisticsRequest,
) -> sas_20181203_models.GetSuspiciousStatisticsResponse:
runtime = util_models.RuntimeOptions()
return self.get_suspicious_statistics_with_options(request, runtime)
async def get_suspicious_statistics_async(
self,
request: sas_20181203_models.GetSuspiciousStatisticsRequest,
) -> sas_20181203_models.GetSuspiciousStatisticsResponse:
runtime = util_models.RuntimeOptions()
return await self.get_suspicious_statistics_with_options_async(request, runtime)
def get_vul_statistics_with_options(
self,
request: sas_20181203_models.GetVulStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetVulStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetVulStatisticsResponse(),
self.do_rpcrequest('GetVulStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def get_vul_statistics_with_options_async(
self,
request: sas_20181203_models.GetVulStatisticsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.GetVulStatisticsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.GetVulStatisticsResponse(),
await self.do_rpcrequest_async('GetVulStatistics', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def get_vul_statistics(
self,
request: sas_20181203_models.GetVulStatisticsRequest,
) -> sas_20181203_models.GetVulStatisticsResponse:
runtime = util_models.RuntimeOptions()
return self.get_vul_statistics_with_options(request, runtime)
async def get_vul_statistics_async(
self,
request: sas_20181203_models.GetVulStatisticsRequest,
) -> sas_20181203_models.GetVulStatisticsResponse:
runtime = util_models.RuntimeOptions()
return await self.get_vul_statistics_with_options_async(request, runtime)
def handle_security_events_with_options(
self,
request: sas_20181203_models.HandleSecurityEventsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.HandleSecurityEventsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.HandleSecurityEventsResponse(),
self.do_rpcrequest('HandleSecurityEvents', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def handle_security_events_with_options_async(
self,
request: sas_20181203_models.HandleSecurityEventsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.HandleSecurityEventsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.HandleSecurityEventsResponse(),
await self.do_rpcrequest_async('HandleSecurityEvents', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def handle_security_events(
self,
request: sas_20181203_models.HandleSecurityEventsRequest,
) -> sas_20181203_models.HandleSecurityEventsResponse:
runtime = util_models.RuntimeOptions()
return self.handle_security_events_with_options(request, runtime)
async def handle_security_events_async(
self,
request: sas_20181203_models.HandleSecurityEventsRequest,
) -> sas_20181203_models.HandleSecurityEventsResponse:
runtime = util_models.RuntimeOptions()
return await self.handle_security_events_with_options_async(request, runtime)
def handle_similar_security_events_with_options(
self,
request: sas_20181203_models.HandleSimilarSecurityEventsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.HandleSimilarSecurityEventsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.HandleSimilarSecurityEventsResponse(),
self.do_rpcrequest('HandleSimilarSecurityEvents', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def handle_similar_security_events_with_options_async(
self,
request: sas_20181203_models.HandleSimilarSecurityEventsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.HandleSimilarSecurityEventsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.HandleSimilarSecurityEventsResponse(),
await self.do_rpcrequest_async('HandleSimilarSecurityEvents', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def handle_similar_security_events(
self,
request: sas_20181203_models.HandleSimilarSecurityEventsRequest,
) -> sas_20181203_models.HandleSimilarSecurityEventsResponse:
runtime = util_models.RuntimeOptions()
return self.handle_similar_security_events_with_options(request, runtime)
async def handle_similar_security_events_async(
self,
request: sas_20181203_models.HandleSimilarSecurityEventsRequest,
) -> sas_20181203_models.HandleSimilarSecurityEventsResponse:
runtime = util_models.RuntimeOptions()
return await self.handle_similar_security_events_with_options_async(request, runtime)
def ignore_hc_check_warnings_with_options(
self,
request: sas_20181203_models.IgnoreHcCheckWarningsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.IgnoreHcCheckWarningsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.IgnoreHcCheckWarningsResponse(),
self.do_rpcrequest('IgnoreHcCheckWarnings', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def ignore_hc_check_warnings_with_options_async(
self,
request: sas_20181203_models.IgnoreHcCheckWarningsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.IgnoreHcCheckWarningsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.IgnoreHcCheckWarningsResponse(),
await self.do_rpcrequest_async('IgnoreHcCheckWarnings', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def ignore_hc_check_warnings(
self,
request: sas_20181203_models.IgnoreHcCheckWarningsRequest,
) -> sas_20181203_models.IgnoreHcCheckWarningsResponse:
runtime = util_models.RuntimeOptions()
return self.ignore_hc_check_warnings_with_options(request, runtime)
async def ignore_hc_check_warnings_async(
self,
request: sas_20181203_models.IgnoreHcCheckWarningsRequest,
) -> sas_20181203_models.IgnoreHcCheckWarningsResponse:
runtime = util_models.RuntimeOptions()
return await self.ignore_hc_check_warnings_with_options_async(request, runtime)
def install_backup_client_with_options(
self,
request: sas_20181203_models.InstallBackupClientRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.InstallBackupClientResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.InstallBackupClientResponse(),
self.do_rpcrequest('InstallBackupClient', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def install_backup_client_with_options_async(
self,
request: sas_20181203_models.InstallBackupClientRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.InstallBackupClientResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.InstallBackupClientResponse(),
await self.do_rpcrequest_async('InstallBackupClient', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def install_backup_client(
self,
request: sas_20181203_models.InstallBackupClientRequest,
) -> sas_20181203_models.InstallBackupClientResponse:
runtime = util_models.RuntimeOptions()
return self.install_backup_client_with_options(request, runtime)
async def install_backup_client_async(
self,
request: sas_20181203_models.InstallBackupClientRequest,
) -> sas_20181203_models.InstallBackupClientResponse:
runtime = util_models.RuntimeOptions()
return await self.install_backup_client_with_options_async(request, runtime)
def modify_anti_brute_force_rule_with_options(
self,
request: sas_20181203_models.ModifyAntiBruteForceRuleRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyAntiBruteForceRuleResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyAntiBruteForceRuleResponse(),
self.do_rpcrequest('ModifyAntiBruteForceRule', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_anti_brute_force_rule_with_options_async(
self,
request: sas_20181203_models.ModifyAntiBruteForceRuleRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyAntiBruteForceRuleResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyAntiBruteForceRuleResponse(),
await self.do_rpcrequest_async('ModifyAntiBruteForceRule', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_anti_brute_force_rule(
self,
request: sas_20181203_models.ModifyAntiBruteForceRuleRequest,
) -> sas_20181203_models.ModifyAntiBruteForceRuleResponse:
runtime = util_models.RuntimeOptions()
return self.modify_anti_brute_force_rule_with_options(request, runtime)
async def modify_anti_brute_force_rule_async(
self,
request: sas_20181203_models.ModifyAntiBruteForceRuleRequest,
) -> sas_20181203_models.ModifyAntiBruteForceRuleResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_anti_brute_force_rule_with_options_async(request, runtime)
def modify_asset_group_with_options(
self,
request: sas_20181203_models.ModifyAssetGroupRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyAssetGroupResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyAssetGroupResponse(),
self.do_rpcrequest('ModifyAssetGroup', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_asset_group_with_options_async(
self,
request: sas_20181203_models.ModifyAssetGroupRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyAssetGroupResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyAssetGroupResponse(),
await self.do_rpcrequest_async('ModifyAssetGroup', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_asset_group(
self,
request: sas_20181203_models.ModifyAssetGroupRequest,
) -> sas_20181203_models.ModifyAssetGroupResponse:
runtime = util_models.RuntimeOptions()
return self.modify_asset_group_with_options(request, runtime)
async def modify_asset_group_async(
self,
request: sas_20181203_models.ModifyAssetGroupRequest,
) -> sas_20181203_models.ModifyAssetGroupResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_asset_group_with_options_async(request, runtime)
def modify_backup_policy_with_options(
self,
tmp_req: sas_20181203_models.ModifyBackupPolicyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyBackupPolicyResponse:
UtilClient.validate_model(tmp_req)
request = sas_20181203_models.ModifyBackupPolicyShrinkRequest()
OpenApiUtilClient.convert(tmp_req, request)
if not UtilClient.is_unset(tmp_req.policy):
request.policy_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.policy, 'Policy', 'json')
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyBackupPolicyResponse(),
self.do_rpcrequest('ModifyBackupPolicy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_backup_policy_with_options_async(
self,
tmp_req: sas_20181203_models.ModifyBackupPolicyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyBackupPolicyResponse:
UtilClient.validate_model(tmp_req)
request = sas_20181203_models.ModifyBackupPolicyShrinkRequest()
OpenApiUtilClient.convert(tmp_req, request)
if not UtilClient.is_unset(tmp_req.policy):
request.policy_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.policy, 'Policy', 'json')
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyBackupPolicyResponse(),
await self.do_rpcrequest_async('ModifyBackupPolicy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_backup_policy(
self,
request: sas_20181203_models.ModifyBackupPolicyRequest,
) -> sas_20181203_models.ModifyBackupPolicyResponse:
runtime = util_models.RuntimeOptions()
return self.modify_backup_policy_with_options(request, runtime)
async def modify_backup_policy_async(
self,
request: sas_20181203_models.ModifyBackupPolicyRequest,
) -> sas_20181203_models.ModifyBackupPolicyResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_backup_policy_with_options_async(request, runtime)
def modify_backup_policy_status_with_options(
self,
request: sas_20181203_models.ModifyBackupPolicyStatusRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyBackupPolicyStatusResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyBackupPolicyStatusResponse(),
self.do_rpcrequest('ModifyBackupPolicyStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_backup_policy_status_with_options_async(
self,
request: sas_20181203_models.ModifyBackupPolicyStatusRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyBackupPolicyStatusResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyBackupPolicyStatusResponse(),
await self.do_rpcrequest_async('ModifyBackupPolicyStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_backup_policy_status(
self,
request: sas_20181203_models.ModifyBackupPolicyStatusRequest,
) -> sas_20181203_models.ModifyBackupPolicyStatusResponse:
runtime = util_models.RuntimeOptions()
return self.modify_backup_policy_status_with_options(request, runtime)
async def modify_backup_policy_status_async(
self,
request: sas_20181203_models.ModifyBackupPolicyStatusRequest,
) -> sas_20181203_models.ModifyBackupPolicyStatusResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_backup_policy_status_with_options_async(request, runtime)
def modify_create_vul_whitelist_with_options(
self,
request: sas_20181203_models.ModifyCreateVulWhitelistRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyCreateVulWhitelistResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyCreateVulWhitelistResponse(),
self.do_rpcrequest('ModifyCreateVulWhitelist', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_create_vul_whitelist_with_options_async(
self,
request: sas_20181203_models.ModifyCreateVulWhitelistRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyCreateVulWhitelistResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyCreateVulWhitelistResponse(),
await self.do_rpcrequest_async('ModifyCreateVulWhitelist', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_create_vul_whitelist(
self,
request: sas_20181203_models.ModifyCreateVulWhitelistRequest,
) -> sas_20181203_models.ModifyCreateVulWhitelistResponse:
runtime = util_models.RuntimeOptions()
return self.modify_create_vul_whitelist_with_options(request, runtime)
async def modify_create_vul_whitelist_async(
self,
request: sas_20181203_models.ModifyCreateVulWhitelistRequest,
) -> sas_20181203_models.ModifyCreateVulWhitelistResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_create_vul_whitelist_with_options_async(request, runtime)
def modify_emg_vul_submit_with_options(
self,
request: sas_20181203_models.ModifyEmgVulSubmitRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyEmgVulSubmitResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyEmgVulSubmitResponse(),
self.do_rpcrequest('ModifyEmgVulSubmit', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_emg_vul_submit_with_options_async(
self,
request: sas_20181203_models.ModifyEmgVulSubmitRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyEmgVulSubmitResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyEmgVulSubmitResponse(),
await self.do_rpcrequest_async('ModifyEmgVulSubmit', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_emg_vul_submit(
self,
request: sas_20181203_models.ModifyEmgVulSubmitRequest,
) -> sas_20181203_models.ModifyEmgVulSubmitResponse:
runtime = util_models.RuntimeOptions()
return self.modify_emg_vul_submit_with_options(request, runtime)
async def modify_emg_vul_submit_async(
self,
request: sas_20181203_models.ModifyEmgVulSubmitRequest,
) -> sas_20181203_models.ModifyEmgVulSubmitResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_emg_vul_submit_with_options_async(request, runtime)
def modify_group_property_with_options(
self,
request: sas_20181203_models.ModifyGroupPropertyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyGroupPropertyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyGroupPropertyResponse(),
self.do_rpcrequest('ModifyGroupProperty', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_group_property_with_options_async(
self,
request: sas_20181203_models.ModifyGroupPropertyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyGroupPropertyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyGroupPropertyResponse(),
await self.do_rpcrequest_async('ModifyGroupProperty', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_group_property(
self,
request: sas_20181203_models.ModifyGroupPropertyRequest,
) -> sas_20181203_models.ModifyGroupPropertyResponse:
runtime = util_models.RuntimeOptions()
return self.modify_group_property_with_options(request, runtime)
async def modify_group_property_async(
self,
request: sas_20181203_models.ModifyGroupPropertyRequest,
) -> sas_20181203_models.ModifyGroupPropertyResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_group_property_with_options_async(request, runtime)
def modify_instance_anti_brute_force_rule_with_options(
self,
request: sas_20181203_models.ModifyInstanceAntiBruteForceRuleRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyInstanceAntiBruteForceRuleResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyInstanceAntiBruteForceRuleResponse(),
self.do_rpcrequest('ModifyInstanceAntiBruteForceRule', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_instance_anti_brute_force_rule_with_options_async(
self,
request: sas_20181203_models.ModifyInstanceAntiBruteForceRuleRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyInstanceAntiBruteForceRuleResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyInstanceAntiBruteForceRuleResponse(),
await self.do_rpcrequest_async('ModifyInstanceAntiBruteForceRule', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_instance_anti_brute_force_rule(
self,
request: sas_20181203_models.ModifyInstanceAntiBruteForceRuleRequest,
) -> sas_20181203_models.ModifyInstanceAntiBruteForceRuleResponse:
runtime = util_models.RuntimeOptions()
return self.modify_instance_anti_brute_force_rule_with_options(request, runtime)
async def modify_instance_anti_brute_force_rule_async(
self,
request: sas_20181203_models.ModifyInstanceAntiBruteForceRuleRequest,
) -> sas_20181203_models.ModifyInstanceAntiBruteForceRuleResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_instance_anti_brute_force_rule_with_options_async(request, runtime)
def modify_login_base_config_with_options(
self,
request: sas_20181203_models.ModifyLoginBaseConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyLoginBaseConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyLoginBaseConfigResponse(),
self.do_rpcrequest('ModifyLoginBaseConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_login_base_config_with_options_async(
self,
request: sas_20181203_models.ModifyLoginBaseConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyLoginBaseConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyLoginBaseConfigResponse(),
await self.do_rpcrequest_async('ModifyLoginBaseConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_login_base_config(
self,
request: sas_20181203_models.ModifyLoginBaseConfigRequest,
) -> sas_20181203_models.ModifyLoginBaseConfigResponse:
runtime = util_models.RuntimeOptions()
return self.modify_login_base_config_with_options(request, runtime)
async def modify_login_base_config_async(
self,
request: sas_20181203_models.ModifyLoginBaseConfigRequest,
) -> sas_20181203_models.ModifyLoginBaseConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_login_base_config_with_options_async(request, runtime)
def modify_login_switch_config_with_options(
self,
request: sas_20181203_models.ModifyLoginSwitchConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyLoginSwitchConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyLoginSwitchConfigResponse(),
self.do_rpcrequest('ModifyLoginSwitchConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_login_switch_config_with_options_async(
self,
request: sas_20181203_models.ModifyLoginSwitchConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyLoginSwitchConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyLoginSwitchConfigResponse(),
await self.do_rpcrequest_async('ModifyLoginSwitchConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_login_switch_config(
self,
request: sas_20181203_models.ModifyLoginSwitchConfigRequest,
) -> sas_20181203_models.ModifyLoginSwitchConfigResponse:
runtime = util_models.RuntimeOptions()
return self.modify_login_switch_config_with_options(request, runtime)
async def modify_login_switch_config_async(
self,
request: sas_20181203_models.ModifyLoginSwitchConfigRequest,
) -> sas_20181203_models.ModifyLoginSwitchConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_login_switch_config_with_options_async(request, runtime)
def modify_notice_config_with_options(
self,
request: sas_20181203_models.ModifyNoticeConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyNoticeConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyNoticeConfigResponse(),
self.do_rpcrequest('ModifyNoticeConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_notice_config_with_options_async(
self,
request: sas_20181203_models.ModifyNoticeConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyNoticeConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyNoticeConfigResponse(),
await self.do_rpcrequest_async('ModifyNoticeConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_notice_config(
self,
request: sas_20181203_models.ModifyNoticeConfigRequest,
) -> sas_20181203_models.ModifyNoticeConfigResponse:
runtime = util_models.RuntimeOptions()
return self.modify_notice_config_with_options(request, runtime)
async def modify_notice_config_async(
self,
request: sas_20181203_models.ModifyNoticeConfigRequest,
) -> sas_20181203_models.ModifyNoticeConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_notice_config_with_options_async(request, runtime)
def modify_open_log_shipper_with_options(
self,
request: sas_20181203_models.ModifyOpenLogShipperRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyOpenLogShipperResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyOpenLogShipperResponse(),
self.do_rpcrequest('ModifyOpenLogShipper', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_open_log_shipper_with_options_async(
self,
request: sas_20181203_models.ModifyOpenLogShipperRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyOpenLogShipperResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyOpenLogShipperResponse(),
await self.do_rpcrequest_async('ModifyOpenLogShipper', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_open_log_shipper(
self,
request: sas_20181203_models.ModifyOpenLogShipperRequest,
) -> sas_20181203_models.ModifyOpenLogShipperResponse:
runtime = util_models.RuntimeOptions()
return self.modify_open_log_shipper_with_options(request, runtime)
async def modify_open_log_shipper_async(
self,
request: sas_20181203_models.ModifyOpenLogShipperRequest,
) -> sas_20181203_models.ModifyOpenLogShipperResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_open_log_shipper_with_options_async(request, runtime)
def modify_operate_vul_with_options(
self,
request: sas_20181203_models.ModifyOperateVulRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyOperateVulResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyOperateVulResponse(),
self.do_rpcrequest('ModifyOperateVul', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_operate_vul_with_options_async(
self,
request: sas_20181203_models.ModifyOperateVulRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyOperateVulResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyOperateVulResponse(),
await self.do_rpcrequest_async('ModifyOperateVul', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_operate_vul(
self,
request: sas_20181203_models.ModifyOperateVulRequest,
) -> sas_20181203_models.ModifyOperateVulResponse:
runtime = util_models.RuntimeOptions()
return self.modify_operate_vul_with_options(request, runtime)
async def modify_operate_vul_async(
self,
request: sas_20181203_models.ModifyOperateVulRequest,
) -> sas_20181203_models.ModifyOperateVulResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_operate_vul_with_options_async(request, runtime)
def modify_push_all_task_with_options(
self,
request: sas_20181203_models.ModifyPushAllTaskRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyPushAllTaskResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyPushAllTaskResponse(),
self.do_rpcrequest('ModifyPushAllTask', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_push_all_task_with_options_async(
self,
request: sas_20181203_models.ModifyPushAllTaskRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyPushAllTaskResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyPushAllTaskResponse(),
await self.do_rpcrequest_async('ModifyPushAllTask', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_push_all_task(
self,
request: sas_20181203_models.ModifyPushAllTaskRequest,
) -> sas_20181203_models.ModifyPushAllTaskResponse:
runtime = util_models.RuntimeOptions()
return self.modify_push_all_task_with_options(request, runtime)
async def modify_push_all_task_async(
self,
request: sas_20181203_models.ModifyPushAllTaskRequest,
) -> sas_20181203_models.ModifyPushAllTaskResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_push_all_task_with_options_async(request, runtime)
def modify_risk_check_status_with_options(
self,
request: sas_20181203_models.ModifyRiskCheckStatusRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyRiskCheckStatusResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyRiskCheckStatusResponse(),
self.do_rpcrequest('ModifyRiskCheckStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_risk_check_status_with_options_async(
self,
request: sas_20181203_models.ModifyRiskCheckStatusRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyRiskCheckStatusResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyRiskCheckStatusResponse(),
await self.do_rpcrequest_async('ModifyRiskCheckStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_risk_check_status(
self,
request: sas_20181203_models.ModifyRiskCheckStatusRequest,
) -> sas_20181203_models.ModifyRiskCheckStatusResponse:
runtime = util_models.RuntimeOptions()
return self.modify_risk_check_status_with_options(request, runtime)
async def modify_risk_check_status_async(
self,
request: sas_20181203_models.ModifyRiskCheckStatusRequest,
) -> sas_20181203_models.ModifyRiskCheckStatusResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_risk_check_status_with_options_async(request, runtime)
def modify_risk_single_result_status_with_options(
self,
request: sas_20181203_models.ModifyRiskSingleResultStatusRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyRiskSingleResultStatusResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyRiskSingleResultStatusResponse(),
self.do_rpcrequest('ModifyRiskSingleResultStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_risk_single_result_status_with_options_async(
self,
request: sas_20181203_models.ModifyRiskSingleResultStatusRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyRiskSingleResultStatusResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyRiskSingleResultStatusResponse(),
await self.do_rpcrequest_async('ModifyRiskSingleResultStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_risk_single_result_status(
self,
request: sas_20181203_models.ModifyRiskSingleResultStatusRequest,
) -> sas_20181203_models.ModifyRiskSingleResultStatusResponse:
runtime = util_models.RuntimeOptions()
return self.modify_risk_single_result_status_with_options(request, runtime)
async def modify_risk_single_result_status_async(
self,
request: sas_20181203_models.ModifyRiskSingleResultStatusRequest,
) -> sas_20181203_models.ModifyRiskSingleResultStatusResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_risk_single_result_status_with_options_async(request, runtime)
def modify_security_check_schedule_config_with_options(
self,
request: sas_20181203_models.ModifySecurityCheckScheduleConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifySecurityCheckScheduleConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifySecurityCheckScheduleConfigResponse(),
self.do_rpcrequest('ModifySecurityCheckScheduleConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_security_check_schedule_config_with_options_async(
self,
request: sas_20181203_models.ModifySecurityCheckScheduleConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifySecurityCheckScheduleConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifySecurityCheckScheduleConfigResponse(),
await self.do_rpcrequest_async('ModifySecurityCheckScheduleConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_security_check_schedule_config(
self,
request: sas_20181203_models.ModifySecurityCheckScheduleConfigRequest,
) -> sas_20181203_models.ModifySecurityCheckScheduleConfigResponse:
runtime = util_models.RuntimeOptions()
return self.modify_security_check_schedule_config_with_options(request, runtime)
async def modify_security_check_schedule_config_async(
self,
request: sas_20181203_models.ModifySecurityCheckScheduleConfigRequest,
) -> sas_20181203_models.ModifySecurityCheckScheduleConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_security_check_schedule_config_with_options_async(request, runtime)
def modify_start_vul_scan_with_options(
self,
request: sas_20181203_models.ModifyStartVulScanRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyStartVulScanResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyStartVulScanResponse(),
self.do_rpcrequest('ModifyStartVulScan', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_start_vul_scan_with_options_async(
self,
request: sas_20181203_models.ModifyStartVulScanRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyStartVulScanResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyStartVulScanResponse(),
await self.do_rpcrequest_async('ModifyStartVulScan', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_start_vul_scan(
self,
request: sas_20181203_models.ModifyStartVulScanRequest,
) -> sas_20181203_models.ModifyStartVulScanResponse:
runtime = util_models.RuntimeOptions()
return self.modify_start_vul_scan_with_options(request, runtime)
async def modify_start_vul_scan_async(
self,
request: sas_20181203_models.ModifyStartVulScanRequest,
) -> sas_20181203_models.ModifyStartVulScanResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_start_vul_scan_with_options_async(request, runtime)
def modify_strategy_with_options(
self,
request: sas_20181203_models.ModifyStrategyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyStrategyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyStrategyResponse(),
self.do_rpcrequest('ModifyStrategy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_strategy_with_options_async(
self,
request: sas_20181203_models.ModifyStrategyRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyStrategyResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyStrategyResponse(),
await self.do_rpcrequest_async('ModifyStrategy', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_strategy(
self,
request: sas_20181203_models.ModifyStrategyRequest,
) -> sas_20181203_models.ModifyStrategyResponse:
runtime = util_models.RuntimeOptions()
return self.modify_strategy_with_options(request, runtime)
async def modify_strategy_async(
self,
request: sas_20181203_models.ModifyStrategyRequest,
) -> sas_20181203_models.ModifyStrategyResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_strategy_with_options_async(request, runtime)
def modify_strategy_target_with_options(
self,
request: sas_20181203_models.ModifyStrategyTargetRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyStrategyTargetResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyStrategyTargetResponse(),
self.do_rpcrequest('ModifyStrategyTarget', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_strategy_target_with_options_async(
self,
request: sas_20181203_models.ModifyStrategyTargetRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyStrategyTargetResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyStrategyTargetResponse(),
await self.do_rpcrequest_async('ModifyStrategyTarget', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_strategy_target(
self,
request: sas_20181203_models.ModifyStrategyTargetRequest,
) -> sas_20181203_models.ModifyStrategyTargetResponse:
runtime = util_models.RuntimeOptions()
return self.modify_strategy_target_with_options(request, runtime)
async def modify_strategy_target_async(
self,
request: sas_20181203_models.ModifyStrategyTargetRequest,
) -> sas_20181203_models.ModifyStrategyTargetResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_strategy_target_with_options_async(request, runtime)
def modify_tag_with_uuid_with_options(
self,
request: sas_20181203_models.ModifyTagWithUuidRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyTagWithUuidResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyTagWithUuidResponse(),
self.do_rpcrequest('ModifyTagWithUuid', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_tag_with_uuid_with_options_async(
self,
request: sas_20181203_models.ModifyTagWithUuidRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyTagWithUuidResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyTagWithUuidResponse(),
await self.do_rpcrequest_async('ModifyTagWithUuid', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_tag_with_uuid(
self,
request: sas_20181203_models.ModifyTagWithUuidRequest,
) -> sas_20181203_models.ModifyTagWithUuidResponse:
runtime = util_models.RuntimeOptions()
return self.modify_tag_with_uuid_with_options(request, runtime)
async def modify_tag_with_uuid_async(
self,
request: sas_20181203_models.ModifyTagWithUuidRequest,
) -> sas_20181203_models.ModifyTagWithUuidResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_tag_with_uuid_with_options_async(request, runtime)
def modify_vpc_honey_pot_with_options(
self,
request: sas_20181203_models.ModifyVpcHoneyPotRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyVpcHoneyPotResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyVpcHoneyPotResponse(),
self.do_rpcrequest('ModifyVpcHoneyPot', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_vpc_honey_pot_with_options_async(
self,
request: sas_20181203_models.ModifyVpcHoneyPotRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyVpcHoneyPotResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyVpcHoneyPotResponse(),
await self.do_rpcrequest_async('ModifyVpcHoneyPot', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_vpc_honey_pot(
self,
request: sas_20181203_models.ModifyVpcHoneyPotRequest,
) -> sas_20181203_models.ModifyVpcHoneyPotResponse:
runtime = util_models.RuntimeOptions()
return self.modify_vpc_honey_pot_with_options(request, runtime)
async def modify_vpc_honey_pot_async(
self,
request: sas_20181203_models.ModifyVpcHoneyPotRequest,
) -> sas_20181203_models.ModifyVpcHoneyPotResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_vpc_honey_pot_with_options_async(request, runtime)
def modify_vul_target_config_with_options(
self,
request: sas_20181203_models.ModifyVulTargetConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyVulTargetConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyVulTargetConfigResponse(),
self.do_rpcrequest('ModifyVulTargetConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_vul_target_config_with_options_async(
self,
request: sas_20181203_models.ModifyVulTargetConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyVulTargetConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyVulTargetConfigResponse(),
await self.do_rpcrequest_async('ModifyVulTargetConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_vul_target_config(
self,
request: sas_20181203_models.ModifyVulTargetConfigRequest,
) -> sas_20181203_models.ModifyVulTargetConfigResponse:
runtime = util_models.RuntimeOptions()
return self.modify_vul_target_config_with_options(request, runtime)
async def modify_vul_target_config_async(
self,
request: sas_20181203_models.ModifyVulTargetConfigRequest,
) -> sas_20181203_models.ModifyVulTargetConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_vul_target_config_with_options_async(request, runtime)
def modify_web_lock_create_config_with_options(
self,
request: sas_20181203_models.ModifyWebLockCreateConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyWebLockCreateConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyWebLockCreateConfigResponse(),
self.do_rpcrequest('ModifyWebLockCreateConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_web_lock_create_config_with_options_async(
self,
request: sas_20181203_models.ModifyWebLockCreateConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyWebLockCreateConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyWebLockCreateConfigResponse(),
await self.do_rpcrequest_async('ModifyWebLockCreateConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_web_lock_create_config(
self,
request: sas_20181203_models.ModifyWebLockCreateConfigRequest,
) -> sas_20181203_models.ModifyWebLockCreateConfigResponse:
runtime = util_models.RuntimeOptions()
return self.modify_web_lock_create_config_with_options(request, runtime)
async def modify_web_lock_create_config_async(
self,
request: sas_20181203_models.ModifyWebLockCreateConfigRequest,
) -> sas_20181203_models.ModifyWebLockCreateConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_web_lock_create_config_with_options_async(request, runtime)
def modify_web_lock_delete_config_with_options(
self,
request: sas_20181203_models.ModifyWebLockDeleteConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyWebLockDeleteConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyWebLockDeleteConfigResponse(),
self.do_rpcrequest('ModifyWebLockDeleteConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_web_lock_delete_config_with_options_async(
self,
request: sas_20181203_models.ModifyWebLockDeleteConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyWebLockDeleteConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyWebLockDeleteConfigResponse(),
await self.do_rpcrequest_async('ModifyWebLockDeleteConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_web_lock_delete_config(
self,
request: sas_20181203_models.ModifyWebLockDeleteConfigRequest,
) -> sas_20181203_models.ModifyWebLockDeleteConfigResponse:
runtime = util_models.RuntimeOptions()
return self.modify_web_lock_delete_config_with_options(request, runtime)
async def modify_web_lock_delete_config_async(
self,
request: sas_20181203_models.ModifyWebLockDeleteConfigRequest,
) -> sas_20181203_models.ModifyWebLockDeleteConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_web_lock_delete_config_with_options_async(request, runtime)
def modify_web_lock_start_with_options(
self,
request: sas_20181203_models.ModifyWebLockStartRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyWebLockStartResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyWebLockStartResponse(),
self.do_rpcrequest('ModifyWebLockStart', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_web_lock_start_with_options_async(
self,
request: sas_20181203_models.ModifyWebLockStartRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyWebLockStartResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyWebLockStartResponse(),
await self.do_rpcrequest_async('ModifyWebLockStart', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_web_lock_start(
self,
request: sas_20181203_models.ModifyWebLockStartRequest,
) -> sas_20181203_models.ModifyWebLockStartResponse:
runtime = util_models.RuntimeOptions()
return self.modify_web_lock_start_with_options(request, runtime)
async def modify_web_lock_start_async(
self,
request: sas_20181203_models.ModifyWebLockStartRequest,
) -> sas_20181203_models.ModifyWebLockStartResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_web_lock_start_with_options_async(request, runtime)
def modify_web_lock_status_with_options(
self,
request: sas_20181203_models.ModifyWebLockStatusRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyWebLockStatusResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyWebLockStatusResponse(),
self.do_rpcrequest('ModifyWebLockStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_web_lock_status_with_options_async(
self,
request: sas_20181203_models.ModifyWebLockStatusRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyWebLockStatusResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyWebLockStatusResponse(),
await self.do_rpcrequest_async('ModifyWebLockStatus', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_web_lock_status(
self,
request: sas_20181203_models.ModifyWebLockStatusRequest,
) -> sas_20181203_models.ModifyWebLockStatusResponse:
runtime = util_models.RuntimeOptions()
return self.modify_web_lock_status_with_options(request, runtime)
async def modify_web_lock_status_async(
self,
request: sas_20181203_models.ModifyWebLockStatusRequest,
) -> sas_20181203_models.ModifyWebLockStatusResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_web_lock_status_with_options_async(request, runtime)
def modify_web_lock_unbind_with_options(
self,
request: sas_20181203_models.ModifyWebLockUnbindRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyWebLockUnbindResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyWebLockUnbindResponse(),
self.do_rpcrequest('ModifyWebLockUnbind', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_web_lock_unbind_with_options_async(
self,
request: sas_20181203_models.ModifyWebLockUnbindRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyWebLockUnbindResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyWebLockUnbindResponse(),
await self.do_rpcrequest_async('ModifyWebLockUnbind', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_web_lock_unbind(
self,
request: sas_20181203_models.ModifyWebLockUnbindRequest,
) -> sas_20181203_models.ModifyWebLockUnbindResponse:
runtime = util_models.RuntimeOptions()
return self.modify_web_lock_unbind_with_options(request, runtime)
async def modify_web_lock_unbind_async(
self,
request: sas_20181203_models.ModifyWebLockUnbindRequest,
) -> sas_20181203_models.ModifyWebLockUnbindResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_web_lock_unbind_with_options_async(request, runtime)
def modify_web_lock_update_config_with_options(
self,
request: sas_20181203_models.ModifyWebLockUpdateConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyWebLockUpdateConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyWebLockUpdateConfigResponse(),
self.do_rpcrequest('ModifyWebLockUpdateConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def modify_web_lock_update_config_with_options_async(
self,
request: sas_20181203_models.ModifyWebLockUpdateConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ModifyWebLockUpdateConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ModifyWebLockUpdateConfigResponse(),
await self.do_rpcrequest_async('ModifyWebLockUpdateConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def modify_web_lock_update_config(
self,
request: sas_20181203_models.ModifyWebLockUpdateConfigRequest,
) -> sas_20181203_models.ModifyWebLockUpdateConfigResponse:
runtime = util_models.RuntimeOptions()
return self.modify_web_lock_update_config_with_options(request, runtime)
async def modify_web_lock_update_config_async(
self,
request: sas_20181203_models.ModifyWebLockUpdateConfigRequest,
) -> sas_20181203_models.ModifyWebLockUpdateConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.modify_web_lock_update_config_with_options_async(request, runtime)
def operate_suspicious_target_config_with_options(
self,
request: sas_20181203_models.OperateSuspiciousTargetConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.OperateSuspiciousTargetConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.OperateSuspiciousTargetConfigResponse(),
self.do_rpcrequest('OperateSuspiciousTargetConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def operate_suspicious_target_config_with_options_async(
self,
request: sas_20181203_models.OperateSuspiciousTargetConfigRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.OperateSuspiciousTargetConfigResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.OperateSuspiciousTargetConfigResponse(),
await self.do_rpcrequest_async('OperateSuspiciousTargetConfig', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def operate_suspicious_target_config(
self,
request: sas_20181203_models.OperateSuspiciousTargetConfigRequest,
) -> sas_20181203_models.OperateSuspiciousTargetConfigResponse:
runtime = util_models.RuntimeOptions()
return self.operate_suspicious_target_config_with_options(request, runtime)
async def operate_suspicious_target_config_async(
self,
request: sas_20181203_models.OperateSuspiciousTargetConfigRequest,
) -> sas_20181203_models.OperateSuspiciousTargetConfigResponse:
runtime = util_models.RuntimeOptions()
return await self.operate_suspicious_target_config_with_options_async(request, runtime)
def operate_vuls_with_options(
self,
request: sas_20181203_models.OperateVulsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.OperateVulsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.OperateVulsResponse(),
self.do_rpcrequest('OperateVuls', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def operate_vuls_with_options_async(
self,
request: sas_20181203_models.OperateVulsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.OperateVulsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.OperateVulsResponse(),
await self.do_rpcrequest_async('OperateVuls', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def operate_vuls(
self,
request: sas_20181203_models.OperateVulsRequest,
) -> sas_20181203_models.OperateVulsResponse:
runtime = util_models.RuntimeOptions()
return self.operate_vuls_with_options(request, runtime)
async def operate_vuls_async(
self,
request: sas_20181203_models.OperateVulsRequest,
) -> sas_20181203_models.OperateVulsResponse:
runtime = util_models.RuntimeOptions()
return await self.operate_vuls_with_options_async(request, runtime)
def operation_susp_events_with_options(
self,
request: sas_20181203_models.OperationSuspEventsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.OperationSuspEventsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.OperationSuspEventsResponse(),
self.do_rpcrequest('OperationSuspEvents', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def operation_susp_events_with_options_async(
self,
request: sas_20181203_models.OperationSuspEventsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.OperationSuspEventsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.OperationSuspEventsResponse(),
await self.do_rpcrequest_async('OperationSuspEvents', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def operation_susp_events(
self,
request: sas_20181203_models.OperationSuspEventsRequest,
) -> sas_20181203_models.OperationSuspEventsResponse:
runtime = util_models.RuntimeOptions()
return self.operation_susp_events_with_options(request, runtime)
async def operation_susp_events_async(
self,
request: sas_20181203_models.OperationSuspEventsRequest,
) -> sas_20181203_models.OperationSuspEventsResponse:
runtime = util_models.RuntimeOptions()
return await self.operation_susp_events_with_options_async(request, runtime)
def pause_client_with_options(
self,
request: sas_20181203_models.PauseClientRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.PauseClientResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.PauseClientResponse(),
self.do_rpcrequest('PauseClient', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def pause_client_with_options_async(
self,
request: sas_20181203_models.PauseClientRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.PauseClientResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.PauseClientResponse(),
await self.do_rpcrequest_async('PauseClient', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def pause_client(
self,
request: sas_20181203_models.PauseClientRequest,
) -> sas_20181203_models.PauseClientResponse:
runtime = util_models.RuntimeOptions()
return self.pause_client_with_options(request, runtime)
async def pause_client_async(
self,
request: sas_20181203_models.PauseClientRequest,
) -> sas_20181203_models.PauseClientResponse:
runtime = util_models.RuntimeOptions()
return await self.pause_client_with_options_async(request, runtime)
def refresh_container_assets_with_options(
self,
request: sas_20181203_models.RefreshContainerAssetsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.RefreshContainerAssetsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.RefreshContainerAssetsResponse(),
self.do_rpcrequest('RefreshContainerAssets', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def refresh_container_assets_with_options_async(
self,
request: sas_20181203_models.RefreshContainerAssetsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.RefreshContainerAssetsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.RefreshContainerAssetsResponse(),
await self.do_rpcrequest_async('RefreshContainerAssets', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def refresh_container_assets(
self,
request: sas_20181203_models.RefreshContainerAssetsRequest,
) -> sas_20181203_models.RefreshContainerAssetsResponse:
runtime = util_models.RuntimeOptions()
return self.refresh_container_assets_with_options(request, runtime)
async def refresh_container_assets_async(
self,
request: sas_20181203_models.RefreshContainerAssetsRequest,
) -> sas_20181203_models.RefreshContainerAssetsResponse:
runtime = util_models.RuntimeOptions()
return await self.refresh_container_assets_with_options_async(request, runtime)
def rollback_susp_event_quara_file_with_options(
self,
request: sas_20181203_models.RollbackSuspEventQuaraFileRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.RollbackSuspEventQuaraFileResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.RollbackSuspEventQuaraFileResponse(),
self.do_rpcrequest('RollbackSuspEventQuaraFile', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def rollback_susp_event_quara_file_with_options_async(
self,
request: sas_20181203_models.RollbackSuspEventQuaraFileRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.RollbackSuspEventQuaraFileResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.RollbackSuspEventQuaraFileResponse(),
await self.do_rpcrequest_async('RollbackSuspEventQuaraFile', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def rollback_susp_event_quara_file(
self,
request: sas_20181203_models.RollbackSuspEventQuaraFileRequest,
) -> sas_20181203_models.RollbackSuspEventQuaraFileResponse:
runtime = util_models.RuntimeOptions()
return self.rollback_susp_event_quara_file_with_options(request, runtime)
async def rollback_susp_event_quara_file_async(
self,
request: sas_20181203_models.RollbackSuspEventQuaraFileRequest,
) -> sas_20181203_models.RollbackSuspEventQuaraFileResponse:
runtime = util_models.RuntimeOptions()
return await self.rollback_susp_event_quara_file_with_options_async(request, runtime)
def sas_install_code_with_options(
self,
request: sas_20181203_models.SasInstallCodeRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.SasInstallCodeResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.SasInstallCodeResponse(),
self.do_rpcrequest('SasInstallCode', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def sas_install_code_with_options_async(
self,
request: sas_20181203_models.SasInstallCodeRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.SasInstallCodeResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.SasInstallCodeResponse(),
await self.do_rpcrequest_async('SasInstallCode', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def sas_install_code(
self,
request: sas_20181203_models.SasInstallCodeRequest,
) -> sas_20181203_models.SasInstallCodeResponse:
runtime = util_models.RuntimeOptions()
return self.sas_install_code_with_options(request, runtime)
async def sas_install_code_async(
self,
request: sas_20181203_models.SasInstallCodeRequest,
) -> sas_20181203_models.SasInstallCodeResponse:
runtime = util_models.RuntimeOptions()
return await self.sas_install_code_with_options_async(request, runtime)
def start_baseline_security_check_with_options(
self,
request: sas_20181203_models.StartBaselineSecurityCheckRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.StartBaselineSecurityCheckResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.StartBaselineSecurityCheckResponse(),
self.do_rpcrequest('StartBaselineSecurityCheck', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def start_baseline_security_check_with_options_async(
self,
request: sas_20181203_models.StartBaselineSecurityCheckRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.StartBaselineSecurityCheckResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.StartBaselineSecurityCheckResponse(),
await self.do_rpcrequest_async('StartBaselineSecurityCheck', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def start_baseline_security_check(
self,
request: sas_20181203_models.StartBaselineSecurityCheckRequest,
) -> sas_20181203_models.StartBaselineSecurityCheckResponse:
runtime = util_models.RuntimeOptions()
return self.start_baseline_security_check_with_options(request, runtime)
async def start_baseline_security_check_async(
self,
request: sas_20181203_models.StartBaselineSecurityCheckRequest,
) -> sas_20181203_models.StartBaselineSecurityCheckResponse:
runtime = util_models.RuntimeOptions()
return await self.start_baseline_security_check_with_options_async(request, runtime)
def start_image_vul_scan_with_options(
self,
request: sas_20181203_models.StartImageVulScanRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.StartImageVulScanResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.StartImageVulScanResponse(),
self.do_rpcrequest('StartImageVulScan', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def start_image_vul_scan_with_options_async(
self,
request: sas_20181203_models.StartImageVulScanRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.StartImageVulScanResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.StartImageVulScanResponse(),
await self.do_rpcrequest_async('StartImageVulScan', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def start_image_vul_scan(
self,
request: sas_20181203_models.StartImageVulScanRequest,
) -> sas_20181203_models.StartImageVulScanResponse:
runtime = util_models.RuntimeOptions()
return self.start_image_vul_scan_with_options(request, runtime)
async def start_image_vul_scan_async(
self,
request: sas_20181203_models.StartImageVulScanRequest,
) -> sas_20181203_models.StartImageVulScanResponse:
runtime = util_models.RuntimeOptions()
return await self.start_image_vul_scan_with_options_async(request, runtime)
def start_virus_scan_task_with_options(
self,
request: sas_20181203_models.StartVirusScanTaskRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.StartVirusScanTaskResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.StartVirusScanTaskResponse(),
self.do_rpcrequest('StartVirusScanTask', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def start_virus_scan_task_with_options_async(
self,
request: sas_20181203_models.StartVirusScanTaskRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.StartVirusScanTaskResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.StartVirusScanTaskResponse(),
await self.do_rpcrequest_async('StartVirusScanTask', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def start_virus_scan_task(
self,
request: sas_20181203_models.StartVirusScanTaskRequest,
) -> sas_20181203_models.StartVirusScanTaskResponse:
runtime = util_models.RuntimeOptions()
return self.start_virus_scan_task_with_options(request, runtime)
async def start_virus_scan_task_async(
self,
request: sas_20181203_models.StartVirusScanTaskRequest,
) -> sas_20181203_models.StartVirusScanTaskResponse:
runtime = util_models.RuntimeOptions()
return await self.start_virus_scan_task_with_options_async(request, runtime)
def unbind_aegis_with_options(
self,
request: sas_20181203_models.UnbindAegisRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.UnbindAegisResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.UnbindAegisResponse(),
self.do_rpcrequest('UnbindAegis', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def unbind_aegis_with_options_async(
self,
request: sas_20181203_models.UnbindAegisRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.UnbindAegisResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.UnbindAegisResponse(),
await self.do_rpcrequest_async('UnbindAegis', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def unbind_aegis(
self,
request: sas_20181203_models.UnbindAegisRequest,
) -> sas_20181203_models.UnbindAegisResponse:
runtime = util_models.RuntimeOptions()
return self.unbind_aegis_with_options(request, runtime)
async def unbind_aegis_async(
self,
request: sas_20181203_models.UnbindAegisRequest,
) -> sas_20181203_models.UnbindAegisResponse:
runtime = util_models.RuntimeOptions()
return await self.unbind_aegis_with_options_async(request, runtime)
def uninstall_backup_client_with_options(
self,
request: sas_20181203_models.UninstallBackupClientRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.UninstallBackupClientResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.UninstallBackupClientResponse(),
self.do_rpcrequest('UninstallBackupClient', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def uninstall_backup_client_with_options_async(
self,
request: sas_20181203_models.UninstallBackupClientRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.UninstallBackupClientResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.UninstallBackupClientResponse(),
await self.do_rpcrequest_async('UninstallBackupClient', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def uninstall_backup_client(
self,
request: sas_20181203_models.UninstallBackupClientRequest,
) -> sas_20181203_models.UninstallBackupClientResponse:
runtime = util_models.RuntimeOptions()
return self.uninstall_backup_client_with_options(request, runtime)
async def uninstall_backup_client_async(
self,
request: sas_20181203_models.UninstallBackupClientRequest,
) -> sas_20181203_models.UninstallBackupClientResponse:
runtime = util_models.RuntimeOptions()
return await self.uninstall_backup_client_with_options_async(request, runtime)
def validate_hc_warnings_with_options(
self,
request: sas_20181203_models.ValidateHcWarningsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ValidateHcWarningsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ValidateHcWarningsResponse(),
self.do_rpcrequest('ValidateHcWarnings', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def validate_hc_warnings_with_options_async(
self,
request: sas_20181203_models.ValidateHcWarningsRequest,
runtime: util_models.RuntimeOptions,
) -> sas_20181203_models.ValidateHcWarningsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
sas_20181203_models.ValidateHcWarningsResponse(),
await self.do_rpcrequest_async('ValidateHcWarnings', '2018-12-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def validate_hc_warnings(
self,
request: sas_20181203_models.ValidateHcWarningsRequest,
) -> sas_20181203_models.ValidateHcWarningsResponse:
runtime = util_models.RuntimeOptions()
return self.validate_hc_warnings_with_options(request, runtime)
async def validate_hc_warnings_async(
self,
request: sas_20181203_models.ValidateHcWarningsRequest,
) -> sas_20181203_models.ValidateHcWarningsResponse:
runtime = util_models.RuntimeOptions()
return await self.validate_hc_warnings_with_options_async(request, runtime)
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
c08246e90752b5cf2931f98b6a3b7c4a9ca8bf10 | 8452ab63a0c623a78859d5aa0c3fe2d4e413059e | /250957375_lab1_module2_task3.py | ec0c383c81051a3a4030acf0d8442b2eadf5bb01 | [] | no_license | cdevito2/networkingLabs | 079a1c334ee6332ae82f1167156d842291523140 | 47b0ba8dc9aa5faf6e439a7981ddd3f74502c4fb | refs/heads/master | 2020-08-09T05:32:29.732296 | 2019-10-09T19:48:19 | 2019-10-09T19:48:19 | 214,009,231 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,869 | py | '''
Created on Oct. 6, 2019
@author: chris
'''
from socket import *
import base64
import ssl
msg = "\r\n ChrisDevito. 250957375"
endmsg = "\r\n.\r\n"
addmsg = "250957375"
#submitMsg = msg+addmsg
# Choose a mail server (e.g. Google mail server) and call it mailserver mailserver = #Fill in start #Fill in end
mailserver = "smtp.gmail.com"#i chose google for my mail server
serverPort = 587;#google said to use either port 465 or 587, i chose 587 so i can use tls authentication
# Create socket called clientSocket and establish a TCP connection with mailserver
#Fill in start
clientSocket = socket(AF_INET,SOCK_STREAM)
#sock_stream indicates TCP socket rather than UDP
#AF_INET indicates network is using ipv4
#just creating socket called clientSocket
print("gonna connect")#output statment
clientSocket.connect((mailserver,serverPort))#establishing TCP connection
print("connected")
#handshake is performed, connection established
#Fill in end
recv = clientSocket.recv(1024).decode() #getting server response
print(recv)#outputting server response
print("that was recv")
if recv[:3] != '220': #220 is good response so i want to know if a bad response occurs
print('220 reply not received from server.')
# Send HELO command and print server response.
helo = 'HELO Alice\r\n'
clientSocket.send(helo.encode('utf-8')) #must encode the string to utf-8 to be accepted by google
resp = clientSocket.recv(1024).decode() #get server response
print("helo: "+resp)
if resp[:3] != '250':
print('heloCommand: 250 reply not received from server.')
tlsCommand = "STARTTLS\r\n" #gmail uses TLS security so i had to include this
clientSocket.send(tlsCommand.encode('utf-8')) #encode to utf-8 because thats what google requires
resp = clientSocket.recv(1024).decode()
print("tls: "+resp) # get TLS response and output
if resp[:3] != '220':
print('startTls: 220 reply not received from server.')
Client_Socket_WrappedSSL = ssl.wrap_socket(clientSocket)
command = "AUTH LOGIN\r\n" #google requires socket to be wrapped with SSL
Client_Socket_WrappedSSL.send(command.encode('utf-8'))
resp = Client_Socket_WrappedSSL.recv(1024).decode()
print("authentication: "+resp)
if resp[:3] != '334':
print('authlogon: 334 reply not received from server.')
username = input('Enter your username(include@gmail): ') #input full email
username = username.encode('utf-8')
Client_Socket_WrappedSSL.send(base64.b64encode(username) + '\r\n'.encode('utf-8'))
resp = Client_Socket_WrappedSSL.recv(1024).decode()#gmail requires utf and base64 encoding
print("username: "+resp)
if resp[:3] != '334':
print('sendusername: 334 reply not received from server.')
password = input ('Enter your password: ') #user enters password
password = password.encode('utf-8')
Client_Socket_WrappedSSL.send(base64.b64encode(password) + '\r\n'.encode('utf-8'))
resp = Client_Socket_WrappedSSL.recv(1024).decode()
print("psword: "+resp)#receive and output response
if resp[:3] != '235':
print('sendpassword: 235 reply not received from server.')
print("email logon sent to server!")
# Send MAIL FROM command and print server response.
# Fill in start
mail = "MAIL FROM: <" + username.decode() + ">\r\n"
Client_Socket_WrappedSSL.send(mail.encode())
resp = Client_Socket_WrappedSSL.recv(1024).decode()
print("mail resp: "+resp)
if resp[:3] != '250':
print('MAILFROM COMMAND: 250 reply not received from server.')
# Fill in end
# Send RCPT TO command and print server response.
# Fill in start
rcpt = "manidimi123123@hotmail.com"
recipientTo = "RCPT TO: <" + rcpt + ">\r\n"
Client_Socket_WrappedSSL.send(recipientTo.encode());
resp = Client_Socket_WrappedSSL.recv(1024).decode()
print("rcpt resp: "+resp)
if resp[:3] != '250':
print('RCPT TO COMMAND: 250 reply not received from server.')
# Fill in end
# Send DATA command and print server response.
# Fill in start
dataMsg = "DATA\r\n"
Client_Socket_WrappedSSL.send(dataMsg.encode())#send data command and receive resp
resp = Client_Socket_WrappedSSL.recv(1024).decode()
print(resp)
print("datacommand ^")
# Fill in end
# Send message data.
# Fill in start
Client_Socket_WrappedSSL.send(msg.encode()) #send the message to server
# Fill in end
# Message ends with a single period.
# Fill in start
endmsg = "\r\n.\r\n"
Client_Socket_WrappedSSL.send(endmsg.encode())#send end period
respEndMsg = Client_Socket_WrappedSSL.recv(1024).decode()
print("end with period")
print("period resp: "+respEndMsg) # receive and output response
# Fill in end
# Send QUIT command and get server response.
# Fill in start
command = "QUIT\r\n"
Client_Socket_WrappedSSL.send(command.encode())#send quit command and receive response
resp = Client_Socket_WrappedSSL.recv(1024).decode()
print("quit resp: "+resp)
if resp[:3] != '221':
print('QUIT COMMAND: 221 reply not received from server.')
Client_Socket_WrappedSSL.close()
# Fill in end | [
"cdevito2@uwo.ca"
] | cdevito2@uwo.ca |
5498b634ec51ff47231615d83d53c26239e86d57 | 5ad26686c6379c34ab052e2368f9ea5d0a8ba8c9 | /general/kraken_parse.py | 6f1cdcfcad655b6a87b3465fd4f7bb48a75657bb | [] | no_license | LeahRoberts/scripts | b1e90bc4c3ba36f24f1fe797e6ed714a40e7c192 | 2224d21ab0b103f49f0bdcb4bf565078e3eb9f9a | refs/heads/main | 2023-07-14T05:23:43.247540 | 2021-08-24T09:14:51 | 2021-08-24T09:14:51 | 370,647,550 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 415 | py | #!/user/bin/env python
# write script to count and parse out lines with 2nd species percentage higher than x threshold
import sys
# Read in file:
file1 = sys.argv[1]
cutoff = sys.argv[2]
w = open(file1, "r")
with open("contaminated.list", "a") as fout:
for line in w.readlines():
species2 = line.split("\t")[16].rstrip("%")
if float(species2) > int(cutoff):
fout.write(line)
| [
"leah@hl-codon-21-01.ebi.ac.uk"
] | leah@hl-codon-21-01.ebi.ac.uk |
d98fa9c4c72e804c840b7be522b57343cc4a35e4 | 30664f5cf211bccff797ae896097b6aec82fbc36 | /scripts/simple_hk_analysis.py | c552d50840e64843fabb9a603acda9fda945a1fc | [] | no_license | zwytop/ph-hk-agency | 82ffe221d258b5ace5cc84f78c543872ee7b3c3c | b7211fef706b9faea37acfd327107dc0af95121c | refs/heads/master | 2020-04-22T11:16:52.738432 | 2018-12-16T07:06:06 | 2018-12-16T07:06:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,839 | py | import snap
import numpy as np
import matplotlib.pyplot as plt
import random
def getDataPointsToPlot(Graph):
DegToCntV = snap.TIntPrV()
snap.GetDegCnt(Graph, DegToCntV)
totalNodes = Graph.GetNodes()
X, Y = [], []
for output in DegToCntV:
X.append(output.GetVal1())
Y.append(output.GetVal2() / float(totalNodes))
return X, Y
def basic_analysis():
FIn = snap.TFIn("../graphs/hk_simple.graph")
G = snap.TUNGraph.Load(FIn)
numNodes = G.GetNodes()
print "num nodes: ", numNodes
numEdges = G.GetEdges()
print "num edges: ", numEdges
# clustering coefficient
print "\nclustering coefficient"
print "Clustering G: ", snap.GetClustCf(G)
ER = snap.GenRndGnm(snap.PUNGraph, numNodes, numEdges)
print "Clustering ER: ", snap.GetClustCf(ER)
# degree distribution histogram
print "\ndegree distribution histogram"
x_erdosRenyi, y_erdosRenyi = getDataPointsToPlot(ER)
plt.loglog(x_erdosRenyi, y_erdosRenyi, color = 'g', label = 'Erdos Renyi Network')
x_smallWorld, y_smallWorld = getDataPointsToPlot(G)
plt.loglog(x_smallWorld, y_smallWorld, linestyle = 'dashed', color = 'b', label = 'HK Agency Network')
plt.xlabel('Node Degree (log)')
plt.ylabel('Proportion of Nodes with a Given Degree (log)')
plt.title('Degree Distribution of Erdos Renyi and HK Agency Network')
plt.legend()
plt.show()
# degree
print "\ndegree distribution"
deg_sum = 0.0
CntV = snap.TIntPrV()
snap.GetOutDegCnt(G, CntV)
for p in CntV:
deg_sum += p.GetVal1() * p.GetVal2()
max_node = G.GetNI(snap.GetMxDegNId(G))
deg_sum /= float(numNodes)
print "average degree: ", deg_sum # same for G and ER
print "max degree: ", max_node.GetOutDeg(), ", id: ", max_node.GetId()
deg_sum = 0.0
max_node = ER.GetNI(snap.GetMxDegNId(ER))
print "max degree: ", max_node.GetOutDeg(), ", id: ", max_node.GetId()
# diameter
print "\ndiameter"
diam = snap.GetBfsFullDiam(G, 10)
print "Diameter: ", diam
print "ER Diameter: ", snap.GetBfsFullDiam(ER, 10)
# triads
print "\ntriads"
print "Triads: ", snap.GetTriads(G)
print "ER Triads: ", snap.GetTriads(ER)
# centrality
print "\ncentrality"
max_dc = 0.0
maxId = -1
all_centr = []
for NI in G.Nodes():
DegCentr = snap.GetDegreeCentr(G, NI.GetId())
all_centr.append(DegCentr)
if DegCentr > max_dc:
max_dc = DegCentr
maxId = NI.GetId()
print "max"
print "node: %d centrality: %f" % (maxId, max_dc)
print "average centrality: ", np.mean(all_centr)
print "ER"
max_dc = 0.0
maxId = -1
all_centr = []
for NI in ER.Nodes():
DegCentr = snap.GetDegreeCentr(ER, NI.GetId())
all_centr.append(DegCentr)
if DegCentr > max_dc:
max_dc = DegCentr
maxId = NI.GetId()
print "max"
print "node: %d centrality: %f" % (maxId, max_dc)
print "average centrality: ", np.mean(all_centr)
basic_analysis() | [
"mayala3@stanford.edu"
] | mayala3@stanford.edu |
e573dd4f0c9e877ff4401b6edb192275d46b4588 | c9ee7bd79a504597a32eac0d78e54d29ee139572 | /00_algorithm/Stage2/01_UnionFind&Kruskal/lesson1-1.py | 8c6b5d1b9600bb017683d8e9e228990867876b4b | [] | no_license | owenyi/encore | eb3424594da3f67c304a8a9453fc2813d4bbba0d | 878ca04f87050a27aa68b98cba0c997e9f740d5d | refs/heads/main | 2023-07-13T10:08:24.626014 | 2021-08-23T13:40:54 | 2021-08-23T13:40:54 | 349,922,541 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 927 | py | # 특정 원소가 속한 집합을 찾기
def find_parent(x):
if parent[x] == x: return x
parent[x] = find_parent(parent[x])
return parent[x]
# 두 원소가 속한 집합을 합치기
def union_parent(a, b):
a = find_parent(a)
b = find_parent(b)
if a < b: parent[b] = a
else: parent[a] = b
# 노드의 개수와 간선(Union 연산)의 개수 입력 받기
v, e = map(int, input().split())
parent = [i for i in range(v + 1)] # 부모 테이블 초기화하기
# Union 연산을 각각 수행
for i in range(e):
a, b = map(int, input().split())
union_parent(a, b)
# 각 원소가 속한 집합 출력하기
print("각 원소가 속한 집합 : ", end='')
for i in range(1, v + 1):
print(find_parent(i), end=' ')
print()
# 부모 테이블 내용 출력하기
print("부모 테이블 : ", end='')
for i in range(1, v + 1):
print(parent[i], end=' ')
"""
6 4
1 4
2 3
2 4
5 6
""" | [
"67588446+owenyi@users.noreply.github.com"
] | 67588446+owenyi@users.noreply.github.com |
f8e7195c37439ccb1abce5c339cdbe5f0258a6e8 | 76eb448085b66c45fb93290bb50b930e89244c66 | /experimento_1/experimentoSVD.py | c4951994b484d76d1ab783c795653a451ae3b078 | [] | no_license | Daniton2906/MineriaDeDatos | 2717a4fb591764d70cfa1a4882e5ce6d5ac43c2f | d019dd1c0c4fc2f0c5c978e84c1f2e35305c29b8 | refs/heads/master | 2021-01-23T21:54:40.644857 | 2017-12-05T21:38:10 | 2017-12-05T21:38:10 | 102,911,900 | 0 | 0 | null | 2017-12-03T21:09:04 | 2017-09-08T23:13:59 | Python | UTF-8 | Python | false | false | 1,854 | py | import pyreclab
from random import *
from exp_base import *
import os.path
#########################################################################################################
###### FunkSVD ######
#########################################################################################################
prediction_filename = data_url+'predictionsSVD ' #5.csv'
ordenada_filename = data_url+'ordenadasSVD' #5.csv'
print 'SVD'
for i in [1, 5]: #range(1, data_chunks + 1):
f_t = training_filename + str(i) + ".txt"
f_p = probe_filename + str(i) + ".txt"
f_pred = prediction_filename + str(i) + ".csv"
f_ord = ordenada_filename + str(i) + ".csv"
print "Corriendo experimento ", i, "..."
print 'Entrenando...'
obj = pyreclab.SVD( dataset = f_t,
dlmchar = b'\t',
header = True,
usercol = 0,
itemcol = 1,
ratingcol = 2 )
obj.train( factors = 1000, maxiter = 100, lr = 0.01, lamb = 0.1)
print 'Prediciendo...'
#prediction = obj.predict( "630685", "1")
#ranking = obj.recommend( "630685", 10, True)
#print prediction
#print ranking
predictionList, mae, rmse = obj.test( input_file = f_p,
dlmchar = b'\t',
header = False,
usercol = 0,
itemcol = 1,
ratingcol = 2,
output_file = f_pred)
print "mae=",mae
print "rmse=",rmse
print 'Ordenando...'
sort_csv(f_pred, f_ord)
| [
"ddiomedi2906@gmail.com"
] | ddiomedi2906@gmail.com |
170e2609aaab69d31d73db5c0f2ad96c819210f3 | 2ba99f2362690db7cf0548efc0bd49375249a0d6 | /Bus_Route/app/testing_current.py | 2132fff2a5002785269ebff2b19782b2df7af88e | [] | no_license | miniaishwarya/Bus-Route-Navigator | d54844ae562f6b0345804791df6d5dbcdd444773 | 0fa22c865186bb248fa988f498f2cf2c885dc472 | refs/heads/master | 2022-11-17T08:53:36.096427 | 2020-07-09T08:53:43 | 2020-07-09T08:53:43 | 255,096,935 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,057 | py | import cv2
import numpy as np
#import import_ipynb#for enabling importing of ipynb
from app import matching_test2 as m_t #ipynb for matching
from app import pre_processing as pre_p#ipynb for pre processing
from googletrans import Translator
import matplotlib.pyplot as plt#for plotting image
from pytesseract import image_to_string
import pytesseract
def testing(path):
pytesseract.pytesseract.tesseract_cmd = r'C:\Tesseract-OCR\tesseract'
input1 = cv2.imread(path)
gray = pre_p.get_grayscale(input1)
erosion = pre_p.erode(gray)
dilation = pre_p.dilate(erosion)
#for printing gray image
#plt.imshow(gray)
#plt.show()
output = pytesseract.image_to_string(gray, lang='mal')
#print("\nOutput obtained by tesseract from image:-\n")
#print(output)
#output is of type string
array = output.split() #split() returns a list form of "output", array is a list with each element as a malayalam word
#\u200d is a non printable character used in languages(Read wiki)
#print("\nThe malayalam word array :-\n")
#print(array)
#Declaring object "trans_1" for accessing Google translator API
trans_1 = Translator()
text_eng = trans_1.translate(array) #Function for translating the malayalam words in array
#text_eng is an object with attributes
#print("\nThe English translated word :-\n")
list_eng = []
for x in text_eng:
list_eng.append(x.text)
#print(list_eng)
#print("\nEnglish words after matching:-\n")
list_eng = m_t.matching(list_eng)
#m_t.cleaning()
# prints the entire words matched, route number and the route
#print(list_eng)
result=[]
result.append(list_eng[0])
result.append(list_eng[1]-1)
# prints words matched and route number
#print(result)
print('Result in testing_current.py', result)
return result
# ".text" is an attribute of the object text_eng, which has the translated word
| [
"noreply@github.com"
] | miniaishwarya.noreply@github.com |
2a5f0ce18def4e02a4c3c04d02095959d140b185 | b3c2373e6ceee07a9fec8275e6a98461b2c2b12e | /api/db/serializers.py | 1c5214b6f5f36b770e3659f5a11519997ae54cde | [] | no_license | VagnerSpinola/samplemed | 80602db406ba442b9ba8a97b25f84bafa40de6d1 | cd594b499f49e27017be2314d5eacfe095f5e65d | refs/heads/main | 2023-06-16T08:14:41.821027 | 2021-07-01T20:03:19 | 2021-07-01T20:03:19 | 382,035,655 | 0 | 0 | null | 2021-07-01T20:03:19 | 2021-07-01T13:04:51 | Python | UTF-8 | Python | false | false | 303 | py | from rest_framework import serializers
from django.contrib.auth.models import User
from .models import Blog
class BlogSerializer(serializers.ModelSerializer):
username = serializers.CharField(source='user.get_full_name')
class Meta:
model = Blog
fields = "__all__"
| [
"vagner.spinola@casacontrolada.com.br"
] | vagner.spinola@casacontrolada.com.br |
cba84e9e17675ae6886166de617c206eff6eea92 | 24d866517f749b172bc0d54dd87da5df9ae01650 | /Assignment 2.py | 6c028df9729eed34ab8f1fe343ba012fa5de107d | [] | no_license | arzanpathan/Python | 6ff4ea7933d6be80c9c627239eeeaf327f8c5cb1 | 651441aaaf78b8dabf1e96f3807b66b8ca348a1f | refs/heads/master | 2020-03-22T15:48:38.517628 | 2018-07-22T06:38:23 | 2018-07-22T06:38:23 | 140,280,335 | 0 | 2 | null | null | null | null | UTF-8 | Python | false | false | 312 | py | #WAP to Print 10 to 1 using While
print('\nProgram to Print 10 to 1 using While')
a=10
while(a>=1):
print(a)
a=a-1
#WAP to print "n" natural numbers (Take input from the user)
print('\nProgram to print "n" natural numbers')
x=int(input('\nEnter a Number: '))
y=1
while(y<=x):
print(y)
y=y+1
| [
"noreply@github.com"
] | arzanpathan.noreply@github.com |
dbd02df2b48e76f3f0f7020f002afafb81d785c0 | b1d5b50532e808c662bbf46c99a5a1179d1350d1 | /main.py | 7ca0dd681d272fd505209b4aa7b229aa31de795a | [
"Apache-2.0"
] | permissive | Shrenikjangada/Fake-News-Scraper | bf889bde453ccdc17d1e1074d362efe78acac4c3 | ed840710481ee3c5f8d03b9e710157c66ac6296e | refs/heads/master | 2022-12-19T00:37:24.001299 | 2020-10-01T10:54:08 | 2020-10-01T10:54:08 | 300,243,836 | 0 | 0 | Apache-2.0 | 2020-10-01T10:47:31 | 2020-10-01T10:47:29 | null | UTF-8 | Python | false | false | 1,125 | py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 13 00:48:50 2020
@author: deviantpadam
"""
from flask import Flask, render_template, request
import sqlite3
app = Flask(__name__)
# app.jinja_env.globals.update(zip=zip)
conn = sqlite3.connect('db2.sqlite')
cur = conn.cursor()
cur.execute('SELECT * FROM fake_news')
results = cur.fetchall()
@app.route('/')
def main():
global results
length = len(results)
if length%30==0:
last = length//30
else:
last = (length//30)+1
page = request.args.get('num')
if not str(page).isnumeric():
page=1
page=int(page)
if int(page)==1:
n = '/?num='+str(int(page)+1)
p = "#"
elif int(page)==last:
p = '/?num='+str(int(page)-1)
n = "#"
else:
p = '/?num='+str(int(page)-1)
n = '/?num='+str(int(page)+1)
news = results[(int(page)-1)*30:int(page)*30]
return render_template('index.html',news=news , next=n,prev=p,last=last)
@app.route('/temp')
def temp():
return render_template('base.html')
if '__main__'==__name__:
app.run()
| [
"padamgupta1999@gmail.com"
] | padamgupta1999@gmail.com |
3171d4c5b4e9381a54003fffaa2fd2f2e1d89f09 | 6789343770d078f63dc9cfcb905bbb801edc2615 | /images/migrations/0002_auto_20200723_1347.py | 924e235c29d1c483a61e74ee027205bea15f9a2c | [] | no_license | Code-Institute-Submissions/Final_Milestone_Project | 1cac18a7ceb366be13de16c0bf24f1a73b1d606d | 3b12c46beb5b04a506ef6c9fe252d1c891cdd49f | refs/heads/master | 2022-12-11T19:42:38.049404 | 2020-09-09T17:33:11 | 2020-09-09T17:33:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 556 | py | # Generated by Django 3.0.8 on 2020-07-23 13:47
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('images', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='Images',
new_name='Image',
),
migrations.AlterModelOptions(
name='image_data',
options={'verbose_name_plural': 'Image_Data'},
),
]
| [
"seanjcarley@outlook.com"
] | seanjcarley@outlook.com |
91bb87a9d8544fe8ba3f5e4a39c3aa4bc2d0c242 | 8770f1a2d158354e04ddc88dc4e2fd62d2501785 | /application/__init__.py | ee667441677e48913f088b5e70a737768c765dd4 | [] | no_license | sarasiraj2009/flask-blog | b49a8077d63d535eb0da04978a1b590516e47745 | 4dfe0b37086628c0fd1a48add81f6db23cdee0ec | refs/heads/master | 2021-08-06T22:53:51.092392 | 2020-03-17T16:20:16 | 2020-03-17T16:20:16 | 246,011,771 | 0 | 0 | null | 2021-03-20T03:08:59 | 2020-03-09T10:57:39 | Python | UTF-8 | Python | false | false | 576 | py | # import Flask class from the flask module
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from os import getenv
from flask_bcrypt import Bcrypt
from flask_login import LoginManager
# create a new instance of Flask and store it in app
app = Flask(__name__)
bcrypt = Bcrypt(app)
app.config['SQLALCHEMY_DATABASE_URI']=getenv('DATABASE_URI')
app.config['SECRET_KEY'] = getenv('SECRET_KEY')
db = SQLAlchemy(app)
login_manager = LoginManager(app)
login_manager.login_view = 'login'
# import the ./application/routes.py file
from application import routes
| [
"sarasiraj2009@gmail.com"
] | sarasiraj2009@gmail.com |
b862d1f52dec584c48b5dc6edfaf74199dead53f | e67dd7b4cb64a65eafd33c48722d89c922da9100 | /myjango/aixianfeng1/App/urls.py | 2ba51433d3065386edbd8ef68801d2e0214e6882 | [] | no_license | Tomxutianyuan/myjango | 3f25ce16003a458aba2f021b3d6a39eb37b64a3a | d454d6ccc177eb140a16459795848f1179872c52 | refs/heads/master | 2020-04-25T15:57:03.790705 | 2019-02-27T10:27:55 | 2019-02-27T10:27:55 | 172,893,748 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,966 | py | """aixianfeng URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, re_path
from django.views.static import serve
from aixianfeng import settings
from .views import *
app_name = 'App'
urlpatterns = [
path('', index, name='index'),
path('market/', show_market, name='show_market'),
path('mine/', show_mine, name='show_mine'),
path('login/', user_login, name='user_login'),
path('register/', user_register, name='user_register'),
path('checkname/', check_username, name='check_username'),
path('active/', user_active, name='user_active'),
re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}),
path('logout/', user_logout, name='user_logout'),
path('cart/', show_cart, name='show_cart'),
path('addCart/', add_cart, name='add_cart'),
path('changecartstate/', change_cart_state, name='change_cart_state'),
path('subshopping/', sub_shopping, name='sub_shopping'),
path('addshopping/', add_shopping, name='add_shopping'),
path('allselect/', all_select, name='all_select'),
path('unallselect/', unall_select, name='unall_select'),
path('makeorder/', make_order, name='make_order'),
path('ordernotpay/', order_notpay, name='order_notpay'),
path('payed/', order_payed, name='order_payed'),
path('payedother/',order_payedother,name='order_payedother')
]
| [
"17781039907@163.com"
] | 17781039907@163.com |
d816d7ac470e98cd21deba0d308567499d0c46d9 | 5f5719fca3ba26a6daae2c8e78b5eaa62bac24c7 | /pdf_example_2.py | 022e3ea6e8a67677dcfe2329443b5f0297a75516 | [] | no_license | seakun/automated_python_projects | 8e4bc3444c336973ba89fc6e814fbd56a1d4e2ee | 5e355f5bc3d073acd5d48cacf129dcbbc117a247 | refs/heads/master | 2022-04-08T17:17:39.766942 | 2020-03-11T14:20:28 | 2020-03-11T14:20:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 551 | py | import PyPDF2
pdf1File = open('meetingminutes1.pdf', 'rb')
pdf2File = open('meetingminutes2.pdf', 'rb')
reader1 = PyPDF2.PdfFileReader(pdf1File)
reader2 = PyPDF2.PdfFileReader(pdf2File)
writer = PyPDF2.PdfFileWriter()
for pageNum in range(reader1.numPages):
page = reader1.getPage(pageNum)
writer.addPage(page)
for pageNum in range(reader2.numPages):
page = reader1.getPage(pageNum)
writer.addPage(page)
outputFile = open('combinedminutes.pdf', 'wb')
writer.write(outputFile)
outputFile.close()
pdf1File.close()
pdf2File.close()
| [
"seakun@users.noreply.github.com"
] | seakun@users.noreply.github.com |
e4addbf248c5559ec48eefc87e6d736007375e88 | 6413ab402c5e009dd0d19e873d295f2d05f004ac | /week5/rotation.py | fccc7dab00f62ac6108137ed9a5ab8ba360392e8 | [] | no_license | MCV-2020-M1-Project/Team5 | ee04807ad118ed975f245604753f22b86692b48e | ad2093a150efacce6f4d862f3fbf2040ca402689 | refs/heads/main | 2023-01-12T01:58:32.971863 | 2020-11-15T19:09:41 | 2020-11-15T19:09:41 | 301,867,742 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,607 | py | import numpy as np
import cv2
from skimage.transform import probabilistic_hough_line
def rotate_imgs(query):
rotated_images = []
angles = []
for i in range(0,len(query)):
img = query[i]
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
gray_blur = cv2.medianBlur(gray, 5)
# cv2.Canny(image, intensity_H_threshold, intensity_L_threshold, apertureSize, L2gradient)
edges = cv2.Canny(gray_blur, 50, 200)
kernel = np.ones((3,3),np.uint8)
dilation = cv2.dilate(edges, kernel, iterations=1)
# cv2.HoughLinesP(edges, rho = 1, theta = math.pi / 180, threshold = 70, minLineLength = 100, maxLineGap = 10)
lines = probabilistic_hough_line(dilation, threshold=300, line_length=int(np.floor(np.size(img, 0) / 5)),line_gap=3)
max = 0
angle = 0
pos = 0
if lines != []:
for j in range(0, len(lines)):
line = lines[j]
# cv2 and skimage create the lines the opposite ways
x1, y1, x2, y2 = correcCoordSkimage(line)
val = x1 + y1
angle_aux = getAngle(x1, y1, x2, y2)
if (val > max or max == 0) and (angle_aux < 45 and angle_aux > -45):
angle = angle_aux
max = val
pos = j
x1, y1, x2, y2 = correcCoordSkimage(lines[pos])
#cv2.line(img, (x1, y1), (x2, y2), (125), 5) # this codeline draws the line to the img
#Correct the angles
if angle > 45:
angle = 90 - angle
elif angle < -45:
angle = angle + 90
img = rotate(img, angle)
rotated_images.append(img)
# Correct the angles
if angle < 0:
angle = angle + 180
angles.append(angle)
return rotated_images, angles
def getAngle(x1,y1,x2,y2):
if x2 == x1:
angle = 90
elif y1 == y2:
angle = 0
else:
angle = np.arctan((y2 - y1) / (x2 - x1))
# transform to degrees
angle = angle * 180 / np.pi
return -angle # anti-clockwise
def rotate(img, angle):
h = int(round(np.size(img,0)/2))
w = int(round(np.size(img,1)/2))
center = (w,h)
M = cv2.getRotationMatrix2D(center, -angle, 1)
result = cv2.warpAffine(img, M, (w*2, h*2))
return result
def correcCoordSkimage(line):
x2 = line[0][0]
y2 = line[0][1]
x1 = line[1][0]
y1 = line[1][1]
if x1 > x2:
temp = x1
x1 = x2
x2 = temp
temp = y1
y1 = y2
y2 = temp
return x1,y1,x2,y2
| [
"59796230+victorubieto@users.noreply.github.com"
] | 59796230+victorubieto@users.noreply.github.com |
7f9d33ba3b719cb7d295e83ca475ef455092a3e5 | 0c52bc417ba04ebec28f63526a14796c2bff3101 | /app/users/views.py | 649d11839c37700a0c9ea4a297cd10c6bbc5bd0e | [
"MIT"
] | permissive | HHHMHA/recipe-app-api | 87ddd11862cb5d49373527df2ae6ed37089815e6 | 272da0dc2fe6d926fe8cd57778734f9178d1cc73 | refs/heads/main | 2023-03-04T22:46:41.154710 | 2021-02-17T14:57:57 | 2021-02-17T14:57:57 | 314,871,334 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 925 | py | from .serializers import UserSerializer, AuthTokenSerializer
from rest_framework import generics, authentication, permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
class CreateUserView(generics.CreateAPIView):
"""Create a new user in the system"""
serializer_class = UserSerializer
class CreateTokenView(ObtainAuthToken):
"""Create a new auth token for user"""
serializer_class = AuthTokenSerializer
renderer_classes = api_settings.DEFAULT_RENDERER_CLASSES
class ManageUserView(generics.RetrieveUpdateAPIView):
"""Manage the authenticated user"""
serializer_class = UserSerializer
authentication_classes = (authentication.TokenAuthentication,)
permission_classes = (permissions.IsAuthenticated,)
def get_object(self):
"""Retrieve and return authenticated user"""
return self.request.user
| [
"mp4-12cs5@hotmail.com"
] | mp4-12cs5@hotmail.com |
3ca2e10041d93492b98d3758c2f9fb14ee142804 | 830c08a1fc68ce2fc24225de347e799e5e34cfd4 | /demoWebApp/imgUpload/urls.py | 0fc1086f6a0218896e4b6bb5323f37ec51280545 | [] | no_license | syedirfanx/django-webapp | d3ab4e54d5e4f85e4be858b9be4d60b934bb3b3a | 9b80411b78b48859388edc0a529664233f31fa07 | refs/heads/main | 2023-05-06T02:09:00.854685 | 2021-06-02T03:31:57 | 2021-06-02T03:31:57 | 372,400,406 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 222 | py | from django.contrib import admin
from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'imageprocess', views.imageprocess, name='imageprocess'),
]
| [
"irfansyed479@gmail.com"
] | irfansyed479@gmail.com |
4e4f60177f579d3aa004388a33b770fd6a8df91e | a28376a3c7c108dde04836fa9a51307fa401b120 | /src/classifyGalaxies.py | 08f2fa7f5bbeceb9a00c53852ed13dce7fcee44f | [] | no_license | jyang1207/McGrathResearch | 296003eeb6e40817c83a2fa755b43431d46987bd | 1d95b618427a317b31677e36dbc08d6031f2ede4 | refs/heads/master | 2020-04-01T20:58:11.296768 | 2017-10-01T20:26:20 | 2017-10-01T20:26:20 | 60,550,032 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,115 | py | # classifyGalaxies.py
# Jianing Yang
# McGrath research
import csv
import numpy as np
import sys
from optparse import OptionParser
class Classifier:
def __init__(self, filenames = None):
# create and initialize fields for the class
#list of all headers
self.headers = []
#list of all types
self.types = []
#list of lists of all data for three types of components. Each row is a list of strings
self.central_data = []
self.disk_data = []
self.bulge_data = []
#list of lists of all MRP data for three types of components. Each row is a list of strings
self.central_dataMRP = []
self.disk_dataMRP = []
self.bulge_dataMRP = []
#dictionary mapping header string to index of column in raw data
self.header2col = {}
if filenames != None:
f = file(filenames, 'rU')
fread = csv.reader(f)
filenames = []
for row in fread:
filenames.append(row)
print filenames
self.readFiles(filenames)
def readFiles(self, filenames):
#read in all the csv files and put the data into a matrix of strings
for filename in filenames:
fp = file(filename[0], 'rU')
cread = csv.reader(fp)
self.headers = cread.next()
self.types = cread.next()
i = 0
j = 0
#read in data for galaxies in the list
for row in cread:
if row[2] in ["VELA02", "VELA03", "VELA04", "VELA05", "VELA12", "VELA14", "VELA15", "VELA26", "VELA27", "VELA28"]:
if row[1] == "central":
self.central_data.append(row)
i += 1
elif row[1] == "disk":
self.disk_data.append(row)
j += 1
elif row[1] == "bulge":
self.bulge_data.append(row)
elif row[2] in ["VELA02MRP", "VELA03MRP", "VELA04MRP", "VELA05MRP", "VELA12MRP", "VELA14MRP", "VELA15MRP", "VELA26MRP", "VELA27MRP", "VELA28MRP"]:
if row[1] == "central":
self.central_dataMRP.append(row)
i += 1
elif row[1] == "disk":
self.disk_dataMRP.append(row)
j += 1
elif row[1] == "bulge":
self.bulge_dataMRP.append(row)
print filename[0] + ' ' + str(i) + ', ' + str(j)
for i in range(len(self.headers)):
self.header2col[self.headers[i]] = i
#classify the galaxies into one-component and two-component according to (rff1-rff2)/rff1
def classifyComponent(self, isMRP=False):
if isMRP:
central_data = self.central_data
disk_data = self.disk_data
bulge_data = self.bulge_data
else:
central_data = self.central_dataMRP
disk_data = self.disk_dataMRP
bulge_data = self.bulge_dataMRP
if len(central_data) != len(disk_data):
print "Numbers of galaxies for single component and bulge component don't match."
print str(len(central_data)) + ', ' + str(len(disk_data))
return
#column indicating whether one-component fit or two-component fit is better
self.headers.append("comp_num")
self.types.append("enum")
self.header2col["comp_num"] = len(self.headers) - 1
for i in range(len(central_data)):
rff1 = float(central_data[i][self.header2col["rff"]])
rff2 = float(disk_data[i][self.header2col["rff"]])
rff_ratio = (rff1-rff2)/rff1
#the cut-off rff ratio is 0.2
if rff_ratio < 0.2:
central_data[i].append("1")
disk_data[i].append("1")
bulge_data[i].append("1")
else:
central_data[i].append("2")
disk_data[i].append("2")
bulge_data[i].append("2")
#classify the galaxies into spheroids and disk galaxies
def classifyShape(self, isMRP=False):
if isMRP:
central_data = self.central_data
disk_data = self.disk_data
bulge_data = self.bulge_data
else:
central_data = self.central_dataMRP
disk_data = self.disk_dataMRP
bulge_data = self.bulge_dataMRP
#column indicating whether the galaxy is a spheroid or a disk
self.headers.append("shape")
self.types.append("enum")
self.header2col["shape"] = len(self.headers) - 1
#for one-component, the cut-off sersic index is 2.5
for i in range(len(central_data)):
if central_data[i][self.header2col["comp_num"]] == "1":
if float(central_data[i][self.header2col["sersicIndex(n)"]]) < 2.5:
central_data[i].append("disk")
disk_data[i].append("disk")
bulge_data[i].append("disk")
else:
central_data[i].append("spheroid")
disk_data[i].append("spheroid")
bulge_data[i].append("spheroid")
else:
bMag = float(bulge_data[i][self.header2col["mag"]])
dMag = float(disk_data[i][self.header2col["mag"]])
bFlux = 10**(-0.4*bMag)
dFlux = 10**(-0.4*dMag)
tFlux = bFlux + dFlux
if bFlux/tFlux < 0.5:
central_data[i].append("disk")
disk_data[i].append("disk")
bulge_data[i].append("disk")
else:
central_data[i].append("spheroid")
disk_data[i].append("spheroid")
bulge_data[i].append("spheroid")
#write the new data with component and shape information into 3 csv files
def writeFiles(self, outputFilename, isMRP=False):
if isMRP:
central_data = self.central_data
disk_data = self.disk_data
bulge_data = self.bulge_data
else:
central_data = self.central_dataMRP
disk_data = self.disk_dataMRP
bulge_data = self.bulge_dataMRP
outputFilename = outputFilename.split('.')[0]
singleFilename = outputFilename + "_single.csv"
diskFilename = outputFilename + "_disk.csv"
bulgeFilename = outputFilename + "_bulge.csv"
with open(singleFilename, 'wb') as file:
fWriter = csv.writer(file, delimiter = ',')
fWriter.writerow(self.headers)
fWriter.writerow(self.types)
fWriter.writerows(central_data)
with open(diskFilename, 'wb') as file:
fWriter = csv.writer(file, delimiter = ',')
fWriter.writerow(self.headers)
fWriter.writerow(self.types)
fWriter.writerows(disk_data)
with open(bulgeFilename, 'wb') as file:
fWriter = csv.writer(file, delimiter = ',')
fWriter.writerow(self.headers)
fWriter.writerow(self.types)
fWriter.writerows(bulge_data)
#write the new data combined into 1 csv file according to component number and shape
def writeCombined(self, outputFilename, isMRP=False):
if isMRP:
central_data = self.central_data
disk_data = self.disk_data
bulge_data = self.bulge_data
else:
central_data = self.central_dataMRP
disk_data = self.disk_dataMRP
bulge_data = self.bulge_dataMRP
data = central_data
for i in range(len(data)):
if data[i][self.header2col["comp_num"]] == "2":
if data[i][self.header2col["shape"]] == "disk":
data[i] = disk_data[i]
else:
data[i] = bulge_data[i]
with open(outputFilename, 'wb') as file:
fWriter = csv.writer(file, delimiter = ',')
fWriter.writerow(self.headers)
fWriter.writerow(self.types)
fWriter.writerows(data)
if __name__ == '__main__':
if len(sys.argv) < 3:
print "Usage: python %s <csv_filename>" % sys.argv[0]
print " where <csv_filename> specifies a csv file"
exit()
# used to parse command line arguments
parser = OptionParser(usage)
# indicate that the galaxies are MRP
parser.add_option("-m", "--isMRP",
help="to plot MRP counterparts adjacent",
action="store_true")
# indicate whether to write a combined file or seperate files
parser.add_option("-c", "--combined",
help="to write a combined file",
action="store_true")
# parse the command line using above parameter rules
# options - list with everthing defined above,
# args - anything left over after parsing options
[options, args] = parser.parse_args()
# classify the a0 or MRP galaxies by component number and shape
classifier = Classifier(sys.argv[1])
classifier.classifyComponent(isMRP=options.isMRP)
classifier.classifyShape(isMRP=options.isMRP)
if options.combined:
classifier.writeCombined(sys.argv[2])
print "combined files written"
else:
classifier.writeFiles(sys.argv[2])
print "seperate files written"
| [
"noreply@github.com"
] | jyang1207.noreply@github.com |
732198405c718e475715d90fdb730cc8b135948c | dbd87fe6e9466c4cada18b037667cfdddc62c193 | /data/FX_CFD/XTB/utils.py | 78e5d6fefed7858147792c12c920d9589d12f8b3 | [] | no_license | alexanu/Python_Trading_Snippets | 74515a40dc63ba50d95bd50330ed05d59b5dc837 | 85969e681b9c74e24e60cc524a952f9585ea9ce9 | refs/heads/main | 2023-06-25T03:27:45.813987 | 2023-06-09T16:09:43 | 2023-06-09T16:09:43 | 197,401,560 | 18 | 17 | null | 2023-02-08T22:25:25 | 2019-07-17T14:05:32 | Jupyter Notebook | UTF-8 | Python | false | false | 481 | py | from itertools import product
import settings
from api import data_getter
from writer import write_tsv
def file_maker():
combis = product(settings.WATCHLIST_MAP, settings.INDICATORS)
for i in combis:
s = i[0].split(",")[0]
ind = i[1].split(",")
data = data_getter(symbol=s, indicator=ind[0], period=ind[1])
write_tsv(data=data[settings.TIMEFRAME], symbol=s, indicator=ind[0], period=ind[1])
if __name__ == '__main__':
file_maker()
| [
"oanufriyev@gmail.com"
] | oanufriyev@gmail.com |
6e439eb6efdd14a8e96c332e74f77af021b49f4c | ad4d59875729144451f6d61b338b65f13f4cb68d | /stackility/utility/get_ssm_parameter.py | 65e1f25a9e154c785eb5f439d9cbf2817ce4dbc5 | [
"Apache-2.0"
] | permissive | muckamuck/stackility | 49c0b155e3f51a88870b8e865224cf624388e28b | 99c88a314bffdd226b8216204d6d00492ca672fb | refs/heads/master | 2022-08-11T05:56:35.281464 | 2022-07-16T19:57:15 | 2022-07-16T19:57:15 | 96,112,356 | 8 | 6 | Apache-2.0 | 2019-03-30T14:47:07 | 2017-07-03T13:12:28 | Python | UTF-8 | Python | false | false | 690 | py | from __future__ import print_function
import boto3
import sys
def get_ssm_parameter(parameter_name):
'''
Get the decrypted value of an SSM parameter
Args:
parameter_name - the name of the stored parameter of interest
Return:
Value if allowed and present else None
'''
try:
response = boto3.client('ssm').get_parameters(
Names=[parameter_name],
WithDecryption=True
)
return response.get('Parameters', None)[0].get('Value', '')
except Exception:
pass
return ''
def main():
value = get_ssm_parameter(sys.argv[1])
print(value, end='')
if __name__ == '__main__':
main()
| [
"chuck.muckamuck@gmail.com"
] | chuck.muckamuck@gmail.com |
e925ea7dcfbb1c66bd3229ff16e87916a2136489 | 3d19ed693373f71aae913e276237c370f4e8b1a5 | /spring_model.py | 9bf89a5ab10ffb08be1d78aba01e511266f603d7 | [
"MIT"
] | permissive | Mr4k/Pogo | ced20dd3836fb3917119446d29904a318af4ec49 | 3f65769127f396c5cb06c33c6f1eeadfa6dd38aa | refs/heads/master | 2021-01-10T16:25:53.963363 | 2016-01-04T17:01:25 | 2016-01-04T17:01:25 | 49,007,940 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,954 | py | import numpy as np
import scipy.optimize as opt
from graph import Graph
from graph import Node
import re
from loading_bar import LoadingBar
import sys
import random
from datetime import datetime
import build_graph
import argparse
import json
import signal
def save_solution(graph, solution, name):
i = 0
soln = {}
for user in graph.get_users():
soln[user.name] = {
"friends" : [usr.name for usr in user.get_friends()],
"follows" : [usr.name for usr in user.get_follows() if usr not in user.get_friends()],
"x" : solution[i*2],
"y": solution[i*2+1]
}
i += 1
with open(name+".json", 'w') as outfile:
json.dump(soln, outfile)
outfile.close()
def construct_spring_approximation(fname, verbose, run_tests, prune,load_dist, iterations_to_save = -1, solver = "BFGS", k = 1000, q = 500):
#Create the Graph
graph = build_graph.build_graph(fname,prune,verbose)
i = 0
j = 0
#unit distance
e = 1
#replusion distance scaler
scale = 1
position_matrix = e*graph.get_num_users()*np.random.random((graph.get_num_users(), 2))
length_matrix = np.zeros((graph.get_num_users(),graph.get_num_users()))
un_length_matrix = np.zeros((graph.get_num_users(),graph.get_num_users()))
if load_dist:
length_matrix = np.load("directed_length_matrix")
un_length_matrix = np.load("undirected_length_matrix")
else:
if verbose:
print "About to construct all pair distance matrices. This could take a while."
length_matrix = graph.compute_all_path_matrix(True)
un_length_matrix = graph.compute_all_path_matrix(False)
if verbose:
print "Done computing distance matrices"
print "Saving all pair distance matrices"
np.save("directed_length_matrix",length_matrix)
np.save("undirected_length_matrix",un_length_matrix)
connectivity_matrix = np.min(length_matrix,1)
connectivity_matrix[connectivity_matrix == 0] = 1
connectivity_matrix[connectivity_matrix == -1] = 0
repulsion_matrix = (1-connectivity_matrix)
print connectivity_matrix
print repulsion_matrix
print length_matrix
print un_length_matrix
#a quick vectorized distance function
dist = lambda P: np.sqrt((P[:,0]-P[:,0][:, np.newaxis])**2 +
(P[:,1]-P[:,1][:, np.newaxis])**2)
#general broadcasting function
def build_matrix(func, args):
return func(*args)
def diff(A,B):
return A[:,np.newaxis] - B
def energy(P):
epsilon = 0.000001
P = P.reshape((-1, 2))
D = dist(P)
# The potential energy is the sum of the elastic potential energies plus the repel energies.
return (k * connectivity_matrix * (D - length_matrix)**2).sum() + (q*(un_length_matrix)*(repulsion_matrix)*(1/(D/scale+epsilon))).sum()
def grad(P):
epsilon = 0.000001
P = P.reshape((-1, 2))
# We compute the distance matrix.
D = dist(P)
x_diff = build_matrix(diff,(P[:,0],P[:,0]))
y_diff = build_matrix(diff,(P[:,1],P[:,1]))
num_users = P.shape[0]
grad = np.zeros((num_users,2))
#Sorry there has to be a little math involved
grad[:,0]=((2*k*connectivity_matrix*(D-length_matrix)*(1/(D+epsilon)) - q*un_length_matrix*repulsion_matrix*1/((D/scale)**3+epsilon))*x_diff).sum(axis = 1)
grad[:,0]+=((2*k*np.transpose(connectivity_matrix)*(D-np.transpose(length_matrix))*(1/(D+epsilon)) - q*np.transpose(un_length_matrix)*np.transpose(repulsion_matrix)*1/((D/scale)**3+epsilon))*x_diff).sum(axis = 1)
grad[:,1]=((2*k*connectivity_matrix*(D-length_matrix)*(1/(D+epsilon)) - q*un_length_matrix*repulsion_matrix*1/((D/scale)**3+epsilon))*y_diff).sum(axis = 1)
grad[:,1]+=((2*k*np.transpose(connectivity_matrix)*(D-np.transpose(length_matrix))*(1/(D+epsilon)) - q*np.transpose(un_length_matrix)*np.transpose(repulsion_matrix)*1/((D/scale)**3+epsilon))*y_diff).sum(axis = 1)
return grad.ravel()
#Q:Why are there arrays here?
#A:Python's closures do not let you modify the variables outside of local scope but they do let you modify objects like arrays
num_iterations = [0]
best_soln = [None]
last_time = datetime.now()
def solver_callback(xk):
num_iterations.append(num_iterations[0] + 1)
num_iterations.pop(0)
best_soln.append(xk)
best_soln.pop(0)
print str(num_iterations[0]) + " iterations with energy " + str(energy(xk))
if num_iterations[0] % iterations_to_save == 0 and iterations_to_save > 0:
print str(iterations_to_save) + " iterations in:" + str((datetime.now()-last_time).seconds) + "seconds"
last_time = datetime.now()
print "Saving Current Solution..."
save_solution(graph,xk,"iteration_"+str(num_iterations[0]))
print "Solution Saved as " + "iteration_"+str(num_iterations[0])+".js"
def leave_handler(signal, frame):
if best_soln[0] != None:
print "Saving best solution on exit as exit_solution.js"
save_solution(graph, "exit_solution", "exit_solution")
return (solver_callback, leave_handler)
signal.signal(signal.SIGINT, leave_handler)
if run_tests:
from scipy.optimize import check_grad
from scipy.optimize import approx_fprime
print "Checking Gradient:"
print check_grad(energy, grad, position_matrix.ravel())
print "Speed Tests:"
print "Energy Function Speed:"
print datetime.now()
print energy(position_matrix.ravel())
print datetime.now()
print "Gradient Speed:"
print datetime.now()
print grad(position_matrix.ravel())
print datetime.now()
print "Minimizing with " + str(solver)
solution = opt.minimize(energy, position_matrix.ravel(),
method=solver,jac = grad,callback = solver_callback)
print "Solved to optimiality"
if verbose:
print energy(position_matrix.ravel())
print energy(solution.x)
save_solution(graph,solution.x,"results")
def main():
parser = argparse.ArgumentParser(description='spring_model generates a 2d projection of a directed graph')
parser.add_argument(dest="fname", help="The name of the graph file")
parser.add_argument('--solver', action="store", dest="solver", default = 'BFGS',type = str, help = "The solver with which to solve energy mimization problem. Use BFGS for small graphs and L-BFGS-B when you need more speed.")
parser.add_argument('--prune', action="store_true", default=False, help = 'Do NOT include leaf nodes in the graph calculations')
parser.add_argument('--test', action="store_true", default=False, help = 'Run speed and correctness tests on the gradient and energy functions')
parser.add_argument('--preload', action="store_true", default=False, help = 'If true the program will try to load the all pairs distance matrices from the files directed_length_matrix.npy and undirected_length_matrix.npy. This is used to save time for large dense graphs.')
parser.add_argument('--verbose', action="store_true", default=False, help = 'Enable verbose output')
parser.add_argument('--nsave', action="store", dest="nsave", default = -1, type=int, help = "Saves the current best solution every n iterations. A negative value never save.")
parser.add_argument('-k', action="store", dest="k", default = 1000, type=float, help = "The spring stiffness constant")
parser.add_argument('-q', action="store", dest="q", default = 500, type=float, help = "The node replusion constant")
results = parser.parse_args()
construct_spring_approximation(results.fname,results.verbose,results.test,results.prune,results.preload,results.nsave,results.solver,results.k,results.q)
if __name__ == "__main__":
main() | [
"peterstefek@Peters-MacBook-Pro.local"
] | peterstefek@Peters-MacBook-Pro.local |
2795da097634eab051ff4311f8a4603a561cc5d3 | 7944f0731a9b8bfe2b9b7a55aa531956a54d08ae | /array.py | bb059523621e2310b2facb399c28784ac42135e6 | [] | no_license | kimsm4524/pythonpractice | f815af26408c682fc170a893491bf1eb23fb17ad | a2919994a14681ff8038c701e9c698682bc3722b | refs/heads/master | 2022-11-17T15:01:05.487242 | 2020-07-15T05:00:52 | 2020-07-15T05:00:52 | 279,767,182 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 244 | py | arr= [1,2,3]
arr.append('abc')
print (arr)
arr.pop()
print (arr)
arr.reverse()
print (arr)
print (arr.index(3)) #find position
arr.append([4,5])
print (arr[1:3])#slice array 1 to 3(without)
print (arr)
arr[1:3]=[9,10] #change slice
print (arr)
| [
"noreply@github.com"
] | kimsm4524.noreply@github.com |
1b9aeeffee86cbf3eb773aead79ccbf708c406d0 | 5d68727243c7762bb07c43416db2c2e3c4c7cd44 | /ManualQTPlot.py | b70b6b179783e3153de5649ab64ed6a553f78167 | [
"MIT"
] | permissive | dpetrovykh/FIAR | a2b02e7f2a2134575aa9548f8941d05277cfc86e | 45bca950184ea87399f4630bb601b2fccf8795f9 | refs/heads/main | 2023-04-24T14:04:05.462213 | 2021-05-14T16:51:02 | 2021-05-14T16:51:02 | 336,841,949 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,758 | py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 15 11:56:21 2021
@author: dpetrovykh
"""
import sys
import random
import matplotlib
matplotlib.use('Qt5Agg')
from PyQt5 import QtCore, QtWidgets
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
class MplCanvas(FigureCanvas):
def __init__(self, parent=None, width=5, height = 4, dpi=100):
fig = Figure(figsize=(width, height), dpi=dpi)
self.axes = fig.add_subplot(111)
super(MplCanvas, self).__init__(fig)
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
# Create the matplotlib FigureCanvas object,
# which defines a single set of axes as self.axes
self.canvas = MplCanvas(self, width=5, height=4, dpi=100)
self.setCentralWidget(self.canvas)
n_data = 50
self.xdata = list(range(n_data))
self.ydata = [random.randint(0,10) for i in range(n_data)]
self.update_plot()
self.show()
# Setup a timer to trigger the redraw by calling update_plot
self.timer = QtCore.QTimer()
self.timer.setInterval(100)
self.timer.timeout.connect(self.update_plot)
self.timer.start()
def update_plot(self):
self.ydata = self.ydata[1:] + [random.randint(0,10)]
self.canvas.axes.cla() # Clear the canvas
self.canvas.axes.plot(self.xdata, self.ydata, 'r')
# Trigger the canvas to update and redraw.
self.canvas.draw()
app = QtWidgets.QApplication(sys.argv)
w = MainWindow()
app.exec_() | [
"dpetrovykh@gmail.com"
] | dpetrovykh@gmail.com |
791450cd265e4fdf114e22cd378fa7697db6ffcf | 64ae9e59e387aa219183f6748f07ede3533c14b2 | /lib/auxiliary/switchd/workertask.py | 3f4ddb643005a336a65bf135c9c26feece16dbf4 | [
"BSD-2-Clause"
] | permissive | sohonet/HEN | fe0168816d908c9c5d3180e90e67b12e4724c7be | 47575028a6f3d3fe04d6839dd779b2b1b991accc | refs/heads/master | 2021-01-19T07:30:22.849260 | 2012-02-20T19:41:17 | 2012-02-20T19:41:17 | 87,548,153 | 0 | 0 | null | 2017-04-07T13:25:40 | 2017-04-07T13:25:40 | null | UTF-8 | Python | false | false | 1,214 | py | class TaskID:
checkSensorTask = 0
hostStatusTask = 1
switchReadFdbTask = 2
linkStatusTask = 3
networkMapGenerationTask = 4
class WorkerTask:
nodeinstance = None
node = None
taskid = None
timeScheduled = None
def __init__(self, node, nodeinstance, taskid, timeScheduled):
self.nodeinstance = nodeinstance
self.node = node
self.taskid = taskid
self.timeScheduled = timeScheduled
def __del__(self):
del self.nodeinstance
del self.node
del self.taskid
del self.timeScheduled
def __str__(self):
s = "WorkerTask "
if self.taskid == TaskID.checkSensorTask:
s += "checkSensorTask "
elif self.taskid == TaskID.hostStatusTask:
s += "hostStatusTask "
elif self.taskid == TaskID.switchReadFdbTask:
s += "switchReadFdbTask "
elif self.taskid == TaskID.linkStatusTask:
s += "linkStatusTask "
elif self.taskid == TaskID.networkMapGenerationTask:
s += "networkMapGenerationTask "
try:
s += str(self.node.getNodeID())
except:
s += str(self.node)
return s
| [
"ben@darkworks.net"
] | ben@darkworks.net |
97e9f9b74362b9d4880bc5af45ff68171f6f632d | 75ab45db6b528738719282f363a2da116ff8581f | /facebook_page_crawler_general_ver.py | 6076be452f35275eccabb71da99f87d0ff48cadf | [] | no_license | chrisyang-tw/Facebook_Crawler | c27e6dc00a713d5b346aeae294e827f5516fc3ad | 85b8ec676c7db44ae2088d7f69b8f16986f9e102 | refs/heads/master | 2020-06-17T20:01:54.665441 | 2019-07-09T15:41:05 | 2019-07-09T15:41:05 | 170,059,331 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,513 | py | # 抓取 Facebook 各品牌粉專上的文章(幾天前的文章)
# Version 1.3: 自定義粉專
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
import time, re
import csv
import datetime as dt
import requests
#####################################
## 前置作業、變數定義
page_list = list()
print('====================================\n歡迎使用 Facebook 粉絲專頁爬文程式!\n====================================\n')
print('請先輸入您的 Facebook 帳號密碼,此僅會作為一次性使用,程式並不會記憶或回傳至其他地方,請放心使用!')
username = input('>> 請輸入您的帳號,輸入完成按下 enter 鍵:')
password = input('>> 請輸入您的密碼,輸入完成按下 enter 鍵:')
while True:
temp_input = input('\n>> 請輸入粉專貼文網址,不再輸入請按大寫 N 並按下 enter 鍵 (開頭是 \'https://www.facebook.com/...\'):')
if (temp_input != 'N') and ('https://www.facebook.com/' in temp_input):
page_list.append(temp_input)
elif temp_input == 'N':
break
else:
print('您似乎輸入了非網址,請檢查後重新輸入!\n')
while True:
try:
dt_num = int(input('\n>> 請輸入要取得幾天以內的文章,並按下 enter 鍵 (ex:7):'))
break
except ValueError:
print('您輸入了非數值之字元,請重新輸入數字代碼!')
end_date = dt.datetime.today().date()
start_date = end_date - dt.timedelta(days = dt_num - 1)
#####################################
## 瀏覽器開啟、爬蟲開始
print('即將取得近 %d 天的貼文,欲取得的粉專共有 %d 個'%(dt_num, len(page_list)))
print('\n>> 請注意,程式執行完畢後會自動關閉 Chrome 瀏覽器,請勿手動關閉以免程式錯誤。\n若出現防火牆訊息,可點選關閉或接受。')
input('---請按下 Enter 鍵以開始爬蟲---')
csv = open('Facebook 粉專爬文_%s.csv'%end_date.strftime('%m%d'), 'w', encoding='utf8')
csv.write('粉專名稱,編號,日期時間,內文,文章連結,按讚數,留言+分享數,\n')
print('>> 正在開啟瀏覽器...')
driver = webdriver.Chrome('./chromedriver.exe')
print('>> 開啟網頁中...')
driver.get('https://www.facebook.com')
print('>> 登入中...')
driver.find_element_by_id('email').send_keys(username)
driver.find_element_by_id('pass').send_keys(password)
driver.find_element_by_id('loginbutton').click()
brand = ''
brand_index = 0
for index in page_list:
brand = index.split('/')[3]
print('正在開啟網頁...')
driver.get(index)
while brand_index == 0:
temp_msg = input('請先關閉或封鎖通知權限的視窗!關閉後再按 enter 繼續...')
if temp_msg == '':
break
driver.execute_script('window.scrollTo(0, document.body.scrollHeight);')
time.sleep(5)
post_index = 0
while True:
## 先判斷該頁最後一則貼文的日期是否有超過日期範圍,超過即輸出,未超過則往下捲動頁面
for i in driver.find_elements_by_css_selector('div.userContentWrapper'):
last_date_time = i.find_element_by_css_selector('a._5pcq abbr').get_attribute('title')
last_date_time = dt.datetime.strptime(last_date_time.split()[0], '%Y/%m/%d').date()
if last_date_time < start_date:
soup = BeautifulSoup(driver.page_source, 'lxml')
for i in soup.find_all('div', '_5pcr userContentWrapper'):
date = content = link = ''
post_index += 1
date = i.find('a', '_5pcq').find('abbr').get('title')
date_dt = dt.datetime.strptime(date.split()[0], '%Y/%m/%d').date()
## 判斷該則貼文是否在日期範圍內
if date_dt >= start_date:
## 寫入 csv:日期,內文,連結,讚數,留言+分享數
try:
content = i.find('div', '_5pbx').find('p').getText()
content = content.replace(',', ',')
link = 'https://www.facebook.com' + i.find('a', '_5pcq').get('href')
link = link.split('?__xts__')[0].split('?type=3')[0]
like = i.select('span._3dlg span._3dlh')[0].getText().replace(',', '')
if '萬' in like:
like = str(eval(like.replace('\xa0萬', ''))*10000)
comment_share = i.select('div._4vn1')
except:
like = ''
comment_share = []
if comment_share != []:
comment_share = comment_share[0].getText().replace('則留言', ' ').replace('次分享', ' ').replace('萬次觀看', '').replace('次觀看', '').replace(',', '')
c_list = comment_share.split()
else:
c_list = []
if len(c_list) == 3:
c_list = c_list[:-1]
num = 0
for j in range(len(c_list)):
num += eval(c_list[j])
csv.write(brand + ',' + str(post_index) + ',' + date + ',' + content + ',' + link + ',' + like + ',' + str(num) + ',\n')
brand_index += 1
## 貼文圖片下載
print('完成 %s 粉專第 %d 篇貼文的爬取!'%(brand, post_index))
try:
img_link = i.find('a', '_50z9').get('data-ploi')
r = requests.get(img_link)
with open('%s_post_%d.png'%(brand, post_index), 'wb') as f:
f.write(r._content)
except:
print('查無圖片!')
break
else:
## 滾動至最底
driver.execute_script('window.scrollTo(0, document.body.scrollHeight);')
time.sleep(5)
print('完成 %s 粉專的爬文!'%brand)
print('>> 正在關閉瀏覽器...')
driver.close()
print('>> 完成!')
print('\n>> CSV 檔案與貼文圖片已儲存在與程式相同的資料夾中!執行完畢!\n>> CSV 檔請勿直接使用 Excel 開啟,請使用匯入功能,謝謝!')
csv.close()
#####################################
## 寫成 exe 檔
## pyinstaller -F D:\OneDrive\ASUS_INTERN\facebook_page_crawler_1.5.py | [
"christopheryang2012@gmail.com"
] | christopheryang2012@gmail.com |
7d5a4c1c3456e65c7216a3ce61f1b41732d6e95b | 4b641088573c1b9294bbaae5c1177f43c9b89558 | /113.PathSumII.py | 66ec8577f6aeed5af11d3da4a5afe8d6c4eb4e9b | [] | no_license | HsuWang/Leetcode | 5109aa19a24c46849ec659d30a5766aa00e7f344 | f460ca8b080abd3b149d8b120de935bd4b67720e | refs/heads/master | 2020-04-09T12:40:00.228093 | 2019-06-13T16:29:11 | 2019-06-13T16:29:11 | 160,359,201 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 950 | py | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def pathSum(self, root, sum):
"""
:type root: TreeNode
:type sum: int
:rtype: List[List[int]]
"""
def pathSumNode(root, sum,previous):
if root is None:
return
previous.append(root.val)
if root.left is None and root.right is None :
if sum==root.val:
out.append(copy.deepcopy(previous))
previous.pop()
return
pathSumNode(root.left,sum-root.val,previous)
pathSumNode(root.right,sum-root.val,previous)
previous.pop()
out=list()
tmp = list()
pathSumNode( root, sum,tmp)
return out
| [
"noreply@github.com"
] | HsuWang.noreply@github.com |
3d3f406ebb04980682c90fd925e91b33f0e11507 | f9fcba7ac9336c790601c9e3d8f1e9aa9f2ce11b | /P4/qlearning_med_vel_space.py | 73f34ddb40bd4f1c1b4a86691597357683e7d60d | [] | no_license | Dynamite127/cs181-s18-practicals | 9d50b0d7468825bb47b4c9284d40aab120db3145 | 113333c0c94e5553d85a6854378bfd51fdd21f49 | refs/heads/master | 2020-03-13T22:59:17.154605 | 2018-05-02T08:29:33 | 2018-05-02T08:29:33 | 120,121,261 | 0 | 0 | null | 2018-02-03T19:11:29 | 2018-02-03T19:11:29 | null | UTF-8 | Python | false | false | 6,601 | py | # Imports.
import numpy as np
import numpy.random as npr
from SwingyMonkey import SwingyMonkey
import matplotlib
import matplotlib.pyplot as plt
discount_factor = 0.9
screen_width = 600
binsize = 50
screen_height = 400
vstates = 17
# velocity_binsize = 8
num_actions = 2
epsilon = 0.001
class Learner(object):
'''
This agent jumps randomly.
'''
def __init__(self):
self.last_state = None
self.last_action = None
self.last_reward = None
# we initialize the Q matrix for Q learning
self.Q = np.zeros(
(int(num_actions),
int(screen_width/binsize + 1),
int(screen_height/binsize + 1),
int(vstates))
)
# we count the number of times each state has been explored so that we can update epsilon to 0.
# intuitively, if we are perfectly learned, we do not need any more exploration.
self.trials = np.zeros(
(int(num_actions),
int(screen_width/binsize + 1),
int(screen_height/binsize + 1),
int(vstates))
)
def reset(self):
self.last_state = None
self.last_action = None
self.last_reward = None
def exploration(self, p):
return int(npr.rand() < p)
def discretize_velocity(self, velocity):
# If velocity is less than -30, assign velocity to lowest state
if velocity <= -30:
return 0
elif -29 <= velocity <= -26:
return 1
elif -25 <= velocity <= -22:
return 2
elif -21 <= velocity <= -18:
return 3
elif -17 <= velocity <= -14:
return 4
elif -13 <= velocity <= -10:
return 5
elif -9 <= velocity <= -6:
return 6
elif -5 <= velocity <= -2:
return 7
elif -1 <= velocity <= 2:
return 8
elif 3 <= velocity <= 6:
return 9
elif 7 <= velocity <= 10:
return 10
elif 11 <= velocity <= 14:
return 11
elif 15 <= velocity <= 18:
return 12
elif 19 <= velocity <= 22:
return 13
elif 23 <= velocity <= 25:
return 14
elif 26 <= velocity <= 29:
return 15
elif velocity >= 30:
return 16
else:
assert(0)
def action_callback(self, state):
'''
Implement this function to learn things and take actions.
Return 0 if you don't want to jump and 1 if you do.
'''
# Get data from current state
d_gap = int(state['tree']['dist'] / binsize)
v_gap = int((state['tree']['top'] - state['monkey']['top']) / binsize)
# vel = int(state['monkey']['vel'] / velocity_binsize)
vel = self.discretize_velocity(state['monkey']['vel'])
# # If velocity too high or low, place into appropriate bin
# if np.abs(vel) > 8:
# vel = int(8 * np.sign(vel))
action = self.exploration(.5)
if self.last_action != None:
last_d_gap = int(self.last_state['tree']['dist'] / binsize)
last_v_gap = int((self.last_state['tree']['top'] - self.last_state['monkey']['top']) / binsize)
# last_vel = int(self.last_state['monkey']['vel'] / velocity_binsize)
last_vel = self.discretize_velocity(self.last_state['monkey']['vel'])
# # Compress velocity if needed
# if np.abs(last_vel) > 8:
# last_vel = int(8 * np.sign(last_vel))
# Max Q value over all actions for this particular distance from tree, vertical dist from tree,
# velocity
max_Q = np.max(self.Q[:, d_gap, v_gap, vel])
new_epsilon = epsilon / max(self.trials[action][d_gap, v_gap, vel], 1)
if npr.rand() > new_epsilon:
if self.Q[1][d_gap, v_gap, vel] > self.Q[0][d_gap, v_gap, vel]:
action = 1
else:
action = 0
# Learning rate decreases as number of times we execute the last action in the last state
# increases
eta = 1 / self.trials[self.last_action][last_d_gap, last_v_gap, last_vel]
q_adjust = eta * (self.last_reward + discount_factor * max_Q - self.Q[self.last_action][last_d_gap, last_v_gap, last_vel])
self.Q[self.last_action][last_d_gap, last_v_gap, last_vel] += q_adjust
self.last_action = action
self.last_state = state
self.trials[action][d_gap, v_gap, vel] += 1
return action
def reward_callback(self, reward):
'''This gets called so you can see what reward you get.'''
self.last_reward = reward
def run_games(learner, hist, iters = 10000, t_len = 100):
'''
Driver function to simulate learning by having the agent play a sequence of games.
'''
for ii in range(iters):
# Make a new monkey object.
swing = SwingyMonkey(sound=False, # Don't play sounds.
text="Epoch %d" % (ii), # Display the epoch on screen.
tick_length = t_len, # Make game ticks super fast.
action_callback=learner.action_callback,
reward_callback=learner.reward_callback)
# Loop until you hit something.
while swing.game_loop():
pass
# Save score history.
hist.append(swing.score)
print('{}: {}'.format((ii + 1),learner.last_state['score']))
# Reset the state of the learner.
learner.reset()
return
if __name__ == '__main__':
# Select agent.
agent = Learner()
# Empty list to save history.
hist = []
# Run games.
num_iters = 1000
time_step = 2
try:
run_games(agent, hist, num_iters, time_step)
except:
pass
fig, axes = plt.subplots(2, 1, figsize = (10, 8))
axes[0].plot(range(len(hist)), hist, 'o')
axes[0].set_title('Scores Over Time\nMed Velocity Space')
axes[0].set_xlabel('Num Iterations')
axes[0].set_ylabel('Score')
axes[1].hist(hist)
axes[1].set_title('Score Distribution\nMed Velocity Space')
axes[1].set_xlabel('Times Score Achieved')
plt.tight_layout()
plt.savefig('med_vel_space_graphs.png')
plt.clf()
# Save history.
np.save('hist',np.array(hist))
| [
"aaronconradsachs@Carlas-MacBook-Air.local"
] | aaronconradsachs@Carlas-MacBook-Air.local |
2491648b829fae2a14b377c6924af78da6e58114 | d20512cc0bb5dc28e03744bdabb067bdcef1a454 | /swmmio/tests/test_model_elements.py | e01aa796459c414cf9e6d652ee12890cdc3a6908 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | gitGovea/swmmio | ec0b8d1c6ca6ccd2519eb47e572cee94819003ab | 735739081b72c6176ef0993cf1ae5a2febf2e892 | refs/heads/master | 2022-06-29T21:21:26.290230 | 2020-05-06T18:30:49 | 2020-05-06T18:30:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,396 | py | import os
import pytest
import tempfile
import pandas as pd
import swmmio
import swmmio.utils.functions
import swmmio.utils.text
from swmmio.tests.data import MODEL_FULL_FEATURES_XY, MODEL_FULL_FEATURES__NET_PATH, MODEL_A_PATH
from swmmio import Model, dataframe_from_inp
from swmmio.utils.dataframes import get_link_coords
from swmmio.utils.text import get_rpt_sections_details, get_inp_sections_details
@pytest.fixture
def test_model_01():
return Model(MODEL_FULL_FEATURES_XY)
@pytest.fixture
def test_model_02():
return Model(MODEL_FULL_FEATURES__NET_PATH)
def test_complete_headers(test_model_01):
headers = swmmio.utils.text.get_inp_sections_details(test_model_01.inp.path)
print (list(headers.keys()))
sections_in_inp = [
'TITLE', 'OPTIONS', 'EVAPORATION', 'RAINGAGES', 'SUBCATCHMENTS', 'SUBAREAS', 'INFILTRATION',
'JUNCTIONS', 'OUTFALLS', 'STORAGE', 'CONDUITS', 'PUMPS', 'WEIRS', 'XSECTIONS', 'INFLOWS',
'CURVES', 'TIMESERIES', 'REPORT', 'TAGS', 'MAP', 'COORDINATES', 'VERTICES', 'POLYGONS',
'SYMBOLS'
]
assert (all(section in headers for section in sections_in_inp))
def test_complete_headers_rpt(test_model_02):
headers = get_rpt_sections_details(test_model_02.rpt.path)
sections_in_rpt = [
'Link Flow Summary', 'Link Flow Summary', 'Subcatchment Summary',
'Cross Section Summary', 'Link Summary'
]
assert(all(section in headers for section in sections_in_rpt))
assert headers['Link Summary']['columns'] == ['Name', 'FromNode', 'ToNode',
'Type', 'Length', 'SlopePerc',
'Roughness']
def test_get_set_curves(test_model_01):
curves = test_model_01.inp.curves
print (curves)
def test_dataframe_composite(test_model_02):
m = test_model_02
links = m.links
feat = links.geojson[2]
assert feat['properties']['Name'] == '1'
assert feat['properties']['MaxQ'] == 2.54
links_gdf = links.geodataframe
assert links_gdf.index[2] == '1'
assert links_gdf.loc['1', 'MaxQ'] == 2.54
def test_model_section():
m = swmmio.Model(MODEL_FULL_FEATURES_XY)
def pumps_old_method(model):
"""
collect all useful and available data related model pumps and
organize in one dataframe.
"""
# check if this has been done already and return that data accordingly
if model._pumps_df is not None:
return model._pumps_df
# parse out the main objects of this model
inp = model.inp
# create dataframes of relevant sections from the INP
pumps_df = dataframe_from_inp(inp.path, "[PUMPS]")
if pumps_df.empty:
return pd.DataFrame()
# add conduit coordinates
xys = pumps_df.apply(lambda r: get_link_coords(r, inp.coordinates, inp.vertices), axis=1)
df = pumps_df.assign(coords=xys.map(lambda x: x[0]))
df.InletNode = df.InletNode.astype(str)
df.OutletNode = df.OutletNode.astype(str)
model._pumps_df = df
return df
pumps_old_method = pumps_old_method(m)
pumps = m.pumps()
assert(pumps_old_method.equals(pumps))
def test_subcatchment_composite(test_model_02):
subs = test_model_02.subcatchments
assert subs.dataframe.loc['S3', 'Outlet'] == 'j3'
assert subs.dataframe['TotalRunoffIn'].sum() == pytest.approx(2.45, 0.001)
def test_remove_model_section():
with tempfile.TemporaryDirectory() as tempdir:
m1 = swmmio.Model(MODEL_A_PATH)
# create a copy of the model without subcatchments
# m1.inp.infiltration = m1.inp.infiltration.iloc[0:0]
m1.inp.subcatchments = m1.inp.subcatchments.iloc[0:0]
# m1.inp.subareas = m1.inp.subareas.iloc[0:0]
# m1.inp.polygons = m1.inp.polygons.iloc[0:0]
# save to temp location
temp_inp = os.path.join(tempdir, f'{m1.inp.name}.inp')
m1.inp.save(temp_inp)
m2 = swmmio.Model(temp_inp)
sects1 = get_inp_sections_details(m1.inp.path)
sects2 = get_inp_sections_details(m2.inp.path)
# confirm saving a copy retains all sections except those removed
assert ['SUBCATCHMENTS'] == [x for x in sects1 if x not in sects2]
# confirm subcatchments returns an empty df
assert m2.subcatchments.dataframe.empty
| [
"aerispaha@gmail.com"
] | aerispaha@gmail.com |
733cfe9ef22b50f5b8609d81bc03f3d9d88e6929 | 07d3a88373bf1e03712eb85dd05ae1f3b9d9e2c8 | /componentTests/cam.py | 295eef1b00bd2b9dcc39ecefd5502f9b4bf184af | [] | no_license | ittenes/Antonio-Laudcode_columbus17 | 4bdcf7158b34b80ad0da1e59b441438142a30957 | d25f476c9853d6c34201a1aba5495bcc45c6222d | refs/heads/master | 2021-01-01T15:56:57.922135 | 2017-08-18T12:54:12 | 2017-08-18T12:54:12 | 97,733,483 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 956 | py | import numpy as np
import cv2
import numpy as np
import cv2
import Tkinter
from PIL import Image
from PIL import ImageTk
import time
#pip install Pillow
#pip install Image
#img = cv2.imread('img.png')
# A root window for displaying objects
root = Tkinter.Tk()
# Convert the Image object into a TkPhoto object
canvas = Tkinter.Canvas(root, width=1200, height=1100)
canvas.pack()
canvas.create_line(0, 0, 200, 100)
canvas.create_line(0, 100, 200, 0, fill="red", dash=(4, 4))
canvas.create_rectangle(50, 25, 150, 75, fill="blue")
cap = cv2.VideoCapture(0)
if cap.isOpened() == 0:
cap.open(0)
while(True):
ret, frame = cap.read()
time.sleep(1/25)
b,g,r = cv2.split(frame)
img2 = cv2.merge((r,g,b))
im = Image.fromarray(img2)
#cv2.imwrite("fframe.png", frame)
converted = ImageTk.PhotoImage(image=im)
canvas.create_image(500, 500, image=converted)
root.update() # Start the GUI
time.sleep(30)
#cap.release()
#cv2.destroyAllWindows() | [
"lau.llobet@gmail.com"
] | lau.llobet@gmail.com |
18b01e955f05885529a1169802fac6a3aa079a36 | 60b479477f8e0f6e4712d6bdaad839049be0688c | /youtube_scrapper/Video.py | 926997e9cb7bc88d89a355be7a63d8f8b434271a | [] | no_license | maliksblr92/ReactSnippetV2 | 15e99063e83ebde72c3a075e3130f3e3e325d29c | c5c5e912135aa9fa9d4a86a7c24fc8f0129944b7 | refs/heads/master | 2022-12-03T09:09:55.974846 | 2020-08-21T13:44:18 | 2020-08-21T13:44:18 | 289,272,240 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,802 | py | from selenium import webdriver
from bs4 import BeautifulSoup
from selenium.common.exceptions import TimeoutException, NoSuchElementException, JavascriptException
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from youtube_transcript_api import YouTubeTranscriptApi
import json
from time import sleep
import re
import time
driver=""
def channel_information():
elements = WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.XPATH, '//*[@id="top-row"]/ytd-video-owner-renderer')))
for element in elements:
html_text = element.get_attribute("innerHTML")
soup = BeautifulSoup(html_text, 'html.parser')
channel_information={
"channel_image":soup.find("img").attrs.get("src"),
"channel_name":soup.find("a", class_="yt-simple-endpoint style-scope yt-formatted-string").text,
"channel_link":soup.find("a", class_="yt-simple-endpoint style-scope yt-formatted-string").attrs.get("href"),
"subscribers":soup.find(id="owner-sub-count").text
}
return channel_information
def video_information():
try:
element = driver.find_element_by_xpath('//yt-formatted-string[text()="Show more"]')
driver.execute_script("arguments[0].click();", element)
WebDriverWait(driver, 3).until(EC.presence_of_element_located((By.XPATH, '//yt-formatted-string[text()="Category"]')))
html=driver.page_source
soup = BeautifulSoup(html, 'html.parser')
contents= soup.findAll( id="content")
descriptions=contents[0].find('script', id ="scriptTag").text
description=json.loads(descriptions)
cat = soup.find('yt-formatted-string', text = "Category")
if cat:
cat = cat.findNext('a', class_="yt-simple-endpoint style-scope yt-formatted-string")
if cat:
cat = cat.text
else:
cat = ""
general_info=soup.findAll("yt-formatted-string", class_="style-scope ytd-toggle-button-renderer style-text")
video_information={
"likes":general_info[0].attrs.get("aria-label"),
"dislikes":general_info[1].attrs.get("aria-label"),
"category":cat
# contents[4].find("a", class_="yt-simple-endpoint style-scope yt-formatted-string")
}
return video_information, description
except Exception as e:
print(e)
def get_comments(scroll=500):
elem = driver.find_element_by_tag_name("body")
comments_data=[]
while scroll:
elem.send_keys(Keys.PAGE_DOWN)
scroll-=1
comments = WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.XPATH, "//*[@id='contents']/ytd-comment-thread-renderer")))
html_text=driver.page_source
soup = BeautifulSoup(html_text, 'html.parser')
no_comments=soup.find("h2", id="count").text
for comment in comments:
html_text=comment.get_attribute("innerHTML")
soup = BeautifulSoup(html_text, 'html.parser')
comment_={
"name":soup.find("img", id="img").attrs.get("alt"),
"image":soup.find("img", id="img").attrs.get("src"),
"time":soup.find("a" ,class_="yt-simple-endpoint style-scope yt-formatted-string").text,
"text": soup.find(id="content-text").text,
"likes":soup.find("span", id="vote-count-middle").attrs.get("aria-label"),
}
comments_data.append(comment_)
return comments_data, no_comments
def video_scrapper( driver_,video_id="",):
chrome_options = Options()
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("--start-maximized")
global driver
driver=driver_
#driver=webdriver.Chrome(executable_path="./chromedriver", chrome_options=chrome_options)
driver.get(f"https://www.youtube.com/watch?v={video_id}")
channel_info= channel_information()
video_info, descriptions=video_information()
comment_data, number_of_comments=get_comments()
subtitiles=video_subtitle(video_id)
data={
"channel_information":channel_info,
"video_information":video_info,
"description":descriptions,
"number_of_comments":number_of_comments,
"comments":comment_data,
"subtitles":subtitiles
}
return data
def video_subtitle(videoID=""):
data="subtitle are not enabled"
try:
data=YouTubeTranscriptApi.get_transcript(videoID)
return data
except Exception:
return data | [
"zcomisb.007@gmail.com"
] | zcomisb.007@gmail.com |
bacf230a767398ca47a2805717e4e134c5b1e795 | 04ea39d3c224cc74836342f5432a291b3f47c711 | /AndroidCodeSmell/appium_script/tools/log.py | 31629e9e4c53f73058e8c21225d2d2388850349e | [] | no_license | scorpiussusanyu/ACSTNN | 8d8fe313848c9883d1e2819a35ae64bdd6cfe633 | 2196d82d68e31ff3fc4cc847333783848c16d23b | refs/heads/master | 2023-09-02T17:01:26.090710 | 2021-11-04T17:59:18 | 2021-11-04T17:59:18 | 402,281,566 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,695 | py | # -*- coding: utf-8 -*-
"""
@Author:MaoMorn
@Time: 2020/07/21
@Description:
"""
from appium_script.tools import util
from appium_script import metric
from multiprocessing import Process
import jpype
import os
import time
def get_pid(package_name: str) -> str:
command = "adb shell ps | findstr %s" % package_name
result = util.run_command(command)[1]
pid = result.split()[1]
return pid
def log_gc_anr(lock, pid: str, freq: int, log_dir: str):
clean_command = "adb shell rm /data/anr/*"
log_command = "adb shell kill -3 %s" % pid
ls_command = "adb shell ls /data/anr/"
print("启动GC收集:")
util.run_command(clean_command)
log_file_path = os.path.join(log_dir, "gc.csv")
util.creat_file(log_file_path)
log_file = open(log_file_path, "w", newline='')
gc = metric.GC()
gc.init_writer(log_file)
flag = 1
print("GC收集启动成功:")
while lock.value:
time.sleep(freq - 1)
util.run_command(log_command)
time.sleep(1)
file_name = util.run_command(ls_command)[1].strip().split("\r\n")[-1]
command = "adb shell cat /data/anr/%s" % file_name
content = util.run_command(command)[1]
util.run_command(clean_command)
if content != "":
gc.parse(content)
if flag:
gc.write_header()
flag = 0
gc.write_val()
log_file.close()
print("*" * 50)
print("%s 收集完毕" % log_file_path)
def log_gc_logcat(pid: str, timestamp: str, log_dir: str):
log_command = "adb shell logcat -b main -t '%s.000' --pid=%s > %s" % \
(timestamp, pid, os.path.join(log_dir, "gc.txt"))
util.run_command(log_command)
def log_battery(lock, package_name: str, freq: int, log_dir: str):
reset_command = "adb shell dumpsys batterystats --reset"
util.run_command(reset_command)
log_command = "adb shell dumpsys batterystats %s" % package_name
battery = metric.Battery()
# while lock.value:
time.sleep(freq)
result = util.run_command(log_command)[1]
battery.parse(result)
print(battery)
def log_cpu_top(pid: str, package_name: str, log_dir: str):
log_command = "adb shell top -p %s -n 1 | findstr %s" % (pid, package_name)
util.run_command(log_command)
time.sleep(3)
def log_cpu_proc(lock, pid: str, freq: int, log_dir: str):
# 默认2s更新一次
print("启动CPU收集:")
log_file_path = os.path.join(log_dir, "cpu.csv")
util.creat_file(log_file_path)
log_file = open(log_file_path, "w", newline='')
cpu = metric.CPU()
cpu.init_writer(log_file)
cpu.parse(pid)
cpu.write_header()
print("CPU收集启动成功:")
while lock.value:
time.sleep(freq)
cpu.parse(pid)
cpu.write_val()
log_file.close()
print("*" * 50)
print("%s 收集完毕" % log_file_path)
def log_memory(lock, pid: str, freq, log_dir: str):
print("启动Memory收集:") # KB
log_command = "adb shell dumpsys meminfo %s" % pid
log_file_path = os.path.join(log_dir, "memory.csv")
util.creat_file(log_file_path)
log_file = open(log_file_path, "w", newline='')
memory = metric.Memory()
memory.init_writer(log_file)
flag = 1
print("Memory收集启动成功:")
while lock.value:
time.sleep(freq)
content = util.run_command(log_command)[1]
try:
memory.parse(content)
if flag:
memory.write_header()
flag = 0
memory.write_val()
except Exception as e:
print(e)
print("Memory异常:\t" + content)
log_file.close()
print("*" * 50)
print("%s 收集完毕" % log_file_path)
def log_frame(lock, pid: str, freq: int, log_dir: str):
print("启动Frame收集:")
command = "adb shell dumpsys gfxinfo %s reset" % pid
util.run_command(command)
log_file_path = os.path.join(log_dir, "frame.csv")
util.creat_file(log_file_path)
log_file = open(log_file_path, "w", newline='')
frame = metric.Frame()
flag = 1
frame.init_writer(log_file)
print("Frame收集启动成功:")
while lock.value:
time.sleep(freq)
content = util.run_command(command)[1]
frame.parse(content)
if flag:
frame.write_header()
flag = 0
frame.write_val()
log_file.close()
print("*" * 50)
print("%s 收集完毕" % log_file_path)
def log_energy(lock, package_name, log_dir):
print("启动Energy收集:")
jar_dir = "E:/PycharmProjects/AndroidCodeSmell/appium_script/lib"
jar_path = ""
for jar in os.listdir(jar_dir):
jar_path += os.path.join(jar_dir, jar) + ";"
jvm_path = "D:/Java/jdk-8_x86/jre/bin/server/jvm.dll"
jpype.startJVM(jvm_path, "-ea", "-Xms128m", "-Xmx256m", f"-Djava.class.path={jar_path}")
java_class = jpype.JClass("Main")
profiler = java_class.getInstance()
profiler.setTargetPackage(package_name)
print("Energy收集启动成功:")
while lock.value:
continue
profiler.save()
profiler.stop()
jpype.shutdownJVM()
def start_log(package_name, lock, log_dir, freq=2):
print("开始启动日志记录:")
pid = get_pid(package_name)
Process(target=log_frame, args=(lock, pid, freq, log_dir)).start()
Process(target=log_cpu_proc, args=(lock, pid, freq, log_dir)).start()
Process(target=log_memory, args=(lock, pid, freq, log_dir)).start()
Process(target=log_gc_anr, args=(lock, pid, freq, log_dir)).start()
Process(target=log_energy, args=(lock, package_name, log_dir)).start()
if __name__ == "__main__":
# lock = Value('i', 1)
# Process(target=func, args=(lock, 1)).start()
# Process(target=func, args=(lock, -1)).start()
# for i in range(10):
# print("main %d" % i)
# time.sleep(1)
# lock.value = 0
# util.creat_file("C:/Users/MaoMorn/Desktop/a/test.txt")
pid = "25319"
# log_dir = "C:/Users/MaoMorn/Desktop/test"
log_dir = "C:\\Users\\MaoMorn\\Desktop\\test"
print("log")
# Process(target=log_frame, args=(lock, pid, 2, log_dir)).start()
# Process(target=log_cpu_proc, args=(lock, pid, 2, log_dir)).start()
# Process(target=log_memory, args=(lock, pid, 2, log_dir)).start()
# Process(target=log_gc_anr, args=(lock, pid, 2, log_dir)).start()
# for i in range(10):
# print(i)
# time.sleep(1)
# lock.value = 0
| [
"susanyu1026@126.com"
] | susanyu1026@126.com |
80ae4bae5717164516c2b52d00052bef81faa166 | ec9724096e2b4dbb2d877081666aeec319f039d1 | /game/baseball.py | 01ea7c3ea8f262dc0e76ec617ac2660149a30ad0 | [
"MIT"
] | permissive | herjmoo/pystudy | 13b56945a4e10968fd1ebea23cb649e98ab5f81e | 728f6bbb06873a44c02f000344f9b62f3bc42d7c | refs/heads/master | 2020-03-22T18:37:37.707238 | 2018-09-06T05:32:06 | 2018-09-06T05:32:06 | 140,471,504 | 0 | 2 | MIT | 2018-09-06T05:32:07 | 2018-07-10T18:17:48 | Python | UTF-8 | Python | false | false | 3,076 | py | ################################################################################
# baseball.py
# Copyright (c) 2018, PyStudy-GoGoogle
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
################################################################################
import random
from lib.string import *
class Baseball:
def __init__(self):
self.ans_len = 3
self.limit = 10
def setup_ans_len(self, n):
if n > 10:
print("No support, the length of answer should be less or equal than 10")
return
self.ans_len = n
print("Length of answer is set to {0}".format(n))
def setup_try_limit(self, n):
self.limit = n
print("Limit of try(ies) is set to {0}".format(n))
def start(self):
print("==================== GAME START ====================")
# Generate random numbers
ans = ""
while check_duplication(ans):
ans = ""
for i in range(self.ans_len):
ans += str(random.randint(0, 9))
guess = ""
tries = 0
while guess != ans and tries < self.limit:
# Check the input numbers
guess = ""
while len(guess) != self.ans_len or check_duplication(guess):
guess = input("Enter the {0} digit number with no duplication: ".format(self.ans_len))
# Check the numbers and count Strike and Ball
strike = 0
ball = 0
for idx in range(self.ans_len):
if ans[idx] == guess[idx]:
strike += 1
elif guess.count(ans[idx]):
ball += 1
print("{0}S{1}B".format(strike, ball))
tries += 1
if tries == 1:
print("Go out and get Powerball tickets")
elif guess == ans:
print("Congratulation!!! You did it on {0} tries".format(tries))
else:
print("Sorry you lose. The answer is " + ans)
print("==================== GAME END ====================")
| [
"joonmoo.huh@intel.com"
] | joonmoo.huh@intel.com |
243792943a4d64b4c137b4d8458cd10f9d01f78a | 0ef45fc3a3c18e5687f9fdae5222288f0565c37c | /test0.py | bff3df7a5d5127b153e1e9e4be73cd0e54a9d4d0 | [] | no_license | SkyLoveAngle/SoftWare-Test | 59d9d2760f26a4e7c01600970596041a9b450c6f | 36ba00ed16712f14a9d14d78b1841c1cc1f4a6d5 | refs/heads/main | 2023-06-18T10:43:53.984907 | 2021-07-25T13:53:05 | 2021-07-25T13:53:05 | 386,928,640 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 947 | py | from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get("https://www.baidu.com/")
urll=driver.current_url
print(urll)
driver.find_element_by_id("kw").send_keys("福原爱")
driver.find_element_by_id("su").submit()
#固定等待
#time.sleep(10)
#智能等待
# driver.implicitly_wait(10)
#driver.find_element_by_link_text("福原爱 - 百度百科").click()
#浏览器的最大化
driver.maximize_window()
#打印title
time.sleep(6)
title=driver.title
print(title)
url=driver.current_url
print(url)
#浏览器的后退
# driver.back()
time.sleep(6)
#浏览器的前进
# driver.forward()
#设置浏览器的宽和高
driver.set_window_size(400, 1000)
time.sleep(3)
#拖动滚动条到最底端
js1="var q=document.documentElement.scrollTop=10000"
driver.execute_script(js1)
time.sleep(6)
#拖动滚动条到最顶端
js2="var q=document.documentElement.scrollTop=0"
driver.execute_script(js2)
time.sleep(6)
driver.quit()
| [
"1920909528@qq.com"
] | 1920909528@qq.com |
02916aa12e26d8e7bd5c64c4e962ad2a3ddd86e0 | 63a1671145dc6dc6e1a9d10ec21c520b83036fea | /others/label_convert/show_img_by_yolo.py | 9a438d83718bba72dd0beed8655d3fa9949b61fa | [
"MIT"
] | permissive | chenpaopao/- | 4eca1405a3aab86fe649817048852b620a962c1a | 320f7d9a0b9e49528561024217ba07645eb68805 | refs/heads/master | 2023-02-04T17:44:48.639136 | 2022-06-06T05:04:57 | 2022-06-06T05:04:57 | 323,789,818 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,590 | py | import argparse
import os
import sys
from collections import defaultdict
import cv2
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from tqdm import tqdm
category_set = dict()
image_set = set()
every_class_num = defaultdict(int)
category_item_id = -1
def xywhn2xyxy(box, size):
box = list(map(float, box))
size = list(map(float, size))
xmin = (box[0] - box[2] / 2.) * size[0]
ymin = (box[1] - box[3] / 2.) * size[1]
xmax = (box[0] + box[2] / 2.) * size[0]
ymax = (box[1] + box[3] / 2.) * size[1]
return (xmin, ymin, xmax, ymax)
def addCatItem(name):
global category_item_id
category_item = dict()
category_item_id += 1
category_item['id'] = category_item_id
category_item['name'] = name
category_set[name] = category_item_id
return category_item_id
def draw_box(img, objects, draw=True):
for object in objects:
category_name = object[0]
every_class_num[category_name] += 1
if category_name not in category_set:
category_id = addCatItem(category_name)
else:
category_id = category_set[category_name]
xmin = int(object[1][0])
ymin = int(object[1][1])
xmax = int(object[1][2])
ymax = int(object[1][3])
if draw:
def hex2rgb(h): # rgb order (PIL)
return tuple(int(h[1 + i:1 + i + 2], 16) for i in (0, 2, 4))
hex = ('FF3838', 'FF9D97', 'FF701F', 'FFB21D', 'CFD231', '48F90A', '92CC17', '3DDB86', '1A9334', '00D4BB',
'2C99A8', '00C2FF', '344593', '6473FF', '0018EC', '8438FF', '520085', 'CB38FF', 'FF95C8', 'FF37C7')
palette = [hex2rgb('#' + c) for c in hex]
n = len(palette)
c = palette[int(category_id) % n]
bgr = False
color = (c[2], c[1], c[0]) if bgr else c
cv2.rectangle(img, (xmin, ymin), (xmax, ymax), color)
cv2.putText(img, category_name, (xmin, ymin), cv2.FONT_HERSHEY_SIMPLEX, 1, color)
return img
def show_image(image_path, anno_path, show=False, plot_image=False):
assert os.path.exists(image_path), "image path:{} dose not exists".format(image_path)
assert os.path.exists(anno_path), "annotation path:{} does not exists".format(anno_path)
anno_file_list = [os.path.join(anno_path, file) for file in os.listdir(anno_path) if file.endswith(".txt")]
with open(anno_path + "/classes.txt", 'r') as f:
classes = f.readlines()
category_id = dict((k, v.strip()) for k, v in enumerate(classes))
for txt_file in tqdm(anno_file_list):
if not txt_file.endswith('.txt') or 'classes' in txt_file:
continue
filename = txt_file.split(os.sep)[-1][:-3] + "jpg"
image_set.add(filename)
file_path = os.path.join(image_path, filename)
if not os.path.exists(file_path):
continue
img = cv2.imread(file_path)
if img is None:
continue
width = img.shape[1]
height = img.shape[0]
objects = []
with open(txt_file, 'r') as fid:
for line in fid.readlines():
line = line.strip().split()
category_name = category_id[int(line[0])]
bbox = xywhn2xyxy((line[1], line[2], line[3], line[4]), (width, height))
obj = [category_name, bbox]
objects.append(obj)
img = draw_box(img, objects, show)
if show:
cv2.imshow(filename, img)
cv2.waitKey()
cv2.destroyAllWindows()
if plot_image:
# 绘制每种类别个数柱状图
plt.bar(range(len(every_class_num)), every_class_num.values(), align='center')
# 将横坐标0,1,2,3,4替换为相应的类别名称
plt.xticks(range(len(every_class_num)), every_class_num.keys(), rotation=90)
# 在柱状图上添加数值标签
for index, (i, v) in enumerate(every_class_num.items()):
plt.text(x=index, y=v, s=str(v), ha='center')
# 设置x坐标
plt.xlabel('image class')
# 设置y坐标
plt.ylabel('number of images')
# 设置柱状图的标题
plt.title('class distribution')
plt.savefig("class_distribution.png")
plt.show()
if __name__ == '__main__':
"""
脚本说明:
该脚本用于yolo标注格式(.txt)的标注框可视化
参数明说:
image_path:图片数据路径
anno_path:txt标注文件路径
show:是否展示标注后的图片
plot_image:是否对每一类进行统计,并且保存图片
"""
parser = argparse.ArgumentParser()
parser.add_argument('-ip', '--image-path', type=str, default='./data/images', help='image path')
parser.add_argument('-ap', '--anno-path', type=str, default='./data/labels/yolo', help='annotation path')
parser.add_argument('-s', '--show', action='store_true', help='weather show img')
parser.add_argument('-p', '--plot-image', action='store_true')
opt = parser.parse_args()
if len(sys.argv) > 1:
print(opt)
show_image(opt.image_path, opt.anno_path, opt.show, opt.plot_image)
else:
image_path = './data/images'
anno_path = './data/labels/yolo'
show_image(image_path, anno_path, show=True, plot_image=True)
print(every_class_num)
print("category nums: {}".format(len(category_set)))
print("image nums: {}".format(len(image_set)))
print("bbox nums: {}".format(sum(every_class_num.values())))
| [
"739677819@qq.com"
] | 739677819@qq.com |
1e9b873b207de4e3ceafa838dad971dbb1499a7f | 09e57dd1374713f06b70d7b37a580130d9bbab0d | /data/p3BR/R2/benchmark/startQiskit365.py | eb19e320752840e2c905c3f8005c7be2d19bdece | [
"BSD-3-Clause"
] | permissive | UCLA-SEAL/QDiff | ad53650034897abb5941e74539e3aee8edb600ab | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | refs/heads/main | 2023-08-05T04:52:24.961998 | 2021-09-19T02:56:16 | 2021-09-19T02:56:16 | 405,159,939 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,388 | py | # qubit number=3
# total number=73
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.test.mock import FakeVigo, FakeYorktown
kernel = 'circuit/bernstein'
def bitwise_xor(s: str, t: str) -> str:
length = len(s)
res = []
for i in range(length):
res.append(str(int(s[i]) ^ int(t[i])))
return ''.join(res[::-1])
def bitwise_dot(s: str, t: str) -> str:
length = len(s)
res = 0
for i in range(length):
res += int(s[i]) * int(t[i])
return str(res % 2)
def build_oracle(n: int, f: Callable[[str], str]) -> QuantumCircuit:
# implement the oracle O_f
# NOTE: use multi_control_toffoli_gate ('noancilla' mode)
# https://qiskit.org/documentation/_modules/qiskit/aqua/circuits/gates/multi_control_toffoli_gate.html
# https://quantumcomputing.stackexchange.com/questions/3943/how-do-you-implement-the-toffoli-gate-using-only-single-qubit-and-cnot-gates
# https://quantumcomputing.stackexchange.com/questions/2177/how-can-i-implement-an-n-bit-toffoli-gate
controls = QuantumRegister(n, "ofc")
target = QuantumRegister(1, "oft")
oracle = QuantumCircuit(controls, target, name="Of")
for i in range(2 ** n):
rep = np.binary_repr(i, n)
if f(rep) == "1":
for j in range(n):
if rep[j] == "0":
oracle.x(controls[j])
oracle.mct(controls, target[0], None, mode='noancilla')
for j in range(n):
if rep[j] == "0":
oracle.x(controls[j])
# oracle.barrier()
# oracle.draw('mpl', filename=(kernel + '-oracle.png'))
return oracle
def build_circuit(n: int, f: Callable[[str], str]) -> QuantumCircuit:
# implement the Bernstein-Vazirani circuit
zero = np.binary_repr(0, n)
b = f(zero)
# initial n + 1 bits
input_qubit = QuantumRegister(n+1, "qc")
classicals = ClassicalRegister(n, "qm")
prog = QuantumCircuit(input_qubit, classicals)
# inverse last one (can be omitted if using O_f^\pm)
prog.x(input_qubit[n])
# circuit begin
prog.h(input_qubit[1]) # number=1
prog.h(input_qubit[2]) # number=38
prog.cz(input_qubit[0],input_qubit[2]) # number=39
prog.h(input_qubit[2]) # number=40
prog.h(input_qubit[2]) # number=59
prog.cz(input_qubit[0],input_qubit[2]) # number=60
prog.h(input_qubit[2]) # number=61
prog.h(input_qubit[2]) # number=42
prog.cz(input_qubit[0],input_qubit[2]) # number=43
prog.h(input_qubit[2]) # number=44
prog.h(input_qubit[2]) # number=48
prog.cz(input_qubit[0],input_qubit[2]) # number=49
prog.h(input_qubit[2]) # number=50
prog.cx(input_qubit[0],input_qubit[2]) # number=54
prog.cx(input_qubit[0],input_qubit[2]) # number=70
prog.x(input_qubit[2]) # number=71
prog.cx(input_qubit[0],input_qubit[2]) # number=72
prog.h(input_qubit[2]) # number=67
prog.cz(input_qubit[0],input_qubit[2]) # number=68
prog.h(input_qubit[2]) # number=69
prog.h(input_qubit[2]) # number=64
prog.cz(input_qubit[0],input_qubit[2]) # number=65
prog.h(input_qubit[2]) # number=66
prog.cx(input_qubit[0],input_qubit[2]) # number=37
prog.h(input_qubit[2]) # number=51
prog.cz(input_qubit[0],input_qubit[2]) # number=52
prog.h(input_qubit[2]) # number=53
prog.h(input_qubit[2]) # number=25
prog.cz(input_qubit[0],input_qubit[2]) # number=26
prog.h(input_qubit[2]) # number=27
prog.h(input_qubit[1]) # number=7
prog.cz(input_qubit[2],input_qubit[1]) # number=8
prog.rx(0.17592918860102857,input_qubit[2]) # number=34
prog.rx(-0.3989822670059037,input_qubit[1]) # number=30
prog.h(input_qubit[1]) # number=9
prog.h(input_qubit[1]) # number=18
prog.rx(2.3310617489636263,input_qubit[2]) # number=58
prog.cz(input_qubit[2],input_qubit[1]) # number=19
prog.h(input_qubit[1]) # number=20
prog.x(input_qubit[1]) # number=62
prog.y(input_qubit[1]) # number=14
prog.h(input_qubit[1]) # number=22
prog.cz(input_qubit[2],input_qubit[1]) # number=23
prog.rx(-0.9173450548482197,input_qubit[1]) # number=57
prog.cx(input_qubit[2],input_qubit[1]) # number=63
prog.h(input_qubit[1]) # number=24
prog.z(input_qubit[2]) # number=3
prog.z(input_qubit[1]) # number=41
prog.x(input_qubit[1]) # number=17
prog.y(input_qubit[2]) # number=5
prog.x(input_qubit[2]) # number=21
# apply H to get superposition
for i in range(n):
prog.h(input_qubit[i])
prog.h(input_qubit[n])
prog.barrier()
# apply oracle O_f
oracle = build_oracle(n, f)
prog.append(
oracle.to_gate(),
[input_qubit[i] for i in range(n)] + [input_qubit[n]])
# apply H back (QFT on Z_2^n)
for i in range(n):
prog.h(input_qubit[i])
prog.barrier()
# measure
return prog
def get_statevector(prog: QuantumCircuit) -> Any:
state_backend = Aer.get_backend('statevector_simulator')
statevec = execute(prog, state_backend).result()
quantum_state = statevec.get_statevector()
qubits = round(log2(len(quantum_state)))
quantum_state = {
"|" + np.binary_repr(i, qubits) + ">": quantum_state[i]
for i in range(2 ** qubits)
}
return quantum_state
def evaluate(backend_str: str, prog: QuantumCircuit, shots: int, b: str) -> Any:
# Q: which backend should we use?
# get state vector
quantum_state = get_statevector(prog)
# get simulate results
# provider = IBMQ.load_account()
# backend = provider.get_backend(backend_str)
# qobj = compile(prog, backend, shots)
# job = backend.run(qobj)
# job.result()
backend = Aer.get_backend(backend_str)
# transpile/schedule -> assemble -> backend.run
results = execute(prog, backend, shots=shots).result()
counts = results.get_counts()
a = Counter(counts).most_common(1)[0][0][::-1]
return {
"measurements": counts,
# "state": statevec,
"quantum_state": quantum_state,
"a": a,
"b": b
}
def bernstein_test_1(rep: str):
"""011 . x + 1"""
a = "011"
b = "1"
return bitwise_xor(bitwise_dot(a, rep), b)
def bernstein_test_2(rep: str):
"""000 . x + 0"""
a = "000"
b = "0"
return bitwise_xor(bitwise_dot(a, rep), b)
def bernstein_test_3(rep: str):
"""111 . x + 1"""
a = "111"
b = "1"
return bitwise_xor(bitwise_dot(a, rep), b)
if __name__ == "__main__":
n = 2
a = "11"
b = "1"
f = lambda rep: \
bitwise_xor(bitwise_dot(a, rep), b)
prog = build_circuit(n, f)
sample_shot =4000
writefile = open("../data/startQiskit365.csv", "w")
# prog.draw('mpl', filename=(kernel + '.png'))
backend = BasicAer.get_backend('qasm_simulator')
circuit1 = transpile(prog, FakeYorktown())
circuit1.h(qubit=2)
circuit1.x(qubit=3)
circuit1.measure_all()
info = execute(circuit1,backend=backend, shots=sample_shot).result().get_counts()
print(info, file=writefile)
print("results end", file=writefile)
print(circuit1.depth(), file=writefile)
print(circuit1, file=writefile)
writefile.close()
| [
"wangjiyuan123@yeah.net"
] | wangjiyuan123@yeah.net |
ae80616558bed8861d21e76ea900040d98faee2e | ed5802bd6ca441ea6a3aeda7c0369b7018d1c83a | /file_reader.py | a4609fa220cff966eb37c514737c96dfae373da5 | [] | no_license | LostBoyNZ/PR301-Assignment2 | d1978454f24eb257e3f9471585f8d999bcd5a57f | 4fd666eb5322d3bc024af381a7fd092c94441f08 | refs/heads/master | 2020-03-09T21:14:23.723252 | 2018-06-08T08:28:14 | 2018-06-08T08:28:14 | 129,004,153 | 0 | 0 | null | 2018-06-08T08:28:15 | 2018-04-10T22:55:50 | Python | UTF-8 | Python | false | false | 4,173 | py | import sys
from openpyxl import load_workbook
from data_processor import DataProcessor
from databases.database_sqlite import CompanyDatabase
from log_file_handler import LogFileHandler
try:
from errors import ErrorHandler as Err
except NameError and ModuleNotFoundError and ImportError:
print("Fatal Error - Err.py not found.")
sys.exit()
except Exception as e:
print(Err.get_error_message(901, e))
sys.exit()
try:
from database_excel import DatabaseExcel
except NameError and ModuleNotFoundError and ImportError:
print(Err.get_error_message(404, "database_excel"))
sys.exit()
except Exception as e:
print(Err.get_error_message(901, e))
sys.exit()
try:
from data_fields import DataFields
except NameError and ModuleNotFoundError and ImportError:
print(Err.get_error_message(404, "data_fields"))
sys.exit()
except Exception as e:
print(Err.get_error_message(901, e))
sys.exit()
try:
from file_writer import FileWriter
except NameError and ModuleNotFoundError and ImportError:
print(Err.get_error_message(404, "file_writer"))
sys.exit()
except Exception as e:
print(Err.get_error_message(901, e))
sys.exit()
class FileReader(object):
dict_root = {}
def __init__(self):
self.db = CompanyDatabase
@staticmethod
def get_input(text):
return input(text)
@staticmethod
def fetch_workbook_file(file_name):
return load_workbook(file_name)
@staticmethod
def fetch_workbook_contents(wb, switch):
result = DatabaseExcel.get_data_from_excel(DatabaseExcel, wb, switch)
return result
@staticmethod
def fetch_text_file(file_name):
file = ""
try:
file = open(file_name, "r")
except FileNotFoundError:
print(Err.get_error_message(201))
return file
# Claye, Works with CSV and TXT docs
@staticmethod
def fetch_text_contents(file, switch, separator=","):
f = FileReader()
dup_keys = 0
keep_going = True
data_fields = DataFields.get_data_fields(DataFields)
if file is not "":
# Repeat for each line in the text file
for line in file:
# Split file into fields using ","
fields = line.split(separator)
checked_id = DataProcessor.validate_key(fields[0])
if checked_id in f.dict_root:
dup_keys += 1
fields[6] = fields[6].rstrip()
data_to_log = "Duplicate Key" + str(fields[0:])
LogFileHandler.append_file('log.txt', data_to_log)
else:
test_dict = {}
field_number = 1
# Ignore the ID field and the Valid field for now
for row_name in data_fields[1:-1]:
test_dict[row_name] = fields[field_number]
field_number += 1
test_dict['valid'] = '0'
f.dict_root.update({checked_id: test_dict})
# Close the file to free up resources (good practice)
file.close()
if keep_going:
valid_dict = DataProcessor.send_to_validate(f.dict_root,
switch, dup_keys)
return valid_dict
def load_pickle_file(self, file_name=""): # Claye, Graham
file = None
lines = ""
if file_name == "":
file_target = self.get_input(
"Please input the filename to load from >>> ")
else:
file_target = file_name
try:
file = open(file_target, "rb")
except FileNotFoundError:
print(Err.get_error_message(201))
except OSError:
print(Err.get_error_message(103))
if file:
with open(file_target) as file:
lines = file.readlines()
print(lines)
return lines
| [
"noreply@github.com"
] | LostBoyNZ.noreply@github.com |
115aaeea5625f2f62cdb8e38bfed30b18e72628c | 432e415640ccfac632eb33a32ae4c1866d85cc48 | /program/test/test_alloc_on_chip.py | 0b1c45c00926b87fd1e83b7248593e5ec828d532 | [] | no_license | GD06/MPU-ASPLOS-2021 | 0a13ce6eca48efbbca526d2736fa7d00ff5d890b | a357e73239a03384bae73d7006667cfeb07df635 | refs/heads/master | 2022-12-04T19:57:35.420468 | 2020-08-20T14:36:52 | 2020-08-20T14:36:52 | 289,026,962 | 3 | 1 | null | null | null | null | UTF-8 | Python | false | false | 4,021 | py | #!/usr/bin/env python3
import unittest
import tempfile
import os
import program.prog_api as prog_api
import config.config_api as config_api
class TestAllocOnChip(unittest.TestCase):
def setUp(self):
self.curr_dir = os.path.dirname(os.path.realpath(__file__))
self.proj_dir = os.path.dirname(os.path.dirname(self.curr_dir))
_, self.ptx_file = tempfile.mkstemp(suffix=".ptx", dir=self.curr_dir)
self.config = config_api.load_hardware_config()
def tearDown(self):
os.remove(self.ptx_file)
def test_ptx_exists(self):
self.assertTrue(os.path.isfile(self.ptx_file))
def test_reg_alloc(self):
# Print out a simple kernel with registers allocated
with open(self.ptx_file, "w") as f:
print(".visible .entry _Z9Kernel(", file=f)
print("\t .param .u32 _Z9_param_0", file=f)
print(")", file=f)
print("{", file=f)
print("\t .reg .pred\t %p<11>;", file=f)
print("\t .reg .f32\t %f<31>;", file=f)
print("\t .reg .b32\t %r<14>;", file=f)
print("\t .reg .b64\t %rd<9>;", file=f)
print("\t ret;", file=f)
print("}", file=f)
kernel_list = prog_api.load_kernel(self.ptx_file)
self.assertEqual(len(kernel_list), 1)
kernel = kernel_list[0]
self.assertEqual(len(kernel.arg_list), 1)
reg_usage_per_warp, shared_memory_usage_per_block = (
kernel.compute_resource_usage(
data_path_unit_size=self.config["data_path_unit_size"],
num_threads_per_warp=self.config["num_threads_per_warp"],
num_pe=self.config["num_pe"]
)
)
self.assertEqual(
reg_usage_per_warp,
384 + 31 * 4 * 32 + 14 * 4 * 32 + 9 * 8 * 32
)
self.assertEqual(shared_memory_usage_per_block, 0)
self.assertEqual(kernel.reg_offset["%p"], 0)
self.assertEqual(kernel.reg_offset["%f"], 384)
self.assertEqual(kernel.reg_offset["%r"], 384 + 31 * 4 * 32)
rd_offset = 384 + 31 * 4 * 32 + 14 * 4 * 32
self.assertEqual(kernel.reg_offset["%rd"], rd_offset)
# predicate register aligned to 4 bytes
self.assertEqual(kernel.reg_size["%p"], 32)
self.assertEqual(kernel.reg_size["%f"], 128)
self.assertEqual(kernel.reg_size["%r"], 128)
self.assertEqual(kernel.reg_size["%rd"], 256)
return
def test_smem_alloc(self):
# Print out a simple kernel with shared memory allocated
with open(self.ptx_file, "w") as f:
print(".visible .entry _Z9Kernel(", file=f)
print("\t .param .u32 _Z9_param_0", file=f)
print(")", file=f)
print("{", file=f)
print("\t .reg .pred\t %p<2>;", file=f)
print(".shared .align 4 .b8 _var1[508];", file=f)
print(".shared .align 2 .b8 _var2[65];", file=f)
print(".shared .align 4 .b8 _var3[128];", file=f)
print("\t ret;", file=f)
print("}", file=f)
kernel_list = prog_api.load_kernel(self.ptx_file)
self.assertEqual(len(kernel_list), 1)
kernel = kernel_list[0]
self.assertEqual(len(kernel.arg_list), 1)
reg_usage_per_warp, shared_memory_usage_per_block = (
kernel.compute_resource_usage(
data_path_unit_size=self.config["data_path_unit_size"],
num_threads_per_warp=self.config["num_threads_per_warp"],
num_pe=self.config["num_pe"],
)
)
self.assertEqual(reg_usage_per_warp, 128)
self.assertEqual(shared_memory_usage_per_block, 512 + 128 + 128)
self.assertEqual(kernel.smem_offset["_var1"], 0)
self.assertEqual(kernel.smem_offset["_var2"], 512)
self.assertEqual(kernel.smem_offset["_var3"], 512 + 128)
return
if __name__ == "__main__":
unittest.main()
| [
"xfxie.ceca@gmail.com"
] | xfxie.ceca@gmail.com |
5cd7bf15cbb9f9a315ace1403ce4ea46bc9b95db | 163bbb4e0920dedd5941e3edfb2d8706ba75627d | /Code/CodeRecords/2345/60586/315364.py | 08640613734e1bd7c00a353bb3777990539f833a | [] | no_license | AdamZhouSE/pythonHomework | a25c120b03a158d60aaa9fdc5fb203b1bb377a19 | ffc5606817a666aa6241cfab27364326f5c066ff | refs/heads/master | 2022-11-24T08:05:22.122011 | 2020-07-28T16:21:24 | 2020-07-28T16:21:24 | 259,576,640 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 203 | py | input()
input()
x=input()
input()
y=input()
if x=="2 2"and y=="1 2 3":
print("2 1")
print("0 0")
elif x=="2 2"and y=="1 3 3":
print("2 1")
print("3 2")
else:
print(x)
print(y) | [
"1069583789@qq.com"
] | 1069583789@qq.com |
0009a4238258a3dc5749b796594aed5a71aa1f16 | f518506fb620fd29a2db876c05de813508eda519 | /CreateView/CreateView/urls.py | 8ff63f64f426a78c025e088176b31d2ce45712cd | [] | no_license | Niharika3128/Django5-6 | 07435ae9088659e2d192cda60542aee5214e0637 | be3055ca91da45c37f9ec1adb626eea335477746 | refs/heads/master | 2020-06-02T04:28:37.016405 | 2019-06-09T17:28:33 | 2019-06-09T17:28:33 | 191,035,169 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 827 | py | """CreateView URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from app import views
urlpatterns = [
path('admin/', admin.site.urls),
path('main/',views.CreateNewEmployee.as_view())
]
| [
"niharika5475@gmail.com"
] | niharika5475@gmail.com |
3050a3c031b7da4bb89691ad3a0b8dd3d37e51cd | b4f2ba6d72738ca49cff02c9555498702de3a39c | /turt script more colors.py | 16434dad010bd74c0c497738ec7b18f7b8c4b1e4 | [] | no_license | grahamrichard/turtlegram | 7a568ebff097288bd053be54f2ac1973e1a9ea2c | 83b7944763b8d67594b14ab6c7f5dfbc5dedf419 | refs/heads/master | 2021-10-12T02:54:17.712016 | 2019-01-31T22:19:10 | 2019-01-31T22:19:10 | 104,622,034 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,067 | py | # Turtle-gram tests
# March 2017
# ImageTools functions adapted from Susan Fox, Macalester College Computer Science
# Written by Richard Graham
import turtle
from imageToolsTools import *
pic = makePicture("yike.jpg")
# show(pic)
w = getWidth(pic)
h = getHeight(pic)
sc = turtle.Screen()
sc.setup(width=w, height=h)
sc.tracer(2048)
colordict = {
"red": [238, 32, 77], "yellow": [252, 232, 131], "blue": [31, 117, 254], "brown": [180, 103, 77],
"orange": [255, 117, 56], "green": [28, 172, 120], "violet": [146, 110, 174], "black": [35, 35, 35],
"carnation pink": [255, 170, 204], "yellow orange": [255, 182, 83], "blue green": [25, 158, 189],
"red violet": [192, 68, 143], "red orange": [255, 83, 73], "yellow green": [197, 227, 132],
"blue violet": [115, 102, 189], "white": [237, 237, 237], "violet red": [247, 83, 148],
"dandelion": [253, 219, 109], "cerulean": [29, 172, 214], "apricot": [253, 217, 181], "scarlet": [252, 40, 71],
"green yellow": [240, 232, 145], "indigo": [93, 118, 203], "gray": [149, 145, 140]
}
palette = [
'blue violet', 'violet', 'orange', 'brown', 'blue', 'yellow', 'apricot', 'white', 'red orange', 'cerulean',
'gray', 'blue green', 'black', 'indigo', 'scarlet', 'red', 'green', 'yellow green', 'green yellow',
'dandelion', 'carnation pink', 'violet red', 'red violet', 'yellow orange'
]
sequence = {
0: 'green yellow', 1: 'blue violet', 2: 'yellow', 3: 'gray', 4: 'dandelion', 5: 'carnation pink', 6: 'apricot', 7:
'blue green', 8: 'brown', 9: 'indigo', 10: 'violet red', 11: 'red violet', 12: 'scarlet', 13: 'orange', 14:
'black', 15: 'white', 16: 'yellow green', 17: 'red', 18: 'cerulean', 19: 'red orange', 20: 'yellow orange',
21: 'blue', 22: 'green', 23: 'violet'
}
turtlist = []
# FIXME: this one's wrong
# def maketurtles(palette, turtles):
# accumulator = 1
# for i in range(len(palette)):
# tempname = palette[accumulator]
# turtles.append(tempname.turtle.Turtle())
# accumulator += 1
# return turtles
# maketurtles(colorlist, colordict)
print(turtlist)
# def makelists(palette):
# for col in palette.keys():
# listname = "FIXME"
def pixel_params(image, rlist, glist, blist):
for y in range(h):
for x in range(w):
pix = getPixel(image, x, y)
r, g, b = getRGB(pix)
if r > g and r > b:
rlist.append([x, y])
elif g >= r and g >= b:
glist.append([x, y])
elif b > r and b > g:
blist.append([x, y])
return rlist, glist, blist
def turtleprint(rtu, gtu, btu, rlist, glist, blist):
for elem in rlist:
rtu.penup()
rtu.goto(elem)
rtu.dot(1, "red")
for elem in glist:
gtu.penup()
gtu.goto(elem)
gtu.dot(1, "green")
for elem in blist:
btu.penup()
btu.goto(elem)
btu.dot(1, "blue")
# pixel_params(pic, rpoints, gpoints, bpoints)
# turtleprint(tr, tg, tb, rpoints, gpoints, bpoints)
#
# sc.exitonclick()
| [
"rgraham2@macalester.edu"
] | rgraham2@macalester.edu |
92798e97c2e24cf01a2aa823f42f660aaab8293b | 08892167da611ae1d9fa36ac2c1232804da9d487 | /build/ur_dashboard_msgs/catkin_generated/pkg.develspace.context.pc.py | be83fb6cc713cfdfe3c18a4b00a74ad547de0f19 | [] | no_license | QuiN-cy/ROS_Test_ws | cfd11134312590cabe09f404a332e5f1c4415f59 | 6b041e3aa8c27212c5fc665d3c54dbde988b5d67 | refs/heads/main | 2023-05-15T06:19:16.680149 | 2021-06-11T15:34:05 | 2021-06-11T15:34:05 | 371,643,730 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 559 | py | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/student/test_ws/devel/.private/ur_dashboard_msgs/include".split(';') if "/home/student/test_ws/devel/.private/ur_dashboard_msgs/include" != "" else []
PROJECT_CATKIN_DEPENDS = "message_runtime;actionlib_msgs".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "ur_dashboard_msgs"
PROJECT_SPACE_DIR = "/home/student/test_ws/devel/.private/ur_dashboard_msgs"
PROJECT_VERSION = "0.0.0"
| [
"quincy1234321@hotmail.nl"
] | quincy1234321@hotmail.nl |
a9aafb16d4f5348af4bbadc27d0c35d49e1a3854 | c54bdec0e892fbbec533d7d9741148d43cf65c80 | /Django/UserDashboard/apps/user_dashboard/models.py | 59cc23e133d1c2e3c78a6e4f7d41f1020a9fef90 | [] | no_license | tuannguyen0115/Python | d11f0363db05cc580e9126915372c492deb46881 | 206af90b1cf7e8654f00b8e7f0ac11ac5a00b3cb | refs/heads/master | 2021-09-02T10:18:01.725496 | 2018-01-01T20:36:11 | 2018-01-01T20:36:11 | 109,206,903 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,330 | py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
import re
import bcrypt
EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9\.\+_-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z]*$')
# Create your models here.
class UserManager(models.Manager):
def basic_validator(self, postData):
errors = {}
if len(postData['first_name']) < 2:
errors["first_name"] = "First name has to have at least 2 characters."
if not postData['first_name'].isalpha():
errors['first_name'] = "First name cannot have any number."
if len(postData['first_name']) is 0:
errors["first_name"] = "First name is required."
if len(postData['last_name']) < 2:
errors["last_name"] = "Last name has to have at least 2 characters."
if not postData['last_name'].isalpha():
errors['last_name'] = "Last name cannot have any number."
if len(postData['last_name']) is 0:
errors["last_name"] = "Last name is required."
if not EMAIL_REGEX.match(postData['email']):
errors["email"] = "Invalid email format"
if len(postData['email']) is 0:
errors["email"] = "Email is required."
if len(User.objects.filter(email=postData['email'])):
errors["email"] = "Email is already registered."
if postData['pw'] != postData['pw_confirm']:
errors['pw'] = "Password confirmation must match."
if len(postData['pw']) < 8:
errors["pw"] = "Password has to have at least 8 characters."
if len(postData['pw']) is 0:
errors["pw"] = "Password is required."
return errors
class User(models.Model):
first_name = models.CharField(max_length=255)
last_name = models.CharField(max_length=255)
email = models.CharField(max_length=255)
password = models.CharField(max_length=255)
desc = models.TextField()
created_at = models.DateTimeField(auto_now_add = True)
updated_at = models.DateTimeField(auto_now = True)
user_level = models.CharField(max_length=255)
objects = UserManager()
def __repr__(self):
return "<User Object: {} {}, user_level = {}>".format(self.first_name, self.last_name, self.user_level)
| [
"tuannguyen0115@gmail.com"
] | tuannguyen0115@gmail.com |
2e3d8d7cfcfa60a44a0addf88f52ea50fef537c3 | cb63b64435af17aaa652d7efd9f624e0e9385085 | /todo/forms.py | af63ce00a410f0b86a199cb882b0d209adfb2464 | [] | no_license | Vostbur/todo-multiuser-site | e4bb6bb0713cb466fa5338c213911f3d53089db2 | b6e975255cbd74ce2319e64b885558d244454b43 | refs/heads/master | 2023-05-04T23:36:50.668891 | 2021-05-24T19:47:36 | 2021-05-24T19:47:36 | 370,466,082 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 182 | py | from django.forms import ModelForm
from .models import Todo
class TodoForm(ModelForm):
class Meta:
model = Todo
fields = ['title', 'description', 'important']
| [
"vostbur@gmail.com"
] | vostbur@gmail.com |
758ff12c395ca4ef578f2d3c6628e3868269a67b | 240f3fdcf2c5cb846a9acfce6dce736f5363a148 | /1001.py | 48f1b8e7d0243fc69f211935c059df6fe1f03485 | [] | no_license | yuriifreire/uri-judge-with-python | 1436aaaf26e71f7d352509fd2cc316213f7b5f22 | 3f87cf0051bd8cc5c7c8aafa6f32b2a918dee835 | refs/heads/master | 2020-03-27T02:10:37.425892 | 2018-08-23T18:46:46 | 2018-08-23T18:46:46 | 145,771,555 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 57 | py | a = int(input())
b = int(input())
print('X =', a+b)
| [
"yuriifreire@hotmail.com"
] | yuriifreire@hotmail.com |
206e0e260a9034345e1f63fbd7993a4b30eb352e | fa91d7990179d0488952dc3b1b104f22aa5962ac | /tokenizers/roberta_tokenizer.py | 3067c6d96d92b101df09bf705dabfc475d7a89a9 | [] | no_license | scape1989/efficient-bert | 302f3cf3ad94a68995e3c44915712b3417417c73 | 31085bcce45197659d037d8b601717a7fb9c93db | refs/heads/main | 2023-08-01T00:15:04.271518 | 2021-09-16T02:43:02 | 2021-09-16T02:43:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,256 | py | import torch
import regex as re
import json
import tokenizers
from functools import lru_cache
@lru_cache()
def bytes_to_unicodes():
"""
Returns list of utf-8 byte and a mapping to unicode strings.
We specifically avoids mapping to whitespace/control characters the bpe code barfs on.
The reversible bpe codes work on unicode strings.
This means you need a large # of unicode characters in your vocab if you want to avoid UNKs.
When you're at something like a 10B token dataset you end up needing around 5K for decent coverage.
This is a signficant percentage of your normal, say, 32K bpe vocab.
To avoid that, we want lookup tables between utf-8 bytes and unicode strings.
"""
bytes = list(range(ord('!'), ord('~') + 1))+list(range(ord('¡'), ord('¬') + 1))+list(range(ord('®'), ord('ÿ') + 1))
unicodes = bytes[:]
n = 0
for b in range(2**8):
if b not in bytes:
bytes.append(b)
unicodes.append(2**8 + n)
n += 1
unicodes = [chr(n) for n in unicodes]
return dict(zip(bytes, unicodes))
def get_pairs(word):
"""
Return set of symbol pairs in a word.
Word is represented as tuple of symbols (symbols being variable-length strings).
"""
pairs = set()
prev_char = word[0]
for char in word[1:]:
pairs.add((prev_char, char))
prev_char = char
return pairs
class RobertaBasicTokenizer(tokenizers.BaseTokenizer):
def __init__(self, lowercase, vocab_path, merge_path, unk_token='<unk>', sep_token='</s>', pad_token='<pad>',
cls_token='<s>', mask_token='<mask>'):
super(RobertaBasicTokenizer, self).__init__(lowercase)
with open(vocab_path, encoding='utf-8') as f:
self.vocab_map = json.load(f)
self.id_to_token_map = {v: k for k, v in self.vocab_map.items()}
self.byte_encoder = bytes_to_unicodes()
self.byte_decoder = {v: k for k, v in self.byte_encoder.items()}
with open(merge_path, encoding='utf-8') as merges_handle:
bpe_merges = merges_handle.read().split('\n')[1:-1]
bpe_merges = [tuple(merge.split()) for merge in bpe_merges]
self.bpe_ranks = dict(zip(bpe_merges, range(len(bpe_merges))))
self.cache = {}
# Should haved added re.IGNORECASE so BPE merges can happen for capitalized versions of contractions
self.pattern = re.compile(r"""'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+""")
self.unk_token = unk_token
self.sep_token = sep_token
self.pad_token = pad_token
self.cls_token = cls_token
self.mask_token = mask_token
self.special_tokens = {self.unk_token, self.sep_token, self.pad_token, self.cls_token, self.mask_token}
self.unk_token_id = self.vocab_map.get(self.unk_token)
self.sep_token_id = self.vocab_map.get(self.sep_token)
self.pad_token_id = self.vocab_map.get(self.pad_token)
self.cls_token_id = self.vocab_map.get(self.cls_token)
self.mask_token_id = self.vocab_map.get(self.mask_token)
def _tokenize(self, text):
bpe_tokens = []
for token in re.findall(self.pattern, text):
token = ''.join(self.byte_encoder[b] for b in token.encode('utf-8')) # Maps all our bytes to unicode strings, avoiding controle tokens of the BPE (spaces in our case)
bpe_tokens.extend(bpe_token for bpe_token in self._byte_level_tokenize(token).split(' '))
return bpe_tokens
def _byte_level_tokenize(self, token):
if token in self.cache:
return self.cache[token]
word = tuple(token)
pairs = get_pairs(word)
if not pairs:
return token
while True:
bigram = min(pairs, key=lambda pair: self.bpe_ranks.get(pair, float("inf")))
if bigram not in self.bpe_ranks:
break
first, second = bigram
new_word = []
i = 0
while i < len(word):
try:
j = word.index(first, i)
except ValueError:
new_word.extend(word[i:])
break
else:
new_word.extend(word[i:j])
i = j
if word[i] == first and i < len(word) - 1 and word[i + 1] == second:
new_word.append(first + second)
i += 2
else:
new_word.append(word[i])
i += 1
new_word = tuple(new_word)
word = new_word
if len(word) == 1:
break
else:
pairs = get_pairs(word)
word = ' '.join(word)
self.cache[token] = word
return word
def _tokens_to_ids(self, tokens):
ids = []
for token in tokens:
token_id = self.vocab_map.get(token, self.vocab_map.get(self.unk_token))
ids.append(token_id)
return ids
def _ids_to_tokens(self, token_ids):
tokens = []
for token_id in token_ids:
token = self.id_to_token_map.get(token_id, self.unk_token)
tokens.append(token)
return tokens
def _tokens_to_string(self, tokens):
text = ''.join(tokens)
text = bytearray([self.byte_decoder[c] for c in text]).decode('utf-8', errors='replace')
return text
class RobertaTokenizer(RobertaBasicTokenizer):
def __init__(self, lowercase, task, vocab_path, merge_path, max_seq_len, max_query_len=None):
super(RobertaTokenizer, self).__init__(lowercase, vocab_path, merge_path)
self.task = task
self.max_seq_len = max_seq_len
self.max_query_len = max_query_len
# single_tokens: <s> X </s>, paired_tokens: <s> A </s></s> B </s>
self.num_special_token_single = 2
self.num_special_token_paired = 4
self.num_special_token_a_paired = 3
self.num_special_token_b_paired = 1
def _combine_and_pad(self, token_ids_a, token_ids_b):
token_ids = [self.cls_token_id] + token_ids_a + [self.sep_token_id]
segment_ids = [0] * len(token_ids) # Will not be used in roberta model
if token_ids_b is not None:
token_ids += [self.sep_token_id] + token_ids_b + [self.sep_token_id]
segment_ids += [0] + [1] * len(token_ids_b + [self.sep_token_id])
attn_mask = [0] * len(token_ids)
if len(token_ids) < self.max_seq_len:
dif = self.max_seq_len - len(token_ids)
token_ids += [self.pad_token_id] * dif
segment_ids += [0] * dif
attn_mask += [1] * dif
# Replace non-padding symbols with their position numbers, position numbers begin at pad_token_id + 1
mask = token_ids.ne(self.pad_token_id).long()
incremental_indicies = torch.cumsum(mask, dim=1) * mask
position_ids = incremental_indicies + self.pad_token_id
return token_ids, segment_ids, position_ids, attn_mask
| [
"cheneychenhe98@gmail.com"
] | cheneychenhe98@gmail.com |
fd4a6f49b03f1a9333b0454268f0521c7ae973cd | 00c8db59130dbdf3d224af547ee2c8ceff987617 | /apps/blog/migrations/0004_post_likes.py | 3e9198d60b7641d45a2b02ec01760d9321bfdfae | [] | no_license | Dmytro-Sk/website_blog | f89b4d8d9deddf6a6d32267409890682fd4b9e57 | 20c38197a230d9a728d0a541c46c0d281049fc20 | refs/heads/main | 2023-06-01T01:01:53.904467 | 2021-06-20T12:47:57 | 2021-06-20T12:47:57 | 373,511,998 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 531 | py | # Generated by Django 3.2.4 on 2021-06-08 16:26
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('blog', '0003_alter_post_add_post_date'),
]
operations = [
migrations.AddField(
model_name='post',
name='likes',
field=models.ManyToManyField(related_name='blog_posts', to=settings.AUTH_USER_MODEL),
),
]
| [
"0971898920d@gmail.com"
] | 0971898920d@gmail.com |
9fa11d5c6461cd2fe6ffbdf168b2ba242ccad9b0 | 9a9ee424b103f7041a3ae9e07ddf72a67ed2ef9b | /walkupEnv/bin/pygmentize | 52e670000ee623bd859bc8b77354efe347168563 | [
"Apache-2.0"
] | permissive | cogerk/walk-up-music-scrapper | 8a2fd74da6e63a1aa284b22217e3e33852835520 | 74df610985e6ff220a605a49933a0655e247caa3 | refs/heads/master | 2020-03-26T09:51:43.607643 | 2019-01-06T00:09:44 | 2019-01-06T00:09:44 | 144,768,839 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 286 | #!/Users/kathryncogert/Documents/Repos/walk-up-music-scrapper/walkupEnv/bin/python3.6
# -*- coding: utf-8 -*-
import re
import sys
from pygments.cmdline import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
| [
"cogerk@gmail.com"
] | cogerk@gmail.com | |
eb000566544d85a9c7c6d6c3bedbda147e9e7243 | d53e9ece43534b9c22d4cf00f6d26b73d1fc92af | /area_circulo.py | aa523f50ee4071d304f00da7d64cc51c52a05c94 | [] | no_license | m1kr0ch1p/python_stuffs | 11a815864a7a7a592a66064f98648782afc5d286 | e460cd13488aceb364cf0063d813b00584cdf6ff | refs/heads/master | 2023-03-21T13:37:36.278302 | 2021-03-24T03:15:50 | 2021-03-24T03:15:50 | 295,297,930 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 243 | py | #!/usr/bin/python
from math import pi
try:
r = float(input("Me dê o raio do círculo:\n"))
a = pi * (r**2)
print("A área do círculo é " + str(a) + ".")
except:
print("Me dê valores quantitativos.")
# A = π. r2 | [
"noreply@github.com"
] | m1kr0ch1p.noreply@github.com |
9e07a7fd8b20c1fc7d6b06ce142016f550b5b3a5 | e61004d943a7cd094c68cc925e85c1e2b927167f | /datacat_test.py | f3272531a662a7e85dfab243c6cee9d399a9cd02 | [] | no_license | Carterhuang/site_monitor | 9f56221bd25665b10fe1e74a66a1d48bab62ed98 | e283e7e8035b98e98b1dbf985fc142ee17effa5c | refs/heads/master | 2016-09-05T16:57:26.877889 | 2014-10-11T02:23:20 | 2014-10-11T02:23:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,137 | py | import datacat
from datacat import Datacat
import threading
import sys
import time
def mock_hit_on_section(log_file, hits, gap):
file_out = open(log_file, 'w')
for i in xrange(hits):
time.sleep(gap)
file_out.write('127.0.0.1 - - [09/Oct/2014:17:23:05 -0400] "GET /examples/ HTTP/1.1" 304 -\n')
## Creat a sample test file.
def test_1():
print 'Test case 1 started.'
print 'Threshold value: 20'
print 'Fake User, 1 hit per 0.5 second, totally 21 hits'
print 'This test case takes 5 seconds.'
test_file = open('test_datacat.txt', 'w')
test_file.write('127.0.0.1 - - [09/Oct/2014:09:30:51 -0400] "GET /dummy/ HTTP/1.1" 200 11217')
test_file.close()
cat = Datacat('test_datacat.txt', 20,testing=True)
cat.daemon = True
cat.start()
if cat.alerting:
cat.signal_stop()
print 'Test case failed. The cat should not be alerting at this stage\n'
return 0
mock_hit_thread = threading.Thread(target=mock_hit_on_section,
args=['test_datacat.txt', 21, 0.1])
mock_hit_thread.daemon = True
mock_hit_thread.start()
time.sleep(5)
if not cat.alerting:
cat.signal_stop()
print 'Test case failed. The cat should be alerted at this time.\n'
return 0
cat.signal_stop()
print 'Test case (1) succeeded.\n'
return 1
## Creat a sample test file.
def test_2():
print 'Test case 2 started.'
print 'Threshold value: 100'
print 'Fake User, 1 hit per 0.5 second, totally 101 hits'
print 'This test case takes around 60 seconds.'
test_file = open('test_datacat.txt', 'w')
test_file.write('127.0.0.1 - - [09/Oct/2014:09:30:51 -0400] "GET / HTTP/1.1" 200 11217')
test_file.close()
cat = Datacat('test_datacat.txt', 100, testing=True)
cat.daemon = True
cat.start()
if cat.alerting:
cat.signal_stop()
print 'Test case failed. The cat should not be alerting at this stage\n'
return 0
mock_hit_thread = threading.Thread(target=mock_hit_on_section,
args=['test_datacat.txt', 101, 0.5])
mock_hit_thread.daemon = True
mock_hit_thread.start()
time.sleep(60)
if not cat.alerting:
cat.signal_stop()
print 'Test case failed. The cat should be alerted at this time.\n'
return 0
cat.signal_stop()
print 'Test case (2) succeeded.\n'
return 1
## Creat a sample test file.
def test_3():
print 'Test case 3 started.'
print 'Threshold value: 100'
print 'Fake User, 1 hit per 1 second, totally 101 hits'
print 'This test case takes around 110 seconds.'
print 'You are expected to see the recovered message at the end'
test_file = open('test_datacat.txt', 'w')
test_file.write('127.0.0.1 - - [09/Oct/2014:09:30:51 -0400] "GET / HTTP/1.1" 200 11217')
test_file.close()
cat = Datacat('test_datacat.txt', 100,testing=True)
cat.daemon = True
cat.start()
if cat.alerting:
cat.signal_stop()
print 'Test case failed. The cat should not be alerting at this stage\n'
return 0
mock_hit_thread = threading.Thread(target=mock_hit_on_section,
args=['test_datacat.txt', 101, 1])
mock_hit_thread.daemon = True
mock_hit_thread.start()
time.sleep(120)
if not cat.alerting:
cat.signal_stop()
print 'Test case failed. The cat should be alerted at this time.\n'
return 0
time.sleep(10)
if cat.alerting:
cat.signal_stop()
print 'Test case failed. The alert should be recovered now\n'
return 0
cat.signal_stop()
print 'Test case (3) succeeded.\n'
return 1
################# Main Program for Datacat Test ######################
from subprocess import call
call(['rm', 'test_datacat.txt'])
print 'Test file removed'
test_cases = [test_1, test_2, test_3]
count = 0
for proc in test_cases:
if proc():
count += 1
print count, ' out of ', len(test_cases), ' passed!'
sys.exit(0)
| [
"huang456@umn.edu"
] | huang456@umn.edu |
cc79c4249abfc5c1bae0c0c21108e55c5181a89c | cfb95ff224f3ed47076e81074c5bd04c251bb569 | /levelupapi/models/EventGamers.py | d2a3a780e9eac1698bb3cd9fd51732ca7548bb80 | [] | no_license | mcampopiano/levelup-python-api | acba338e8ce153278f6bbf248d036e190110aa3a | 5a21d0a3d3c316102fc0598e1e184e34dc008084 | refs/heads/main | 2023-03-12T10:46:39.263141 | 2021-03-02T21:53:08 | 2021-03-02T21:53:08 | 336,344,099 | 0 | 0 | null | 2021-03-01T20:06:56 | 2021-02-05T17:37:29 | Python | UTF-8 | Python | false | false | 275 | py | from levelupapi.models.events import Event
from levelupapi.models.gamer import Gamer
from django.db import models
class EventGamers(models.Model):
event = models.ForeignKey(Event, on_delete=models.CASCADE)
gamer = models.ForeignKey(Gamer, on_delete=models.CASCADE)
| [
"mcampopiano92@gmail.com"
] | mcampopiano92@gmail.com |
1696af969f32886f5c33dab31069319ccc11befb | 675de311f1ff2cc0a83a2d46cf1c89e25acedd2e | /exercises/dictionary.py | 87603b16e39c24226d14647e1e54f2ae48dd0308 | [] | no_license | Ed92/Python | 5f63a9ceb1016d530ae8e6da66e12134fc88fb34 | fa51020a9112b8c38e0022563dff8dd3ced05476 | refs/heads/master | 2020-03-21T08:26:44.922159 | 2018-09-17T15:05:03 | 2018-09-17T15:05:03 | 126,859,538 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 356 | py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 28 13:55:34 2018
@author: ed
"""
import pprint
message = 'It was a bright cold day in April, and the clocks were striking thirteen'
count = {}
for character in message.upper():
count.setdefault(character, 0)
count[character] = count[character] + 1
pprint.pprint(count) | [
"djamgarian0702@gmail.com"
] | djamgarian0702@gmail.com |
e57a5bd566d8bd5e6aa1057bfd026b0c36f65ea1 | 33d078ea9a4dd549d99b01a3aff09d1f2032d6eb | /test/test_server.py | 926c6bae3aa8e125201d8c062760d2678483ddf8 | [] | no_license | labinxu/majong | f84fa34ce4ba82f5006f37f0ddc98b8c08445d10 | 234a82b11093f475d5fc4ea37d2b77a3d33877be | refs/heads/master | 2020-03-19T04:18:39.950419 | 2018-06-02T12:16:38 | 2018-06-02T12:16:38 | 135,814,974 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,446 | py | import sys
if '..' not in sys.path:
sys.path.append('..')
import socket
from xserver import XServer
from player import Player
from protos.action_pb2 import Action
class Test_server(XServer):
def __init__(self, host,ip,players):
# define four players
super().__init__(host, ip, players)
def initcards(self):
"""
"""
self.cards = [1 ,1 ,1 ,2 ,2 ,3 ,3 ,4 ,4 ,4 ,5 ,7 ,6,
1 ,7 ,2 ,3 ,9, 5, 6, 7, 8, 9,7,3]
def __listenling(self):
"""
"""
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR, 1)
sock.bind((self.ip, self.port))
sock.listen(self.player_number)
self.sock = sock
self.logger.info('starting the server %s %s' % (self.ip, self.port))
i = 1
while True:
s, addr = sock.accept()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
player = Player(s, addr, i, self)
action = Action()
action.id = i
action.direct = 0
#init
action.action_type = Action.ACT_INIT
action.message = 'init player'
player.send_action(action)
self.players.append(player)
player.start()
i += 1
if __name__=="__main__":
xserver = Test_server('127.0.0.1', 20000, 1)
xserver.start()
| [
"flowinair@gmail.com"
] | flowinair@gmail.com |
614b502c6cf9478ab6a5cad99a4b7a5c85842776 | 136b3072f1c5dd17f97ef9dea7c792d01377bf6e | /def.py | 928aba3af5dc51fb98644ac655950da34791742a | [] | no_license | sungjh0726/hello | bb8475497310690e6a3a108599a14019bbd8a09c | 094080a8cca3092d09c34a9d02647b1d0c7573ea | refs/heads/master | 2020-04-04T23:15:35.012809 | 2019-01-18T04:07:33 | 2019-01-18T04:07:33 | 156,352,381 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 83 | py | def get_fruits():
return ['오렌지','사과','바나나']
a = get_fruits | [
"sungjh0726@naver.com"
] | sungjh0726@naver.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.