blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
281
content_id
stringlengths
40
40
detected_licenses
listlengths
0
57
license_type
stringclasses
2 values
repo_name
stringlengths
6
116
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
313 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
18.2k
668M
โŒ€
star_events_count
int64
0
102k
fork_events_count
int64
0
38.2k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
107 values
src_encoding
stringclasses
20 values
language
stringclasses
1 value
is_vendor
bool
2 classes
is_generated
bool
2 classes
length_bytes
int64
4
6.02M
extension
stringclasses
78 values
content
stringlengths
2
6.02M
authors
listlengths
1
1
author
stringlengths
0
175
fbce3d599059e069660f8427732a950cda10ff90
27046ec5d4d644ca099e4e6b3e711a9fe1f210bb
/part_2_train.py
a2197dfa0ad5367098150ab440e595fc0f32affd
[]
no_license
RobertFielding/fraud-pandas-plotly
d5d9405f967fbbef00164aefe7a96912c296ea58
2d8eaaa3f7014a9de8e6c7c085b506dcfcb5fab5
refs/heads/master
2023-03-25T19:14:12.238219
2021-03-14T13:23:31
2021-03-14T13:23:31
342,892,256
0
0
null
null
null
null
UTF-8
Python
false
false
2,500
py
import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import roc_curve, roc_auc_score from sklearn.model_selection import train_test_split import numpy as np data_filename = 'creditcard.csv' df = pd.read_csv(data_filename) train, test = train_test_split(df, test_size=0.2) train_features, train_labels = train.iloc[:, :-1], train.iloc[:, -1] test_features, test_labels = test.iloc[:, :-1], test.iloc[:, -1] # Configure Random Forest Classifier, then train and test rf_classifer = RandomForestRegressor(max_depth=4, random_state=0) rf_classifer = rf_classifer.fit(train_features, train_labels) rf_predictions = rf_classifer.predict(test_features) # Make rf_df dataframe test["Prediction Percentile"] = rf_predictions ## Performance metrics # ROC and auc rf_fpr, rf_tpr, _ = roc_curve(test_labels, test["Prediction Percentile"]) rf_auc = roc_auc_score(test_labels, test["Prediction Percentile"], multi_class='ovr') np.savetxt("ROC_rf_fpr", rf_fpr) np.savetxt("ROC_rf_tpr", rf_tpr) with open("ROC_rf_auc.txt", mode='w') as f: f.write(str(rf_auc)) # Plot ROC Curve plt.plot(rf_fpr, rf_tpr, label="Random Forest ROC Curve") # plt.show() # Distribution of prediction scores test["Label"] = "Genuine" test.loc[test["Class"] == 1, "Label"] = "Fraud" for data_type in ["Genuine", "Fraud"]: sns.histplot(data=test[test["Label"] == data_type], common_norm=False, x="Prediction Percentile", stat="density", ) plt.title(data_type + "_Predictions") # plt.show() plt.savefig(f"Figures/Random_Forest_{data_type}.png") plt.clf() test.loc[test["Label"] == "Fraud", "Amount"].sum() ## Creation of scorecard score_df = test[["Label", "Amount", "Prediction Percentile"]] score_df["Genuine Volume"] = (score_df["Label"] == "Genuine").astype(int) score_df["Fraud Volume"] = (score_df["Label"] == "Fraud").astype(int) score_df["Genuine Amount"] = np.where(score_df["Label"] == "Genuine", score_df["Amount"], 0) score_df["Fraud Amount"] = np.where(score_df["Label"] == "Fraud", score_df["Amount"], 0) scorecard = (score_df[["Genuine Volume", "Fraud Volume", "Genuine Amount", "Fraud Amount"]] .groupby((100 * score_df["Prediction Percentile"]).astype(int)) .sum()) scorecard = scorecard.reindex(range(0, 100, 1), fill_value=0) scorecard = scorecard[::-1].cumsum()[::-1] pd.DataFrame.to_csv(scorecard, "Scorecard.csv")
[ "robert.fielding@hotmail.co.uk" ]
robert.fielding@hotmail.co.uk
59344cfbae1c333672ea43675c4735706ee9ee76
3089066acea6edac48ad1fd4a48c958cc7fc8049
/src/training/mlp.py
4e80ecedc29891163fe1abcd5cc0095aac2b6eae
[]
no_license
kevinkoste/university-load-forecasting
a527e52e009916fe7d7b230cbc39d379c45b6b0e
0498a3886582a96f89348498bc412655c7b0bfe2
refs/heads/main
2023-08-03T09:24:27.108126
2021-01-21T04:04:22
2021-01-21T04:04:22
171,188,408
6
2
null
2023-07-06T21:27:06
2019-02-18T00:21:27
Python
UTF-8
Python
false
false
2,573
py
import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense def DayAheadMLP(endog, exog, date, lags=range(1,169), hoursAhead=38, epochs=200, activation='relu', optimizer='adam', loss='mse', verbose=0): """ Trains a fresh MLP and returns a day-ahead forecast endog(pd.Series): Series (usually corresponding to a cluster) of hourly indexed load data exog(pd.DataFrame): DataFrame of covariates if applicable date(date-like obj): Hour after which to begin 38-hour-ahead forecast lags(List): List of lag features to generate (default=range(1,169)) hoursAhead(int): number of hours ahead to predict (default=38) epochs(int): number of epochs for training (default=200) activation(str): key for activation function (default='relu') optimizer(str): key for optimizer (default='adam') loss(str): key for loss function (default='mse') """ # force DataFrame dtype for y, copy X y = pd.DataFrame(endog) X = exog.copy(deep=True) testDate = pd.to_datetime(date) # scale y (0,1) on annual min and max, important assumption scaler = MinMaxScaler().fit(y) y = pd.DataFrame(data=scaler.transform(y), index=y.index, columns=y.columns) for i in lags: X['t-'+str(i)] = y.iloc[:,0].shift(i) for j in range(1,38): y['t+'+str(j)] = y.iloc[:,0].shift(-j) # truncate on both sides to remove NaNs X.dropna(inplace=True) y = y.reindex(X.index, axis=0).dropna() X = X.reindex(y.index, axis=0).dropna() # train/test split, train range includes all available data up to two days prior to test date y_train = y.loc[y.index < testDate-pd.Timedelta(days=2)].values X_train = X.loc[X.index < testDate-pd.Timedelta(days=2)].values X_test = X.loc[X.index == testDate].values # set input and hidden layer dimensions inputDim = X_train.shape[1] hiddenDim = (inputDim-38)//2 + 38 # define model based on hyperparameters model = Sequential() model.add(Dense(hiddenDim, activation=activation, input_dim=inputDim)) model.add(Dense(38)) model.compile(optimizer=optimizer, loss=loss) # fit the model and make a prediction model.fit(X_train, y_train, epochs=epochs) y_pred = model.predict(X_test, verbose=0) # return result after reverse scaling return scaler.inverse_transform(y_pred).flatten()
[ "kevin.koste@yale.edu" ]
kevin.koste@yale.edu
85ee743b57fa57b5f097d7c44528ca83bfbafbc4
ca7aa979e7059467e158830b76673f5b77a0f5a3
/Python_codes/p03250/s433353636.py
15a9e1142e1ac04131cec60d4882b0b4d8b16ff5
[]
no_license
Aasthaengg/IBMdataset
7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901
f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8
refs/heads/main
2023-04-22T10:22:44.763102
2021-05-13T17:27:22
2021-05-13T17:27:22
367,112,348
0
0
null
null
null
null
UTF-8
Python
false
false
70
py
a=list(map(int,input().split())) a=sorted(a) print(a[-1]*10+a[1]+a[0])
[ "66529651+Aastha2104@users.noreply.github.com" ]
66529651+Aastha2104@users.noreply.github.com
e5f6e54c65a454755c25967480e4273cf37e6070
50339c2df5be1dc9812c0d986872b877b5904340
/data_import/liusinuo/sql_time.py
33332860c879dbef4bceb58475d4d44124bd0773
[]
no_license
hashuang/managesys
affcbe16ee54f1dd1bfb4a20f73118c071afee51
67c9c6a395f61842083ae16bb59410c77ba44d21
refs/heads/master
2020-12-25T11:52:33.844031
2017-08-02T02:40:24
2017-08-02T02:40:24
75,186,487
0
0
null
2016-11-30T12:50:14
2016-11-30T12:50:14
null
UTF-8
Python
false
false
12,475
py
''' 2016-10-21 ๅฏนๅบ” space.py ไปฃ็  ๆŽงๅˆถ ็ฉบ้—ดๅˆ†ๆž ็š„ sql ่ฏญๅฅ ''' from . import mysql conn_mysql=mysql.MySQL(); import datetime #=====================ใ€ SQL ่ฏญ ๅฅ ๆŸฅ ่ฏข ใ€‘================================== def time_sql(sql_date1,sql_date2,sql_ctry_prov_cty,tradeNo_list,space_name,aspect_name,dateChoose,aspect): print("\n ๆ—ถ้—ด๏ผš",sql_date1,"-",sql_date2,"\n","้’ข็ง๏ผš",tradeNo_list,"\n","ๅœฐ็‚น๏ผš",space_name,"\n","ๅˆ†ๆžๅ†…ๅฎน๏ผš",aspect_name,"\n") sql_date1 = datetime.datetime.strptime(sql_date1, '%Y%m%d') sql_date2 = datetime.datetime.strptime(sql_date2, '%Y%m%d') xDay = (sql_date2 - sql_date1).days #print (xDay) aDay = datetime.timedelta(days=1) #print (aDay) i = 0 time_dict = {} # time_dict_day = {} # time_dict_allDay = {} rtn_sum_dict = {} weight_sum_dict ={} passOrNot = 0 tradeNo_rtn_reason_print = [] while i <= xDay: #ๆฏๆฌกๅฐ†ๆ—ฅๆœŸๆ›ดๆ–ฐไธบๅŽไธ€ๅคฉ if i == 0: sql_date = sql_date1.strftime('%Y%m%d') #print (sql_date1.strftime('%Y%m%d')) i += 1 else: sql_date = datetime.datetime.strptime(sql_date, '%Y%m%d') + aDay #print (sql_date.strftime('%Y%m%d')) sql_date = sql_date.strftime('%Y%m%d') #ๆ ผๅผ่ฝฌๆข i += 1 if dateChoose == 1: #่ฎขๅ•ๆ—ถ้—ด #่ฎขๅ•ๆ—ถ้—ดใ€ๆ€ป้”€้‡ sql_wgt = "select c.tradeNo,sum(c.orderWeight) from data_import_sales_orderno a,data_import_sales_custplace b,data_import_sales2_orderno_orderitem c where a.orderDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.custNo = b.custNo and c.orderNo = a.orderNo group by c.tradeNo" #print (sql_wgt) #่ฎขๅ•ๆ—ถ้—ดใ€ๆ€ป้”€ๅ”ฎ้ข sql_amt = "select c.tradeNo,sum(c.orderWeight * c.basePrice) from data_import_sales_orderno a,data_import_sales_custplace b,data_import_sales2_orderno_orderitem c where a.orderDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.custNo = b.custNo and c.orderNo = a.orderNo group by c.tradeNo" #่ฎขๅ•ๆ—ถ้—ดใ€ๆ€ป้€€่ดง็އใ€่ดจ้‡้—ฎ้ข˜ไธชๆ•ฐ elif dateChoose == 2: #ๅ‘่ดงๆ—ถ้—ด ใ€ๅพˆๆ…ขใ€‘๏ผŒๅนณๅ‡ๆŸฅ่ฏขๆ—ถ้—ดไธบ10sๅทฆๅณ๏ผŒๆŸฅ่ฏขๆœฌ่บซๅฐฑๅพˆๆ…ข #ๅ‘่ดงๆ—ถ้—ดใ€ๆ€ป้”€้‡ sql_wgt = "select d.tradeNo,sum(a.realDeliWgt) from data_import_sales_displistno a,data_import_sales_orderno b,data_import_sales_custplace c,data_import_sales2_orderno_orderitem d where a.createDate1 = " + sql_date + " and a.orderNo = b.orderNo and c." + sql_ctry_prov_cty + " = '" + space_name + "' and b.custNo = c.custNo and d.orderNo = a.orderNo and d.orderItem = a.orderItem group by d.tradeNo" #ๅ‘่ดงๆ—ถ้—ดใ€ๆ€ป้”€ๅ”ฎ้ข sql_amt = "select d.tradeNo,sum(a.prodAmt) from data_import_sales_displistno a,data_import_sales_orderno b,data_import_sales_custplace c,data_import_sales2_orderno_orderitem d where a.createDate1 = " + sql_date + " and a.orderNo = b.orderNo and c." + sql_ctry_prov_cty + " = '" + space_name + "' and b.custNo = c.custNo and d.orderNo = a.orderNo and d.orderItem = a.orderItem group by d.tradeNo" elif dateChoose == 3: #ๆดพ่ฝฆๅฑฅ่ฟๆ—ถ้—ด(ๅ‡บ่ดง้”€่ดฆๆ—ฅๆœŸ) #ๆดพ่ฝฆๅฑฅ่ฟๆ—ถ้—ดใ€ๆ€ป้”€้‡ sql_wgt = "select a.tradeNo,sum(a.realWgt) from data_import_sales_loadno a,data_import_sales_custplace b where a.shipDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.custNo = b.custNo group by a.tradeNo" #ๆดพ่ฝฆๅฑฅ่ฟๆ—ถ้—ดใ€ๆ€ป้”€ๅ”ฎ้ข sql_amt = "select a.tradeNo,sum(a.realWgt * a.unitPrice) from data_import_sales_loadno a,data_import_sales_custplace b where a.shipDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.custNo = b.custNo group by a.tradeNo" elif dateChoose == 4: #ๆดพ่ฝฆๅฑฅ่ฟๆ—ถ้—ด(็ป“็ฎ—ๆ—ถ้—ด) #ๆดพ่ฝฆๅฑฅ่ฟๆ—ถ้—ดใ€ๆ€ป้”€้‡ sql_wgt = "select a.tradeNo,sum(a.realWgt) from data_import_sales_loadno a,data_import_sales_custplace b where a.settleDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.custNo = b.custNo group by a.tradeNo" #ๆดพ่ฝฆๅฑฅ่ฟๆ—ถ้—ดใ€ๆ€ป้”€ๅ”ฎ้ข sql_amt = "select a.tradeNo,sum(a.realWgt * a.unitPrice) from data_import_sales_loadno a,data_import_sales_custplace b where a.settleDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.custNo = b.custNo group by a.tradeNo" elif dateChoose == 5: #่ฃ…่ฝฆ้€š็Ÿฅๆ—ถ้—ด #่ฃ…่ฝฆ้€š็Ÿฅๆ—ถ้—ดใ€ๆ€ป้”€้‡ sql_wgt = "select c.tradeNo,sum(c.realWgt) from data_import_sales_collectno a,data_import_sales_custplace b,data_import_sales_loadno c where a.effectDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and c.custNo = b.custNo and a.collectNo = c.collectNo group by c.tradeNo" #่ฃ…่ฝฆ้€š็Ÿฅๆ—ถ้—ดใ€ๆ€ป้”€ๅ”ฎ้ข sql_amt = "select c.tradeNo,sum(c.realWgt * c.unitPrice) from data_import_sales_collectno a,data_import_sales_custplace b,data_import_sales_loadno c where a.effectDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and c.custNo = b.custNo and a.collectNo = c.collectNo group by c.tradeNo" elif dateChoose == 6: #่ฎขๅ•ๅญ˜่ดงๆกฃๅปบ็ซ‹ๆ—ถ้—ด ######## ๆ•ฐๆฎๅฏผ็š„ไธๅ…จ๏ผŒ้œ€่ฆ้‡ๆ–ฐๅฏผ่ฟ™ไธช่กจ #่ฎขๅ•ๅญ˜่ดงๆกฃๅปบ็ซ‹ๆ—ถ้—ดใ€ๆ€ป้”€้‡ sql_wgt = "select a.tradeNo,sum(a.labelWgt) from data_import_sales_labelno a,data_import_sales_custplace b,data_import_sales2_orderno_orderitem c where a.createDate121 = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.orderNo = c.orderNo and a.orderItem = c.orderItem and a.customerNo = b.custNo group by a.tradeNo" #่ฎขๅ•ๅญ˜่ดงๆกฃๅปบ็ซ‹ๆ—ถ้—ดใ€ๆ€ป้”€ๅ”ฎ้ข sql_amt = "select a.tradeNo,sum(a.labelWgt * c.basePrice) from data_import_sales_labelno a,data_import_sales_custplace b,data_import_sales2_orderno_orderitem c where a.createDate121 = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.orderNo = c.orderNo and a.orderItem = c.orderItem and a.customerNo = b.custNo group by a.tradeNo" elif dateChoose == 7: #่ดจไฟไนฆๆ—ถ้—ด #่ดจไฟไนฆๆ—ถ้—ดใ€ๆ€ป้”€้‡ sql_wgt = "select a.tradeNo,sum(c.orderWeight) from data_import_sales_millsheetno a,data_import_sales_custplace b,data_import_sales2_orderno_orderitem c where a.reviseDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.customerNo = b.custNo and c.orderNo = a.orderNo and a.item = c.orderItem group by a.tradeNo" #่ดจไฟไนฆๆ—ถ้—ดใ€ๆ€ป้”€ๅ”ฎ้ข sql_amt = "select a.tradeNo,sum(c.orderWeight * c.basePrice) from data_import_sales_millsheetno a,data_import_sales_custplace b,data_import_sales2_orderno_orderitem c where a.reviseDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.customerNo = b.custNo and c.orderNo = a.orderNo and a.item = c.orderItem group by a.tradeNo" else: #ๅค–ๅบ“ๆŽฅๆ”ถๆ—ถ้—ด ######### ๆžๆธ…ๆฅš ๅค–ๅบ“ๆŽฅๆ”ถ ไธŽ ๆดพ่ฝฆๅฑฅ่ฟ ็š„ๅ…ณ็ณป๏ผŒไป–ไปฌๆ˜ฏไบ’ๆ–ฅๅ…ณ็ณป๏ผŒ็Žฐๅœจ้œ€่ฆ้‡ๆ–ฐๅฏผlabelno่กจ๏ผŒไปฅไฝฟๅพ—ๆญคๆ—ถ้—ดๅฏไปฅๅพ—ๅ‡บ็ป“ๆžœ #ๅค–ๅบ“ๆŽฅๆ”ถๆ—ถ้—ดใ€ๆ€ป้”€้‡ sql_wgt = "select c.tradeNo,sum(a.receiveWgt) from data_import_sales_receiveno a,data_import_sales_custplace b,data_import_sales_loadno c where a.updateDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and c.custNo = b.custNo and a.loadNo = c.loadNo group by c.tradeNo" #ๅค–ๅบ“ๆŽฅๆ”ถๆ—ถ้—ดใ€ๆ€ป้”€ๅ”ฎ้ข sql_amt = "select c.tradeNo,sum(a.receiveWgt * c.unitPrice) from data_import_sales_receiveno a,data_import_sales_custplace b,data_import_sales_loadno c where a.updateDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and c.custNo = b.custNo and a.loadNo = c.loadNo group by c.tradeNo" #ๆ€ป้€€่ดง็އใ€่ดจ้‡้—ฎ้ข˜ไธชๆ•ฐ ไธๅˆ†ๆ—ถ้—ด sql_rtn = "select a.tradeNo,sum(a.rtnWgt) from data_import_sales_rtnno a,data_import_sales_custplace b where a.createDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.custNo = b.custNo group by a.tradeNo" sql_rtn_reason = "select a.rtnNo,a.orderNo,a.custNo,a.tradeNo,a.rtnWgt,a.unitPrice,a.rtnReason from data_import_sales_rtnno a,data_import_sales_custplace b where a.createDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.custNo = b.custNo" sql_rtn_reason_count = "select a.tradeNo,a.orderNo,a.orderItem,a.rtnReason from data_import_sales_rtnno a,data_import_sales_custplace b where a.createDate = " + sql_date + " and b." + sql_ctry_prov_cty + " = '" + space_name + "' and a.custNo = b.custNo group by a.orderNo,a.orderItem,a.rtnReason" #=====================ใ€ ๆฑ‚ ๅ’Œ ๅญ˜ ๅ…ฅ ๅญ— ๅ…ธ ใ€‘================================== if aspect == 1 : tradeNo_wgt_list = conn_mysql.select(sql_wgt) weight_sum = 0 for tradeNo in tradeNo_list: #ๆ‰€้€‰้’ข็ง for tradeNo_wgt in tradeNo_wgt_list: if tradeNo_wgt[0] == tradeNo: #ๅฆ‚ๆžœ่ฎขๅ•ไธญๆœ‰่ฟ™ไธช้’ข็ง weight_sum += tradeNo_wgt[1] #้‡้‡ๆฑ‚ๅ’Œ else: pass #print ("ๆ€ป้”€้‡๏ผš\t",sql_date,weight_sum) #print ("\n") time_dict[sql_date] = weight_sum elif aspect == 2: tradeNo_amt_list = conn_mysql.select(sql_amt) amount_sum = 0 for tradeNo in tradeNo_list: #ๆ‰€้€‰้’ข็ง for tradeNo_amt in tradeNo_amt_list: if tradeNo_amt[0] == tradeNo: #ๅฆ‚ๆžœ่ฎขๅ•ไธญๆœ‰่ฟ™ไธช้’ข็ง amount_sum += tradeNo_amt[1] #้‡้‡ๆฑ‚ๅ’Œ else: pass #print ("ๆ€ป้”€ๅ”ฎ้ข๏ผš\t",sql_date,amount_sum) #print ("\n") time_dict[sql_date] = amount_sum elif aspect == 3: #ๆ€ป้”€้‡ tradeNo_wgt_list = conn_mysql.select(sql_wgt) weight_sum = 0 for tradeNo in tradeNo_list: #ๆ‰€้€‰้’ข็ง for tradeNo_wgt in tradeNo_wgt_list: if tradeNo_wgt[0] == tradeNo: #ๅฆ‚ๆžœ่ฎขๅ•ไธญๆœ‰่ฟ™ไธช้’ข็ง weight_sum += tradeNo_wgt[1] #้‡้‡ๆฑ‚ๅ’Œ else: pass #ๆฑ‚ๆ€ป้€€่ดง tradeNo_rtn_list = conn_mysql.select(sql_rtn) rtn_sum = 0 rtn_rate = 0 for tradeNo in tradeNo_list: #ๆ‰€้€‰้’ข็ง for tradeNo_rtn in tradeNo_rtn_list: if tradeNo_rtn[0] == tradeNo: #ๅฆ‚ๆžœ่ฎขๅ•ไธญๆœ‰่ฟ™ไธช้’ข็ง rtn_sum += tradeNo_rtn[1] #้‡้‡ๆฑ‚ๅ’Œ else: pass if weight_sum != 0: rtn_rate = ( rtn_sum / weight_sum ) * 100 rtn_rate = float(str(rtn_rate)[0:8]) # print ("ๆ€ป้€€่ดง็އ๏ผš\t%s%.5f" % (sql_date,rtn_rate),"%") else: # print ("ๆ€ป้€€่ดง็އ๏ผš\tๆ€ป้”€้‡ไธบ0๏ผŒๆ— ๆณ•่ฎก็ฎ—้€€่ดง็އ๏ผ") rtn_rate = "ๆ€ป้”€้‡ไธบ0๏ผŒๆ— ๆณ•่ฎก็ฎ—้€€่ดง็އ๏ผ" #tradeNo_rtn_rsn_list = conn_mysql.select(sql_rtn_reason) #print ("้€€่ดงๅŽŸๅ› ๏ผš\t",tradeNo_rtn_rsn_list) #print ("\n") time_dict[sql_date] = rtn_rate #ๆฏๆ—ฅ็š„้€€่ดง้‡้‡ไธŽๆ€ป้‡้‡็š„็ป“ๆžœๅญ˜ๅ‚จ่ตทๆฅ rtn_sum_dict[sql_date] = rtn_sum #ๆฏๆ—ฅ้€€่ดง้‡้‡ weight_sum_dict[sql_date] = weight_sum #ๆฏๆ—ฅๆ€ป้”€้‡ # #ๆฏๆ—ฅ็ป“ๆžœๅญ˜ๅ‚จ่ตทๆฅ # time_dict_day['rtn_rate'] = rtn_rate # time_dict_day['rtn_sum'] = rtn_sum # time_dict_day['weight_sum'] = weight_sum # #ๅฐ†ๆฏๆ—ฅ็ป“ๆžœๅญ˜ๅˆฐไธ€ไธชๅคงๅญ—ๅ…ธไธญ # time_dict_allDay[sql_date] = time_dict_day else: count = 0 tradeNo_rtn_reason_count_list = conn_mysql.select(sql_rtn_reason_count) for tradeNo in tradeNo_list: for tradeNo_rtn_count_reason in tradeNo_rtn_reason_count_list: if tradeNo == tradeNo_rtn_count_reason[0]: count = count + 1 #print ("่ดจ้‡้—ฎ้ข˜ไธชๆ•ฐ๏ผš",sql_date,count) time_dict[sql_date] = count if aspect == 3 or aspect == 4: tradeNo_rtn_reason_list = conn_mysql.select(sql_rtn_reason) #print (tradeNo_rtn_reason_list) for tradeNo in tradeNo_list: #ๆ‰€้€‰้’ข็ง for tradeNo_rtn_reason in tradeNo_rtn_reason_list: if tradeNo_rtn_reason[3] == tradeNo: tradeNo_rtn_reason_print.append(tradeNo_rtn_reason) #print ("่ดจ้‡้—ฎ้ข˜ๅŽŸๅ› ",tradeNo_rtn_reason_print) else: pass if len(tradeNo_rtn_reason_print) == 0: passOrNot = 1 else: pass #print (tradeNo_rtn_reason_print) #print (passOrNot) #ๅฆ‚ๆžœๆ˜ฏ้€€่ดง็އ็š„่ฏ๏ผŒ้œ€่ฆๅญ˜ๅ‚จๆฏๆ—ฅ็š„้€€่ดง้‡ไธŽๆ€ป้”€้‡๏ผŒไปฅไฟ่ฏๅŽ็ปญ่ฎก็ฎ—็ป“ๆžœๆญฃ็กฎ if aspect == 3: time_dict_rtn = {} #ๅฐ†ๅ…จ้ƒจ็ป“ๆžœๅญ˜ๅ‚จๅˆฐๅŒไธ€ไธชdictionaryไธญ time_dict_rtn['time_dict'] = time_dict #ๆœ€ๅŽŸๅง‹ๅพ—ๅˆฐ็š„้€€่ดง็އ time_dict_rtn['rtn_sum_dict'] = rtn_sum_dict #้€€่ดง้‡้‡ time_dict_rtn['weight_sum_dict'] = weight_sum_dict #ๆ€ป้”€้‡ #print (time_dict_rtn) return time_dict_rtn,passOrNot,tradeNo_rtn_reason_print else: return time_dict,passOrNot,tradeNo_rtn_reason_print #return sql_wgt,sql_amt,sql_rtn,sql_rtn_reason,sql_rtn_reason_count
[ "787666673@qq.com" ]
787666673@qq.com
e8a8f4d0229e4d340b624c0df984722ccbca9816
f62e0baeb105997af682c3d22384c99545ccdf15
/python_projects/love_calculator.py
45902f9ca7c3f7dc3d3ec4ada80c7fcd1d3b6282
[]
no_license
Brad-ONeill/Website
88d85a4299aef79bc0fbc926295703c37d1473e9
64e3314b9a1851fdeb705b798573b6c670af8385
refs/heads/master
2023-04-29T13:20:38.470382
2023-04-18T20:32:25
2023-04-18T20:32:25
184,084,912
0
0
null
null
null
null
UTF-8
Python
false
false
742
py
print("Welcome to the Love Calculator!") name1 = input("What is your name? \n") name2 = input("What is their name? \n") combined_string = name1 + name2 names = combined_string.lower() t = names.count("t") r = names.count("r") u = names.count("u") e = names.count("e") true = t + r + u + e l = names.count("l") o = names.count("o") v = names.count("v") e = names.count("e") love = l + o + v + e score = int(str(true) + str(love)) if score > 90: print(f"Your score is {score}, you go together pretty well.") elif score >= 40 and score <= 50: print(f"Your score is {score}, you are alright together.") elif score <= 10: print(f"your score is {score}, maybe reconsider your options") else: print(f"Your score is {score}.")
[ "49478841+Brad-ONeill@users.noreply.github.com" ]
49478841+Brad-ONeill@users.noreply.github.com
58950f55ea5a2b7fae6b323bfc181434c02aaaee
305d25e1d2084761e889057077706b1ba3f9122d
/nmigen_boards/arty_z7.py
ba432b642cc9588c44c7e5037b12b600668f5a6b
[ "LicenseRef-scancode-unknown-license-reference", "BSD-2-Clause" ]
permissive
nicolas-robin/nmigen-boards
d7d8fe29d788f8b1fdcf8da0cf7202a1f0fa741a
6fc91b491214b80c56b2b2d031da1a50c7254c56
refs/heads/master
2020-12-10T15:43:43.358008
2020-01-17T21:54:48
2020-01-17T21:54:48
233,314,458
0
0
NOASSERTION
2020-01-12T00:01:57
2020-01-12T00:01:57
null
UTF-8
Python
false
false
5,359
py
import os import subprocess from nmigen.build import * from nmigen.vendor.xilinx_7series import * from .resources import * __all__ = ["ArtyZ720Platform"] class ArtyZ720Platform(Xilinx7SeriesPlatform): device = "xc7z020" package = "clg400" speed = "1" default_clk = "clk125" resources = [ Resource("clk125", 0, Pins("H16", dir="i"), Clock(125e6), Attrs(IOSTANDARD="LVCMOS33")), *SwitchResources( pins="M20 M19", attrs=Attrs(IOSTANDARD="LVCMOS33")), RGBLEDResource(0, r="N15", g="G17", b="L15", # LD4 attrs=Attrs(IOSTANDARD="LVCMOS33")), RGBLEDResource(1, # LD5 r="M15", g="L14", b="G14", attrs=Attrs(IOSTANDARD="LVCMOS33")), *LEDResources( pins="R14 P14 N16 M14", attrs=Attrs(IOSTANDARD="LVCMOS33")), *ButtonResources( pins="D19 D20 L20 L19", attrs=Attrs(IOSTANDARD="LVCMOS33")), Resource("audio", 0, Subsignal("pwm", Pins("R18", dir="o")), Subsignal("sd", PinsN("T17", dir="o")), Attrs(IOSTANDARD="LVCMOS33")), Resource("crypto_sda", 0, # ATSHA204A Pins("J15", dir="io"), Attrs(IOSTANDARD="LVCMOS33")), Resource("hdmi_rx", 0, # J10 Subsignal("cec", Pins("H17", dir="io")), Subsignal("clk", DiffPairs("N18", "P19", dir="i"), Attrs(IO_TYPE="TMDS_33")), Subsignal("d", DiffPairs("V20 T20 N20", "W20 U20 P20", dir="i"), Attrs(IO_TYPE="TMDS_33")), Subsignal("hpd", Pins("T19", dir="o")), Subsignal("scl", Pins("U14", dir="io")), Subsignal("sda", Pins("U15", dir="io")), Attrs(IOSTANDARD="LVCMOS33")), Resource("hdmi_tx", 0, # J11 Subsignal("cec", Pins("G15", dir="io")), Subsignal("clk", DiffPairs("L16", "L17", dir="o"), Attrs(IO_TYPE="TMDS_33")), Subsignal("d", DiffPairs("K17 K19 J18", "K18 J19 H18", dir="o"), Attrs(IO_TYPE="TMDS_33")), Subsignal("hpd", PinsN("R19", dir="i")), Subsignal("scl", Pins("M17", dir="io")), Subsignal("sda", Pins("M18", dir="io")), Attrs(IOSTANDARD="LVCMOS33")) ] connectors = [ Connector("pmod", 0, "Y18 Y19 Y16 Y17 - - U18 U19 W18 W19 - -"), # JA Connector("pmod", 1, "Y14 W14 T10 T11 - - W16 V16 W13 V12 - -"), # JB Connector("ck_io", 0, { # Outer Digital Header "io0": "T14", "io1": "U12", "io2": "U13", "io3": "V13", "io4": "V15", "io5": "T15", "io6": "R16", "io7": "U17", "io8": "V17", "io9": "V18", "io10": "T16", "io11": "R17", "io12": "P18", "io13": "N17", # Inner Digital Header "io26": "U5", "io27": "V5", "io28": "V6", "io29": "U7", "io30": "V7", "io31": "U8", "io32": "V8", "io33": "V10", "io34": "W10", "io35": "W6", "io36": "Y6", "io37": "Y7", "io38": "W8", "io39": "Y8", "io40": "W9", "io41": "Y9", # Outer Analog Header as Digital IO "a0": "Y11", "a1": "Y12", "a2": "W11", "a3": "V11", "a4": "T5", "a5": "U10", # Inner Analog Header as Digital IO "a6": "F19", "a7": "F20", "a8": "C20", "a9": "B20", "a10": "B19", "a11": "A20", # Misc. "a": "Y13" }), Connector("ck_spi", 0, { "miso": "W15", "mosi": "T12", "sck": "H15", "ss": "F16" }), Connector("ck_i2c", 0, { "scl": "P16", "sda": "P15" }), Connector("xadc", 0, { # Outer Analog Header "vaux1_n": "D18", "vaux1_p": "E17", "vaux9_n": "E19", "vaux9_p": "E18", "vaux6_n": "J14", "vaux6_p": "K14", "vaux15_n": "J16", "vaux15_p": "K16", "vaux5_n": "H20", "vaux5_p": "J20", "vaux13_n": "G20", "vaux13_p": "G19", # Inner Analog Header "vaux12_n": "F20", "vaux12_p": "F19", "vaux0_n": "B20", "vaux0_p": "C20", "vaux8_n": "A20", "vaux8_p": "B19" }) ] def toolchain_program(self, products, name, **kwargs): xc3sprog = os.environ.get("XC3SPROG", "xc3sprog") with products.extract("{}.bit".format(name)) as bitstream_filename: subprocess.run([xc3sprog, "-c", "jtaghs1_fast", "-p", "1", bitstream_filename], check=True) if __name__ == "__main__": from .test.blinky import * ArtyZ720Platform().build(Blinky(), do_program=True)
[ "whitequark@whitequark.org" ]
whitequark@whitequark.org
ce3577da94f38a365616e8374df42eec5835d6cf
48c038e381aa0e276ee08d7bd93479522597b561
/JiewuOnline/settings.py
86ee150b1e68be4da612b060ff05ddfbb0e969a8
[]
no_license
niuniu20160626/JiewuOnline
263afbbbb98225264e387fd77e4b12d429377101
51fa260df654a8e59cf694fc1c8b095b217093a0
refs/heads/master
2023-05-04T22:15:41.962693
2021-05-30T07:56:44
2021-05-30T07:56:44
341,800,004
0
0
null
null
null
null
UTF-8
Python
false
false
4,704
py
""" Django settings for JiewuOnline project. Generated by 'django-admin startproject' using Django 3.0.3. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '1gn76s3&unjga7ma21luh@)vtvi(aty(xmeji31xt$9fu)n6op' # 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', 'apps.courses.apps.CoursesConfig', 'apps.users.apps.UsersConfig', 'apps.organizations.apps.OrganizationsConfig', 'apps.operations.apps.OperationsConfig', 'xadmin.apps.XAdminConfig', 'crispy_forms', 'DjangoUeditor', 'captcha', 'pure_pagination', 'import_export', ] 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 = 'JiewuOnline.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'django.template.context_processors.media', 'apps.users.views.message_nums', ], }, }, ] WSGI_APPLICATION = 'JiewuOnline.wsgi.application' # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'HOST': '127.0.0.1', 'PORT': '3306', 'NAME': 'jiewuonlinedb', 'USER': 'root', 'PASSWORD': 'wenjian52', 'OPTIONS': { 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", "init_command": "SET foreign_key_checks = 0;", }, } } # Password validation # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] AUTH_USER_MODEL = "users.UserProfile" # Internationalization # https://docs.djangoproject.com/en/3.0/topics/i18n/ LANGUAGE_CODE = 'zh-hans' TIME_ZONE = 'Asia/Calcutta' USE_I18N = True USE_L10N = True USE_TZ = False # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.0/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static') ] # media files (JPG, mp4็ญ‰็ญ‰) MEDIA_URL = "/media/" MEDIA_ROOT = os.path.join(BASE_DIR, 'media') #STATIC_ROOT = os.path.join(BASE_DIR, 'static') yp_apikey = "0c86ece8d860b75c40b1ed204cb29e63" #code_dict = { # "mobile":"code" #} #redis ้…็ฝฎ REDIS_HOST = "127.0.0.1" REDIS_PORT = 6379 #1.ๅฆ‚ๆžœ้‡ๅฏdjango๏ผŒๅ˜้‡ไธๅญ˜ๅœจ #2.้š็€้ชŒ่ฏ่ถŠๆฅ่ถŠๅคš๏ผŒๅ†…ๅญ˜ๅ ็”จ่ถŠๆฅ่ถŠๅคง #3.ไฝฟ็”จredis k๏ผŒvๅญ˜ๅ‚จ #Linux ๆˆ–macไธ‹้ขๅฎ‰่ฃ… redis #sudo apt-get install redis-server #sudo apt-get install redis-cli #windows ๅฎ‰่ฃ… #ๅœจgithubไธญไธ‹่ฝฝ๏ผŒๅฎ‰่ฃ… #็ผ–ๅ†™view็š„ๆญฅ้ชค #1.viewไปฃ็  #2.้…็ฝฎurl #3.ไฟฎๆ”นhtml็•Œ้ขไธญ็›ธๅ…ณๅœฐๅ€ #ๅˆ†้กต็›ธๅ…ณ่ฎพ็ฝฎ PAGINATION_SETTINGS = { 'PAGE_RANGE_DISPLAYED': 6, 'MARGIN_PAGES_DISPLAYED': 2, 'SHOW_FIRST_PAGE_WHEN_INVALID': True, }
[ "1714885031@qq.com" ]
1714885031@qq.com
b03da968a1665b5afb8ffa3fc0d43782537fb80b
8669dde5ed094cc597b2d7e1768cfba94a432d50
/lib_sarscov2.py
3a27c1f5bda74eb200cdbbffc90215511b2337f4
[ "MIT" ]
permissive
Campeanu/COVID-19
22bc69a81b24cbed5afe75db715f316fb5f6494e
ee2442b24e30406d57646e6387ca7a970f9cd162
refs/heads/master
2021-05-26T22:07:35.435709
2020-04-09T09:51:08
2020-04-09T09:51:08
254,173,432
0
0
null
null
null
null
UTF-8
Python
false
false
1,310
py
# Asn or Asp / B AAU, AAC; GAU, GAC # Gln or Glu / Z CAA, CAG; GAA, GAG # START AUG translation_table = """Ala / A GCU, GCC, GCA, GCG Ile / I AUU, AUC, AUA Arg / R CGU, CGC, CGA, CGG; AGA, AGG Leu / L CUU, CUC, CUA, CUG; UUA, UUG Asn / N AAU, AAC Lys / K AAA, AAG Asp / D GAU, GAC Met / M AUG Phe / F UUU, UUC Cys / C UGU, UGC Pro / P CCU, CCC, CCA, CCG Gln / Q CAA, CAG Ser / S UCU, UCC, UCA, UCG; AGU, AGC Glu / E GAA, GAG Thr / T ACU, ACC, ACA, ACG Trp / W UGG Gly / G GGU, GGC, GGA, GGG Tyr / Y UAU, UAC His / H CAU, CAC Val / V GUU, GUC, GUA, GUG STOP UAA, UGA, UAG """.strip() dec = {} for t in translation_table.split("\n"): k = t[:len("Val / V") ].strip() v = t[ len("Val / V"):] if '/' in k: k = k.split("/")[-1].strip() k = k.replace("STOP", "*") v = v.replace(",", "").replace(";", "").lower().replace("u", "t").split(" ") for vv in v: if vv in dec: print("dup", vv) dec[vv.strip()] = k # !!!! def translate(x, protein=False): x = x.lower() aa = [] for i in range(0, len(x)-2, 3): aa.append(dec[x[i:i+3]]) aa = ''.join(aa) if protein: if aa[0] != "M" or aa[-1] != "*": print("BAD PROTEIN") print(aa) return None aa = aa[:-1] return aa.split("*") # !!!
[ "campeanu.it@yahoo.com" ]
campeanu.it@yahoo.com
c5c7c9fa51eaaec171b3b32e2cb18f6d63866966
8a82a83655f118208692e55d7804d9fa480ad4b6
/book/apress/Beginning.Python.Visualization.Crafting.Visual.Transformation.Scripts/Chapter04/src/read_ini.py
bf4374d1f2c6de9b410eea7d36a061bd6b2c38a7
[]
no_license
xenron/sandbox-da-python
0814159da9a91923e4b66c5e40057e381f765e96
ab8f1c0d57fdc6006355f613012b84165068c315
refs/heads/master
2020-04-12T05:41:33.182110
2016-12-14T22:57:33
2016-12-14T22:57:33
60,324,979
5
2
null
null
null
null
UTF-8
Python
false
false
292
py
# read an INI (config) file import ConfigParser read_opts=ConfigParser.ConfigParser() read_opts.read('../data/options.ini') # print parameters and values for section in read_opts.sections(): print "[%s]" % section for param in read_opts.items(section): print param
[ "xenron@outlook.com" ]
xenron@outlook.com
d054580c3aeb4fc7763d77e069fc957b1ef93a28
60ea9e854d224a1c0034c8ef85ef2736eb38c1a6
/bayes/debug.py
5350506b44683984914efabba23a8959fe3dba42
[]
no_license
SunnyWiki/PY-bayesian
f926d500d47470e6899620da3cae0668b230efb7
5007f40ec7035e9670ec2f8f649d8d3d4f009e6c
refs/heads/master
2021-01-22T23:48:19.141358
2017-03-22T06:58:46
2017-03-22T06:58:46
85,670,643
0
0
null
null
null
null
UTF-8
Python
false
false
5,164
py
#-*- coding: UTF-8 -*- import os import jieba import numpy as np from sklearn.naive_bayes import MultinomialNB # from sklearn import datasets # iris = datasets.load_iris() # from sklearn.naive_bayes import GaussianNB # gnb = GaussianNB() # y_pred = gnb.fit(iris.data, iris.target).predict(iris.data) # print("Number of mislabeled points out of a total %d points : %d"% (iris.data.shape[0],(iris.target != y_pred).sum())) trainPath = "/opt/app/highlevel/training/data/TRAIN" testPath = "/opt/app/highlevel/training/data/TEST" stopwordsPath = "/home/hldev/Work/PYproject/bayes/stopwords.txt" categoryDir = os.listdir(trainPath) testCatDir = os.listdir(testPath) vocab_set = set([]) vocab_list = [] stopwords_list = [] stopwords_set = set([]) stopwords_raw = [line.strip() for line in open(stopwordsPath).readlines()] for s in stopwords_raw: stopwords_list.append(s.decode('gbk')) stopwords_set = set(stopwords_list) for cat in categoryDir: if cat == "่ดŸ้ข": negativePaths = os.listdir(trainPath + "/" + cat) if cat == "ๆญฃ้ข": positivePaths = os.listdir(trainPath + "/" + cat) for text in negativePaths: f = open(trainPath + "/่ดŸ้ข/" + text, "r") try: content = f.read() words_list = jieba.cut(content) print(", ".join(words_list)) for word in words_list: if word not in stopwords_set: vocab_set.add(word) finally: f.close() for text in positivePaths: f = open(trainPath + "/ๆญฃ้ข/" + text, "r") try: content = f.read() words_list = jieba.cut(content) for word in words_list: if word not in stopwords_set: vocab_set.add(word) finally: f.close() vocab_list = list(vocab_set) train_vector = [] trainTarget_vector = [] for text in negativePaths: content_vector = [0] * len(vocab_list) f = open(trainPath + "/่ดŸ้ข/" + text, "r") try: content = f.read() words_list = jieba.cut(content) for word in words_list: if word in vocab_list: content_vector[vocab_list.index(word)] = content_vector[vocab_list.index(word)] + 1 train_vector.append(content_vector) trainTarget_vector.append(int(0)) finally: f.close() for text in positivePaths: content_vector = [0] * len(vocab_list) f = open(trainPath + "/ๆญฃ้ข/" + text, "r") try: content = f.read() words_list = jieba.cut(content) for word in words_list: if word in vocab_list: content_vector[vocab_list.index(word)] = content_vector[vocab_list.index(word)] + 1 train_vector.append(content_vector) trainTarget_vector.append(int(1)) finally: f.close() test_vector = [] testTarget_vector = [] for cat in testCatDir: if cat == "่ดŸ้ข": t_negativePaths = os.listdir(testPath + "/" + cat) if cat == "ๆญฃ้ข": t_positivePaths = os.listdir(testPath + "/" + cat) for text in t_negativePaths: content_vector = [0] * len(vocab_list) f = open(testPath + "/่ดŸ้ข/" + text, "r") try: content = f.read() words_list = jieba.cut(content) print(", ".join(words_list)) for word in words_list: if word in vocab_list: content_vector[vocab_list.index(word)] = content_vector[vocab_list.index(word)] + 1 test_vector.append(content_vector) testTarget_vector.append(int(0)) finally: f.close() for text in t_positivePaths: content_vector = [0] * len(vocab_list) f = open(testPath + "/ๆญฃ้ข/" + text, "r") try: content = f.read() words_list = jieba.cut(content) for word in words_list: if word in vocab_list: content_vector[vocab_list.index(word)] = content_vector[vocab_list.index(word)] + 1 test_vector.append(content_vector) testTarget_vector.append(int(1)) finally: f.close() train_vector = np.array(train_vector) trainTarget_vector = np.array(trainTarget_vector) test_vector = np.array(test_vector) testTarget_vector = np.array(testTarget_vector) clf = MultinomialNB().fit(train_vector, trainTarget_vector) bayesian_predict = clf.predict(test_vector) wrongNumber = (testTarget_vector != bayesian_predict).sum() rightRate = 1 - (float(wrongNumber) / test_vector.shape[0]) conditional_prob = clf.__dict__.get("feature_log_prob_") prior_prob = clf.__dict__.get("class_log_prior_") negativeCp_list = list(conditional_prob[0]) positiveCp_list = list(conditional_prob[1]) negativePrior = prior_prob[0] positivePrior = prior_prob[1] negativeKeywords_list = [] positiveKeywords_list = [] for i in range(len(vocab_list)): negativeKeywords_list.append((vocab_list[i], negativeCp_list[i])) positiveKeywords_list.append((vocab_list[i], positiveCp_list[i])) negativeKeywords_list = sorted(negativeKeywords_list, key=lambda pair: pair[1], reverse=True) positiveKeywords_list = sorted(positiveKeywords_list, key=lambda pair: pair[1], reverse=True) print("Right rate out of a total %d is : %f" % (test_vector.shape[0], rightRate))
[ "1935508351@qq.com" ]
1935508351@qq.com
883d9dc211bbc3f3eed188ffcb37ceb8e89ab2b4
60bd2e1cce82fc831f029def9c507e3cde2e2bc5
/Vezba1/Zadatak8.py
e7ce8940ccffc4bd9c19caada5705e991ea4f42b
[]
no_license
AndjelaStevanovic/GIS_programiranje_domaci
427b2910b848d1404f31dd050b693f539fca971f
bcff3a6d9df0388a049920ed6f74181580f4fc16
refs/heads/master
2021-05-13T11:44:34.004144
2018-01-11T18:31:21
2018-01-11T18:31:21
117,137,457
0
0
null
null
null
null
UTF-8
Python
false
false
760
py
#Zadatak 8 - Vezba 1 # -*- coding: utf-8 -*- import random broj_pogadjanja = 0 print('Zdravo! Kako se zoves?') ime = raw_input() broj = random.randint(0, 100) while broj_pogadjanja < 10: print('Uneti broj:') pogadjanje = input() pogadjanje = int(pogadjanje) broj_pogadjanja = broj_pogadjanja + 1 if pogadjanje < broj: print('Uneti broj je manji od zamisljenog broj.') if pogadjanje > broj: print('Broj je veci od zamisljenog broja.') if pogadjanje == broj: break if pogadjanje == broj: broj_pogadjanja = str(broj_pogadjanja) print('Bravo, ' + ime + '! Pogodili ste broj iz ' + broj_pogadjanja + ' pokusaja!') if pogadjanje!= broj: broj = str(broj) print('Pogresili ste. Zamisljeni broj je: ' + broj)
[ "andjelastevanovic@ymail.com" ]
andjelastevanovic@ymail.com
1c1c810b779e1a8b626c59a69872d8d026f44862
f153cbfc77cfe4ace1eadf8f1cf4c7d17248c228
/minified.py
07ff2f5d7332a922de6ad9c50ee645e5c16ad32b
[]
no_license
aadityarengarajan/POS-System
1846a84576920bc925da9969fc5e4b074164e330
dbe43d8496aca42a5a5a2af451eb8ff1c0e3b107
refs/heads/main
2023-08-03T08:45:55.439442
2021-03-30T19:19:19
2021-03-30T19:19:19
405,992,069
0
0
null
null
null
null
UTF-8
Python
false
false
15,685
py
from pickle import dump,load from random import random from datetime import datetime as dt from os import listdir if "items.dat" not in listdir(): with open("items.dat","wb"): pass if "sales.dat" not in listdir(): with open("sales.dat","wb"): pass def read_items(): objects = [] with (open("items.dat", "rb")) as openfile: while True: try: objects.append(load(openfile)) except EOFError: break try: return objects[0] except IndexError: return {"items":[]} def write_items(data): with open("items.dat","wb") as f: dump(data,f) return True def read_sales(): objects = [] with (open("sales.dat", "rb")) as openfile: while True: try: objects.append(load(openfile)) except EOFError: break try: return objects[0] except IndexError: return {"sales":[]} def write_sales(data): with open("sales.dat","wb") as f: dump(data,f) return True def add_item(): particular = input("PARTICULAR : ") rate = float(input("RATE (in Rupees) : ")) qt = 0 while qt<=0: qt = float(input("QUANTITY (PCS/UNITS) : ")) if qt<=0: print("QUANTITY MUST BE MORE THAN 0") items = read_items() codes = [] for i in items["items"]: codes.append(int(i["code"])) try: code = (max(codes)+1) except ValueError: code = 1 items["items"].append({"code":code, "particular":particular, "rate":rate, "quantity":qt}) write_items(items) i = {"code":code, "particular":particular, "rate":rate, "quantity":qt} print(f''' ITEM CODE {i["code"]} PARTICULAR : {i["particular"]} RATE : {i["rate"]} CURRENT QUANTITY : {i["quantity"]} ''') print("\n\nNEW ITEM ADDED.") def add_stock(): code = int(input("ITEM CODE : ")) items = read_items() for i in items["items"]: if int(i["code"])==int(code): print(f'''ITEM CODE {i["code"]} PARTICULAR : {i["particular"]} RATE : {i["rate"]} CURRENT QUANTITY : {i["quantity"]} ''') qty = -1 while qty<0: qty = float(input("ENTER ADDITIONAL QUANTITY (PCS/UNITS) : ")) if qty<0: print("QUANTITY MUST BE MORE THAN OR EQUAL TO 0") print("\n"*2) print(f'''ITEM CODE {i["code"]} PARTICULAR : {i["particular"]} RATE : {i["rate"]} CURRENT QUANTITY : {i["quantity"]} NEW QUANTITY : {qty} TOTAL QUANTITY : {i["quantity"]+qty} ''') if input("ARE YOU SURE YOU WOULD LIKE TO AMEND CHANGES? (Y/N [Default : Y]) : ") in "Yy": new_item = ({"code":i["code"], "particular":i["particular"], "rate":i["rate"], "quantity":i["quantity"]+qty}) items["items"].remove(i) items["items"].append(new_item) write_items(items) print("\n\nSTOCK INCREASED.") return True else: print("\n\nSTOCK UNCHANGED.") return True print("\n\nITEM NOT FOUND.") return False def reduce_stock(code,qt): items = read_items() for i in items["items"]: if int(i["code"])==int(code): new_item = ({"code":i["code"], "particular":i["particular"], "rate":i["rate"], "quantity":i["quantity"]-qt}) items["items"].remove(i) items["items"].append(new_item) write_items(items) return True return False def check_exists(code): items = read_items() code_exists = False stock_exists = False stock_pcs = 0 for i in items["items"]: if int(i["code"])==int(code): code_exists = True if int(i["quantity"])>=1: stock_exists = True stock_pcs = int(i["quantity"]) return {"code_exists":code_exists,"stock_exists":stock_exists,"stock_pcs":stock_pcs} def get_item(code): items = read_items() code_exists = False stock_exists = False for i in items["items"]: if int(i["code"])==int(code): return i return False def code_gen(): exists = True while exists == True: code = int(random()*(10**8)) exists = check_exists(code)["code_exists"] return code def bill(): datetime = dt.now().strftime("%d/%m/%y %H:%M:%S") cash_memo = {"date":datetime, "number":code_gen()} purchased_items = [] c = 0 total_amt = 0 while 1: if input("ADD ANOTHER ITEM? (Y/N [Default : Y]) : ") in "Yy": print(''' ADD ITEM ======== ''') item = int(input("CODE : ")) if check_exists(item)["code_exists"] == False: print("Code doesn't exist :(") continue elif check_exists(item)["stock_exists"] == False: print("Item is out of stock :(") continue else: qt = 0 while qt<=0 or int(qt)>int(check_exists(item)["stock_pcs"]): qt = float(input("QUANTITY (PCS/UNITS) : ")) if qt<=0: print("QUANTITY MUST BE MORE THAN 0") if int(qt)>int(check_exists(item)["stock_pcs"]): print(f'THERE ARE ONLY {check_exists(item)["stock_pcs"]} PCS/UNITS IN STOCK. PLEASE ENTER A NUMBER LESSER THAN THE SAME.') c += 1 item = get_item(item) code = item["code"] particular = item["particular"] rate = item["rate"] quantity = qt amount = rate*qt purchased_items.append({"sno":c, "code":code, "particular":particular, "rate":rate, "quantity":quantity, "amount":amount}) total_amt += amount else: break cash_memo.update({"items":purchased_items,"total":total_amt}) print(f''' ================================================================================ Date : {cash_memo["date"]} Cash Memo Number : {cash_memo["number"]} ================================================================================ S. No. Item Code Particular Rate Quantity Amt ''') for i in cash_memo["items"]: print(f"{i['sno']} {i['code']} {i['particular']} Rs. {i['rate']} {i['quantity']} Rs. {i['amount']}") print(f''' ================================================================================ Grand Total Rs. {cash_memo["total"]} ================================================================================''') print("\n"*3) if input("ARE YOU SURE YOU WOULD LIKE TO COMPLETE BILLING? (Y/N [N to Cancel Bill, Default : Y]) : ") in "Yy": for i in cash_memo["items"]: reduce_stock(i["code"],i["quantity"]) current_sales = read_sales() current_sales["sales"].append(cash_memo) write_sales(current_sales) print("\n\nBILLING COMPLETE.") else: print("\n\nBILLING CANCELED.") def cash_memo(): billno = int(input("Enter Cash Memo Number : ")) all_sales = read_sales() for i in all_sales["sales"]: if i["number"] == billno: cash_memo = i print(f''' ================================================================================ Date : {cash_memo["date"]} Cash Memo Number : {cash_memo["number"]} ================================================================================ S. No. Item Code Particular Rate Quantity Amt ''') for j in cash_memo["items"]: print(f"{j['sno']} {j['code']} {j['particular']} Rs. {j['rate']} {j['quantity']} Rs. {j['amount']}") print(f''' ================================================================================ Grand Total Rs. {cash_memo["total"]} ================================================================================''') print("\n"*3) return True print("Cash Memo Not Found. Invalid Number :(") def daily_sales_report(): while 1: try: date = dt.strptime(input("ENTER DATE AS 'DD/MM/YYYY' (WITHOUT QUOTES) : "),"%d/%m/%Y") break except: print("INVALID.") continue all_sales = read_sales() items_list = [] amount = 0 for i in all_sales["sales"]: if dt.strptime(i["date"], "%d/%m/%y %H:%M:%S").strftime("%d/%m/%Y") == date.strftime("%d/%m/%Y"): for x in i["items"]: item_added = False for z in items_list: if z["name"] == x["particular"]: z["amount"] += x["amount"] item_added = True if item_added == False: items_list.append({"name":x["particular"],"amount":x["amount"]}) amount += i["total"] print(f""" ========================================================== DAILY SALES REPORT FOR DAY : {date.strftime("%d/%m/%Y")} ========================================================== LIST OF ITEMS SOLD ==================""") for i in items_list: print(f"{i['name']} - Rs. {i['amount']}") print(f""" ================== TOTAL AMOUNT EARNT : Rs. {amount}""") def monthly_sales_report(): while 1: try: date = dt.strptime(input("ENTER MONTH AS 'MM/YYYY' (WITHOUT QUOTES) : "),"%m/%Y") break except: print("INVALID.") continue all_sales = read_sales() items_list = [] amount = 0 for i in all_sales["sales"]: if dt.strptime(i["date"], "%d/%m/%y %H:%M:%S").strftime("%m/%Y") == date.strftime("%m/%Y"): for x in i["items"]: item_added = False for z in items_list: if z["name"] == x["particular"]: z["amount"] += x["amount"] item_added = True if item_added == False: items_list.append({"name":x["particular"],"amount":x["amount"]}) amount += i["total"] print(f""" ========================================================== MONTHLY SALES REPORT FOR MONTH : {date.strftime("%B, %Y")} ========================================================== LIST OF ITEMS SOLD ==================""") for i in items_list: print(f"{i['name']} : Rs. {i['amount']}") print(f""" ================== TOTAL AMOUNT EARNT : Rs. {amount}""") def yearly_sales_report(): while 1: try: date = dt.strptime(input("ENTER YEAR AS 'YYYY' (WITHOUT QUOTES) : "),"%Y") break except: print("INVALID.") continue all_sales = read_sales() items_list = [] amount = 0 for i in all_sales["sales"]: if dt.strptime(i["date"], "%d/%m/%y %H:%M:%S").strftime("%Y") == date.strftime("%Y"): for x in i["items"]: item_added = False for z in items_list: if z["name"] == x["particular"]: z["amount"] += x["amount"] item_added = True if item_added == False: items_list.append({"name":x["particular"],"amount":x["amount"]}) amount += i["total"] print(f""" ========================================================== MONTHLY SALES REPORT FOR YEAR : {date.strftime("%Y")} ========================================================== LIST OF ITEMS SOLD ==================""") for i in items_list: print(f"{i['name']} : Rs. {i['amount']}") print(f""" ================== TOTAL AMOUNT EARNT : Rs. {amount}""") def item_wise_report(): all_sales = read_sales() items_list = [] amount = 0 for i in all_sales["sales"]: for x in i["items"]: item_added = False for z in items_list: if z["name"] == x["particular"]: z["amount"] += x["amount"] item_added = True if item_added == False: items_list.append({"name":x["particular"],"amount":x["amount"]}) amount += i["total"] print(""" ========================================================== ITEM-WISE SALES REPORT ========================================================== LIST OF ITEMS SOLD ==================""") for i in items_list: print(f"{i['name']} : Rs. {i['amount']}") print(f""" ================== TOTAL AMOUNT EARNT : Rs. {amount}""") def items_available(): items = read_items() print(""" ========================================================== LIST OF ITEMS AVAILABLE / STOCK REPORT ========================================================== CODE PARTICULAR QUANTITY AVAILABILITY """) for i in items["items"]: print(i["code"],i["particular"],i["quantity"],end=" ") if int(i["quantity"])>=1: print(" AVAILABLE") else: print(" UNAVAILABLE") print("\n") def order_stock_list(): items = read_items() order_list = [] print(""" ========================================================== LIST OF ITEMS<20 / TO ORDER ========================================================== CODE PARTICULAR QUANTITY """) for i in items["items"]: if int(i["quantity"])<20: print(i["code"],i["particular"],i["quantity"]) menu = """ ========================================== SALES MANAGEMENT SYSTEM FOR STORES ========================================== WHAT WOULD YOU LIKE TO DO? (1) ADD NEW ITEM TO INVENTORY (2) ADD NEW STOCK TO INVENTORY (3) PERFORM BILLING FOR CUSTOMER (4) VIEW CASH MEMO GIVEN CODE (5) VIEW SALES REPORT(S) (6) VIEW LIST OF AVAILABLE ITEMS (7) GENERATE ORDER LIST FOR ITEMS WHERE STOCK < 20 (0) EXIT YOUR CHOICE : """ report_menu = """ ========================================== VIEW SALES REPORT(S) ========================================== WHAT TYPE OF SALES REPORT WOULD YOU LIKE TO VIEW? (1) DAILY SALES REPORT (2) MONTHLY SALES REPORT (3) YEARLY SALES REPORT (4) ITEM-WISE SALES REPORT (0) BACK TO MAIN MENU YOUR CHOICE : """ while True: while 1: try: ch = int(input(menu)) break except: print("PLEASE ENTER A VALID INTEGER") continue if ch==1: add_item() print("\n"*2) elif ch==2: add_stock() print("\n"*2) elif ch==3: bill() print("\n"*2) elif ch==4: cash_memo() print("\n"*2) elif ch==5: while 1: try: ch = int(input(report_menu)) break except: print("PLEASE ENTER A VALID INTEGER") continue if ch==1: daily_sales_report() elif ch==2: monthly_sales_report() elif ch==3: yearly_sales_report() elif ch==4: item_wise_report() print("\n"*2) elif ch==6: items_available() print("\n"*2) elif ch==7: order_stock_list() print("\n"*2) elif ch==0: break
[ "aadit.xo@gmail.com" ]
aadit.xo@gmail.com
983dcd62c2be5d68fa2354efe39fd201726c82be
469aaddd0e22041e7fc4ec12553258f1d7a2092c
/0x10-python-network_1/5-hbtn_header.py
e29c2e76d7349c26d94f79763ae0be09d51145c1
[]
no_license
youmnaz/holbertonschool-python
80dba488d9e62cfcd260e349f3b036299cec4b17
e6de933f7d5501ea2393729157fd82e776a4a357
refs/heads/master
2023-01-13T20:31:59.258910
2020-11-20T08:30:09
2020-11-20T08:30:09
291,691,627
0
0
null
null
null
null
UTF-8
Python
false
false
185
py
#!/usr/bin/python3 """ 5-hbtn_header.py """ import requests from sys import argv if __name__ == "__main__": r = requests.get(argv[1]) print(r.headers.get("X-Request-Id"))
[ "youmna.zogheib@gmail.com" ]
youmna.zogheib@gmail.com
5aef6dd981da9ff255c7995ba9489e29d410523f
034abf3ad29001e01e3c3ca8106647ac9992e5db
/rock-paper-scissor.py
7880d66590f1442ae8ea694a8021cfe95fe4465a
[]
no_license
gunjeet210/Rock-Paper-Scissors
b1b0c3db0fd6caaf5354924f06f6ce0e35951d86
a07cbc2eaf6dfd494a8e4d8933bb4023a1914c73
refs/heads/master
2021-01-08T15:59:33.132018
2020-02-21T07:13:41
2020-02-21T07:13:41
242,073,752
0
0
null
null
null
null
UTF-8
Python
false
false
1,519
py
import random, time print("Let us play RPS game") while True: print("Enter choice \n1. Rock\n2. Paper\n3. Scissor") choice=int(input("User turn: ")) while choice > 3 or choice < 1: choice=int(input("enter valid input: ")) if choice == 1: choice_name = "Rock" elif choice == 2: choice_name = "Paper" else: choice_name = "Scissor" print("User Choice is: "+ choice_name) print("Now its computerji's turn....") comp_choice = random.randint(1,3) time.sleep(1) while comp_choice == choice: comp_choice = random.randint(1,3) if comp_choice == 1: comp_choice_name = "Rock" elif comp_choice == 2: comp_choice_name = "Paper" else: comp_choice_name = "Scissors" print("ComputerJi's Choice is: "+ comp_choice_name) #Gameplay print(choice_name + " V/S " + comp_choice_name) time.sleep(1) if((choice == 1 and comp_choice == 2) or (choice == 2 and comp_choice == 1)): print("Paper Wins.") result = "paper" elif((choice==1 and comp_choice == 3) or (choice == 3 and comp_choice == 1)): print("Rock Wins.") result = "rock" else: print("Scissor Wins.") result = "scissor" time.sleep(1) if result == choice_name: print("User Wins.") else: print("ComputerJi Wins.") print("Do you want to play again? (Y/N)") ans = input() if ans == 'n' or ans == 'N': break print("\nThanks for playing along.")
[ "noreply@github.com" ]
noreply@github.com
3091099fee02328c00c32ce85434caa6c2918a00
d2fdd6b10b0467913971d1408a9a4053f0be9ffb
/datahub/investment/project/migrations/0033_add_investment_document_permission.py
87a514117458d20c8bf84bc4f1155a3ce0c0b8eb
[]
no_license
jakub-kozlowski/data-hub-leeloo
fc5ecebb5e4d885c824fc7c85acad8837fcc5c76
7f033fcbcfb2f7c1c0e10bec51620742d3d929df
refs/heads/master
2020-05-18T13:29:14.145251
2019-04-30T12:12:50
2019-04-30T12:12:50
null
0
0
null
null
null
null
UTF-8
Python
false
false
728
py
# Generated by Django 2.0.1 on 2018-01-09 16:32 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('investment', '0032_investmentproject_comments'), ] operations = [ migrations.AlterModelOptions( name='investmentproject', options={'default_permissions': ('add', 'change_all', 'delete'), 'permissions': (('read_all_investmentproject', 'Can read all investment project'), ('read_associated_investmentproject', 'Can read associated investment project'), ('change_associated_investmentproject', 'Can change associated investment project'), ('read_investmentproject_document', 'Can read investment project document'))}, ), ]
[ "reupen@users.noreply.github.com" ]
reupen@users.noreply.github.com
084ccfc5ffcd100f2f98fb3e75c4f6b676d5d3f8
09d4c110161520c2ed8bab9f19e2a07f23d66b46
/wordvector/migrations/0002_auto_20161031_0252.py
0f0e11ca6dc638d5054b1f4a4c29c7e564bcdd13
[]
no_license
lunrongchen/SWR
0565df4d62b4198d9dabcc7de760f78e9ff43c7e
fd5cc45e1351b20f7b09ea1c82ddb3bc14930575
refs/heads/master
2021-01-12T14:09:08.125125
2016-11-07T16:51:24
2016-11-07T16:51:24
69,759,201
1
0
null
2016-11-05T17:12:50
2016-10-01T19:34:08
Python
UTF-8
Python
false
false
928
py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('wordvector', '0001_initial'), ] operations = [ migrations.CreateModel( name='WordVectorFile', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('data_src', models.CharField(max_length=100)), ('dimension', models.IntegerField(default=50)), ('data_count', models.IntegerField(default=0)), ('data_link', models.FileField(default=b'data_link/None/No-data_link.zip', upload_to=b'data_link/')), ], ), migrations.AlterUniqueTogether( name='wordvectorfile', unique_together=set([('data_src', 'dimension')]), ), ]
[ "lunrongchen@163.com" ]
lunrongchen@163.com
b69e51e5659b5d82c82d2fd63ceaef1eb4b4624b
3da9b0ebd7f4378e1f0a0fe60b943e041d760719
/simplemooc/courses/migrations/0007_auto_20211026_1450.py
45d89225d95d2be94b6d1fc008887de946c7efda
[]
no_license
gabriel-valenga/Python3NaWebComDjangoUdemy
b9f5d3f5127eff0247f5a89ff82a04c441dd7332
381c0dda61ef7984154686fcd1858b9eb9655a18
refs/heads/master
2023-08-21T04:38:52.119456
2021-10-28T21:30:05
2021-10-28T21:30:05
null
0
0
null
null
null
null
UTF-8
Python
false
false
537
py
# Generated by Django 3.2.8 on 2021-10-26 17:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('courses', '0006_remove_course_about'), ] operations = [ migrations.RemoveField( model_name='course', name='description', ), migrations.AddField( model_name='course', name='start_date', field=models.DateField(blank=True, null=True, verbose_name='Data de รญnicio'), ), ]
[ "gabrielvalengalemos@yahoo.com" ]
gabrielvalengalemos@yahoo.com
8c7c442705664c9f9d05136d7029682ac4793785
f14e95cb9df97570759699092c171743cc3e00c8
/keyword_dreamvector.py
640e1af4adea2f876c3a6dfc69225b8957163131
[]
no_license
DallasAutumn/ChinaDream
b92b5de62a0973988b9673e120e8dac5bcf6050d
2d6c6f45290add74d4daf02f2c2f51e9b4d69c92
refs/heads/master
2020-06-17T18:51:30.657908
2019-05-16T07:54:03
2019-05-16T07:54:03
null
0
0
null
null
null
null
UTF-8
Python
false
false
79,760
py
# -*- coding: utf-8 -*- """ ------------------------------- Time : 2019-04-09 16:19 Author : diw Email : di.W@hotmail.com File : keyword_dreamvector.py Desc: ๆž„ๅปบไธญๅ›ฝๆขฆๅ‘้‡ ------------------------------- """ import warnings import math warnings.filterwarnings("ignore") from sklearn.metrics.cluster import calinski_harabaz_score import pandas as pd import numpy as np from pandas.plotting import parallel_coordinates import matplotlib.pyplot as plt import matplotlib.collections from sklearn.cluster import KMeans from sklearn import metrics from sklearn.manifold import TSNE import seaborn as sns from sklearn.mixture import GaussianMixture from sklearn.decomposition import PCA from sklearn.cluster import SpectralClustering from mpl_toolkits.mplot3d import Axes3D #3Dๅ›พ่กจ้œ€่ฆไฝฟ็”จโ€œmpl_toolkitsโ€ๆจกๅ— import random plt.rcParams['font.family'] = ['Arial Unicode MS'] #็”จๆฅๆญฃๅธธๆ˜พ็คบไธญๆ–‡ๆ ‡็ญพ plt.rcParams['axes.unicode_minus'] = False #็”จๆฅๆญฃๅธธๆ˜พ็คบ่ดŸๅท dreamvector_list = {} def merge_list(list1,list2): temp_list = [] for i in range(len(list1)): temp_list.append(list1[i] + list2[i]) return temp_list def province_dic(province_list, keyword_location): #output_dic['็œไปฝ'] = {'keyword_name': [(sorted according to city list)]} output_dic = {} for current_location,current_location_list in keyword_location.items(): for current_province in province_list: if(current_province in current_location): if(current_province not in output_dic.keys()): output_dic[current_province] = current_location_list break else: temp_list = merge_list(output_dic[current_province],current_location_list) output_dic[current_province] = temp_list break else: continue return output_dic def keyword_province_emotion(province_list,keyword_location_emotion): #output_dic['keyword_name'] = {'็œไปฝ': [(sorted according to emotion list)]} output_dic = {} for current_keyword,current_keyword_dic in keyword_location_emotion.items(): output_dic[current_keyword] = {} for current_location,current_location_emotion_list in current_keyword_dic.items(): for current_province in province_list: if(current_province in current_location): if(current_province not in output_dic[current_keyword].keys()): output_dic[current_keyword][current_province] = current_location_emotion_list break else: temp_list = merge_list(output_dic[current_keyword][current_province],current_location_emotion_list) output_dic[current_keyword][current_province] = temp_list break else: continue return output_dic # result_dic['keyword'] = [็œ1๏ผŒ็œ2๏ผŒ...,็œ31,ๆƒ…ๆ„Ÿ0,ๆƒ…ๆ„Ÿ1,ๆƒ…ๆ„Ÿ3,ๆƒ…ๆ„Ÿ4,ๆƒ…ๆ„Ÿ5,] def generate_dreamvector(keyword_list, province_list,keyword_province,emotion_list,keyword_location_emotion): result_dic = {} for current_keyword in keyword_list: result_dic[current_keyword] = [] # ็œไปฝๆ•ฐๆฎ for current_province in province_list: result_dic[current_keyword].append(keyword_province[current_province][keyword_list.index(current_keyword)]) for current_emotion in emotion_list: result_dic[current_keyword].append(keyword_location_emotion[current_keyword][current_province][emotion_list.index(current_emotion)]) return result_dic def read_keyword_location_emotion(keyword_location_emotion_file): with open(keyword_location_emotion_file) as f: return_dic = eval(f.read()) return return_dic # ๅฐ†ๆŒ‰็œๆๅŠๆฌกๆ•ฐ่ฝฌๆˆ็™พๅˆ†ๆฏ” ๅฐ†ๆƒ…ๆ„Ÿๅ€ผ่ฝฌไธบ็™พๅˆ†ๆฏ” def dreamvector_dic_topercent(province_list,emotion_list,dreamvector_dic): dreamvector_percent_dic = {} for current_keyword,current_original_dreamvector in dreamvector_dic.items(): dreamvector_percent_dic[current_keyword] = [] province_num = len(province_list) emotion_num = len(emotion_list) current_province_total = 0 current_emotion_total = 0 for i in range(province_num): current_province_total += current_original_dreamvector[i] for i in range(emotion_num): current_emotion_total += current_original_dreamvector[i+province_num] for i in range(province_num): dreamvector_percent_dic[current_keyword].append(float(current_original_dreamvector[i])/current_province_total) for i in range(emotion_num): dreamvector_percent_dic[current_keyword].append(float(current_original_dreamvector[i+province_num])/current_emotion_total) # print(dreamvector_percent_dic) return dreamvector_percent_dic def draw_parallel_coordinate(dreamvector_dataframe,n_cluster): plt.rcParams['figure.figsize'] = (16, 8) # ่ฎพ็ฝฎfigure_sizeๅฐบๅฏธ plt.figure() # plt.title(str(n_cluster) + '_classes') parallel_coordinates(dreamvector_dataframe,'่š็ฑป็ฑปๅˆซ',colormap='hsv') plt.savefig('result/dreamvector/parallel_coordinates' + str(n_cluster) + '_cluster' + '.png') plt.show() def imple_kmeans(dreamvector_dataframe,k): model = KMeans(n_clusters=k, n_jobs=4) # ๅˆ†ไธบk็ฑป๏ผŒๅนถๅ‘ๆ•ฐ4 model.fit(dreamvector_dataframe) # ๅผ€ๅง‹่š็ฑป # ็ฎ€ๅ•ๆ‰“ๅฐ็ป“ๆžœ r1 = pd.Series(model.labels_).value_counts() # ็ปŸ่ฎกๅ„ไธช็ฑปๅˆซ็š„ๆ•ฐ็›ฎ r2 = pd.DataFrame(model.cluster_centers_) # ๆ‰พๅ‡บ่š็ฑปไธญๅฟƒ r = pd.concat([r2, r1], axis=1) # ๆจชๅ‘่ฟžๆŽฅ๏ผˆ0ๆ˜ฏ็บตๅ‘๏ผ‰๏ผŒๅพ—ๅˆฐ่š็ฑปไธญๅฟƒๅฏนๅบ”็š„็ฑปๅˆซไธ‹็š„ๆ•ฐ็›ฎ r.columns = list(dreamvector_dataframe.columns) + [u'็ฑปๅˆซๆ•ฐ็›ฎ'] # ้‡ๅ‘ฝๅ่กจๅคด # print(r) # ่ฏฆ็ป†่พ“ๅ‡บๅŽŸๅง‹ๆ•ฐๆฎๅŠๅ…ถ็ฑปๅˆซ r = pd.concat([dreamvector_dataframe, pd.Series(model.labels_, index=dreamvector_dataframe.index)], axis=1) # ่ฏฆ็ป†่พ“ๅ‡บๆฏไธชๆ ทๆœฌๅฏนๅบ”็š„็ฑปๅˆซ r.columns = list(dreamvector_dataframe.columns) + [u'่š็ฑป็ฑปๅˆซ'] # ้‡ๅ‘ฝๅ่กจๅคด ch_index = calinski_harabaz_score(r.iloc[:, 0:-1], r['่š็ฑป็ฑปๅˆซ']) print(str(k) + ' class calinski_harabaz_score:' + str(ch_index)) show_pca(r,2,k) # show_pca(r,3,k) # show_tsne(r,2,k) # show_tsne(r,3,k) # draw_parallel_coordinate(r,k) return ch_index def imple_GMM(dreamvector_dataframe,k): model = GaussianMixture(n_components=k) # ๅˆ†ไธบk็ฑป๏ผŒๅนถๅ‘ๆ•ฐ4 model.fit(dreamvector_dataframe) # ๅผ€ๅง‹่š็ฑป # ็ฎ€ๅ•ๆ‰“ๅฐ็ป“ๆžœ labels = model.predict(dreamvector_dataframe) # print(r) # ่ฏฆ็ป†่พ“ๅ‡บๅŽŸๅง‹ๆ•ฐๆฎๅŠๅ…ถ็ฑปๅˆซ dreamvector_dataframe['่š็ฑป็ฑปๅˆซ'] = labels ch_index = calinski_harabaz_score(dreamvector_dataframe.iloc[:,0:-1], labels) print(str(k)+' class calinski_harabaz_score:' +str(ch_index)) show_pca(dreamvector_dataframe,2,k) show_pca(dreamvector_dataframe,3,k) show_tsne(dreamvector_dataframe,2,k) show_tsne(dreamvector_dataframe,3,k) draw_parallel_coordinate(dreamvector_dataframe,k) return ch_index def imple_SpectralClustering(dreamvector_dataframe,k): model = SpectralClustering(n_clusters=k) # ๅˆ†ไธบk็ฑป, ไฝฟ็”จ้ป˜่ฎค็š„้ซ˜ๆ–ฏๆ ธ # ็ฎ€ๅ•ๆ‰“ๅฐ็ป“ๆžœ labels = model.fit_predict(dreamvector_dataframe) # print(r) # ่ฏฆ็ป†่พ“ๅ‡บๅŽŸๅง‹ๆ•ฐๆฎๅŠๅ…ถ็ฑปๅˆซ dreamvector_dataframe['่š็ฑป็ฑปๅˆซ'] = labels ch_index = calinski_harabaz_score(dreamvector_dataframe.iloc[:,0:-1], labels) print(str(k) + ' class calinski_harabaz_score:' +str(ch_index)) show_pca(dreamvector_dataframe,2,k) show_pca(dreamvector_dataframe,3,k) show_tsne(dreamvector_dataframe,2,k) show_tsne(dreamvector_dataframe,3,k) draw_parallel_coordinate(dreamvector_dataframe,k) return ch_index def show_pca(dreamvector_dataframe,num_components,n_cluster): pca = PCA(n_components=num_components) newData = pca.fit_transform(dreamvector_dataframe.iloc[:,0:-1]) print(pca.explained_variance_ratio_) pca_data = pd.DataFrame(newData,index=dreamvector_dataframe._stat_axis.values.tolist()) pca_data['class'] = dreamvector_dataframe['่š็ฑป็ฑปๅˆซ'] #2d if(num_components==2): # ไธๅŒ็ฑปๅˆซ็”จไธๅŒ้ขœ่‰ฒๅ’Œๆ ทๅผ็ป˜ๅ›พ plt.rcParams['figure.figsize'] = (8, 6) # ่ฎพ็ฝฎfigure_sizeๅฐบๅฏธ # hueๆŒ‡่‰ฒๅฝฉ๏ผŒๆ˜ฏๆ•ฃ็‚นไธๅŒ้ขœ่‰ฒ็š„ๆฅๆบ # print(pca_data) # plt.title(str(n_cluster) + '_classes') dream_list = dreamvector_dataframe._stat_axis.values.tolist() plt.scatter(pca_data.iloc[:, 0], pca_data.iloc[:, 1], c=pca_data['class'], cmap='hsv', linewidth=0.65) for i in range(len(dreamvector_dataframe['่š็ฑป็ฑปๅˆซ'])): random_x = -1 + 2*np.random.random() random_y = -1 + 2*np.random.random() if(dream_list[i] == '็ฅ–ๅ›ฝๅผบๅคง'): plt.annotate(dream_list[i], xy=(pca_data.iloc[i, 0], pca_data.iloc[i, 1]), xytext=(-(45 + random_x), +(5 + random_y)), textcoords='offset points') # ่ฟ™้‡Œxyๆ˜ฏ้œ€่ฆๆ ‡่ฎฐ elif(dream_list[i] == '็”Ÿๆดปๅนธ็ฆ' or dream_list[i] == '็™ฝๆ‰‹่ตทๅฎถ' or dream_list[i] == 'ๅ‘ๅฑ•ๆœบไผš' ): plt.annotate(dream_list[i], xy=(pca_data.iloc[i, 0], pca_data.iloc[i, 1]), xytext=(-(45+random_x),-(5+random_y)),textcoords='offset points') # ่ฟ™้‡Œxyๆ˜ฏ้œ€่ฆๆ ‡่ฎฐ elif(dream_list[i] == 'ๅ‡บๅ'): plt.annotate(dream_list[i], xy=(pca_data.iloc[i, 0], pca_data.iloc[i, 1]), xytext=(-(25 + random_x), -(5 + random_y)), textcoords='offset points') # ่ฟ™้‡Œxyๆ˜ฏ้œ€่ฆๆ ‡่ฎฐ elif (dream_list[i] == 'ๅฅฝๅทฅไฝœ'): plt.annotate(dream_list[i], xy=(pca_data.iloc[i, 0], pca_data.iloc[i, 1]), xytext=(+(3 + random_x), +(5 + random_y)), textcoords='offset points') # ่ฟ™้‡Œxyๆ˜ฏ้œ€่ฆๆ ‡่ฎฐ else: plt.annotate(dream_list[i], xy=(pca_data.iloc[i, 0], pca_data.iloc[i, 1]), xytext=(+(3+random_x),+(2+random_y)),textcoords='offset points') # ่ฟ™้‡Œxyๆ˜ฏ้œ€่ฆๆ ‡่ฎฐ plt.grid(True) plt.savefig('result/dreamvector/pca_2d_'+str(n_cluster)+'cluster'+'.png') plt.show() elif(num_components==3): # 3d plt.rcParams['figure.figsize'] = (8, 4) # ่ฎพ็ฝฎfigure_sizeๅฐบๅฏธ fig = plt.figure('3D scatter plot') ax = fig.add_subplot(111, projection='3d') # 3dๅ›พ้œ€่ฆๅŠ projection='3d' # ax.set_title(str(n_cluster) + '_classes') # print(pca_data) ax.scatter(pca_data.iloc[:, 0], pca_data.iloc[:, 1], pca_data.iloc[:, 2], c=pca_data['class'], cmap='hsv', label = '') plt.savefig('result/dreamvector/pca_3d_'+str(n_cluster)+'cluster'+'.png') plt.show() def show_tsne(dreamvector_dataframe,num_components,n_cluster): tsne = TSNE(n_components=num_components) #:่กจ็คบๆ‰€ๆœ‰่กŒ # print(dreamvector_dataframe.iloc[:,0:-1]) tsne.fit(dreamvector_dataframe.iloc[:,0:-1]) tsne = pd.DataFrame(tsne.embedding_, index=dreamvector_dataframe.iloc[:,0:-1].index) # ่ฝฌๆขๆ•ฐๆฎๆ ผๅผ tsne['class'] = dreamvector_dataframe['่š็ฑป็ฑปๅˆซ'] # print(tsne) #2d if (num_components == 2): # ไธๅŒ็ฑปๅˆซ็”จไธๅŒ้ขœ่‰ฒๅ’Œๆ ทๅผ็ป˜ๅ›พ plt.rcParams['figure.figsize'] = (8, 6) # ่ฎพ็ฝฎfigure_sizeๅฐบๅฏธ # hueๆŒ‡่‰ฒๅฝฉ๏ผŒๆ˜ฏๆ•ฃ็‚นไธๅŒ้ขœ่‰ฒ็š„ๆฅๆบ # print(pca_data) # plt.title(str(n_cluster) + '_classes') dream_list = dreamvector_dataframe._stat_axis.values.tolist() plt.scatter(tsne.iloc[:, 0], tsne.iloc[:, 1], c=tsne['class'], cmap='hsv', linewidth=0.65) for i in range(len(dreamvector_dataframe['่š็ฑป็ฑปๅˆซ'])): random_int = random.randint(1,2) plt.annotate(dream_list[i], xy=(tsne.iloc[i, 0], tsne.iloc[i, 1]), xytext=(+(3+random_int), +(2+random_int)),textcoords='offset points') # ่ฟ™้‡Œxyๆ˜ฏ้œ€่ฆๆ ‡่ฎฐ plt.grid(True) plt.savefig('result/dreamvector/tsne_2d_'+str(n_cluster)+'cluster'+'.png') plt.show() #3d elif(num_components==3): plt.rcParams['figure.figsize'] = (8, 4) # ่ฎพ็ฝฎfigure_sizeๅฐบๅฏธ fig = plt.figure('3D scatter plot') ax = fig.add_subplot(111, projection='3d') # 3dๅ›พ้œ€่ฆๅŠ projection='3d' # ax.set_title(str(n_cluster) + '_classes') # print(pca_data) ax.scatter(tsne.iloc[:, 0], tsne.iloc[:, 1], tsne.iloc[:, 2], c=tsne['class'], cmap='hsv') plt.savefig('result/dreamvector/tsne_3d_'+str(n_cluster)+'cluster'+'.png') plt.show() # output_dic['dream'] = {'province_shang':x,'emotion_shang':y} def province_emotion_shang(dreamvector_dic,province_number,emotion_number): output_dic = {} for current_dream,current_dreamvector in dreamvector_dic.items(): output_dic[current_dream] = {} temp_total_province = 0 temp_total_emotion = 0 for i in range(province_number): temp_total_province += current_dreamvector[i] for j in range(emotion_number): temp_total_emotion += current_dreamvector[j+province_number] #calc shang province_shang = 0.0 emotion_shang = 0.0 for i in range(province_number): p_i = float(current_dreamvector[i])/temp_total_province if (p_i != 0): province_shang -= p_i * math.log(p_i, 2) else: continue for j in range(emotion_number): p_i = float(current_dreamvector[j+province_number]) / temp_total_emotion if(p_i != 0): emotion_shang -= p_i * math.log(p_i, 2) else: continue output_dic[current_dream]['province_shang'] = province_shang output_dic[current_dream]['emotion_shang'] = emotion_shang print(output_dic) return output_dic if __name__=='__main__': keyword_location_emotion_file = 'data/city_keyword_emotion/result.txt' keyword_list = ['ๅฅๅบท','ไบ‹ไธšๆœ‰ๆˆ','ๅ‘ๅฑ•ๆœบไผš','็”Ÿๆดปๅนธ็ฆ','ๆœ‰ๆˆฟ','ๅ‡บๅ','ๅฎถๅบญๅนธ็ฆ','ๅฅฝๅทฅไฝœ','ๅนณ็ญ‰ๆœบไผš','็™ฝๆ‰‹่ตทๅฎถ','ๆˆไธบๅฏŒไบบ','ไธชไฝ“่‡ช็”ฑ','ๅฎ‰ไบซๆ™šๅนด','ๆ”ถๅ…ฅ่ถณๅคŸ','ไธชไบบๅŠชๅŠ›','็ฅ–ๅ›ฝๅผบๅคง','ไธญๅ›ฝ็ปๆตŽๆŒ็ปญๅ‘ๅฑ•','็ˆถ่พˆๆ›ดๅฅฝ'] emotion_list = ['ๆ„คๆ€’', 'ๅŽŒๆถ', '้ซ˜ๅ…ด', 'ๆ‚ฒไผค', 'ๆๆƒง'] # keyword_emotion = {'ๅฅๅบท': {'3': 10431113, '2': 26792199, '4': 2580746, '0': 4043353, '-1': 1177096, '1': 2913965}, 'ไบ‹ไธšๆœ‰ๆˆ': {'2': 182625, '3': 93729, '-1': 2200, '0': 9446, '1': 10420, '4': 1338}, 'ๅ‘ๅฑ•ๆœบไผš': {'1': 35078, '2': 240583, '3': 25407, '4': 102948, '0': 30883, '-1': 1673}, '็”Ÿๆดปๅนธ็ฆ': {'2': 5620765, '3': 2260554, '0': 107260, '1': 210780, '4': 598263, '-1': 76305}, 'ๆœ‰ๆˆฟ': {'2': 585255, '4': 23221, '0': 239103, '1': 88429, '3': 242650, '-1': 20816}, 'ๅ‡บๅ': {'1': 179269, '0': 265398, '2': 779865, '-1': 45724, '3': 176544, '4': 53626}, 'ๅฎถๅบญๅนธ็ฆ': {'0': 30577, '2': 898104, '1': 46120, '-1': 13928, '3': 334588, '4': 67132}, 'ๅฅฝๅทฅไฝœ': {'2': 361045, '0': 61684, '1': 42414, '3': 224019, '-1': 10240, '4': 16839}, 'ๅนณ็ญ‰ๆœบไผš': {'0': 6292, '2': 28517, '1': 13302, '3': 7778, '4': 18844, '-1': 532}, '็™ฝๆ‰‹่ตทๅฎถ': {'2': 99983, '1': 14435, '0': 6935, '4': 3537, '3': 51325, '-1': 2124}, 'ๆˆไธบๅฏŒไบบ': {'0': 4720, '2': 27105, '4': 4514, '3': 6976, '1': 2062, '-1': 241}, 'ไธชไฝ“่‡ช็”ฑ': {'4': 186214, '2': 13971, '-1': 499, '0': 2549, '3': 2767, '1': 25807}, 'ๅฎ‰ไบซๆ™šๅนด': {'3': 22815, '0': 4039, '2': 13059, '1': 4846, '-1': 1116, '4': 503}, 'ๆ”ถๅ…ฅ่ถณๅคŸ': {'1': 2521, '2': 8989, '0': 2120, '3': 2275, '4': 3063, '-1': 69}, 'ไธชไบบๅŠชๅŠ›': {'2': 59979, '3': 89586, '4': 6187, '-1': 794, '0': 1407, '1': 4688}, '็ฅ–ๅ›ฝๅผบๅคง': {'2': 8334, '3': 5633, '0': 2391, '4': 1845, '1': 508, '-1': 547}, 'ไธญๅ›ฝ็ปๆตŽๆŒ็ปญๅ‘ๅฑ•': {'2': 2323, '4': 1208, '0': 470, '1': 308, '3': 47, '-1': 11}, '็ˆถ่พˆๆ›ดๅฅฝ': {'2': 571, '3': 234, '0': 142, '4': 329, '1': 28, '-1': 4}} keyword_location = {'ๅนฟ่ฅฟ ๆฒณๆฑ ': [34951, 240, 410, 7301, 796, 1125, 752, 427, 36, 127, 28, 127, 27, 4, 123, 7, 1, 0], 'ๆตทๅค– ๆพณๅคงๅˆฉไบš': [139477, 486, 833, 12435, 8290, 5497, 1722, 1730, 161, 336, 147, 263, 99, 46, 249, 60, 4, 7], 'ไธŠๆตท ้ป„ๆตฆๅŒบ': [295300, 1473, 4089, 41795, 6505, 9633, 4385, 3692, 584, 1001, 246, 890, 217, 141, 446, 82, 44, 8], 'ๅŒ—ไบฌ ๆœ้˜ณๅŒบ': [572916, 3518, 6255, 81276, 13588, 19765, 10366, 9809, 1132, 2572, 493, 1868, 628, 317, 1030, 288, 80, 16], '้ฆ™ๆธฏ': [143944, 649, 1028, 24400, 3405, 4914, 2478, 2298, 105, 780, 73, 586, 113, 69, 467, 33, 6, 3], '็ฆๅปบ ็ฆๅทž': [349113, 1873, 2532, 45366, 7770, 10950, 5684, 5747, 417, 1113, 184, 837, 443, 105, 843, 126, 18, 11], 'ๅŒ—ไบฌ ่ฅฟๅŸŽๅŒบ': [157549, 860, 1717, 23223, 4102, 5511, 2946, 2640, 292, 506, 136, 731, 241, 83, 223, 120, 50, 6], 'ๅฐๆนพ ๅฐๅŒ—ๅธ‚': [155328, 881, 1587, 26565, 3159, 5228, 4144, 1979, 191, 481, 99, 425, 112, 45, 1512, 26, 3, 8], '้™•่ฅฟ ๅฎ้ธก': [63239, 395, 623, 12628, 1246, 1721, 1255, 758, 107, 176, 27, 178, 60, 26, 94, 26, 2, 4], 'ๅฑฑไธœ ๆฝๅŠ': [171208, 1253, 2028, 33911, 3693, 5869, 3546, 2237, 298, 636, 150, 476, 117, 70, 282, 72, 6, 4], 'ๆน–ๅ— ๅฒณ้˜ณ': [55835, 434, 477, 11540, 1146, 1772, 1317, 992, 59, 186, 37, 144, 94, 12, 129, 15, 2, 0], 'ๅฎ‰ๅพฝ ๅฎฃๅŸŽ': [33665, 205, 295, 6904, 1478, 1197, 712, 470, 37, 97, 16, 246, 28, 8, 56, 16, 3, 0], 'ๅนฟ่ฅฟ ็™พ่‰ฒ': [36106, 233, 428, 6837, 697, 1157, 719, 470, 42, 99, 24, 109, 32, 21, 69, 3, 0, 0], 'ไธŠๆตท': [430581, 2254, 4031, 64763, 13047, 14617, 7498, 6007, 676, 1862, 334, 3226, 394, 219, 3409, 179, 62, 5], 'ๆฒณๅ—': [158716, 1769, 1405, 26426, 3128, 4097, 3225, 1902, 221, 621, 86, 522, 189, 47, 1011, 56, 7, 2], 'ๅ‰ๆž— ่พฝๆบ': [77223, 311, 500, 10425, 956, 1381, 1005, 534, 50, 126, 30, 151, 30, 10, 85, 16, 1, 1], 'ๅŒ—ไบฌ': [778117, 4084, 6362, 120671, 20783, 21292, 13514, 9334, 1557, 3351, 504, 5744, 569, 280, 1427, 349, 98, 18], 'ๆตทๅ— ๅ…ถไป–': [102273, 951, 1181, 25059, 2189, 3352, 2316, 1162, 178, 313, 54, 347, 57, 43, 205, 38, 2, 4], 'ๅฑฑ่ฅฟ ๅคชๅŽŸ': [174466, 994, 1254, 28274, 3811, 5299, 3137, 2715, 288, 761, 123, 444, 164, 56, 308, 109, 13, 6], 'ๅนฟ่ฅฟ ๅ—ๅฎ': [251500, 1695, 1913, 30559, 5489, 8055, 4265, 3765, 277, 761, 138, 557, 379, 90, 724, 76, 13, 9], 'ๅ‰ๆž— ้•ฟๆ˜ฅ': [221334, 1285, 1712, 36709, 5082, 6984, 4442, 3294, 305, 904, 125, 835, 227, 63, 411, 85, 12, 6], 'ๅนฟไธœ ๆƒ ๅทž': [150596, 896, 1136, 22540, 3425, 4224, 2994, 1884, 123, 608, 62, 664, 202, 51, 424, 42, 2, 5], 'ๅนฟไธœ ๆทฑๅœณ': [935347, 5658, 8358, 143264, 27775, 28338, 17221, 13364, 1197, 3888, 718, 7655, 1000, 501, 1399, 323, 88, 25], '้‡ๅบ† ๅŒๆกฅๅŒบ': [26859, 159, 208, 5324, 533, 531, 601, 288, 38, 47, 15, 132, 5, 7, 525, 3, 1, 0], 'ๆพณ้—จ ๅ…ถไป–': [254931, 1783, 3462, 52939, 5922, 8668, 5284, 2971, 499, 709, 237, 1372, 126, 113, 720, 36, 4, 7], 'ๅนฟไธœ ๅนฟๅทž': [1365479, 6989, 10207, 259708, 77454, 42558, 23903, 19309, 1910, 5233, 834, 39344, 1817, 1029, 2787, 488, 105, 40], '่พฝๅฎ ๅคง่ฟž': [318460, 1467, 5317, 97195, 6292, 7909, 13249, 4109, 312, 1040, 119, 702, 236, 104, 404, 141, 673, 4], 'ๅฑฑไธœ ๆณฐๅฎ‰': [60007, 373, 433, 10541, 1550, 1939, 1163, 919, 80, 229, 40, 158, 47, 18, 90, 21, 4, 4], 'ๆ–ฐ็–† ๅ…‹ๆ‹‰็Ž›ไพ': [25856, 182, 276, 5758, 527, 886, 595, 339, 29, 71, 17, 90, 25, 6, 36, 8, 1, 0], 'ๆต™ๆฑŸ ๆญๅทž': [689010, 3028, 6573, 120690, 30310, 20954, 11646, 12647, 839, 3266, 328, 10244, 698, 264, 3820, 248, 56, 20], 'ไธŠๆตท ๆจๆตฆๅŒบ': [90582, 517, 863, 13068, 1995, 3780, 1559, 1724, 165, 282, 68, 366, 91, 56, 118, 55, 19, 8], 'ๆฑŸ่‹ ่‹ๅทž': [417830, 2465, 2495, 63523, 9712, 13547, 7595, 6553, 510, 2112, 255, 1250, 434, 159, 1147, 172, 32, 18], '้™•่ฅฟ ๆธญๅ—': [61832, 345, 519, 11116, 1021, 1571, 1112, 720, 73, 175, 29, 145, 47, 16, 218, 23, 1, 0], 'ๆฒณๅŒ— ็Ÿณๅฎถๅบ„': [268452, 1259, 2006, 42243, 6894, 7054, 5528, 3894, 318, 917, 157, 644, 275, 74, 456, 105, 19, 10], 'ๅŒ—ไบฌ ้€šๅทžๅŒบ': [65576, 398, 494, 10401, 1685, 1809, 1171, 787, 83, 786, 39, 398, 49, 20, 100, 28, 2, 1], 'ๅฑฑไธœ ้’ๅฒ›': [303463, 1523, 3141, 46543, 6178, 10308, 5656, 4802, 366, 1246, 185, 832, 388, 105, 558, 177, 24, 8], 'ๅนฟไธœ ไธœ่Žž': [289156, 2047, 2223, 36912, 4448, 7837, 5336, 3498, 252, 1165, 136, 709, 276, 78, 367, 81, 10, 6], 'ๆฒณๅ— ๆ–ฐไนก': [87852, 447, 607, 13179, 1584, 2232, 1492, 1151, 118, 317, 45, 217, 70, 13, 171, 32, 8, 1], '่พฝๅฎ ๆฒˆ้˜ณ': [341588, 1779, 2031, 48575, 6851, 9141, 5771, 5146, 421, 1324, 197, 843, 326, 102, 500, 156, 21, 4], 'ๆฒณๅŒ— ้‚ฏ้ƒธ': [88468, 556, 721, 15372, 1914, 2565, 1882, 1191, 91, 483, 46, 247, 84, 44, 197, 42, 10, 2], 'ๆน–ๅ— ้•ฟๆฒ™': [377151, 1856, 3033, 56963, 7819, 11668, 8253, 14722, 489, 1225, 226, 1185, 554, 115, 487, 179, 42, 10], 'ๅ…ถไป–': [4808645, 30822, 30241, 849805, 114819, 143278, 97633, 73268, 6006, 17868, 1985, 19544, 4338, 1526, 14872, 2076, 318, 126], '่พฝๅฎ': [121723, 631, 894, 27676, 2839, 3430, 2828, 1521, 106, 485, 72, 403, 79, 43, 999, 56, 7, 0], 'ๅคฉๆดฅ ็บขๆกฅๅŒบ': [27529, 652, 288, 5622, 605, 889, 537, 414, 36, 81, 15, 99, 18, 14, 51, 13, 0, 0], 'ๅฑฑ่ฅฟ ๅ•ๆข': [40664, 289, 414, 8935, 801, 1178, 820, 465, 65, 160, 19, 117, 26, 17, 128, 15, 0, 1], 'ๅ››ๅท ๆˆ้ƒฝ': [689723, 3372, 4793, 91777, 14275, 23892, 14198, 12013, 1100, 2502, 377, 1955, 963, 276, 1063, 303, 62, 31], 'ๅŒ—ไบฌ ๆ˜ŒๅนณๅŒบ': [67752, 414, 625, 13119, 1896, 2316, 1287, 1056, 103, 284, 38, 426, 69, 28, 126, 32, 9, 2], '่ดตๅทž ่ดต้˜ณ': [121518, 822, 1061, 21458, 2648, 4485, 2413, 1992, 184, 505, 65, 347, 137, 46, 298, 53, 11, 4], 'ๅŒ—ไบฌ ไธœๅŸŽๅŒบ': [866491, 4761, 9322, 139938, 19459, 26592, 16079, 11406, 2976, 2798, 594, 2834, 879, 358, 2061, 390, 476, 22], 'ๆฒณๅŒ— ไฟๅฎš': [100833, 768, 831, 17555, 2298, 3095, 2126, 1571, 147, 510, 80, 282, 106, 23, 251, 50, 5, 7], 'ๆฒณๅŒ— ๅ”ๅฑฑ': [119516, 698, 798, 18747, 2554, 3192, 2763, 1668, 157, 431, 81, 289, 136, 29, 145, 46, 6, 3], 'ๆฑŸ่‹ ๆ— ้”ก': [221325, 1120, 1598, 33709, 5474, 7483, 3832, 3674, 280, 980, 113, 1279, 234, 64, 618, 71, 22, 8], 'ๆฑŸ่ฅฟ': [103211, 609, 720, 18531, 2299, 2896, 2072, 1443, 110, 307, 45, 399, 90, 29, 772, 47, 3, 0], '้‡ๅบ† ไน้พ™ๅกๅŒบ': [36002, 187, 263, 6093, 842, 1427, 590, 691, 45, 119, 20, 161, 42, 5, 64, 17, 1, 4], 'ๅŒ—ไบฌ ๆ€€ๆŸ”ๅŒบ': [31234, 275, 245, 6749, 880, 864, 620, 388, 39, 71, 12, 307, 19, 16, 47, 8, 1, 0], '้ป‘้พ™ๆฑŸ ้ป‘ๆฒณ': [33198, 244, 347, 7360, 774, 1030, 687, 409, 60, 99, 24, 122, 16, 11, 89, 11, 1, 0], 'ๆต™ๆฑŸ ๅฐๅทž': [113047, 721, 890, 19531, 2379, 3692, 1988, 1891, 142, 489, 59, 302, 101, 46, 183, 45, 8, 4], 'ๆน–ๅŒ— ๆญฆๆฑ‰': [529992, 3239, 4559, 96880, 11419, 18088, 9989, 10974, 907, 2134, 396, 1688, 692, 205, 851, 224, 44, 29], '้‡ๅบ† ๆฒ™ๅชๅๅŒบ': [73638, 393, 464, 8848, 1114, 2418, 1032, 1224, 93, 203, 36, 190, 77, 18, 136, 37, 5, 5], 'ๅฑฑไธœ ไธœ่ฅ': [67493, 351, 504, 12683, 1200, 1985, 1415, 1068, 92, 205, 33, 236, 60, 17, 128, 25, 2, 2], 'ๅŒ—ไบฌ ๆตทๆท€ๅŒบ': [403345, 2221, 6725, 68724, 10279, 16898, 8547, 8606, 2238, 1707, 388, 1748, 478, 275, 818, 266, 226, 32], 'ๆตทๅค– ็พŽๅ›ฝ': [251744, 1386, 2527, 29116, 5826, 14286, 4337, 4633, 868, 1221, 247, 842, 271, 180, 632, 168, 20, 12], 'ๅฎ‰ๅพฝ': [114225, 666, 927, 19002, 2672, 3259, 2129, 1864, 3082, 470, 57, 443, 124, 35, 3051, 49, 8, 4], '้‡ๅบ† ๆถช้™ตๅŒบ': [25432, 117, 160, 4326, 395, 647, 394, 260, 18, 56, 14, 77, 21, 11, 33, 7, 0, 0], 'ๆตทๅค– ๅŠ ๆ‹ฟๅคง': [77423, 470, 674, 10697, 1944, 4632, 1474, 1457, 174, 327, 70, 272, 104, 36, 134, 56, 6, 2], 'ๆฑŸ่‹ ๅ—ไบฌ': [516864, 3800, 3471, 77543, 12261, 18265, 9939, 9244, 888, 1744, 336, 1913, 680, 187, 2059, 248, 184, 23], 'ๆต™ๆฑŸ ๅฎๆณข': [282669, 1597, 1723, 43045, 18808, 8216, 4669, 5819, 324, 1006, 129, 1853, 330, 81, 1220, 164, 17, 7], 'ๅŒ—ไบฌ ไธฐๅฐๅŒบ': [105782, 626, 839, 16739, 2739, 3537, 2013, 1608, 160, 367, 84, 517, 136, 34, 135, 62, 9, 5], 'ๅฎ‰ๅพฝ ๅ…ญๅฎ‰': [40628, 262, 382, 7632, 999, 1322, 837, 619, 49, 152, 24, 196, 51, 12, 156, 24, 0, 0], 'ๅนฟไธœ ไธญๅฑฑ': [135528, 839, 1189, 20898, 2452, 4052, 2892, 1770, 164, 669, 56, 442, 133, 39, 188, 43, 5, 3], '้’ๆตท ่ฅฟๅฎ': [66552, 508, 761, 13605, 4309, 2146, 1329, 892, 87, 185, 37, 170, 51, 22, 350, 21, 5, 3], 'ๆฒณๅŒ— ็งฆ็š‡ๅฒ›': [79960, 497, 695, 14220, 1663, 2355, 1467, 1112, 184, 297, 53, 236, 46, 26, 120, 27, 3, 4], 'ๅฑฑไธœ ๆตŽๅ—': [305884, 1757, 2349, 47560, 6631, 9468, 5398, 4966, 517, 1114, 204, 708, 359, 104, 786, 166, 41, 15], 'ๅฑฑไธœ ๅจๆตท': [65580, 390, 599, 10939, 1426, 2150, 1217, 810, 77, 205, 56, 184, 59, 20, 83, 29, 2, 1], 'ๆน–ๅ— ้‚ต้˜ณ': [44742, 291, 494, 8548, 938, 1332, 932, 616, 63, 176, 37, 150, 39, 15, 67, 19, 2, 1], 'ไธŠๆตท ๆตฆไธœๆ–ฐๅŒบ': [243752, 1282, 2769, 35702, 6705, 10051, 4271, 4136, 500, 976, 246, 890, 302, 145, 325, 127, 37, 9], '้ฆ™ๆธฏ ไธœๅŒบ': [4918, 21, 48, 1066, 104, 207, 83, 65, 11, 26, 1, 12, 8, 8, 9, 2, 3, 0], 'ไธŠๆตท ๅพๆฑ‡ๅŒบ': [164137, 887, 1758, 29683, 3446, 5623, 2762, 2590, 247, 630, 108, 504, 218, 72, 221, 72, 13, 6], 'ๅฎๅค ้“ถๅท': [128799, 860, 1257, 29263, 2724, 3510, 2493, 1591, 159, 370, 90, 335, 96, 47, 359, 43, 6, 2], 'ๅŒ—ไบฌ ๅด‡ๆ–‡ๅŒบ': [48565, 281, 403, 8873, 1374, 1485, 909, 537, 69, 130, 15, 366, 40, 16, 73, 24, 0, 2], '่ดตๅทž ้ป”่ฅฟๅ—': [43200, 335, 456, 9624, 809, 1255, 866, 463, 88, 113, 21, 135, 30, 15, 167, 12, 2, 0], 'ๆฑŸ่‹ ๅธธๅทž': [145786, 748, 1037, 20813, 2587, 4696, 2512, 1979, 152, 443, 93, 380, 179, 313, 195, 61, 3, 2], '็ฆๅปบ ่ކ็”ฐ': [105647, 642, 948, 17938, 2086, 3293, 2056, 1172, 113, 324, 42, 366, 85, 26, 384, 28, 4, 0], 'ๆตทๅค– ้Ÿฉๅ›ฝ': [69878, 234, 389, 5781, 799, 3657, 741, 1113, 72, 235, 52, 89, 40, 13, 61, 18, 2, 0], '่พฝๅฎ ็›˜้”ฆ': [41924, 289, 361, 8267, 919, 1183, 819, 477, 56, 160, 33, 112, 22, 10, 102, 19, 4, 0], 'ๆน–ๅŒ— ๅฎœๆ˜Œ': [75149, 466, 595, 12693, 1427, 2500, 1370, 1080, 79, 258, 42, 194, 76, 27, 108, 32, 7, 1], '้™•่ฅฟ ๆฆ†ๆž—': [54989, 388, 545, 10580, 1157, 1412, 1092, 655, 85, 188, 27, 129, 67, 19, 83, 26, 2, 1], 'ๆฑŸ่‹ ๆณฐๅทž': [68740, 459, 567, 15322, 1516, 2219, 1314, 924, 76, 286, 31, 170, 84, 15, 424, 27, 6, 2], '้‡ๅบ†': [190197, 895, 1268, 28705, 6603, 6390, 2740, 2627, 211, 669, 83, 3177, 157, 57, 399, 65, 12, 3], 'ไธŠๆตท ้—ต่กŒๅŒบ': [104495, 617, 1030, 15159, 2524, 4392, 1918, 1676, 183, 380, 74, 352, 167, 43, 136, 39, 11, 2], 'ๆต™ๆฑŸ ๆธฉๅทž': [236704, 1325, 1560, 31795, 4646, 7003, 3865, 3231, 271, 1141, 147, 520, 264, 85, 677, 53, 7, 7], 'ๅนฟไธœ ๆฑ•ๅคด': [276803, 1354, 1382, 36753, 3593, 7148, 4250, 2601, 171, 707, 87, 506, 197, 51, 336, 43, 7, 4], 'ๆฑŸ่‹ ็›ๅŸŽ': [78866, 552, 728, 13829, 1684, 2893, 1474, 1105, 103, 310, 45, 210, 86, 45, 405, 42, 6, 3], 'ๅคฉๆดฅ': [146414, 858, 1012, 24635, 3903, 4325, 2613, 1905, 199, 488, 73, 1109, 163, 54, 620, 70, 12, 3], '่ดตๅทž ้ตไน‰': [71507, 497, 706, 14156, 1538, 2394, 1489, 941, 99, 265, 43, 252, 86, 24, 228, 34, 1, 0], 'ไธŠๆตท ๅ˜‰ๅฎšๅŒบ': [52788, 327, 465, 8513, 1109, 1893, 1063, 735, 63, 215, 27, 199, 59, 17, 75, 15, 4, 2], 'ๅนฟไธœ ๆฑŸ้—จ': [147461, 869, 1110, 44222, 13904, 3815, 2686, 1904, 114, 797, 52, 8387, 151, 123, 818, 21, 6, 2], '็ฆๅปบ': [173048, 1088, 1565, 31922, 3791, 5345, 3432, 1895, 203, 615, 67, 733, 155, 173, 426, 63, 5, 2], 'ๆต™ๆฑŸ ็ปๅ…ด': [114815, 738, 943, 19826, 2805, 4039, 2206, 1864, 125, 431, 63, 385, 124, 44, 189, 45, 4, 0], '้ป‘้พ™ๆฑŸ ๅ“ˆๅฐ”ๆปจ': [265306, 1528, 1621, 41407, 5786, 8227, 4746, 3943, 361, 1255, 148, 630, 263, 84, 530, 110, 9, 11], 'ๅนฟไธœ ๆฒณๆบ': [76547, 532, 682, 13569, 1546, 2070, 1588, 860, 60, 208, 39, 226, 49, 15, 97, 23, 1, 0], 'ๅคฉๆดฅ ๆญฆๆธ…ๅŒบ': [26218, 184, 231, 5125, 528, 689, 548, 304, 28, 78, 14, 68, 18, 9, 30, 7, 0, 1], '็ฆๅปบ ๆผณๅทž': [111568, 725, 1137, 20924, 1990, 3976, 2173, 1362, 142, 385, 79, 347, 119, 37, 1469, 34, 3, 3], 'ๅนฟไธœ': [485558, 3645, 3686, 81986, 17836, 13620, 8640, 5222, 574, 1846, 280, 5945, 437, 218, 1460, 169, 23, 8], 'ๆฒณๅŒ— ๅผ ๅฎถๅฃ': [51922, 359, 459, 10692, 1072, 1551, 1077, 662, 64, 181, 32, 146, 49, 22, 107, 25, 0, 1], 'ๅŒ—ไบฌ ็Ÿณๆ™ฏๅฑฑๅŒบ': [43856, 340, 429, 9048, 1360, 1555, 877, 614, 91, 152, 36, 370, 38, 26, 68, 23, 4, 1], 'ๆฑŸ่‹': [247518, 1146, 1640, 32951, 4339, 7268, 3945, 2943, 274, 724, 136, 717, 246, 555, 1010, 121, 9, 5], 'ๅฑฑไธœ ็ƒŸๅฐ': [111711, 895, 703, 17860, 2362, 3737, 2121, 1772, 167, 448, 82, 269, 103, 48, 154, 43, 9, 9], 'ๅ†…่’™ๅค ๅŒ…ๅคด': [59706, 403, 514, 11815, 1291, 1843, 1245, 830, 76, 200, 34, 203, 40, 32, 118, 26, 2, 4], 'ๆน–ๅ— ๅจ„ๅบ•': [36916, 400, 387, 7827, 813, 1138, 879, 583, 45, 149, 27, 119, 33, 10, 227, 17, 3, 0], '่ฅฟ่— ๆž—่Š': [42080, 284, 548, 9262, 874, 1309, 815, 432, 83, 128, 31, 129, 18, 19, 68, 13, 1, 0], '่ฅฟ่— ๆ‹‰่จ': [52142, 345, 591, 11686, 1107, 1651, 1086, 676, 80, 161, 33, 170, 43, 16, 138, 12, 3, 2], 'ๅฑฑไธœ': [211107, 1188, 1908, 37232, 4556, 6190, 4032, 2705, 311, 1159, 148, 756, 168, 71, 608, 93, 19, 5], 'ๅฑฑ่ฅฟ ่ฟๅŸŽ': [55037, 397, 523, 10204, 1177, 1602, 1096, 709, 62, 235, 35, 150, 42, 25, 84, 16, 5, 2], 'ๆ–ฐ็–† ๅ“ˆๅฏ†': [27013, 194, 299, 6099, 626, 874, 578, 290, 82, 88, 19, 85, 19, 9, 48, 9, 1, 0], 'ๆตทๅ— ๆตทๅฃ': [194471, 1413, 1937, 36800, 4501, 6041, 3710, 2573, 717, 611, 122, 615, 151, 104, 1451, 84, 10, 6], '้’ๆตท ็މๆ ‘': [40663, 331, 508, 9615, 885, 1364, 884, 439, 65, 129, 35, 143, 19, 11, 60, 5, 0, 1], 'ๅนฟ่ฅฟ ๆŸณๅทž': [104400, 608, 802, 15154, 1944, 2988, 1712, 1315, 153, 283, 59, 269, 100, 43, 1318, 34, 1, 2], 'ๆน–ๅ—': [130348, 576, 953, 20112, 2339, 3292, 2184, 2262, 163, 394, 52, 426, 119, 36, 598, 55, 10, 1], 'ๆน–ๅŒ—': [148340, 904, 1137, 27056, 2975, 4112, 2579, 2075, 244, 507, 71, 491, 151, 60, 542, 55, 8, 1], '้‡ๅบ† ๆธไธญๅŒบ': [52696, 257, 505, 8363, 1368, 2120, 900, 735, 69, 203, 38, 407, 43, 20, 133, 21, 2, 1], 'ๅฎ‰ๅพฝ ๅˆ่‚ฅ': [260311, 1590, 1801, 41364, 8265, 7751, 5089, 4585, 1260, 875, 146, 1908, 347, 82, 396, 101, 14, 8], 'ๅฎ‰ๅพฝ ้˜œ้˜ณ': [48550, 361, 487, 10351, 1230, 1568, 1048, 754, 58, 196, 38, 202, 57, 26, 116, 23, 2, 2], 'ไธŠๆตท ้•ฟๅฎๅŒบ': [87964, 603, 843, 13077, 1959, 3382, 1595, 1546, 152, 267, 65, 313, 87, 34, 121, 50, 8, 3], 'ๆตทๅค– ๅ…ถไป–': [263663, 1261, 1548, 27139, 4798, 12458, 4050, 5364, 469, 1057, 183, 628, 324, 84, 1577, 154, 11, 12], 'ๆฒณๅ— ๅฎ‰้˜ณ': [61691, 339, 446, 12050, 1296, 1630, 1354, 886, 95, 249, 31, 160, 123, 15, 100, 26, 0, 1], 'ๅฎๅค ๅดๅฟ ': [81228, 656, 1117, 19399, 1800, 2490, 1906, 861, 113, 249, 68, 311, 51, 36, 217, 22, 1, 1], 'ๆต™ๆฑŸ ๅ˜‰ๅ…ด': [133837, 783, 943, 23511, 2792, 4768, 2227, 1842, 169, 434, 75, 344, 173, 50, 180, 42, 12, 7], 'ๅŒ—ไบฌ ๅคงๅ…ดๅŒบ': [59798, 315, 478, 10510, 1655, 1646, 1100, 789, 82, 215, 31, 384, 58, 21, 100, 25, 3, 1], 'ไธŠๆตท ้™ๅฎ‰ๅŒบ': [74115, 450, 904, 12207, 1989, 3225, 1382, 1299, 145, 296, 53, 267, 82, 41, 111, 30, 20, 4], '้ป‘้พ™ๆฑŸ ็ปฅๅŒ–': [38124, 279, 331, 7897, 780, 1200, 810, 404, 35, 131, 20, 128, 35, 9, 58, 22, 2, 0], 'ๅนฟไธœ ็ ๆตท': [138299, 770, 1311, 21891, 2801, 4308, 3218, 2191, 169, 481, 71, 427, 144, 44, 536, 43, 7, 4], 'ๅฑฑไธœ ่ๆณฝ': [48336, 312, 409, 8682, 1103, 1312, 942, 649, 78, 187, 23, 132, 77, 14, 82, 18, 7, 0], 'ๆฒณๅŒ—': [146272, 770, 1184, 25332, 3032, 4058, 2698, 1607, 148, 466, 65, 548, 108, 308, 544, 63, 3, 2], 'ๅ››ๅท ๅฎœๅฎพ': [35879, 235, 314, 6411, 743, 1254, 807, 482, 50, 148, 15, 93, 37, 7, 107, 13, 0, 4], 'ๆฑŸ่ฅฟ ๅฎœๆ˜ฅ': [69692, 498, 558, 14932, 1364, 1923, 1515, 802, 70, 183, 38, 199, 67, 11, 126, 21, 1, 3], '้™•่ฅฟ ่ฅฟๅฎ‰': [462430, 2601, 3251, 71889, 10681, 13241, 8305, 8257, 710, 1770, 291, 1149, 579, 162, 979, 256, 36, 19], 'ๆฒณๅ— ๅผ€ๅฐ': [59237, 360, 456, 10109, 1079, 1494, 1167, 764, 71, 215, 31, 143, 113, 19, 337, 26, 3, 3], 'ๆตทๅค– ่ทๅ…ฐ': [5821, 28, 53, 871, 182, 428, 105, 137, 19, 34, 2, 45, 14, 7, 7, 3, 0, 0], 'ๆตทๅค– ้ฉฌๆฅ่ฅฟไบš': [47222, 228, 334, 6756, 719, 1491, 903, 582, 52, 132, 26, 102, 30, 10, 103, 6, 2, 0], 'ๆฑŸ่‹ ๆทฎๅฎ‰': [60883, 381, 702, 10543, 1291, 2065, 1290, 811, 79, 224, 35, 193, 71, 18, 1134, 18, 3, 1], 'ๅฑฑไธœ ๆปจๅทž': [246554, 1983, 3867, 58297, 5333, 9107, 5302, 3148, 447, 821, 261, 695, 67, 96, 472, 76, 1, 5], 'ๆต™ๆฑŸ ้‡‘ๅŽ': [125116, 743, 858, 18901, 2611, 3698, 2026, 1762, 177, 594, 80, 274, 128, 35, 1523, 54, 7, 4], 'ๆตทๅค–': [386207, 1658, 1817, 36186, 5823, 14187, 5004, 4993, 1104, 1121, 178, 795, 282, 134, 561, 153, 20, 13], 'ๆ–ฐ็–† ๆ˜Œๅ‰': [32376, 180, 289, 5980, 655, 860, 622, 366, 28, 104, 25, 88, 20, 13, 55, 9, 1, 1], '็ฆๅปบ ๅŽฆ้—จ': [316789, 1996, 2518, 51194, 6900, 10332, 7957, 5032, 365, 1090, 186, 850, 348, 166, 755, 139, 28, 6], 'ๅนฟ่ฅฟ ่ดตๆธฏ': [33832, 249, 386, 6664, 724, 1065, 685, 456, 38, 121, 16, 139, 42, 7, 56, 12, 2, 0], 'ไธŠๆตท ๆ™ฎ้™€ๅŒบ': [101969, 481, 705, 12830, 1918, 3394, 1445, 1460, 121, 245, 71, 311, 92, 30, 113, 30, 8, 5], '็ฆๅปบ ๆณ‰ๅทž': [211817, 1248, 1485, 32652, 4165, 7076, 3860, 2935, 360, 1013, 118, 489, 260, 71, 1540, 62, 11, 2], '้ป‘้พ™ๆฑŸ ้นคๅฒ—': [35192, 262, 368, 7450, 708, 1046, 766, 377, 99, 148, 19, 128, 24, 15, 49, 10, 2, 0], '่พฝๅฎ ไธนไธœ': [45071, 315, 385, 8651, 942, 1496, 937, 579, 60, 145, 35, 162, 32, 8, 197, 16, 1, 2], '่ดตๅทž ๅฎ‰้กบ': [40742, 350, 471, 9053, 935, 1265, 839, 437, 50, 104, 31, 165, 41, 14, 153, 10, 2, 2], '้ฆ™ๆธฏ ๅ…ถไป–': [349688, 2144, 3880, 62534, 7013, 11880, 6632, 4351, 425, 1128, 252, 1212, 192, 130, 487, 65, 8, 7], 'ๅคฉๆดฅ ไธœไธฝๅŒบ': [24860, 168, 271, 5265, 545, 707, 487, 320, 39, 87, 15, 75, 27, 13, 41, 6, 1, 0], 'ๆฑŸ่ฅฟ ไธŠ้ฅถ': [54856, 413, 489, 11200, 1194, 1815, 1187, 802, 78, 633, 41, 181, 92, 23, 182, 25, 1, 0], 'ๆต™ๆฑŸ': [213745, 1062, 1513, 31622, 5964, 5788, 3695, 2472, 255, 842, 109, 965, 188, 70, 4082, 75, 11, 2], '็”˜่‚ƒ ็™ฝ้“ถ': [34177, 246, 329, 6968, 649, 999, 701, 329, 34, 102, 19, 107, 29, 11, 57, 14, 0, 1], 'ๅ››ๅท ้›…ๅฎ‰': [25242, 145, 240, 8802, 489, 838, 506, 343, 41, 75, 14, 62, 31, 8, 59, 15, 3, 0], 'ไบ‘ๅ— ๅคง็†': [38021, 263, 371, 7555, 908, 1319, 729, 518, 55, 123, 30, 131, 46, 8, 72, 11, 1, 0], 'ๆฑŸ่‹ ๅพๅทž': [122265, 741, 863, 18937, 2772, 3727, 2278, 1837, 168, 481, 64, 348, 138, 45, 177, 66, 9, 3], 'ๆตทๅค– ๆ–ฐๅŠ ๅก': [55390, 344, 517, 8472, 1585, 2407, 1090, 970, 101, 224, 38, 166, 57, 29, 102, 29, 3, 4], 'ๆพณ้—จ': [36508, 245, 361, 7451, 854, 1563, 798, 469, 52, 155, 29, 115, 26, 16, 215, 12, 0, 0], 'ๅŒ—ไบฌ ๅฎฃๆญฆๅŒบ': [58230, 346, 492, 10949, 1690, 2108, 1172, 659, 86, 188, 42, 378, 59, 28, 82, 35, 9, 1], '้ป‘้พ™ๆฑŸ': [91395, 506, 654, 15665, 1898, 2566, 1779, 984, 126, 428, 46, 347, 75, 29, 488, 25, 5, 1], 'ไบ‘ๅ—': [87179, 498, 652, 14422, 1785, 2390, 1536, 1216, 87, 242, 45, 252, 98, 21, 626, 29, 3, 6], 'ๅ†…่’™ๅค ๅ‘ผๅ’Œๆตฉ็‰น': [86769, 521, 4428, 16602, 1920, 3101, 1667, 1253, 124, 298, 50, 252, 103, 30, 156, 41, 13, 0], '็ฆๅปบ ๅ—ๅนณ': [79963, 521, 844, 15651, 1639, 2642, 1689, 907, 87, 251, 35, 252, 74, 19, 547, 215, 4, 0], 'ๆฒณๅ— ้ƒ‘ๅทž': [441159, 2629, 3741, 75959, 10092, 12416, 8881, 7525, 614, 2001, 332, 1084, 588, 164, 1434, 214, 36, 14], '้’ๆตท ๆตทไธœ': [43128, 328, 555, 10192, 955, 1270, 945, 434, 72, 99, 32, 168, 22, 17, 118, 9, 0, 0], 'ๅฑฑ่ฅฟ ้˜ณๆณ‰': [41374, 293, 449, 9183, 899, 1156, 874, 543, 55, 122, 32, 152, 24, 9, 185, 15, 0, 2], 'ๆฑŸ่ฅฟ ๆ–ฐไฝ™': [50192, 275, 422, 9172, 883, 1289, 908, 481, 67, 114, 30, 135, 35, 19, 146, 14, 1, 0], '้ฆ™ๆธฏ ไน้พ™ๅŸŽๅŒบ': [14070, 81, 76, 3630, 264, 634, 219, 178, 17, 73, 10, 76, 11, 3, 188, 4, 0, 0], 'ๅฑฑไธœ ไธดๆฒ‚': [96701, 506, 706, 16167, 2503, 2587, 1815, 1267, 150, 567, 41, 330, 129, 23, 217, 46, 10, 2], 'ๆฒณๅ— ๅนณ้กถๅฑฑ': [53818, 319, 676, 10197, 1089, 1481, 1084, 659, 82, 182, 35, 178, 45, 20, 83, 31, 1, 1], 'ๆฒณๅ— ๆด›้˜ณ': [119067, 648, 723, 18717, 2247, 3347, 2096, 2326, 161, 429, 69, 233, 129, 28, 1114, 67, 11, 6], 'ๅคฉๆดฅ ่ฅฟ้’ๅŒบ': [44756, 318, 412, 9602, 1073, 1408, 999, 804, 76, 185, 24, 170, 26, 8, 306, 14, 3, 1], 'ไธŠๆตท ๅขๆนพๅŒบ': [64194, 297, 390, 7909, 1005, 1800, 802, 578, 84, 136, 26, 182, 31, 13, 61, 15, 7, 1], 'ๅ››ๅท ๆณธๅทž': [37514, 225, 333, 6247, 718, 1162, 671, 487, 42, 94, 20, 124, 41, 7, 39, 17, 4, 0], 'ๅนฟ่ฅฟ ๆฅๅฎพ': [7757, 31, 39, 1668, 152, 181, 133, 75, 9, 19, 4, 33, 6, 3, 12, 2, 0, 0], 'ๅฑฑไธœ ๆžฃๅบ„': [126023, 965, 1612, 28669, 2822, 4085, 2645, 1554, 193, 432, 111, 349, 53, 44, 279, 31, 5, 3], 'ๆ–ฐ็–† ไนŒ้ฒๆœจ้ฝ': [102701, 646, 949, 18558, 2326, 3468, 2537, 1646, 189, 422, 74, 528, 112, 36, 201, 70, 8, 4], '่ฅฟ่— ้˜ฟ้‡Œ': [42511, 310, 545, 10410, 941, 1393, 918, 510, 64, 124, 43, 148, 28, 17, 81, 14, 0, 2], 'ๅฐๆนพ ๅฐไธญๅธ‚': [11679, 32, 36, 1731, 149, 261, 160, 86, 12, 29, 4, 26, 4, 0, 4, 0, 1, 0], 'ๅŒ—ไบฌ ๆˆฟๅฑฑๅŒบ': [58419, 430, 1534, 11503, 1513, 1436, 1167, 672, 81, 185, 29, 435, 41, 14, 462, 25, 1, 1], 'ไธŠๆตท ้‡‘ๅฑฑๅŒบ': [35216, 237, 381, 7077, 633, 1024, 1113, 522, 31, 103, 23, 105, 41, 34, 55, 10, 2, 1], 'ๆน–ๅŒ— ๅ’ธๅฎ': [36892, 276, 405, 8046, 838, 1212, 777, 488, 41, 132, 35, 128, 29, 11, 88, 12, 1, 2], '่พฝๅฎ ๆœ้˜ณ': [38322, 267, 339, 8274, 865, 1107, 815, 466, 53, 354, 23, 129, 22, 12, 69, 21, 2, 0], 'ๆ–ฐ็–† ๅทด้Ÿณ้ƒญๆฅž': [28844, 183, 314, 5900, 687, 879, 605, 349, 34, 83, 17, 103, 16, 5, 95, 18, 3, 0], 'ๆต™ๆฑŸ ่ˆŸๅฑฑ': [62813, 343, 472, 10442, 1191, 1733, 980, 685, 213, 141, 30, 167, 47, 11, 137, 28, 1, 1], '้‡ๅบ† ๅ—ๅฒธๅŒบ': [60230, 259, 426, 8015, 1264, 2134, 852, 986, 76, 162, 26, 344, 56, 11, 100, 22, 3, 0], '็”˜่‚ƒ ๅ…ฐๅทž': [120602, 761, 942, 22030, 2406, 3387, 2277, 1679, 211, 418, 70, 332, 144, 48, 187, 73, 7, 8], 'ๆพณ้—จ ่Šฑๅœฐ็Ž›ๅ ‚ๅŒบ': [12356, 53, 52, 2205, 176, 418, 139, 111, 17, 22, 4, 25, 12, 1, 176, 1, 1, 1], 'ๅŒ—ไบฌ ้กบไน‰ๅŒบ': [41413, 275, 348, 8654, 1254, 1219, 810, 519, 62, 107, 25, 355, 34, 19, 68, 19, 0, 0], '็”˜่‚ƒ ้…’ๆณ‰': [27608, 210, 299, 6268, 711, 849, 606, 328, 37, 73, 22, 105, 25, 11, 407, 10, 0, 0], 'ๅคฉๆดฅ ๆฒณไธœๅŒบ': [37566, 264, 406, 7374, 910, 1318, 773, 550, 39, 168, 19, 123, 39, 14, 62, 18, 1, 1], 'ไบ‘ๅ— ไธดๆฒง': [22724, 170, 241, 5156, 513, 711, 447, 256, 28, 63, 24, 62, 16, 11, 48, 11, 0, 0], 'ๅฎๅค ๅ›บๅŽŸ': [79550, 670, 1033, 19077, 1723, 2444, 1743, 810, 120, 349, 58, 310, 44, 20, 519, 26, 2, 1], '้™•่ฅฟ ๆฑ‰ไธญ': [50603, 348, 494, 10122, 1004, 1436, 1022, 576, 58, 130, 51, 129, 46, 14, 154, 14, 1, 4], 'ๆฒณๅŒ— ๅปŠๅŠ': [72262, 472, 641, 13117, 1602, 2174, 1338, 984, 113, 310, 59, 185, 78, 17, 118, 33, 7, 2], 'ๅคฉๆดฅ ๅ’ŒๅนณๅŒบ': [100184, 512, 709, 13983, 2046, 3019, 1592, 1266, 131, 265, 58, 248, 82, 37, 130, 42, 11, 5], 'ๅฑฑไธœ ๅพทๅทž': [58940, 410, 580, 11403, 1177, 1814, 1125, 751, 78, 182, 39, 179, 45, 20, 95, 29, 10, 3], 'ๅฎ‰ๅพฝ ไบณๅทž': [32887, 225, 316, 6953, 834, 1072, 667, 386, 48, 132, 18, 130, 33, 18, 59, 9, 1, 2], 'ๆน–ๅ— ๆ ชๆดฒ': [57882, 404, 479, 10081, 1248, 1824, 1158, 890, 74, 184, 31, 195, 60, 19, 91, 17, 3, 5], 'ไธŠๆตท ๆพๆฑŸๅŒบ': [59496, 369, 591, 9406, 1325, 2205, 1086, 1002, 89, 240, 41, 201, 59, 19, 98, 18, 2, 1], 'ๅฑฑ่ฅฟ ไธดๆฑพ': [52527, 374, 468, 10505, 1250, 1571, 1156, 694, 71, 194, 25, 172, 36, 26, 112, 14, 3, 1], '้ป‘้พ™ๆฑŸ ๅคงๅบ†': [56011, 409, 435, 11007, 1298, 1925, 1157, 854, 89, 242, 29, 172, 52, 18, 208, 27, 3, 7], 'ๅคฉๆดฅ ๅฎๅปๅŒบ': [21217, 185, 240, 4476, 474, 597, 440, 255, 31, 62, 15, 74, 15, 8, 40, 5, 0, 0], 'ๅ››ๅท ็ปต้˜ณ': [62443, 377, 473, 10015, 1456, 2234, 1131, 916, 86, 245, 39, 190, 73, 20, 115, 28, 1, 2], 'ๆฒณๅ— ไฟก้˜ณ': [49669, 378, 517, 9674, 1134, 1586, 1173, 774, 89, 228, 32, 159, 64, 19, 90, 26, 1, 2], '่พฝๅฎ ่พฝ้˜ณ': [35951, 298, 337, 7454, 875, 1144, 796, 380, 48, 89, 21, 144, 21, 18, 57, 7, 5, 3], 'ๆตทๅค– ๅพทๅ›ฝ': [15459, 88, 164, 2116, 1080, 1116, 261, 303, 41, 65, 28, 87, 18, 7, 21, 26, 1, 1], 'ๅฑฑไธœ ๆตŽๅฎ': [74154, 441, 534, 12300, 1514, 2099, 1483, 969, 120, 309, 68, 198, 65, 47, 116, 55, 6, 3], 'ๆน–ๅŒ— ้šๅทž': [34617, 256, 356, 7433, 749, 1055, 754, 458, 39, 111, 25, 139, 30, 9, 124, 9, 1, 1], 'ๆฒณๅ— ๆผฏๆฒณ': [64936, 435, 832, 14121, 1190, 1810, 2364, 844, 186, 225, 62, 246, 101, 18, 112, 18, 2, 0], 'ๆฑŸ่ฅฟ ๅ—ๆ˜Œ': [248582, 1158, 1549, 33616, 4643, 6069, 3953, 3493, 318, 2613, 112, 995, 292, 75, 2714, 121, 16, 5], '้ฆ™ๆธฏ ไธญ่ฅฟๅŒบ': [32526, 119, 345, 4399, 492, 1375, 470, 429, 49, 133, 25, 84, 35, 31, 69, 13, 1, 1], 'ๆ–ฐ็–† ๅก”ๅŸŽ': [22264, 167, 264, 4908, 462, 662, 456, 249, 42, 66, 8, 70, 11, 2, 38, 3, 2, 0], 'ๅ‰ๆž— ๆพๅŽŸ': [46092, 349, 528, 10087, 1019, 1395, 1024, 538, 65, 128, 26, 140, 41, 19, 90, 13, 1, 0], 'ๅฑฑ่ฅฟ': [87331, 459, 734, 15883, 1828, 2332, 1779, 1165, 116, 328, 52, 278, 49, 33, 781, 23, 3, 1], 'ๆตทๅค– ๆณ•ๅ›ฝ': [59497, 380, 494, 10072, 1370, 3234, 1187, 1126, 121, 249, 41, 195, 56, 29, 109, 37, 3, 3], 'ๅนฟไธœ ๆข…ๅทž': [88817, 552, 715, 14044, 1422, 2271, 1683, 1065, 64, 265, 35, 231, 62, 15, 94, 14, 2, 4], 'ๆน–ๅ— ๅธธๅพท': [47365, 327, 421, 8641, 1169, 1550, 977, 888, 75, 179, 30, 150, 51, 15, 89, 18, 3, 1], 'ๅคฉๆดฅ ๆฒณๅŒ—ๅŒบ': [30585, 199, 275, 6001, 716, 1046, 602, 425, 48, 78, 19, 122, 22, 10, 56, 13, 1, 1], 'ๅนฟ่ฅฟ ๆก‚ๆž—': [91002, 481, 625, 13352, 1727, 2660, 1517, 1355, 116, 296, 40, 232, 92, 33, 176, 35, 3, 2], 'ๅ››ๅท ๅ—ๅ……': [53447, 262, 319, 7877, 944, 1576, 939, 808, 54, 173, 30, 118, 48, 15, 129, 14, 5, 0], 'ไธŠๆตท ๅด‡ๆ˜ŽๅŽฟ': [23969, 171, 223, 5132, 464, 651, 441, 292, 38, 65, 23, 62, 17, 8, 41, 8, 0, 1], 'ๆตทๅค– ่‹ฑๅ›ฝ': [89884, 542, 897, 13679, 2336, 5382, 1740, 2204, 236, 380, 70, 292, 126, 44, 255, 58, 9, 3], '้™•่ฅฟ ๅฎ‰ๅบท': [41223, 309, 440, 8934, 889, 1270, 926, 559, 45, 109, 27, 118, 41, 17, 142, 18, 1, 2], 'ๅŒ—ไบฌ ๅนณ่ฐทๅŒบ': [29610, 190, 282, 6582, 881, 824, 563, 358, 121, 85, 17, 269, 17, 10, 50, 8, 1, 1], 'ๅ‰ๆž— ๅ‰ๆž—': [82993, 479, 698, 14882, 1693, 2420, 1638, 988, 105, 293, 43, 206, 73, 29, 168, 28, 7, 1], 'ๅนฟไธœ ไฝ›ๅฑฑ': [282547, 1631, 2160, 38985, 5479, 8844, 6426, 5485, 303, 1011, 131, 959, 351, 102, 342, 78, 16, 6], 'ๅŒ—ไบฌ ๅฏ†ไบ‘ๅŽฟ': [27534, 266, 254, 6465, 861, 718, 582, 307, 23, 73, 21, 313, 17, 8, 35, 9, 0, 1], 'ๆฒณๅŒ— ่กกๆฐด': [45510, 336, 430, 12302, 1081, 1418, 885, 648, 55, 171, 34, 155, 31, 11, 80, 25, 0, 0], 'ๆฑŸ่‹ ๅฎฟ่ฟ': [50007, 312, 419, 9875, 1149, 1457, 917, 664, 57, 254, 49, 184, 49, 25, 617, 14, 1, 1], 'ๅ››ๅท ๅ‡‰ๅฑฑ': [22771, 146, 218, 4810, 468, 736, 462, 272, 51, 80, 20, 66, 26, 5, 40, 8, 0, 0], 'ๅ››ๅท': [143020, 782, 1031, 22441, 2730, 4776, 2603, 1805, 162, 518, 68, 477, 122, 46, 656, 62, 3, 0], 'ๅนฟ่ฅฟ': [109337, 811, 1224, 19988, 2640, 3509, 2168, 1332, 127, 394, 66, 440, 116, 33, 798, 43, 0, 3], '่พฝๅฎ ้žๅฑฑ': [66423, 408, 512, 11559, 1347, 1893, 1251, 768, 59, 265, 48, 200, 61, 12, 221, 34, 5, 0], '้‡ๅบ† ๆฑŸๅŒ—ๅŒบ': [49426, 304, 476, 7808, 1188, 2017, 944, 790, 73, 202, 30, 237, 55, 20, 90, 18, 4, 2], 'ไบ‘ๅ— ไฟๅฑฑ': [24979, 250, 271, 5596, 534, 747, 536, 306, 29, 63, 14, 80, 20, 8, 49, 7, 2, 0], '่ดตๅทž ๆฏ•่Š‚': [38508, 341, 413, 8866, 898, 1316, 841, 484, 64, 126, 35, 128, 21, 6, 929, 16, 0, 0], 'ๆน–ๅŒ— ่†ๅทž': [57398, 392, 534, 11647, 1279, 1933, 1247, 881, 91, 203, 35, 177, 52, 27, 122, 20, 3, 7], '้™•่ฅฟ ๅ’ธ้˜ณ': [62095, 472, 527, 12479, 1159, 1775, 1207, 838, 95, 221, 35, 165, 66, 23, 399, 22, 4, 0], 'ไบ‘ๅ— ๆ˜†ๆ˜Ž': [180194, 1048, 1392, 28870, 4092, 6135, 3397, 2853, 278, 1126, 147, 468, 255, 57, 311, 102, 10, 9], 'ไธŠๆตท ่™นๅฃๅŒบ': [74209, 382, 694, 10960, 1853, 3168, 1389, 1275, 201, 249, 62, 273, 85, 32, 116, 30, 4, 3], '่พฝๅฎ ้“ๅฒญ': [38212, 288, 357, 7719, 837, 1098, 789, 412, 52, 110, 24, 137, 27, 16, 1152, 26, 3, 1], 'ๆฑŸ่‹ ๆ‰ฌๅทž': [93457, 593, 685, 15463, 2162, 3561, 1817, 1549, 147, 288, 66, 311, 116, 30, 193, 59, 7, 0], 'ๅ‰ๆž—': [80296, 508, 674, 15462, 1810, 2376, 1716, 909, 86, 246, 31, 383, 61, 18, 362, 32, 1, 0], '้‡ๅบ† ไธ‡ๅทžๅŒบ': [73167, 259, 401, 8362, 925, 1472, 850, 661, 115, 161, 24, 140, 47, 20, 109, 114, 2, 1], 'ๅฑฑ่ฅฟ ้•ฟๆฒป': [46023, 341, 469, 9351, 1063, 1366, 1094, 597, 125, 156, 26, 157, 33, 15, 114, 15, 1, 0], '้ป‘้พ™ๆฑŸ ็‰กไธนๆฑŸ': [43732, 339, 387, 9029, 977, 1475, 896, 610, 58, 204, 23, 145, 48, 12, 1956, 21, 1, 0], 'ๆฒณๅ— ้นคๅฃ': [30613, 231, 307, 6235, 658, 891, 653, 379, 23, 108, 25, 103, 29, 10, 122, 13, 0, 1], 'ๅ››ๅท ้˜ฟๅ': [19867, 165, 217, 4499, 390, 609, 379, 218, 28, 50, 19, 72, 14, 6, 25, 3, 0, 0], 'ๆน–ๅŒ— ๅญๆ„Ÿ': [43702, 335, 389, 9089, 883, 1273, 903, 683, 65, 156, 21, 139, 40, 16, 75, 17, 0, 2], 'ๆต™ๆฑŸ ่กขๅทž': [52661, 345, 460, 10281, 2437, 1590, 1110, 696, 63, 144, 38, 184, 39, 18, 71, 9, 5, 1], 'ๅนฟไธœ ่‚‡ๅบ†': [141093, 682, 760, 31258, 1819, 2619, 1910, 1183, 83, 286, 39, 258, 82, 21, 116, 17, 2, 1], 'ๆน–ๅŒ— ่ฅ„้˜ณ': [57549, 387, 575, 11340, 1367, 2279, 1221, 949, 72, 243, 29, 180, 79, 16, 93, 29, 3, 2], 'ๅฎ‰ๅพฝ ๆปๅทž': [40597, 281, 362, 7721, 864, 1216, 827, 578, 58, 121, 22, 151, 48, 13, 396, 19, 2, 1], 'ๅฎ‰ๅพฝ ๆทฎๅŒ—': [33724, 232, 336, 7126, 825, 1119, 712, 465, 49, 138, 22, 129, 38, 14, 59, 16, 0, 4], 'ไบ‘ๅ— ๆ€’ๆฑŸ': [22743, 187, 255, 5212, 518, 696, 510, 256, 32, 59, 18, 76, 17, 8, 116, 3, 0, 0], 'ๆฑŸ่‹ ๅ—้€š': [112214, 625, 752, 17550, 2262, 3603, 2601, 1909, 143, 428, 60, 306, 135, 41, 209, 47, 5, 2], 'ๅนฟไธœ ๆน›ๆฑŸ': [95259, 625, 858, 17006, 1899, 3022, 2061, 1378, 79, 374, 109, 295, 74, 39, 135, 25, 7, 3], 'ๅ››ๅท ไนๅฑฑ': [38690, 243, 320, 6552, 811, 1410, 750, 535, 59, 120, 23, 108, 37, 13, 87, 15, 2, 2], '็”˜่‚ƒ ๅคฉๆฐด': [45220, 274, 376, 7778, 705, 1088, 763, 538, 46, 103, 19, 120, 36, 8, 936, 17, 2, 1], '้‡ๅบ† ๆธๅŒ—ๅŒบ': [41638, 252, 303, 5849, 912, 1768, 714, 693, 59, 141, 56, 132, 47, 10, 46, 16, 2, 3], '็ฆๅปบ ๅฎๅพท': [58859, 420, 494, 11596, 1207, 2017, 1060, 787, 81, 205, 36, 188, 66, 27, 97, 20, 4, 2], 'ๆฑŸ่ฅฟ ๆ™ฏๅพท้•‡': [50283, 313, 491, 9890, 1036, 1578, 982, 590, 72, 154, 34, 197, 41, 11, 528, 17, 2, 1], 'ๅฎ‰ๅพฝ ้ป„ๅฑฑ': [37940, 255, 357, 8668, 1094, 1187, 875, 469, 40, 121, 21, 271, 78, 12, 849, 16, 2, 2], 'ๅคฉๆดฅ ๆดฅๅ—ๅŒบ': [22219, 167, 247, 4915, 522, 805, 863, 330, 53, 99, 18, 73, 16, 12, 39, 8, 0, 0], 'ๆน–ๅ— ๆฐธๅทž': [49958, 335, 391, 7889, 804, 1140, 896, 531, 58, 150, 28, 128, 68, 20, 401, 14, 3, 2], 'ๆน–ๅŒ— ๅๅ ฐ': [46334, 340, 441, 9022, 1026, 1443, 1020, 768, 61, 194, 39, 125, 73, 15, 71, 22, 2, 1], 'ๆฒณๅ— ๅ•†ไธ˜': [48344, 312, 429, 9192, 1138, 1415, 963, 664, 117, 203, 21, 158, 51, 13, 110, 19, 0, 1], 'ๅฎ‰ๅพฝ ่šŒๅŸ ': [55881, 324, 447, 10444, 1286, 1386, 948, 1107, 61, 167, 27, 251, 74, 20, 238, 16, 0, 4], '้ป‘้พ™ๆฑŸ ไฝณๆœจๆ–ฏ': [39170, 292, 330, 7907, 852, 1285, 804, 497, 58, 166, 27, 140, 33, 13, 84, 13, 4, 1], '็ฆๅปบ ไธ‰ๆ˜Ž': [95813, 574, 935, 17370, 1913, 2760, 2059, 1066, 111, 271, 53, 301, 127, 38, 261, 35, 2, 2], '้ป‘้พ™ๆฑŸ ไผŠๆ˜ฅ': [31552, 236, 344, 7319, 692, 954, 764, 359, 48, 108, 20, 119, 20, 8, 78, 10, 0, 1], '้’ๆตท ๆตท่ฅฟ': [39199, 308, 493, 9027, 853, 1158, 784, 385, 65, 111, 30, 121, 21, 7, 79, 15, 0, 2], '่พฝๅฎ ๆŠš้กบ': [52891, 304, 485, 9627, 1055, 1413, 1094, 746, 63, 135, 27, 185, 39, 14, 275, 25, 4, 0], 'ๆน–ๅŒ— ้ป„ๅ†ˆ': [43499, 322, 441, 8925, 982, 1347, 930, 690, 57, 143, 36, 135, 39, 16, 289, 17, 2, 5], 'ๆฒณๅ— ็„ฆไฝœ': [52839, 473, 404, 9717, 1201, 1527, 1223, 729, 65, 196, 28, 126, 51, 19, 118, 28, 4, 0], 'ๆตทๅค– ๆ—ฅๆœฌ': [114364, 515, 555, 11249, 2016, 6233, 1545, 1938, 142, 332, 45, 251, 117, 45, 162, 56, 6, 3], '็”˜่‚ƒ ็”˜ๅ—': [21561, 181, 246, 5413, 437, 644, 514, 217, 36, 59, 11, 72, 10, 7, 44, 3, 0, 0], 'ๆตทๅค– ็‘žๅฃซ': [8952, 20, 73, 6153, 210, 343, 385, 153, 15, 31, 6, 53, 5, 7, 12, 4, 7, 0], 'ๆฑŸ่ฅฟ ้นฐๆฝญ': [37036, 276, 408, 7918, 776, 1170, 801, 444, 51, 103, 29, 130, 20, 11, 981, 10, 0, 2], 'ๅ‰ๆž— ๅปถ่พนๆœ้ฒœๆ—่‡ชๆฒปๅทž': [47470, 376, 461, 9919, 999, 1512, 1061, 591, 65, 177, 24, 143, 32, 14, 85, 14, 1, 4], 'ไบ‘ๅ— ็މๆบช': [31058, 193, 318, 6544, 619, 1033, 605, 392, 42, 118, 28, 97, 18, 11, 53, 13, 1, 0], '่ดตๅทž ๅ…ญ็›˜ๆฐด': [42178, 336, 516, 9822, 1025, 1531, 1002, 513, 57, 133, 34, 184, 31, 16, 146, 6, 2, 1], 'ๆ–ฐ็–†': [71446, 653, 582, 11998, 1344, 1787, 1268, 669, 80, 183, 26, 264, 36, 18, 719, 27, 3, 1], 'ๆฒณๅ— ๆฟฎ้˜ณ': [44939, 350, 489, 8562, 1537, 1264, 1069, 602, 49, 171, 26, 117, 51, 19, 80, 24, 5, 0], 'ๆฑŸ่ฅฟ ่ไนก': [49426, 330, 464, 9223, 954, 1324, 1098, 615, 59, 146, 24, 158, 45, 19, 95, 18, 0, 0], '้™•่ฅฟ ้“œๅท': [41974, 287, 404, 8784, 738, 1168, 833, 409, 42, 99, 16, 114, 34, 7, 77, 14, 1, 0], 'ๅฐๆนพ ๅฐๅ—ๅธ‚': [4473, 23, 22, 1148, 93, 114, 89, 51, 5, 16, 1, 10, 3, 1, 6, 2, 0, 0], 'ๅนฟไธœ ไบ‘ๆตฎ': [29945, 180, 253, 5399, 648, 878, 630, 424, 32, 103, 19, 112, 29, 9, 56, 6, 0, 0], 'ๅ››ๅท ๅ†…ๆฑŸ': [29602, 397, 302, 6168, 591, 1002, 653, 415, 40, 78, 22, 97, 33, 10, 70, 8, 3, 1], 'ๅนฟ่ฅฟ ้˜ฒๅŸŽๆธฏ': [27872, 190, 317, 6569, 655, 919, 614, 323, 44, 117, 25, 96, 25, 19, 37, 5, 0, 0], 'ๆฒณๅ— ่ฎธๆ˜Œ': [46070, 323, 396, 9405, 1158, 1367, 998, 892, 59, 184, 15, 130, 65, 16, 78, 23, 2, 1], '้ป‘้พ™ๆฑŸ ไธƒๅฐๆฒณ': [28106, 198, 323, 6350, 603, 886, 578, 316, 46, 106, 24, 115, 16, 16, 50, 12, 0, 1], 'ๅ†…่’™ๅค ้„‚ๅฐ”ๅคšๆ–ฏ': [44233, 287, 430, 9203, 940, 1235, 1037, 596, 67, 198, 25, 139, 52, 9, 291, 18, 0, 4], 'ๆ–ฐ็–† ๅ…‹ๅญœๅ‹’่‹': [18813, 156, 248, 4854, 448, 621, 453, 218, 25, 64, 21, 67, 9, 8, 83, 8, 2, 0], '้™•่ฅฟ': [108301, 669, 868, 19816, 2405, 2936, 2060, 1403, 135, 365, 69, 363, 82, 25, 797, 47, 4, 2], 'ๆฒณๅ— ไธ‰้—จๅณก': [36209, 229, 325, 6832, 796, 1042, 742, 392, 49, 160, 31, 122, 26, 10, 923, 10, 1, 1], 'ๅฑฑไธœ ๆ—ฅ็…ง': [49062, 301, 1783, 9068, 1094, 1394, 860, 669, 60, 168, 42, 110, 43, 18, 105, 14, 2, 0], 'ๅฎ‰ๅพฝ ่Šœๆน–': [74556, 431, 540, 12340, 2059, 2444, 1425, 1254, 88, 249, 32, 441, 99, 26, 260, 29, 3, 1], 'ๅฑฑ่ฅฟ ๅฟปๅทž': [38079, 302, 453, 8399, 836, 1174, 844, 465, 65, 131, 36, 135, 29, 13, 113, 18, 0, 0], 'ๆต™ๆฑŸ ๆน–ๅทž': [90064, 453, 651, 14326, 1556, 2533, 1511, 1190, 117, 322, 44, 224, 61, 15, 535, 31, 10, 3], 'ๆน–ๅ— ๅผ ๅฎถ็•Œ': [32053, 218, 345, 7093, 694, 1030, 721, 444, 45, 97, 20, 95, 14, 18, 72, 5, 0, 1], '่ฅฟ่— ๆ˜Œ้ƒฝ': [43270, 347, 579, 10660, 952, 1393, 919, 465, 77, 123, 35, 152, 26, 13, 646, 6, 2, 0], '็ฆๅปบ ้พ™ๅฒฉ': [82886, 552, 844, 15900, 1681, 2530, 1734, 1035, 94, 244, 49, 278, 78, 22, 713, 36, 0, 2], 'ๅฎ‰ๅพฝ ้ฉฌ้žๅฑฑ': [53603, 280, 401, 8565, 1168, 1457, 855, 643, 54, 135, 40, 172, 67, 18, 69, 67, 0, 3], 'ๆฑŸ่ฅฟ ๅ‰ๅฎ‰': [56201, 373, 456, 10405, 1080, 1424, 1035, 659, 68, 147, 36, 156, 41, 17, 98, 18, 1, 1], 'ๅฎ‰ๅพฝ ๆฑ ๅทž': [29173, 226, 348, 6581, 862, 910, 647, 421, 59, 80, 21, 269, 21, 10, 53, 11, 1, 0], 'ๆต™ๆฑŸ ไธฝๆฐด': [74292, 454, 560, 13691, 1543, 1956, 1324, 1046, 109, 295, 31, 208, 33, 21, 167, 21, 7, 4], '้ฆ™ๆธฏ ๆฒ™็”ฐๅŒบ': [5181, 36, 30, 1200, 83, 256, 86, 68, 10, 14, 3, 14, 2, 1, 6, 3, 0, 0], 'ๅŒ—ไบฌ ้—จๅคดๆฒŸๅŒบ': [26167, 218, 240, 6452, 909, 790, 598, 305, 35, 77, 15, 296, 14, 14, 39, 14, 0, 2], '้™•่ฅฟ ๅ•†ๆด›': [34089, 286, 381, 7921, 724, 1015, 738, 376, 171, 92, 19, 103, 24, 13, 65, 15, 1, 0], 'ๅนฟ่ฅฟ ็މๆž—': [43149, 318, 464, 7982, 994, 1523, 902, 657, 62, 209, 30, 156, 57, 15, 74, 18, 1, 1], 'ๅ†…่’™ๅค ้€š่พฝ': [42302, 314, 425, 9063, 1012, 1294, 873, 494, 58, 249, 27, 153, 44, 15, 70, 6, 2, 0], 'ๆ–ฐ็–† ไผŠ็Ё': [32331, 204, 327, 6658, 655, 931, 754, 426, 64, 99, 15, 80, 22, 8, 105, 16, 4, 0], 'ไบ‘ๅ— ๅพทๅฎ': [25383, 299, 300, 5687, 513, 804, 578, 304, 27, 92, 12, 75, 20, 12, 106, 10, 0, 1], '่ฅฟ่—': [70092, 334, 418, 10599, 1123, 1476, 1032, 534, 52, 358, 25, 183, 28, 12, 506, 9, 1, 0], 'ๅคฉๆดฅ ๅŒ—่พฐๅŒบ': [26971, 205, 277, 5554, 505, 801, 510, 351, 44, 72, 10, 83, 25, 3, 59, 7, 3, 2], '้‡ๅบ† ็ถฆๆฑŸๅŽฟ': [9924, 77, 102, 2228, 200, 357, 212, 130, 13, 32, 7, 30, 11, 2, 13, 0, 0, 0], 'ๅคฉๆดฅ ๆฒณ่ฅฟๅŒบ': [53606, 390, 430, 9143, 1192, 1938, 1028, 823, 95, 182, 39, 182, 58, 21, 75, 24, 0, 1], 'ๅคฉๆดฅ ่“ŸๅŽฟ': [18122, 144, 176, 4209, 408, 577, 404, 232, 28, 52, 14, 64, 14, 4, 36, 6, 0, 0], 'ๆฑŸ่ฅฟ ๆŠšๅทž': [42498, 345, 447, 8611, 911, 1296, 914, 514, 70, 134, 25, 180, 32, 17, 65, 14, 0, 0], 'ๆฑŸ่‹ ้•‡ๆฑŸ': [67431, 446, 549, 11688, 1418, 2446, 1366, 987, 92, 217, 46, 204, 84, 20, 108, 33, 1, 0], 'ๆฒณๅ— ๅ—้˜ณ': [66535, 366, 520, 11862, 1316, 1938, 1401, 1364, 102, 254, 53, 165, 92, 26, 229, 48, 3, 0], '็”˜่‚ƒ ้™‡ๅ—': [34089, 222, 393, 7912, 598, 924, 674, 336, 53, 94, 15, 91, 19, 7, 42, 17, 3, 1], 'ๅฎ‰ๅพฝ ๅฎ‰ๅบ†': [51312, 280, 391, 9823, 1716, 1656, 1026, 723, 76, 167, 32, 553, 57, 14, 135, 27, 5, 0], '่ดตๅทž ้ป”ๅ—': [38445, 293, 444, 8339, 842, 1166, 809, 454, 62, 99, 33, 116, 21, 13, 157, 20, 1, 0], 'ๅนฟ่ฅฟ ้’ฆๅทž': [33725, 255, 334, 6645, 756, 1070, 649, 443, 56, 120, 19, 105, 52, 23, 59, 11, 1, 0], 'ไบ‘ๅ— ๆ›ฒ้–': [34053, 221, 301, 6577, 720, 986, 681, 405, 64, 114, 15, 91, 31, 6, 51, 19, 3, 2], 'ๅ››ๅท ๅพท้˜ณ': [39878, 293, 322, 7167, 942, 1517, 906, 606, 61, 146, 33, 151, 55, 15, 68, 19, 4, 2], '่ดตๅทž ้ป”ไธœๅ—': [46452, 327, 432, 9491, 855, 1420, 917, 503, 50, 110, 37, 141, 31, 21, 117, 7, 1, 1], 'ๆ–ฐ็–† ๅ้ฒ็•ช': [20335, 145, 260, 5100, 448, 664, 411, 217, 17, 66, 12, 73, 13, 12, 68, 10, 0, 1], 'ๆฒณๅ— ๅ‘จๅฃ': [46861, 292, 412, 8376, 926, 1137, 837, 553, 45, 174, 24, 129, 47, 12, 91, 29, 2, 1], 'ๅฎๅค': [53667, 357, 552, 11971, 1318, 1640, 1190, 603, 71, 286, 23, 220, 29, 10, 513, 20, 1, 0], '้ฆ™ๆธฏ ๆฒนๅฐ–ๆ—บๅŒบ': [4867, 26, 28, 895, 59, 217, 49, 45, 15, 12, 6, 7, 3, 1, 3, 0, 1, 0], 'ๅนฟไธœ ๆญ้˜ณ': [179087, 1577, 906, 18292, 1863, 3407, 2601, 1422, 84, 494, 41, 292, 135, 14, 256, 11, 3, 3], 'ๅนฟไธœ ๆฝฎๅทž': [109940, 561, 807, 19160, 3607, 3181, 1909, 1651, 153, 599, 43, 919, 68, 16, 112, 13, 2, 2], '่ดตๅทž': [69539, 438, 698, 13169, 1499, 2068, 1325, 784, 91, 324, 28, 261, 45, 21, 510, 14, 3, 1], 'ๆตทๅค– ไฟ„็ฝ—ๆ–ฏ': [24487, 218, 299, 5562, 579, 1187, 530, 379, 41, 96, 13, 97, 21, 6, 40, 13, 3, 0], 'ๅฑฑ่ฅฟ ๆœ”ๅทž': [33644, 273, 394, 7811, 864, 1063, 786, 395, 52, 110, 26, 128, 18, 16, 94, 21, 3, 1], '้‡ๅบ† ๆฑŸๆดฅๅธ‚': [12421, 81, 133, 2474, 242, 393, 264, 184, 16, 32, 10, 40, 8, 2, 16, 6, 3, 0], 'ๅ‰ๆž— ้€šๅŒ–': [60202, 371, 518, 11457, 1153, 1651, 1073, 576, 63, 129, 45, 191, 31, 18, 100, 12, 1, 0], '้‡ๅบ† ๅˆๅทๅŒบ': [13671, 194, 140, 2965, 302, 460, 288, 241, 15, 40, 10, 40, 12, 8, 20, 11, 0, 1], 'ๅคฉๆดฅ ๆปจๆตทๆ–ฐๅŒบ': [17255, 110, 203, 3075, 301, 454, 318, 291, 24, 61, 9, 45, 31, 3, 18, 16, 0, 0], 'ๅฑฑไธœ ๆท„ๅš': [86623, 450, 590, 13656, 1531, 2514, 1538, 1113, 135, 330, 54, 253, 105, 31, 190, 37, 6, 4], '็”˜่‚ƒ ๅฎš่ฅฟ': [24911, 203, 269, 6125, 528, 715, 589, 307, 40, 77, 17, 74, 13, 5, 46, 9, 0, 0], 'ๆฒณๅŒ— ๆฒงๅทž': [72074, 547, 575, 15830, 1406, 1953, 1547, 874, 94, 277, 45, 192, 82, 20, 118, 29, 3, 2], 'ๅ†…่’™ๅค ๅทดๅฝฆๆท–ๅฐ”็›Ÿ': [33927, 274, 376, 7410, 734, 990, 702, 400, 55, 98, 24, 99, 18, 10, 78, 15, 0, 1], 'ๅฑฑไธœ ่Žฑ่Šœ': [29541, 208, 257, 6180, 567, 935, 573, 319, 41, 86, 20, 101, 30, 11, 58, 8, 1, 0], 'ไธŠๆตท ๅฅ‰่ดคๅŒบ': [35130, 221, 319, 6726, 814, 1223, 704, 522, 50, 109, 30, 142, 52, 8, 38, 14, 0, 0], 'ๅ†…่’™ๅค ๅ‘ผไผฆ่ดๅฐ”': [40923, 328, 414, 9155, 917, 1313, 923, 552, 80, 135, 25, 157, 43, 16, 75, 21, 3, 1], 'ๅ†…่’™ๅค ้”กๆž—้ƒญๅ‹’็›Ÿ': [30267, 275, 367, 7163, 649, 963, 665, 420, 59, 92, 16, 118, 23, 10, 52, 13, 1, 1], 'ๅฐๆนพ ๅ…ถไป–': [95712, 616, 1400, 18251, 1957, 3206, 1873, 1118, 141, 298, 69, 356, 50, 30, 1299, 19, 1, 2], 'ๅ†…่’™ๅค ไนŒๆตท': [41386, 240, 403, 8438, 801, 1089, 812, 397, 45, 100, 26, 127, 20, 6, 136, 7, 0, 0], '้‡ๅบ† ๅคง่ถณๅŽฟ': [9695, 81, 92, 2235, 202, 344, 234, 139, 18, 43, 7, 21, 7, 4, 12, 6, 0, 0], 'ๅนฟไธœ ้˜ณๆฑŸ': [76547, 562, 710, 14899, 1325, 2476, 1614, 830, 48, 247, 34, 300, 45, 18, 91, 13, 1, 1], 'ๆ–ฐ็–† ๅšๅฐ”ๅก”ๆ‹‰': [21986, 195, 295, 5320, 496, 677, 502, 262, 33, 88, 20, 72, 10, 6, 37, 9, 3, 0], 'ๅฐๆนพ ๅฐไธœๅŽฟ': [7529, 44, 17, 1142, 87, 79, 70, 48, 11, 13, 3, 18, 2, 0, 312, 0, 0, 0], 'ๆฒณๅŒ— ้‚ขๅฐ': [72190, 419, 568, 12021, 1488, 1855, 1307, 802, 96, 238, 35, 167, 50, 23, 233, 22, 2, 0], 'ๅฑฑ่ฅฟ ๆ™‹ๅŸŽ': [44679, 345, 423, 9296, 1177, 1460, 936, 556, 73, 153, 37, 167, 46, 19, 80, 9, 1, 0], 'ๆฑŸ่ฅฟ ่ตฃๅทž': [110639, 773, 925, 22059, 2354, 2981, 2388, 1427, 145, 377, 57, 300, 141, 29, 224, 57, 10, 4], '้’ๆตท ้ป„ๅ—': [40283, 297, 517, 9657, 859, 1265, 828, 437, 143, 82, 32, 122, 14, 18, 824, 11, 1, 3], '้’ๆตท ๆžœๆด›': [41314, 305, 521, 9901, 835, 1370, 882, 423, 66, 108, 40, 153, 22, 12, 242, 12, 2, 1], 'ๅฎๅค ็Ÿณๅ˜ดๅฑฑ': [88484, 695, 1105, 19829, 1909, 2661, 1961, 986, 115, 218, 51, 312, 66, 23, 154, 21, 3, 0], 'ๅคฉๆดฅ ๅก˜ๆฒฝๅŒบ': [30922, 239, 263, 6143, 686, 987, 791, 422, 43, 128, 20, 104, 26, 12, 60, 18, 1, 0], 'ไบ‘ๅ— ๆ–‡ๅฑฑ': [25256, 201, 317, 5514, 543, 835, 513, 293, 49, 90, 12, 86, 20, 12, 41, 5, 2, 2], '้‡ๅบ† ้ป”ๆฑŸๅŒบ': [9676, 70, 100, 2202, 213, 336, 208, 129, 12, 23, 5, 28, 8, 4, 17, 4, 1, 1], 'ๅนฟ่ฅฟ ๅŒ—ๆตท': [43397, 273, 408, 7797, 778, 1285, 819, 534, 46, 129, 27, 146, 42, 14, 296, 13, 0, 0], 'ๅ››ๅท ่พพๅทž': [33841, 197, 287, 6027, 728, 1181, 725, 472, 47, 126, 19, 89, 29, 9, 173, 20, 1, 3], '็”˜่‚ƒ ๅบ†้˜ณ': [28057, 202, 301, 6582, 627, 856, 637, 306, 39, 92, 11, 99, 19, 7, 98, 7, 0, 0], 'ๆน–ๅŒ— ่†้—จ': [40467, 266, 419, 7769, 844, 1191, 851, 472, 46, 112, 28, 136, 33, 15, 62, 21, 0, 0], 'ไบ‘ๅ— ็บขๆฒณ': [33222, 203, 294, 6390, 693, 1056, 627, 425, 48, 100, 22, 114, 34, 4, 60, 15, 0, 2], '่ฅฟ่— ้‚ฃๆ›ฒ': [41527, 271, 541, 9865, 867, 1290, 861, 415, 65, 95, 40, 166, 30, 45, 143, 6, 0, 1], 'ไธŠๆตท ๅ—ๆฑ‡ๅŒบ': [26273, 209, 302, 5732, 545, 852, 588, 299, 36, 62, 13, 103, 29, 11, 37, 5, 1, 2], 'ๅฎ‰ๅพฝ ๅฎฟๅทž': [54277, 241, 377, 7403, 894, 1159, 807, 533, 55, 135, 19, 134, 59, 10, 138, 14, 2, 0], 'ๅฐๆนพ ๅ˜‰ไน‰ๅธ‚': [2856, 22, 23, 1067, 119, 83, 45, 29, 8, 6, 2, 25, 3, 0, 2, 0, 0, 0], 'ๅนฟไธœ ้Ÿถๅ…ณ': [100653, 547, 805, 16493, 1701, 2601, 2688, 1121, 69, 264, 34, 305, 76, 12, 148, 21, 1, 1], '่พฝๅฎ ่ฅๅฃ': [43229, 300, 389, 8837, 961, 1339, 876, 485, 61, 202, 20, 110, 31, 15, 63, 16, 1, 2], 'ๆฑŸ่ฅฟ ไนๆฑŸ': [76359, 479, 653, 13236, 1492, 2122, 1432, 1345, 90, 233, 43, 230, 71, 14, 216, 28, 3, 3], 'ๆน–ๅ— ๆน˜่ฅฟๅœŸๅฎถๆ—่‹—ๆ—่‡ชๆฒปๅทž': [29361, 243, 317, 6622, 673, 904, 604, 423, 50, 99, 13, 103, 23, 5, 57, 10, 0, 1], 'ๅ››ๅท ็”˜ๅญœ': [21994, 167, 224, 5223, 477, 793, 464, 216, 36, 59, 19, 58, 17, 4, 214, 7, 1, 1], 'ไบ‘ๅ— ่ฟชๅบ†': [26066, 181, 309, 5138, 464, 669, 506, 227, 34, 50, 10, 84, 10, 2, 123, 2, 1, 0], 'ไธŠๆตท ้’ๆตฆๅŒบ': [38028, 232, 346, 7049, 775, 1156, 680, 462, 62, 112, 29, 134, 33, 16, 46, 13, 1, 1], 'ๆฑŸ่‹ ่ฟžไบ‘ๆธฏ': [66734, 503, 504, 11042, 1421, 1808, 1240, 851, 82, 234, 40, 198, 58, 25, 155, 26, 0, 4], '็”˜่‚ƒ ๆญฆๅจ': [27292, 206, 284, 6493, 582, 734, 610, 286, 43, 68, 13, 100, 15, 8, 48, 10, 0, 0], 'ๅ‰ๆž— ็™ฝๅฑฑ': [48808, 329, 458, 10332, 894, 1340, 975, 536, 48, 2291, 30, 177, 33, 8, 82, 15, 2, 1], 'ๅ‰ๆž— ็™ฝๅŸŽ': [44171, 356, 455, 9785, 1005, 1338, 903, 518, 58, 111, 34, 162, 35, 22, 62, 20, 2, 1], 'ๆน–ๅ— ๆน˜ๆฝญ': [59563, 379, 489, 10143, 1038, 1614, 1080, 900, 62, 165, 30, 159, 59, 25, 183, 18, 4, 1], 'ๅคฉๆดฅ ้™ๆตทๅŽฟ': [20909, 139, 222, 4697, 465, 656, 438, 246, 25, 73, 13, 70, 16, 9, 24, 5, 3, 0], 'ๆตทๅค– ๅทด่ฅฟ': [22221, 138, 233, 4110, 435, 759, 434, 247, 41, 76, 13, 94, 13, 5, 42, 7, 1, 0], 'ๆน–ๅŒ— ๆฉๆ–ฝๅœŸๅฎถๆ—่‹—ๆ—่‡ชๆฒปๅทž': [37944, 275, 338, 7538, 782, 1208, 701, 490, 53, 135, 25, 105, 35, 11, 49, 9, 1, 2], 'ๅนฟไธœ ๆธ…่ฟœ': [81474, 544, 674, 14952, 1509, 2324, 1733, 1107, 65, 232, 37, 266, 71, 21, 180, 10, 1, 1], 'ๅนฟไธœ ่Œ‚ๅ': [90113, 625, 823, 17121, 2466, 2461, 1780, 1137, 87, 327, 43, 445, 78, 33, 152, 27, 1, 1], '้‡ๅบ† ๅทดๅ—ๅŒบ': [16536, 93, 152, 3038, 374, 553, 330, 289, 29, 46, 14, 47, 22, 10, 30, 4, 0, 1], 'ๆน–ๅŒ— ้„‚ๅทž': [37677, 272, 338, 6465, 620, 959, 634, 371, 37, 81, 20, 89, 24, 7, 49, 11, 0, 1], 'ๅฎ‰ๅพฝ ๅทขๆน–': [26730, 181, 259, 5909, 679, 937, 617, 323, 39, 88, 23, 196, 37, 13, 144, 7, 0, 1], 'ๅฑฑไธœ ่ŠๅŸŽ': [51509, 310, 389, 9115, 992, 1353, 1775, 635, 65, 190, 34, 159, 33, 14, 63, 22, 1, 0], '่พฝๅฎ ่‘ซ่Šฆๅฒ›': [39562, 286, 367, 8267, 909, 1380, 776, 504, 51, 143, 30, 147, 29, 11, 181, 13, 3, 1], 'ๆน–ๅ— ็›Š้˜ณ': [34180, 234, 356, 7306, 722, 1186, 757, 544, 42, 124, 22, 92, 29, 11, 176, 12, 1, 0], 'ๆตทๅค– ่’™ๅค': [1176, 11, 7, 482, 86, 92, 26, 28, 3, 4, 0, 34, 3, 0, 5, 1, 0, 0], '็”˜่‚ƒ ๅ˜‰ๅณชๅ…ณ': [47670, 234, 369, 7066, 694, 913, 694, 308, 41, 85, 16, 128, 24, 6, 69, 11, 2, 1], 'ๅนฟ่ฅฟ ่ดบๅทž': [30973, 261, 302, 6554, 686, 927, 630, 379, 213, 113, 19, 132, 22, 11, 113, 13, 2, 1], '่พฝๅฎ ๆœฌๆบช': [44511, 320, 384, 8096, 778, 1341, 904, 494, 48, 133, 23, 112, 33, 11, 69, 10, 2, 2], '้ฆ™ๆธฏ ๆนพไป”ๅŒบ': [4945, 19, 53, 1063, 112, 211, 79, 77, 9, 24, 1, 11, 6, 3, 7, 2, 0, 0], 'ๆตทๅ— ไธ‰ไบš': [139085, 1026, 1551, 31061, 3042, 4264, 2910, 1616, 177, 411, 83, 488, 99, 49, 280, 47, 5, 3], '้‡ๅบ† ็ŸณๆŸฑๅœŸๅฎถๆ—่‡ชๆฒปๅŽฟ': [8735, 68, 109, 2004, 192, 289, 166, 109, 11, 22, 11, 22, 5, 3, 12, 2, 0, 0], '้’ๆตท ๆตทๅ—': [44303, 363, 580, 10146, 928, 1285, 1000, 455, 51, 113, 36, 138, 28, 15, 199, 6, 3, 1], '่พฝๅฎ ้˜œๆ–ฐ': [33885, 252, 362, 7525, 784, 1035, 747, 424, 58, 119, 22, 127, 23, 25, 70, 13, 0, 0], 'ๅฐๆนพ': [51053, 294, 498, 9660, 1023, 1728, 1734, 626, 60, 162, 24, 135, 35, 16, 93, 12, 0, 1], 'ๆน–ๅ— ่กก้˜ณ': [62725, 423, 438, 11766, 1243, 1930, 1290, 1010, 122, 206, 42, 192, 80, 36, 1034, 20, 6, 1], 'ๆตทๅค– ่ฅฟ็ญ็‰™': [6914, 48, 42, 1310, 253, 436, 133, 176, 20, 135, 3, 62, 8, 1, 12, 4, 0, 0], 'ๆน–ๅ— ้ƒดๅทž': [49369, 317, 409, 8694, 959, 1338, 916, 700, 56, 128, 26, 142, 39, 21, 61, 18, 0, 1], 'ไธŠๆตท ๅฎๅฑฑๅŒบ': [64496, 378, 514, 10320, 1586, 2596, 1114, 1067, 87, 255, 40, 220, 74, 22, 115, 35, 6, 3], '้‡ๅบ† ่ฃๆ˜ŒๅŽฟ': [9868, 80, 87, 2282, 214, 372, 206, 105, 14, 33, 6, 24, 8, 3, 15, 6, 0, 0], '่ดตๅทž ้“œไป': [42945, 307, 491, 9762, 914, 1370, 1008, 521, 60, 126, 35, 157, 35, 22, 179, 9, 0, 0], 'ๅ››ๅท ๆ”€ๆž่Šฑ': [24736, 200, 234, 4786, 596, 830, 517, 264, 39, 67, 21, 90, 24, 16, 34, 7, 0, 0], '่พฝๅฎ ้”ฆๅทž': [46818, 334, 418, 9633, 1079, 1517, 960, 700, 54, 181, 30, 130, 30, 14, 156, 16, 2, 2], 'ไบ‘ๅ— ่ฅฟๅŒ็‰ˆ็บณ': [28622, 205, 333, 6184, 626, 946, 606, 318, 48, 90, 17, 105, 19, 8, 57, 13, 2, 1], '้’ๆตท': [62298, 350, 501, 11593, 3190, 1562, 1166, 569, 53, 139, 28, 199, 22, 13, 435, 23, 1, 0], '้‡ๅบ† ้…‰้˜ณๅœŸๅฎถๆ—่‹—ๆ—่‡ชๆฒปๅŽฟ': [8856, 76, 94, 2112, 201, 302, 222, 86, 68, 23, 12, 30, 6, 5, 12, 7, 0, 1], 'ไธŠๆตท ้—ธๅŒ—ๅŒบ': [58462, 389, 520, 9813, 1554, 2320, 1113, 905, 86, 173, 42, 250, 58, 27, 65, 28, 4, 1], 'ๆตทๅค– ๆณฐๅ›ฝ': [100712, 644, 300, 8436, 775, 4410, 1400, 475, 52, 109, 17, 109, 28, 6, 42, 11, 3, 1], 'ๆน–ๅŒ— ๅคฉ้—จ': [6276, 35, 37, 1788, 124, 164, 130, 77, 8, 20, 2, 37, 4, 2, 135, 2, 0, 0], 'ๅฎ‰ๅพฝ ้“œ้™ต': [31174, 226, 303, 6678, 839, 930, 673, 409, 47, 99, 31, 174, 28, 7, 921, 16, 6, 0], '้ป‘้พ™ๆฑŸ ้ฝ้ฝๅ“ˆๅฐ”': [62444, 321, 476, 11053, 1164, 1768, 1121, 739, 67, 201, 40, 201, 64, 19, 269, 29, 2, 2], 'ๅ‰ๆž— ๅ››ๅนณ': [56821, 424, 523, 11804, 1166, 1653, 1220, 606, 57, 175, 33, 180, 49, 18, 385, 21, 3, 0], 'ๅฑฑ่ฅฟ ๅคงๅŒ': [54777, 387, 538, 10646, 1067, 1547, 1032, 664, 99, 190, 39, 166, 75, 17, 486, 23, 3, 5], '็”˜่‚ƒ ้‡‘ๆ˜Œ': [41424, 295, 499, 8021, 769, 1078, 811, 385, 56, 98, 25, 127, 16, 11, 85, 8, 0, 2], 'ๅ†…่’™ๅค ๅ…ดๅฎ‰็›Ÿ': [30851, 248, 332, 7255, 685, 971, 752, 347, 39, 97, 40, 119, 29, 8, 130, 17, 1, 1], 'ๆ–ฐ็–† ็Ÿณๆฒณๅญ': [6058, 50, 45, 2054, 172, 259, 151, 135, 10, 30, 22, 23, 9, 7, 10, 5, 1, 0], 'ๅ››ๅท ้‚ๅฎ': [27111, 179, 240, 6261, 586, 988, 609, 363, 40, 87, 20, 114, 28, 16, 45, 10, 0, 0], 'ๅ†…่’™ๅค ่ตคๅณฐ': [55301, 365, 446, 10592, 987, 1454, 1056, 585, 52, 309, 31, 127, 33, 16, 74, 19, 1, 1], '้ป‘้พ™ๆฑŸ ๅคงๅ…ดๅฎ‰ๅฒญ': [24997, 214, 299, 5933, 564, 790, 574, 258, 41, 84, 21, 80, 6, 8, 43, 9, 1, 0], '่ฅฟ่— ๅฑฑๅ—': [42087, 285, 473, 9628, 847, 1217, 825, 409, 63, 85, 24, 150, 19, 9, 168, 11, 0, 1], 'ๅฑฑ่ฅฟ ๆ™‹ไธญ': [53068, 346, 478, 10192, 1073, 1514, 1166, 603, 70, 178, 40, 163, 45, 16, 88, 22, 2, 1], 'ๆ–ฐ็–† ้˜ฟๅ…‹่‹': [24459, 154, 286, 5495, 583, 767, 484, 267, 48, 86, 12, 93, 14, 6, 78, 8, 1, 1], 'ๅคฉๆดฅ ๅ—ๅผ€ๅŒบ': [69455, 434, 540, 10048, 1415, 2383, 1173, 1080, 103, 202, 47, 215, 78, 25, 92, 37, 3, 1], '้‡ๅบ† ็’งๅฑฑๅŽฟ': [9666, 78, 77, 2200, 217, 323, 201, 127, 16, 27, 15, 31, 4, 1, 17, 2, 0, 1], 'ๅนฟ่ฅฟ ๆขงๅทž': [43419, 677, 416, 8246, 873, 1298, 886, 529, 41, 156, 29, 118, 56, 11, 72, 14, 2, 1], '้‡ๅบ† ๆขๅนณๅŽฟ': [8795, 79, 91, 2070, 178, 291, 212, 99, 15, 31, 2, 31, 11, 3, 10, 3, 0, 0], 'ๅฐๆนพ ้ซ˜้›„ๅธ‚': [92910, 692, 1211, 18359, 1893, 3081, 1945, 1099, 126, 242, 65, 255, 56, 39, 158, 25, 3, 2], 'ๅนฟไธœ ๆฑ•ๅฐพ': [73967, 541, 676, 13285, 1264, 2022, 1515, 876, 70, 235, 32, 211, 51, 10, 114, 7, 2, 3], 'ๆตทๅ—': [78761, 448, 662, 14888, 1702, 2196, 1417, 791, 93, 211, 39, 339, 43, 18, 1209, 33, 3, 0], '้‡ๅบ† ๅฟ ๅŽฟ': [9290, 74, 109, 2030, 178, 315, 200, 97, 15, 35, 8, 30, 4, 3, 16, 0, 1, 0], 'ไบ‘ๅ— ไธฝๆฑŸ': [37117, 222, 280, 7345, 807, 1070, 686, 426, 58, 93, 35, 99, 30, 9, 402, 10, 1, 0], 'ๅ†…่’™ๅค ้˜ฟๆ‹‰ๅ–„็›Ÿ': [26435, 179, 319, 6065, 556, 784, 524, 279, 37, 74, 15, 92, 17, 9, 48, 10, 0, 1], '็”˜่‚ƒ ไธดๅค': [23488, 186, 283, 5464, 530, 691, 513, 249, 60, 55, 21, 87, 15, 7, 369, 8, 2, 0], '้‡ๅบ† ้•ฟๅฏฟๅŒบ': [10436, 63, 128, 2371, 212, 404, 221, 165, 17, 45, 6, 37, 11, 5, 68, 4, 1, 0], 'ๆน–ๅ— ๆ€€ๅŒ–': [42858, 325, 406, 8478, 924, 1417, 860, 696, 61, 147, 34, 160, 43, 11, 117, 12, 2, 1], 'ๅ››ๅท ๅนฟๅ…ƒ': [32232, 197, 244, 5329, 632, 848, 565, 341, 32, 117, 8, 97, 20, 8, 45, 7, 2, 2], 'ๅคฉๆดฅ ๅคงๆธฏๅŒบ': [21967, 166, 216, 4969, 494, 752, 486, 283, 24, 74, 13, 86, 16, 2, 25, 4, 0, 2], '็”˜่‚ƒ ๅผ ๆŽ–': [25232, 233, 302, 6208, 563, 825, 589, 316, 33, 85, 26, 94, 10, 10, 43, 7, 1, 1], '้‡ๅบ† ไบ‘้˜ณๅŽฟ': [9312, 70, 109, 2115, 208, 299, 213, 138, 8, 21, 8, 24, 8, 1, 20, 2, 0, 0], 'ๆ–ฐ็–† ๅ’Œ็”ฐ': [20945, 164, 291, 5201, 438, 658, 440, 230, 25, 65, 15, 80, 15, 9, 37, 5, 1, 0], 'ๅ››ๅท ็œ‰ๅฑฑ': [27555, 195, 260, 5466, 605, 895, 604, 312, 41, 97, 12, 81, 28, 4, 32, 16, 0, 0], '้‡ๅบ† ๅฝญๆฐด่‹—ๆ—ๅœŸๅฎถๆ—่‡ชๆฒปๅŽฟ': [8997, 62, 101, 2101, 182, 272, 211, 124, 9, 20, 4, 21, 7, 3, 12, 2, 1, 0], '้ป‘้พ™ๆฑŸ ้ธก่ฅฟ': [50251, 262, 354, 8323, 827, 1163, 826, 421, 48, 114, 27, 117, 25, 18, 116, 11, 1, 1], '็”˜่‚ƒ ๅนณๅ‡‰': [29955, 225, 278, 6135, 627, 848, 646, 301, 36, 74, 29, 107, 14, 8, 148, 6, 1, 1], 'ๅ››ๅท ่ต„้˜ณ': [28370, 198, 251, 5039, 569, 841, 525, 337, 38, 80, 12, 77, 25, 6, 87, 11, 1, 1], 'ๆพณ้—จ ๆฐนไป”': [4171, 35, 31, 1675, 87, 166, 73, 40, 16, 13, 3, 13, 1, 4, 2, 2, 1, 0], '้ฆ™ๆธฏ ็ฆปๅฒ›ๅŒบ': [53693, 309, 146, 4997, 444, 388, 415, 413, 14, 55, 3, 110, 1, 1, 1513, 7, 0, 0], 'ๆตทๅค– ็‘žๅ…ธ': [3956, 17, 46, 772, 125, 231, 83, 92, 21, 26, 6, 43, 2, 0, 8, 3, 0, 1], 'ๅ››ๅท ่‡ช่ดก': [29263, 226, 259, 5561, 667, 1055, 610, 439, 33, 96, 24, 94, 34, 11, 36, 13, 0, 1], '้™•่ฅฟ ๅปถๅฎ‰': [42821, 320, 433, 9345, 984, 1233, 889, 539, 71, 132, 28, 123, 39, 13, 141, 12, 1, 1], 'ๅฎ‰ๅพฝ ๆทฎๅ—': [45775, 331, 398, 8903, 1293, 1457, 984, 623, 45, 149, 24, 258, 46, 15, 76, 24, 1, 0], '้’ๆตท ๆตทๅŒ—': [41214, 292, 494, 9479, 816, 1204, 831, 425, 61, 110, 22, 150, 23, 14, 141, 10, 1, 0], 'ๅฐๆนพ ๅฝฐๅŒ–ๅŽฟ': [5069, 35, 19, 1279, 102, 78, 90, 56, 8, 12, 2, 20, 0, 1, 197, 0, 0, 0], 'ๆตทๅค– ่ถŠๅ—': [19968, 117, 231, 4345, 480, 728, 451, 298, 38, 47, 14, 89, 14, 13, 30, 2, 0, 0], 'ไบ‘ๅ— ๆฅš้›„': [25724, 197, 267, 5639, 557, 783, 534, 308, 38, 80, 21, 102, 22, 6, 113, 14, 0, 1], 'ๆตทๅค– ่ฒๅพ‹ๅฎพ': [19311, 134, 232, 3835, 433, 654, 430, 237, 85, 60, 8, 82, 7, 5, 33, 2, 2, 0], 'ๆตทๅค– ๅฐๅฐผ': [20612, 139, 232, 4287, 434, 698, 413, 223, 21, 65, 14, 70, 16, 6, 39, 6, 0, 0], 'ๆตทๅค– ๆŒชๅจ': [5500, 34, 22, 3935, 135, 226, 332, 116, 12, 21, 2, 49, 6, 0, 10, 4, 1, 0], '่ฅฟ่— ๆ—ฅๅ–€ๅˆ™': [42807, 310, 502, 10299, 978, 1271, 962, 486, 67, 120, 35, 157, 24, 17, 76, 7, 2, 0], 'ๅคฉๆดฅ ๆฑ‰ๆฒฝๅŒบ': [17424, 142, 229, 4171, 378, 555, 393, 176, 36, 46, 15, 66, 11, 8, 31, 3, 2, 0], 'ๅฐๆนพ ๆ–ฐๅŒ—ๅธ‚': [5635, 14, 29, 1195, 82, 214, 95, 74, 7, 18, 5, 9, 5, 1, 3, 0, 0, 0], 'ๆตทๅค– ๅŒˆ็‰™ๅˆฉ': [1223, 9, 14, 438, 62, 82, 16, 28, 1, 10, 1, 18, 4, 2, 3, 1, 0, 0], '้‡ๅบ† ๅทซๅฑฑๅŽฟ': [5837, 54, 73, 1481, 103, 181, 123, 78, 10, 12, 3, 15, 7, 0, 11, 2, 0, 0], '้‡ๅบ† ๅฅ‰่Š‚ๅŽฟ': [11687, 87, 149, 2236, 238, 316, 215, 143, 13, 25, 7, 30, 3, 5, 23, 2, 1, 0], 'ๅฐๆนพ ๅ—ๆŠ•ๅŽฟ': [7759, 26, 26, 1009, 96, 85, 85, 38, 9, 14, 2, 10, 1, 1, 95, 2, 0, 0], '้‡ๅบ† ๅคงๆธกๅฃๅŒบ': [18203, 100, 151, 3408, 367, 581, 335, 196, 20, 49, 17, 68, 21, 5, 19, 10, 0, 0], 'ๆตทๅค– ๅœŸ่€ณๅ…ถ': [6789, 9, 14, 457, 82, 134, 30, 40, 1, 12, 3, 33, 2, 4, 5, 0, 0, 0], 'ๆตทๅค– ๅธŒ่…Š': [4204, 32, 18, 884, 128, 266, 64, 104, 5, 16, 4, 51, 7, 1, 6, 2, 0, 1], 'ๆฒณๅ— ้ฉป้ฉฌๅบ—': [40340, 251, 350, 7912, 879, 1216, 804, 534, 57, 152, 26, 119, 37, 15, 75, 15, 1, 1], 'ไบ‘ๅ— ๆ™ฎๆดฑ': [28164, 199, 256, 6245, 534, 851, 629, 309, 37, 99, 13, 66, 27, 12, 67, 12, 2, 2], '้‡ๅบ† ๅŒ—็ขšๅŒบ': [25250, 119, 351, 10138, 474, 694, 1159, 351, 22, 72, 15, 106, 23, 3, 33, 15, 51, 11], '้ป‘้พ™ๆฑŸ ๅŒ้ธญๅฑฑ': [38485, 267, 326, 7535, 710, 1069, 768, 370, 51, 92, 21, 120, 26, 6, 96, 8, 1, 0], 'ๆตทๅค– ไนŒๅ…‹ๅ…ฐ': [1298, 7, 5, 457, 71, 79, 24, 28, 6, 15, 0, 32, 1, 1, 1, 1, 0, 0], 'ๅ†…่’™ๅค ไนŒๅ…ฐๅฏŸๅธƒๅธ‚': [29080, 226, 341, 6921, 605, 885, 643, 303, 58, 113, 18, 104, 15, 9, 332, 17, 1, 1], 'ๅ†…่’™ๅค': [74319, 480, 650, 15594, 1733, 2156, 1573, 905, 93, 266, 42, 308, 38, 19, 424, 24, 1, 1], 'ๆตทๅค– ๆ„ๅคงๅˆฉ': [10870, 64, 52, 1924, 245, 730, 171, 233, 16, 49, 7, 59, 15, 3, 18, 8, 0, 1], 'ๆตทๅค– ็ˆฑๅฐ”ๅ…ฐ': [5784, 25, 31, 1043, 201, 257, 115, 137, 10, 44, 3, 48, 9, 7, 4, 6, 0, 0], 'ๆตทๅค– ๆฒ™็‰น้˜ฟๆ‹‰ไผฏ': [4671, 32, 38, 851, 211, 368, 95, 144, 18, 27, 3, 57, 8, 4, 10, 8, 1, 1], 'ๆตทๅค– ๅฐๅบฆ': [18881, 145, 300, 4302, 486, 646, 412, 270, 35, 59, 19, 80, 14, 11, 40, 8, 0, 0], 'ๆฒณๅ— ๆตŽๆบ': [5724, 32, 42, 1581, 111, 129, 108, 84, 8, 15, 1, 27, 12, 3, 11, 4, 1, 0], '้ฆ™ๆธฏ ๅŒ—ๅŒบ': [2503, 16, 13, 741, 37, 88, 28, 26, 14, 5, 0, 10, 0, 1, 3, 1, 0, 0], 'ๆน–ๅŒ— ไป™ๆกƒ': [7708, 61, 57, 1945, 170, 224, 159, 110, 4, 27, 9, 34, 14, 0, 31, 1, 0, 0], '้‡ๅบ† ๆฝผๅ—ๅŽฟ': [9851, 97, 114, 2110, 202, 308, 193, 99, 14, 30, 6, 29, 4, 4, 19, 4, 0, 0], 'ๆตทๅค– ๅŸƒๅŠ': [2207, 14, 16, 657, 107, 210, 35, 42, 5, 25, 3, 37, 5, 0, 4, 1, 0, 0], '้‡ๅบ† ๆฐธๅทๅŒบ': [14139, 92, 156, 2895, 301, 495, 320, 245, 22, 43, 8, 40, 11, 8, 15, 3, 1, 1], 'ไบ‘ๅ— ๆ˜ญ้€š': [25546, 215, 355, 5641, 565, 924, 546, 312, 32, 86, 15, 94, 23, 9, 35, 10, 1, 1], 'ๆฒณๅŒ— ๆ‰ฟๅพท': [47791, 344, 533, 10300, 1046, 1445, 1022, 697, 71, 164, 29, 149, 40, 21, 151, 24, 5, 2], 'ๆน–ๅŒ— ็ฅžๅ†œๆžถ': [5535, 55, 35, 2037, 110, 119, 121, 95, 7, 10, 2, 19, 4, 0, 11, 3, 0, 0], '้‡ๅบ† ๅŸŽๅฃๅŽฟ': [7820, 66, 83, 1887, 147, 253, 146, 94, 12, 29, 9, 27, 8, 1, 13, 1, 0, 0], 'ๆตทๅค– ๅ“ฅไผฆๆฏ”ไบš': [1360, 8, 9, 543, 141, 60, 26, 34, 10, 14, 0, 23, 0, 1, 3, 3, 0, 0], 'ๆตทๅค– ไธน้บฆ': [3471, 18, 26, 761, 135, 181, 74, 90, 12, 19, 3, 30, 2, 1, 11, 4, 0, 0], 'ๆ–ฐ็–† ้˜ฟๅ‹’ๆณฐ': [21060, 148, 264, 5057, 470, 776, 439, 270, 276, 56, 24, 120, 14, 7, 104, 7, 0, 0], 'ๆน–ๅŒ— ้ป„็Ÿณ': [44434, 316, 427, 8652, 967, 1303, 975, 686, 52, 144, 22, 130, 42, 19, 117, 33, 6, 2], 'ๅฐๆนพ ๆ–ฐ็ซนๅŽฟ': [3492, 58, 23, 1091, 80, 75, 85, 174, 11, 16, 0, 21, 1, 0, 18, 0, 0, 0], '้‡ๅบ† ๆญฆ้š†ๅŽฟ': [8683, 81, 83, 1938, 189, 288, 214, 87, 5, 19, 4, 23, 4, 4, 10, 5, 0, 0], 'ๆตทๅค– ๆ–ฐ่ฅฟๅ…ฐ': [15620, 69, 75, 1626, 303, 644, 236, 233, 19, 54, 7, 65, 20, 8, 25, 11, 1, 0], 'ๅŒ—ไบฌ ๅปถๅบ†ๅŽฟ': [21219, 127, 232, 4565, 473, 669, 446, 236, 33, 50, 14, 84, 14, 13, 31, 11, 1, 1], '้‡ๅบ† ๅžซๆฑŸๅŽฟ': [8757, 75, 101, 1898, 192, 308, 189, 99, 14, 30, 5, 26, 5, 1, 16, 2, 0, 0], '้ฆ™ๆธฏ ่ง‚ๅก˜ๅŒบ': [3554, 23, 25, 983, 66, 192, 61, 37, 6, 8, 7, 7, 4, 2, 6, 1, 0, 0], 'ๆ–ฐ็–† ๅ–€ไป€': [26245, 157, 289, 5429, 493, 774, 522, 277, 45, 74, 17, 73, 23, 10, 1046, 4, 1, 1], '้‡ๅบ† ไธฐ้ƒฝๅŽฟ': [9555, 63, 109, 1956, 186, 311, 191, 101, 11, 40, 4, 23, 4, 4, 7, 3, 1, 0], 'ๅ››ๅท ๅนฟๅฎ‰': [27966, 215, 262, 5415, 526, 844, 578, 354, 43, 108, 15, 80, 26, 6, 167, 9, 0, 1], 'ๅฎๅค ไธญๅซ': [7159, 46, 39, 2624, 184, 166, 126, 63, 7, 24, 3, 34, 12, 2, 8, 3, 0, 0], 'ๅคฉๆดฅ ไฟ็จŽๅŒบ': [3771, 42, 29, 1485, 69, 59, 70, 38, 1, 10, 2, 9, 2, 0, 8, 2, 0, 0], 'ๅคฉๆดฅ ๅฎๆฒณๅŽฟ': [17887, 152, 208, 4148, 378, 606, 389, 206, 84, 74, 15, 49, 12, 3, 29, 2, 0, 0], '้‡ๅบ† ้“œๆขๅŽฟ': [9730, 172, 117, 2235, 217, 356, 201, 110, 17, 26, 7, 31, 7, 2, 16, 1, 0, 0], 'ๅนฟ่ฅฟ ๅด‡ๅทฆ': [5796, 44, 49, 1721, 131, 144, 116, 70, 8, 21, 0, 28, 9, 0, 9, 0, 0, 0], 'ๅ››ๅท ๅทดไธญ': [23204, 173, 234, 4807, 540, 756, 519, 331, 70, 69, 21, 56, 28, 9, 31, 10, 2, 0], '้‡ๅบ† ๅผ€ๅŽฟ': [10442, 90, 118, 2392, 226, 382, 249, 152, 14, 50, 7, 28, 7, 3, 14, 2, 0, 0], 'ๆตทๅค– ่Šฌๅ…ฐ': [2749, 16, 30, 610, 132, 193, 60, 99, 11, 21, 1, 37, 7, 2, 5, 2, 0, 0], '็”˜่‚ƒ': [82808, 432, 649, 14156, 1493, 1946, 1346, 1196, 86, 239, 35, 265, 40, 20, 1078, 42, 3, 0], 'ๆตทๅค– ๅขจ่ฅฟๅ“ฅ': [824, 9, 1, 385, 63, 49, 23, 12, 5, 3, 0, 21, 0, 1, 4, 0, 0, 0], '้‡ๅบ† ๅ—ๅทๅŒบ': [9916, 84, 90, 2041, 173, 333, 199, 152, 9, 25, 5, 27, 6, 4, 20, 3, 0, 0], 'ๅฐๆนพ ๅŸบ้š†ๅธ‚': [2957, 22, 14, 889, 75, 109, 71, 50, 1, 3, 1, 10, 4, 0, 1, 0, 0, 0], 'ๅฐๆนพ ๆ–ฐ็ซนๅธ‚': [3698, 37, 22, 988, 105, 111, 68, 41, 8, 8, 2, 7, 2, 1, 5, 1, 0, 2], 'ๆตทๅค– ๆฏ”ๅˆฉๆ—ถ': [2346, 13, 18, 537, 110, 146, 31, 42, 6, 25, 3, 28, 6, 7, 7, 5, 0, 0], 'ๆตทๅค– ้˜ฟๆ นๅปท': [1806, 8, 8, 487, 80, 127, 37, 50, 4, 18, 3, 40, 3, 0, 3, 0, 0, 0], 'ๆตทๅค– ๅ—้ž': [1268, 13, 10, 507, 76, 72, 33, 25, 2, 2, 0, 40, 0, 1, 2, 0, 0, 0], '้ฆ™ๆธฏ ่ฅฟ่ดกๅŒบ': [3237, 4, 12, 742, 45, 116, 40, 35, 6, 8, 1, 4, 2, 0, 2, 4, 0, 0], '้ฆ™ๆธฏ ๆทฑๆฐดๅŸ—ๅŒบ': [3527, 16, 19, 969, 50, 73, 41, 19, 6, 11, 1, 6, 0, 0, 103, 2, 0, 0], '้ฆ™ๆธฏ ้ป„ๅคงไป™ๅŒบ': [4542, 15, 21, 862, 52, 94, 43, 29, 13, 14, 1, 17, 3, 0, 4, 0, 0, 1], 'ๆพณ้—จ ๅคงๅ ‚ๅŒบ': [2542, 26, 18, 1690, 60, 71, 63, 15, 13, 6, 1, 3, 1, 0, 2, 0, 1, 0], 'ๆน–ๅŒ— ๆฝœๆฑŸ': [8646, 41, 47, 1836, 131, 196, 124, 75, 6, 18, 1, 22, 4, 5, 74, 2, 0, 0], 'ๅฐๆนพ ๅฐไธญๅŽฟ': [4312, 30, 34, 1125, 68, 66, 67, 65, 4, 15, 0, 8, 1, 0, 517, 1, 0, 0], '้‡ๅบ† ็ง€ๅฑฑๅœŸๅฎถๆ—่‹—ๆ—่‡ชๆฒปๅŽฟ': [8708, 72, 121, 2059, 172, 258, 192, 104, 17, 28, 10, 25, 2, 3, 11, 0, 1, 1], '้‡ๅบ† ๅทซๆบชๅŽฟ': [8271, 82, 92, 1891, 176, 251, 173, 95, 15, 33, 4, 35, 5, 2, 11, 2, 0, 0], '้‡ๅบ† ไธ‡็››ๅŒบ': [12022, 60, 92, 2076, 195, 271, 207, 106, 19, 25, 6, 39, 7, 1, 22, 2, 0, 0], 'ๆพณ้—จ ้ฃŽ้กบๅ ‚ๅŒบ': [2487, 27, 16, 1493, 57, 58, 39, 35, 19, 1, 2, 3, 4, 0, 4, 1, 4, 0], 'ๆพณ้—จ ่ทฏ็Žฏ': [2264, 15, 3, 1383, 66, 39, 37, 11, 11, 3, 1, 5, 0, 2, 2, 0, 0, 0], '้ฆ™ๆธฏ ๅฑฏ้—จๅŒบ': [2321, 22, 6, 801, 42, 90, 51, 31, 8, 8, 0, 5, 2, 0, 5, 2, 0, 0], '้ฆ™ๆธฏ ๅ…ƒๆœ—ๅŒบ': [3554, 20, 12, 906, 56, 170, 76, 41, 6, 7, 1, 5, 6, 0, 81, 1, 1, 0], 'ๅฐๆนพ ่Šฑ่ŽฒๅŽฟ': [1213, 5, 9, 510, 57, 74, 37, 14, 3, 3, 0, 3, 0, 0, 0, 0, 0, 0], '้ฆ™ๆธฏ ่ƒๆนพๅŒบ': [2532, 11, 11, 710, 42, 103, 37, 24, 3, 11, 1, 10, 1, 1, 4, 3, 0, 0], 'ๆตทๅค– ๅฅฅๅœฐๅˆฉ': [2360, 16, 14, 560, 94, 133, 50, 47, 5, 15, 2, 38, 3, 1, 5, 1, 0, 0], 'ๆตทๅค– ไผŠๆœ—': [1166, 5, 14, 394, 93, 76, 16, 28, 4, 5, 0, 30, 1, 1, 0, 0, 0, 0], 'ๅฐๆนพ ๆกƒๅ›ญๅŽฟ': [3358, 6, 22, 897, 72, 107, 58, 68, 5, 8, 0, 11, 8, 0, 2, 1, 0, 0], 'ๆตทๅค– ็™ฝไฟ„็ฝ—ๆ–ฏ': [1465, 8, 21, 463, 70, 45, 10, 30, 3, 17, 0, 26, 1, 0, 1, 0, 0, 0], 'ๅฐๆนพ ๅฑไธœๅŽฟ': [1565, 9, 4, 586, 32, 33, 26, 19, 2, 4, 1, 6, 0, 0, 0, 0, 0, 0], '้ฆ™ๆธฏ ๅคงๅŸ”ๅŒบ': [1558, 17, 12, 587, 28, 64, 33, 33, 4, 5, 4, 7, 2, 1, 0, 1, 0, 0], '้ฆ™ๆธฏ ่‘ต้’ๅŒบ': [2732, 9, 11, 674, 32, 68, 36, 34, 2, 7, 1, 1, 2, 0, 2, 1, 0, 0], 'ๅฐๆนพ ๅ˜‰ไน‰ๅŽฟ': [1279, 5, 4, 663, 29, 28, 19, 11, 2, 0, 1, 3, 1, 0, 1, 0, 0, 0], 'ๆตทๅค– ่‘ก่„็‰™': [1192, 5, 5, 445, 72, 80, 17, 36, 5, 21, 0, 30, 3, 0, 2, 0, 0, 0], '้ฆ™ๆธฏ ๅ—ๅŒบ': [1918, 12, 17, 728, 55, 73, 43, 29, 8, 9, 2, 3, 2, 0, 4, 0, 0, 0], 'ๆพณ้—จ ๆœ›ๅพทๅ ‚ๅŒบ': [2138, 15, 10, 1456, 50, 36, 39, 18, 7, 4, 1, 1, 0, 0, 3, 0, 0, 0], 'ๅฐๆนพ ้ซ˜้›„ๅŽฟ': [1285, 7, 7, 631, 19, 21, 22, 16, 2, 4, 0, 1, 0, 0, 0, 0, 1, 0], 'ๆพณ้—จ ๅœฃๅฎ‰ๅคšๅฐผๅ ‚ๅŒบ': [2813, 27, 11, 1390, 61, 82, 62, 35, 16, 8, 1, 4, 2, 0, 4, 2, 0, 0], 'ๅฐๆนพ ๅฎœๅ…ฐๅŽฟ': [1391, 6, 8, 588, 32, 41, 27, 10, 0, 3, 3, 4, 3, 0, 1, 2, 1, 0], 'ๅฐๆนพ ่‹—ๆ —ๅŽฟ': [10642, 57, 23, 1005, 85, 68, 81, 174, 9, 16, 0, 15, 2, 0, 135, 1, 1, 0], 'ๆตทๅค– ๅคๅทด': [1410, 8, 17, 454, 115, 113, 32, 52, 5, 18, 0, 35, 2, 1, 1, 3, 0, 0], 'ๆตทๅค– ๆณขๅ…ฐ': [1492, 11, 6, 362, 65, 61, 27, 32, 3, 23, 0, 28, 0, 0, 0, 0, 0, 0], 'ๅฐๆนพ ไบ‘ๆž—ๅŽฟ': [1214, 16, 4, 651, 32, 23, 14, 6, 4, 6, 1, 3, 2, 1, 0, 0, 0, 0], 'ๅฐๆนพ ๅฐๅ—ๅŽฟ': [1007, 11, 6, 596, 28, 30, 17, 14, 5, 3, 0, 1, 1, 0, 2, 0, 0, 0], 'ๅฐๆนพ ๆพŽๆน–ๅŽฟ': [5624, 40, 21, 1036, 83, 54, 81, 25, 4, 13, 1, 16, 0, 0, 281, 0, 0, 0], '': [202, 1, 0, 48, 3, 11, 4, 9, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0]} province_list = ['ๅŒ—ไบฌ', 'ๅคฉๆดฅ', 'ๅ†…่’™ๅค', 'ๆ–ฐ็–†', 'ๆฒณๅŒ—', '็”˜่‚ƒ', 'ๅฎๅค', 'ๅฑฑ่ฅฟ', '้™•่ฅฟ', '้’ๆตท', 'ๅฑฑไธœ', 'ๆฒณๅ—', 'ๅฎ‰ๅพฝ', '่พฝๅฎ', 'ๅ‰ๆž—', '้ป‘้พ™ๆฑŸ', 'ๆฑŸ่‹', 'ๆต™ๆฑŸ', 'ไธŠๆตท', 'ๆน–ๅŒ—', 'ๆน–ๅ—', 'ๅ››ๅท', '้‡ๅบ†', '่ดตๅทž', 'ไบ‘ๅ—', 'ๅนฟ่ฅฟ', 'ๆฑŸ่ฅฟ', '็ฆๅปบ', 'ๅนฟไธœ', 'ๆตทๅ—', '่ฅฟ่—'] keyword_province = province_dic(province_list,keyword_location) keyword_location_emotion = read_keyword_location_emotion(keyword_location_emotion_file) keyword_province_emotion_dic = keyword_province_emotion(province_list,keyword_location_emotion) # print(keyword_province_emotion_dic) dreamvector_dic = generate_dreamvector(keyword_list,province_list,keyword_province,emotion_list,keyword_province_emotion_dic) print(dreamvector_dic) dreamvector_percent_dic = dreamvector_dic_topercent(province_list,emotion_list,dreamvector_dic) #shang # shang_dic = province_emotion_shang(dreamvector_dic,len(province_list),len(emotion_list)) # shang_dic = {'ๅฅๅบท': {'province_shang': 4.614931341259213, 'emotion_shang': 1.7425643297013043},'ไบ‹ไธšๆœ‰ๆˆ': {'province_shang': 4.6637099637881985, 'emotion_shang': 1.330961168845477},'ๅ‘ๅฑ•ๆœบไผš': {'province_shang': 4.646693383284832, 'emotion_shang': 1.6815369339421364},'็”Ÿๆดปๅนธ็ฆ': {'province_shang': 4.676081956069652, 'emotion_shang': 1.326266607438356},'ๆœ‰ๆˆฟ': {'province_shang': 4.450996265928352, 'emotion_shang': 1.8512545823922906},'ๅ‡บๅ': {'province_shang': 4.60629078639634, 'emotion_shang': 1.7926907030973753},'ๅฎถๅบญๅนธ็ฆ': {'province_shang': 4.645193087395395, 'emotion_shang': 1.4111918296202708},'ๅฅฝๅทฅไฝœ': {'province_shang': 4.5806270617437725, 'emotion_shang': 1.699848118852902},'ๅนณ็ญ‰ๆœบไผš': {'province_shang': 4.535844884956961, 'emotion_shang': 1.8934531097785894},'็™ฝๆ‰‹่ตทๅฎถ': {'province_shang': 4.576773617415558, 'emotion_shang': 1.4671189161848104},'ๆˆไธบๅฏŒไบบ': {'province_shang': 4.610419305107782, 'emotion_shang': 1.806871317347328},'ไธชไฝ“่‡ช็”ฑ': {'province_shang': 3.8793067156561394, 'emotion_shang': 1.3132859350989219},'ๅฎ‰ไบซๆ™šๅนด': {'province_shang': 4.532088162152894, 'emotion_shang': 1.7959849012260913},'ๆ”ถๅ…ฅ่ถณๅคŸ': {'province_shang': 4.44449133972484, 'emotion_shang': 1.8576476312107724},'ไธชไบบๅŠชๅŠ›': {'province_shang': 4.724085178174252, 'emotion_shang': 1.1191634015490641},'็ฅ–ๅ›ฝๅผบๅคง': {'province_shang': 4.611218815596922, 'emotion_shang': 1.549148587597116},'ไธญๅ›ฝ็ปๆตŽๆŒ็ปญๅ‘ๅฑ•': {'province_shang': 3.82186193262807, 'emotion_shang': 1.5304930567574826},'็ˆถ่พˆๆ›ดๅฅฝ': {'province_shang': 4.541929022026666, 'emotion_shang': 1.9182958340544896}} #columns name columns_name = [] for current_province in province_list: columns_name.append(current_province) for current_emotion in emotion_list: columns_name.append(current_emotion) # dreamvector [็œ1๏ผŒ็œ2๏ผŒ...,็œ31,ๆƒ…ๆ„Ÿ0,ๆƒ…ๆ„Ÿ1,ๆƒ…ๆ„Ÿ3,ๆƒ…ๆ„Ÿ4,ๆƒ…ๆ„Ÿ5] dreamvector_dataframe = pd.DataFrame.from_dict(dreamvector_percent_dic, orient='index',columns = columns_name) print(dreamvector_dataframe) # ไธ้œ€่ฆๅˆ—ๆ ‡ๅ‡†ๅŒ– #ๅˆ—ๆ ‡ๅ‡†ๅŒ–็š„ๆขฆๅ‘้‡ # dreamvector_dataframe_standardized = dreamvector_dataframe.apply(lambda x: (x-np.mean(x))/np.std(x,ddof=1)) # print(dreamvector_dataframe_standardized) ## Parallel Coordinate # draw_parallel_coordinate(dreamvector_dataframe_standardized) #chๆŒ‡ๆ ‡ ch_list = [] x_list = [] temp_n = 1 xticks_list = [] for i in range(2,16): # current_ch = imple_kmeans(dreamvector_dataframe,i+1) current_ch = imple_GMM(dreamvector_dataframe,i+1) # current_ch = imple_SpectralClustering(dreamvector_dataframe,i+1) x_list.append(i+1) ch_list.append(current_ch) xticks_list.append(temp_n) temp_n+=1 plt.plot(xticks_list, ch_list) plt.xticks(xticks_list, x_list) plt.title('calinski harabaz score') plt.xlabel('็ฑป็›ฎๆ•ฐ') plt.show() plt.savefig('result/dreamvector/ch_score.png')
[ "di.w@hotmail.com" ]
di.w@hotmail.com
41399fad248b0a0094d4e199dd1c4adfebedd1a3
fbfd842136ce51a598801d1db8a383633f6ef65b
/CP/Competetive Programming And DSA/codechef5.py
0c25e1b5b9fa3b2bd3d58fe41d022c3b5ad4f14c
[]
no_license
jayz25/MiniProjects-And-CP
6d74fd1b58d10036235520a1d10d928f45d5d542
40eb2f0f3449e77e02424fcc8fa80597f2a83bf6
refs/heads/master
2023-06-11T03:04:50.348564
2021-06-20T18:42:55
2021-06-20T18:42:55
366,385,384
0
0
null
null
null
null
UTF-8
Python
false
false
1,043
py
''' 2 8 38 7 8 19 7 8 7 10 20 4 5 2 10 4 9 7 2 ''' def some(N,K,l): if sum(l)<=(2*K): return -1 S = K res = [] for i in range(N): if l[i]<=S: S = S - l[i] count+=1 res.append(i) if S<=0: break for i in res: del l[i] for i in range(1,len(l)+1): if sum[:i]>=K: count+=i return count return -1 def co(N,K,l): K=K*2 subs = ([[0 for i in range(K+1)]for i in range(N+1)]) for i in range(1,K+1): subs[0][i] = 10**9-1 for i in range(1,N+1): for j in range(1,K+1): if l[i-1] > j: subs[i][j] = subs[i-1][j] else: subs[i][j] = min(subs[i-1][j],subs[i][j-l[i-1]]+1) return subs[N][K] T = int(input()) while T!=0: N, K = map(int,input().split()) l = list(map(int,input().split())) l.sort(reverse=True) print(co(N,K,l)) T-=1
[ "patiljayesh026@gmail.com" ]
patiljayesh026@gmail.com
db3596b8480850b3718c2c9d08671fd49db81831
0543faeee9f493260e8cbd8a9155a96a8cbb0df2
/main_app/migrations/0018_profile.py
9f188815d07ced745fd5193ceebf36edd8813264
[]
no_license
tanveerahmad1517/Treasuregram
134853f298628c161ebe741864cdb581ce80db8f
797e0ff1460eb50d90aa385f6fb25990ed7766fa
refs/heads/master
2020-03-10T13:58:43.912795
2018-04-13T14:32:31
2018-04-13T14:32:31
129,413,871
0
0
null
null
null
null
UTF-8
Python
false
false
697
py
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2018-02-13 13:10 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main_app', '0017_remove_treasure_date'), ] operations = [ migrations.CreateModel( name='Profile', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('first_name', models.CharField(db_column='first_name', max_length=50)), ('last_name', models.CharField(db_column='last_name', max_length=50)), ], ), ]
[ "tanveerobjects@gmail.com" ]
tanveerobjects@gmail.com
7a25619ac5eff44c957cd979158b601393eb548e
725d06cd4ff104efc089e13b9a06ca5b6dd3b342
/Hangman.py
2aed0d44dd37d3d0e6fc9781e2bc622ec54ed412
[]
no_license
prathmeshpatel/hangman-game
30fd088c143cd617c14a1876fd7d4d6dac402c75
c0b3692a3c70b69f78cec1a85b62cb53a579694a
refs/heads/master
2021-04-30T17:39:37.657034
2017-01-27T21:36:14
2017-01-27T21:36:14
80,247,952
0
0
null
null
null
null
UTF-8
Python
false
false
4,029
py
''' Created on Oct 16, 2016 @author: Prathmesh Patel ''' import random def fileToStringList(filename): #opens file and returns a list of strings(words) wordlist = [] f = open(filename) for line in f: line = line.strip() wordlist.append(line) f.close() return wordlist def getPossibleWords(wordlist,length): # returns a list of words from wordlist having a specified length return[word for word in wordlist if len(word)==length] def displayGuess(wordList): #list of characters with letters correctly guessed and '_' for letters not quessed yet: returns the list as a String return ' '.join(wordList) def guessStart(word): #returns a list of single characters '_' the same size as the wordToGuess return ['_']*len(word) def miss(guessList,wordToGuess, letter): # helper function to use as an update for a counter for number of user misses misses = 0 if letter in wordToGuess: misses += 0 else: misses +=1 return misses def updateLetter(guessList,wordToGuess, letter): # updates _ to the letter guessed if guessed correctly and then prints if this happens. If this doesn't happen, it prints as a miss, return updated guessList for x in range(len(wordToGuess)): if wordToGuess[x]==letter: guessList[x]= letter if letter in wordToGuess: print "You guessed a letter!" else: print "That's a MISS" return guessList def playGame(words): #setup for game, uses raw_inputs guessLength = int(raw_input("how many letters in word to guess? ")) #how many letters in the word you want to guess numberMisses = int(raw_input("how many misses allowed? ")) #how many misses can you allow in the game wordsOfLength = getPossibleWords(words,guessLength) # creates list of all possible words with length inputted wordToGuess = random.choice(wordsOfLength) # random choice from above list guessList = guessStart(wordToGuess) # creates guessList as underscores for every letter in word count = 0 #counter for number of guesses misses = 0 #counter for number of misses strAlphabet = "abcdefghijklmnopqrstuvwxyz" #will remove letters as they are guessed while True: if guessList.count('_') == 0: # all letters guessed break print "guessed so far:", displayGuess(guessList) letter = raw_input("guess a letter: ") #guess if letter == "+": #guess the word if inputted guess = raw_input("guess the word:") if guess == wordToGuess: print "THAT'S RIGHT! YOU WIN!" break #game ends else: print "That's wrong. BUMMER. You lose. The word was:", wordToGuess break #game ends updateLetter(guessList, wordToGuess, letter) #updates guesslist strAlphabet = strAlphabet.replace(letter,"") #removes guessed letter from string of alphabet print "letters not guessed:", strAlphabet count +=1 #count +1 for number of guesses misses += miss (guessList, wordToGuess, letter) #updates number of misses if misses == numberMisses: #number of misses used up break #game ends print numberMisses - misses, "misses left" #total misses inputted minus how many you missed print "guess a letter or enter + to guess the word" # prints game over based on spaces cleared or misses used up if guessList.count('_') == 0 and misses < numberMisses: print "You win. You guessed the word", wordToGuess print "You guessed", count," times" elif misses == numberMisses: print "You lost, word was", wordToGuess print "You guessed incorrectly", misses, "times, smh" if __name__ == '__main__': words = fileToStringList('lowerwords.txt') playGame(words)
[ "noreply@github.com" ]
noreply@github.com
1998f40d200a554665e76178c4a6f06101755f94
74d11e4000d99e43dc4c53c93ac59782ebbe1802
/portrait/deeplab/model_test.py
c586ccd0ea5c6626ab32562bec21e041fdf8b7cc
[ "Apache-2.0" ]
permissive
hiepgaf/portrait
f450971e8881e9bcd1f386966651a9a01c1d11ce
930a167cbb368cdc2cf906b06b70c035d87e6938
refs/heads/master
2020-03-19T00:14:06.916160
2018-05-14T05:57:29
2018-05-14T05:57:29
null
0
0
null
null
null
null
UTF-8
Python
false
false
941
py
"""Tests for encoder""" import numpy as np import tensorflow as tf from model import deeplab_v3_plus_model def create_test_inputs(batch, height, width, channels): """Create mock Images """ if None in [batch, height, width, channels]: return tf.placeholder(tf.float32, (batch, height, width, channels)) else: return tf.to_float( np.tile(np.reshape( np.reshape(np.arange(height), [height, 1]) + np.reshape(np.arange(width), [1, width]), [1, height, width, 1]), [batch, 1, 1, channels])) class DeepLabV3PlusTest(tf.test.TestCase): def testBuildDeepLabV3Plus(self): """"Encoder Constructor Test""" images = create_test_inputs(2, 224, 224, 3) encoded_features, _ = deeplab_v3_plus_model( images=images) self.assertListEqual( encoded_features.get_shape().as_list(), [2, 28, 28, 256]) if __name__ == '__main__': tf.test.main()
[ "tdat.nguyen93@gmail.com" ]
tdat.nguyen93@gmail.com
ec16e406e8d72d362730558816a5f89cd01e3f47
5127f3db0b6eaf658273925a2b44321d8b4067f3
/bases/models.py
4181b6b12ba7886956392284fdae5b5803e9019e
[]
no_license
AlejooRob/SistemcomprasfacturasDjango
bce611417c05e770eda692ca66e8f320ac8cbbc7
98053a73b2f063c24676c8bf5632ef75233e20a6
refs/heads/main
2023-05-02T00:02:02.308681
2021-05-19T15:29:35
2021-05-19T15:29:35
null
0
0
null
null
null
null
UTF-8
Python
false
false
903
py
from django.db import models from django.contrib.auth.models import User from django_userforeignkey.models.fields import UserForeignKey class ClassModel(models.Model): estado = models.BooleanField(default=True) fc = models.DateTimeField(auto_now_add=True) fm = models.DateTimeField(auto_now=True) uc = models.ForeignKey(User, on_delete=models.CASCADE) um = models.IntegerField(blank=True,null=True) class Meta: abstract=True class ClassModel2(models.Model): estado = models.BooleanField(default=True) fc = models.DateTimeField(auto_now_add=True) fm = models.DateTimeField(auto_now=True) # uc = models.ForeignKey(User, on_delete=models.CASCADE) # um = models.IntegerField(blank=True,null=True) uc= UserForeignKey(auto_user_add=True,related_name='+') um= UserForeignKey(auto_user=True,related_name='+') class Meta: abstract=True
[ "alejolink001@gmail.com" ]
alejolink001@gmail.com
7c819f3f0a6e6339a8d5382922dddc7f7b4c6af1
ddfb9db447f098485b1c9672de08ca97aeea3501
/trespalabras.py
fdd484147e5240f7ef22bf291766e47e21cb756f
[]
no_license
AlbertoFido/fido1
7a1e9ffc87263ae2ad9cf0491aa94dfe9b299561
ef5ba4e9eb6456e8612908b049a3e6ec57e4e7f9
refs/heads/master
2016-09-01T14:41:36.814675
2016-03-17T19:46:02
2016-03-17T19:46:02
43,089,293
0
0
null
null
null
null
UTF-8
Python
false
false
495
py
def checkio(words): cad2=words.split(' ') contador=0 salida = False for ele in cad2: if ele.isalpha(): contador+=1 else: contador = 0 if contador >= 3: salida = True return salida print checkio("start 5 one two three 7 end") #True print checkio("Hello World hello") #== True, "Hello" print checkio("He is 123 man") #== False, "123 man" print checkio("1 2 3 4") # == False, "Digits" print checkio("bla bla bla bla") # == True, "Bla Bla" print checkio("Hi") # == False, "Hi"
[ "albertofido92@gmail.com" ]
albertofido92@gmail.com
c655ec659eb34d34fc137ef60ca4dd3dcf62b5ec
0f39e47e2538c8469b558fdf14e06781d8b390a3
/playground/detection/coco/yolof/yolof.res101.C5.1x/config.py
78088d11fc7eaea988b0ee97f3e5cd6d73fad74c
[ "Apache-2.0", "MIT" ]
permissive
baodijun/YOLOF
d1bdaee4de22acc0290edc5951943739c1971e88
905209bfd58d1ed67908cfa0685de05a89d3fd6c
refs/heads/main
2023-03-25T05:03:11.998150
2021-03-19T15:03:01
2021-03-19T15:03:01
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,790
py
from cvpods.configs.base_detection_config import BaseDetectionConfig _config_dict = dict( MODEL=dict( # Backbone NAME: "build_resnet_backbone" RESNETS=dict(DEPTH=101, OUT_FEATURES=["res5"]), ANCHOR_GENERATOR=dict( SIZES=[[32, 64, 128, 256, 512]], ASPECT_RATIOS=[[1.0]] ), YOLOF=dict( ENCODER=dict( IN_FEATURES=["res5"], NUM_CHANNELS=512, BLOCK_MID_CHANNELS=128, NUM_RESIDUAL_BLOCKS=4, BLOCK_DILATIONS=[2, 4, 6, 8], NORM="BN", ACTIVATION="ReLU" ), DECODER=dict( IN_CHANNELS=512, NUM_CLASSES=80, NUM_ANCHORS=5, CLS_NUM_CONVS=2, REG_NUM_CONVS=4, NORM="BN", ACTIVATION="ReLU", PRIOR_PROB=0.01 ), BBOX_REG_WEIGHTS=(1.0, 1.0, 1.0, 1.0), ADD_CTR_CLAMP=True, CTR_CLAMP=32, MATCHER_TOPK=4, POS_IGNORE_THRESHOLD=0.15, NEG_IGNORE_THRESHOLD=0.7, FOCAL_LOSS_GAMMA=2.0, FOCAL_LOSS_ALPHA=0.25, SCORE_THRESH_TEST=0.05, TOPK_CANDIDATES_TEST=1000, NMS_THRESH_TEST=0.6 ), ), DATASETS=dict( TRAIN=("coco_2017_train",), TEST=("coco_2017_val",), ), DATALOADER=dict(NUM_WORKERS=8), SOLVER=dict( LR_SCHEDULER=dict( STEPS=(15000, 20000), MAX_ITER=22500, WARMUP_FACTOR=0.00066667, WARMUP_ITERS=1500 ), OPTIMIZER=dict( NAME="D2SGD", BASE_LR=0.12, BIAS_LR_FACTOR=1.0, WEIGHT_DECAY=0.0001, WEIGHT_DECAY_NORM=0.0, MOMENTUM=0.9, BACKBONE_LR_FACTOR=0.334 ), IMS_PER_BATCH=64, IMS_PER_DEVICE=8, ), INPUT=dict( AUG=dict( TRAIN_PIPELINES=[ ("ResizeShortestEdge", dict( short_edge_length=(800,), max_size=1333, sample_style="choice")), ("RandomFlip", dict()), ("RandomShift", dict(max_shifts=32)) ], TEST_PIPELINES=[ ("ResizeShortestEdge", dict( short_edge_length=800, max_size=1333, sample_style="choice")), ], ), # Whether the model needs RGB, YUV, HSV etc. FORMAT="BGR", ), ) class YOLOFConfig(BaseDetectionConfig): def __init__(self, d=None, **kwargs): super().__init__(d, **kwargs) self._register_configuration(_config_dict) config = YOLOFConfig()
[ "qiang.chen@nlpr.ia.ac.cn" ]
qiang.chen@nlpr.ia.ac.cn
37c3ab3420c73bbf6ec48d698d397aa157c521b6
4013b4b4e513a6ecccaa88fbda7d8c427a28b481
/openemory/accounts/migrations/0015_add_data_archive.py
2a46effd658b541276e18167710b8556882b8b5e
[ "Apache-2.0" ]
permissive
alexBLR/OpenEmory
1d4922a986c1e872bd9dd2656abb030bdc43d0a7
d5306c7b60003d7681340786d115c78fc6f34661
refs/heads/master
2020-12-25T10:10:13.138691
2015-08-12T15:21:54
2015-08-12T15:21:54
40,536,243
0
0
null
2015-08-11T10:35:44
2015-08-11T10:35:44
null
UTF-8
Python
false
false
12,931
py
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models from django.contrib.flatpages.models import FlatPage, Site # This a acutally a FlatPage data migration but there was not good place to put it outer than here. class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Don't use "from appname.models import ModelName". # Use orm.ModelName to refer to models in this application, # and orm['appname.ModelName'] for models in other applications. s = Site.objects.get(id='1') f = FlatPage(url='/data-archiving/', title='Data Archiving', content='(info about data archiving)') f.save() f.sites.add(s) f.save() def backwards(self, orm): "Write your backwards methods here." models = { 'accounts.announcement': { 'Meta': {'object_name': 'Announcement'}, 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'end': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'message': ('django.db.models.fields.TextField', [], {'max_length': '500'}), 'start': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) }, 'accounts.bookmark': { 'Meta': {'object_name': 'Bookmark'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'pid': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) }, 'accounts.degree': { 'Meta': {'object_name': 'Degree'}, 'holder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['accounts.UserProfile']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'institution': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), 'year': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) }, 'accounts.esdperson': { 'Meta': {'object_name': 'EsdPerson', 'db_table': '\'"esdv"."v_oem_fclt"\'', 'managed': 'False', 'db_tablespace': "'esdv'"}, '_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True', 'db_column': "'prsn_i'"}), 'ad_name': ('django.db.models.fields.CharField', [], {'max_length': '75', 'db_column': "'prsn_n_dspl_acdr'"}), 'department_id': ('django.db.models.fields.CharField', [], {'max_length': '10', 'db_column': "'dprt_c'"}), 'department_name': ('django.db.models.fields.CharField', [], {'max_length': '40', 'db_column': "'dprt8dtry_n'"}), 'directory_name': ('django.db.models.fields.CharField', [], {'max_length': '75', 'db_column': "'prsn_n_full_dtry'"}), 'directory_suppressed': ('openemory.accounts.fields.YesNoBooleanField', [], {'default': 'False', 'db_column': "'prsn_f_sprs_dtry'"}), 'division_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'db_column': "'dvsn_i'"}), 'division_name': ('django.db.models.fields.CharField', [], {'max_length': '40', 'db_column': "'dvsn8dtry_n'"}), 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_column': "'emad_n'"}), 'email_forward': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_column': "'emad8frwd_n'"}), 'employee_status': ('django.db.models.fields.CharField', [], {'max_length': '1', 'db_column': "'emjo_c_stts_empe'"}), 'faculty_flag': ('openemory.accounts.fields.YesNoBooleanField', [], {'default': 'False', 'max_length': '1', 'db_column': "'empe_f_fclt'"}), 'fax': ('django.db.models.fields.CharField', [], {'max_length': '12', 'db_column': "'prad_a_fax_empe_fmtt'"}), 'firstmid_name': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_column': "'prsn_n_fm_dtry'"}), 'information_suppressed': ('openemory.accounts.fields.YesNoBooleanField', [], {'default': 'False', 'db_column': "'prsn_f_sprs_infr'"}), 'internet_suppressed': ('openemory.accounts.fields.YesNoBooleanField', [], {'default': 'False', 'db_column': "'prsn_f_sprs_intt'"}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '25', 'db_column': "'prsn_n_last_dtry'"}), 'mailstop_code': ('django.db.models.fields.CharField', [], {'max_length': '12', 'db_column': "'mlst_i'"}), 'mailstop_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_column': "'mlst_n'"}), 'name_suffix': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_column': "'prsn_n_sufx_dtry'"}), 'netid': ('django.db.models.fields.CharField', [], {'max_length': '8', 'db_column': "'logn8ntwr_i'"}), 'person_type': ('django.db.models.fields.CharField', [], {'max_length': '1', 'db_column': "'prsn_c_type'"}), 'phone': ('django.db.models.fields.CharField', [], {'max_length': '12', 'db_column': "'prad_a_tlph_empe_fmtt'"}), 'ppid': ('django.db.models.fields.CharField', [], {'max_length': '8', 'db_column': "'prsn_i_pblc'"}), 'title': ('django.db.models.fields.CharField', [], {'max_length': '70', 'db_column': "'prsn_e_titl_dtry'"}) }, 'accounts.externallink': { 'Meta': {'object_name': 'ExternalLink'}, 'holder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['accounts.UserProfile']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}) }, 'accounts.grant': { 'Meta': {'object_name': 'Grant'}, 'grantee': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['accounts.UserProfile']"}), 'grantor': ('django.db.models.fields.CharField', [], {'max_length': '250', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '250', 'blank': 'True'}), 'project_title': ('django.db.models.fields.CharField', [], {'max_length': '250', 'blank': 'True'}), 'year': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) }, 'accounts.position': { 'Meta': {'object_name': 'Position'}, 'holder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['accounts.UserProfile']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) }, 'accounts.userprofile': { 'Meta': {'ordering': "['user__username']", 'object_name': 'UserProfile'}, 'biography': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), 'dept_num': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), 'employee_num': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), 'full_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), 'hr_id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'nonfaculty_profile': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'phone': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), 'photo': ('django.db.models.fields.files.ImageField', [], {'default': "''", 'max_length': '100', 'blank': 'True'}), 'show_suppressed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'subdept_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), 'title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) }, 'auth.group': { 'Meta': {'object_name': 'Group'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) }, 'auth.permission': { 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) }, 'auth.user': { 'Meta': {'object_name': 'User'}, 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) }, 'contenttypes.contenttype': { 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) }, 'taggit.tag': { 'Meta': {'object_name': 'Tag'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'}) }, 'taggit.taggeditem': { 'Meta': {'object_name': 'TaggedItem'}, 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'taggit_taggeditem_tagged_items'", 'to': "orm['contenttypes.ContentType']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'object_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}), 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'taggit_taggeditem_items'", 'to': "orm['taggit.Tag']"}) } } complete_apps = ['accounts'] symmetrical = True
[ "athom09@emory.edu" ]
athom09@emory.edu
88e209e71bd5abada8fca06441598115041c3409
00b9d05d36e403aafe33becfd738bedb4e6927ae
/Day3/DbConnectionDemo.py
1adcbed723c57dedaae5901a1e36c11a8aa64490
[]
no_license
ShahUjval/Python
9383b2b4f5c519096a4496db3862d1adaffc2ea2
e49d9f148a08b8e8bd8e5d58aa5c2b9ee1984523
refs/heads/master
2021-01-20T20:18:06.616409
2016-06-03T09:37:38
2016-06-03T09:37:38
null
0
0
null
null
null
null
UTF-8
Python
false
false
271
py
import MySQLdb conn = MySQLdb.connect('localhost','root','katieholmes123','python') conn.autocommit(True) query = "Select version()" cur = conn.cursor() cur.execute(query) print cur.description[0][0] print '-' * 22 print cur.fetchone()[0] cur.close()
[ "shah.ujval@gmail.com" ]
shah.ujval@gmail.com
53171e07178a012d3d4820a34f4a4926dbf039f9
909afe0216a37bdc19683d81e533fa6c094329c1
/python/fluent_python/17-futures/flags_threadpool.py
06c33a7643ddd6282576bba9507f4a1c595c79bf
[]
no_license
wxnacy/study
af7fdcd9915d668be73c6db81bdc961247e24c73
7bca9dc8ec211be15c12f89bffbb680d639f87bf
refs/heads/master
2023-04-08T17:57:40.801687
2023-03-29T08:02:20
2023-03-29T08:02:20
118,090,886
18
22
null
2022-12-16T03:11:43
2018-01-19T07:14:02
HTML
UTF-8
Python
false
false
481
py
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: wxnacy(wxnacy@gmail.com) # Description: ไฝฟ็”จๅคš็บฟ็จ‹ไธ‹่ฝฝ from concurrent.futures import ThreadPoolExecutor from flags import download_one, main MAX_WORKERS = 20 def download_many(suffixs): workers = min(MAX_WORKERS, len(suffixs)) with ThreadPoolExecutor(workers) as executor: res = executor.map(download_one, suffixs) return len(list(res)) if __name__ == "__main__": main(download_many)
[ "371032668@qq.com" ]
371032668@qq.com
1a1c0596441aa2d97790c1857301e569d6e85134
c5ba9519273bf864c91f3564c8a63e4a7fd729fb
/xitongguanli/xitongdemo/user/urls.py
cf3e991f0e16acb7b8133ed48f43a42353760154
[]
no_license
tainsir/xitongguanli
b318e8c8b708192f79106ec9d4f64804e4875e3e
8c619bf8c5e5f665bc1e0d1b9d8700eb1249f00c
refs/heads/master
2020-08-03T12:16:24.656311
2019-09-30T05:08:59
2019-09-30T05:08:59
211,750,152
0
0
null
null
null
null
UTF-8
Python
false
false
1,821
py
from django.conf.urls import url from . import views app_name = "user" urlpatterns = [ # ------------------- ็”จๆˆท็™ป้™†url ---------------------------- url(r'^login/$', views.login, name='login'), # ็”จๆˆท็™ป้™† url(r'^login_out/$', views.login_out, name="login_out"), # ็”จๆˆท้€€ๅ‡บ # ------------------- ็ณป็ปŸ้ฆ–้กต็š„url ---------------------------- url(r"^choice/$", views.choice, name="choice"), # ้€‰ๆ‹ฉ็”จๆˆทๅ’Œ็ป„็ป‡ url(r'^starter/$', views.starter, name='starter'), # ็ณป็ปŸ้ฆ–้กต #---------------------ๆœ็ดข------------------------------- url(r"^search/$" , views.search , name = "search"), # ------------------- ็”จๆˆทCRUD็š„url ---------------------------- url(r'^user/$', views.show_all_user, name="show_all_user"), # ็‚นๅ‡ป็”จๆˆท่ฟ›ๅ…ฅ็”จๆˆท็•Œ้ข url(r'^(?P<u_id>\d+)/user_details/', views.user_details, name="user_details"), # ๅฑ•็คบ็”จๆˆท่ฏฆๆƒ…้กต้ข url(r'^add_user/$', views.add_user, name='add_user'), # ๆ–ฐๅขž็”จๆˆท url(r'^(?P<u_id>\d+)/edit_user/$', views.edit_user, name='edit_user'), # ไฟฎๆ”น็”จๆˆท url(r'^(?P<u_id>\d+)/delete/$', views.delete, name='delete'), # ๅˆ ้™ค็”จๆˆท # ------------------- ่ง’่‰ฒCRUD็š„url ---------------------------- url(r'^role/$', views.show_all_role, name='show_all_role'), # ๆ˜พ็คบๆ‰€ๆœ‰ๆ“ไฝœ้กนๅ’Œ่ง’่‰ฒ url(r'^new_role/$', views.new_role, name='new_role'), # ๆ–ฐๅปบ่ง’่‰ฒ url(r'^edit_role/(?P<rid>\d+)/$', views.edit_role, name='edit_role'), # ็ผ–่พ‘่ง’่‰ฒ url(r'^del_role/$', views.del_role, name='del_role'), # ๅˆ ้™ค(ๅœ็”จ)่ง’่‰ฒ #---------------------่ง’่‰ฒๆƒ้™-------------------------------------- url(r'^show_opeartion/$' , views.show_opeartion , name = "show_opeartion"), url(r'^show_role/$' , views.show_role , name = "show_role"), ]
[ "noreply@github.com" ]
noreply@github.com
343c17bb1ca6baf99ce4f13cd5186e9c00b5d09a
1201b15c891116d0475926d3db707a053f480ab3
/config.py
898ffc64792fb9a2aaa9ae4b2d92c8060f4ec5e7
[ "MIT" ]
permissive
PeARSearch/PeARS
701708be4525c47c2ffed750adf1688a4ddfc419
f97f416071a22826798188bcd75ce4d3e4f2623d
refs/heads/master
2020-04-05T03:18:34.334948
2017-07-22T12:33:18
2017-07-22T12:33:18
50,421,624
64
14
null
2017-07-22T12:33:19
2016-01-26T10:30:24
DM
UTF-8
Python
false
false
434
py
#! /usr/bin/env python # -*- coding: utf-8 -*- import os basedir = os.path.abspath(os.path.dirname(__file__)) # db configurations - not using now SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db') SQLALCHEMY_BINDS = { 'wikiwoods': 'sqlite:///' + os.path.join(basedir, 'wikiwoods.db') } SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository') CSRF_ENABLED = True SECRET_KEY='parayan-manasilla'
[ "hrishi.kb@gmail.com" ]
hrishi.kb@gmail.com
1596a3bc363dc0db81d5748b98371958e64dd2d8
f63fa6561b3c3f39fae8a7e3a37e7862b7103e70
/loop.py
b24f1de5ac9959e594eb83112757c1586b014d7e
[ "MIT" ]
permissive
maxreciprocate/Looper
eebbea08f6e96917c3f3a4162b0961d42b0b958d
0f7c56a52a540b768054fd174bab940992906e93
refs/heads/master
2023-06-07T15:40:27.985275
2019-10-30T03:55:00
2019-10-30T03:55:00
null
0
0
null
null
null
null
UTF-8
Python
false
false
6,715
py
import os import sys import numpy as np from mpg123 import Mpg123, Out123 class MusicFile: def __init__(self, filename): # Load the file, if it exists and is an mp3 file if os.path.exists(filename) and os.path.isfile(filename): if filename[-3:].lower() == 'mp3': mp3 = Mpg123(filename) else: raise TypeError( "This script can currently only handle MP3 files.") else: raise FileNotFoundError("Specified file not found.") # Get the waveform data from the mp3 file frames = list(mp3.iter_frames()) self.frames = frames # Get the metadata from the mp3 file self.rate, self.channels, self.encoding = mp3.get_format() def calculate_max_frequencies(self): """Uses the real Fourier transform to get the frequencies over time for the file. Records the strongest frequency over time from a "fingerprint" region associated with the song's melody. """ # Fourier transform each frame of the file frame_ffts = [] # The first 1 and last 2 frames are omitted since they are # frequently of different lengths than the rest of the file start_frame, end_frame = (1, len(self.frames) - 2) for i in range(start_frame, end_frame): # Decode the frame (stored as a byte array) # into a numpy int16 array # (NOTE: this assumes a 16-bit encoding, which was true # for the files tested, but won't necessarily always be true arr = np.frombuffer(self.frames[i], dtype=np.int16) # Take just the first channel, so that we only need # to work with one time series arr = arr[::self.channels] # Perform the Fourier transform frame_fft = np.abs(np.fft.rfft(arr)) frame_ffts.append(frame_fft) # Convert the list of ffts to a numpy.ndarray (easier to work with) fft_2d = np.stack(frame_ffts) # Get frequency information # (Should be identical for each frame, except sometimes # the first and last frames, which we omitted) frame_freq = np.fft.rfftfreq(len(arr)) # Clip the data to a smaller range of frequencies. For the files # tested, this range corresponded to a "fingerprint" region # where the actual melody resides. clip_start, clip_end = (1, 25) frame_freq_sub = frame_freq[clip_start:clip_end] fft_2d_sub = fft_2d[:, clip_start:clip_end] # Mask out low-amplitude frequencies so that we don't match to noise # (this is done on a proportional threshold # since absolute magnitudes vary) fft_2d_denoise = np.ma.masked_where( (fft_2d_sub.T < fft_2d_sub.max() * 0.25), fft_2d_sub.T, 0) # Finally, get the dominant frequency for each frame # (and mask it to omit any points where the dominant frequency is # just the baseline frequency) max_freq = frame_freq_sub[np.argmax(fft_2d_denoise, axis=0)] self.max_freq = np.ma.masked_where(max_freq == frame_freq_sub[0], max_freq) def sig_corr(self, s1, s2, comp_length): """Calculates the auto-correlation of the track (as compressed into max_freq) with itself, based on sub-samples starting at frames s1 and s2, each comp_length frames long.""" # np.corrcoef returns an array of coefficients - # the simple 'R' value is at row 1, col 0 return np.corrcoef( self.max_freq[s1:s1+comp_length], self.max_freq[s2:s2+comp_length])[1, 0] def pct_match(self, s1, s2, comp_length): """Calculates the percentage of matching notes between two subsamples of self.max_freq, each one comp_length notes long, one starting at s1 and one starting at s2 """ matches = (self.max_freq[s1:s1+comp_length] == self.max_freq[s2:s2+comp_length]) return np.ma.sum(matches) / np.ma.count(matches) def find_loop_point(self, start_offset=200, test_len=500): """Finds matches based on auto-correlation over a portion of the music track.""" # Using heuristics for the test length and "loop to" point. # NOTE: this algorithm is arbitrary and could certainly be improved, # especially for cases where the loop point is not totally clear max_corr = 0 best_start = None best_end = None for start in range(200, len(self.max_freq) - test_len, int(len(self.max_freq) / 10)): for end in range(start + 500, len(self.max_freq) - test_len): sc = self.sig_corr(start, end, test_len) if sc > max_corr: best_start = start best_end = end max_corr = sc return (best_start, best_end, max_corr) def time_of_frame(self, frame): samples_per_sec = self.rate * self.channels # NOTE: division by 2 assumes 16-bit encoding samples_per_frame = len(self.frames[1]) / 2 frames_per_sec = samples_per_sec / samples_per_frame time_sec = frame / frames_per_sec return "{:02.0f}:{:06.3f}".format( time_sec // 60, time_sec % 60 ) def play_looping(self, start_offset, loop_offset): out = Out123() out.start(self.rate, self.channels, self.encoding) i = 0 try: while True: out.play(self.frames[i]) i += 1 if i == loop_offset: i = start_offset except KeyboardInterrupt: print() # so that the program ends on a newline def loop_track(filename): try: # Load the file print("Loading {}...".format(filename)) track = MusicFile(filename) track.calculate_max_frequencies() start_offset, best_offset, best_corr = track.find_loop_point() print("Playing with loop from {} back to {} ({:.0f}% match)".format( track.time_of_frame(best_offset), track.time_of_frame(start_offset), best_corr * 100)) print("(press Ctrl+C to exit)") track.play_looping(start_offset, best_offset) except (TypeError, FileNotFoundError) as e: print("Error: {}".format(e)) if __name__ == '__main__': # Load the file if len(sys.argv) == 2: loop_track(sys.argv[1]) else: print("Error: No file specified.", "\nUsage: python3 loop.py file.mp3")
[ "nolananicholson@gmail.com" ]
nolananicholson@gmail.com
fd9d88ea405216244963a2f1d054b06ca60ec7cb
f73c18586be66640a362c19ca1fe6816bcc34ca6
/ml_pipeline/tests/test_mlflow.py
55da1a65a54e8db8327c607f1ab2a9d20f4598e9
[ "MIT" ]
permissive
TianhaoFu/cloud_ml_platform
1b46034ef5aada154180938a58319fa7d67cf732
66508abbffdda1b75dd4267e3da1838ecb59c423
refs/heads/main
2023-06-05T17:11:05.685864
2021-06-24T05:08:13
2021-06-24T05:08:13
null
0
0
null
null
null
null
UTF-8
Python
false
false
476
py
import mlflow import os from random import random, randint from mlflow import log_metric, log_param def test_mlflow(): base_uri = os.environ.get('BASE_URI') tracking_uri = base_uri + '/mlflow' if base_uri else '' mlflow.set_tracking_uri(tracking_uri) # Log a parameter (key-value pair) log_param("param1", randint(0, 100)) # Log a metric; metrics can be updated throughout the run log_metric("foo", random()) log_metric("foo", random() + 1)
[ "myoilbox@gmail.com" ]
myoilbox@gmail.com
6ae67fd3e9663fc9ea82a6080b85773cce01b42f
b485f7721e01cd55c9043b3ca4dde374216384fc
/task1/cgi/show.py
7f23ab0fa42bb35c9777cf777b7ca15eaa2d167c
[]
no_license
anastasiarudenko/lab3_3.9
4a01194cfd967d4110621e8a85b221db1efd1bd8
b794c01e0d795c160f3919aca73ed9f9549329e4
refs/heads/master
2022-09-04T10:29:42.477377
2020-05-25T10:46:27
2020-05-25T10:46:27
266,750,756
0
0
null
null
null
null
UTF-8
Python
false
false
241
py
#!/usr/bin/env python3 import cgi import html f = open('data.txt', 'r') text = f.read() f.close() print("Content-type:text/html\r\n\r\n") print("<h2>With escaping: %s</h2>" % html.escape(text)) print("<h2>Without escaping: %s</h2>" % text)
[ "cyanidecalcium@yandex.ru" ]
cyanidecalcium@yandex.ru
5486a88353c3ff9a71da6e4fb6e0dd86a820b8d9
2d4821fb383287080eacc70941ba43c12c9cb73f
/RepairService/welcome/views.py
15c39fe09773f7f9224780c5a4ef306713098701
[]
no_license
chirag12357/school_django
2b2b5e1496d6c488550963c791c906ec98e19093
702fa7b030d6cdeb7f4821129af0f19af7b142ee
refs/heads/master
2020-09-07T20:11:30.117230
2019-11-12T13:28:47
2019-11-12T13:28:47
220,901,228
0
0
null
null
null
null
UTF-8
Python
false
false
128
py
from django.shortcuts import render # Create your views here. def welcfunc(request): return render(request,"welcome.html")
[ "noreply@github.com" ]
noreply@github.com
3e5b76060a8d08eb9c454a93b5bf91d108e6268c
e2e08d7c97398a42e6554f913ee27340226994d9
/pyautoTest-master๏ผˆICF-7.5.0๏ผ‰/test_case/scg_old/scg_obj_shell_2nd/test_c40343.py
3c334ff2e3e9d1098cbb335f5426d69ef272f5d0
[]
no_license
lizhuoya1111/Automated_testing_practice
88e7be512e831d279324ad710946232377fb4c01
b3a532d33ddeb8d01fff315bcd59b451befdef23
refs/heads/master
2022-12-04T08:19:29.806445
2020-08-14T03:51:20
2020-08-14T03:51:20
287,426,498
0
0
null
null
null
null
UTF-8
Python
false
false
1,783
py
import pytest import time import sys from page_obj.scg.scg_def import * from page_obj.scg.scg_def_obj import * from page_obj.scg.scg_def_log import * from page_obj.common.rail import * from os.path import dirname, abspath sys.path.insert(0, dirname(dirname(abspath(__file__)))) test_id = 40343 # ไฟฎๆ”นไปฅsubnetๆ–นๅผๆทปๅŠ ็š„ไธ€ๆกaddr obj,ๆŸฅ็œ‹log def test_change_obj_wxw(browser): try: login_web(browser, url="10.2.2.81") # ๅ…ˆๆทปๅŠ ๅ†ไฟฎๆ”น add_obj_address_wxw(browser, name='obj_add_343', desc='zheๆ˜ฏyiไธชๆ่ฟฐ1', subnetip='11.11.11.1', subnetmask='24') # ๆฌฒไฟฎๆ”นๅ“ชไธชๅ‚ๆ•ฐๅฏ็›ดๆŽฅ็ผ–่พ‘ change_obj_address_wxw(browser, name='obj_add_343', desc='zheๆ˜ฏyiไธชๆ่ฟฐ2', subnetip='11.11.11.2', subnetmask='32') time.sleep(2) # ๅˆ‡ๆขๅˆฐ้ป˜่ฎคframe browser.switch_to.default_content() get_log(browser, ็ฎก็†ๆ—ฅๅฟ—) browser.switch_to.default_content() # ๅˆ‡ๆขๅˆฐๅทฆไพงframe browser.switch_to.frame("content") loginfo = browser.find_element_by_xpath('//*[@id="namearea0"]').text try: assert "้…็ฝฎๅœฐๅ€ๅฏน่ฑกๆˆๅŠŸ๏ผŒไฟฎๆ”นๅ†…้ƒจๅฏน่ฑก [obj_add_343]" in loginfo rail_pass(test_run_id, test_id) except: rail_fail(test_run_id, test_id) assert "้…็ฝฎๅœฐๅ€ๅฏน่ฑกๆˆๅŠŸ๏ผŒไฟฎๆ”นๅ†…้ƒจๅฏน่ฑก [obj_add_343]" in loginfo except Exception as err: # ๅฆ‚ๆžœไธŠ้ข็š„ๆญฅ้ชคๆœ‰ๆŠฅ้”™๏ผŒ้‡ๆ–ฐ่ฎพๅค‡๏ผŒๆขๅค้…็ฝฎ reload(hostip="10.2.2.81") print(err) rail_fail(test_run_id, test_id) time.sleep(70) assert False if __name__ == '__main__': pytest.main(["-v", "-s", "test_c40343.py"])
[ "15501866985@163.com" ]
15501866985@163.com
9c798312fb973574870b50564f097af475b494c3
9b5715ad23991bd94d0cf6257683af69638be534
/faceRec/utils.py
8e9a8e87f93bda945015b70134501ac9608b9d7e
[]
no_license
amessadiqi/facerec
7364be109f21d52a3477977b371814185a3d7ae2
f363798a182e7f17e843bd413cf3fdc38c90846b
refs/heads/master
2022-12-10T21:54:57.962493
2020-09-17T15:18:58
2020-09-17T15:18:58
296,343,019
0
0
null
null
null
null
UTF-8
Python
false
false
2,566
py
import os import random import string import face_recognition from faceRec.models import db, User def add_user(email, password, first_name, last_name, gender, profile_picture, birthday, address): user = User(email=email, password=password, first_name=first_name, last_name=last_name, gender=gender, profile_picture=profile_picture, birthday=birthday, address=address) db.session.add(user) db.session.commit() def find_user_by_email(email): return User.query.filter_by(email=email).first() def find_user_by_id(id): return User.query.filter_by(id=id).first() def get_users(): return User.query.all() # Return User object or False if not found def find_user_by_image(image): users = get_users() for user in users: known_image = face_recognition.load_image_file(os.path.dirname(__file__) + user.profile_picture) unknown_image = face_recognition.load_image_file(image) biden_encoding = face_recognition.face_encodings(known_image)[0] unknown_encoding = face_recognition.face_encodings(unknown_image)[0] results = face_recognition.compare_faces([biden_encoding], unknown_encoding) if results[0] == True: return user return False def save_uploaded_image(image, dir): image_filename = ''.join( random.choices(string.ascii_uppercase + string.digits, k=5)) + image.filename image_uri = dir + image_filename image_path = os.path.dirname(__file__) + image_uri image.save(image_path) return image_path, image_uri, image_filename def compare_faces(img1, img2): image1 = face_recognition.load_image_file(img1) image2 = face_recognition.load_image_file(img2) encoding1 = face_recognition.face_encodings(image1)[0] encoding2 = face_recognition.face_encodings(image2)[0] return face_recognition.compare_faces([encoding1], encoding2) def detect_faces(img_path, img_filename, scaleFactor=1.1): import cv2 colored_img = cv2.imread(img_path) f_cascade = cv2.CascadeClassifier(r'C:\Users\lenovo\Desktop\faceRec\faceRec\haarcascade_frontalface_alt.xml') img_copy = colored_img.copy() gray = cv2.cvtColor(img_copy, cv2.COLOR_BGR2GRAY) faces = f_cascade.detectMultiScale(gray, scaleFactor=scaleFactor, minNeighbors=5) for (x, y, w, h) in faces: cv2.rectangle(img_copy, (x, y), (x + w, y + h), (0, 255, 0), 2) cv2.imwrite(img_path, img_copy) return img_filename
[ "amessadiqi@gmail.com" ]
amessadiqi@gmail.com
63067b766fec7b99acd1864cd7e39787c0f755b8
50bd87708a19ac7003c2cc3e2834047acc684eb9
/็ฝ‘็ปœ้€šไฟก/009_ๅ็จ‹_greenlet.py
2c58a061e2d437e27cd1f328ba6a45a786b1f80c
[]
no_license
lzxysf/python
db30bef343bb02d99c3f2a0f96c4c942b69b8b52
7d1f09b788eec293ae0bddcc0117e2dcd8a79f0b
refs/heads/master
2020-12-05T06:43:24.461101
2020-04-08T13:21:02
2020-04-08T13:21:02
232,037,659
0
0
null
2020-04-08T13:14:39
2020-01-06T06:23:20
Python
UTF-8
Python
false
false
443
py
''' ไธบไบ†ๆ›ดๅฅฝไฝฟ็”จๅ็จ‹ๆฅๅฎŒๆˆๅคšไปปๅŠก๏ผŒpythonไธญ็š„greenletๆจกๅ—ๅฏนๅ…ถๅฐ่ฃ…๏ผŒไปŽ่€Œไฝฟๅพ—ๅˆ‡ๆขไปปๅŠกๅ˜็š„ๆ›ดๅŠ ็ฎ€ๅ• ''' from greenlet import greenlet import time def test1(): while True: print('----A----') time.sleep(0.5) gr2.switch() def test2(): while True: print('----B----') time.sleep(0.5) gr1.switch() gr1 = greenlet(test1) gr2 = greenlet(test2) gr1.switch()
[ "lzxysf@qq.com" ]
lzxysf@qq.com
2271ce0fe39d71d42b7ce4efd6399e6568b37c17
165cf5ce4f80ca7037237f3abf59eeef68e3105e
/mkhufftbl.py
3c301889a940a899069a6c4854abd1413420911d
[ "MIT" ]
permissive
ngtcp2/nghttp3
1eb043960397ec5bdd3f704d4ccc9b11613ec99c
dd5d9d55dcb13a1729b7ad1c8c30f8e5ad82c4df
refs/heads/main
2023-08-31T03:23:38.565595
2023-08-30T09:58:04
2023-08-30T09:58:04
156,868,263
693
82
MIT
2023-08-30T09:55:36
2018-11-09T13:49:36
C
UTF-8
Python
false
false
22,404
py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This script reads Huffman Code table [1] and generates symbol table # and decoding tables in C language. The resulting code is used in # lib/nghttp3_qpack_huffman.h and lib/nghttp3_qpack_huffman_data.c # # [1] http://http2.github.io/http2-spec/compression.html import re import sys import io # From [1] HUFFMAN_CODE_TABLE = """\ ( 0) |11111111|11000 1ff8 [13] ( 1) |11111111|11111111|1011000 7fffd8 [23] ( 2) |11111111|11111111|11111110|0010 fffffe2 [28] ( 3) |11111111|11111111|11111110|0011 fffffe3 [28] ( 4) |11111111|11111111|11111110|0100 fffffe4 [28] ( 5) |11111111|11111111|11111110|0101 fffffe5 [28] ( 6) |11111111|11111111|11111110|0110 fffffe6 [28] ( 7) |11111111|11111111|11111110|0111 fffffe7 [28] ( 8) |11111111|11111111|11111110|1000 fffffe8 [28] ( 9) |11111111|11111111|11101010 ffffea [24] ( 10) |11111111|11111111|11111111|111100 3ffffffc [30] ( 11) |11111111|11111111|11111110|1001 fffffe9 [28] ( 12) |11111111|11111111|11111110|1010 fffffea [28] ( 13) |11111111|11111111|11111111|111101 3ffffffd [30] ( 14) |11111111|11111111|11111110|1011 fffffeb [28] ( 15) |11111111|11111111|11111110|1100 fffffec [28] ( 16) |11111111|11111111|11111110|1101 fffffed [28] ( 17) |11111111|11111111|11111110|1110 fffffee [28] ( 18) |11111111|11111111|11111110|1111 fffffef [28] ( 19) |11111111|11111111|11111111|0000 ffffff0 [28] ( 20) |11111111|11111111|11111111|0001 ffffff1 [28] ( 21) |11111111|11111111|11111111|0010 ffffff2 [28] ( 22) |11111111|11111111|11111111|111110 3ffffffe [30] ( 23) |11111111|11111111|11111111|0011 ffffff3 [28] ( 24) |11111111|11111111|11111111|0100 ffffff4 [28] ( 25) |11111111|11111111|11111111|0101 ffffff5 [28] ( 26) |11111111|11111111|11111111|0110 ffffff6 [28] ( 27) |11111111|11111111|11111111|0111 ffffff7 [28] ( 28) |11111111|11111111|11111111|1000 ffffff8 [28] ( 29) |11111111|11111111|11111111|1001 ffffff9 [28] ( 30) |11111111|11111111|11111111|1010 ffffffa [28] ( 31) |11111111|11111111|11111111|1011 ffffffb [28] ' ' ( 32) |010100 14 [ 6] '!' ( 33) |11111110|00 3f8 [10] '"' ( 34) |11111110|01 3f9 [10] '#' ( 35) |11111111|1010 ffa [12] '$' ( 36) |11111111|11001 1ff9 [13] '%' ( 37) |010101 15 [ 6] '&' ( 38) |11111000 f8 [ 8] ''' ( 39) |11111111|010 7fa [11] '(' ( 40) |11111110|10 3fa [10] ')' ( 41) |11111110|11 3fb [10] '*' ( 42) |11111001 f9 [ 8] '+' ( 43) |11111111|011 7fb [11] ',' ( 44) |11111010 fa [ 8] '-' ( 45) |010110 16 [ 6] '.' ( 46) |010111 17 [ 6] '/' ( 47) |011000 18 [ 6] '0' ( 48) |00000 0 [ 5] '1' ( 49) |00001 1 [ 5] '2' ( 50) |00010 2 [ 5] '3' ( 51) |011001 19 [ 6] '4' ( 52) |011010 1a [ 6] '5' ( 53) |011011 1b [ 6] '6' ( 54) |011100 1c [ 6] '7' ( 55) |011101 1d [ 6] '8' ( 56) |011110 1e [ 6] '9' ( 57) |011111 1f [ 6] ':' ( 58) |1011100 5c [ 7] ';' ( 59) |11111011 fb [ 8] '<' ( 60) |11111111|1111100 7ffc [15] '=' ( 61) |100000 20 [ 6] '>' ( 62) |11111111|1011 ffb [12] '?' ( 63) |11111111|00 3fc [10] '@' ( 64) |11111111|11010 1ffa [13] 'A' ( 65) |100001 21 [ 6] 'B' ( 66) |1011101 5d [ 7] 'C' ( 67) |1011110 5e [ 7] 'D' ( 68) |1011111 5f [ 7] 'E' ( 69) |1100000 60 [ 7] 'F' ( 70) |1100001 61 [ 7] 'G' ( 71) |1100010 62 [ 7] 'H' ( 72) |1100011 63 [ 7] 'I' ( 73) |1100100 64 [ 7] 'J' ( 74) |1100101 65 [ 7] 'K' ( 75) |1100110 66 [ 7] 'L' ( 76) |1100111 67 [ 7] 'M' ( 77) |1101000 68 [ 7] 'N' ( 78) |1101001 69 [ 7] 'O' ( 79) |1101010 6a [ 7] 'P' ( 80) |1101011 6b [ 7] 'Q' ( 81) |1101100 6c [ 7] 'R' ( 82) |1101101 6d [ 7] 'S' ( 83) |1101110 6e [ 7] 'T' ( 84) |1101111 6f [ 7] 'U' ( 85) |1110000 70 [ 7] 'V' ( 86) |1110001 71 [ 7] 'W' ( 87) |1110010 72 [ 7] 'X' ( 88) |11111100 fc [ 8] 'Y' ( 89) |1110011 73 [ 7] 'Z' ( 90) |11111101 fd [ 8] '[' ( 91) |11111111|11011 1ffb [13] '\' ( 92) |11111111|11111110|000 7fff0 [19] ']' ( 93) |11111111|11100 1ffc [13] '^' ( 94) |11111111|111100 3ffc [14] '_' ( 95) |100010 22 [ 6] '`' ( 96) |11111111|1111101 7ffd [15] 'a' ( 97) |00011 3 [ 5] 'b' ( 98) |100011 23 [ 6] 'c' ( 99) |00100 4 [ 5] 'd' (100) |100100 24 [ 6] 'e' (101) |00101 5 [ 5] 'f' (102) |100101 25 [ 6] 'g' (103) |100110 26 [ 6] 'h' (104) |100111 27 [ 6] 'i' (105) |00110 6 [ 5] 'j' (106) |1110100 74 [ 7] 'k' (107) |1110101 75 [ 7] 'l' (108) |101000 28 [ 6] 'm' (109) |101001 29 [ 6] 'n' (110) |101010 2a [ 6] 'o' (111) |00111 7 [ 5] 'p' (112) |101011 2b [ 6] 'q' (113) |1110110 76 [ 7] 'r' (114) |101100 2c [ 6] 's' (115) |01000 8 [ 5] 't' (116) |01001 9 [ 5] 'u' (117) |101101 2d [ 6] 'v' (118) |1110111 77 [ 7] 'w' (119) |1111000 78 [ 7] 'x' (120) |1111001 79 [ 7] 'y' (121) |1111010 7a [ 7] 'z' (122) |1111011 7b [ 7] '{' (123) |11111111|1111110 7ffe [15] '|' (124) |11111111|100 7fc [11] '}' (125) |11111111|111101 3ffd [14] '~' (126) |11111111|11101 1ffd [13] (127) |11111111|11111111|11111111|1100 ffffffc [28] (128) |11111111|11111110|0110 fffe6 [20] (129) |11111111|11111111|010010 3fffd2 [22] (130) |11111111|11111110|0111 fffe7 [20] (131) |11111111|11111110|1000 fffe8 [20] (132) |11111111|11111111|010011 3fffd3 [22] (133) |11111111|11111111|010100 3fffd4 [22] (134) |11111111|11111111|010101 3fffd5 [22] (135) |11111111|11111111|1011001 7fffd9 [23] (136) |11111111|11111111|010110 3fffd6 [22] (137) |11111111|11111111|1011010 7fffda [23] (138) |11111111|11111111|1011011 7fffdb [23] (139) |11111111|11111111|1011100 7fffdc [23] (140) |11111111|11111111|1011101 7fffdd [23] (141) |11111111|11111111|1011110 7fffde [23] (142) |11111111|11111111|11101011 ffffeb [24] (143) |11111111|11111111|1011111 7fffdf [23] (144) |11111111|11111111|11101100 ffffec [24] (145) |11111111|11111111|11101101 ffffed [24] (146) |11111111|11111111|010111 3fffd7 [22] (147) |11111111|11111111|1100000 7fffe0 [23] (148) |11111111|11111111|11101110 ffffee [24] (149) |11111111|11111111|1100001 7fffe1 [23] (150) |11111111|11111111|1100010 7fffe2 [23] (151) |11111111|11111111|1100011 7fffe3 [23] (152) |11111111|11111111|1100100 7fffe4 [23] (153) |11111111|11111110|11100 1fffdc [21] (154) |11111111|11111111|011000 3fffd8 [22] (155) |11111111|11111111|1100101 7fffe5 [23] (156) |11111111|11111111|011001 3fffd9 [22] (157) |11111111|11111111|1100110 7fffe6 [23] (158) |11111111|11111111|1100111 7fffe7 [23] (159) |11111111|11111111|11101111 ffffef [24] (160) |11111111|11111111|011010 3fffda [22] (161) |11111111|11111110|11101 1fffdd [21] (162) |11111111|11111110|1001 fffe9 [20] (163) |11111111|11111111|011011 3fffdb [22] (164) |11111111|11111111|011100 3fffdc [22] (165) |11111111|11111111|1101000 7fffe8 [23] (166) |11111111|11111111|1101001 7fffe9 [23] (167) |11111111|11111110|11110 1fffde [21] (168) |11111111|11111111|1101010 7fffea [23] (169) |11111111|11111111|011101 3fffdd [22] (170) |11111111|11111111|011110 3fffde [22] (171) |11111111|11111111|11110000 fffff0 [24] (172) |11111111|11111110|11111 1fffdf [21] (173) |11111111|11111111|011111 3fffdf [22] (174) |11111111|11111111|1101011 7fffeb [23] (175) |11111111|11111111|1101100 7fffec [23] (176) |11111111|11111111|00000 1fffe0 [21] (177) |11111111|11111111|00001 1fffe1 [21] (178) |11111111|11111111|100000 3fffe0 [22] (179) |11111111|11111111|00010 1fffe2 [21] (180) |11111111|11111111|1101101 7fffed [23] (181) |11111111|11111111|100001 3fffe1 [22] (182) |11111111|11111111|1101110 7fffee [23] (183) |11111111|11111111|1101111 7fffef [23] (184) |11111111|11111110|1010 fffea [20] (185) |11111111|11111111|100010 3fffe2 [22] (186) |11111111|11111111|100011 3fffe3 [22] (187) |11111111|11111111|100100 3fffe4 [22] (188) |11111111|11111111|1110000 7ffff0 [23] (189) |11111111|11111111|100101 3fffe5 [22] (190) |11111111|11111111|100110 3fffe6 [22] (191) |11111111|11111111|1110001 7ffff1 [23] (192) |11111111|11111111|11111000|00 3ffffe0 [26] (193) |11111111|11111111|11111000|01 3ffffe1 [26] (194) |11111111|11111110|1011 fffeb [20] (195) |11111111|11111110|001 7fff1 [19] (196) |11111111|11111111|100111 3fffe7 [22] (197) |11111111|11111111|1110010 7ffff2 [23] (198) |11111111|11111111|101000 3fffe8 [22] (199) |11111111|11111111|11110110|0 1ffffec [25] (200) |11111111|11111111|11111000|10 3ffffe2 [26] (201) |11111111|11111111|11111000|11 3ffffe3 [26] (202) |11111111|11111111|11111001|00 3ffffe4 [26] (203) |11111111|11111111|11111011|110 7ffffde [27] (204) |11111111|11111111|11111011|111 7ffffdf [27] (205) |11111111|11111111|11111001|01 3ffffe5 [26] (206) |11111111|11111111|11110001 fffff1 [24] (207) |11111111|11111111|11110110|1 1ffffed [25] (208) |11111111|11111110|010 7fff2 [19] (209) |11111111|11111111|00011 1fffe3 [21] (210) |11111111|11111111|11111001|10 3ffffe6 [26] (211) |11111111|11111111|11111100|000 7ffffe0 [27] (212) |11111111|11111111|11111100|001 7ffffe1 [27] (213) |11111111|11111111|11111001|11 3ffffe7 [26] (214) |11111111|11111111|11111100|010 7ffffe2 [27] (215) |11111111|11111111|11110010 fffff2 [24] (216) |11111111|11111111|00100 1fffe4 [21] (217) |11111111|11111111|00101 1fffe5 [21] (218) |11111111|11111111|11111010|00 3ffffe8 [26] (219) |11111111|11111111|11111010|01 3ffffe9 [26] (220) |11111111|11111111|11111111|1101 ffffffd [28] (221) |11111111|11111111|11111100|011 7ffffe3 [27] (222) |11111111|11111111|11111100|100 7ffffe4 [27] (223) |11111111|11111111|11111100|101 7ffffe5 [27] (224) |11111111|11111110|1100 fffec [20] (225) |11111111|11111111|11110011 fffff3 [24] (226) |11111111|11111110|1101 fffed [20] (227) |11111111|11111111|00110 1fffe6 [21] (228) |11111111|11111111|101001 3fffe9 [22] (229) |11111111|11111111|00111 1fffe7 [21] (230) |11111111|11111111|01000 1fffe8 [21] (231) |11111111|11111111|1110011 7ffff3 [23] (232) |11111111|11111111|101010 3fffea [22] (233) |11111111|11111111|101011 3fffeb [22] (234) |11111111|11111111|11110111|0 1ffffee [25] (235) |11111111|11111111|11110111|1 1ffffef [25] (236) |11111111|11111111|11110100 fffff4 [24] (237) |11111111|11111111|11110101 fffff5 [24] (238) |11111111|11111111|11111010|10 3ffffea [26] (239) |11111111|11111111|1110100 7ffff4 [23] (240) |11111111|11111111|11111010|11 3ffffeb [26] (241) |11111111|11111111|11111100|110 7ffffe6 [27] (242) |11111111|11111111|11111011|00 3ffffec [26] (243) |11111111|11111111|11111011|01 3ffffed [26] (244) |11111111|11111111|11111100|111 7ffffe7 [27] (245) |11111111|11111111|11111101|000 7ffffe8 [27] (246) |11111111|11111111|11111101|001 7ffffe9 [27] (247) |11111111|11111111|11111101|010 7ffffea [27] (248) |11111111|11111111|11111101|011 7ffffeb [27] (249) |11111111|11111111|11111111|1110 ffffffe [28] (250) |11111111|11111111|11111101|100 7ffffec [27] (251) |11111111|11111111|11111101|101 7ffffed [27] (252) |11111111|11111111|11111101|110 7ffffee [27] (253) |11111111|11111111|11111101|111 7ffffef [27] (254) |11111111|11111111|11111110|000 7fffff0 [27] (255) |11111111|11111111|11111011|10 3ffffee [26] EOS (256) |11111111|11111111|11111111|111111 3fffffff [30] """ class Node: def __init__(self, term = None): self.term = term self.left = None self.right = None self.trans = [] self.id = None self.accept = False class Context: def __init__(self): self.next_id_ = 0 self.root = Node() def next_id(self): id = self.next_id_ self.next_id_ += 1 return id def _add(node, sym, bits): if len(bits) == 0: node.term = sym return else: if bits[0] == '0': if node.left is None: node.left = Node() child = node.left else: if node.right is None: node.right = Node() child = node.right _add(child, sym, bits[1:]) def huffman_tree_add(ctx, sym, bits): _add(ctx.root, sym, bits) def _set_node_id(ctx, node, prefix): if node.term is not None: return if len(prefix) <= 7 and [1] * len(prefix) == prefix: node.accept = True node.id = ctx.next_id() _set_node_id(ctx, node.left, prefix + [0]) _set_node_id(ctx, node.right, prefix + [1]) def huffman_tree_set_node_id(ctx): _set_node_id(ctx, ctx.root, []) def _traverse(node, sym, start_node, root, left): if left == 0: if sym == 256: sym = None node = None start_node.trans.append((node, sym)) return if node.term is not None: node = root def go(node): if node.term is not None: assert sym is None nsym = node.term else: nsym = sym _traverse(node, nsym, start_node, root, left - 1) go(node.left) go(node.right) def _build_transition_table(ctx, node): if node is None: return _traverse(node, None, node, ctx.root, 4) _build_transition_table(ctx, node.left) _build_transition_table(ctx, node.right) def huffman_tree_build_transition_table(ctx): _build_transition_table(ctx, ctx.root) NGHTTP3_QPACK_HUFFMAN_ACCEPTED = 1 << 14 NGHTTP3_QPACK_HUFFMAN_SYM = 1 << 15 def _print_transition_table(node): if node.term is not None: return print('/* {} */'.format(node.id)) print('{') for nd, sym in node.trans: flags = 0 if sym is None: out = 0 else: out = sym flags |= NGHTTP3_QPACK_HUFFMAN_SYM if nd is None: id = 256 else: id = nd.id if id is None: # if nd.id is None, it is a leaf node id = 0 flags |= NGHTTP3_QPACK_HUFFMAN_ACCEPTED elif nd.accept: flags |= NGHTTP3_QPACK_HUFFMAN_ACCEPTED print(' {{0x{:02x}, {}}},'.format(id | flags, out)) print('},') _print_transition_table(node.left) _print_transition_table(node.right) def huffman_tree_print_transition_table(ctx): _print_transition_table(ctx.root) print('/* 256 */') print('{') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print(' {0x100, 0},') print('},') if __name__ == '__main__': ctx = Context() symbol_tbl = [(None, 0) for i in range(257)] for line in io.StringIO(HUFFMAN_CODE_TABLE): m = re.match( r'.*\(\s*(\d+)\)\s+([|01]+)\s+(\S+)\s+\[\s*(\d+)\].*', line) if m: sym = int(m.group(1)) bits = re.sub(r'\|', '', m.group(2)) code = m.group(3) nbits = int(m.group(4)) if len(code) > 8: raise Error('Code is more than 4 bytes long') assert(len(bits) == nbits) symbol_tbl[sym] = (nbits, code) huffman_tree_add(ctx, sym, bits) huffman_tree_set_node_id(ctx) huffman_tree_build_transition_table(ctx) print('''\ typedef struct { uint32_t nbits; uint32_t code; } nghttp3_qpack_huffman_sym; ''') print('''\ const nghttp3_qpack_huffman_sym huffman_sym_table[] = {''') for i in range(257): nbits = symbol_tbl[i][0] k = int(symbol_tbl[i][1], 16) k = k << (32 - nbits) print('''\ {{ {}, 0x{}u }}{}\ '''.format(symbol_tbl[i][0], hex(k)[2:], ',' if i < 256 else '')) print('};') print('') print('''\ enum {{ NGHTTP3_QPACK_HUFFMAN_ACCEPTED = {}, NGHTTP3_QPACK_HUFFMAN_SYM = {}, }} nghttp3_qpack_huffman_decode_flag; '''.format(NGHTTP3_QPACK_HUFFMAN_ACCEPTED, NGHTTP3_QPACK_HUFFMAN_SYM)) print('''\ typedef struct { uint16_t fstate; uint8_t sym; } nghttp3_qpack_huffman_decode_node; ''') print('''\ const nghttp3_qpack_huffman_decode_node qpack_huffman_decode_table[][16] = {''') huffman_tree_print_transition_table(ctx) print('};')
[ "tatsuhiro.t@gmail.com" ]
tatsuhiro.t@gmail.com
dc3f80de3fed77fc2506bf296b04f63ce5dd996c
f19c5436c7173835a3f1d064541ee742178e213a
/mah/divide and conquer/[BOJ]1920_์ˆ˜ ์ฐพ๊ธฐ.py
9bdd791f8797941a03f185c9f847b8104e5e9e83
[]
no_license
hongsungheejin/Algo-Study
f1c521d01147a6f74320dbc8efe3c1037e970e73
d6cb8a2cc6495ccfcfb3477330a3af95895fae32
refs/heads/main
2023-07-06T10:58:27.258128
2021-07-29T02:11:13
2021-07-29T02:11:13
379,269,918
2
0
null
null
null
null
UTF-8
Python
false
false
385
py
N = int(input()) nums = list(map(int, input().split())) nums.sort() M = int(input()) tars = list(map(int, input().split())) def binary_serach(tar): l, r = 0, len(nums) - 1 while l<=r: m = (l+r)//2 if nums[m] == tar: return 1 elif nums[m] < tar: l=m+1 else: r=m-1 return 0 for tar in tars: print(binary_serach(tar))
[ "mai.hong0924@gmail.com" ]
mai.hong0924@gmail.com
dd38861457d0332d6c9b6322722556eb6f6b3fc6
b577bd7cee15fc4a9c7b57eac07b532b53f5a890
/teste.py
048c8e430f2aaccdbe0cc12bec39aa454a6d551e
[]
no_license
ponsdev/Arch-Timer
6dcac54e6a43c8f89a1f09dace1d7e9d32a632a2
ae89915e727c67d66662df3cedaa570d253ac5c7
refs/heads/master
2020-03-09T15:39:57.312960
2019-05-10T18:27:09
2019-05-10T18:27:09
128,864,924
0
0
null
null
null
null
UTF-8
Python
false
false
48
py
import sys filePath=sys.argv[1] print(filePath)
[ "viniciusdev@zoho.com" ]
viniciusdev@zoho.com
3c5c13bc7708b7f1f902b92f1224968214201cf3
110e46dfe166dd00854ef70549e942c644a8775b
/Python_ Ejercicios/Ingreso_Linkedin.py
60586d80479683aa40a8652b9dd681c5d8cdab60
[]
no_license
silvina84/TrabajosPython
1b573cd594b998cee8f5c73fb4de924ac0f13998
afe2fdf2662229b8f2d98af0211638b03e12e690
refs/heads/master
2023-03-02T11:55:14.722338
2021-02-10T22:55:58
2021-02-10T22:55:58
337,839,896
0
0
null
null
null
null
UTF-8
Python
false
false
1,880
py
#Login con usuario y contraseรฑa en Linkedin import xlrd #Para leer archivos excel import pandas import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait #Llama a un subpaquete dentro de selenium , es para esperar from selenium.webdriver.support import expected_conditions as ec from selenium.common.exceptions import NoSuchElementException excel_credenciales = 'C:\\Users\\silvina\\Documents\\Datos_Linkedin.xlsx' df = pandas.read_excel(excel_credenciales) user = df['usuario'][0] psw = df['contraseรฑa'][0] url = 'https://www.linkedin.com/' #Selectores boton_iniciar_sesion = 'body > nav > div > a.nav__button-secondary' ingreso_usuario = '#username' ingreso_contrasenia = '#password' boton_login = '#app__container > main > div:nth-child(2) > form > div.login__form_action_container > button' error_contrasenia ='#error-for-password' xpath_error_psw = '//*[@id="error-for-password"]' #Abrir navegador driver = webdriver.Chrome("C:\\chromedriver_win32\\chromedriver.exe") #Maximizar pantalla driver.maximize_window() driver.get(url) #Busco el elemento de Iniciar Sesion driver.find_element_by_css_selector(boton_iniciar_sesion).click() #Ahora nos logueamos, utilizo un bloque try-except para atrapar excepciones try: driver.find_element_by_css_selector(ingreso_usuario).send_keys(user) driver.find_element_by_css_selector(ingreso_contrasenia).send_keys(psw) driver.find_element_by_css_selector(boton_login).click() driver.find_element_by_xpath(xpath_error_psw) except Exception as ex: print(ex) print("Ingreso correcto a la pรกgina") else: print("La contrasenia ingresada es incorrecta") #Le damos un tiempo de 3 segundos para que cargue la pรกgina time.sleep(3) #Cerramos el driver driver.quit()
[ "silvinacace@gmail.com" ]
silvinacace@gmail.com
1c91383daeead69767d8a3e989bcf2f3fff2bfeb
1910497a6d0bf8d572ecb933127792c6ee924f26
/Python/Mutations.py
b71f00ff91cfb5841480d27fd1a3db4b40189081
[]
no_license
saurabhc24/hackerrank-solutions
558e56754c11f5f25976df1aa38b33db04b37734
3499014a33b3383ee28d48f92063a67bb9e05bfc
refs/heads/master
2023-08-21T18:05:42.507456
2021-10-03T17:42:35
2021-10-03T17:42:35
260,264,605
0
2
null
2020-10-10T07:31:13
2020-04-30T16:40:08
C
UTF-8
Python
false
false
439
py
def mutate_string(string, position, character): return"".join(list(string[:position]+character+string[position+1:])) #first converting the string into list and then using slice [:] to add the desired character at the required position, then using join() string method to convert it back to string if __name__ == '__main__': s = raw_input() i, c = raw_input().split() s_new = mutate_string(s, int(i), c) print s_new
[ "noreply@github.com" ]
noreply@github.com
39e2d9dbdc83ea68defe4b575e5d0bee237f89bc
205be8d429df36e27cdfc048bfca9212c5a62a87
/icu/urls.py
ed2cf073014ebef72cfb33b59762ed1241b9df93
[]
no_license
KennyChrisUmurundi/HOsto
16c8f926282fc48c981532447f1685fbbc2b457c
33fa31524a08934f3deb8f622a1b1554d8ef1af4
refs/heads/master
2022-04-01T02:42:39.146227
2020-01-07T11:44:08
2020-01-07T11:44:08
193,458,881
0
0
null
null
null
null
UTF-8
Python
false
false
478
py
from django.urls import path from django.contrib.auth import views as auth_views from . import views as icu_views from django.conf.urls.static import static from django.conf import settings app_name = 'icu' urlpatterns = [ path('Medical Update/',icu_views.update_list,name="add-medical"), path('scan/',icu_views.ScanCode,name="ScanCode"), path('patient/<slug:code>',icu_views.patient,name="patient"), path('feedback/<slug:code>/<int:id>',icu_views.feedback,name="feedback"), ]
[ "ndayikennysmuusic@gmail.com" ]
ndayikennysmuusic@gmail.com
1fcd94d623978daffea0a24521a7a469988c6c4a
743d2aa865b22d7707a845fb2a015096d62778b5
/embed2geo.py
59cf41ea45050b90e01d3e96c66f392e5859cbe0
[]
no_license
Yonghui56/coord2geo_GMSH
dcab900497da350cec7f95278ba5e3b11742b35a
82d35b2533efbfb2798b63ce0301fb6daff26960
refs/heads/master
2020-06-20T00:33:37.256259
2019-07-15T05:34:25
2019-07-15T05:34:25
196,929,602
1
0
null
null
null
null
UTF-8
Python
false
false
1,130
py
# Python Program for quick gmsh grid gen import string,sys def convert_pts_togmsh(filename,outputname,startpoint): # Read in data using this bit fin=open(filename, 'r') i=0 x = []; y = []; z = []; lines = fin.readlines() for line in lines: # comments indicated by # if line[0] != '#' or line[0] != '': i=i+1 data = str.split(line) x.append(float(data[0])) y.append(float(data[1])) z.append(float(data[2])) n_lines = int(i) # Write data out with this; fout = open(outputname,'w') lc_name = "%s_lc" % filename[0:3] # Format # Point(1) = {0, 0, 0, lc}; fout.write("%s = 0.005;\n" % lc_name) j = startpoint for i in range(n_lines): outputline = "Point{%i} In Surface{1};\n " \ % (j) j = j + 1 fout.write(outputline) # gmsh bspline format # Write out splinefit line #fout.write("Spline(%i) = {%i:%i};\n" \ # % (startpoint,startpoint,startpoint+n_lines-1)) fout.close fin.close def main(): inputfile = sys.argv[1] convert_pts_togmsh(inputfile,inputfile+".geo",1) if __name__ == "__main__": main()
[ "noreply@github.com" ]
noreply@github.com
520225b1b9d44a0d7ef41248511013f812e9c07f
5ead730e69f1042de1f43ac64e767d6463ffe691
/basic guess game.py
6c1bf87b7d5dcc7046f85a7ffb5b79db10b2b3ab
[ "MIT" ]
permissive
ravi9607/basic-program-by-python
84258d110cdb9f9f285e93ddac5eb411d60fae77
534fc4a4c316ba0b8391f72647c4f9c9d33bb8e6
refs/heads/main
2022-12-26T05:33:35.965400
2020-10-10T13:07:51
2020-10-10T13:07:51
301,167,757
0
0
null
2020-10-04T15:56:25
2020-10-04T15:56:24
null
UTF-8
Python
false
false
356
py
code_word = "priya" guess = "" guess_count= 0 guess_limit= 3 out_of_gusses=False while guess != code_word and not out_of_gusses : if guess_count< guess_limit: guess = input("enter guess : ") guess_count+=1 else: out_of_gusses=True if out_of_gusses: print("you lose!") else: print("congrats, YOU WIN !")
[ "noreply@github.com" ]
noreply@github.com
13daadc403ee347a1877bef70ef64461737e38cc
5a71ca1f5c964f803350e3c1238cb48986db565c
/coinlibbitfinex/coinlibbitfinex/streamapi.py
d6eb6285f6a324d0a46d8cc40959a345f9c959cd
[]
no_license
tetocode/coinliball
fd644cbc16039ecad7e43228ea4e287ead5c8e5f
41ebbac13c1fbba98aedaa766b9a505cb157f374
refs/heads/master
2022-09-28T21:58:08.130006
2020-06-04T03:00:56
2020-06-04T03:00:56
269,247,318
0
2
null
null
null
null
UTF-8
Python
false
false
3,624
py
import json import logging from typing import Hashable, Dict from websocket import WebSocket from coinlib.datatypes.streamdata import StreamData from coinlib.trade.websocketstreamapi import WebSocketStreamApi logger = logging.getLogger(__name__) class StreamApi(WebSocketStreamApi): URL = 'wss://api.bitfinex.com/ws' def __init__(self, **kwargs): super().__init__(**kwargs) self._subscriptions = {} self._channel_id_map: Dict[int, Hashable] = {} def _process_subscription_q(self, ws: WebSocket): # process one if len(self._subscription_q): op, (key, params) = self._subscription_q.popleft() if op == 'subscribe': self._subscriptions[key] = params self._subscribe_channel(params) logger.debug(f'subscribe {key} {params}') elif op == 'unsubscribe': params = self._subscriptions.pop(key, None) if params is not None: for channel_id, v in self._channel_id_map.items(): if v == key: self._unsubscribe_channel(channel_id) logger.debug(f'unsubscribe {key} {params} {channel_id}') break else: assert False, f'unknown operation={op}' def _subscribe_channel(self, params: dict): request = dict(event='subscribe') request.update(params) self.send_message(request) def _unsubscribe_channel(self, channel_id: int): self.send_message({ 'event': 'unsubscribe', 'chanId': channel_id, }) def on_message(self, message_data: str): message = json.loads(message_data) if isinstance(message, dict): event = message.get('event') if event == 'info': logger.debug(f'event info {message}') return elif event == 'subscribed': self.on_subscribed(message) return elif event == 'unsubscribed': self.on_unsubscribed(message) return elif event == 'error': self.on_error(message) return else: logger.warning(f'event unsupported {message}') return if isinstance(message, list): self.on_channel_data(message) return logger.warning(f'unknown message {message}') def on_subscribed(self, message: dict): channel_name = message['channel'] for key, params in self._subscriptions.items(): if channel_name == params.get('channel'): if channel_name == 'book': # TODO: distinguish between order_book and raw_order_book if message['pair'].upper() != params.get('pair', '').upper(): continue channel_id = int(message['chanId']) self._channel_id_map[channel_id] = key logger.debug(f'event subscribed {message}') return logger.warning('unknown event subscribe {message}') def on_unsubscribed(self, message: dict): _ = self logger.debug(f'event unsubscribed {message}') def on_error(self, message: dict): _ = self logger.error(f'event error {message}') def on_channel_data(self, data: list): channel_id = data[0] key = self._channel_id_map.get(channel_id) if key: self.on_raw_data(StreamData(key, data))
[ "_" ]
_
cbf2636b58eb80307527d3264435f464bf9c787e
aa2c403a5f333857217685c03e9ca950c315ccc1
/egs/voxceleb/multitask/nnet/lib/finetune.py
600edf7d901a7c1a538289d067e3d6b02bdc37d6
[ "Apache-2.0" ]
permissive
entn-at/tf-kaldi-speaker-master
5db8984c4bc86d1b3112586c377f926fa9dd3134
8392af04cbaee3fb3dd87329ad4b60d710f45d9f
refs/heads/master
2020-12-06T10:48:41.272114
2020-06-30T09:09:25
2020-06-30T09:09:25
232,444,778
0
0
Apache-2.0
2020-01-08T00:38:44
2020-01-08T00:38:44
null
UTF-8
Python
false
false
9,145
py
# Fine-tune a pre-trained model to a new model. # Optimize the entire network after loading the pre-trained model. # This require that there is no new parameter introduced in the model. # This is appropriate to train an End-to-end triplet loss (or other) network from a softmax pre-trained network where # no additional layer is involved. # If a new softmax layer is added to the pre-trained layer, it is better to train the new softmax first and # then update the entire network. import os import argparse import random import sys import tensorflow as tf import numpy as np from misc.utils import get_pretrain_model, load_lr from misc.utils import ValidLoss, save_codes_and_config, compute_cos_pairwise_eer, load_valid_loss from model.trainer import Trainer from dataset.data_loader import KaldiDataRandomQueue from dataset.kaldi_io import FeatureReader from six.moves import range # We don't need to use a `continue` option here, because if we want to resume training, we should simply use train.py. # In the beginning of finetuning, we want to restore a part of the model rather than the entire graph. parser = argparse.ArgumentParser() parser.add_argument("-c", "--cont", action="store_true", help="Continue training from an existing model.") parser.add_argument("--checkpoint", type=str, default="-1", help="The checkpoint in the pre-trained model. The default is to load the BEST checkpoint (according to valid_loss)") parser.add_argument("--config", type=str, help="The configuration file.") parser.add_argument("train_dir", type=str, help="The data directory of the training set.") parser.add_argument("train_spklist", type=str, help="The spklist file maps the TRAINING speakers to the indices.") parser.add_argument("valid_dir", type=str, help="The data directory of the validation set.") parser.add_argument("valid_spklist", type=str, help="The spklist maps the VALID speakers to the indices.") parser.add_argument("pretrain_model", type=str, help="The pre-trained model directory.") parser.add_argument("finetune_model", type=str, help="The fine-tuned model directory") if __name__ == '__main__': tf.logging.set_verbosity(tf.logging.INFO) args = parser.parse_args() params = save_codes_and_config(args.cont, args.finetune_model, args.config) # Set the random seed. The random operations may appear in data input, batch forming, etc. tf.set_random_seed(params.seed) random.seed(params.seed) np.random.seed(params.seed) # The model directory always has a folder named nnet model_dir = os.path.join(args.finetune_model, "nnet") if args.cont: # If we continue training, we can figure out how much steps the model has been trained, # using the index of the checkpoint import re ckpt = tf.train.get_checkpoint_state(model_dir) if ckpt and ckpt.model_checkpoint_path: ckpt_name = os.path.basename(ckpt.model_checkpoint_path) step = int(next(re.finditer("(\d+)(?!.*\d)", ckpt_name)).group(0)) else: sys.exit("Cannot load checkpoint from %s" % model_dir) start_epoch = int(step / params.num_steps_per_epoch) else: # Load the pre-trained model to the target model directory. # The pre-trained model will be copied as the fine-tuned model and can be loaded from the new directory. # The pre-trained model is now just like an initialized model. get_pretrain_model(os.path.join(args.pretrain_model, "nnet"), os.path.join(args.finetune_model, "nnet"), args.checkpoint) start_epoch = 0 learning_rate = params.learning_rate learning_rate_array = [] if os.path.isfile(str(learning_rate)): with open(str(learning_rate), "r") as f: for line in f.readlines(): learning_rate_array.append(float(line.strip())) # The size of the file should be large enough assert len(learning_rate_array) > params.num_epochs, "The learning rate file is shorter than the num of epochs." tf.logging.info("Using specified learning rate decay strategy.") else: # The learning rate is determined by the training process. However, if we continue training, # the code doesn't know the previous learning rate if it is tuned using the validation set. # To solve that, just save the learning rate to an individual file. if os.path.isfile(os.path.join(model_dir, "learning_rate")): learning_rate_array = load_lr(os.path.join(model_dir, "learning_rate")) assert len(learning_rate_array) == start_epoch + 1, "Not enough learning rates in the learning_rate file." else: learning_rate_array = [float(learning_rate)] * (start_epoch + 1) dim = FeatureReader(args.train_dir).get_dim() with open(os.path.join(model_dir, "feature_dim"), "w") as f: f.write("%d\n" % dim) num_total_train_speakers = KaldiDataRandomQueue(args.train_dir, args.train_spklist).num_total_speakers tf.logging.info("There are %d speakers in the training set and the dim is %d" % (num_total_train_speakers, dim)) min_valid_loss = ValidLoss() if os.path.isfile(os.path.join(model_dir, "valid_loss")): min_valid_loss = load_valid_loss(os.path.join(model_dir, "valid_loss")) # The trainer is used to control the training process trainer = Trainer(params, args.finetune_model) trainer.build("train", dim=dim, loss_type=params.loss_func, num_speakers=num_total_train_speakers, noupdate_var_list=params.noupdate_var_list) trainer.build("valid", dim=dim, loss_type=params.loss_func, num_speakers=num_total_train_speakers) if "early_stop_epochs" not in params.dict: params.dict["early_stop_epochs"] = 5 if "min_learning_rate" not in params.dict: params.dict["min_learning_rate"] = 1e-5 if start_epoch == 0: # Load the pre-trained model and transfer to current model trainer.get_finetune_model(params.noload_var_list) # Before any further training, we evaluate the performance of the current model valid_loss, valid_embeddings, valid_labels = trainer.valid(args.valid_dir, args.valid_spklist, batch_type=params.batch_type, output_embeddings=True) eer = compute_cos_pairwise_eer(valid_embeddings, valid_labels) tf.logging.info("In the beginning: Valid EER: %f" % eer) for epoch in range(start_epoch, params.num_epochs): trainer.train(args.train_dir, args.train_spklist, learning_rate_array[epoch]) valid_loss, valid_embeddings, valid_labels = trainer.valid(args.valid_dir, args.valid_spklist, batch_type=params.batch_type, output_embeddings=True) eer = compute_cos_pairwise_eer(valid_embeddings, valid_labels) tf.logging.info("[INFO] Valid EER: %f" % eer) # Tune the learning rate if necessary. if not os.path.isfile(str(learning_rate)): new_learning_rate = learning_rate_array[epoch] if valid_loss < min_valid_loss.min_loss: min_valid_loss.min_loss = valid_loss min_valid_loss.min_loss_epoch = epoch else: if epoch - min_valid_loss.min_loss_epoch >= params.reduce_lr_epochs: new_learning_rate /= 2 # If the valid loss in the next epoch still does not reduce, the learning rate will keep reducing. tf.logging.info("After epoch %d, no improvement. Reduce the learning rate to %f" % ( min_valid_loss.min_loss_epoch, new_learning_rate)) # min_valid_loss.min_loss = valid_loss min_valid_loss.min_loss_epoch += (params.reduce_lr_epochs / 2) learning_rate_array.append(new_learning_rate) if epoch == 0: # If this is the first epoch, the first learning rate should be recorded with open(os.path.join(model_dir, "learning_rate"), "a") as f: f.write("0 %.8f\n" % learning_rate_array[0]) # Save the learning rate and loss for each epoch. with open(os.path.join(model_dir, "learning_rate"), "a") as f: f.write("%d %.8f\n" % (epoch + 1, learning_rate_array[epoch + 1])) with open(os.path.join(model_dir, "valid_loss"), "a") as f: f.write("%d %f %f\n" % (epoch, valid_loss, eer)) # If the learning rate is too small, the training is actually get stuck. # Also early stop is applied. if learning_rate_array[epoch + 1] < (params.min_learning_rate - 1e-12) or \ epoch - min_valid_loss.min_loss_epoch >= params.early_stop_epochs: break # Close the session before we exit. trainer.close()
[ "ruyun_li@outlook.com" ]
ruyun_li@outlook.com
736bedd04ea4ca3c0156959d4853a7f040a14417
fac02e1c20a0fe9873acbcdb42dadc63f60eb53a
/diming/diming/pipelines.py
f53d0d26dfd3ee5c629c117cfaae1483d9c3b4d3
[]
no_license
mekhicode/crawler
da56ef6304ae176248759804781847ad8d4c8d7d
080ad590a2473f747cf37e3cc48a122b959d80ba
refs/heads/master
2021-01-22T07:06:25.238971
2016-09-20T05:50:49
2016-09-20T05:50:49
68,670,780
0
0
null
null
null
null
UTF-8
Python
false
false
286
py
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html class DimingPipeline(object): def process_item(self, item, spider): return item
[ "tangmash@163.com" ]
tangmash@163.com
19b41fc5be51639e178372588125d29a461f3787
aa99ccc7b3dd4a359b2a4c2925bca95e421b759a
/FIG5.2a/g158.py
2faf0fa0e61ba827de1a93c7908567cf04fc0aed
[]
no_license
ardhendubarman/PROJECT
7689b083c633d0e543359462f28a60658a3dabe6
97a02f3a7a8eee0009c1c465c6df52ffd608cf55
refs/heads/master
2021-01-25T11:14:28.710512
2017-06-10T10:33:01
2017-06-10T10:33:01
93,915,610
0
0
null
null
null
null
UTF-8
Python
false
false
2,653
py
""" A freely-propagating, premixed hydrogen flat flame with multicomponent transport properties. """ import cantera as ct import pickle as pkl import numpy as np # Simulation parameters p = ct.one_atm # pressure [Pa] S_l=[] #j=[0.32, 0.34, 0.38, 0.46, 0.62] i = np.linspace(300, 1350, 30) # unburned gas temperature [K] np.put(i,18,920) grid=1.58 for Tin in i: reactants = 'CH4:1, O2:2, N2:7.52' # premixed gas composition initial_grid = np.linspace(0.0, grid, 6) # m tol_ss = [1.0e-5, 1.0e-9] # [rtol atol] for steady-state problem tol_ts = [1.0e-4, 1.0e-13] # [rtol atol] for time stepping loglevel = 1 # amount of diagnostic output (0 to 8) refine_grid = True # 'True' to enable refinement, 'False' to disable # IdealGasMix object used to compute mixture properties gas = ct.Solution('gri30.xml') gas.TPX = Tin, p, reactants # Flame object f = ct.FreeFlame(gas, initial_grid) f.flame.set_steady_tolerances(default=tol_ss) f.flame.set_transient_tolerances(default=tol_ts) # Set properties of the upstream fuel-air mixture f.inlet.T = Tin f.inlet.X = reactants ## f.show_solution() # Solve with the energy equation disabled f.energy_enabled = False f.set_max_jac_age(10, 10) f.set_time_step(1e-5, [2, 5, 10, 20]) f.solve(loglevel=loglevel, refine_grid=False) f.save('adiabatic.xml', 'no_energy', 'solution with the energy equation disabled') # Solve with the energy equation enabled f.transport_model= 'Mix' f.set_refine_criteria(ratio=3, slope=0.04, curve=0.07) f.energy_enabled = True f.solve(loglevel=loglevel, refine_grid=refine_grid) f.save('adiabatic.xml', 'energy', 'solution with mixture-averaged transport') #f.show_solution() print('mixture-averaged flamespeed = {0:7f} m/s'.format(f.u[0])) S_l.append(f.u[0]) #%% ##import matplotlib.pyplot as plt ##plt.loglog(i, S_l) # Solve with multi-component transport properties # f.transport_model = 'Multi' # f.solve(loglevel, refine_grid) # f.show_solution() # print('multicomponent flamespeed = {0:7f} m/s'.format(f.u[0])) # f.save('h2_adiabatic.xml','energy_multi', # 'solution with multicomponent transport') # write the velocity, temperature, density, and mole fractions to a CSV file ## f.write_csv('adiabatic.csv', quiet=True) #%% #z=[a*b for a,b in zip(f.grid,f.u)] ##z=f.grid ##z=[a*b for a,b in zip(f.grid,f.u)] ##z=f.grid/f.u[0] ##pkl.dump(z,open('data.pkl','wb')) ##pkl.dump(Tin,open('data.pkl','wb')) ##i=len(z) pkl.dump(S_l,open('vel_'+str(grid)+'.pkl','wb')) pkl.dump(Tin,open('temp.pkl','wb'))
[ "ardhendu.1994@gmail.com" ]
ardhendu.1994@gmail.com
6e15567d6391d71d681cf27964983a4307bacdde
d6d3e49cd07d64c6c59ad101a8a2a8585cb8874a
/DHidasAna/SimpleAna/python/__init__.py
2499d6cb767ee0f3a69e86799dffd820c9b31ac5
[]
no_license
dhidas/UserCode
2bb36c4eb5bd9daa4d71a739a042e4aee9200dea
04701c732d8acb3042e8967898a789d2b2845da4
refs/heads/master
2021-01-18T14:02:11.537626
2013-10-25T14:31:27
2013-10-25T14:31:27
null
0
0
null
null
null
null
UTF-8
Python
false
false
201
py
#Automatically created by SCRAM import os localrt=os.getenv('LOCALRT', None) arch=os.getenv('SCRAM_ARCH', None) if localrt != None: __path__.append(localrt+'/cfipython/'+arch+'/DHidasAna/SimpleAna')
[ "" ]
8b0694bbd0567276a741b8362253e858aa967ba9
5b41ca66248cbbfd65f4eec920b8e6b23c4ba64d
/messagebox.py
fca82a8015ad086c1b45f71981d99f410bdb3e97
[]
no_license
jejaksaid/python-gui
2bcfd4b9b555a1e684961cee6868f209d78cc4e9
f59a0e10951c33a866bbd7a7fb75d86e10abcf53
refs/heads/master
2022-12-17T06:34:17.342632
2020-09-26T12:07:07
2020-09-26T12:07:07
281,889,510
0
0
null
null
null
null
UTF-8
Python
false
false
1,265
py
import sys from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QMessageBox from PyQt5.QtGui import QIcon from PyQt5.QtCore import pyqtSlot #Create a window with a button. If you click the button, the dialog will popup. def window(): app = QApplication(sys.argv) win = QWidget() button1 = QPushButton(win) button1.setText("Show Dialog!") button1.move(100,100) button1.clicked.connect(showDialog) win.setWindowTitle("Click Button") win.show() sys.exit(app.exec_()) '''A dialog is created with QMessageBox(). Donโ€™t forget to import this from PyQt5. Then use the methods setIcon(), setText(), setWindowTitle() to set the window decoration. You can configure the dialogs buttons with setStandardButtons().''' def showDialog(): msgBox = QMessageBox() msgBox.setIcon(QMessageBox.Information) msgBox.setText("Message box pop up window") msgBox.setWindowTitle("QMessageBox Example") msgBox.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel) msgBox.buttonClicked.connect(msgButtonClick) returnValue = msgBox.exec() if returnValue == QMessageBox.Ok: print('Ok Clicked') def msgButtonClick(i): print("Button clicked is:", i.text()) if __name__ == '__main__': window()
[ "noreply@github.com" ]
noreply@github.com
8af84a01d80c776522cf1031d8232f43427a9540
66bb3f65f0157a2b5475903c90a54d5173bc4f0a
/djthia/core/views.py
702cc124bdbc259bc6fdc7f8295d8de0cd43d8fa
[ "MIT" ]
permissive
carthage-college/django-djthia
691233049bcb05391fd82e390edb717f3bc0588a
52401592291a980c7226c0573d415e7cdb8c20d3
refs/heads/master
2023-03-04T08:22:03.055448
2023-02-24T18:33:12
2023-02-24T18:33:12
249,989,382
0
0
MIT
2023-02-24T18:33:56
2020-03-25T13:43:24
Python
UTF-8
Python
false
false
1,886
py
# -*- coding: utf-8 -*- import json import requests from datetime import datetime from django.conf import settings from django.core.cache import cache from django.http import HttpResponse from django.shortcuts import render from django.urls import reverse_lazy from django.utils.safestring import mark_safe from django.views.decorators.csrf import csrf_exempt from djauth.decorators import portal_auth_required from djthia.core.decorators import eligibility @portal_auth_required( session_var='DJTHIA_AUTH', redirect_url=reverse_lazy('access_denied'), ) @eligibility def home(request): """Application home.""" return render(request, 'home.html', {'year': datetime.now().year}) @csrf_exempt @portal_auth_required( session_var='DJTHIA_AUTH', redirect_url=reverse_lazy('access_denied'), ) def clear_cache(request, ctype='blurbs'): """Clear the cache for API content.""" cid = request.POST.get('cid') request_type = 'post' if not cid: cid = request.GET.get('cid') request_type = 'get' if cid: key = 'livewhale_{0}_{1}'.format(ctype, cid) cache.delete(key) timestamp = datetime.timestamp(datetime.now()) earl = '{0}/live/{1}/{2}@JSON?cache={3}'.format( settings.LIVEWHALE_API_URL, ctype, cid, timestamp, ) try: response = requests.get(earl, headers={'Cache-Control': 'no-cache'}) text = json.loads(response.text) cache.set(key, text) api_data = mark_safe(text['body']) except ValueError: api_data = "Cache was not cleared." if request_type == 'post': content_type = 'text/plain; charset=utf-8' else: content_type = 'text/html; charset=utf-8' else: api_data = "Requires a content ID" return HttpResponse(api_data, content_type=content_type)
[ "plungerman@gmail.com" ]
plungerman@gmail.com
ac036b0c581fd56f8e5a1abc72999ba8a216c0aa
cdfb03781f49a49fca5d0f316ecdffaeda9820ca
/djangohw/settings.py
43eb61118c966cb2173b36b8192539392bbd3352
[]
no_license
argocan/djangohw
8f302697fca27ba6f824fe8536cea0de99233337
da4b9a12b020a2627e05d131f2d5c7da76f50c3e
refs/heads/main
2023-02-04T02:06:33.058412
2020-12-15T12:18:15
2020-12-15T12:18:15
321,629,074
0
0
null
null
null
null
UTF-8
Python
false
false
3,068
py
""" Django settings for djangohw project. Generated by 'django-admin startproject' using Django 3.1.1. 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 = '(dn-&qaq$k(=5=4d+0)abz#au4#nv@30+_t+@!!i2$gt6g^y23' # 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', ] 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 = 'djangohw.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 = 'djangohw.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/'
[ "fabrizio.gambelunghe@cdp.it" ]
fabrizio.gambelunghe@cdp.it
d93a6ea41527ac0523476d0d352ebbf555f433f9
702e834fec254abce7f739a8086ba06e976df7ad
/necAnalysis.py
25c80736cc16dbb670761dd38ba8a99c49678411
[]
no_license
iamjino/tanimaul
0a6146fbc2f9e3b0748ce74f014d78c0d0feffb0
d77d3880edb15654bc683dc069a50ed477b96031
refs/heads/master
2023-01-20T14:52:29.354725
2020-11-30T19:11:19
2020-11-30T19:11:19
295,502,667
0
0
null
null
null
null
UTF-8
Python
false
false
9,069
py
import pandas as pd def day_voter(x): result = '' if x['์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] > 0: result = x['ํˆฌํ‘œ์ˆ˜'] return result class NecAnalysis(): def __init__(self, file_result, file_book): result_items = pd.read_excel(file_result) book_items = pd.read_excel(file_book) nec_result_part = result_items[['์๋ฉด๋™ํˆฌํ‘œ๊ตฌ๋ช…', '์๋ฉด๋™๋ช…', 'ํˆฌํ‘œ๊ตฌ๋ช…', '์„ ๊ฑฐ์ธ์ˆ˜', 'ํˆฌํ‘œ์ˆ˜', '๊ธฐ๊ถŒ์ˆ˜']].copy() nec_result_part.rename(columns={'์๋ฉด๋™๋ช…': '์๋ฉด๋™๋ช…_๊ฒฐ๊ณผ', 'ํˆฌํ‘œ๊ตฌ๋ช…': 'ํˆฌํ‘œ๊ตฌ๋ช…_๊ฒฐ๊ณผ'}, inplace=True) self.na = pd.merge(book_items, nec_result_part, on='์๋ฉด๋™ํˆฌํ‘œ๊ตฌ๋ช…', how='right') self.score = result_items.copy() self.dongs = self.na['์๋ฉด๋™๋ช…'].dropna().unique() self.score_dong_unique = self.score['์๋ฉด๋™๋ช…'].unique() self.score_place_unique = self.score['ํˆฌํ‘œ๊ตฌ๋ช…'].unique() def get_place_pre_sum(self): self.na['๋‹น์ผํˆฌํ‘œ์ˆ˜'] = '' self.na['์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] = self.na['ํ™•์ •๋œ ๊ตญ๋‚ด์„ ๊ฑฐ์ธ์ˆ˜ (A)'] - self.na['์„ ๊ฑฐ์ธ์ˆ˜'] self.na['๋‹น์ผํˆฌํ‘œ์ˆ˜'] = self.na.apply(day_voter, axis=1) self.na.drop(self.na.index[self.na['ํˆฌํ‘œ๊ตฌ๋ช…'] == '์†Œ๊ณ„'], axis=0, inplace=True) self.na.set_index(['์๋ฉด๋™๋ช…_๊ฒฐ๊ณผ', 'ํˆฌํ‘œ๊ตฌ๋ช…_๊ฒฐ๊ณผ'], inplace=True) self.na['๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] = '' for dong in self.dongs: dong_pre_sum = self.na.loc[(dong, '๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ'), '์„ ๊ฑฐ์ธ์ˆ˜'] dong_pre = self.na.loc[dong, '์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'].sum() dong_pre_in_ratio = dong_pre_sum / dong_pre for place in self.na.loc[dong].index: self.na.loc[(dong, place), '๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] = \ self.na.loc[(dong, place), '์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] * dong_pre_in_ratio self.na['๊ด€์™ธ์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] = self.na['์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] - self.na['๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] self.na['๋‹น์ผํˆฌํ‘œ์œจ'] = self.na['๋‹น์ผํˆฌํ‘œ์ˆ˜'] / self.na['ํ™•์ •๋œ ๊ตญ๋‚ด์„ ๊ฑฐ์ธ์ˆ˜ (A)'] * 100 self.na['์‚ฌ์ „ํˆฌํ‘œ์œจ'] = self.na['์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] / self.na['ํ™•์ •๋œ ๊ตญ๋‚ด์„ ๊ฑฐ์ธ์ˆ˜ (A)'] * 100 self.na['๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ์œจ'] = self.na['๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] / self.na['ํ™•์ •๋œ ๊ตญ๋‚ด์„ ๊ฑฐ์ธ์ˆ˜ (A)'] * 100 self.na['๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ ๋น„์ค‘'] = self.na['๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] / self.na['์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] * 100 self.na['ํˆฌํ‘œ์œจ'] = self.na['๋‹น์ผํˆฌํ‘œ์œจ'] + self.na['์‚ฌ์ „ํˆฌํ‘œ์œจ'] self.na['๊ธฐ๊ถŒ์œจ'] = self.na['๊ธฐ๊ถŒ์ˆ˜'] / self.na['ํ™•์ •๋œ ๊ตญ๋‚ด์„ ๊ฑฐ์ธ์ˆ˜ (A)'] * 100 self.na.drop(self.na.index[pd.isna(self.na['ํˆฌํ‘œ๊ตฌ๋ช…'])], axis=0, inplace=True) def get_place_pre_score(self): self.score.drop(['์๋ฉด๋™ํˆฌํ‘œ๊ตฌ๋ช…', '๋Œ€์ˆ˜', '์„ ๊ฑฐ๋ช…', '์„ ๊ฑฐ๊ตฌ๋ช…'], axis=1, inplace=True) self.score['์œ ํ˜•'] = '๋‹น์ผํˆฌํ‘œ' score = [] self.score.set_index(['์๋ฉด๋™๋ช…', 'ํˆฌํ‘œ๊ตฌ๋ช…', '์œ ํ˜•'], inplace=True) for dong in self.dongs: dong_pre_score = self.score.loc[(dong, '๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ', '๋‹น์ผํˆฌํ‘œ')].copy() dong_pre_sum = dong_pre_score['์„ ๊ฑฐ์ธ์ˆ˜'] for place in self.na.loc[dong].index: place_pre_sum = self.na.loc[(dong, place), '๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] place_pre_score = dong_pre_score * (place_pre_sum / dong_pre_sum) place_pre_score.rename((dong, place, '๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ'), inplace=True) score.append(place_pre_score) gu_pre_sum = self.na['๊ด€์™ธ์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'].sum() gu_pre_out_score = self.score.loc[('๊ฑฐ์†Œยท์„ ์ƒํˆฌํ‘œ', '์ „์ฒด', '๋‹น์ผํˆฌํ‘œ')] gu_pre_out_score = gu_pre_out_score.add(self.score.loc[('๊ด€์™ธ์‚ฌ์ „ํˆฌํ‘œ', '์ „์ฒด', '๋‹น์ผํˆฌํ‘œ')]) if '๊ตญ์™ธ๋ถ€์žฌ์žํˆฌํ‘œ' in self.score_dong_unique: gu_pre_out_score = gu_pre_out_score.add(self.score.loc[('๊ตญ์™ธ๋ถ€์žฌ์žํˆฌํ‘œ', '์ „์ฒด', '๋‹น์ผํˆฌํ‘œ')]) if '์žฌ์™ธํˆฌํ‘œ' in self.score_dong_unique: gu_pre_out_score = gu_pre_out_score.add(self.score.loc[('์žฌ์™ธํˆฌํ‘œ', '์ „์ฒด', '๋‹น์ผํˆฌํ‘œ')]) gu_pre_out_score = gu_pre_out_score.add(self.score.loc[('์ž˜๋ชปํˆฌ์ž…ยท๊ตฌ๋ถ„๋œํˆฌํ‘œ์ง€', '์ „์ฒด', '๋‹น์ผํˆฌํ‘œ')]) for dong in self.dongs: for place in self.na.loc[dong].index: place_pre_sum = self.na.loc[(dong, place), '๊ด€์™ธ์‚ฌ์ „ํˆฌํ‘œ์ˆ˜'] place_pre_score = gu_pre_out_score * (place_pre_sum / gu_pre_sum) place_pre_score.rename((dong, place, '๊ด€์™ธ์‚ฌ์ „ํˆฌํ‘œ'), inplace=True) score.append(place_pre_score) self.score = self.score.append(score) self.score.rename({'๋ฌดํšจ ํˆฌํ‘œ์ˆ˜': '๋ฌดํšจ ํˆฌํ‘œ', '๊ธฐ๊ถŒ์ˆ˜': '๊ธฐ๊ถŒ'}, axis='columns', inplace=True) self.score.drop(['๊ฑฐ์†Œยท์„ ์ƒํˆฌํ‘œ', '๊ด€์™ธ์‚ฌ์ „ํˆฌํ‘œ', '๊ตญ์™ธ๋ถ€์žฌ์žํˆฌํ‘œ', '์žฌ์™ธํˆฌํ‘œ', '์ž˜๋ชปํˆฌ์ž…ยท๊ตฌ๋ถ„๋œํˆฌํ‘œ์ง€'], axis=0, level=0, inplace=True) self.score.drop(['์†Œ๊ณ„', '๊ณ„', '๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ'], axis=0, level=1, inplace=True) self.score.sort_index(inplace=True) def copy_series(self, org_list, dong, place): new_list = org_list.copy() new_list.rename((dong, place), inplace=True) return new_list def concat_list(self, add_list): df_list = pd.DataFrame(add_list) df_list.drop(['์„ ๊ฑฐ์ธ์ˆ˜', 'ํˆฌํ‘œ์ˆ˜'], axis=1, inplace=True) self.na = pd.concat([self.na, df_list], axis=1) def get_score_analysis(self): if '๊ตญ์™ธ๋ถ€์žฌ์žํˆฌํ‘œ(๊ณต๊ด€)' in self.score_dong_unique: total_valid = self.score['ํˆฌํ‘œ์ˆ˜'].sum() - self.score.loc[('๊ตญ์™ธ๋ถ€์žฌ์žํˆฌํ‘œ(๊ณต๊ด€)', '์ „์ฒด', '๋‹น์ผํˆฌํ‘œ'), 'ํˆฌํ‘œ์ˆ˜'] else: total_valid = self.score['ํˆฌํ‘œ์ˆ˜'].sum() stat_score = [] analysis_total_ratio = [] ratio_sums = [] ratio_pres = [] ratio_days = [] for dong in self.dongs: for place in self.na.loc[dong].index: place_score = self.score.loc[(dong, place)] score_sum = place_score.sum() score_sum.rename((dong, place, '์†Œ๊ณ„'), inplace=True) stat_score.append(score_sum) total_vote = score_sum['ํˆฌํ‘œ์ˆ˜'] ratio_sum = score_sum / total_vote * 100 ratio_sum.rename((dong, place, '๋น„์œจ'), inplace=True) stat_score.append(ratio_sum) score_pre = self.score.loc[(dong, place, ['๊ด€๋‚ด์‚ฌ์ „ํˆฌํ‘œ', '๊ด€์™ธ์‚ฌ์ „ํˆฌํ‘œ'])].sum() score_pre.rename((dong, place, '์‚ฌ์ „์†Œ๊ณ„'), inplace=True) stat_score.append(score_pre) ratio_pre = score_pre / total_vote * 100 ratio_pre.rename((dong, place, '์‚ฌ์ „๋น„์œจ'), inplace=True) stat_score.append(ratio_pre) score_day = self.score.loc[(dong, place, ['๋‹น์ผํˆฌํ‘œ'])].sum() ratio_day = score_day / total_vote * 100 ratio_day.rename((dong, place, '๋‹น์ผ๋น„์œจ'), inplace=True) stat_score.append(ratio_day) ratio_sums.append(self.copy_series(ratio_sum, dong, place)) ratio_pres.append(self.copy_series(ratio_pre, dong, place)) ratio_days.append(self.copy_series(ratio_day, dong, place)) score_total_ratio_anlaysis = score_sum / total_valid * 100 * self.na.index.size score_total_ratio_anlaysis.rename((dong, place), inplace=True) analysis_total_ratio.append(score_total_ratio_anlaysis) self.score = self.score.append(stat_score) self.score.sort_index(inplace=True) self.concat_list(ratio_sums) self.concat_list(ratio_pres) self.concat_list(ratio_days) def merge_house_info(self, sg_id, doc_poll_house_info): df_house_infos = pd.read_excel(doc_poll_house_info) df_house_info_sub1 = df_house_infos.loc[:, [sg_id, '์„ธ๋Œ€์ˆ˜', '๋™์ˆ˜', '์ „์šฉ๋ฉด์  60์ดํ•˜', '์ „์šฉ๋ฉด์  60-85์ดํ•˜', '์ „์šฉ๋ฉด์  85-135์ดํ•˜', '์ „์šฉ๋ฉด์  135์ดˆ๊ณผ', '๋‹จ์ง€ ์ „์šฉ๋ฉด์ ํ•ฉ']] df_house_info_sub1.rename(columns={'์„ธ๋Œ€์ˆ˜': '๊ณต๋™์ฃผํƒ ์„ธ๋Œ€์ˆ˜'}, inplace=True) df_house_info_summary = df_house_info_sub1.groupby(sg_id).sum() df_house_info_summary.insert(0, '๊ณต๋™์ฃผํƒ ๋‹จ์ง€์ˆ˜', df_house_info_sub1.groupby(sg_id).size()) self.na = pd.merge(self.na, df_house_info_summary, left_on='ํˆฌํ‘œ๊ตฌ๋ช…', right_index=True, how='left') self.na['์„ธ๋Œ€ ํ‰๊ท  ์ „์šฉ๋ฉด์ '] = self.na['๋‹จ์ง€ ์ „์šฉ๋ฉด์ ํ•ฉ'] / self.na['๊ณต๋™์ฃผํƒ ์„ธ๋Œ€์ˆ˜'] self.na['๊ณต๋™์ฃผํƒ ์„ธ๋Œ€์ˆ˜ ์ปค๋ฒ„๋ฆฌ์ง€'] = self.na['๊ณต๋™์ฃผํƒ ์„ธ๋Œ€์ˆ˜'] / self.na['์„ธ๋Œ€์ˆ˜'] * 100 def run(self, sg_id, doc_poll_house_info): self.get_place_pre_sum() self.get_place_pre_score() self.merge_house_info(sg_id, doc_poll_house_info) self.get_score_analysis()
[ "55924206+ryanroypapa@users.noreply.github.com" ]
55924206+ryanroypapa@users.noreply.github.com
711cad9016bd2b8763f7e58436756578d43a0017
0f20fd02b26edda61d911387fae18248a5b387c1
/smtp/smtpd_senddata/smtpd_senddata.py
6e7487b46bc852ec71dc94766dc968be74783247
[]
no_license
jadermcs/networkinglab
fa7660536b39179bc71c1a2caabe7fb3d4043027
326d4ce261b2c0a4c684ff7c355992edcf85f5c6
refs/heads/master
2020-03-10T02:50:58.834880
2018-04-28T14:45:49
2018-04-28T14:45:49
129,147,873
0
0
null
2018-04-15T14:56:25
2018-04-11T20:05:42
Python
UTF-8
Python
false
false
795
py
import smtplib import email.utils from email.mime.text import MIMEText # Create the message msg = MIMEText('This is the body of the message.') msg['To'] = email.utils.formataddr(('Recipient', 'recipient@example.com'), ('Joao', 'joaoud@example.com')) msg['From'] = email.utils.formataddr(('Author', 'author@example.com')) msg['Subject'] = 'Simple test message' server = smtplib.SMTP('172.17.0.2', 1025) server.set_debuglevel(True) # show communication with the server try: server.sendmail('author@example.com', ['recipient@example.com', 'joaoud@example.com'], msg.as_string()) finally: server.quit()
[ "jadermcs94@gmail.com" ]
jadermcs94@gmail.com
b284a5639417c0f7114f20e3ced9f5d326bbab15
699c5894668e07bbb4ddae632730f0d218f72558
/Yeji-Lee/baekjoon/b_100/๋‘ ์ˆ˜ ๋น„๊ตํ•˜๊ธฐ.py
dba5c432a59ef39ab6eefb04ce05640afbacc605
[]
no_license
Sumsan38/learning-algorithm
0914ddbbd8786381dda807562e4529773b4aa987
59a1d7b53d4348a0320b0cbf48ee75b5086b3a29
refs/heads/master
2023-07-15T08:16:29.896218
2021-08-14T11:47:01
2021-08-14T11:47:01
null
0
0
null
null
null
null
UTF-8
Python
false
false
154
py
# https://www.acmicpc.net/problem/1330 A, B = map(int, input().split()) if A > B: print('>') elif A < B: print('<') elif A == B: print('==')
[ "noreply@github.com" ]
noreply@github.com
15964455a90498f40c1b5832baba1979f60603a1
487ce91881032c1de16e35ed8bc187d6034205f7
/codes/CodeJamCrawler/16_0_3_neat/16_0_3_stanm_coin-jam.py
d03fbeb3caa801b73d052e9fa018ecc9ef309635
[]
no_license
DaHuO/Supergraph
9cd26d8c5a081803015d93cf5f2674009e92ef7e
c88059dc66297af577ad2b8afa4e0ac0ad622915
refs/heads/master
2021-06-14T16:07:52.405091
2016-08-21T13:39:13
2016-08-21T13:39:13
49,829,508
2
0
null
2021-03-19T21:55:46
2016-01-17T18:23:00
Python
UTF-8
Python
false
false
945
py
#! /usr/bin/python import sys def rinp(): one = input() _ = input().split(' ') N = int(_[0]) J = int(_[1]) return (N, J) def get_binary(num): return "{0:b}".format(num) def in_base(stng, base): return int(stng, base) def get_div(x): for d in range(2, x): if d * d > x: return 1 if x % d == 0: return d def check_num(x): bnry = get_binary(x) divs = [] for base in range(2, 11): t = in_base(bnry, base) div = get_div(t) if div == 1: return 0 divs.append(div) print (bnry, " ".join([str(d) for d in divs])) return 1 def main(): (N, J) = rinp() start = 2 ** (N - 1) + 1 end = 2 ** N - 1 print ("Case #1:") count = 0 for x in range(end, start, -2): get_binary(x) count += check_num(x) if count == J: break if __name__ == '__main__': main()
[ "[dhuo@tcd.ie]" ]
[dhuo@tcd.ie]
4f7d45874caf756b4c49443237a554b3a6d6fa09
305eb0000d98d01ac804d50d2f7ec145006f43bf
/agent/bot.py
14c35fd9059bedf6993aab69ab499b326ab028dc
[ "MIT" ]
permissive
latticetower/dr-derks-mutants
e72109f873118cd2c6323fb15d5780bcc41b679e
5c3ab86137ecb478a3013985172d160568a86b13
refs/heads/main
2023-03-03T00:58:31.167240
2021-02-04T04:28:35
2021-02-04T04:40:22
334,600,980
1
1
null
null
null
null
UTF-8
Python
false
false
85
py
import numpy as np from agent.dqn_bot import DerkPlayer # change this if necessary
[ "merlettaia@gmail.com" ]
merlettaia@gmail.com
49876f9f114cb015c6ec0352ca7ce0cdded1edee
0393e64ac4ed8e3d745b31d44836b58571faaabb
/aefingar_forritun/daemi21-while.py
62b274d4f84b333ad325bb3863b604122476a8e9
[]
no_license
danielthorr18/forritun_git
c3647e1e6dd35cd55287bb2d51066d8ab55ea931
b544371664a15dd0660aef83cdf474e506e1b412
refs/heads/master
2020-03-28T00:04:50.700712
2018-11-15T15:26:42
2018-11-15T15:26:42
147,368,645
0
0
null
null
null
null
UTF-8
Python
false
false
197
py
turns = int(input("Slรกรฐu inn tรถlu: ")) counter = 0 while counter < turns: pick = int(input("Slรกรฐu inn tรถlu: ")) if pick % 2 == 1: print("รพรบ valdir", pick) counter += 1
[ "danielr18@ru.is" ]
danielr18@ru.is
4272a7d781c422d78e27a838280b038082ef95ab
57fc5d54f5df359c7a53020fb903f36479d3a322
/controllers/.history/supervisor/supervisor_20201127194410.py
c91f5cc5bde9a494e19c7adadf4e75e4d0388496
[]
no_license
shenwuyue-xie/webots_testrobots
929369b127258d85e66c5275c9366ce1a0eb17c7
56e476356f3cf666edad6449e2da874bb4fb4da3
refs/heads/master
2023-02-02T11:17:36.017289
2020-12-20T08:22:59
2020-12-20T08:22:59
323,032,362
0
0
null
null
null
null
UTF-8
Python
false
false
25,059
py
import math import numpy as np from numpy import random from numpy.core.fromnumeric import size from numpy.lib.function_base import meshgrid import utilities as utils from deepbots.supervisor.controllers.supervisor_emitter_receiver import \ SupervisorCSV # # from deepbots.supervisor.wrappers.tensorboard_wrapper import TensorboardLogger from tensorboardX import SummaryWriter from models.networks import TD3 from controller import Keyboard import os Max_robotnum = 6 OBSERVATION_SPACE = (Max_robotnum-1) * 4 + 7 + 9 * Max_robotnum ACTION_SPACE = Max_robotnum * 2 + 3 MAX_DSNUM = (Max_robotnum-1) * 4 + 7 DIST_SENSORS_MM = {'min': 0, 'max': 1000} XPOSITION = {'min':-2, 'max':2} YPOSITION = {'min':-1.5 , 'max':1.5} ZPOSITION = {'min': -1, 'max' : 8} MAX_DISTANCE = {'min':0, 'max':10} MAX_ANGLE = {'min':-math.pi, 'max':math.pi} # import ptvsd # print("waiting for debugger attach") # ptvsd.enable_attach(address=("127.0.0.1",7788)) # ptvsd.wait_for_attach() class TaskDecisionSupervisor(SupervisorCSV): def __init__(self,robot,observation_space,log_dir,v_action,v_observation,v_reward,windows=[10,100,200]): super(TaskDecisionSupervisor,self).__init__() self.timestep = int(self.supervisor.getBasicTimeStep()) self.keyboard = Keyboard() self.keyboard.enable(self.timestep) self.emitter = self.supervisor.getEmitter('emitter') self.receiver = self.supervisor.getReceiver('receiver') self.robot_list = robot self.robot_handles = [] self.observation = [0 for i in range(observation_space)] self.findThreshold = 0.2 self.steps = 0 self.steps_threshold = 6000 self.endbattery = [50000 for i in range(Max_robotnum)] self.final_distance = [50 for i in range(Max_robotnum)] self.final_target = self.supervisor.getFromDef('final_target') self.should_done = False self.startbattery = 50000 self.setuprobots() self.step_cntr = 0 self.step_global = 0 self.step_reset = 0 self.score = 0 self.score_history = [] self.v_action = v_action self.v_observation = v_observation self.v_reward = v_reward self.windows = windows self.file_writer = SummaryWriter(log_dir, flush_secs=30) def setuprobots(self): for defname in self.robot_list: self.robot_handles.append(self.supervisor.getFromDef(defname)) def handle_receiver(self): message = [] for i in range(self.robot_num): if self.receiver.getQueueLength() > 0: string_message = self.receiver.getData().decode("utf-8") string_message = string_message.split(",") for ms in string_message: message.append(ms) self.receiver.nextPacket() return message def get_observations(self): self.ds_values = [] self.final_distance = [50 for i in range(Max_robotnum)] self.message = [1000 for i in range(MAX_DSNUM)] self.angles = [] observation = [] message = self.handle_receiver() self.angles = [0 for i in range(Max_robotnum)] if len(message) != 0: for i in range(len(message)): self.message[i] = float(message[i]) self.ds_values.append(float(message[i])) for j in range(MAX_DSNUM): observation.append(utils.normalize_to_range(float(self.message[j]),DIST_SENSORS_MM['min'],DIST_SENSORS_MM['max'], 0, 1)) for k in range(0,self.robot_num): robot_position = [] robot_position = self.robot_handles[k].getPosition() robot_rotation = [] robot_rotation = self.robot_handles[k].getOrientation() observation.append(utils.normalize_to_range(float(robot_position[0]),XPOSITION['min'],XPOSITION['max'],0,1)) observation.append(utils.normalize_to_range(float(robot_position[1]),YPOSITION['min'],YPOSITION['max'],0,1)) observation.append(utils.normalize_to_range(float(robot_position[2]),ZPOSITION['min'],ZPOSITION['max'],0,1)) observation.append(utils.normalize_to_range(float(robot_rotation[0]),-1,1,0,1)) observation.append(utils.normalize_to_range(float(robot_rotation[1]),-1,1,0,1)) observation.append(utils.normalize_to_range(float(robot_rotation[2]),-1,1,0,1)) observation.append(utils.normalize_to_range(float(robot_rotation[3]),-math.pi,math.pi,0,1)) self.final_distance[k] = utils.get_distance_from_target(self.robot_handles[k],self.final_target) observation.append(utils.normalize_to_range(float(self.final_distance[k]),MAX_DISTANCE['min'],MAX_DISTANCE['max'],0,1)) self.angles[k] = utils.get_angle_from_target(self.robot_handles[k],self.final_target) observation.append(utils.normalize_to_range(float(self.angles[k]),MAX_ANGLE['min'],MAX_ANGLE['max'],0,1)) for m in range(self.robot_num,Max_robotnum): for n in range(9): observation.append(0.5) else : observation = [0 for i in range(OBSERVATION_SPACE)] self.observation = observation return self.observation # robot_children = self.robot_handles[k].getField('children') # frontjoint_node = robot_children.getMFNode(3) # frontjoint = frontjoint_node.getField('jointParameters') # frontjoint = frontjoint.getSFNode() # para = frontjoint.getField('position') # front_hingeposition = para.getSFFloat() # observation.append(utils.normalize_to_range(float(front_hingeposition),-math.pi/2,math.pi/2,0,1)) # front_ep = frontjoint_node.getField('endPoint') # front_ep = front_ep.getSFNode() # frontrotation_field = front_ep.getField('rotation') # front_rotation = frontrotation_field.getSFRotation() # for f in range(3): # observation.append(utils.normalize_to_range(float(front_rotation[f]),-1,1,0,1)) # observation.append(utils.normalize_to_range(float(front_rotation[3]),-math.pi/2,math.pi/2,0,1)) # robot_children = self.robot_handles[k].getField('children') # rearjoint_node = robot_children.getMFNode(4) # rearjoint = rearjoint_node.getField('jointParameters') # rearjoint = rearjoint.getSFNode() # para = rearjoint.getField('position') # rear_hingeposition = para.getSFFloat() # observation.append(utils.normalize_to_range(float(rear_hingeposition),-math.pi/2,math.pi/2,0,1)) # rear_ep = rearjoint_node.getField('endPoint') # rear_ep = rear_ep.getSFNode() # rearrotation_field = rear_ep.getField('rotation') # rear_rotation = rearrotation_field.getSFRotation() # for r in range(3): # observation.append(utils.normalize_to_range(float(rear_rotation[r]),-1,1,0,1)) # observation.append(utils.normalize_to_range(float(rear_rotation[3]),-math.pi/2,math.pi/2,0,1)) # final_position = [] # final_position = self.final_target.getPosition() # observation.append(utils.normalize_to_range(float(final_position[0]),XPOSITION['min'],XPOSITION['max'],0,1)) # observation.append(utils.normalize_to_range(float(final_position[1]),YPOSITION['min'],YPOSITION['max'],0,1)) # observation.append(utils.normalize_to_range(float(final_position[2]),ZPOSITION['min'],ZPOSITION['max'],0,1)) # final_distance = [] # for d in range(self.robot_num): # final_distance.append(utils.get_distance_from_target(self.robot_handles[d],self.final_target)) # self.final_distance[d] = final_distance[d] def get_default_observation(self): self.observation = [0 for i in range(OBSERVATION_SPACE)] return self.observation def empty_queue(self): self.observation = [0 for i in range(OBSERVATION_SPACE)] # self.shockcount = 0 self.overrangecount = 0 # self.flagadd = False # self.flagreduce = False self.dscount = 0 while self.supervisor.step(self.timestep) != -1: if self.receiver.getQueueLength() > 0: self.receiver.nextPacket() else: break def get_reward(self,action): if (self.observation == [0 for i in range(OBSERVATION_SPACE)] or len(self.observation) == 0 ) : return 0 reward = 0 translations = [] for i in range(len(self.robot_handles)): translation = self.robot_handles[i].getField('translation').getSFVec3f() translations.append(translation) if self.steps >= self.steps_threshold: return -20 if np.min(self.ds_values) <= 50: reward = reward -2 self.dscount = self.dscount + 1 if self.dscount > 60: reward = reward -20 self.should_done = True if self.dscount > 30: reward = reward - 5 if np.min(self.ds_values) <= 150: reward = reward -1 for j in range(len(self.robot_handles)): if translations[j][2] <= ZPOSITION['min'] or translations[j][2] >= ZPOSITION['max']: reward = reward - 2 self.overrangecount = self.overrangecount + 1 if translations[j][0] <= XPOSITION['min'] or translations[j][0] >= ZPOSITION['max']: reward = reward - 2 self.overrangecount = self.overrangecount + 1 if self.overrangecount >40: reward = reward -20 self.should_done = True if min(self.final_distance) < self.findThreshold: reward = reward + 100 for m in range(Max_robotnum): consumption = self.startbattery - self.endbattery[m] reward = reward - float(consumption/self.startbattery) * 6 return reward else : reward = reward - float(min(self.final_distance)) return reward # """ๆƒฉ็ฝšไธๅœ+-+-็š„่กŒไธบ """ # if action[-1] > 0.9 : # if self.flagreduce == True: # self.shockcount = self.shockcount + 1 # self.flagadd = True # self.flagreduce = False # if action[-1] < 0.1: # if self.flagadd == True: # self.shockcount = self.shockcount + 1 # self.flagadd = False # self.flagreduce =True # if action[-1] >=0.1 and action[-1] <=0.9: # self.shockcount = self.shockcount - 1 # self.flagadd = False # self.flagreduce = False # if self.shockcount >= 8: # reward = reward - 4 # if self.shockcount >= 12: # reward = reward - 8 # self.should_done = True # """ๅฆ‚ๆžœban็š„ๅŠจไฝœๅ€ผๆœ‰ๅไธชๅ€ผๅ‡บ็ŽฐๅœจๅŠจไฝœๅŒบๅŸŸ๏ผŒไธ็จณๅฎš็ป™่ดŸ็š„reward,่ฎญ็ปƒๅˆฐ100ไปฃๅทฆๅณๆ—ถ๏ผŒๆจกๅ—ๅ‡ ไนŽไธๅ†ๅŠจ่‡ชๅทฑ็š„ๅ‰ๅŽmotor""" # count = 0 # for k in range(12,24): # action[k] = utils.normalize_to_range(float(action[k]),-0.2,1.2,0,1) # if action[k] > 0.95 or action[k] < 0.05: # count = count + 1 # if count > 9 : # reward = reward - 2 """something worse need to be modified""" """ๅŠ ๆœบๅ™จไบบๆ—ถ่ฟ˜้œ€่ฆ่€ƒ่™‘rearmotor็š„ไฝ็ฝฎ๏ผŒๆต‹่ฏ•ๅŽๅ‘็Žฐๆ˜ฏhingejoint็š„jointParametersๅŸŸ็š„positionๅ‚ๆ•ฐ๏ผŒ้œ€่ฆๆ‰พๅˆฐ่ฟ™ไธชๅ‚ๆ•ฐ""" """ๅฏไปฅๅชๆ”นๅ˜็›ธๅฏนๅบ”็š„hingejointๅ‚ๆ•ฐไฝฟไธค่€…็ป“ๅˆ๏ผŒไนŸๅฏไปฅๆ”นๅ˜ๆจกๅ—ไฝ็ฝฎๅ’Œ่ง’ๅบฆ๏ผŒไฝ†ๆ˜ฏๆ”นๅ˜ๆจกๅ—ไฝ็ฝฎๅ’Œ่ง’ๅบฆๆฏ”่พƒๅคๆ‚""" # position = abs(get...) # ๆ”นๅ˜hingejoint,ๅช้œ€่ฆๆ”นๅ˜front hingejoint็š„positionๅ‚ๆ•ฐ # ๆ”นๅ˜ๆจกๅ—ไฝ็ฝฎๅ’Œ่ง’ๅบฆ # deltaxๅ’Œdeltazๅฏไปฅๆ นๆฎpositionๆฅ่ฎก็ฎ—๏ผŒไธป่ฆๆ˜ฏrotation่ฆๆ›ดๆ”น๏ผŒ็ป•x่ฝดๆ—‹่ฝฌ(1,0,0,rad) # ไฝ†ๆ˜ฏไน‹ๅ‰ๅฏปๆ‰พๆจกๅ—็š„ไฝ็ฝฎๆ—ถๅทฒ็ปไฟฎๆ”น่ฟ‡่‡ชๅทฑ็š„rotation๏ผŒๆ‰€ไปฅไธๅฅฝๆ›ดๆ”น,ๅนถไธ”ๆ›ดๆ”นไบ†rotation๏ผŒtranslationไนŸ่ฆๆ›ดๆ”น๏ผŒ็”จ่ฟ™ๅฅ—ไฝ“ๅงฟ่กจๅพไฝ“็ณปๆ›ดๆ”น่ตทๆฅ็‰นๅˆซๅคๆ‚ # ๅฆๅค–๏ผŒๅ› ไธบๆ˜ฏๅพ€ๅŽๅŠ ๆจกๅ—๏ผŒๆ‰€ไปฅ้™ค้žๅฐพๅทดไธŠ็ฟ˜๏ผŒๅฆๅˆ™้ƒฝไธ่ƒฝ่ฟ™ๆ ทๅŠ ๏ผˆ้™ทๅˆฐๅœฐๅบ•ไธ‹ไบ†๏ผ‰ # ๅ†ตไธ”๏ผŒๅณไพฟๅฐพๅทดไธŠ็ฟ˜๏ผŒๅฏไปฅ็›ดๆŽฅๅŠ ๅˆฐๅŽbanไธŠ๏ผŒๅฏ่ƒฝไนŸไผšๅ› ไธบ้‡ๅŠ›ๅŽŸๅ› ๆŠŠๆ•ดไธชๆž„ๅž‹ๆŽ€็ฟป # ็ปผไธŠๆ‰€่ฟฐ๏ผŒๆ— ่ฎบๆ˜ฏๅฏ่กŒๆ€ง๏ผŒ่ฟ˜ๆ˜ฏ็จณๅฎšๆ€งๅŽŸๅ› ๏ผŒ้ƒฝๅปบ่ฎฎๅชไฟฎๆ”นfront_hingejoint็š„positionๅ€ผ def robot_step(self,action): # x = np.random.rand() # e = 0.8 + ep * 0.2/10000 # if x > e : # action[-1] = np.random.rand() if action[-1] > 0 and action[-1] <= 0.1 and self.robot_num < Max_robotnum: last_translation = self.robot_handles[-1].getField('translation').getSFVec3f() last_angle = self.robot_handles[-1].getField('rotation').getSFRotation()[3] last_rotation = self.robot_handles[-1].getField('rotation').getSFRotation() delta_z = 0.23 * math.cos(last_angle) delta_x = 0.23 * math.sin(last_angle) new_translation = [] new_translation.append(last_translation[0] - delta_x) new_translation.append(last_translation[1]) new_translation.append(last_translation[2] - delta_z) robot_children = self.robot_handles[-1].getField('children') rearjoint_node = robot_children.getMFNode(4) joint = rearjoint_node.getField('jointParameters') joint = joint.getSFNode() para = joint.getField('position') hingeposition = para.getSFFloat() if hingeposition > 0.8 or hingeposition < -0.8: delta = 0.03 - 0.03 * math.cos(hingeposition) delta_z = delta * math.cos(last_angle) delta_x = delta * math.sin(last_angle) new_translation[0] = new_translation[0] + delta_x new_translation[2] = new_translation[2] + delta_z new_rotation = [] for i in range(4): new_rotation.append(last_rotation[i]) flag_translation = False flag_rotation = False flag_front = False flag_frontposition = False flag_frontrotation = False battery_remain = float(self.endbattery[self.robot_num]) importname = "robot_" + str(self.robot_num) + '.wbo' new_file =[] with open(importname,'r') as f: lines = f.readlines() for line in lines: if "translation" in line: if flag_translation == False: replace = "translation " + str(new_translation[0]) + " " + str(new_translation[1]) + " " + str(new_translation[2]) line = "\t" + replace +'\n' flag_translation = True if "rotation" in line: if flag_rotation == False: replace = "rotation " + str(new_rotation[0]) + " " + str(new_rotation[1]) + " " + str(new_rotation[2]) + " " \ +str(new_rotation[3]) line = "\t" + replace +'\n' flag_rotation = True if 'front HingeJoint' in line: flag_front = True if 'position' in line: if flag_front == True and flag_frontposition ==False: repalce = "position "+ str(hingeposition) line = "\t\t\t\t" + repalce + '\n' flag_frontposition = True if 'rotation' in line : if flag_front == True and flag_frontrotation == False: replace = "rotation " + str(1)+ ' ' + str(0)+ ' ' + str(0) + ' ' + str(hingeposition) line if "50000" in line : line = "\t\t" + str(battery_remain) + "," + " " + str(50000) + '\n' new_file.append(line) with open(importname,'w') as f: for line in new_file: f.write(line) rootNode = self.supervisor.getRoot() childrenField = rootNode.getField('children') childrenField.importMFNode(-1,importname) defname = 'robot_' + str(self.robot_num) self.robot_handles.append(self.supervisor.getFromDef(defname)) self.robot_num = self.robot_num + 1 # new_translation_field = self.robot_handles[-1].getField('translation') # new_translation_field.setSFVec3f(new_translation) # new_rotation_field = self.robot_handles[-1].getField('rotation') # new_rotation_field.setSFRotation(new_rotation) # robot_children = self.robot_handles[-1].getField('children') # frontjoint_node = robot_children.getMFNode(3) # joint = frontjoint_node.getField('jointParameters') # joint = joint.getSFNode() # para = joint.getField('position') # para.setSFFloat(-hingeposition) # battery_remain = float(self.endbattery[self.robot_num - 1]) # battery_field = self.robot_handles[-1].getField('battery') # battery_field.setMFFloat(0,battery_remain) # battery_field.setMFFloat(1,self.startbattery) elif action[-1] >= 0.9 and action[-1] < 1 and self.robot_num >1: battery_field = self.robot_handles[-1].getField('battery') battery_remain = battery_field.getMFFloat(0) self.endbattery[self.robot_num - 1] = battery_remain removerobot = self.robot_handles[-1] removerobot.remove() self.robot_num = self.robot_num - 1 del(self.robot_handles[-1]) def step(self,action): if self.supervisor.step(self.timestep) == -1: exit() self.handle_emitter(action) key = self.keyboard.getKey() observation = self.get_observations() reward = self.get_reward(action) isdone = self.is_done() info = self.get_info() if key == Keyboard.CONTROL + ord("A"): print() print("Actions: ", action) if key == ord("R"): print() print("Rewards: ", reward) if key == Keyboard.CONTROL + ord("Y"): print() print("Observations: ", observation) if key == Keyboard.CONTROL + ord("M"): print() print("message", self.message) if (self.v_action > 1): self.file_writer.add_histogram( "Actions/Per Global Step", action, global_step=self.step_global) if (self.v_observation > 1): self.file_writer.add_histogram( "Observations/Per Global Step", observation, global_step=self.step_global) if (self.v_reward > 1): self.file_writer.add_scalar("Rewards/Per Global Step", reward, self.step_global) if (isdone): self.file_writer.add_scalar( "Is Done/Per Reset step", self.step_cntr, global_step=self.step_reset) self.file_writer.flush() self.score += reward self.step_cntr += 1 self.step_global += 1 return observation,reward,isdone,info def is_done(self): self.steps = self.steps + 1 self.file_writer.flush() if min(self.final_distance) <= self.findThreshold: print("======== + Solved + ========") return True if self.steps >= self.steps_threshold or self.should_done: return True # rotation_field = self.robot_handles[0].getField('rotation').getSFRotation() # """้œ€่ฆ่ฎก็ฎ—ๅ‡บๆจกๅ—ๅฎŒๅ…จไพง่พนๅ€’็š„rotationๆ˜ฏๅคšๅฐ‘๏ผŒ้‡ๅˆฐ่ฟ™็งๆƒ…ๅ†ต็›ดๆŽฅ่ฟ›่กŒไธ‹ไธ€ๆฌก่ฟญไปฃ""" # # if rotation_field[0] < -0.4 and rotation_field[1] > 0.4 and rotation_field[2] > 0.4 and rotation_field[3] < -1.5708: # # return True return False def reset(self): print("Reset simulation") self.respawnRobot() self.steps = 0 self.should_done = False self.robot_num = 1 """observation ๆบไปฃ็ wrapperๆœ‰้—ฎ้ข˜""" self.score_history.append(self.score) if (self.v_reward > 0): self.file_writer.add_scalar( "Score/Per Reset", self.score, global_step=self.step_reset) for window in self.windows: if self.step_reset > window: self.file_writer.add_scalar( "Score/With Window {}".format(window), np.average(self.score_history[-window:]), global_step=self.step_reset - window) self.file_writer.flush() self.step_reset += 1 self.step_cntr = 0 self.score = 0 return self.get_default_observation() def flush(self): if self._file_writer is not None: self._file_writer.flush() def close(self): if self._file_writer is not None: self._file_writer.close() def get_info(self): pass def respawnRobot(self): for robot in self.robot_handles: robot.remove() rootNode = self.supervisor.getRoot() childrenField = rootNode.getField('children') childrenField.importMFNode(-1,"robot_0.wbo") # childrenField.importMFNode(-1,"robot_1.wbo") # childrenField.importMFNode(-1,"robot_2.wbo") # childrenField.importMFNode(-1,"robot_3.wbo") # childrenField.importMFNode(-1,"robot_4.wbo") # childrenField.importMFNode(-1,"robot_5.wbo") self.robot_handles = [] for defrobotname in self.robot_list: self.robot_handles.append(self.supervisor.getFromDef(defrobotname)) self.final_target = self.supervisor.getFromDef('final_target') self.supervisor.simulationResetPhysics() self._last_message = None robot_defnames = ['robot_0'] supervisor_env = TaskDecisionSupervisor(robot_defnames, observation_space=OBSERVATION_SPACE,log_dir="logs/results/ddpg", v_action=1,v_observation=1,v_reward=1,windows=[10,\ 10000, 2000]) agent = TD3(lr_actor=0.00025, lr_critic=0.0025, input_dims= OBSERVATION_SPACE, gamma=0.99, tau=0.001, env=supervisor_env, batch_size=512, layer1_size=400, layer2_size=300, layer3_size=200, layer4_size=400, layer5_size=300, layer6_size=200, n_actions=ACTION_SPACE, load_models=False, save_dir='./models/saved/ddpg/') score_history = [] np.random.seed(0) for i in range(1, 20000): done = False score = 0 obs = list(map(float, supervisor_env.reset())) supervisor_env.empty_queue() first_iter = True if i % 10000 == 0: print("================= TESTING =================") while not done: act = agent.choose_action_test(obs).tolist() supervisor_env.robot_step(act) new_state, _, done, _ = supervisor_env.step(act) obs = list(map(float, new_state)) else: print("================= TRAINING =================") while not done: if (not first_iter): act = agent.choose_action_train(obs).tolist() else: first_iter = False act = [0,0] for k in range(0,13): act.append(0.5) supervisor_env.robot_step(act) new_state, reward, done, info = supervisor_env.step(act) agent.remember(obs, act, reward, new_state, int(done)) agent.learn() score += reward obs = list(map(float, new_state)) score_history.append(score) print("===== Episode", i, "score %.2f" % score, "100 game average %.2f" % np.mean(score_history[-100:])) if i % 100 == 0: agent.save_models()
[ "1092673859@qq.com" ]
1092673859@qq.com
4a2f9b5baa86079690190cf78a776554744e8271
c5cad31bfc771d3261d1eead8e31856c19eb5e74
/publishTool/assembleTest_D05_7.py
3bf657b7e122eea1a22d8512b50fc9ff0a277b9e
[]
no_license
alpha0080/mayaTool
61b649825d85b88de2d24e9260e23f5c5aa559cb
153da6e987d13fb7311ee55a2a3e635bc8c7afde
refs/heads/master
2021-01-19T11:52:03.715437
2018-05-07T10:30:23
2018-05-07T10:30:23
88,001,018
0
0
null
null
null
null
BIG5
Python
false
false
190,588
py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'C:/Users/alpha.DESKTOP-1S1STEK/Documents/GitHub/mayaTool/publishTool/assembleTest_B01.ui' # # Created: Thu Jul 06 16:28:26 2017 # by: pyside2-uic running on PySide2 2.0.0~alpha0 # # WARNING! All changes made in this file will be lost! from PySide2 import QtCore, QtGui, QtWidgets import maya.cmds as cmds import pymel.core as pm import json import os #from pprint import pprint import datetime class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(650, 860) MainWindow.setMinimumSize(QtCore.QSize(650, 860)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(41, 61, 55)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(61, 91, 82)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(51, 76, 68)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(20, 30, 27)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(27, 40, 36)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(41, 61, 55)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(20, 30, 27)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(41, 61, 55)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(61, 91, 82)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(51, 76, 68)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(20, 30, 27)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(27, 40, 36)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(41, 61, 55)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(20, 30, 27)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(20, 30, 27)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(41, 61, 55)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(61, 91, 82)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(51, 76, 68)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(20, 30, 27)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(27, 40, 36)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(20, 30, 27)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(20, 30, 27)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(41, 61, 55)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(41, 61, 55)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(41, 61, 55)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) MainWindow.setPalette(palette) MainWindow.setAutoFillBackground(False) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.frame_21 = QtWidgets.QFrame(self.centralwidget) self.frame_21.setGeometry(QtCore.QRect(590, 31, 56, 56)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) self.frame_21.setPalette(palette) self.frame_21.setFrameShape(QtWidgets.QFrame.Box) self.frame_21.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_21.setLineWidth(1) self.frame_21.setMidLineWidth(0) self.frame_21.setObjectName("frame_21") self.pushButton_P3_changePageA = QtWidgets.QPushButton(self.frame_21) self.pushButton_P3_changePageA.setEnabled(True) self.pushButton_P3_changePageA.setGeometry(QtCore.QRect(2, 3, 25, 25)) self.pushButton_P3_changePageA.setText("") icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/connerA.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3_changePageA.setIcon(icon) self.pushButton_P3_changePageA.setIconSize(QtCore.QSize(25, 25)) self.pushButton_P3_changePageA.setCheckable(True) self.pushButton_P3_changePageA.setAutoDefault(False) self.pushButton_P3_changePageA.setDefault(False) self.pushButton_P3_changePageA.setFlat(True) self.pushButton_P3_changePageA.setObjectName("pushButton_P3_changePageA") self.pushButton_P3_changePageB = QtWidgets.QPushButton(self.frame_21) self.pushButton_P3_changePageB.setEnabled(True) self.pushButton_P3_changePageB.setGeometry(QtCore.QRect(27, 3, 25, 25)) self.pushButton_P3_changePageB.setText("") icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/connerB.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3_changePageB.setIcon(icon1) self.pushButton_P3_changePageB.setIconSize(QtCore.QSize(25, 25)) self.pushButton_P3_changePageB.setCheckable(True) self.pushButton_P3_changePageB.setAutoDefault(False) self.pushButton_P3_changePageB.setDefault(False) self.pushButton_P3_changePageB.setFlat(True) self.pushButton_P3_changePageB.setObjectName("pushButton_P3_changePageB") self.pushButton_P3_changePageC = QtWidgets.QPushButton(self.frame_21) self.pushButton_P3_changePageC.setEnabled(True) self.pushButton_P3_changePageC.setGeometry(QtCore.QRect(2, 28, 25, 25)) self.pushButton_P3_changePageC.setText("") icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/connerC.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3_changePageC.setIcon(icon2) self.pushButton_P3_changePageC.setIconSize(QtCore.QSize(25, 25)) self.pushButton_P3_changePageC.setCheckable(True) self.pushButton_P3_changePageC.setAutoDefault(False) self.pushButton_P3_changePageC.setDefault(False) self.pushButton_P3_changePageC.setFlat(True) self.pushButton_P3_changePageC.setObjectName("pushButton_P3_changePageC") self.pushButton_P3_changePageD = QtWidgets.QPushButton(self.frame_21) self.pushButton_P3_changePageD.setEnabled(True) self.pushButton_P3_changePageD.setGeometry(QtCore.QRect(27, 28, 25, 25)) self.pushButton_P3_changePageD.setText("") icon3 = QtGui.QIcon() icon3.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/connerD.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3_changePageD.setIcon(icon3) self.pushButton_P3_changePageD.setIconSize(QtCore.QSize(25, 25)) self.pushButton_P3_changePageD.setCheckable(True) self.pushButton_P3_changePageD.setAutoDefault(False) self.pushButton_P3_changePageD.setDefault(False) self.pushButton_P3_changePageD.setFlat(True) self.pushButton_P3_changePageD.setObjectName("pushButton_P3_changePageD") self.frame_5 = QtWidgets.QFrame(self.centralwidget) self.frame_5.setGeometry(QtCore.QRect(435, 32, 151, 56)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) self.frame_5.setPalette(palette) self.frame_5.setFrameShape(QtWidgets.QFrame.Box) self.frame_5.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_5.setLineWidth(1) self.frame_5.setMidLineWidth(0) self.frame_5.setObjectName("frame_5") self.label_fileData_19 = QtWidgets.QLabel(self.frame_5) self.label_fileData_19.setGeometry(QtCore.QRect(50, 0, 20, 20)) font = QtGui.QFont() font.setFamily("Calibri") font.setPointSize(8) self.label_fileData_19.setFont(font) self.label_fileData_19.setAlignment(QtCore.Qt.AlignCenter) self.label_fileData_19.setObjectName("label_fileData_19") self.label_fileData_20 = QtWidgets.QLabel(self.frame_5) self.label_fileData_20.setGeometry(QtCore.QRect(15, 0, 20, 20)) font = QtGui.QFont() font.setFamily("Calibri") font.setPointSize(8) self.label_fileData_20.setFont(font) self.label_fileData_20.setAlignment(QtCore.Qt.AlignCenter) self.label_fileData_20.setObjectName("label_fileData_20") self.label_fileData_21 = QtWidgets.QLabel(self.frame_5) self.label_fileData_21.setGeometry(QtCore.QRect(85, 0, 20, 20)) font = QtGui.QFont() font.setFamily("Calibri") font.setPointSize(8) self.label_fileData_21.setFont(font) self.label_fileData_21.setAlignment(QtCore.Qt.AlignCenter) self.label_fileData_21.setObjectName("label_fileData_21") self.label_fileData_22 = QtWidgets.QLabel(self.frame_5) self.label_fileData_22.setGeometry(QtCore.QRect(120, 0, 20, 20)) font = QtGui.QFont() font.setFamily("Calibri") font.setPointSize(8) self.label_fileData_22.setFont(font) self.label_fileData_22.setAlignment(QtCore.Qt.AlignCenter) self.label_fileData_22.setObjectName("label_fileData_22") self.pushButton_P3_largeIcon = QtWidgets.QPushButton(self.frame_5) self.pushButton_P3_largeIcon.setEnabled(True) self.pushButton_P3_largeIcon.setGeometry(QtCore.QRect(10, 20, 30, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) self.pushButton_P3_largeIcon.setPalette(palette) self.pushButton_P3_largeIcon.setAutoFillBackground(False) self.pushButton_P3_largeIcon.setText("") icon4 = QtGui.QIcon() icon4.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChoose_Large_Close.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon4.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseLarge.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon4.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseLarge.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) icon4.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseLarge.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) self.pushButton_P3_largeIcon.setIcon(icon4) self.pushButton_P3_largeIcon.setIconSize(QtCore.QSize(30, 30)) self.pushButton_P3_largeIcon.setCheckable(True) self.pushButton_P3_largeIcon.setChecked(False) self.pushButton_P3_largeIcon.setAutoRepeat(False) self.pushButton_P3_largeIcon.setAutoExclusive(False) self.pushButton_P3_largeIcon.setAutoDefault(False) self.pushButton_P3_largeIcon.setDefault(False) self.pushButton_P3_largeIcon.setFlat(True) self.pushButton_P3_largeIcon.setObjectName("pushButton_P3_largeIcon") self.pushButton_P3_MidIcon = QtWidgets.QPushButton(self.frame_5) self.pushButton_P3_MidIcon.setEnabled(True) self.pushButton_P3_MidIcon.setGeometry(QtCore.QRect(45, 20, 30, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) self.pushButton_P3_MidIcon.setPalette(palette) self.pushButton_P3_MidIcon.setAutoFillBackground(False) self.pushButton_P3_MidIcon.setText("") icon5 = QtGui.QIcon() icon5.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChoose_Mid_Close.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon5.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseMid.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon5.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseMid.png"), QtGui.QIcon.Active, QtGui.QIcon.On) icon5.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseMid.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) icon5.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseMid.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) self.pushButton_P3_MidIcon.setIcon(icon5) self.pushButton_P3_MidIcon.setIconSize(QtCore.QSize(30, 30)) self.pushButton_P3_MidIcon.setCheckable(True) self.pushButton_P3_MidIcon.setChecked(False) self.pushButton_P3_MidIcon.setAutoRepeat(False) self.pushButton_P3_MidIcon.setAutoExclusive(False) self.pushButton_P3_MidIcon.setAutoDefault(False) self.pushButton_P3_MidIcon.setDefault(False) self.pushButton_P3_MidIcon.setFlat(True) self.pushButton_P3_MidIcon.setObjectName("pushButton_P3_MidIcon") self.pushButton_P3_smallIcon = QtWidgets.QPushButton(self.frame_5) self.pushButton_P3_smallIcon.setEnabled(True) self.pushButton_P3_smallIcon.setGeometry(QtCore.QRect(80, 20, 30, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) self.pushButton_P3_smallIcon.setPalette(palette) self.pushButton_P3_smallIcon.setAutoFillBackground(False) self.pushButton_P3_smallIcon.setText("") icon6 = QtGui.QIcon() icon6.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChoose_Small_Close.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon6.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseSmall.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon6.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseSmall.png"), QtGui.QIcon.Active, QtGui.QIcon.On) icon6.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseSmall.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) icon6.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseSmall.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) self.pushButton_P3_smallIcon.setIcon(icon6) self.pushButton_P3_smallIcon.setIconSize(QtCore.QSize(30, 30)) self.pushButton_P3_smallIcon.setCheckable(True) self.pushButton_P3_smallIcon.setChecked(False) self.pushButton_P3_smallIcon.setAutoRepeat(False) self.pushButton_P3_smallIcon.setAutoExclusive(False) self.pushButton_P3_smallIcon.setAutoDefault(False) self.pushButton_P3_smallIcon.setDefault(False) self.pushButton_P3_smallIcon.setFlat(True) self.pushButton_P3_smallIcon.setObjectName("pushButton_P3_smallIcon") self.pushButton_P3_text = QtWidgets.QPushButton(self.frame_5) self.pushButton_P3_text.setEnabled(True) self.pushButton_P3_text.setGeometry(QtCore.QRect(115, 20, 30, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) self.pushButton_P3_text.setPalette(palette) self.pushButton_P3_text.setAutoFillBackground(False) self.pushButton_P3_text.setText("") icon7 = QtGui.QIcon() icon7.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChoose_Text_Close.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon7.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseText.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon7.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseText.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) icon7.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/sizeChooseText.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) self.pushButton_P3_text.setIcon(icon7) self.pushButton_P3_text.setIconSize(QtCore.QSize(30, 30)) self.pushButton_P3_text.setCheckable(True) self.pushButton_P3_text.setChecked(False) self.pushButton_P3_text.setAutoRepeat(False) self.pushButton_P3_text.setAutoExclusive(False) self.pushButton_P3_text.setAutoDefault(False) self.pushButton_P3_text.setDefault(False) self.pushButton_P3_text.setFlat(True) self.pushButton_P3_text.setObjectName("pushButton_P3_text") self.frame_6 = QtWidgets.QFrame(self.centralwidget) self.frame_6.setGeometry(QtCore.QRect(5, 32, 221, 56)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) self.frame_6.setPalette(palette) self.frame_6.setFrameShape(QtWidgets.QFrame.Box) self.frame_6.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_6.setLineWidth(1) self.frame_6.setMidLineWidth(0) self.frame_6.setObjectName("frame_6") self.pushButton_P3_deletSelectItem = QtWidgets.QPushButton(self.frame_6) self.pushButton_P3_deletSelectItem.setGeometry(QtCore.QRect(150, 20, 30, 30)) self.pushButton_P3_deletSelectItem.setText("") icon8 = QtGui.QIcon() icon8.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/deletePublishB.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3_deletSelectItem.setIcon(icon8) self.pushButton_P3_deletSelectItem.setIconSize(QtCore.QSize(30, 30)) self.pushButton_P3_deletSelectItem.setFlat(True) self.pushButton_P3_deletSelectItem.setObjectName("pushButton_P3_deletSelectItem") self.pushButton_P3_selectItem = QtWidgets.QPushButton(self.frame_6) self.pushButton_P3_selectItem.setGeometry(QtCore.QRect(50, 15, 35, 35)) self.pushButton_P3_selectItem.setText("") icon9 = QtGui.QIcon() icon9.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/getSelectItemPublishB.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3_selectItem.setIcon(icon9) self.pushButton_P3_selectItem.setIconSize(QtCore.QSize(35, 35)) self.pushButton_P3_selectItem.setFlat(True) self.pushButton_P3_selectItem.setObjectName("pushButton_P3_selectItem") self.label_fileData_43 = QtWidgets.QLabel(self.frame_6) self.label_fileData_43.setGeometry(QtCore.QRect(145, 0, 46, 20)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(248, 255, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(248, 255, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(85, 127, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.label_fileData_43.setPalette(palette) font = QtGui.QFont() font.setFamily("Calibri") font.setPointSize(8) self.label_fileData_43.setFont(font) self.label_fileData_43.setAlignment(QtCore.Qt.AlignCenter) self.label_fileData_43.setObjectName("label_fileData_43") self.label_fileData_40 = QtWidgets.QLabel(self.frame_6) self.label_fileData_40.setGeometry(QtCore.QRect(45, -3, 46, 20)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(248, 255, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(248, 255, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(85, 127, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.label_fileData_40.setPalette(palette) font = QtGui.QFont() font.setFamily("Calibri") font.setPointSize(8) self.label_fileData_40.setFont(font) self.label_fileData_40.setAlignment(QtCore.Qt.AlignCenter) self.label_fileData_40.setObjectName("label_fileData_40") self.pushButton_P3_refreshInputItem = QtWidgets.QPushButton(self.frame_6) self.pushButton_P3_refreshInputItem.setGeometry(QtCore.QRect(5, 15, 35, 35)) self.pushButton_P3_refreshInputItem.setText("") icon10 = QtGui.QIcon() icon10.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/refreshPublishB.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3_refreshInputItem.setIcon(icon10) self.pushButton_P3_refreshInputItem.setIconSize(QtCore.QSize(35, 35)) self.pushButton_P3_refreshInputItem.setFlat(True) self.pushButton_P3_refreshInputItem.setObjectName("pushButton_P3_refreshInputItem") self.label_fileData_39 = QtWidgets.QLabel(self.frame_6) self.label_fileData_39.setGeometry(QtCore.QRect(0, -3, 46, 20)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(248, 255, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(248, 255, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(85, 127, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.label_fileData_39.setPalette(palette) font = QtGui.QFont() font.setFamily("Calibri") font.setPointSize(8) self.label_fileData_39.setFont(font) self.label_fileData_39.setAlignment(QtCore.Qt.AlignCenter) self.label_fileData_39.setObjectName("label_fileData_39") self.frame_8 = QtWidgets.QFrame(self.centralwidget) self.frame_8.setGeometry(QtCore.QRect(609, 90, 36, 531)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) self.frame_8.setPalette(palette) self.frame_8.setFrameShape(QtWidgets.QFrame.Box) self.frame_8.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_8.setLineWidth(1) self.frame_8.setMidLineWidth(0) self.frame_8.setObjectName("frame_8") self.pushButton_P3_openBranchJson = QtWidgets.QPushButton(self.frame_8) self.pushButton_P3_openBranchJson.setEnabled(True) self.pushButton_P3_openBranchJson.setGeometry(QtCore.QRect(3, 472, 25, 25)) self.pushButton_P3_openBranchJson.setText("") icon11 = QtGui.QIcon() icon11.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/option2-512.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3_openBranchJson.setIcon(icon11) self.pushButton_P3_openBranchJson.setIconSize(QtCore.QSize(25, 25)) self.pushButton_P3_openBranchJson.setCheckable(True) self.pushButton_P3_openBranchJson.setAutoDefault(False) self.pushButton_P3_openBranchJson.setDefault(False) self.pushButton_P3_openBranchJson.setFlat(True) self.pushButton_P3_openBranchJson.setObjectName("pushButton_P3_openBranchJson") self.pushButton_P3_loadFile = QtWidgets.QPushButton(self.frame_8) self.pushButton_P3_loadFile.setEnabled(True) self.pushButton_P3_loadFile.setGeometry(QtCore.QRect(3, 440, 25, 25)) self.pushButton_P3_loadFile.setText("") icon12 = QtGui.QIcon() icon12.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/load60.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3_loadFile.setIcon(icon12) self.pushButton_P3_loadFile.setIconSize(QtCore.QSize(27, 25)) self.pushButton_P3_loadFile.setCheckable(True) self.pushButton_P3_loadFile.setAutoDefault(False) self.pushButton_P3_loadFile.setDefault(False) self.pushButton_P3_loadFile.setFlat(True) self.pushButton_P3_loadFile.setObjectName("pushButton_P3_loadFile") self.pushButton_P3_processModeling = QtWidgets.QPushButton(self.frame_8) self.pushButton_P3_processModeling.setEnabled(True) self.pushButton_P3_processModeling.setGeometry(QtCore.QRect(5, 5, 25, 25)) self.pushButton_P3_processModeling.setText("") icon13 = QtGui.QIcon() icon13.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processMod_C_OFF.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon13.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processMod_C_ON.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon13.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processMod_C_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off) icon13.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processMod_C_ON.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) icon13.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processMod_C_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) self.pushButton_P3_processModeling.setIcon(icon13) self.pushButton_P3_processModeling.setIconSize(QtCore.QSize(25, 25)) self.pushButton_P3_processModeling.setCheckable(True) self.pushButton_P3_processModeling.setAutoDefault(False) self.pushButton_P3_processModeling.setDefault(False) self.pushButton_P3_processModeling.setFlat(True) self.pushButton_P3_processModeling.setObjectName("pushButton_P3_processModeling") self.pushButton_P3_processTexture = QtWidgets.QPushButton(self.frame_8) self.pushButton_P3_processTexture.setEnabled(True) self.pushButton_P3_processTexture.setGeometry(QtCore.QRect(5, 31, 25, 25)) self.pushButton_P3_processTexture.setText("") icon14 = QtGui.QIcon() icon14.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processTex_C_ON.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon14.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processText_C_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) icon14.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processText_C_OFF.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon14.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processText_C_OFF.png"), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon14.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processText_C_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off) icon14.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processTex_C_ON.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) icon14.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processTex_C_ON.png"), QtGui.QIcon.Active, QtGui.QIcon.On) self.pushButton_P3_processTexture.setIcon(icon14) self.pushButton_P3_processTexture.setIconSize(QtCore.QSize(25, 25)) self.pushButton_P3_processTexture.setCheckable(True) self.pushButton_P3_processTexture.setAutoDefault(False) self.pushButton_P3_processTexture.setDefault(False) self.pushButton_P3_processTexture.setFlat(True) self.pushButton_P3_processTexture.setObjectName("pushButton_P3_processTexture") self.pushButton_P3_processRigging = QtWidgets.QPushButton(self.frame_8) self.pushButton_P3_processRigging.setEnabled(True) self.pushButton_P3_processRigging.setGeometry(QtCore.QRect(5, 57, 25, 25)) self.pushButton_P3_processRigging.setText("") icon15 = QtGui.QIcon() icon15.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processRig_C_ON.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon15.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processRig_C_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) icon15.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processRig_C_OFF.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon15.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processRig_C_OFF.png"), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon15.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processRig_C_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off) icon15.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processRig_C_ON.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) self.pushButton_P3_processRigging.setIcon(icon15) self.pushButton_P3_processRigging.setIconSize(QtCore.QSize(25, 25)) self.pushButton_P3_processRigging.setCheckable(True) self.pushButton_P3_processRigging.setAutoDefault(False) self.pushButton_P3_processRigging.setDefault(False) self.pushButton_P3_processRigging.setFlat(True) self.pushButton_P3_processRigging.setObjectName("pushButton_P3_processRigging") self.pushButton_P3_inputMayaOn = QtWidgets.QPushButton(self.frame_8) self.pushButton_P3_inputMayaOn.setEnabled(True) self.pushButton_P3_inputMayaOn.setGeometry(QtCore.QRect(3, 230, 25, 25)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) self.pushButton_P3_inputMayaOn.setPalette(palette) self.pushButton_P3_inputMayaOn.setAutoFillBackground(False) self.pushButton_P3_inputMayaOn.setText("") icon16 = QtGui.QIcon() icon16.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOption_Maya_ON.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon16.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOption_maya_Off.png"), QtGui.QIcon.Active, QtGui.QIcon.Off) icon16.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOption_maya_Off.png"), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon16.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOption_maya_Off.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon16.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOption_Maya_ON.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) icon16.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOption_maya_Off.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off) icon16.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOption_Maya_ON.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) icon16.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOption_Maya_ON.png"), QtGui.QIcon.Active, QtGui.QIcon.On) self.pushButton_P3_inputMayaOn.setIcon(icon16) self.pushButton_P3_inputMayaOn.setIconSize(QtCore.QSize(25, 25)) self.pushButton_P3_inputMayaOn.setCheckable(True) self.pushButton_P3_inputMayaOn.setChecked(False) self.pushButton_P3_inputMayaOn.setAutoRepeat(False) self.pushButton_P3_inputMayaOn.setAutoExclusive(False) self.pushButton_P3_inputMayaOn.setAutoDefault(False) self.pushButton_P3_inputMayaOn.setDefault(False) self.pushButton_P3_inputMayaOn.setFlat(True) self.pushButton_P3_inputMayaOn.setObjectName("pushButton_P3_inputMayaOn") self.pushButton_P3_inputRibOn = QtWidgets.QPushButton(self.frame_8) self.pushButton_P3_inputRibOn.setEnabled(True) self.pushButton_P3_inputRibOn.setGeometry(QtCore.QRect(3, 265, 25, 25)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) self.pushButton_P3_inputRibOn.setPalette(palette) self.pushButton_P3_inputRibOn.setAutoFillBackground(False) self.pushButton_P3_inputRibOn.setText("") icon17 = QtGui.QIcon() icon17.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOptionRIB_On.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon17.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOption_Rib_Off.png"), QtGui.QIcon.Active, QtGui.QIcon.Off) icon17.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOption_Rib_Off.png"), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon17.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOption_Rib_Off.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon17.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOptionRIB_On.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) icon17.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOption_Rib_Off.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off) icon17.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOptionRIB_On.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) icon17.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/InputOptionRIB_On.png"), QtGui.QIcon.Active, QtGui.QIcon.On) self.pushButton_P3_inputRibOn.setIcon(icon17) self.pushButton_P3_inputRibOn.setIconSize(QtCore.QSize(25, 25)) self.pushButton_P3_inputRibOn.setCheckable(True) self.pushButton_P3_inputRibOn.setChecked(False) self.pushButton_P3_inputRibOn.setAutoRepeat(False) self.pushButton_P3_inputRibOn.setAutoExclusive(False) self.pushButton_P3_inputRibOn.setAutoDefault(False) self.pushButton_P3_inputRibOn.setDefault(False) self.pushButton_P3_inputRibOn.setFlat(True) self.pushButton_P3_inputRibOn.setObjectName("pushButton_P3_inputRibOn") self.pushButton_P3_NA = QtWidgets.QPushButton(self.frame_8) self.pushButton_P3_NA.setEnabled(True) self.pushButton_P3_NA.setGeometry(QtCore.QRect(5, 83, 25, 25)) self.pushButton_P3_NA.setText("") icon18 = QtGui.QIcon() icon18.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processNA_C_ON.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon18.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processNA_C_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) icon18.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processNA_C_OFF.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon18.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processNA_C_OFF.png"), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon18.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processNA_C_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off) icon18.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/processNA_C_ON.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) self.pushButton_P3_NA.setIcon(icon18) self.pushButton_P3_NA.setIconSize(QtCore.QSize(25, 25)) self.pushButton_P3_NA.setCheckable(True) self.pushButton_P3_NA.setAutoDefault(False) self.pushButton_P3_NA.setDefault(False) self.pushButton_P3_NA.setFlat(True) self.pushButton_P3_NA.setObjectName("pushButton_P3_NA") self.pushButton_P3_packageAll = QtWidgets.QPushButton(self.frame_8) self.pushButton_P3_packageAll.setGeometry(QtCore.QRect(3, 501, 25, 25)) self.pushButton_P3_packageAll.setText("") icon19 = QtGui.QIcon() icon19.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/package.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3_packageAll.setIcon(icon19) self.pushButton_P3_packageAll.setIconSize(QtCore.QSize(25, 25)) self.pushButton_P3_packageAll.setFlat(True) self.pushButton_P3_packageAll.setObjectName("pushButton_P3_packageAll") self.comboBox = QtWidgets.QComboBox(self.centralwidget) self.comboBox.setGeometry(QtCore.QRect(360, 5, 286, 22)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(19, 29, 26)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(14, 21, 19)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(19, 29, 26)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(14, 21, 19)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(19, 29, 26)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(14, 21, 19)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(14, 21, 19)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.comboBox.setPalette(palette) self.comboBox.setObjectName("comboBox") self.comboBox.addItem("") self.frame_11 = QtWidgets.QFrame(self.centralwidget) self.frame_11.setGeometry(QtCore.QRect(227, 32, 206, 56)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) self.frame_11.setPalette(palette) self.frame_11.setFrameShape(QtWidgets.QFrame.Box) self.frame_11.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_11.setLineWidth(1) self.frame_11.setMidLineWidth(0) self.frame_11.setObjectName("frame_11") self.pushButton_page3_other = QtWidgets.QPushButton(self.frame_11) self.pushButton_page3_other.setEnabled(True) self.pushButton_page3_other.setGeometry(QtCore.QRect(170, 20, 30, 30)) self.pushButton_page3_other.setText("") icon20 = QtGui.QIcon() icon20.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_other_ON.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon20.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_other_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) icon20.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_other_OFF.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon20.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_other_OFF.png"), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon20.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_other_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off) icon20.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_other_ON.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) self.pushButton_page3_other.setIcon(icon20) self.pushButton_page3_other.setIconSize(QtCore.QSize(30, 30)) self.pushButton_page3_other.setCheckable(True) self.pushButton_page3_other.setAutoDefault(False) self.pushButton_page3_other.setDefault(False) self.pushButton_page3_other.setFlat(True) self.pushButton_page3_other.setObjectName("pushButton_page3_other") self.pushButton_page3_vehicle = QtWidgets.QPushButton(self.frame_11) self.pushButton_page3_vehicle.setEnabled(True) self.pushButton_page3_vehicle.setGeometry(QtCore.QRect(77, 20, 30, 30)) self.pushButton_page3_vehicle.setText("") icon21 = QtGui.QIcon() icon21.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_veh_ON.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon21.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_veh_OFF.png"), QtGui.QIcon.Active, QtGui.QIcon.Off) icon21.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_veh_OFF.png"), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon21.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_veh_OFF.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon21.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_veh_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) icon21.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_veh_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off) icon21.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_veh_ON.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) icon21.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_veh_ON.png"), QtGui.QIcon.Active, QtGui.QIcon.On) self.pushButton_page3_vehicle.setIcon(icon21) self.pushButton_page3_vehicle.setIconSize(QtCore.QSize(30, 30)) self.pushButton_page3_vehicle.setCheckable(True) self.pushButton_page3_vehicle.setAutoDefault(False) self.pushButton_page3_vehicle.setDefault(False) self.pushButton_page3_vehicle.setFlat(True) self.pushButton_page3_vehicle.setObjectName("pushButton_page3_vehicle") self.pushButton_page3_all = QtWidgets.QPushButton(self.frame_11) self.pushButton_page3_all.setEnabled(True) self.pushButton_page3_all.setGeometry(QtCore.QRect(10, 20, 30, 30)) self.pushButton_page3_all.setText("") icon22 = QtGui.QIcon() icon22.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_all_ON.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon22.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_all_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) icon22.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_all_OFF.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon22.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_all_OFF.png"), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon22.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_all_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off) icon22.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_all_ON.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) self.pushButton_page3_all.setIcon(icon22) self.pushButton_page3_all.setIconSize(QtCore.QSize(30, 30)) self.pushButton_page3_all.setCheckable(True) self.pushButton_page3_all.setAutoDefault(False) self.pushButton_page3_all.setDefault(False) self.pushButton_page3_all.setFlat(True) self.pushButton_page3_all.setObjectName("pushButton_page3_all") self.pushButton_page3_props = QtWidgets.QPushButton(self.frame_11) self.pushButton_page3_props.setEnabled(True) self.pushButton_page3_props.setGeometry(QtCore.QRect(139, 20, 30, 30)) self.pushButton_page3_props.setText("") icon23 = QtGui.QIcon() icon23.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_prop_ON.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon23.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_prop_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) icon23.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_prop_OFF.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon23.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_prop_OFF.png"), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon23.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_prop_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off) icon23.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_prop_ON.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) self.pushButton_page3_props.setIcon(icon23) self.pushButton_page3_props.setIconSize(QtCore.QSize(30, 30)) self.pushButton_page3_props.setCheckable(True) self.pushButton_page3_props.setAutoDefault(False) self.pushButton_page3_props.setDefault(False) self.pushButton_page3_props.setFlat(True) self.pushButton_page3_props.setObjectName("pushButton_page3_props") self.pushButton_page3_character = QtWidgets.QPushButton(self.frame_11) self.pushButton_page3_character.setEnabled(True) self.pushButton_page3_character.setGeometry(QtCore.QRect(46, 20, 30, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) self.pushButton_page3_character.setPalette(palette) self.pushButton_page3_character.setAutoFillBackground(False) self.pushButton_page3_character.setText("") icon24 = QtGui.QIcon() icon24.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_cha_ON.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) icon24.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_cha_OFF.png"), QtGui.QIcon.Active, QtGui.QIcon.Off) icon24.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_cha_OFF.png"), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon24.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_cha_OFF.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon24.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_cha_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) icon24.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_cha_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off) icon24.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_cha_ON.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) icon24.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_cha_ON.png"), QtGui.QIcon.Active, QtGui.QIcon.On) self.pushButton_page3_character.setIcon(icon24) self.pushButton_page3_character.setIconSize(QtCore.QSize(30, 30)) self.pushButton_page3_character.setCheckable(True) self.pushButton_page3_character.setChecked(False) self.pushButton_page3_character.setAutoRepeat(False) self.pushButton_page3_character.setAutoExclusive(False) self.pushButton_page3_character.setAutoDefault(False) self.pushButton_page3_character.setDefault(False) self.pushButton_page3_character.setFlat(True) self.pushButton_page3_character.setObjectName("pushButton_page3_character") self.pushButton_page3_set = QtWidgets.QPushButton(self.frame_11) self.pushButton_page3_set.setEnabled(True) self.pushButton_page3_set.setGeometry(QtCore.QRect(108, 20, 30, 30)) self.pushButton_page3_set.setText("") icon25 = QtGui.QIcon() icon25.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_set_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.On) icon25.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_set_OFF.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon25.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_set_OFF.png"), QtGui.QIcon.Selected, QtGui.QIcon.Off) icon25.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_set_OFF.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off) icon25.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_set_ON.png"), QtGui.QIcon.Selected, QtGui.QIcon.On) icon25.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/assetType_set_ON.png"), QtGui.QIcon.Active, QtGui.QIcon.On) self.pushButton_page3_set.setIcon(icon25) self.pushButton_page3_set.setIconSize(QtCore.QSize(30, 30)) self.pushButton_page3_set.setCheckable(True) self.pushButton_page3_set.setAutoDefault(False) self.pushButton_page3_set.setDefault(False) self.pushButton_page3_set.setFlat(True) self.pushButton_page3_set.setObjectName("pushButton_page3_set") self.plainTextEdit_assetMetaData = QtWidgets.QPlainTextEdit(self.centralwidget) self.plainTextEdit_assetMetaData.setGeometry(QtCore.QRect(226, 625, 381, 210)) self.plainTextEdit_assetMetaData.setObjectName("plainTextEdit_assetMetaData") self.tableWidget_AssetItemList = QtWidgets.QTableWidget(self.centralwidget) self.tableWidget_AssetItemList.setGeometry(QtCore.QRect(226, 90, 381, 530)) self.tableWidget_AssetItemList.setLayoutDirection(QtCore.Qt.LeftToRight) self.tableWidget_AssetItemList.setInputMethodHints(QtCore.Qt.ImhNone) self.tableWidget_AssetItemList.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) self.tableWidget_AssetItemList.setDragEnabled(True) self.tableWidget_AssetItemList.setDragDropMode(QtWidgets.QAbstractItemView.DragOnly) self.tableWidget_AssetItemList.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection) self.tableWidget_AssetItemList.setIconSize(QtCore.QSize(60, 60)) self.tableWidget_AssetItemList.setTextElideMode(QtCore.Qt.ElideNone) self.tableWidget_AssetItemList.setRowCount(2) self.tableWidget_AssetItemList.setColumnCount(2) self.tableWidget_AssetItemList.setObjectName("tableWidget_AssetItemList") self.tableWidget_AssetItemList.setColumnCount(2) self.tableWidget_AssetItemList.setRowCount(2) item = QtWidgets.QTableWidgetItem() self.tableWidget_AssetItemList.setItem(0, 0, item) item = QtWidgets.QTableWidgetItem() self.tableWidget_AssetItemList.setItem(0, 1, item) item = QtWidgets.QTableWidgetItem() self.tableWidget_AssetItemList.setItem(1, 0, item) item = QtWidgets.QTableWidgetItem() self.tableWidget_AssetItemList.setItem(1, 1, item) self.tableWidget_AssetItemList.horizontalHeader().setVisible(False) self.tableWidget_AssetItemList.horizontalHeader().setCascadingSectionResizes(False) self.tableWidget_AssetItemList.horizontalHeader().setDefaultSectionSize(120) self.tableWidget_AssetItemList.horizontalHeader().setMinimumSectionSize(25) self.tableWidget_AssetItemList.horizontalHeader().setSortIndicatorShown(False) self.tableWidget_AssetItemList.horizontalHeader().setStretchLastSection(False) self.tableWidget_AssetItemList.verticalHeader().setVisible(False) self.tableWidget_AssetItemList.verticalHeader().setCascadingSectionResizes(False) self.tableWidget_AssetItemList.verticalHeader().setDefaultSectionSize(120) self.tableWidget_AssetItemList.verticalHeader().setHighlightSections(True) self.tableWidget_AssetItemList.verticalHeader().setMinimumSectionSize(25) self.frame_7 = QtWidgets.QFrame(self.centralwidget) self.frame_7.setGeometry(QtCore.QRect(5, 625, 220, 210)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(185, 198, 185)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(121, 182, 164)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(101, 151, 136)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(54, 80, 72)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(40, 60, 54)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(81, 121, 109)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) self.frame_7.setPalette(palette) self.frame_7.setFrameShape(QtWidgets.QFrame.Box) self.frame_7.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_7.setLineWidth(1) self.frame_7.setMidLineWidth(0) self.frame_7.setObjectName("frame_7") self.label_showImage_2 = QtWidgets.QLabel(self.frame_7) self.label_showImage_2.setGeometry(QtCore.QRect(10, 0, 211, 191)) self.label_showImage_2.setText("") self.label_showImage_2.setPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/picture-01-150.png")) self.label_showImage_2.setObjectName("label_showImage_2") self.pushButton_P3addItemToLeftA = QtWidgets.QPushButton(self.centralwidget) self.pushButton_P3addItemToLeftA.setGeometry(QtCore.QRect(205, 90, 20, 60)) self.pushButton_P3addItemToLeftA.setText("") icon26 = QtGui.QIcon() icon26.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/addToLeftA.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3addItemToLeftA.setIcon(icon26) self.pushButton_P3addItemToLeftA.setIconSize(QtCore.QSize(30, 120)) self.pushButton_P3addItemToLeftA.setFlat(True) self.pushButton_P3addItemToLeftA.setObjectName("pushButton_P3addItemToLeftA") self.pushButton_P3addItemToLeftB = QtWidgets.QPushButton(self.centralwidget) self.pushButton_P3addItemToLeftB.setGeometry(QtCore.QRect(205, 151, 20, 60)) self.pushButton_P3addItemToLeftB.setText("") icon27 = QtGui.QIcon() icon27.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/addToLeftB.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3addItemToLeftB.setIcon(icon27) self.pushButton_P3addItemToLeftB.setIconSize(QtCore.QSize(25, 120)) self.pushButton_P3addItemToLeftB.setFlat(True) self.pushButton_P3addItemToLeftB.setObjectName("pushButton_P3addItemToLeftB") self.pushButton_P3addItemToLeftC = QtWidgets.QPushButton(self.centralwidget) self.pushButton_P3addItemToLeftC.setGeometry(QtCore.QRect(205, 212, 20, 60)) self.pushButton_P3addItemToLeftC.setText("") icon28 = QtGui.QIcon() icon28.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/addToLeftC.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3addItemToLeftC.setIcon(icon28) self.pushButton_P3addItemToLeftC.setIconSize(QtCore.QSize(25, 120)) self.pushButton_P3addItemToLeftC.setFlat(True) self.pushButton_P3addItemToLeftC.setObjectName("pushButton_P3addItemToLeftC") self.pushButton_P3_addItem = QtWidgets.QPushButton(self.centralwidget) self.pushButton_P3_addItem.setGeometry(QtCore.QRect(205, 499, 20, 60)) self.pushButton_P3_addItem.setText("") icon29 = QtGui.QIcon() icon29.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/addB.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3_addItem.setIcon(icon29) self.pushButton_P3_addItem.setIconSize(QtCore.QSize(20, 80)) self.pushButton_P3_addItem.setFlat(True) self.pushButton_P3_addItem.setObjectName("pushButton_P3_addItem") self.pushButton_P3_deleteItem = QtWidgets.QPushButton(self.centralwidget) self.pushButton_P3_deleteItem.setGeometry(QtCore.QRect(205, 560, 20, 60)) self.pushButton_P3_deleteItem.setText("") icon30 = QtGui.QIcon() icon30.addPixmap(QtGui.QPixmap("//mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/deleteB.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton_P3_deleteItem.setIcon(icon30) self.pushButton_P3_deleteItem.setIconSize(QtCore.QSize(20, 80)) self.pushButton_P3_deleteItem.setFlat(True) self.pushButton_P3_deleteItem.setObjectName("pushButton_P3_deleteItem") self.pushButton_P3_aux1 = QtWidgets.QPushButton(self.centralwidget) self.pushButton_P3_aux1.setGeometry(QtCore.QRect(205, 273, 20, 60)) self.pushButton_P3_aux1.setText("") self.pushButton_P3_aux1.setIcon(icon29) self.pushButton_P3_aux1.setIconSize(QtCore.QSize(20, 80)) self.pushButton_P3_aux1.setFlat(True) self.pushButton_P3_aux1.setObjectName("pushButton_P3_aux1") self.pushButton_P3_aux2 = QtWidgets.QPushButton(self.centralwidget) self.pushButton_P3_aux2.setGeometry(QtCore.QRect(205, 334, 20, 60)) self.pushButton_P3_aux2.setText("") self.pushButton_P3_aux2.setIcon(icon29) self.pushButton_P3_aux2.setIconSize(QtCore.QSize(20, 80)) self.pushButton_P3_aux2.setFlat(True) self.pushButton_P3_aux2.setObjectName("pushButton_P3_aux2") self.pushButton_P3_aux3 = QtWidgets.QPushButton(self.centralwidget) self.pushButton_P3_aux3.setGeometry(QtCore.QRect(205, 395, 20, 60)) self.pushButton_P3_aux3.setText("") self.pushButton_P3_aux3.setIcon(icon29) self.pushButton_P3_aux3.setIconSize(QtCore.QSize(20, 80)) self.pushButton_P3_aux3.setFlat(True) self.pushButton_P3_aux3.setObjectName("pushButton_P3_aux3") MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QtWidgets.QApplication.translate("MainWindow", "MainWindow", None, -1)) self.label_fileData_19.setText(QtWidgets.QApplication.translate("MainWindow", "M", None, -1)) self.label_fileData_20.setText(QtWidgets.QApplication.translate("MainWindow", "L", None, -1)) self.label_fileData_21.setText(QtWidgets.QApplication.translate("MainWindow", "S", None, -1)) self.label_fileData_22.setText(QtWidgets.QApplication.translate("MainWindow", "T", None, -1)) self.label_fileData_43.setText(QtWidgets.QApplication.translate("MainWindow", "Delete", None, -1)) self.label_fileData_40.setText(QtWidgets.QApplication.translate("MainWindow", "Select", None, -1)) self.label_fileData_39.setText(QtWidgets.QApplication.translate("MainWindow", "Refresh", None, -1)) self.comboBox.setItemText(0, QtWidgets.QApplication.translate("MainWindow", "Select Asset Pref Table", None, -1)) __sortingEnabled = self.tableWidget_AssetItemList.isSortingEnabled() self.tableWidget_AssetItemList.setSortingEnabled(False) self.tableWidget_AssetItemList.item(0, 0).setText(QtWidgets.QApplication.translate("MainWindow", "a", None, -1)) self.tableWidget_AssetItemList.item(0, 1).setText(QtWidgets.QApplication.translate("MainWindow", "a", None, -1)) self.tableWidget_AssetItemList.item(1, 0).setText(QtWidgets.QApplication.translate("MainWindow", "a", None, -1)) self.tableWidget_AssetItemList.item(1, 1).setText(QtWidgets.QApplication.translate("MainWindow", "a", None, -1)) self.tableWidget_AssetItemList.setSortingEnabled(__sortingEnabled) # item = self.itemAt(event.pos()) #print item # QtWidgets.QTreeWidget.mousePressEvent(self, event) #if event.button() == QtCore.Qt.LeftButton: # print 'press' # selectItem = self.treeWidget_sceneAssembleTree.currentItem() # self.treeWidget_sceneAssembleTree.mousePressEvent(selectItem) # self.treeWidget_sceneAssembleTree.inde QtGui class mod_MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): def __init__(self, parent= QtWidgets.QApplication.activeWindow()): super(mod_MainWindow, self).__init__(parent) #super(MyTreeWidget, self).__init__(parent) # MyTreeWidget.__init__(self) self.setupUi(self) # tree = self.treeWidget_sceneAssembleTree self.treeWidget_sceneAssembleTree = assetTreeInTheWorld(self) #dir( self.setupUi(self)) self.typeListAllowDict = {'transform':[255,255,255], #item list could be move and edit 'mesh':[100,190,70], 'RenderManArchive':[200,100,100], 'gpuCache':[30,230,230], 'moreThanOneItemTheSameName':[255,0,0] } self.topLayerItemIndexDict = {'0':'character', '1':'vehicle', '2':'set', '3':'prop', '4':'other', '5':'effect'} #self.treeWidget_sceneAssembleTree.itemClicked.connect(self.treeItemClick) #self.treeWidget_sceneAssembleTree.itemPressed.connect(self.treeItemClick) # self.pushButton_P3_largeIcon.clicked.connect(self.setLargeAssetIcon) self.pushButton_P3_MidIcon.clicked.connect(self.setMidAssetIcon) self.pushButton_P3_smallIcon.clicked.connect(self.setSmallAssetIcon) self.pushButton_P3_text.clicked.connect(self.setTextAssetMain) self.tableWidget_AssetItemList.itemClicked.connect(self.showAssetMetaDataFromSelect) self.itemDict ={} self.iconFile = QtGui.QIcon("//mcd-one/database/assets/scripts/maya_scripts///mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/NA120ENPTY.png") self.currentIconSize = 'large' #default set to large size icon #self.tableWidget_AssetItemList.setSortingEnabled(True) # self.tableWidget_AssetItemList.pressed.connect(self.dragTest) # drag = QtGui.QDrag(self) # # print'dragTest',drag.mimeData() ## printdrag,type(drag) # initial button checked self.pushButton_page3_all.setChecked(True) self.pushButton_P3_processModeling.setChecked(True) self.pushButton_P3_processTexture.setChecked(True) self.pushButton_P3_processRigging.setChecked(True) self.pushButton_P3_inputMayaOn.setChecked(True) self.pushButton_P3_NA.setChecked(False) self.clickAssetFilletAll() # self.allAssetClassFillet = ['character','vehicle','set','prop','other'] #button click sing self.pushButton_page3_all.clicked.connect(self.clickAssetFilletAll) self.pushButton_page3_character.clicked.connect(self.clickAssetFilletCharacter) self.pushButton_page3_vehicle.clicked.connect(self.clickAssetFilletVehicle) self.pushButton_page3_set.clicked.connect(self.clickAssetFilletSet) self.pushButton_page3_props.clicked.connect(self.clickAssetFilletProps) self.pushButton_page3_other.clicked.connect(self.clickAssetFilletOther) self.pushButton_P3_addItem.clicked.connect(self.addOutlineGroup) self.pushButton_P3_processModeling.clicked.connect(self.clickProcessFilletChange) self.pushButton_P3_processTexture.clicked.connect(self.clickProcessFilletChange) self.pushButton_P3_processRigging.clicked.connect(self.clickProcessFilletChange) self.pushButton_P3_NA.clicked.connect(self.clickProcessFilletChange) self.pushButton_P3_refreshInputItem.clicked.connect(self.reflashOutLinerTree) # self.pushButton_P3addItemToLeftA.clicked.connect(self.runBuildItemLevelTree) # self.pushButton_P3addItemToLeftB.clicked.connect(self.storeOutLineStructure) self.pushButton_P3addItemToLeftC.clicked.connect(self.ttt) ## modify treeWidget_sceneAssembleTree start---------------------------------------------------- #self.treeWidget_sceneAssembleTree.itemChanged.connect(self.itemChangedName) self.treeWidget_sceneAssembleTree.setColumnCount(1) self.treeWidget_sceneAssembleTree.header().setDefaultSectionSize(350) self.treeWidget_sceneAssembleTree.header().setMinimumSectionSize(25) self.storeOutLineStructure() # ๆ•ด็† self.runBuildItemLevelTree() # ๆ•ด็† itemCollapsed self.treeWidget_sceneAssembleTree.doubleClicked.connect(self.editItem) # self.treeWidget_sceneAssembleTree.itemEntered.connect(self.asdf) # self.treeWidget_sceneAssembleTree.itemPressed.connect(self.pressTest) self.pushButton_P3_deletSelectItem.clicked.connect(self.deleteSelectTreeItem) self.pushButton_P3_selectItem.clicked.connect(self.selectAssetTreeItem) #self.treeWidget_sceneAssembleTree.dra press ## modify treeWidget_sceneAssembleTree end---------------------------------------------------- self.setFontC() # pressItem = QtWidgets.QTreeWidgetItem(self.treeWidget_sceneAssembleTree) # self.pushButton_P3_packageAll.clicked.connect(self.testTest) ''' class mod_MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): def __init__(self, parent= QtWidgets.QApplication.activeWindow()): super(mod_MainWindow, self).__init__(parent) self.setupUi(self) ''' def selectAssetTreeItem(self) : # print 'selectAssetTreeItem' selectItem = self.treeWidget_sceneAssembleTree.selectItems() print selectItem cmds.select(cl=True) for i in selectItem: print i cmds.select(i,tgl=True) ''' if self.treeWidget_sceneAssembleTree.indexOfTopLevelItem(selectItem) == -1: selectItemFullNameList = [selectItem.text(0)] while self.treeWidget_sceneAssembleTree.indexOfTopLevelItem(selectItem) == -1: selectItem = selectItem.parent() selectItemFullNameList.append(selectItem.text(0).split('__')[0]) selectItemInOutLiner = '|'.join(reversed(selectItemFullNameList)) else: topLayerItemIndex = self.treeWidget_sceneAssembleTree.indexOfTopLevelItem(selectItem) selectItemInOutLiner = self.topLayerItemIndexDict[str(topLayerItemIndex)] cmds.select(selectItemInOutLiner) ''' def deleteSelectTreeItem(self): selectItem = self.treeWidget_sceneAssembleTree.selectItems() print selectItem for i in selectItem: print i cmds.delete(i) self.reflashOutLinerTree() def getFullName(self,childItem): # print'getFullName' if self.treeWidget_sceneAssembleTree.indexOfTopLevelItem(childItem) == -1: parentItem = childItem.parent() parentItemName = childItem.parent().text(0) self.selectItemFullNameLis.append(parentItemName) else: pass def reflashOutLinerTree(self): # print'reflash tree' self.storeItemDateInDict (3) #self.treeWidget_sceneAssembleTree.clear() self.storeOutLineStructure() self.runBuildItemLevelTree() def runChangeItemName(self): # print'runChangeItemName' try: if self.treeWidget_sceneAssembleTree.currentItem().text(0) == self.newGroupName: pass else: self.itemChangedName() except: pass def treeItemClick(self): # self.treeWidget_sceneAssembleTree = QtWidgets.QTreeWidget(self.frame_9) selectItem = self.treeWidget_sceneAssembleTree.currentItem() # self.treeWidget_sceneAssembleTree.mouseMoveEvent(QtGui.QMouseEvent(selectItem)) # print selectItem #self.treeWidget_sceneAssembleTree. # print selectItem.text(0) # print QtCore.QMimeData(selectItem).text() # print self.treeWidget_sceneAssembleTree.dropMimeData(0,'ef',1,2) # self.treeWidget_sceneAssembleTree.itemChanged.connect(self.itemMove) #PySide2.QtWidgets.QTreeWidget.dropMimeData(PySide2.QtWidgets.QTreeWidgetItem, int, PySide2.QtCore.QMimeData, PySide2.QtCore.Qt.DropAction) # self.dropEvent() #def mouseMoveEvent(self, event): # print 'cc' ''' def mouseMoveEvent(self, event): mimeData = QtCore.QMimeData() mimeData.setText(self.mimeText) drag = QtGui.QDrag(self) drag.setMimeData(mimeData) drag.exec_(QtCore.Qt.CopyAction | QtCore.Qt.MoveAction, QtCore.Qt.CopyAction) # print 'gggg' ''' # self.treeWidget_sceneAssembleTree = QtWidgets.QTreeWidget(self.frame_9) # def mousePressEvent(treeWidget_sceneAssembleTree): # print 'sds' # selectItem = self.treeWidget_sceneAssembleTree.currentItem() # print selectItem.text(0) def itemMove(self): print 'bbbbb' selectItem = self.treeWidget_sceneAssembleTree.currentItem() print selectItem.parent().text(0) def treeItemClickB(self): # print'check 01' # print'treeItemClick' takeItem = self.treeWidget_sceneAssembleTree.currentItem() ## printself.treeWidget_sceneAssembleTree.currentItem().text(0) self.getTreeLocation(takeItem) def getTreeLocation(self,takeItem): # print'check 02' # print'run getTreeLocation' # printtakeItem.text(0)#.currentColumn() getTopLayerIndex = self.treeWidget_sceneAssembleTree.indexOfTopLevelItem(takeItem) # get toplayerIndex if getTopLayerIndex == -1: getParent = takeItem.parent().text(0) else: getParent = 'none' print takeItem.childCount() print getParent #cmds.select('aa4') def runBuildItemLevelTree(self): # print'check 03' # self.storeOutLineStructure() # self.getOutLinerStructure() # print'start to build itemTree' # self.addOutlineGroup() # self.storeOutLineStructure() self.treeWidget_sceneAssembleTree.clear() self.buildDefaultTopLayerItem() # print'build tree' totalIteCount = len(self.allAssetGrpDepthDict.keys()) # get how many items in self.allAssetGrpDepthDict ๏ผŒ็ฒๅพ—outlineไธญๆ‰€ๆœ‰ๅฑค็ดš็š„ๅ็จฑ็ธฝๆ•ธ้‡ self.errorItem = {'character':{'0':[]},'vehicle':{'1':[]},'set':{'2':[]},'prop':{'3':[]},'other':{'4':[]},'effect':{'5':[]}} for i in range(0,totalIteCount): # # printi eachItemFullName = self.allAssetGrpDepthDict.keys()[i] #็ฒๅพ—ๆฏๅ€‹ๅฑค็ดšgroupๅ็จฑ,fullName ๅฎŒๆ•ดๅ็จฑ eachItemShortName = eachItemFullName.split('|')[-1] eachItemDepthList = self.allAssetGrpDepthDict[self.allAssetGrpDepthDict.keys()[i]] #็ฒๅพ—ๆฏๅ€‹ๅฑค็ดšgroup ๆ‰€ๅฐๆ‡‰็š„ๅฑค็ดšList eachItemFullDepth = len(eachItemDepthList) #็ฒๅพ—็‰ฉไปถๆ‰€ๅœจๅฑค็ดš๏ผŒ ๆฏๅ€‹็‰ฉไปถ็š„็ธฝๅฑค็ดš topLayerItemIndex = int(eachItemDepthList[0]) topLayerItemSelect = self.treeWidget_sceneAssembleTree.topLevelItem(topLayerItemIndex) parentItem = topLayerItemSelect parentItemForSetName = topLayerItemSelect for depth in range(1,eachItemFullDepth): # # print'depth',depth currentCount = parentItem.childCount() maxCount = int(eachItemDepthList[depth])+1 placeIndex = int(eachItemDepthList[depth]) delta = maxCount - currentCount if delta <= 0: parentItem = parentItem.child(placeIndex) else: self.createChildItem(delta,currentCount,parentItem,eachItemShortName) #try: parentItem = self.childItem.parent().child(placeIndex) #ๅ›žๅ‚ณๅœจ็ฌฌๅนพๅ€‹ๅˆ†ๆ”ฏ moreThanOne = 0 self.checkIsMoreThanOne(eachItemShortName) # # print'moreThanOne',self.moreThanOne # self.defineItemAddress(parentItemForSetName,eachItemDepthList,eachItemShortName,topLayerItemSelect,topLayerItemIndex) # printself.errorItem self.changeTopLayerItemName() def changeTopLayerItemName(self): # print'check 04' for i in range(0,len(self.errorItem.keys())): # printself.errorItem[self.errorItem.keys()[i]]#.keys()[0]#,self.errorItem[self.errorItem.keys()[i]] topLayerItem = self.treeWidget_sceneAssembleTree.topLevelItem(i) errorCount = len(self.errorItem[topLayerItem.text(0)][self.errorItem[topLayerItem.text(0)].keys()[0]]) newTopLayerItemName = topLayerItem.text(0) +'__('+str(errorCount)+')' # printnewTopLayerItemName # # printtopLayerItem.text(0) topLayerItem.setText(0,newTopLayerItemName) #self.treeWidget_sceneAssembleTree.itemChanged.connect(self.itemChangedName) # # printself.errorItem[topLayerItem.text(0)][self.errorItem[topLayerItem.text(0)].keys()[0]] def checkIsMoreThanOne(self,eachItemShortName): # print'check 05' # # print'checkIsMoreThanOne' checkList = cmds.ls(eachItemShortName) # # printcheckList if len(checkList) >1 : self.moreThanOne = 1 else: self.moreThanOne = 0 # return moreThanOne # # printmoreThanOne errorCount def defineItemAddress(self,parentItemForSetName,eachItemDepthList,eachItemShortName,topLayerItemSelect,topLayerItemIndex): #ๅฎš็พฉ็‰ฉไปถ็š„ไฝ็ฝฎ๏ผŒๅฆ‚ๆžœๆ˜ฏๆœ‰้‡่ค‡ๅ็จฑ็š„็‰ฉไปถๆœƒ้กฏ็คบ็ด…่‰ฒ # print'check 06' depthLength = len(eachItemDepthList) itemSelect = parentItemForSetName for childIndex in range(1,depthLength): itemSelect = itemSelect.child(int(eachItemDepthList[childIndex])) itemSelect.setText(0,eachItemShortName) if self.moreThanOne == 0: pass else: itemTypeColor = self.typeListAllowDict['moreThanOneItemTheSameName'] itemSelect.setForeground(0,QtGui.QBrush(QtGui.QColor(int(itemTypeColor[0]), int(itemTypeColor[1]), int(itemTypeColor[2]))))#.setFont(0,self.fontLevelThree) # # printitemSelect.topLayerItem() # # printself.treeWidget_sceneAssembleTree.topLevelWidget(itemSelect) # # print'topLayerItem',topLayerItemSelect.text(0),topLayerItemIndex self.errorItem[topLayerItemSelect.text(0)][self.errorItem[topLayerItemSelect.text(0)].keys()[0]].append(eachItemShortName) def buildDefaultTopLayerItem(self): # print'check 07' defaultTopLayerItem = ['character','vehicle','set','prop','other','effect'] for i in defaultTopLayerItem: #itemName = defaultTopLayerItem[i] topLayerItem = QtWidgets.QTreeWidgetItem(self.treeWidget_sceneAssembleTree) topLayerItem.setFlags(QtCore.Qt.ItemIsSelectable|QtCore.Qt.ItemIsDropEnabled|QtCore.Qt.ItemIsUserCheckable|QtCore.Qt.ItemIsEnabled) topLayerItem.setText(0,'%s'%i) def createChildItem(self,delta,currentCount,parentItem,eachItemShortName): # maxCount ็‚บ่ฉฒๅฑค็ดš้œ€่ฆๅ‰ตๅปบๅนพๅ€‹็‰ฉไปถ # print'check 08' for i in range(0,delta): self.childItem = QtWidgets.QTreeWidgetItem(parentItem) self.childItem.setText(0,eachItemShortName) def getOutLinerStructure(self,searchAsset): # print'check 09' tempBuildDefaultGrpList = [] tempBuildDefaultGrpList.append(searchAsset) countList= [] allInTransformGrp = cmds.listRelatives(searchAsset, children=True, pa=True,ad=True) if allInTransformGrp == None: pass else: for j in allInTransformGrp: grpLingName = cmds.ls(j,l=True)[0] tempBuildDefaultGrpList.append(grpLingName) countList.append(len(grpLingName.split('|'))) maxDepth = sorted(countList)[-1]-1 elementEveryLevelCount = {} itemHierarchy = {} depthDict = {} for i in range(0, maxDepth): depthDict.update({i:{}}) for i in range(1,maxDepth): elementEveryLevelCount.update({i:[]}) allItemReleationShipDist = {} refChildDict = {} for i in tempBuildDefaultGrpList: refChild = cmds.listRelatives(i, children=True, pa=True,ad=0) refChildList = [] try: refMaxCount= len(refChild) for j in range(0,refMaxCount): indexOfItem = refChild[j].split('|')[-1]+'.'+str(j) refChildList.append(indexOfItem) objNodeType = cmds.nodeType(refChild[j]) self.itemLevelDict.update({refChild[j].split('|')[-1]:[str(j),objNodeType]}) refChildDict.update({i.split('|')[-1]:refChildList}) except: refMaxCount = 'none' refChildDict.update({i.split('|')[-1]:'None'}) refParent = cmds.listRelatives(i, children=True, p=True,ad=0) refChildSerNum = [] def getItemStructure(self,searchAsset,assetIndex): # print'check 10' allItemInTopLayerItem = cmds.listRelatives(searchAsset, children=True, pa=True,ad=True,f=True) for i in allItemInTopLayerItem: tempItemLevelList = [assetIndex] #check i not in except list nodeTypeExceptList= ['joint','airField','nucleus','vortexField','turbulenceField','pointEmitter','dragField','gravityField','newtonField','uniformField','volumeAxisField'] if i in nodeTypeExceptList: pass else: for j in i.split('|'): try: getPartDepthLevel = self.itemLevelDict[j][0] #get index of each depth level #itemLevelDict tempItemLevelList.append(str(getPartDepthLevel)) except: pass self.allAssetGrpDepthDict.update({i:tempItemLevelList}) def storeOutLineStructure(self): # print'check 12' # # print'aaaa' self.itemLevelDict = {} #create empty itemLevelDict ,item dictionary self.allAssetGrpDepthDict = {} #create empty dict, that reference group depth and index to each item and grp self.defaultAssetBuildDict = {'character':'0','vehicle':'1','set':'2','prop':'3','other':'4','effect':'5'} for i in self.defaultAssetBuildDict: try: self.getOutLinerStructure(i) ## printi except: pass # print'itemLevelDict',self.itemLevelDict for i in self.defaultAssetBuildDict.keys(): try: self.getItemStructure(i,self.defaultAssetBuildDict[i]) except: pass # print'self.allAssetGrpDepthDict', self.allAssetGrpDepthDict def getOutLinerStructure(self,searchAsset): # print'check 13' tempBuildDefaultGrpList = [] tempBuildDefaultGrpList.append(searchAsset) countList= [] allInTransformGrp = cmds.listRelatives(searchAsset, children=True, pa=True,ad=True) if allInTransformGrp == None: pass else: for j in allInTransformGrp: grpLingName = cmds.ls(j,l=True)[0] tempBuildDefaultGrpList.append(grpLingName) # # printgrpLingName countList.append(len(grpLingName.split('|'))) maxDepth = sorted(countList)[-1]-1 # # print'maxDepth',maxDepth elementEveryLevelCount = {} itemHierarchy = {} depthDict = {} for i in range(0, maxDepth): depthDict.update({i:{}}) ## printdepthDict for i in range(1,maxDepth): elementEveryLevelCount.update({i:[]}) allItemReleationShipDist = {} #for i in tempBuildDefaultGrpList: # # printi refChildDict = {} for i in tempBuildDefaultGrpList: # # printi #chaList = i.split('|') refChild = cmds.listRelatives(i, children=True, pa=True,ad=0) ## print'refChild',refChild,type(refChild) refChildList = [] try: refMaxCount= len(refChild) # # print'refMaxCount',refMaxCount for j in range(0,refMaxCount): indexOfItem = refChild[j].split('|')[-1]+'.'+str(j) ## printj ,refChild[j] # # printindexOfItem refChildList.append(indexOfItem) objNodeType = cmds.nodeType(refChild[j]) # # printobjNodeType self.itemLevelDict.update({refChild[j].split('|')[-1]:[str(j),objNodeType]}) refChildDict.update({i.split('|')[-1]:refChildList}) except: refMaxCount = 'none' refChildDict.update({i.split('|')[-1]:'None'}) refParent = cmds.listRelatives(i, children=True, p=True,ad=0) refChildSerNum = [] ##--------------get info from maya group structure END --------------------------------------------------------------------------------------------------------------------- def setFontC(self): # print'check 14' self.fontC = QtGui.QFont() self.fontC.setFamily("Calibri") self.fontC.setPointSize(10) self.brushC = QtGui.QBrush(QtGui.QColor(255, 0, 0)) self.brushC.setStyle(QtCore.Qt.NoBrush) def addOutlineGroup(self): # print'check 15' # print'addOutlineGroup' currentSelectItem = self.treeWidget_sceneAssembleTree.currentItem() newItemTheSameNameList = [] for i in cmds.ls(typ= 'transform'): ## printi[0:7] if i[0:7] == 'newItem': # printi newItemTheSameNameList.append(i) # print'newItemTheSameNameList',newItemTheSameNameList newItemTheSameNameCount = len(newItemTheSameNameList) newItemName = 'newItem'+'%04d'%(newItemTheSameNameCount+1) # print'newItemName '+ newItemName # # print'newItemTheSameNameCount', newItemTheSameNameCount # cmd if currentSelectItem.isSelected() == False: # print'create A new Group in TopLayer' allTopLayerCount = int(self.treeWidget_sceneAssembleTree.topLevelItemCount()) # printallTopLayerCount newItem = QtWidgets.QTreeWidgetItem(self.treeWidget_sceneAssembleTree) newItemInOutLine = self.treeWidget_sceneAssembleTree.topLevelItem(allTopLayerCount).setText(0, QtWidgets.QApplication.translate("MainWindow", newItemName, None, -1)) if newItemName not in self.allTopLayerItemsInOutline: cmds.createNode('transform', n=newItemName) self.allTopLayerItemsInOutline.append(newItemName) else: pass #self.allTopLayerItemsInOutline else: # printcurrentSelectItem.text(0) # printself.treeWidget_sceneAssembleTree.indexOfTopLevelItem(currentSelectItem) #get selectItem topLayerIndex if self.treeWidget_sceneAssembleTree.indexOfTopLevelItem(currentSelectItem) == -1: print'currentSelectItem.parent()',currentSelectItem.parent().text(0) else: pass def editItem(self): ## modify item name in tree ๏ผŒไฟฎๆ”น็‰ฉไปถๅ็จฑ doubleClick run # print'check 17' checkTopLayerIndex = self.treeWidget_sceneAssembleTree.indexOfTopLevelItem(self.treeWidget_sceneAssembleTree.currentItem()) if checkTopLayerIndex == -1 : # ๆชขๆŸฅๆ˜ฏๅฆ็‚บ็ฌฌไธ€ๅฑค็‰ฉไปถ item = self.treeWidget_sceneAssembleTree.itemFromIndex(self.treeWidget_sceneAssembleTree.selectedIndexes()[0]) #get select Item Name self.origialGroupName = item.text(0) item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsDragEnabled | QtCore.Qt.ItemIsEditable) # self.newGroupName = self.treeWidget_sceneAssembleTree.currentItem().text(0) # # printself.origialGroupName # self.moreThanOneList = cmds.ls(self.newGroupName) # self.moreThanOneListCount = len(self.moreThanOneList) else: # print'it count not change name' pass # self.runBuildItemLevelTree() self.newGroupName = self.treeWidget_sceneAssembleTree.currentItem().text(0) self.treeWidget_sceneAssembleTree.itemChanged.connect(self.runChangeItemName) def itemChangedName(self): # print'check 18' # print'chaned item Name' # self.newGroupName = self.treeWidget_sceneAssembleTree.currentItem().text(0) self.moreThanOneList = cmds.ls(self.newGroupName) # print'self.moreThanOneList',self.moreThanOneList self.moreThanOneListCount = len(self.moreThanOneList) # print'self.moreThanOneListCount',self.moreThanOneListCount if self.moreThanOneListCount > 1: #tempName = self.newGroupName tempName = self.treeWidget_sceneAssembleTree.currentItem().text(0) for i in range(0,self.moreThanOneListCount): self.origialGroupName = self.moreThanOneList[i] self.newGroupName = tempName + '_' +'%04d'%i # print'self.origialGroupName,self.newGroupName',self.origialGroupName,self.newGroupName cmds.rename(self.origialGroupName,self.newGroupName) else: self.newGroupName = self.treeWidget_sceneAssembleTree.currentItem().text(0) # print'self.origialGroupName,self.newGroupName',self.origialGroupName,self.newGroupName cmds.rename(self.origialGroupName,self.newGroupName) # except: # pass # self.runBuildItemLevelTree() # self.runBuildItemLevelTree()itemChangedName def ttt(self): print 'check 19' # # printself.treeWidget_sceneAssembleTree.currentItem().text(1) # # printself.treeWidget_sceneAssembleTree.currentItem().text(0) # # printself.treeWidget_sceneAssembleTree.currentItem().text(2) # # printself.treeWidget_sceneAssembleTree.currentItem().icon(0).name() # # printself.treeWidget_sceneAssembleTree.currentItem().icon(0) # printself.treeWidget_sceneAssembleTree.currentItem().text(0) # iconFile =QtGui.QIcon('//mcd-one/database/assets/scripts/maya_scripts///mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/NA120B.png') # self.tableWidget_AssetItemList.item(row, column).setIcon(iconFile) def dragTest(self): # print'check 21' ## printself.treeWidget_sceneAssembleTree.currentItem #searchKey = self.tableWidget_AssetItemList.currentItem().text() selectedAssetItemColumn = self.tableWidget_AssetItemList.currentColumn() selectedAssetItemRow = self.tableWidget_AssetItemList.currentRow() searchKey = str(selectedAssetItemColumn)+'_._'+str(selectedAssetItemRow) # # printsearchKey data = self.tableItemListInfoDict[searchKey] # # printdata.keys()[0] #mimeData = QtCore.QMimeData() # # printmimeData. # drag = QtGui.QDrag(self) self.itemDrag = self.tableWidget_AssetItemList.currentItem().text() ## printself.treeWidget_sceneAssembleTree.findItems(itemDrag) # # printitemDrag #self.treeWidget_sceneAssembleTree.indexFromItem(itemDrag,0) # # printself.treeWidget_sceneAssembleTree.findItems(itemDrag,QtCore.Qt.MatchExactly) #self.table.findItems( #self.edit.text(), QtCore.Qt.MatchExactly) def test(self): print'check 22' # printself.pushButton_P3_processModeling.isChecked() # printself.pushButton_P3_processTexture.isChecked() # printself.pushButton_P3_processRigging.isChecked() # printself.pushButton_P3_NA.isChecked() def clickProcessFilletChange(self): # print'check 23_0' self.clickAssetClass(self.assetClassSelectMode) def clickAssetFilletAll(self): # print'check 23_0' self.assetClassSelectMode = 'all' self.clickAssetClass('all') def clickAssetFilletCharacter(self): # print'check 23_0' self.clickAssetClass('character') self.assetClassSelectMode = 'character' def clickAssetFilletVehicle(self): # print'check 23_0' self.clickAssetClass('vehicle') self.assetClassSelectMode = 'vehicle' def clickAssetFilletSet(self): # print'check 23_0' self.clickAssetClass('set') self.assetClassSelectMode = 'set' def clickAssetFilletProps(self): # print'check 23_0' self.clickAssetClass('props') self.assetClassSelectMode = 'props' def clickAssetFilletOther(self): # print'check 23_0' self.clickAssetClass('other') self.assetClassSelectMode = 'other' def clickAssetClass(self,classMode): # print'check 23' # printclassMode self.pushButton_page3_all.setChecked(False) self.pushButton_page3_character.setChecked(False) self.pushButton_page3_vehicle.setChecked(False) self.pushButton_page3_set.setChecked(False) self.pushButton_page3_props.setChecked(False) self.pushButton_page3_other.setChecked(False) if classMode == 'all': self.pushButton_page3_all.setChecked(True) self.allAssetClassFillet = ['character','vehicle','set','prop','other'] if classMode == 'character': self.pushButton_page3_character.setChecked(True) self.allAssetClassFillet = ['character'] if classMode == 'vehicle': self.pushButton_page3_vehicle.setChecked(True) self.allAssetClassFillet = ['vehicle'] if classMode == 'set': self.pushButton_page3_set.setChecked(True) self.allAssetClassFillet = ['set'] if classMode == 'props': self.pushButton_page3_props.setChecked(True) self.allAssetClassFillet = ['prop'] if classMode == 'other': self.pushButton_page3_other.setChecked(True) self.allAssetClassFillet = ['other'] self.loadPublishedData() if self.currentIconSize == 'large': self.setLargeAssetIcon() if self.currentIconSize == 'mid': self.setMidAssetIcon() if self.currentIconSize == 'small': self.setSmallAssetIcon() if self.currentIconSize == 'text': self.setTextAssetMain() def showAssetMetaDataFromSelect(self): # print'check 24' # print'showAssetMetaDataFromSelect start' #searchKey = self.tableWidget_AssetItemList.currentItem().text() selectedAssetItemColumn = self.tableWidget_AssetItemList.currentColumn() selectedAssetItemRow = self.tableWidget_AssetItemList.currentRow() searchKey = str(selectedAssetItemColumn)+'_._'+str(selectedAssetItemRow) # printsearchKey data = self.tableItemListInfoDict[searchKey] # printdata # for i in data showItemName = 'asset Name : %s'%data.keys()[0].split('.')[0] +'\n' showItemAssetType = 'asset Type : %s'%data.keys()[0].split('.')[1] +'\n' showItemAssetProcessNow = 'asset Progress Now : %s'%data.keys()[0].split('.')[2] +'\n'+'\n' showFileName = 'asset File Name : %s'%data[data.keys()[0]]['fileName'] +'\n'+'\n' showAssetCreator = 'asset Creator :%s'%data[data.keys()[0]]['user'] +'\n' filePublishTime = 'asset Publish Time :%s'%datetime.datetime.fromtimestamp(os.path.getmtime(data[data.keys()[0]]['fileName']))+'\n' showRibArchive = 'asset RibArchive :%s'%data[data.keys()[0]]['ribArchive']['ribArchivePath'] +'\n' showRibArchive = 'asset RibArchive :%s'%data[data.keys()[0]]['ribArchive']['ribArchivePath'] +'\n' publishTimeFromFile = str(datetime.datetime.fromtimestamp(os.path.getmtime(data[data.keys()[0]]['fileName']))) filePublishTime = 'asset Publish Time :%s'%publishTimeFromFile.split('.')[0]+'\n' iconFileName = data[data.keys()[0]]['fileIcon'] ## printfilePublishTime,type(filePublishTime) self.checkFileSize(data[data.keys()[0]]['fileName']) # printself.fileSize showAssetMayaFileSize = 'asset mayaFileSize :%s'%self.fileSize +'\n' # self.checkFileSize(data[data.keys()[0]]['fileName']) showList = [showItemName,showItemAssetType,showItemAssetProcessNow,showFileName,showAssetCreator,filePublishTime,showAssetMayaFileSize,showRibArchive] showInPlainText = '' for i in showList: showInPlainText = showInPlainText +i # printshowInPlainText self.plainTextEdit_assetMetaData.setPlainText(showInPlainText) self.label_showImage_2.setGeometry(QtCore.QRect(5, 5, 200, 200)) self.label_showImage_2.setPixmap(QtGui.QPixmap(iconFileName)) def checkFileSize(self,fileName): # print'check 25' fileSizeBt = os.stat(fileName).st_size /1024 if fileSizeBt < 1024: fileSize = str(fileSizeBt) +'KB' elif fileSizeBt <1024*1024: fileSize = '%.3f'%(fileSizeBt/1024.0) +'MB' else: fileSize='%.3f'%(fileSizeBt/1024.0/1024.0) +'GB' self.fileSize = fileSize def loadPublishedData(self): # print'check 26' file = '//mcd-one/3d_project/ocean_world_2016_cf/publish/global/ocean_world_2016_cf_publishAnnonce.json' with open(file) as data_file: data = json.load(data_file) # self.allAssetClassFillet = ['character','vehicle','set','prop','other'] #allAssetClass allProcesType = ['layout','animation','lighting','effects','simulation'] allItemDict = {} assetTempDict ={} shotTempDict = {} for i in self.allAssetClassFillet: for j in data['assets'][i].keys(): # # print'jjjjj',j if len(data['assets'][i][j]) == 0: assetTempDict.update({j+'.'+'not available':{}}) else: for k in data['assets'][i][j].keys(): assetTempDict.update({j+'.'+k:data['assets'][i][j][k]['state']}) for i in data['shot'].keys(): #shotName.shot.processType:{} for j in allProcesType: if len(data['shot'][i]) == 0: itemKey = i +'.shot.not available' shotTempDict.update({itemKey:{}}) else: itemKey = i + '.shot.'+ j if j in data['shot'][i].keys(): shotTempDict.update({itemKey:data['shot'][i][j]['state']}) allItemDict.update(assetTempDict) # allItemDict.update(shotTempDict) #if want to show shot use this line ## print'allItemDict',allItemDict #is 'texture','model','rigging' icon is checked textureTempDict = {} for i in allItemDict.keys(): if i.split('.')[2] == 'texture': textureTempDict.update({i:allItemDict[i]}) modelTempDict = {} for i in allItemDict.keys(): if i.split('.')[2] == 'model': modelTempDict.update({i:allItemDict[i]}) riggingTempDict = {} for i in allItemDict.keys(): if i.split('.')[2] == 'rigging': riggingTempDict.update({i:allItemDict[i]}) NATempDict = {} for i in allItemDict.keys(): if i.split('.')[2] == 'not available': NATempDict.update({i:allItemDict[i]}) ## print'hjghfjg',self.pushButton_P3_processModeling.isChecked() # self.pushButton_P3_processModeling ## print'self.pushButton_P3_NA.isChecked()',self.pushButton_P3_NA.isChecked() #self.test() newItemDict={} if self.pushButton_P3_processModeling.isChecked() == True: newItemDict.update(modelTempDict) if self.pushButton_P3_processTexture.isChecked() == True: newItemDict.update(textureTempDict) if self.pushButton_P3_processRigging.isChecked() == True: newItemDict.update(riggingTempDict) if self.pushButton_P3_NA.isChecked() == True: newItemDict.update(NATempDict) self.itemDict = newItemDict self.totalItemCount = len(self.itemDict) # # print'self.itemDict',self.itemDict # # print'newItemDict',newItemDict ## printsorted(newItemDict) def storeItemDateInDict(self,cloumnCount): # print'check 27' # print'storeItemDateInDict start' infoSearchList = ['fileName','fileIcon','gpuCache','ribArchive','user','publishTime','metaData'] rowCount = 0 self.tableItemListInfoDict= {} tempItemInDictList = [] notAvailableItem = [] # # print'self.itemDict.keys()',self.itemDict.keys() for i in self.itemDict.keys(): if i.split('.')[2] == 'not available': notAvailableItem.append(i) else: tempItemInDictList.append(i) sortedTempItemList = sorted(tempItemInDictList) + notAvailableItem # # print'sortedTempItemList',sortedTempItemList for i in range(0,self.totalItemCount ): self.tempInfoDictPreItem = {} if cloumnCount == 1: column = 2 row = i else: column = i % cloumnCount row = i/cloumnCount *2 tempKey = str(column) +'_._'+ str(row) # # print'tempKey',tempKey item = sortedTempItemList[i] # # print'item',item tempItemList = {} for j in infoSearchList: try: secondItem = self.itemDict[sortedTempItemList[i]][j] except: secondItem = {} tempItemList.update({j:secondItem}) # # print'secondItem',secondItem self.tableItemListInfoDict.update({tempKey:{item:tempItemList}}) # # print'self.tableItemListInfoDict',self.tableItemListInfoDict if cloumnCount == 1: rowSize = 30 columnSize =400 textRowSize =30 if cloumnCount == 3: rowSize = 120 columnSize =120 textRowSize =20 if cloumnCount == 4: rowSize = 80 columnSize =80 textRowSize =20 if cloumnCount == 6: rowSize = 60 columnSize =60 textRowSize =20 #setItemText(self,cloumnCount,rowSize,columnSize) self.setItemIcon(columnSize,rowSize) self.setItemText(cloumnCount,columnSize,textRowSize) def setItemIcon(self,columnSize,rowSize): # print'check 28' # print'setItemIcon start' ## print'self.tableItemListInfoDict',self.tableItemListInfoDict tempIconFileDict={} for i in self.tableItemListInfoDict.keys(): row = int(i.split('_._')[1]) column = int(i.split('_._')[0]) if len(self.tableItemListInfoDict[i][self.tableItemListInfoDict[i].keys()[0]]['fileIcon']) == 0: iconFile =QtGui.QIcon('//mcd-one/database/assets/scripts/maya_scripts///mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/NA120B.png') else: iconFile = QtGui.QIcon(self.tableItemListInfoDict[i][self.tableItemListInfoDict[i].keys()[0]]['fileIcon'])#.keys() item = QtWidgets.QTableWidgetItem() itemName = self.tableItemListInfoDict[i].keys()[0] item.setText(itemName) self.tableWidget_AssetItemList.setItem(row, column, item) self.tableWidget_AssetItemList.horizontalHeader().setDefaultSectionSize(columnSize) self.tableWidget_AssetItemList.verticalHeader().setDefaultSectionSize(rowSize) self.tableWidget_AssetItemList.item(row, column).setIcon(iconFile) def setItemText(self,cloumnCount,columnSize,textRowSize): # print'check 29' ## printself.tableItemListInfoDict.keys() ## print'cloumnCount',cloumnCount for i in self.tableItemListInfoDict.keys(): # # print'self.tableItemListInfoDict.keys()',self.tableItemListInfoDict.keys() if cloumnCount == 1: row = int(i.split('_._')[1]) column = 0 else: row = int(i.split('_._')[1])+1 ## print'row',row column = int(i.split('_._')[0]) itemName = str(self.tableItemListInfoDict[i].keys()[0]).split('.')[0] # # print'itemText',i,self.tableItemListInfoDict[i] ## printitemName ## printrow ,column item = QtWidgets.QTableWidgetItem() self.tableWidget_AssetItemList.setItem(row, column, item) # self.tableWidget_AssetItemList.setRowHeight(100,60) #set text row height # self.tableWidget_AssetItemList.setIconSize(QtCore.QSize(40,40)) #self.tableWidget_AssetItemList.horizontalHeader().setDefaultSectionSize(columnSize) #self.tableWidget_AssetItemList.verticalHeader().setDefaultSectionSize(rowSize) self.tableWidget_AssetItemList.setRowHeight(row,textRowSize) #set text row height self.tableWidget_AssetItemList.item(row, column).setText(QtWidgets.QApplication.translate("MainWindow",'aaa', None,-1)) self.tableWidget_AssetItemList.item(row, column).setText(QtWidgets.QApplication.translate("MainWindow",itemName, None,-1)) def setTextMode(self): # print'check 30' self.tableWidget_AssetItemList.clear() self.pushButton_P3_largeIcon.setChecked(True) self.pushButton_P3_MidIcon.setChecked(False) self.pushButton_P3_smallIcon.setChecked(False) self.pushButton_P3_text.setChecked(False) setRow = self.totalItemCount +1 self.tableWidget_AssetItemList.setColumnCount(3) self.tableWidget_AssetItemList.setRowCount(setRow) def setLargeAssetIcon(self): # print'check 31' self.tableWidget_AssetItemList.clear() self.pushButton_P3_largeIcon.setChecked(True) self.pushButton_P3_MidIcon.setChecked(False) self.pushButton_P3_smallIcon.setChecked(False) self.pushButton_P3_text.setChecked(False) # print'setLargeAssetIcon' self.tableWidget_AssetItemList.clear() self.pushButton_P3_largeIcon.setChecked(True) self.pushButton_P3_MidIcon.setChecked(False) self.pushButton_P3_smallIcon.setChecked(False) self.pushButton_P3_text.setChecked(False) if self.totalItemCount%3 == 0: setRow = ((self.totalItemCount / 3) *2) +1 else: setRow = ((self.totalItemCount / 3) *2) +2 # # printsetRow #setRow = self.totalItemCount / 2 *2 +2 self.tableWidget_AssetItemList.setColumnCount(3) self.tableWidget_AssetItemList.setRowCount(setRow) #self.tableWidget_AssetItemList.horizontalHeader().setDefaultSectionSize(120) #self.tableWidget_AssetItemList.verticalHeader().setDefaultSectionSize(120) iconFile = self.iconFile tableItemIndex={} for column in range(0,3): #set icon for row in range(0,setRow,2): self.createTableItem(column,row,iconFile,120) for column in range(0,3): for row in range(1,setRow,2): self.setTableItemText(column,row) self.storeItemDateInDict (3) # create Item Dict self.currentIconSize = 'large' def setMidAssetIcon(self): # print'check 32' # print'setMidAssetIcon' self.tableWidget_AssetItemList.clear() self.pushButton_P3_largeIcon.setChecked(False) self.pushButton_P3_MidIcon.setChecked(True) self.pushButton_P3_smallIcon.setChecked(False) self.pushButton_P3_text.setChecked(False) if self.totalItemCount%4 == 0: setRow = ((self.totalItemCount / 4) *2) +1 else: setRow = ((self.totalItemCount / 4) *2) +2 # # printsetRow # self.tableWidget_AssetItemList.setColumnCount(4) self.tableWidget_AssetItemList.setRowCount(setRow) # self.tableWidget_AssetItemList.horizontalHeader().setDefaultSectionSize(80) # self.tableWidget_AssetItemList.verticalHeader().setDefaultSectionSize(80) iconFile = self.iconFile for column in range(0,4): #set icon setItemText for row in range(0,setRow,2): # # printrow self.createTableItem(column,row,iconFile,80) for column in range(0,4): for row in range(1,setRow,2): # # printrow self.setTableItemText(column,row) self.storeItemDateInDict (4) self.currentIconSize = 'mid' def setSmallAssetIcon(self): # print'check 33' # print'setSmallAssetIcon' self.tableWidget_AssetItemList.clear() self.pushButton_P3_largeIcon.setChecked(False) self.pushButton_P3_MidIcon.setChecked(False) self.pushButton_P3_smallIcon.setChecked(True) self.pushButton_P3_text.setChecked(False) if self.totalItemCount%6 == 0: setRow = ((self.totalItemCount / 6) *2) +1 else: setRow = ((self.totalItemCount / 6) *2) +2 # # printsetRow self.tableWidget_AssetItemList.setColumnCount(6) self.tableWidget_AssetItemList.setRowCount(setRow) # self.tableWidget_AssetItemList.horizontalHeader().setDefaultSectionSize(60) # self.tableWidget_AssetItemList.verticalHeader().setDefaultSectionSize(60) iconFile = self.iconFile for column in range(0,6): #set icon for row in range(0,setRow,2): self.createTableItem(column,row,iconFile,60) for column in range(0,6): for row in range(1,setRow,2): # # printrow self.setTableItemText(column,row) self.storeItemDateInDict (6) self.currentIconSize = 'small' def setTextAssetMain(self): # print'check 34' self.setTextAsset(30) def setTextAsset(self,size): # print'check 35' # print'setTextAsset~~' self.tableWidget_AssetItemList.clear() self.pushButton_P3_largeIcon.setChecked(False) self.pushButton_P3_MidIcon.setChecked(False) self.pushButton_P3_smallIcon.setChecked(False) self.pushButton_P3_text.setChecked(True) setRow = self.totalItemCount #+ 1 self.tableWidget_AssetItemList.setColumnCount(3) self.tableWidget_AssetItemList.setRowCount(setRow) self.storeItemDateInDict(1) # # print'self.tableItemListInfoDict',self.tableItemListInfoDict.keys() iconFile =self.iconFile for row in range(0, setRow): item = QtWidgets.QTableWidgetItem() self.tableWidget_AssetItemList.setColumnWidth(0,size) #index ser number self.tableWidget_AssetItemList.setRowHeight(row , size) #set text row height self.tableWidget_AssetItemList.setItem(row, 0, item) self.tableWidget_AssetItemList.item(row, 0).setText(QtWidgets.QApplication.translate("MainWindow", "serNum", None,-1)) self.tableWidget_AssetItemList.item(row, 0).setText(QtWidgets.QApplication.translate("MainWindow", str(row), None,-1)) item = QtWidgets.QTableWidgetItem() self.tableWidget_AssetItemList.setColumnWidth(1,size) #index ser number self.tableWidget_AssetItemList.setRowHeight(row , size) #set text row height self.tableWidget_AssetItemList.setItem(row, 1, item) self.tableWidget_AssetItemList.item(row, 1).setIcon(iconFile) item = QtWidgets.QTableWidgetItem() self.tableWidget_AssetItemList.setColumnWidth(2,300) #index ser number # self.tableWidget_AssetItemList.setRowHeight(row , size) #set text row height self.tableWidget_AssetItemList.setItem(row, 2, item) self.tableWidget_AssetItemList.item(row, 2).setText(QtWidgets.QApplication.translate("MainWindow", "icon", None,-1)) for i in self.tableItemListInfoDict.keys() : row = int(i.split('_._')[1]) self.tableWidget_AssetItemList.setRowHeight(row , size) #set text row height itemName = str(self.tableItemListInfoDict[i].keys()[0]) self.tableWidget_AssetItemList.item(row, 2).setText(QtWidgets.QApplication.translate("MainWindow", itemName, None,-1)) for i in self.tableItemListInfoDict.keys() : row = int(i.split('_._')[1]) itemIconFile = str(self.tableItemListInfoDict[i][self.tableItemListInfoDict[i].keys()[0]]['fileIcon']) # itemIconFile='//mcd-one/database/assets/scripts/maya_scripts///mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/NA120B.png' if len(itemIconFile) == 2: # # print'itemIconFile','not available' itemIconFile = '//mcd-one/database/assets/scripts/maya_scripts///mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/NA120B.png' self.tableWidget_AssetItemList.item(row, 1).setIcon(QtGui.QIcon(itemIconFile)) self.tableWidget_AssetItemList.setIconSize(QtCore.QSize(size,size)) pass else: # # print'itemIconFile'itemIconFile # # print'itemIconFile',itemIconFile self.tableWidget_AssetItemList.item(row, 1).setIcon(QtGui.QIcon(itemIconFile)) self.tableWidget_AssetItemList.setIconSize(QtCore.QSize(size,size)) # for row in range(0, setRow): # item = QtWidgets.QTableWidgetItem() # self.tableWidget_AssetItemList.setColumnWidth(3,size) #index ser number # self.tableWidget_AssetItemList.setRowHeight(row , size) self.currentIconSize = 'text' def initialTableWidgetAssetList(self): # print'check 36' self.tableWidget_AssetItemList.clear() #self.tableWidget_AssetItemList.setRowCount(2) #self.tableWidget_AssetItemList.setColumnCount(2) self.tableWidget_AssetItemList.setColumnCount(3) self.tableWidget_AssetItemList.setRowCount(4) self.tableWidget_AssetItemList.horizontalHeader().setDefaultSectionSize(60) self.tableWidget_AssetItemList.verticalHeader().setDefaultSectionSize(60) def createTableItem(self,column,row,iconFile,iconSize): # print'check 37' item = QtWidgets.QTableWidgetItem() self.tableWidget_AssetItemList.setItem(row, column, item) self.tableWidget_AssetItemList.item(row, column).setText(QtWidgets.QApplication.translate("MainWindow", "ItemIconHere", None,-1)) self.tableWidget_AssetItemList.item(row, column).setIcon(iconFile) self.tableWidget_AssetItemList.setIconSize(QtCore.QSize(iconSize,iconSize)) def createItemB(self,column,row,iconFile): # print'check 38' # icon = QtGui.QIcon("C:/Program Files/Autodesk/Maya2017///mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/animation.png") #iconFile = QtGui.QIcon("C:/Program Files/Autodesk/Maya2017///mcd-one/database/assets/scripts/maya_scripts/icons/publishToolIcon/animation.png") item = QtWidgets.QTableWidgetItem() self.tableWidget_AssetItemList.setItem(row, column, item) #self.tableWidget_AssetItemList.item(row, column).setText(QtWidgets.QApplication.translate("MainWindow", "ItemIcon", None,-1)) self.tableWidget_AssetItemList.item(row, column).setIcon(iconFile) self.tableWidget_AssetItemList.setIconSize(QtCore.QSize(60,60)) # self.tableWidget.item(1, 2).setIconText('aaa') # item. # add text Item def setTableItemText(self,column,row): # print'check 39' item = QtWidgets.QTableWidgetItem() # textRow = row+1 self.tableWidget_AssetItemList.setRowHeight(row , 20) #set text row height self.tableWidget_AssetItemList.setItem(row, column, item) # self.tableWidget_AssetItemList.setIconSize(QtCore.QSize(40,40)) self.tableWidget_AssetItemList.item(row, column).setText(QtWidgets.QApplication.translate("MainWindow", "ItemName", None,-1)) #item.setTextAlignment(-20) # self.tableWidget.setRowHeight(1 , 20) class assetTreeInTheWorld(QtWidgets.QTreeWidget,mod_MainWindow): def __init__(self,parent= QtWidgets.QApplication.activeWindow()): super(assetTreeInTheWorld, self).__init__(parent) self.setAcceptDrops(True) #self.setHeaderLabels(["Select Members"]) self.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) self.setGeometry(QtCore.QRect(5, 90, 200, 530)) self.setColumnCount(2) #self.mousePressPos = QtCore.QPoint(0,0) self.setObjectName("treeWidget_sceneAssembleTree") #self.header().setVisible(False) #self.header().setCascadingSectionResizes(False) #self.header().setDefaultSectionSize(150) #self.header().setHighlightSections(False) #self.header().setMinimumSectionSize(25) #self.setDragEnabled(True) #self.setDragDropOverwriteMode(True) #self.setDragDropMode(QtWidgets.QAbstractItemView.InternalMove) self.header().setHidden(True) self.setSelectionMode(self.ExtendedSelection) self.setDragDropMode(self.InternalMove) self.setDragEnabled(True) self.setDropIndicatorShown(True) # self.itemSelectionChanged.connect(self.selectItems) self.topLayerItemIndexDict = {'0':'character', '1':'vehicle', '2':'set', '3':'prop', '4':'other', '5':'effect'} #self.pushButton_P3_deletSelectItem.clicked.connect(self.asdf) def asdf(self): print 'asdf' def selectItems(self): print 'selectItems' treeItemName = [] treeItemFullNameList = [] treeItem = self.selectedItems() for i in treeItem: if self.indexOfTopLevelItem(i) == -1: treeItemName.append(i.text(0)) self.checkParentFullName(i) # print 'itemFullName',self.parentItemFullName treeItemFullNameList.append(self.parentItemFullName) else: print 'can not modify toplayer item' return treeItemFullNameList def dropEvent(self, event): print 'dropEvent' if event.source() == self: QtWidgets.QAbstractItemView.dropEvent(self, event) def dropMimeData(self, parent, row, data, action): print 'dropMimeData' if action == QtCore.Qt.MoveAction: #print self.moveSelection(parent, row) return self.moveSelection(parent, row) return False def checkParentFullName(self,parentItem): print 'checkParentFullName' # itemLevelIndexList = [] parentItemIndex = self.indexOfTopLevelItem(parentItem) # print 'parentItemIndex',parentItemIndex if parentItemIndex == -1: parentItemFullNameList = [parentItem.text(0)] while self.indexOfTopLevelItem(parentItem) == -1: parentItem = parentItem.parent() # print 'parentItem',parentItem.text(0) parentItemFullNameList.append(parentItem.text(0).split('__')[0]) parentItemFullName = '|'.join(reversed(parentItemFullNameList)) else: topLayerItemIndex = parentItemIndex parentItemFullName = self.topLayerItemIndexDict[str(topLayerItemIndex)] # print 'parentItemFullName',parentItemFullName self.parentItemFullName =parentItemFullName #return parentFullName #cmds.select(selectItemInOutLiner) def moveSelection(self, parent, position): print 'moveSelection' # save the selected items dragItem = self.selectItems() selection = [QtCore.QPersistentModelIndex(i) for i in self.selectedIndexes()] parent_index = self.indexFromItem(parent) if parent_index in selection: return False # save the drop location in case it gets moved target = self.model().index(position, 0, parent_index).row() if target < 0: target = position # remove the selected items taken = [] for index in reversed(selection): item = self.itemFromIndex(QtCore.QModelIndex(index)) if item is None or item.parent() is None: taken.append(self.takeTopLevelItem(index.row())) else: taken.append(item.parent().takeChild(index.row())) self.checkParentFullName(parent) dropTarget = self.parentItemFullName print 'dragItem',dragItem print 'dropTarget',dropTarget self.moveTreeItem(dragItem,dropTarget) while taken: if position == -1: # append the items if position not specified if parent_index.isValid(): parent.insertChild( parent.childCount(), taken.pop(0)) else: self.insertTopLevelItem( self.topLevelItemCount(), taken.pop(0)) else: # insert the items at the specified position if parent_index.isValid(): parent.insertChild(min(target, parent.childCount()), taken.pop(0)) else: self.insertTopLevelItem(min(target, self.topLevelItemCount()), taken.pop(0)) return True def moveTreeItem(self,dragItem,dropTarget): print 'moveTreeItem' for i in dragItem: cmds.parent(i,dropTarget) def main(): global ui app = QtWidgets.QApplication.instance() if app == None: app = QtWidgets.QApplication(sys.argv) try: ui.close() ui.deleteLater() except: pass ui = mod_MainWindow() ui.show() if __name__ == '__main__': main()
[ "alpha@mail.chungyo.net" ]
alpha@mail.chungyo.net
f0c2651bd1caa32ffae059846f3a13da0a81e91e
19c6ae914b454dd2e23e364b78fab8734e300316
/api/migrations/0003_auto_20180414_1541.py
020b94563bce9b5d0c3044ae773d370daada992d
[]
no_license
deepnirmal/Django-sample
6e538a6f1acc989302c70459d388e1d49a86944b
29eed30fec4d3f5f9d53090e6dd54707b45e37ce
refs/heads/master
2020-03-10T23:29:13.531222
2018-04-16T05:17:07
2018-04-16T05:17:07
null
0
0
null
null
null
null
UTF-8
Python
false
false
461
py
# Generated by Django 2.0.4 on 2018-04-14 15:41 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('api', '0002_auto_20180414_1524'), ] operations = [ migrations.AlterField( model_name='task', name='status', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Status'), ), ]
[ "Deep.Nirmal@walmart.com" ]
Deep.Nirmal@walmart.com
aa589907e356abf2a7b24506f773b839094ef43d
3a89ee8d30e3df1270482b5dcb2df3e1da60281e
/ember/pssa/model.py
c69715dbde091c09c94bdf1eef1f6ea296e832d2
[]
no_license
whigg/ember
71968322cff2ea6e017b3433f8b9cca80bd3f1d5
d4a6e04b29ab7de7bbce431282b68aa21397351a
refs/heads/master
2023-01-05T04:13:51.048735
2020-11-03T03:30:58
2020-11-03T03:36:29
null
0
0
null
null
null
null
UTF-8
Python
false
false
14,294
py
import random from collections import deque, defaultdict from functools import lru_cache from itertools import combinations import dwave_networkx as dnx from networkx import Graph from ember.hardware.chimera import ChimeraGraph from ember.hardware.transform import overlap_clique, double_triangle_clique from ember.hardware.transform_helper import divide_guiding_pattern from ember.pssa.graph import MutableGraph __all__ = ["ProbabilisticSwapShiftModel", "CliqueOverlapModel"] class BaseModel: def __init__(self, guest: Graph, host: ChimeraGraph): if host.faulty_nodes or host.faulty_edges: raise NotImplementedError( "Chimera graphs with faults are not supported by these algorithms") self.guest = guest self.host = host m, l = host.params dnx_coords = dnx.chimera_coordinates(m, t=l) self.linear_to_chimera = dnx_coords.linear_to_chimera self.chimera_to_linear = dnx_coords.chimera_to_linear self.forward_embed = None def _chimera_distance(self, g1: int, g2: int): if g1 == g2: return 0 (i1, j1, u1, k1) = self.linear_to_chimera(g1) (i2, j2, u2, k2) = self.linear_to_chimera(g2) dist = abs(i1 - i2) + abs(j1 - j2) dist += 2 if u1 == u2 else 1 if u1 == 0 and u2 == 0 and (j1 - j2) == 0 and k1 == k2: dist -= 2 if u1 == 1 and u2 == 1 and (i1 - i2) == 0 and k1 == k2: dist -= 2 return dist def _create_contact_graph(self, embed): self.contact_graph = MutableGraph(self.guest, include_edges=False) self.initial_cost = 0 for n1 in range(len(embed)): e1 = embed[n1] for n2 in range(n1): e2 = embed[n2] weight = 0 for g1 in e1: for g2 in e2: weight += 1 if self._chimera_distance(g1, g2) == 1 else 0 if weight > 0: self.contact_graph.add_edge(n1, n2, weight) self.initial_cost += 1 if self.guest.has_edge(n1, n2) else 0 def all_moves(self): pass def random_swap_move(self): pass def random_shift_move(self, *args): pass def delta_swap(self, swap_move): pass def swap(self, swap_move): pass def delta_shift(self, swap_move): pass def shift(self, swap_move): pass def randomize(self): pass class ProbabilisticSwapShiftModel(BaseModel): """ Simulated annealing model which finds an embedding by swapping chains or by shifting nodes between chains. Uses pssa.hardware.transform.double_triangle_clique as a guiding pattern. """ def __init__(self, guest, host: ChimeraGraph): """ Initialize model with guest graph and host graph. Args: guest (nx.Graph): a guest instance host (ChimeraGraph): Any Chimera host instance """ super().__init__(guest, host) guiding_pattern = double_triangle_clique(host) initial_emb = divide_guiding_pattern(guiding_pattern, len(guest)) self.forward_embed = [deque(initial_emb[i]) for i in range(len(initial_emb))] self.inverse_embed = {l: k for k, ll in initial_emb.items() for l in ll} self.inverse_guiding_pattern = \ {l: k for k, ll in guiding_pattern.items() for l in ll} for i in range(len(host)): if i not in self.inverse_embed: self.inverse_embed[i] = -1 self._create_contact_graph(initial_emb) def all_moves(self): raise NotImplementedError() def random_swap_move(self): n1, n1_nb = random.choice(tuple(self.guest.edges)) n2 = random.choice(tuple( self.contact_graph.nodes[n1_nb].neighbours)).val return n1, n2 def random_shift_move(self, any_dir=False): n_to = random.randrange(len(self.guest)) if len(self.forward_embed[n_to]) < 2: return None g_to = self.forward_embed[n_to][0] if random.getrandbits(1) == 0 \ else self.forward_embed[n_to][-1] cand = [] for g_to_nb in iter(self.host[g_to]): n_to_nb = self.inverse_embed[g_to_nb] if n_to_nb == -1: continue if self.inverse_embed[g_to] == n_to_nb: continue if self.forward_embed[n_to_nb][0] != g_to_nb \ and self.forward_embed[n_to_nb][-1] != g_to_nb: continue if any_dir: cand.append(g_to_nb) elif self.inverse_guiding_pattern[g_to_nb] == \ self.inverse_guiding_pattern[g_to]: cand.append(g_to_nb) if len(cand) == 0: return None g_from = random.choice(cand) return g_from, g_to def delta_swap(self, swap_move): n1, n2 = swap_move delta = 0 for n1_nb in self.contact_graph.nodes[n1].neighbours: if n2 == n1_nb.val: continue if self.guest.has_edge(n1, n1_nb.val): delta -= 1 if self.guest.has_edge(n2, n1_nb.val): delta += 1 for n2_nb in self.contact_graph.nodes[n2].neighbours: if n1 == n2_nb.val: continue if self.guest.has_edge(n2, n2_nb.val): delta -= 1 if self.guest.has_edge(n1, n2_nb.val): delta += 1 return delta def swap(self, swap_move): n1, n2 = swap_move for g1 in self.forward_embed[n1]: self.inverse_embed[g1] = n2 for g2 in self.forward_embed[n2]: self.inverse_embed[g2] = n1 self.forward_embed[n1], self.forward_embed[n2] = \ self.forward_embed[n2], self.forward_embed[n1] self.contact_graph.swap_node(n1, n2) def delta_shift(self, shift_move): g_from, g_to = shift_move n_from = self.inverse_embed[g_from] n_to = self.inverse_embed[g_to] n_nb_count = defaultdict(int) delta = 0 # Consider neighbours of g_to, increment delta for new segments added to n_from for g_to_nb in iter(self.host[g_to]): n_to_nb = self.inverse_embed[g_to_nb] if n_to_nb == -1: continue if n_to_nb == n_from or n_to_nb == n_to: continue if n_to_nb not in n_nb_count and not self.contact_graph.has_edge(n_from, n_to_nb) \ and self.guest.has_edge(n_from, n_to_nb): delta += 1 n_nb_count[n_to_nb] += 1 # If g_to is in all edges connecting n_to to n_to_nb then decrement delta for n_to_nb, count in n_nb_count.items(): assert self.contact_graph.edge_weight(n_to_nb, n_to) >= count # Debug if self.contact_graph.edge_weight(n_to_nb, n_to) == count \ and self.guest.has_edge(n_to_nb, n_to): delta -= 1 return delta def shift(self, shift_move): g_from, g_to = shift_move n_from = self.inverse_embed[g_from] n_to = self.inverse_embed[g_to] # Update forward embed if self.forward_embed[n_from][-1] == g_from: self.forward_embed[n_from].append(g_to) else: self.forward_embed[n_from].appendleft(g_to) if self.forward_embed[n_to][-1] == g_to: self.forward_embed[n_to].pop() else: self.forward_embed[n_to].popleft() # Update inverse embed self.inverse_embed[g_to] = n_from # Update contact hardware for g_to_nb in iter(self.host[g_to]): n_to_nb = self.inverse_embed[g_to_nb] if n_to_nb == -1: continue if n_to_nb == n_from: self.contact_graph.decrement_edge_weight(n_from, n_to) elif n_to_nb == n_to: self.contact_graph.increment_edge_weight(n_from, n_to) else: self.contact_graph.increment_edge_weight(n_from, n_to_nb) self.contact_graph.decrement_edge_weight(n_to, n_to_nb) class CliqueOverlapModel(BaseModel): """ Simulated annealing model which finds an embedding by swapping chains or by conversion between I-shaped chains, L-shaped chains and T-Shaped chains. Uses pssa.hardware.transform.overlap_clique as a guiding pattern. """ def __init__(self, guest, host: ChimeraGraph): """ Initialize model with guest graph and host graph. Args: guest (nx.Graph): a guest instance host (ChimeraGraph): Any Chimera host instance """ super().__init__(guest, host) initial_embed = overlap_clique(host) self.forward_embed = [set(initial_embed[i]) for i in range(len(guest))] self.inverse_embed = {n: i for i in range(len(guest)) for n in initial_embed[i]} self._create_contact_graph(self.forward_embed) def randomize(self): random.shuffle(self.forward_embed) self.inverse_embed = \ {n: i for i in range(len(self.guest)) for n in self.forward_embed[i]} self._create_contact_graph(self.forward_embed) @lru_cache def all_moves(self): m, l = self.host.params swaps = list(combinations(range(len(self.guest)), 2)) shifts = list(range(len(self.guest) - m * l)) return swaps, shifts def random_swap_move(self): n1, n1_nb = random.choice(tuple(self.guest.edges)) n2 = random.choice(tuple( self.contact_graph.nodes[n1_nb].neighbours)).val return n1, n2 def random_shift_move(self, *args): m, l = self.host.params z_idx = random.randint(0, len(self.guest) - m * l - 1) return z_idx def delta_swap(self, swap_move): n1, n2 = swap_move delta = 0 for n1_nb in self.contact_graph.nodes[n1].neighbours: if n2 == n1_nb.val: continue if self.guest.has_edge(n1, n1_nb.val): delta -= 1 if self.guest.has_edge(n2, n1_nb.val): delta += 1 for n2_nb in self.contact_graph.nodes[n2].neighbours: if n1 == n2_nb.val: continue if self.guest.has_edge(n2, n2_nb.val): delta -= 1 if self.guest.has_edge(n1, n2_nb.val): delta += 1 return delta def swap(self, swap_move): n1, n2 = swap_move for g1 in self.forward_embed[n1]: self.inverse_embed[g1] = n2 for g2 in self.forward_embed[n2]: self.inverse_embed[g2] = n1 self.forward_embed[n1], self.forward_embed[n2] = \ self.forward_embed[n2], self.forward_embed[n1] self.contact_graph.swap_node(n1, n2) def delta_shift(self, shift_move): delta = 0 n_minor, n_major, n_overlap = self._get_overlap_state(shift_move) # check ownership status if n_overlap == n_major: # major loss, minor gain for n_nb in self._get_n_minors(shift_move): if n_nb == n_minor: continue if self.guest.has_edge(n_major, n_nb): delta -= 1 if self.guest.has_edge(n_minor, n_nb) \ and not self.contact_graph.has_edge(n_minor, n_nb): delta += 1 elif n_overlap == n_minor: # major gain, minor loss for n_nb in self._get_n_minors(shift_move): if n_nb == n_minor: continue if self.guest.has_edge(n_minor, n_nb) \ and self.contact_graph.edge_weight(n_minor, n_nb) == 1: delta -= 1 if self.guest.has_edge(n_major, n_nb): delta += 1 else: raise Exception("Bad state") return delta def shift(self, shift_move): n_minor, n_major, n_overlap = self._get_overlap_state(shift_move) if n_overlap == n_major: # major loss, minor gain for g_nb in self._get_g_minors(shift_move): self.forward_embed[n_major].remove(g_nb) self.forward_embed[n_minor].add(g_nb) self.inverse_embed[g_nb] = n_minor for n_nb in self._get_n_minors(shift_move): if n_nb == n_minor: continue self.contact_graph.decrement_edge_weight(n_major, n_nb) self.contact_graph.increment_edge_weight(n_minor, n_nb) elif n_overlap == n_minor: # major gain, minor loss for g_nb in self._get_g_minors(shift_move): self.forward_embed[n_major].add(g_nb) self.forward_embed[n_minor].remove(g_nb) self.inverse_embed[g_nb] = n_major for n_nb in self._get_n_minors(shift_move): if n_nb == n_minor: continue self.contact_graph.increment_edge_weight(n_major, n_nb) self.contact_graph.decrement_edge_weight(n_minor, n_nb) else: raise Exception("Bad state") def _get_g_minors(self, z_idx): cell, unit = z_idx // 4, z_idx % 4 try: for c in range(cell + 1): yield self.chimera_to_linear((1 + cell, c, 1, unit)) except KeyError: pass def _get_n_minors(self, z_idx): cell = z_idx // 4 _, l = self.host.params try: for c in range(cell + 1): for u in range(l): yield self.inverse_embed[ self.chimera_to_linear((1 + cell, c, 0, u))] except KeyError: pass def _get_overlap_state(self, z_idx): cell, unit = z_idx // 4, z_idx % 4 m, _ = self.host.params # minor, major, overlap return self.inverse_embed[self.chimera_to_linear((1 + cell, cell, 0, unit))], \ self.inverse_embed[self.chimera_to_linear((1 + cell, m - 1, 1, unit))], \ self.inverse_embed[self.chimera_to_linear((1 + cell, cell, 1, unit))]
[ "ipwnu777@gmail.com" ]
ipwnu777@gmail.com
235bea81a7895dc78c4ca7bd704cd9fc6093faec
7c5fb33929116bb77b438de3ead93b3978b5af71
/alf/networks/action_encoder.py
16792ab6d227f26716c18cf61406688f1e6c33a0
[ "Apache-2.0" ]
permissive
HorizonRobotics/alf
d6dac891322a81ccb7e2a9749139627b1eda28cb
b00ff2fa5e660de31020338ba340263183fbeaa4
refs/heads/pytorch
2023-08-21T18:51:41.370566
2023-08-16T00:07:22
2023-08-16T00:07:22
178,459,453
288
57
Apache-2.0
2023-09-14T20:40:20
2019-03-29T18:44:07
Python
UTF-8
Python
false
false
2,719
py
# Copyright (c) 2019 Horizon Robotics. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """A simple parameterless action encoder.""" import numpy as np import torch import torch.nn.functional as F import alf from .network import Network class SimpleActionEncoder(Network): """A simple encoder for action. It encodes discrete action to one hot representation and use the original continous actions. The output is the concat of all of them after flattening. """ def __init__(self, action_spec): """ Args: action_spec (nested BoundedTensorSpec): spec for actions """ def check_supported_spec(spec): if spec.is_discrete: assert np.min(spec.minimum) == np.max(spec.minimum) == 0 assert np.min(spec.maximum) == np.max(spec.maximum) alf.nest.map_structure(check_supported_spec, action_spec) self._action_spec = action_spec super().__init__(input_tensor_spec=action_spec, name="ActionEncoder") def forward(self, inputs, state=()): """Generate encoded actions. Args: inputs (nested Tensor): action tensors. Returns: nested Tensor with the same structure as inputs. """ alf.nest.assert_same_structure(inputs, self._action_spec) actions = inputs outer_rank = alf.nest.utils.get_outer_rank(inputs, self._action_spec) def _encode_one_action(action, spec): if spec.is_discrete: num_actions = spec.maximum - spec.minimum + 1 if num_actions.ndim == 0: num_actions = int(num_actions) else: num_actions = int(num_actins[0]) a = F.one_hot(action, num_actions).to(torch.float32) else: a = action if outer_rank > 0: return a.reshape(*a.shape[:outer_rank], -1) else: return a.reshape(-1) actions = alf.nest.map_structure(_encode_one_action, actions, self._action_spec) return torch.cat(alf.nest.flatten(actions), dim=-1), ()
[ "noreply@github.com" ]
noreply@github.com
1d9541158f83578238b98dcdfc19ba79daf98b49
9ac08da288a54b1b2a2e318cbfd906d30364eac8
/src/unit3_challenge2.py
6388b50d56c93b0519a184e13358bb6ab3b9d55e
[]
no_license
bigdatasciencegroup/datalab
79bac9caf42352eefd0e79977cfb6e28c6af7323
83617eba3b9b1170e5f271d12e79ad7c6bcfdd66
refs/heads/master
2023-05-09T21:50:58.008163
2020-01-01T12:32:56
2020-01-01T12:32:56
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,950
py
import sys from sklearn.metrics.cluster import adjusted_mutual_info_score from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from src.base.task import BaseTask from src.utils.models import FileSizeClusterer from sklearn.base import TransformerMixin import numpy as np from io import BytesIO from zipfile import ZipFile from sklearn.pipeline import make_pipeline from sklearn.cluster import KMeans from androguard.misc import AnalyzeAPK from androguard.misc import APK from src.utils.utils import SavedDict from src.utils.utils import ElbowPlotter import os from src.utils.models import DenseTransformer from src.utils.models import GmmClusterer from sklearn.preprocessing import StandardScaler class FeatureExtractor(TransformerMixin): def __init__(self, working_dir): super(FeatureExtractor, self).__init__() self.json_path = os.path.join(working_dir, 'more_features.json') self.vectorizer = TfidfVectorizer() def fit(self, xs, ys=None): return self def transform(self, xs, ys=None): xs_len = len(xs) transformed = [] with SavedDict(self.json_path) as d: for i, sample in enumerate(xs): if i % 10 == 0: print('{} of {}'.format(i, xs_len)) transformed.append(self.transform_sample(sample, d)) return transformed def transform_sample(self, sample, cache_dict): filename, app = sample if filename not in cache_dict.keys(): cache_dict[filename] = self.extract_features(app) return cache_dict[filename] def extract_features(self, app): features = {} try: a, d, dx = AnalyzeAPK(app, raw=True) features['permissions'] = ' '.join(list(map(lambda x: x.rsplit('.', 1)[1], a.permissions))) features['min_sdk'] = a.get_min_sdk_version() features['log_size'] = np.log(sys.getsizeof(app)) except Exception as ex: pass return features class Vectorizer(TransformerMixin): def __init__(self, text_vectorizer): self.text_vectorizer = text_vectorizer def get_texts(self, xs): return [x['permissions'] if 'permissions' in x.keys() else "" for x in xs] def fit(self, xs, ys=None): self.text_vectorizer.fit(self.get_texts(xs)) return self def transform(self, xs, ys=None): transformed = [self.transform_sample(x) for x in xs] return transformed def transform_sample(self, sample): text_features = self.text_vectorizer.transform(self.get_texts([sample])) text_features = list(np.array(text_features.todense())[0]) min_sdk = sample.get('min_sdk', 0) if min_sdk != min_sdk or min_sdk is None: min_sdk = 0 log_size = sample.get('log_size', 0) if log_size != log_size or log_size is None: log_size = 0 all_features = text_features #+ [min_sdk, log_size] return all_features class Task(BaseTask): def get_model(self): return make_pipeline( FeatureExtractor(working_dir=self.path), Vectorizer(TfidfVectorizer()), StandardScaler(), # ElbowPlotter(model=KMeans(), metric=self.metric, k_range=(10, 30), unsupervised=True), KMeans(n_clusters=30, n_init=50, max_iter=1000) ) @property def metric(self): return adjusted_mutual_info_score @property def include_file_names(self): return True @property def mode(self): return BaseTask.Mode.CLUSTERING @property def train_data_link(self): return 'https://www.sec.cs.tu-bs.de/teaching/ws19/datalab/03-clust/d0f626fb065b9bd661f3f681cf032853478d2f46.zip' @property def test_data_link(self): return "https://www.sec.cs.tu-bs.de/teaching/ws19/datalab/03-clust/813e0f0cffaa77809374d0ce34f170e153c47605.zip"
[ "jonasitzmann@github.com" ]
jonasitzmann@github.com
b9053a14c9ecab360901c53e37eb3ed50d3054f1
e1c10cc188de604dfbce7403a7612f0c84457db4
/resources/lecturer.py
2c4dc1f536de265a9bafc89e569c8a4b714c7e16
[]
no_license
clemkofi/ccn_directory
42499e640d098f96e810226b6602c7747e1456af
50a8818f23e60ca74a075d77270aebfdd613505d
refs/heads/master
2022-12-09T20:01:21.694835
2018-11-09T08:06:50
2018-11-09T08:06:50
155,115,133
0
0
null
2022-12-08T01:15:42
2018-10-28T21:00:12
Python
UTF-8
Python
false
false
10,868
py
from resources_classes.db import DatabaseReq from flask import request, jsonify from flask_restful import Resource, reqparse from apiapp import pass_generator, get_timestamp, get_current_timestamp, get_date_from_timestamp, get_token_for_user from notification_service.notification_mail import password_notification from werkzeug.security import generate_password_hash, check_password_hash import uuid from decorators import token_required # from werkzeug.security import generate_password_hash, check_password_hash class LecturerResource(Resource): ''' Request for creating, updating, deleting and getting all information for the lecturers in the system ''' @token_required def post(self, currentUser, typeAuth): ok_pass_go_on = 0 #check from the token authentication to ensure that the user is a lecturer and is allowed to perform this task if typeAuth == "staff": if currentUser[0]['privilege'] == "HR": ok_pass_go_on = 1 elif typeAuth == "admin": ok_pass_go_on = 1 else: return jsonify({'Statuscode' : '200', 'message' : 'You are not allowed to add lecturer'}) if ok_pass_go_on == 0: return jsonify({'Statuscode' : '200', 'message' : 'You are not allowed to add lecturer'}) try: #parse the arguments for the post request parser = reqparse.RequestParser() parser.add_argument('surname', type=str, help='surname of the lecturer') parser.add_argument('other_names', type=str, help='other names of the lecturer') parser.add_argument('dob', type=str, help='date of birth of the lecturer') parser.add_argument('phone', type=str, help='active phone number') parser.add_argument('email', type=str, help='active email address') parser.add_argument('Group_id', type=str, help='id for the group the lecturer has been added to') parser.add_argument('department_id', type=str, help='id for the department the lecturer has been assigned to') args = parser.parse_args() #convert the dob to timestamp args['dob'] = get_timestamp(date=args['dob']) #generate password for the Lecturer new_password = pass_generator() args['vcode'] = new_password #then hash the password to be stored in the db hashed_password = generate_password_hash(new_password, method='sha256') #give the last update time of the Data args['last_update_time'] = get_current_timestamp() #get the public id from the uuid args['public_id'] = str(uuid.uuid4()) #adding the arguemnts to a list args_to_pass = [] args_to_pass.append(args['surname']) args_to_pass.append(args['other_names']) args_to_pass.append(args['dob']) args_to_pass.append(args['phone']) args_to_pass.append(args['email']) args_to_pass.append(args['Group_id']) args_to_pass.append(args['department_id']) args_to_pass.append(hashed_password) args_to_pass.append(args['last_update_time']) args_to_pass.append(args['public_id']) #creating a cursor from the db class arg_data = DatabaseReq().get_cursor(proc_name='spInsertNewLecturer', mode='post', args=args_to_pass) if arg_data=="success": password_notification(args) return jsonify({'Statuscode':'200', 'Message':'Lecturer creation successful'}) else: return jsonify({'Statuscode':'600', 'Message':arg_data}) except Exception as e: return{'error' : str(e)} #/lecturer/ = all lecturers #/lecturer/?p_id=public_id = one lecturer with public id @token_required def get(self, currentUser, typeAuth): ok_pass_go_on = 0 #check from the token authentication to ensure that the user is a lecturer and is allowed to perform this task if typeAuth == "staff": ok_pass_go_on = 1 elif typeAuth == "admin": ok_pass_go_on = 1 else: return jsonify({'Statuscode' : '200', 'message' : 'You are not allowed to add lecturer'}) if ok_pass_go_on == 0: return jsonify({'Statuscode' : '200', 'message' : 'You are not allowed to add lecturer'}) try: public_id = request.args.get('p_id') if public_id is None: #creating a cursor from the db class to get all lecturers data_all_lecturers = DatabaseReq().get_cursor(proc_name='spGetAllLecturers', mode='get') else: #create cursor to get just one lecturer based on his public id data_all_lecturers = DatabaseReq().get_cursor(proc_name='spGetOneLecturer', mode='get', args=[public_id]) if (len(data_all_lecturers)>0): lecturerList = [] #use a for loop to iterate through the result for item in data_all_lecturers: if item[6] is 1: continue i = { 'surname':item[1], 'other_names':item[2], 'dob':item[3], 'phone':item[4], 'email':item[5], 'account_setup':item[7], 'public_id':item[8], 'vcode':item[9], 'Group_id':item[11], 'Department_id':item[12] } #change date of birth to readable format i['dob'] = get_date_from_timestamp(timestamp=i['dob']) lecturerList.append(i) print len(lecturerList) return jsonify({'Statuscode':'200','Lecturers':lecturerList}) else: return jsonify({'Statuscode':'600', 'Message':'No result found'}) except Exception as e: return{'error' : str(e)} def delete(self): try: #parse the arguments for the delete request parser = reqparse.RequestParser() parser.add_argument('p_id', type=str, help='public_id of the lecturer') args = parser.parse_args() public_id = args['p_id'] #create cursor to get just one lecturer based on his public id data_lecturer_check = DatabaseReq().get_cursor(proc_name='spGetOneLecturer', mode='get', args=[public_id]) if (len(data_lecturer_check)>0): #create a cursor to delete the user based on his public_id data_lecturer_delete = DatabaseReq().get_cursor(proc_name='spDeleteOneLecturer', mode='del', args=[public_id]) if data_lecturer_delete=="success": return jsonify({'Statuscode':'200', 'Message':'Lecturer successfully deleted'}) else: return jsonify({'Statuscode':'700', 'Message':data_lecturer_delete}) else: return jsonify({'Statuscode':'600', 'Message':'No such user found'}) except Exception as e: return{'error': str(e)} class LecturerLoginResource(Resource): ''' Request for creating, updating, deleting and getting all information for the lecturers in the system ''' def post(self): #parse the arguments for the post request parser = reqparse.RequestParser() parser.add_argument('email', type=str, help='active email address') parser.add_argument('vcode', type=str, help='active vcode to use') args = parser.parse_args() #login info for the Lecturer args_login = [] args_login.append(args['email']) args_login.append(args['vcode']) #create cursor to get just one lecturer based on his public id data_all_lecturers = DatabaseReq().get_cursor(proc_name='spGetLecturerLogin', mode='postget', args=args_login) if (len(data_all_lecturers)>0): lecturerinfo = [] #use a for loop to iterate through the result for item in data_all_lecturers: if item[6] is 1: continue i = { 'surname':item[1], 'other_names':item[2], 'dob':item[3], 'phone':item[4], 'email':item[5], 'account_setup':item[7], 'public_id':item[8], 'vcode':item[9], 'Group_id':item[11], 'Department_name':item[14], } #change date of birth to readable format i['dob'] = get_date_from_timestamp(timestamp=i['dob']) lecturerinfo.append(i) return jsonify({'Statuscode':'200','Lecturer':lecturerinfo}) else: return jsonify({'Statuscode':'600', 'Message':'Authentication Failed ... No such user'}) def get(self): #this is a function that implements the token authentication when a user logs in # this gets the auth variables from the request .... auth = request.authorization if not auth or not auth.username or not auth.password: return jsonify({"message" : "Could not verify! Login required!", "Statuscode" : "401"}) #login info for the Lecturer args_login = auth.username #create cursor to get just one lecturer based on his public id data_one_lecturer = DatabaseReq().get_cursor(proc_name='spGetLecturerLogin2', mode='postget', args=[args_login]) if len(data_one_lecturer) > 0: lecturerinfo = [] hashed_vcode = "" #use a for loop to iterate through the result for item in data_one_lecturer: if item[6] is 1: continue i = { 'public_id':item[8], 'Group_id':item[11], 'Department_id':item[13], } lecturerinfo.append(i) hashed_vcode = item[9] if check_password_hash(hashed_vcode, auth.password): token_to_give = get_token_for_user(lecturerinfo[0]['public_id'], lecturerinfo[0]['Department_id'], typeAuth='lecturer') return jsonify({"Statuscode" : "200", "tokenObtained" : token_to_give}) return jsonify({"message" : "Could not verify! Login required!", "Statuscode" : "401"})
[ "cak.nartey@gmail.com" ]
cak.nartey@gmail.com
386a61ea077f264cdd7a36d12cd3aebae50c463d
305585c6e2e2f9d69603f728f8ac1dd38d12e63b
/plot.py
4c3271781150d2fdf7fffb86226e9e9bdab11755
[]
no_license
yingted/scribbler-commander
87d01e91426a2e2a7f20f8519922f3571d0710f3
5072feb6b8bc3126c92fedf2297ef6be72301376
refs/heads/master
2021-01-19T15:02:59.844424
2013-11-30T00:00:25
2013-11-30T00:00:25
32,125,465
0
0
null
null
null
null
UTF-8
Python
false
false
693
py
from pickle import load from matplotlib.pyplot import * from sys import argv from itertools import cycle from model import Prior with open(argv[1])as f: fig=figure() ax=fig.add_subplot(111) #clr=iter(cycle('bgrcmykw')) clr=iter(cycle('bgrcmyk')) for ent in sorted(load(f),key=lambda x:x['irp']): start=ent['data'][0]['t']*1.5-.5*ent['data'][1]['t'] t=[] v=[] for sample in ent['data']: t.append(sample['t']-start) v.append(sample['v']) ax.scatter(t,v,c=next(clr),marker='x') if len(argv)>2: with open(argv[2])as f: clr=iter(cycle('bgrcmyk')) for irp,ent in sorted(load(f).items()): ax.errorbar(Prior._times,ent['mu'],yerr=ent['sigma'],fmt='-o',c=next(clr)) show()
[ "yingted@gmail.com@2a0f7078-9aa0-a7c8-291c-ce4e4205d19b" ]
yingted@gmail.com@2a0f7078-9aa0-a7c8-291c-ce4e4205d19b
2e9d12a6e7190233efa49503cb1d489948f47589
451aa47b80ce89318d74113a1dfea781f79af441
/onsset/funcs.py
dc4b17a6dbbf24dd39c27c4307cd744e183e53e2
[ "MIT" ]
permissive
Somalia-Electrification-Platform/onsset
79f08d837aea9abde6e5956c56c78d6db27f31b2
64f05ce862e2918b17869da3534d35ef3a5b401a
refs/heads/Somalia
2023-03-30T23:54:43.831492
2021-03-23T10:42:17
2021-03-23T10:42:17
299,992,794
0
1
NOASSERTION
2021-03-22T10:19:37
2020-09-30T17:06:48
Python
UTF-8
Python
false
false
10,014
py
from onsset import * import matplotlib.pylab as plt import seaborn as sns def tech_specifications(discount_rate, grid_generation_cost, grid_power_plants_capital_cost, grid_losses, mg_hydro_capital_cost, sa_pv_capital_cost_1, sa_pv_capital_cost_2, sa_pv_capital_cost_3, sa_pv_capital_cost_4, sa_pv_capital_cost_5, sa_pv_life, hv_line_capacity, hv_line_cost, mv_line_cost, mv_line_capacity, lv_line_capacity, lv_line_cost, lv_line_max_length, distribution_losses, distribution_om, hv_mv_transformer_cost, mv_lv_transformer_cost, service_transformer_type, service_transformer_cost, max_nodes_per_serv_transformer, connection_cost_per_household, hydro_life, start_year, end_year): # Mini-grid hydro costs mg_hydro_calc = Technology(om_of_td_lines=distribution_om, distribution_losses=distribution_losses, connection_cost_per_hh=connection_cost_per_household, base_to_peak_load_ratio=0.85, capacity_factor=0.5, tech_life=hydro_life, capital_cost={float("inf"): mg_hydro_capital_cost}, om_costs=0.02, ) # Stand-alone PV costs sa_pv_calc = Technology(base_to_peak_load_ratio=0.9, tech_life=sa_pv_life, om_costs=0.075, capital_cost={float("inf"): sa_pv_capital_cost_5, 0.2: sa_pv_capital_cost_4, 0.08: sa_pv_capital_cost_3, 0.03: sa_pv_capital_cost_2, 0.006: sa_pv_capital_cost_1}, standalone=True ) mg_pv_hybrid_calc = Technology(om_of_td_lines=distribution_om, distribution_losses=distribution_losses, connection_cost_per_hh=connection_cost_per_household, capacity_factor=0.5, tech_life=30, mini_grid=True, hybrid=True) mg_wind_hybrid_calc = Technology(om_of_td_lines=distribution_om, distribution_losses=distribution_losses, connection_cost_per_hh=connection_cost_per_household, capacity_factor=0.5, tech_life=30, mini_grid=True, hybrid=True) Technology.set_default_values(base_year=start_year, start_year=start_year, end_year=end_year, discount_rate=discount_rate, hv_line_type=hv_line_capacity, hv_line_cost=hv_line_cost, mv_line_type=mv_line_capacity, mv_line_amperage_limit=8.0, mv_line_cost=mv_line_cost, lv_line_type=lv_line_capacity, lv_line_cost=lv_line_cost, lv_line_max_length=lv_line_max_length, service_transf_type=service_transformer_type, service_transf_cost=service_transformer_cost, max_nodes_per_serv_trans=max_nodes_per_serv_transformer, mv_lv_sub_station_cost=mv_lv_transformer_cost, mv_mv_sub_station_cost=mv_lv_transformer_cost, hv_lv_sub_station_cost=hv_mv_transformer_cost, hv_mv_sub_station_cost=hv_mv_transformer_cost) return mg_hydro_calc, sa_pv_calc, mg_pv_hybrid_calc, mg_wind_hybrid_calc def summary_table_calc(self, yearsofanalysis, option, intensification_dist): elements = [] for year in yearsofanalysis: elements.append("Population{}".format(year)) elements.append("NewConnections{}".format(year)) elements.append("Capacity{}".format(year)) elements.append("Investment{}".format(year)) if (option == 1) & (intensification_dist > 0): techs = ["Expanded_MG", "SA_PV", "MG_PV_Hybrid", "MG_Wind_Hybrid", "MG_Hydro"] codes = [2, 3, 8, 9, 7] else: techs = ["Grid", "SA_PV", "MG_PV_Hybrid", "MG_Wind_Hybrid", "MG_Hydro"] codes = [1, 3, 8, 9, 7] sumtechs = [] for year in yearsofanalysis: sumtechs.extend(["Population{}".format(year) + t for t in techs]) sumtechs.extend(["NewConnections{}".format(year) + t for t in techs]) sumtechs.extend(["Capacity{}".format(year) + t for t in techs]) sumtechs.extend(["Investment{}".format(year) + t for t in techs]) summary = pd.Series(index=sumtechs, name='country') for year in yearsofanalysis: code_index = 0 for t in techs: code = codes[code_index] code_index += 1 summary.loc["Population{}".format(year) + t] = self.loc[(self[SET_ELEC_FINAL_CODE + '{}'.format(year)] == code) & (self[SET_ELEC_FINAL_CODE + '{}'.format(year)] < 99), SET_POP + '{}'.format(year)].sum() / 1000000 summary.loc["NewConnections{}".format(year) + t] = self.loc[(self[SET_ELEC_FINAL_CODE + '{}'.format(year)] == code) & (self[SET_ELEC_FINAL_CODE + '{}'.format(year)] < 99), SET_NEW_CONNECTIONS + '{}'.format(year)].sum() /1000000 summary.loc["Capacity{}".format(year) + t] = self.loc[(self[SET_ELEC_FINAL_CODE + '{}'.format(year)] == code) & (self[SET_ELEC_FINAL_CODE + '{}'.format(year)] < 99), SET_NEW_CAPACITY + '{}'.format(year)].sum() / 1000 summary.loc["Investment{}".format(year) + t] = self.loc[(self[SET_ELEC_FINAL_CODE + '{}'.format(year)] == code) & (self[SET_ELEC_FINAL_CODE + '{}'.format(year)] < 99), SET_INVESTMENT_COST + '{}'.format(year)].sum() code += 1 index = techs + ['Total'] columns = [] for year in yearsofanalysis: columns.append("Population{} (Million)".format(year)) columns.append("NewConnections{} (Million)".format(year)) columns.append("Capacity{} (MW)".format(year)) columns.append("Investment{} (million USD)".format(year)) columns.append("NewConnectionsTotal (Million)") columns.append("CapacityTotal (MW)") columns.append("InvestmentTotal (million USD)") summary_table = pd.DataFrame(index=index, columns=columns) summary_table[columns[0]] = summary.iloc[0:5].tolist() + [summary.iloc[0:5].sum()] summary_table[columns[1]] = summary.iloc[5:10].tolist() + [summary.iloc[5:10].sum()] summary_table[columns[2]] = summary.iloc[10:15].tolist() + [summary.iloc[10:15].sum()] summary_table[columns[3]] = [round(x / 1e4) / 1e2 for x in summary.iloc[15:20].astype(float).tolist()] + [round(summary.iloc[15:20].sum() / 1e4) / 1e2] summary_table[columns[4]] = summary.iloc[20:25].tolist() + [summary.iloc[20:25].sum()] summary_table[columns[5]] = summary.iloc[25:30].tolist() + [summary.iloc[25:30].sum()] summary_table[columns[6]] = summary.iloc[30:35].tolist() + [summary.iloc[30:35].sum()] summary_table[columns[7]] = [round(x / 1e4) / 1e2 for x in summary.iloc[35:40].astype(float).tolist()] + [round(summary.iloc[35:40].sum() / 1e4) / 1e2] summary_table[columns[8]] = summary_table[columns[1]] + summary_table[columns[5]] summary_table[columns[9]] = summary_table[columns[2]] + summary_table[columns[6]] summary_table[columns[10]] = summary_table[columns[3]] + summary_table[columns[7]] return summary_table def summary_plots(summary_table, yearsofanalysis): colors = ['#73B2FF', '#FFD38C', '#FE5931', '#A56A56', '#00518E'] techs = ["Grid", "SA_PV", "MG_PV_Hybrid", "MG_Wind_Hybrid", "MG_Hydro"] techs_colors = dict(zip(techs, colors)) columns = [] for year in yearsofanalysis: columns.append("Population{} (Million)".format(year)) columns.append("NewConnections{} (Million)".format(year)) columns.append("Capacity{} (MW)".format(year)) columns.append("Investment{} (million USD)".format(year)) columns.append("NewConnectionsTotal (Million)") columns.append("CapacityTotal (MW)") columns.append("InvestmentTotal (million USD)") summary_plot = summary_table.drop(labels='Total', axis=0) fig_size = [15, 15] font_size = 8 plt.rcParams["figure.figsize"] = fig_size f, axarr = plt.subplots(2, 2) fig_size = [15, 15] font_size = 8 plt.rcParams["figure.figsize"] = fig_size sns.barplot(x=summary_plot.index.tolist(), y=columns[4], data=summary_plot, ax=axarr[0, 0], palette=colors) axarr[0, 0].set_ylabel(columns[4], fontsize=2 * font_size) axarr[0, 0].tick_params(labelsize=font_size) sns.barplot(x=summary_plot.index.tolist(), y=columns[8], data=summary_plot, ax=axarr[0, 1], palette=colors) axarr[0, 1].set_ylabel(columns[5], fontsize=2 * font_size) axarr[0, 1].tick_params(labelsize=font_size) sns.barplot(x=summary_plot.index.tolist(), y=columns[9], data=summary_plot, ax=axarr[1, 0], palette=colors) axarr[1, 0].set_ylabel(columns[6], fontsize=2 * font_size) axarr[1, 0].tick_params(labelsize=font_size) sns.barplot(x=summary_plot.index.tolist(), y=columns[10], data=summary_plot, ax=axarr[1, 1], palette=colors) axarr[1, 1].set_ylabel(columns[7], fontsize=2 * font_size) axarr[1, 1].tick_params(labelsize=font_size) return summary_plot
[ "asahl@UG.KTH.SE" ]
asahl@UG.KTH.SE
e1a5744f6ecf92c626944827d21bdcfcd422a518
d76d9b9498d028755d7b2b04482ba8c79cb339eb
/Python-Challenge/PyPoll/main.py
7ab4c7286bad50ea051f1f044584493c76ae662b
[]
no_license
JonZagorski/Python-Challenge-
9332f2a1bb4dcc89da4ee6938a3a931ca0e0688a
53080cd5d97d67b9b6cfe351cb4293a3e6a7b499
refs/heads/master
2022-12-01T11:57:44.328423
2020-08-16T04:13:47
2020-08-16T04:13:47
286,357,194
0
0
null
null
null
null
UTF-8
Python
false
false
2,918
py
#import the important things import os import csv #variables to store values go here totalvotes = 0 number_votes = 0 #make a list to store candidates candidates = [] #make list for vote counts vote_counts =[] #set the path to election_data election_data = os.path.join("resources","election_data.csv") #open election_data with open(election_data, newline='', encoding= 'utf-8') as csvfile: #read csvfile election_csvreader = csv.reader(csvfile,delimiter=',') #skip header line next(election_csvreader, None) #start for loop for row in election_csvreader: #count the total rows totalvotes += 1 #set candidate list with row[2] values candidate = row[2] #add the votes to candidates if candidate in candidates: candidate_index = candidates.index(candidate) vote_counts[candidate_index] = vote_counts[candidate_index] + 1 #add each candidate to the list else: candidates.append(candidate) vote_counts.append(1) pct = [] max_votes = vote_counts[0] max_index = 0 for x in range(len(candidates)): #calculation to get the percentage, x is the looper value vote_pct = round(vote_counts[x]/totalvotes*100, 2) pct.append(vote_pct) if vote_counts[x] > max_votes: max_votes = vote_counts[x] max_index = x winner = candidates[max_index] #Test the variables #print(totalvotes) #print(candidates) #print(vote_counts) #print(max_votes) #print(election_winner) print('======================================================') print('| Election Results |') print('======================================================') print(f'Total Votes: {totalvotes}') print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') for x in range(len(candidates)): print(f'{candidates[x]} : {pct[x]}% ({vote_counts[x]})') print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') print(f'Election winner: {winner.upper()}') print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') #Export file name and open as text file output_file = os.path.join("election_results.txt") with open(output_file, "w", newline="") as datafile: # Write results to export text file datafile.write("Election Results\n") datafile.write("-----------------------------\n") datafile.write(f"Total Votes: {number_votes}\n") datafile.write("-----------------------------\n") for count in range(len(candidates)): datafile.write(f"{candidates[count]}: {pct[count]}% ({vote_counts[count]})\n") datafile.write("-----------------------------\n") datafile.write(f"Winner: {winner}\n") datafile.write("-----------------------------\n")
[ "noreply@github.com" ]
noreply@github.com
fd56c339b78756507aae6c9ee5d01037b3f502bb
ba46763cf8ecd8eb22b8e6033ed68b5a5b2f2395
/cross-section/read_XSfb_from_data.py
45fad680282e2669183648f263787d8463aba17e
[]
no_license
kazuki-sakurai/LHC_recast
92c224f8e27d646675f0faf6d768dded026d88ef
66bac802d0fe15312177d4143e85758e12212425
refs/heads/master
2021-01-09T05:50:26.708261
2017-11-17T16:29:56
2017-11-17T16:29:56
80,840,370
2
1
null
2019-03-14T14:32:18
2017-02-03T15:14:29
Python
UTF-8
Python
false
false
1,906
py
#!/usr/bin/env python import sys, os import numpy as np from scipy import interpolate def get_xsfb(infile, m_in, unit): if unit == 'pb': fac = 1000. if unit == 'fb': fac = 1. dirname = os.path.dirname(__file__) infile_path = os.path.join(dirname, infile) data = np.loadtxt(infile_path) try: mass_ar, xspb_ar = np.transpose(data) except: mass_ar, xspb_ar, dummy = np.transpose(data) xspb_data = interpolate.interp1d(mass_ar, xspb_ar) xspb = xspb_data(m_in) xsfb = xspb * fac return xsfb try: mode = sys.argv[1] m_in = float(sys.argv[2]) rs = int(sys.argv[3]) br = float(sys.argv[4]) except: print '[mode] [mass] [energy] [BR]' if mode in ['QqN1']: mode = 'QQ4F' if mode in ['GqqN1', 'GttN1', 'GbbN1', 'GqqN2lLlN1', 'GqqC1wN1', 'GqqC1wN2zN1']: mode = 'GG' if mode in ['C1lLlN1_C1lLlN1', 'C1lL3lN1_C1lL3lN1']: mode = 'C1C1wino' if mode in ['C1lLlN1_N2lLlN1', 'C1lL3lN1_N2lL3lN1', 'C1whadN1_N2zlepN1', 'C1wlepN1_N2zlepN1']: mode = 'C1N2wino' if mode in ['B1tC1wN1', 'B1bN1', 'T1bC1wN1']: mode = 'Q3Q3' GG_file = 'GGxsec{rs}.dat'.format(rs=rs) QQ5F_file = 'QQxsec{rs}_5F.dat'.format(rs=rs) Q3Q3_file = 'Q3Q3xsec{rs}.dat'.format(rs=rs) C1C1_file = 'C1C1wino{rs}.dat'.format(rs=rs) C1N2_file = 'C1N2wino{rs}.dat'.format(rs=rs) if mode == 'GG': print get_xsfb(GG_file, m_in, 'pb') * br exit() if mode == 'QQ5F': print get_xsfb(QQ5F_file, m_in, 'pb') * br exit() if mode == 'Q3Q3': print get_xsfb(Q3Q3_file, m_in, 'pb') * br exit() if mode == 'QQ4F': QQ5F = get_xsfb(QQ5F_file, m_in, 'pb') BLBL = BRBR = get_xsfb(Q3Q3_file, m_in, 'pb') QQ4F = QQ5F - BLBL - BRBR print QQ4F * br exit() if mode == 'C1C1wino': print get_xsfb(C1C1_file, m_in, 'fb') * br exit() if mode == 'C1N2wino': print get_xsfb(C1N2_file, m_in, 'fb') * br exit()
[ "kazuki.sakurai.1225@gmail.com" ]
kazuki.sakurai.1225@gmail.com
19e8f21141951d921204abcb75ae7fa31b3ef394
4d547798e619238c13dc5cf7c82e7f7ff2451c1c
/DjangoSunucu/Proje/Sunucu/models.py
986ee05fdf47264d351d88dc101826a60916dc2a
[]
no_license
emogooo/Buyukbas-Android-IOS-Uygulamasinin-Sunucusu
c845224275dcdba712411a009725a90331360e3a
5daf911c597c5fe437cc7fb02720e4d3253f54f3
refs/heads/master
2022-12-08T03:08:43.938063
2020-09-04T12:24:24
2020-09-04T12:24:24
292,840,524
0
0
null
null
null
null
UTF-8
Python
false
false
3,593
py
from django.db import models """ from django.db.models import signals from django.dispatch import receiver from django.db.models.signals import pre_save """ class Asi(models.Model): ad = models.CharField(max_length=30) aciklama = models.CharField(max_length=200) def __str__(self): return self.ad class CikisSebebi(models.Model): ad = models.CharField(max_length=30) def __str__(self): return self.ad class Isletme(models.Model): ad = models.CharField(max_length=30) def __str__(self): return self.ad class Cinsiyet(models.Model): ad = models.CharField(max_length=30) def __str__(self): return self.ad class Irk(models.Model): ad = models.CharField(max_length=30) def __str__(self): return self.ad class Pazarlikci(models.Model): ad = models.CharField(max_length=30) soyad = models.CharField(max_length=30) telefon = models.CharField(max_length=11) adres = models.CharField(max_length=70) def __str__(self): return self.ad + " " + self.soyad class AlisBilgisi(models.Model): fiyatTL = models.PositiveSmallIntegerField() tarih = models.DateField(auto_now=False, auto_now_add=False) kilo = models.PositiveSmallIntegerField() pazarlikci = models.ForeignKey(Pazarlikci, on_delete=models.CASCADE) def __str__(self): return str(self.fiyatTL) + " " + str(self.kilo) + " " + str(self.tarih) + " " + str(self.pazarlikci) class Hayvan(models.Model): kupeNo = models.CharField(max_length=10) padokNo = models.CharField(max_length=10) aciklama = models.CharField(max_length=200) aktif = models.BooleanField(default=True) alisBilgisi = models.ForeignKey(AlisBilgisi, on_delete=models.CASCADE) irk = models.ForeignKey(Irk, on_delete=models.CASCADE) cinsiyet = models.ForeignKey(Cinsiyet, on_delete=models.CASCADE) isletme = models.ForeignKey(Isletme, on_delete=models.CASCADE) def __str__(self): return str(self.kupeNo) class AsiBilgi(models.Model): hayvan = models.ForeignKey(Hayvan, on_delete=models.CASCADE) asi = models.ForeignKey(Asi, on_delete=models.CASCADE) tarih = models.DateField(auto_now=False, auto_now_add=False) def __str__(self): return str(self.hayvan) + " " +str(self.asi) class Cikis(models.Model): sebep = models.ForeignKey(CikisSebebi, on_delete=models.CASCADE) hayvan = models.ForeignKey(Hayvan, on_delete=models.CASCADE) tarih = models.DateField(auto_now=False, auto_now_add=False) def __str__(self): return str(self.hayvan) + " " + str(self.sebep) class Ticaret(models.Model): cikis = models.ForeignKey(Cikis, on_delete=models.CASCADE) musteri = models.ForeignKey(Pazarlikci, on_delete=models.CASCADE) fiyatTL = models.PositiveSmallIntegerField() tarih = models.DateField(auto_now=False, auto_now_add=False) def __str__(self): return str(self.musteri) + " " + str(self.cikis) + " " + str(self.fiyatTL) class EskiKupeNo(models.Model): hayvan = models.ForeignKey(Hayvan, on_delete=models.CASCADE) eskiKupe = models.CharField(max_length=10) yeniKupe = models.CharField(max_length=10) tarih = models.DateField(auto_now=False, auto_now_add=False) def __str__(self): return str(self.hayvan) + " " + str(self.eskiKupe) + " " + str(self.yeniKupe) """ @receiver(signals.pre_save, sender=Hayvan) def createOrUpdate(sender, instance, **kwargs): if kwargs['created']: print('created') else: print('updated') pre_save.connect(createOrUpdate, sender=Hayvan) """
[ "58745898+emogooo@users.noreply.github.com" ]
58745898+emogooo@users.noreply.github.com
31796965335c361024f29cf5de2c18699d806d6e
0f2d3fca1ef0d59f5276b2e1e1af7b02c225917b
/tests/test_visualiser.py
827a2853bb3584bb13a1ba442160337714b47305
[]
no_license
breakingflower/door2door_mi_challenge
4f3f47b8cfae91d2684a85df7956f1b201cec36f
450f1ba9a0d281ca418da8d256da329db31a102f
refs/heads/master
2023-04-13T23:34:06.637892
2020-09-28T20:15:38
2020-09-28T20:15:38
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,225
py
################################################################### # Script Name : "TEST_VISUALISER.PY" # Description : Tests for the visualiser/visualiser.py file # Args : # Author : Floris Remmen # Email : floris.remmen@gmail.com # Date : "28 September 2020" ################################################################### import unittest from visualiser.visualiser import Visualiser from utilities.bounding_box import BoundingBox from utilities.staticdatareader import StaticDataReader from simulator.simulator import Simulator import warnings from os.path import isfile class TestVisualiser(unittest.TestCase): """ Testcase for the Visualiser Class """ @classmethod def setUpClass(self): """ Sets up the class. The data only has to be read in once, so this is done in the class setup method. """ # TODO: Remove warn ngs filter when migrating to geopandas > 0.7.0 ! warnings.simplefilter('ignore', category=FutureWarning) warnings.simplefilter('ignore', category=DeprecationWarning) static_data = StaticDataReader( 'data/berlin_bounds.poly', 'data/berlin_stops.geojson' ) bounding_box_tuple = ( 13.34014892578125, 52.52791908000258, 13.506317138671875, 52.562995039558004 ) simulator = Simulator( bounding_box = bounding_box_tuple ) simulation_results = simulator.simulate(number_of_requests=6) self.visualiser = Visualiser( bounding_box = BoundingBox(bounding_box_tuple), simulation_results = simulation_results, static_data= static_data, static_path = 'webapp/static' ) def setUp(self): pass def test_generate_overview_figure(self): """ Asserts a overview figure is generated after calling the function. """ self.visualiser.generate_overview_figure() self.assertTrue( isfile(f"{self.visualiser.static_path}/{self.visualiser.id}_overview_plot.png") ) def test_generate_closeup_figure(self): """ Asserts a closeup figure is generated after calling the function. """ self.visualiser.generate_closeup_figure() self.assertTrue( isfile(f"{self.visualiser.static_path}/{self.visualiser.id}_closeup_plot.png") ) def test_generate_gmap(self): """ Asserts a html map is generated after calling the function. """ self.visualiser.generate_gmap() self.assertTrue( isfile(f"{self.visualiser.static_path}/{self.visualiser.id}_map.html") ) def tearDown(self): pass if __name__ == "__main__": unittest.main()
[ "floris.remmen@gmail.com" ]
floris.remmen@gmail.com
ad8896eded98ca8dd1abc0c510565e4fa348ab17
0481ecb46752eea02bbeedbf3ded92c8a6acdc18
/httprunner_yaosansan/loader.py
074eb4c8d28c8807ab0e0dee4263ceae0199942d
[]
no_license
whitexie/workwechat-interface
e5d2dae39c7b8569e60d461db09602c8fd273c81
145e431bd65351d9244ffa6e1e747809990004be
refs/heads/master
2020-09-07T13:54:47.376186
2019-11-12T04:12:32
2019-11-12T04:12:32
220,801,763
0
0
null
null
null
null
UTF-8
Python
false
false
258
py
import yaml def load_yaml(yaml_file_path): """ read yaml file :param yaml_file_path: str :return: """ with open(yaml_file_path, 'r') as f: json_object = yaml.load(f.read(), Loader=yaml.FullLoader) return json_object
[ "shieber@163.com" ]
shieber@163.com
875f0277e8f0a1d890f62156d1ff2f9287f22dc2
508fd86b80959df7289f49c90c67b5da5b42d440
/bin_to_dec_oct_hex.py
9f57df283a83f6237be5262c92c546e0e8ab4815
[]
no_license
habeebahmed/challenges
ea02e56fdf6cfbf702c6e4dfc2606e71250da5ac
b163ed0707364e472db9ef5c1b54975572fd2e19
refs/heads/master
2022-09-17T21:38:46.413225
2022-07-31T23:01:25
2022-07-31T23:01:25
225,154,386
1
0
null
null
null
null
UTF-8
Python
false
false
2,906
py
''' Online Python Compiler. Code, Compile, Run and Debug python program online. Write your code in this editor and press "Run" button to execute it. ''' # print("Hello World") # b_num = list(input("Input a binary number: ")) # value = 0 # for i in range(len(b_num)): # digit = b_num.pop() # if digit == '1': # value = value + pow(2, i) # print("The decimal value of the number is", value) import math import os import random import re import sys # # Complete the 'binary_converter' function below. # # The function is expected to return a STRING. # The function accepts following parameters: # 1. INTEGER_ARRAY binary # 2. CHARACTER base # def getOctal(binArray): i = 0 ocatalArray = [0] * 32 pos = 0 count = 1 ocatalDigit = 0 lengthOfBinList = len(str(binArray)) while int(binArray)!=0: digit = binArray % 10 ocatalDigit += digit * pow(2,i) binArray = int (binArray / 10) i += 1 ocatalArray[pos] = ocatalDigit if count % 3 == 0 or lengthOfBinList == count: ocatalDigit = 0 i = 0 pos += 1 count += 1 newArray = ocatalArray[:pos] newArray.reverse() return newArray # 16 - 8 4 2 1 # 0-9 A B C D E F def getHexa(binArray): i = 0 hexArray = [0] * 32 pos = 0 count = 1 hexDigit = 0 lengthOfBinList = len(str(binArray)) hexaObj = { 10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F' } while int(binArray) != 0: digit = binArray % 10 hexDigit += digit * pow(2,i) binArray = int (binArray / 10) i += 1 hexArray[pos] = hexDigit if count%4 == 0 or lengthOfBinList == count: if hexDigit > 9: hexArray[pos] = hexaObj[hexDigit] i = 0 hexDigit = 0 pos +=1 count +=1 newArray = hexArray[:pos] newArray.reverse() return newArray def binary_converter(binary,base = 'd'): print(binary, base) value = 0 if base == 'b': return "".join(map(str, binary)).lstrip('0') elif base == 'o': octalArray = getOctal(int("".join(map(str, binary)).lstrip('0'))) return "".join(map(str, octalArray)) elif base == 'h': hexArray = getHexa(int("".join(map(str, binary)).lstrip('0'))) return "".join(map(str, hexArray)) else: for i in range(len(binary)): digit = binary.pop() if digit == 1: value = value + pow(2, i) print(value) return value # fptr = open(os.environ['OUTPUT_PATH'], 'w') binary = [1,1,1,1,1,1,0,1] try: base = 'h' result = binary_converter(binary, base) except: result = binary_converter(binary) print("value", result) # fptr.write(result + '\n') # fptr.close()
[ "habeebahmed@Habeebs-MacBook-Pro.local" ]
habeebahmed@Habeebs-MacBook-Pro.local
d0b5c3f8d6c7520c4bec6204a5f3d9ed7fbba332
f1a6e9228ee3a66a2b878b85ee6e6b5d6ac9ddfa
/gallery/wsgi.py
0276e4ba6c10865c3587a5b1d6d76a8c445f3cd2
[ "MIT" ]
permissive
Doktatech/Gallery
499f0b645d6f9e74d7f16a688ea8a62d331f03d8
7916ce6e38c80817554b1d02f7886f7b1ee759f7
refs/heads/master
2021-09-09T11:54:25.624827
2019-06-17T13:03:13
2019-06-17T13:03:13
191,943,755
0
0
null
2021-09-08T01:04:47
2019-06-14T13:00:27
Python
UTF-8
Python
false
false
394
py
""" WSGI config for gallery project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gallery.settings") application = get_wsgi_application()
[ "Doktatech2@gmail.com" ]
Doktatech2@gmail.com
ff3b79306b579ddcb48b552d769e092672abe3e5
ec2937329e810741c768f421b1f143dcc23e0431
/testapp/models.py
12fef266b580d5f71d6528cf84549bf78a0ff17a
[]
no_license
kaushikdobariya777/dk_lms
fdc0ebf09980f029f4072756ee5a82e07e3506fc
d26eb169d990a3eeea5d8e56be8dd44dcd13e76c
refs/heads/master
2023-07-19T17:08:55.287103
2021-08-26T03:31:43
2021-08-26T03:31:43
400,028,560
0
0
null
null
null
null
UTF-8
Python
false
false
252
py
from django.db import models class Employee(models.Model): eno=models.IntegerField() ename=models.CharField(max_length=30) esal=models.FloatField() eaddr=models.CharField(max_length=60) def __str__(self): return self.ename
[ "kaus.patel777@gmail.com" ]
kaus.patel777@gmail.com
c9a604456c34d29080c08177efe61aef1e31a260
55cdb125dcff042f59798253ec63ee021755a01b
/cookie-Token/models.py
ac280672d77adad609d5c9fc3d8182ec488781df
[]
no_license
chaojixiaoyao/python-rear_end
5b547548a57109ce4f067a9a140288af96388ba3
3c05d2d92948780ac8bd91d3bead05fb08900c38
refs/heads/master
2020-05-15T13:14:14.848573
2019-05-16T10:02:47
2019-05-16T10:02:47
182,291,566
1
0
null
null
null
null
UTF-8
Python
false
false
5,641
py
import json def save(data, path): """ data ๆ˜ฏ dict ๆˆ–่€… list path ๆ˜ฏไฟๅญ˜ๆ–‡ไปถ็š„่ทฏๅพ„ """ s = json.dumps(data, indent=2, ensure_ascii=False) with open(path, 'w+', encoding='utf-8') as f: f.write(s) def load(path): with open(path, 'r', encoding='utf-8') as f: s = f.read() return json.loads(s) class Model(object): """ Model ๆ˜ฏๆ‰€ๆœ‰ model ็š„ๅŸบ็ฑป @classmethod ๆ˜ฏไธ€ไธชๅฅ—่ทฏ็”จๆณ• ไพ‹ๅฆ‚ user = User() user.db_path() ่ฟ”ๅ›ž User.txt """ @classmethod def db_path(cls): """ cls ๆ˜ฏ็ฑปๅ, ่ฐ่ฐƒ็”จ็š„็ฑปๅๅฐฑๆ˜ฏ่ฐ็š„ classmethod ๆœ‰ไธ€ไธชๅ‚ๆ•ฐๆ˜ฏ class(่ฟ™้‡Œๆˆ‘ไปฌ็”จ cls ่ฟ™ไธชๅๅญ—) ๆ‰€ไปฅๆˆ‘ไปฌๅฏไปฅๅพ—ๅˆฐ class ็š„ๅๅญ— """ classname = cls.__name__ path = '{}.txt'.format(classname) return path @classmethod def all(cls): """ all ๆ–นๆณ•(็ฑป้‡Œ้ข็š„ๅ‡ฝๆ•ฐๅซๆ–นๆณ•)ไฝฟ็”จ load ๅ‡ฝๆ•ฐๅพ—ๅˆฐๆ‰€ๆœ‰็š„ models """ path = cls.db_path() models = load(path) # ่ฟ™้‡Œ็”จไบ†ๅˆ—่กจๆŽจๅฏผ็”Ÿๆˆไธ€ไธชๅŒ…ๅซๆ‰€ๆœ‰ ๅฎžไพ‹ ็š„ list # m ๆ˜ฏ dict, ็”จ cls.new(m) ๅฏไปฅๅˆๅง‹ๅŒ–ไธ€ไธช cls ็š„ๅฎžไพ‹ # ไธๆ˜Ž็™ฝๅฐฑ log ๅคงๆณ•็œ‹็œ‹่ฟ™ไบ›้ƒฝๆ˜ฏๅ•ฅ ms = [cls.new(m) for m in models] return ms @classmethod def new(cls, form): m = cls(form) return m @classmethod def find_by(cls, **kwargs): """ ็”จๆณ•ๅฆ‚ไธ‹๏ผŒkwargs ๆ˜ฏๅชๆœ‰ไธ€ไธชๅ…ƒ็ด ็š„ dict u = User.find_by(username='gua') """ k, v = '', '' for key, value in kwargs.items(): k, v = key, value all = cls.all() for m in all: # getattr(m, k) ็ญ‰ไปทไบŽ m.__dict__[k] if v == m.__dict__[k]: return m return None @classmethod def find_all(cls, **kwargs): """ ็”จๆณ•ๅฆ‚ไธ‹๏ผŒkwargs ๆ˜ฏๅชๆœ‰ไธ€ไธชๅ…ƒ็ด ็š„ dict u = User.find_by(username='gua') """ k, v = '', '' for key, value in kwargs.items(): k, v = key, value all = cls.all() data = [] for m in all: # getattr(m, k) ็ญ‰ไปทไบŽ m.__dict__[k] if v == m.__dict__[k]: data.append(m) return data def __repr__(self): """ __repr__ ๆ˜ฏไธ€ไธช้ญ”ๆณ•ๆ–นๆณ• ็ฎ€ๅ•ๆฅ่ฏด, ๅฎƒ็š„ไฝœ็”จๆ˜ฏๅพ—ๅˆฐ็ฑป็š„ ๅญ—็ฌฆไธฒ่กจ่พพ ๅฝขๅผ ๆฏ”ๅฆ‚ print(u) ๅฎž้™…ไธŠๆ˜ฏ print(u.__repr__()) """ classname = self.__class__.__name__ properties = ['{}: ({})'.format(k, v) for k, v in self.__dict__.items()] s = '\n'.join(properties) return '< {}\n{} >\n'.format(classname, s) def save(self): """ ็”จ all ๆ–นๆณ•่ฏปๅ–ๆ–‡ไปถไธญ็š„ๆ‰€ๆœ‰ model ๅนถ็”Ÿๆˆไธ€ไธช list ๆŠŠ self ๆทปๅŠ ่ฟ›ๅŽปๅนถไธ”ไฟๅญ˜่ฟ›ๆ–‡ไปถ """ models = self.all() first_index = 0 if self.__dict__.get('id') is None: # ๅŠ ไธŠ id if len(models) > 3: # ไธๆ˜ฏ็ฌฌไธ€ไธชๆ•ฐๆฎ self.id = models[-1].id + 1 else: # ๆ˜ฏ็ฌฌไธ€ไธชๆ•ฐๆฎ self.id = first_index models.append(self) else: # ๆœ‰ id ่ฏดๆ˜Žๅทฒ็ปๆ˜ฏๅญ˜ๅœจไบŽๆ•ฐๆฎๆ–‡ไปถไธญ็š„ๆ•ฐๆฎ # ้‚ฃไนˆๅฐฑๆ‰พๅˆฐ่ฟ™ๆกๆ•ฐๆฎๅนถๆ›ฟๆขไน‹ index = -1 for i, m in enumerate(models): if m.id == self.id: index = i break # ็œ‹็œ‹ๆ˜ฏๅฆๆ‰พๅˆฐไธ‹ๆ ‡ # ๅฆ‚ๆžœๆ‰พๅˆฐ๏ผŒๅฐฑๆ›ฟๆขๆމ่ฟ™ๆกๆ•ฐๆฎ if index > -1: models[index] = self # ไฟๅญ˜ l = [m.__dict__ for m in models] path = self.db_path() save(l, path) class User(Model): """ User ๆ˜ฏไธ€ไธชไฟๅญ˜็”จๆˆทๆ•ฐๆฎ็š„ model ็Žฐๅœจๅชๆœ‰ไธคไธชๅฑžๆ€ง username ๅ’Œ password """ def __init__(self, form): self.id = form.get('id', None) if self.id is not None: self.id = int(self.id) self.username = form.get('username', '') self.password = form.get('password', '') def validate_login(self): # return self.username == 'gua' and self.password == '123' u = User.find_by(username=self.username) # us = User.all() # for u in us: # if u.username == self.username and u.password == self.password: # return True # return False return u is not None and u.password == self.password # ่ฟ™ๆ ท็š„ไปฃ็ ๆ˜ฏไธๅฅฝ็š„๏ผŒไธๅบ”่ฏฅ็”จ้šๅผ่ฝฌๆข # return u and u.password == self.password """ 0 None '' """ def validate_register(self): return len(self.username) > 2 and len(self.password) > 2 class Message(Model): """ Message ๆ˜ฏ็”จๆฅไฟๅญ˜็•™่จ€็š„ model """ def __init__(self, form): self.author = form.get('author', '') self.message = form.get('message', '') def test(): # users = User.all() # u = User.find_by(username='gua') form = dict( username='gua', password='gua', ) u = User(form) u.save() # u.save() # u.save() # u.save() # u.save() # u.save() # u = User.find_by(id=1) # u.username = '็“œ' # u.save() if __name__ == '__main__': test()
[ "noreply@github.com" ]
noreply@github.com
4c4e27e45b34e9331a3ec84ac79cfdf43b698848
f2543f7266cc6f6bebee3d14081daaa676a6f80a
/tensorflow_federated/python/research/optimization/emnist_ae/dataset_test.py
aa4b7a71a5ea7055bce4f6d2649dd8c65cb6a93a
[ "Apache-2.0" ]
permissive
matech96/federated
d497d24e64399f6b1da673a8457e88a18bc29473
b30a26d66162bd02a89a12f119e17925d161a26b
refs/heads/master
2022-11-12T10:20:34.483506
2020-06-11T21:13:02
2020-06-11T21:13:30
271,650,529
0
0
Apache-2.0
2020-06-11T21:31:51
2020-06-11T21:31:50
null
UTF-8
Python
false
false
1,962
py
# Copyright 2019, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import tensorflow as tf from tensorflow_federated.python.research.optimization.emnist_ae import dataset TEST_BATCH_SIZE = dataset.TEST_BATCH_SIZE class DatasetTest(tf.test.TestCase): def test_emnist_dataset_structure(self): emnist_train, emnist_test = dataset.get_emnist_datasets( client_batch_size=10, client_epochs_per_round=1, only_digits=True) self.assertEqual(len(emnist_train.client_ids), 3383) sample_train_ds = emnist_train.create_tf_dataset_for_client( emnist_train.client_ids[0]) train_batch = next(iter(sample_train_ds)) train_batch_shape = train_batch[0].shape test_batch = next(iter(emnist_test)) test_batch_shape = test_batch[0].shape self.assertEqual(train_batch_shape.as_list(), [10, 28*28]) self.assertEqual(test_batch_shape.as_list(), [TEST_BATCH_SIZE, 28*28]) def test_global_emnist_dataset_structure(self): global_train, global_test = dataset.get_centralized_emnist_datasets( batch_size=32, only_digits=False) train_batch = next(iter(global_train)) train_batch_shape = train_batch[0].shape test_batch = next(iter(global_test)) test_batch_shape = test_batch[0].shape self.assertEqual(train_batch_shape.as_list(), [32, 28*28]) self.assertEqual(test_batch_shape.as_list(), [TEST_BATCH_SIZE, 28*28]) if __name__ == '__main__': tf.test.main()
[ "tensorflow.copybara@gmail.com" ]
tensorflow.copybara@gmail.com
64ee037a348f62ede96c0c96f074d48d1350d374
6b5c6d0258833d706cbcedc4499879bef659aeb4
/tools/__init__.py
f5161f39b10fef2058eefc05f340a0aebcc33120
[]
no_license
udjenweb/online_courses
ce80474a11d2dbb7c45e34597dd2ce79e6462074
515307de0ce3997610b150f361f88600fc8799bd
refs/heads/master
2021-01-21T20:38:50.688646
2017-05-24T08:18:00
2017-05-24T08:18:00
92,264,065
0
0
null
null
null
null
UTF-8
Python
false
false
423
py
# coding: utf-8 from .eve.eve_sqlalchemy_fix import EveSQLAlchemy from .eve.domains import Domains from .aditional.current_object import CurrentObject from .http.response_standard_json import ( response_data_error, response_data_success, ) from .aditional.console import draw from .aditional.loggingconf import ( LOGGING_CONF_DEFAULT, FORMAT_DEFAULT, create_file_handler, create_console_handler, )
[ "udjen.web@gmail.com" ]
udjen.web@gmail.com
7f824ee40e811bbb0b10b06bebe9de412a97a178
65e07d1e35598e5686e743e9bdefcdd5e1269a0d
/archiveit_redirect.py
51440f3afb3374425033df8ef6d544f7754a5e5a
[]
no_license
ale-gaeta/bentley_scripts
94dbf3e120c218ec0af8ed235bc304ca45b3518e
2ad4b986212715a495036697d78952dc53dad74c
refs/heads/master
2023-03-15T14:12:12.595590
2016-06-30T19:02:55
2016-06-30T19:02:55
null
0
0
null
null
null
null
UTF-8
Python
false
false
6,501
py
import os from os.path import join import requests from lxml import etree import csv import re import HTMLParser def get_redirect_metadata(redirect_dict, collection_id, redirect_dir): skip = ['createdDate','lastUpdatedDate','active','public','note','url'] starting_seeds = {} for seed in redirect_dict: starting_seeds[seed] = '' with requests.Session() as s: collection_feed = s.get('https://partner.archive-it.org/seam/resource/collectionFeed?accountId=934&collectionId=' + collection_id) collection_metadata = etree.fromstring(collection_feed.text.encode('utf-8')) tree = etree.ElementTree(collection_metadata) seeds = tree.xpath('//seed') for seed in seeds: url = seed.xpath('./url')[0].text if url in starting_seeds: starting_seeds[url] = tree.getpath(seed) redirect_metadata = [] add_deactivate = {} redirect_investigate = {} entity_parser = HTMLParser.HTMLParser() for seed in starting_seeds: if len(starting_seeds[seed]) > 0: new_seed = redirect_dict[seed] add_deactivate[seed] = new_seed seed_metadata = {} seed_path = starting_seeds[seed] seed_element = tree.xpath(seed_path)[0] for elem in seed_element.xpath('.//*'): if elem.text is not None and not elem.tag in skip and not 'name' in elem.attrib: elem_name = elem.tag elem_text = entity_parser.unescape(elem.text.replace('&#8220;','"').replace('&#8221;','"').replace('&#8217;',"'")) if elem_name not in seed_metadata: seed_metadata[elem_name] = [] seed_metadata[elem_name].append(elem_text.encode('utf-8')) elif 'name' in elem.attrib: if elem.attrib['name'] not in skip: elem_name = elem.attrib['name'] elem_text = entity_parser.unescape(elem.text.replace('&#8220;','"').replace('&#8221;','"').replace('&#8217;',"'")) if elem_name not in seed_metadata: seed_metadata[elem_name] = [] seed_metadata[elem_name].append(elem_text.encode('utf-8')) seed_metadata['url'] = [] seed_metadata['url'].append(new_seed) seed_metadata['Note'] = [] seed_metadata['Note'].append("QA NOTE: This seed was created as a result of the previous seed URL redirecting to this URL. Previous captures under seed URL " + seed) redirect_metadata.append(seed_metadata) else: redirect_investigate[seed] = redirect_dict[seed] with open(join(redirect_dir,'add_and_deactivate.csv'),'ab') as add_deactivate_csv: writer = csv.writer(add_deactivate_csv) writer.writerow(['Add','Deactivate','Deactivation Note']) for seed, new_seed in add_deactivate.items(): writer.writerow([new_seed, seed, 'QA NOTE: Seed deactivated. Seed URL redirects to ' + new_seed + '. A new seed with the redirected seed URL has been added.']) if len(redirect_investigate) > 0: with open(join(redirect_dir,'redirect_investigate.csv'),'ab') as investigate_csv: writer = csv.writer(investigate_csv) writer.writerow(['Seed URL','Redirect URL']) for seed, new_seed in redirect_investigate.items(): writer.writerow([seed, new_seed]) header_order = ['url','Title','Subject','Personal Creator','Corporate Creator','Coverage','Description','Publisher','Note'] redirect_csv = join(redirect_dir,'redirect_metadata.csv') header_counts = {} for seed in redirect_metadata: for element in seed: count = len(seed[element]) elem_lower = element.lower() if element not in header_counts: header_counts[element] = count elif count > header_counts[element]: header_counts[element] = count for element in header_order: elem_lower = element.lower() if element not in header_counts and elem_lower not in header_counts: header_counts[element] = 1 for seed in redirect_metadata: for element in header_counts: if element not in seed: seed[element] = [] for element in seed: current_count = len(seed[element]) header_count = header_counts[element] difference = header_count - current_count if difference > 0: seed[element].extend([''] * difference) header_row = [] header_counts_lower = {k.lower():v for k,v in header_counts.items()} for element in header_order: elem_lower = element.lower() header_row.extend([element] * header_counts_lower[elem_lower]) with open(redirect_csv,'ab') as csvfile: writer = csv.writer(csvfile) writer.writerow(header_row) for seed in redirect_metadata: row = [] for element in header_order: elem_lower = element.lower() if element in seed: row.extend([item for item in seed[element]]) elif elem_lower in seed: row.extend([item for item in seed[elem_lower]]) with open(redirect_csv,'ab') as csvfile: writer = csv.writer(csvfile) writer.writerow(row) def main(): job_numbers = raw_input('Enter a comma separated list of job numbers: ') base_dir = raw_input('Enter the directory in which job files are saved (e.g., U:/web_archives/jobs): ') jobs = [job.strip() for job in job_numbers.split(',')] for job in jobs: redirect_dict = {} job_dir = join(base_dir,job) with open(join(job_dir,'seedstatus.csv'),'rb') as csvfile: reader = csv.reader(csvfile) first_row = reader.next() collection_string = first_row[0] collection_id = re.findall(r'(\d+)\t',collection_string)[0] redirect_dir = join(job_dir,'redirects') redirect_csv = join(redirect_dir,'redirect_information.csv') with open(redirect_csv,'rb') as redirect_csv: reader = csv.reader(redirect_csv) next(reader,None) for row in reader: seed = row[0].strip() redirect = row[1].strip() redirect_dict[seed] = redirect get_redirect_metadata(redirect_dict,collection_id,redirect_dir) main()
[ "djpillen@umich.edu" ]
djpillen@umich.edu
2a90475a226a8743f66d4c4e113d97af8b7e8754
2f737cb4ac4e00d7f850624d5a9fc94e7425155b
/interview/views.py
b577b8b321bbb2cc19bd49026e5b968117448b1b
[]
no_license
eppel81/testchallenge
bd3a789a37280d8471a04c19eb1b4bdcf319fea7
3dce0ac40e1acbe691659786e765e34eb15a0ede
refs/heads/master
2016-08-11T07:46:18.963408
2015-11-03T14:22:54
2015-11-03T14:22:54
43,557,586
0
0
null
null
null
null
UTF-8
Python
false
false
12,076
py
# -*- coding: utf-8 -*- from django.shortcuts import render, get_object_or_404, Http404, redirect from django.contrib import auth from django.core.context_processors import csrf from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.decorators import permission_required from django.forms.models import modelformset_factory, inlineformset_factory import random import forms import pdb from .models import Interview, InterElem, DoneInterview def message(request, mess_text): """ ะ”ะปั ะพั‚ะพะฑั€ะฐะถะตะฝะธั ัะพะพะฑั‰ะตะฝะธะน """ return render(request, 'interview/message.html', {'title': mess_text}) def list_interviews(request): """ ะ’ั‹ะฒะพะดะธั‚ ัะฟะธัะพะบ ะฒัะตั… ััƒั‰ะตัั‚ะฒัƒัŽั‰ะธั… ะพะฟั€ะพัะพะฒ """ c_dict = {} c_dict['title'] = 'ะกะฟะธัะพะบ ะฒัะตั… ะพะฟั€ะพัะพะฒ:' c_dict['user'] = auth.get_user(request) c_dict['interviews'] = Interview.objects.all().order_by('id') return render(request, 'interview/listinterviews.html', c_dict) # def edit_interview2(request, interview_id): # """ # ะขัƒั‚ ะฑัƒะดะตั‚ ัั‚ั€ะฐะฝะธั†ะฐ ะดะปั ั€ะตะดะฐะบั‚ะธั€ะพะฒะฐะฝะธั ะบะพะฝะบั€ะตั‚ะฝะพะณะพ ะพะฟั€ะพัะฐ - ัะตะนั‡ะฐั ะฝะต ะธัะฟะพะปัŒะทัƒะตั‚ัั # """ # c_dict = {} # interview = get_object_or_404(Interview, pk=interview_id) # c_dict['interview'] = interview # return render(request, "interview/edit_interview.html", c_dict) def edit_interview(request, interview_id): """ ะขัƒั‚ ะฟะพะฟั€ะพะฑัƒะตะผ ั‡ะตั€ะตะท ะฝะฐะฑะพั€ั‹ ะผะพะดะตะปัŒะฝั‹ั… ั„ะพั€ะผ modelformset_factory """ interview = get_object_or_404(Interview, pk=interview_id) ElemFormset = modelformset_factory(InterElem, exclude=('interview',), extra=1, can_delete=True) c_dict = {} c_dict.update(csrf(request)) c_dict['title'] = '"' + str(interview) + '"' if request.method == 'POST': inter_form = forms.FormEditInterview(request.POST, instance=interview) elem_formset = ElemFormset(request.POST, queryset=InterElem.objects.filter(interview=interview).order_by('position'), prefix='elems') if elem_formset.is_valid(): if inter_form.is_valid(): inter_form.save() # ั‚ัƒั‚ ะฝัƒะถะฝะพ ะตั‰ะต ะดะพัะพั…ั€ะฐะฝะธั‚ัŒ ะพะฑัŠะตะบั‚ ะธะฝั‚ะตั€ะฒัŒัŽ ะฒ ะบะฐะถะดะพะน ั„ะพั€ะผะต forms_list = elem_formset.save(commit=False) # ัƒะดะฐะปะธะผ ั„ะพั€ะผั‹, ะฟะพะผะตั‡ะตะฝะฝั‹ะต ะดะปั ัƒะดะฐะปะตะฝะธั (checkbox) for item in elem_formset.deleted_objects: item.delete() # ะดะพัะพั…ั€ะฐะฝัะตะผ ะพะฑัŠะตะบั‚ interview ะดะปั ะฟั€ะฐะฒะธะปัŒะฝะพะน ะฒะฝะตัˆะฝะตะน ััั‹ะปะบะธ for item in forms_list: item.interview = interview item.save() return HttpResponseRedirect(reverse('edit_interview', args=(interview_id,))) if inter_form.is_valid(): inter_form = forms.FormEditInterview(instance=interview) else: inter_form = forms.FormEditInterview(instance=interview) elem_formset = ElemFormset(queryset=InterElem.objects.filter(interview=interview).order_by('position'), prefix='elems') c_dict['inter_form'] = inter_form c_dict['elem_formset'] = elem_formset return render(request, "interview/edit_interview.html", c_dict) def pass_interview(request, interview_id): """ ะคัƒะฝะบั†ะธั-ะฟั€ะตะดัั‚ะฐะฒะปะตะฝะธะต ะดะปั ะณะพะปะพัะพะฒะฐะฝะธั ะฟะพ ะบะพะฝะบั€ะตั‚ะฝะพะผัƒ ะพะฟั€ะพััƒ interview_id """ interview = Interview.objects.get(pk=interview_id) # ะฒั‹ะฑะธั€ะฐะตะผ ัะปะตะผะตะฝั‚ั‹ ะบะพะฝะบั€ะตั‚ะฝะพะณะพ ะพะฟั€ะพัะฐ elems = interview.interelem_set.order_by('position') if not elems: return render(request, 'interview/message.html', {'title': 'ะ’ะพะฟั€ะพัั‹ ะฟะพะบะฐ ะฝะต ะณะพั‚ะพะฒั‹. ะกะฟะฐัะธะฑะพ ะทะฐ ะฟะพะฝะธะผะฐะฝะธะต)'}) # ั‚ัƒั‚ ะฝะฐะดะพ ะฟั€ะพะฒะตั€ะธั‚ัŒ access ะฒ interview (ะฝัƒะถะฝะพ ะฐะฒั‚ะพั€ะธะทะธั€ะพะฒะฐั‚ัŒัั ะธะปะธ ะบัƒะบะธ) user = auth.get_user(request) if int(interview.access) > 0 and user.is_anonymous(): return render(request, 'interview/message.html', {'title': 'ะขะพะปัŒะบะพ ะดะปั ะทะฐั€ะตะณะธัั‚ั€ะธั€ะพะฒะฐะฝะฝั‹ั… ะฟะพะปัŒะทะพะฒะฐั‚ะตะปะตะน'}) if user.is_anonymous(): # ัะพะทะดะฐะดะธะผ id ะดะปั ัƒะฝะธะบะฐะปัŒะฝั‹ั… ัŽะทะตั€ะพะฒ user.id = random.randrange(100000001, 101000000) # ะฟั€ะพะฒะตั€ัะตะผ ะฝะต ะณะพะปะพัะพะฒะฐะป ะปะธ ะพะฝ ั€ะฐะฝะตะต ะฟะพ ะบัƒะบะต if ('inter_%s' % interview_id) in request.COOKIES: return render(request, 'interview/message.html', {'title': 'ะ˜ะทะฒะธะฝะธั‚ะต, ะฝะพ ะฒั‹ ัƒะถะต ะฟั€ะพัˆะปะธ ัั‚ะพั‚ ะพะฟั€ะพั'}) else: # ะฟั€ะพะฒะตั€ะธะผ ะตัั‚ัŒ ะปะธ ัƒ ัŽะทะตั€ะฐ ะพั‚ะฒะตั‚ ะฝะฐ ะฒะตั€ั…ะฝะธะน ะฒะพะฟั€ะพั ั‚ะตะบัƒั‰ะตะณะพ ะพะฟั€ะพัะฐ if DoneInterview.objects.filter(user_id=user.id, interelem=elems[0]).exists(): return render(request, 'interview/message.html', {'title': 'ะ˜ะทะฒะธะฝะธั‚ะต, ะฝะพ ะฒั‹ ัƒะถะต ะฟั€ะพัˆะปะธ ัั‚ะพั‚ ะพะฟั€ะพั'}) # ะณะพั‚ะพะฒะธะผ context ะดะปั ัˆะฐะฑะปะพะฝะฐ c_dict = {} c_dict['interview_id'] = interview_id c_dict['title'] = '"' + str(interview) + '"' c_dict.update(csrf(request)) if request.method != 'POST': form = forms.FormInterview(elems) c_dict['form'] = form else: form = forms.FormInterview(elems, request.POST) c_dict['form'] = form if form.is_valid(): cd = form.cleaned_data # ั‚ัƒั‚ ัะพั…ั€ะฐะฝัะตะผ ะฒะฒะตะดะตะฝะฝั‹ะต ัŽะทะตั€ะพะผ ะดะฐะฝะฝั‹ะต ะฟะพ ะฟะตั€ะตั‡ะฝัŽ ัะปะตะผะตะฝั‚ะพะฒ ะพะฟั€ะพัะฐ # ะผะพะถะฝะพ ะฟะพั‚ะพะผ ะฒั‹ะฝะตัั‚ะธ ะฒ FormInterview.save() for key in cd: interelem = get_object_or_404(InterElem, pk=int(key)) resp = cd[key] # ะตัะปะธ ะดะฐะฝะฝั‹ะต ะพั‚ะฒะตั‚ะฐ - ะผัƒะปัŒั‚ะธัะตะปะตะบั‚ if isinstance(resp, list): # pdb.set_trace() resp = ', '.join(resp) # ะตัะปะธ checkbox elif isinstance(resp, bool): resp = 'ะดะฐ' if resp else 'ะฝะตั‚' user_meta = request.META['HTTP_USER_AGENT'] try: interelem.doneinterview_set.create(user_id=user.id, resp=resp, user_meta=user_meta) except: raise Http404('ะะต ัƒะดะฐะปะพััŒ ัะพั…ั€ะฐะฝะธั‚ัŒ ะฒะฐัˆะธ ะดะฐะฝะฝั‹ะต. ะŸะพะฟั€ะพะฑัƒะนั‚ะต ะตั‰ะต ั€ะฐะทะพะบ.') response = render(request, 'interview/message.html', {'title': 'ะกะฟะฐัะธะฑะพ, ะฒั‹ ัƒัะฟะตัˆะฝะพ ะฟั€ะพัˆะปะธ ะพะฟั€ะพั'}) # ะตัะปะธ ะฐะฝะพะฝะธะผ, ั‚ะพ ัั‚ะฐะฒะธะผ ะตะผัƒ ะบัƒะบัƒ if user.is_anonymous(): response.set_cookie('inter_%s' % interview_id, 'done') return response # return HttpResponseRedirect(reverse('pass_interview', args=(interview_id, ))) return render(request, 'interview/passinterview.html', c_dict) # ะทะฐะบั€ั‹ะฒะฐะตะผ ะดะพัั‚ัƒะฟ ะดะปั ะพะฑั‹ั‡ะฝั‹ั… (ะฝะต staff) ัŽะทะตั€ะพะฒ ั ะฟะตั€ะตั…ะพะดะพะผ ะฝะฐ ัะฟะธัะพะบ ะพะฟั€ะพัะพะฒ #@permission_required('interview.add_interview', login_url='/interview/') def interview_results(request, interview_id): """ ะ’ั‹ะฒะพะด ั€ะตะทัƒะปัŒั‚ะฐั‚ะพะฒ ะบะพะฝะบั€ะตั‚ะฝะพะณะพ ะพะฟั€ะพัะฐ """ c_dict = {} interview = get_object_or_404(Interview, pk=interview_id) c_dict['descr'] = interview.description # ะพะฑะพั€ะฐั‡ะธะฒะฐะตะผ list, ั‡ั‚ะพะฑั‹ ะฒั‹ะฟะพะปะฝะธั‚ัŒ ะทะฐะฟั€ะพั ะธะผะตะฝะฝะพ ะฒ ัั‚ะพะผ ะผะตัั‚ะต elems = list(interview.interelem_set.order_by('position')) if elems: # ะฒั‹ะฑะตั€ะตะผ ะฒัะตั… ัŽะทะตั€ะพะฒ, ะบะพั‚ะพั€ั‹ะต ะณะพะปะพัะพะฒะฐะปะธ ะฟะพ ะบะพะฝะบั€ะตั‚ะฝะพะผัƒ ะพะฟั€ะพััƒ # done_interview_users = DoneInterview.objects.filter(interelem__in=list(elems)).distinct('user_id') # distinct - ะฟะพั‡ะตะผัƒ-ั‚ะพ ะฝะต ะทะฐั€ะฐะฑะพั‚ะฐะป done_interview_users = DoneInterview.objects.filter(interelem__in=elems) # ะทะดะตััŒ ะฑัƒะดะตะผ ัะพั…ั€ะฐะฝัั‚ัŒ ัƒะฝะธะบะฐะปัŒะฝั‹ั… ะณะพะปะพัะพะฒะฐะฒัˆะธั… ะฟะพะปัŒะทะพะฒะฐั‚ะตะปะตะน users = [] for done_interview_user in done_interview_users: if done_interview_user.user_id not in users: users.append(done_interview_user.user_id) resps = [] questions = [] # ั„ะพั€ะผะธั€ัƒะตะผ ัะฟะธัะพะบ ะฒะพะฟั€ะพัะพะฒ-ัะปะตะผะตะฝั‚ะพะฒ ะธะฝั‚ะตั€ะฒัŒัŽ for elem in elems: questions.append(elem.text_before_elem) # ะฟั€ะพั…ะพะดะธะผ ะฟะพ ะฟะตั€ะตั‡ะฝัŽ ะพะฑัŠะตะบั‚ะพะฒ ั€ะตะทัƒะปัŒั‚ะฐั‚ะพะฒ ะณะพะปะพัะพะฒะฐะฝะธั ั ัƒะฝะธะบะฐะปัŒะฝั‹ะผะธ ัŽะทะตั€ะฐะผะธ. # ะญั‚ะพ ะดะปั ั‚ะพะณะพ, ั‡ั‚ะพะฑั‹ ะพั‚ะพะฑั€ะฐะทะธั‚ัŒ ะฒ ัˆะฐะฑะปะพะฝะต ั‚ะฐะฑะปะธั†ัƒ, ั€ะฐัั‚ัƒั‰ัƒัŽ ะฒะฝะธะท. for user in users: user_resps = [] for elem in elems: # ะฝัƒะถะฝะพ ะฟะตั€ะตั…ะฒะฐั‚ะธั‚ัŒ ะธัะบะปัŽั‡ะตะฝะธะต, ั‚.ะบ. ะฒะพะฟั€ะพั-ัะปะตะผะตะฝั‚ ะผะพะณ ะดะพะฑะฐะฒะธั‚ัŒัั ะบ ะพะฟั€ะพััƒ ะฟะพัะปะต # ะณะพะปะพัะพะฒะฐะฝะธั ะบะฐะบะธะผ-ะปะธะฑะพ ัŽะทะตั€ะพะผ ะธ ั‚ะพะณะดะฐ ะฟั€ะพัั‚ะพ ะฝะต ะฑัƒะดะตั‚ ะฝัƒะถะฝะพะณะพ ะพะฑัŠะตะบั‚ะฐ-ั€ะตะทัƒะปัŒั‚ะฐั‚ ะณะพะปะพัะพะฒะฐะฝะธั. try: elem_response = DoneInterview.objects.get(user_id=user, interelem=elem) tmp = elem_response.resp except Exception: tmp = '' user_resps.append(tmp) # ะดะพะฑะฐะฒะปัะตะผ ะฒ ัะฟะธัะพะบ ะบะพั€ั‚ะตะถ ('ัŽะทะตั€', [ะพั‚ะฒะตั‚ั‹...]) resps.append((user, user_resps)) # ะตัะปะธ ะตัั‚ัŒ ะพั‚ะฒะตั‚ั‹ ะฝะฐ ะฒะพะฟั€ะพัั‹ ะธะฝั‚ะตั€ะฒัŒัŽ if resps: c_dict['title'] = 'ะ ะตะทัƒะปัŒั‚ะฐั‚ั‹ ะณะพะปะพัะพะฒะฐะฝะธั ะฟะพ ะพะฟั€ะพััƒ:' c_dict['questions'] = questions c_dict['resps'] = resps return render(request, 'interview/interviewresults_new.html', c_dict) # def interview_results_new(requerst, interview_id): # """ # ะžะฑะฝะพะฒะปะตะฝะฝะฐั ั„ัƒะฝะบั†ะธั interview_result (ัะผ. ะฒั‹ัˆะต). ะขัƒั‚ ะฝะตะผะฝะพะณะพ ะฟะพะดั€ัƒะณะพะผัƒ ะพะฑั€ะฐั‰ะฐะตะผัั ะบ ะฑะฐะทะต ะดะฐะฝะฝั‹ั…. # """ # c_dict = {} # interview = get_object_or_404(Interview, pk=interview_id) # elems = list(interview.interelem_set.order_by('position')) # # # ั‚ัƒั‚ ัะฟะธัะพะบ ะพะฑัŠะตะบั‚ะพะฒ-ะพั‚ะฒะตั‚ะพะฒ ะฒัะตั… ัŽะทะตั€ะพะฒ ะฟะพ ะดะฐะฝะฝะพะผัƒ ะธะฝั‚ะตั€ะฒัŒัŽ # all_resps = list(DoneInterview.objects.filter(interelem__in=elems)) # # # ะฒั‹ะฑะตั€ะตะผ ัะฟะธัะพะบ ัŽะทะตั€ะพะฒ # users_list = [] # for item in all_resps: # if item.user_id not in users_list: # users_list.append(item.user_id) # # # ะดะปั ะบะฐะถะดะพะณะพ ัŽะทะตั€ะฐ ะฒั‹ั‚ะฐั‰ะธะผ ะฝัƒะถะฝั‹ะน ะพั‚ะฒะตั‚ # for item in all_resps: # pass # # return render(requerst, 'interview/interviewresults_new.html', c_dict) def add_interview(request): """ ะขัƒั‚ ะดะพะฑะฐะฒะปัะตะผ ะฝะพะฒั‹ะน ะพะฟั€ะพั ะฒ ะฑะฐะทัƒ """ c_dict = {} c_dict.update(csrf(request)) c_dict['title'] = 'ะ”ะพะฑะฐะฒะปัะตะผ ะพะฟั€ะพั' if request.POST: inter_form = forms.FormEditInterview(request.POST) if inter_form.is_valid(): interview_id = inter_form.save() # return redirect('interview/%s/edit' % interview_id) return HttpResponseRedirect(reverse('edit_interview', args=(interview_id.id, ))) else: inter_form = forms.FormEditInterview() c_dict['inter_form'] = inter_form return render(request, 'interview/edit_interview.html', c_dict)
[ "gogenko@ukr.net" ]
gogenko@ukr.net
ea6229eb0f4297817a25182b65275423940a989f
425ef46a6f6a3fd799e059eeacda10068976a282
/menu/migrations/0002_auto_20210605_2027.py
e8a60db0f6704a40945aa6dad772dcaf8c71bd1e
[]
no_license
dervin48/Final2021
6ac6365c9e2dbc31945afd7e5bf5a3ca5a97f439
30360210a3cdf9b5119b02af614a6421fb78c82a
refs/heads/master
2023-06-28T22:24:35.515353
2021-07-28T03:39:59
2021-07-28T03:39:59
390,199,922
0
0
null
null
null
null
UTF-8
Python
false
false
574
py
# Generated by Django 3.2.3 on 2021-06-06 02:27 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('menu', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='menu', name='platillo', ), migrations.AddField( model_name='menu', name='descripcion', field=models.CharField(default=1, max_length=50, verbose_name='descripcion'), preserve_default=False, ), ]
[ "dervin48@gmail.com" ]
dervin48@gmail.com
ddb9e86f2af78422c26df983d968c40f0bf75e76
df4d6e326241b044b6de4064fd595be556f14902
/src/mysite/resources/views.py
6c8fb593075077c2a543a54423b686fcf0208c1a
[]
no_license
Joelant97/AppLeo-Proyecto_Final
9218a088991a32ce90ed0a838ef88679d7f846d9
ee1613d11302b007e254ecb676c8720d9a27d498
refs/heads/master
2021-06-24T10:30:56.337788
2020-08-26T09:18:24
2020-08-26T09:18:24
147,465,639
0
0
null
null
null
null
UTF-8
Python
false
false
9,502
py
from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import get_object_or_404, render_to_response from django.views import generic from django.views.generic.edit import CreateView, UpdateView, DeleteView, View from django.core.urlresolvers import reverse_lazy from .models import Estudiante, Profesor #from django.contrib.auth.models import User from .forms import RegistroForm from django.shortcuts import redirect from django.contrib.auth import login, authenticate # Librerias para Servicio de Rest: from rest_framework.views import APIView from rest_framework.response import Response # from rest_framework import status from .models import Evaluacion from .models import Lectura from .serializers import EstudianteSerializer from .serializers import EvaluacionSerializer # from .models import EvaluacionForm from django.shortcuts import render from rest_framework.response import Response from .fusioncharts import FusionCharts class RegistrarView(CreateView): model = Profesor form_class = RegistroForm template_name = "resources/registrar.html" success_url = reverse_lazy('login') def form_valid(self, form): ''' En este parte, si el formulario es valido guardamos lo que se obtiene de รฉl y usamos authenticate para que el usuario incie sesiรณn luego de haberse registrado y lo redirigimos al index ''' form.save() usuario = form.cleaned_data.get('username') password = form.cleaned_data.get('password1') usuario = authenticate(username=usuario, password=password) login(self.request, usuario) return redirect('/') # def form_valid(self, form): # # Add logged-in user as autor of comment THIS IS THE KEY TO THE SOLUTION # form.instance.profesor = self.request.user # # # Call super-class form validation behaviour # return super(RegistrarView, self).form_valid(form) def get_context_data(self, **kwargs): context = super(CreateView, self).get_context_data(**kwargs) context.update({ 'all_profesors': Profesor.objects.all(), }) return context def get_queryset(self): return Profesor.objects.all() # class RegistroUsuario(CreateView): # model = User # template_name = "resources/registrar.html" # form_class = RegistroForm # success_url = reverse_lazy('login') class ListProfesorLogeado(generic.ListView): template_name = 'resources/profesor-detalles.html' context_object_name = 'user.is_authenticated' slug_field = 'profesor' slug_url_kwarg = 'profesor' def get_queryset(self): return Profesor.objects.all() class DetailViewProfesor(generic.DetailView): model = Profesor template_name = 'resources/profesor-detalles.html' # success_url = reverse_lazy('profesor-update') ''' Vista para la Lectura, la cual solo sera vista por el estudiante: ''' # Crea tus Vistas aqui def busqueda(request): estudiantes = Estudiante.objects.filter(nombres__icontains=request.GET['nombres']).values('id', 'nombres', 'apellidos') try: if estudiantes: return render_to_response('resources/buscar-resultados.html', {'estudiante': estudiantes}) except: return HttpResponse("Hubo una excepcion") else: return HttpResponse("No hay estudiantes con ese nombre") # Vista para Realizar Evaluaciones del Modelo "Evaluacion" class RealizarEvaluacionVista(CreateView): model = Evaluacion template_name = "resources/evaluacion_form.html" success_url = "/estudiante/{estudiante_id}" # Esto es para direcionar hacia los detalles del estudiante # luego de registrar la evaluacion que se le ha realizo. fields = ['estudiante', 'es_favorito', 'evaluacion_tipo', 'fluidez_lectora', 'tipo_lectura', 'comentario', 'texto_a_leer', 'fecha'] # def get_context_data(self, **kwargs): # context = super(CreateView, self).get_context_data(**kwargs) # context.update({ # 'all_estudiantes': Estudiante.objects.all(), # }) # return context # # def get_queryset(self): # return Estudiante.objects.all() # Eliminar las Evaluaciones: def DeleteEvaluacion(request, eva_id): # El id de la Evaluacion a eliminar es id== eva_id eva_obj = get_object_or_404(Evaluacion, id=eva_id) eva_obj.delete() return HttpResponseRedirect(request.META.get('HTTP_REFERER', '/')) # Esto te permite redirecionar a la misma pagina # en que estabas, luego de eliminar y actualizar. class IndexView(generic.ListView): template_name = 'resources/index.html' context_object_name = 'all_estudiantes' def get_context_data(self, **kwargs): context = super(IndexView, self).get_context_data(**kwargs) context.update({ 'all_evaluaciones': Evaluacion.objects.all(), }) return context def get_queryset(self): return Estudiante.objects.all() class ReportesView(generic.ListView): template_name = 'resources/reportes.html' context_object_name = 'all_evaluaciones' slug_field = 'evaluacion' slug_url_kwarg = 'evaluacion' def get_queryset(self): return Evaluacion.objects.all() # context_object_name = 'all_estudiantes' # # def get_context_data(self, **kwargs): # context = super(IndexView, self).get_context_data(**kwargs) # context.update({ # 'all_evaluaciones': Evaluacion.objects.all(), # }) # return context # # def get_queryset(self): # return Estudiante.objects.all() class DetailViewEvaluacion(generic.DetailView): model = Evaluacion template_name = 'resources/evaluacion-detalles.html' # success_url = reverse_lazy('estudiante-update') class ListEstudiantes(generic.ListView): template_name = 'resources/estudiantes.html' context_object_name = 'all_estudiantes' slug_field = 'estudiante' slug_url_kwarg = 'estudiante' def get_queryset(self): return Estudiante.objects.all() class DetailView(generic.DetailView): model = Estudiante template_name = 'resources/detalles.html' class CrearEstudiante(CreateView): model = Estudiante fields = ['id', 'nombres', 'apellidos', 'genero', 'edad', 'foto'] # success_url = "/estudiante/{estudiante_id}" # success_url = reverse_lazy('listado-estudiantes') def form_valid(self, form): # Add logged-in user as autor of comment THIS IS THE KEY TO THE SOLUTION form.instance.profesor = self.request.user # Call super-class form validation behaviour return super(CrearEstudiante, self).form_valid(form) class CrearLectura(CreateView): model = Lectura success_url = "listado/lecturas/" template_name = "resources/lectura_form.html" fields = ['id', 'titulo', 'texto'] # /lecturas lista class ListLecturas(generic.ListView): template_name = 'resources/lecturas.html' context_object_name = 'all_lecturas' slug_field = 'lectura' slug_url_kwarg = 'lectura' def get_queryset(self): return Lectura.objects.all() class UpdateEstudiante(UpdateView): model = Estudiante fields = ['id', 'nombres', 'apellidos', 'genero', 'edad', 'foto'] class DeleteEstudiante(DeleteView): model = Estudiante success_url = reverse_lazy('resources:index') class UpdateLectura(UpdateView): model = Lectura fields = ['id', 'titulo', 'texto'] class DeleteLectura(DeleteView): model = Lectura success_url = reverse_lazy('resources:listado-lecturas') ''' Vistas para las Graficas (Libreria: FusionCharts) ''' def chart(request): dataSource= {} dataSource['chart'] = { "caption": "Velocidad de la lectura,", "subCaption": "evaluada segun su tipo", "xAxisName": "Tipo Lectura", "yAxisName": "Velocidad Lectora (En PPM)", "numberPrefix": "ppm", "theme": "zune" } # The data for the chart should be in an array where each element of the array is a JSON object # having the `label` and `value` as key value pair. dataSource['data'] = [] # Iterate through the data in `Revenue` model and insert in to the `dataSource['data']` list. for key in Evaluacion.objects.all(): data = {} data['label'] = key.tipo_lectura data['value'] = key.fluidez_lectora dataSource['data'].append(data) # Create an object for the Column 2D chart using the FusionCharts class constructor column2D = FusionCharts("column2D", "ex1", "600", "350", "chart-1", "json", dataSource) return render(request, 'resources/bar-chart.html', {'output': column2D.render()}) # Manejo de RestFull(Listar o crear uno nuevo del model para el Serv.Rest): # /estudiantes class EstudianteList(APIView): def get(self, request): estudiantes = Estudiante.objects.all() serializer = EstudianteSerializer(estudiantes, many=True) return Response(serializer.data) def post(self): pass # /evaluaciones class EvaluacionList(APIView): # Esto funciona como una especie de JSON. def get(self, request): evaluaciones = Evaluacion.objects.all() serializer = EvaluacionSerializer(evaluaciones, many=True) return Response(serializer.data) def post(self): pass
[ "joelant97@gmail.com" ]
joelant97@gmail.com
5647512c5cd52dcc2a76ac3b597b98b37f41dd63
5552d301f74af1db5472fa6d1acbef8689ef3823
/rango/choices.py
5cfb0fef92463b3d77fdc4c242bc77788abad593
[]
no_license
Conal97/IT-Group-Project
4d80b1b9dd71db4b51c9f77408ecde3b24398bac
a916a82d605d32b68792382fc00bd45559734496
refs/heads/master
2023-07-05T12:37:17.393949
2021-08-06T21:37:42
2021-08-06T21:37:42
null
0
0
null
null
null
null
UTF-8
Python
false
false
83
py
CHOICES = ( (1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), )
[ "conalbrosnan@gmail.com" ]
conalbrosnan@gmail.com
727bc0e499477df5820ad111e776f25fb0102e8f
a5c975a059b785a413c5f8b47bc7127e326c4382
/08_cell_line_prediction/nbconverted/plot_drug_response_classification.py
1ed4b814ad288e7bec2cfab83ce5de61e928c983
[ "BSD-3-Clause" ]
permissive
greenelab/pancancer-evaluation
a36d00c52ec1a6c44a1b3d7593adc107b546ea2c
7650b0ff18dfa466b74937cfcac3317443d01056
refs/heads/master
2023-08-29T00:32:32.524308
2023-08-15T18:51:41
2023-08-15T18:51:41
283,575,430
9
2
BSD-3-Clause
2023-08-15T18:51:42
2020-07-29T18:38:57
Jupyter Notebook
UTF-8
Python
false
false
8,622
py
#!/usr/bin/env python # coding: utf-8 # ## Analysis of drug response binary classification with held-out cancer types # In[1]: import os import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import pancancer_evaluation.config as cfg import pancancer_evaluation.utilities.analysis_utilities as au get_ipython().run_line_magic('load_ext', 'autoreload') get_ipython().run_line_magic('autoreload', '2') # In[2]: # analysis of results generated by script: # 08_cell_line_classification/run_drug_response_prediction.py # (with varying feature_selection parameters) # we ran two types of experiments, one where we hold out each individual # cancer type in CCLE and one where we pool liquid cancers and solid cancers # and hold them out together # here, we can choose which experiment we want to look at the results of stratify_by = 'liquid_or_solid' if stratify_by == 'cancer_type': single_cancer_dir = os.path.join('results', 'drug_response_binary', 'single_cancer') pancancer_dir = os.path.join('results', 'drug_response_binary_all', 'pancancer') pancancer_only_dir = os.path.join('results', 'drug_response_binary_all', 'all_other_cancers') elif stratify_by == 'liquid_or_solid': single_cancer_dir = os.path.join('results', 'drug_response_binary_liquid_or_solid', 'single_cancer') pancancer_dir = os.path.join('results', 'drug_response_binary_liquid_or_solid', 'pancancer') pancancer_only_dir = os.path.join('results', 'drug_response_binary_liquid_or_solid', 'all_other_cancers') # feature selection dimensions tested n_dims = [100, 250, 500, 1000, 5000] # feature selection methods tested fs_methods = [ 'mad', 'pancan_f_test', 'median_f_test', 'random' ] # drug to plot results for drug = 'Cisplatin' # metric to plot results for metric = 'aupr' delta_metric = 'delta_{}'.format(metric) # location to save plots to output_plots = False if metric == 'auroc': output_plots_dir = cfg.ccle_fs_plots_dir / 'drug_response_binary' / 'auroc' else: output_plots_dir = cfg.ccle_fs_plots_dir / 'drug_response_binary' # ### Load results # # We load the results of the single cancer, pan-cancer, and "pan-cancer only" (aka "all other cancers") experiments here. # In[3]: single_cancer_df = au.load_prediction_results_fs( single_cancer_dir, cfg.fs_methods ) single_cancer_df = single_cancer_df[single_cancer_df.n_dims.isin(n_dims)].copy() single_cancer_df['train_set'] = 'single_cancer' for n in n_dims: for fs_method in fs_methods: single_cancer_df.loc[ (single_cancer_df.fs_method == fs_method) & (single_cancer_df.n_dims == n), 'fs_method' ] = '{}.{}'.format(fs_method, n) single_cancer_df.rename(columns={'gene': 'drug'}, inplace=True) print(np.unique(single_cancer_df.seed)) print(np.unique(single_cancer_df.n_dims)) print(np.unique(single_cancer_df.fs_method)) print(single_cancer_df.shape) single_cancer_df.head() # In[4]: pancancer_df = au.load_prediction_results_fs( pancancer_dir, cfg.fs_methods ) pancancer_df = pancancer_df[pancancer_df.n_dims.isin(n_dims)].copy() pancancer_df['train_set'] = 'pancancer' for n in n_dims: for fs_method in fs_methods: pancancer_df.loc[ (pancancer_df.fs_method == fs_method) & (pancancer_df.n_dims == n), 'fs_method' ] = '{}.{}'.format(fs_method, n) pancancer_df.rename(columns={'gene': 'drug'}, inplace=True) print(np.unique(pancancer_df.seed)) print(np.unique(pancancer_df.fs_method)) print(pancancer_df.shape) pancancer_df.head() # In[5]: pancancer_only_df = au.load_prediction_results_fs( pancancer_only_dir, cfg.fs_methods ) pancancer_only_df = pancancer_only_df[pancancer_only_df.n_dims.isin(n_dims)].copy() pancancer_only_df['train_set'] = 'pancancer_only' for n in n_dims: for fs_method in fs_methods: pancancer_only_df.loc[ (pancancer_only_df.fs_method == fs_method) & (pancancer_only_df.n_dims == n), 'fs_method' ] = '{}.{}'.format(fs_method, n) pancancer_only_df.rename(columns={'gene': 'drug'}, inplace=True) print(np.unique(pancancer_only_df.seed)) print(np.unique(pancancer_only_df.fs_method)) print(pancancer_only_df.shape) pancancer_only_df.head() # In[6]: # get difference between true and shuffled models, split by # feature selection method and holdout cancer type def compare_from_experiment(experiment_df): compare_df = [] for fs_method in experiment_df.fs_method.unique(): for holdout_cancer_type in experiment_df.holdout_cancer_type.unique(): compare_df.append( au.compare_control_ind( experiment_df[ (experiment_df.fs_method == fs_method) & (experiment_df.holdout_cancer_type == holdout_cancer_type) ], identifier='drug', metric=metric, verbose=True) .assign(fs_method=fs_method, holdout_cancer_type=holdout_cancer_type) ) return pd.concat(compare_df) single_cancer_compare_df = compare_from_experiment(single_cancer_df) pancancer_compare_df = compare_from_experiment(pancancer_df) pancancer_only_compare_df = compare_from_experiment(pancancer_only_df) print(single_cancer_compare_df.shape, pancancer_compare_df.shape, pancancer_only_compare_df.shape) # In[7]: # split fs_method and n_dims so we can make a line plot # over different values of n_dims for compare_df in [ single_cancer_compare_df, pancancer_compare_df, pancancer_only_compare_df ]: compare_df[['fs_method', 'n_dims']] = compare_df.fs_method.str.split('.', 1, expand=True) compare_df['n_dims'] = compare_df.n_dims.astype(int) # In[8]: print(single_cancer_compare_df.fs_method.unique()) print(single_cancer_compare_df.n_dims.unique()) single_cancer_compare_df.head() # ### Plot average performance across cancer types and number of features selected # In[9]: print(single_cancer_compare_df.identifier.unique()) # In[10]: print(single_cancer_compare_df.fs_method.unique()) # In[11]: sns.set({'figure.figsize': (18, 6)}) sns.set_context('notebook') fig, axarr = plt.subplots(1, 3) dfs_to_plot = [ single_cancer_compare_df, pancancer_compare_df, pancancer_only_compare_df ] names_to_plot = [ 'Train single-cancer', 'Train pan-cancer', 'Train all other cancer types' ] fs_method_order = [ 'mad', 'pancan_f_test', 'median_f_test', 'random' ] for ix, compare_df in enumerate(dfs_to_plot): ax = axarr[ix] # averaged over cancer types plot_df = (compare_df[(compare_df.identifier == drug)] .sort_values(by='n_dims', ascending=True) ) sns.pointplot(data=plot_df, x='n_dims', y=delta_metric, hue='fs_method', hue_order=fs_method_order, ax=ax) ax.set_title(names_to_plot[ix]) ax.set_xlabel('Number of features selected') ax.set_ylim(-0.2, 1) plt.suptitle('{}, averaged over all holdout cancer types'.format(drug)) plt.tight_layout() print(plot_df.holdout_cancer_type.unique(), file=sys.stderr) if output_plots: output_plots_dir.mkdir(exist_ok=True) plt.savefig(output_plots_dir / '{}_response_classify_summary.png'.format(drug), dpi=200, bbox_inches='tight') # In[12]: sns.set({'figure.figsize': (16, 12)}) sns.set_context('notebook') fig, axarr = plt.subplots(3, 1) dfs_to_plot = [ single_cancer_compare_df, pancancer_compare_df, pancancer_only_compare_df ] names_to_plot = [ 'Train single-cancer', 'Train pan-cancer', 'Train all other cancer types' ] # max_n_dims = max(n_dims) max_n_dims = 1000 # split individual cancer types for ix, compare_df in enumerate(dfs_to_plot): ax = axarr[ix] plot_df = (compare_df[(compare_df.identifier == drug) & (compare_df.n_dims == max_n_dims)] .sort_values(by='holdout_cancer_type') ) sns.boxplot(data=plot_df, x='holdout_cancer_type', y=delta_metric, hue='fs_method', hue_order=fs_method_order, ax=ax) ax.set_title(names_to_plot[ix]) if ix == len(dfs_to_plot) - 1: ax.set_xlabel('Holdout cancer type') else: ax.set_xlabel('') ax.get_legend().remove() ax.set_ylim(-0.2, 1) plt.suptitle('{}, {} features, by test cancer type'.format(drug, max_n_dims), y=0.99) plt.tight_layout() if output_plots: plt.savefig(output_plots_dir / '{}_response_classify_by_cancer_type.png'.format(drug), dpi=200, bbox_inches='tight')
[ "jjc2718@gmail.com" ]
jjc2718@gmail.com
721df6306fe4aea832ee672e8b82516f53baa8c3
4fd73945d4794f4fd38aa66d433afca83fbadff5
/Ch2_compare_test.py
626c7cd609b2b86d3d0dac824f45c584faf089d4
[]
no_license
jasper2326/Scrapy
be120ba1b4c6fd218343c717dc8919e88ddf0af8
71227812b917bbd54fef6fb423e4e1f1c0bfca24
refs/heads/master
2021-06-29T16:04:35.132250
2017-09-16T13:45:52
2017-09-16T13:45:52
103,092,861
0
0
null
null
null
null
UTF-8
Python
false
false
795
py
# author = Jasper_Jiao@ele.me # -*- coding: cp936 -*- # coding: cp936 import time import re import Ch2_compare import Scrapy.Ch1.Ch1_download NUM_ITERATIONS = 1000 html = Scrapy.Ch1.Ch1_download.download_3('http://example.webscraping.com/places/default/view/united-kingdom-239') for name, scraper in [('Regular expressions', Ch2_compare.re_scraper), ('BeautifulSoup', Ch2_compare.bs_scraper), ('Lxml', Ch2_compare.lxml_scraper)]: start = time.time() for i in range(NUM_ITERATIONS): if scraper == Ch2_compare.re_scraper: re.purge() result = scraper(html) assert(result['area'] == '244,820 square kilometres') end = time.time() print '%s: %.2f seconds' % (name, end - start)
[ "noreply@github.com" ]
noreply@github.com
caf01fee84b8f19a586c8dadd8b3aa0ec0be2030
be3f8a09a5b8859fffa07673cdfd17723e843b86
/src/Socket_Control/coordinate_collation_interface.py
61179a2af41d390603fb1d43dad2348078877ed4
[ "MIT" ]
permissive
SamKaiYang/2019_Hiwin_Shaking
88646a0a9ff87dfe96a3fb90ede44602bd413d53
d599f8c87dc4da89eae266990d12eb3a8b0f3e16
refs/heads/master
2020-07-22T13:25:21.063822
2019-09-09T03:29:11
2019-09-09T03:29:11
207,216,404
0
0
null
null
null
null
UTF-8
Python
false
false
7,413
py
#!/usr/bin/env python3 # license removed for brevity #encoding:utf-8 import tkinter as tk import shake_strategy_trigger as shake_trig import shake_strategy_content as shake_cont # interface for collation # ======================================================================= # =23/07/2019:add above pos_collation = # ======================================================================= collate_speed=15 def LeftCollate(): shake_cont.InitData(shake_cont.delt_z) # shake_cont.Left(shake_cont.Animation_Action) shake_cont.Left(shake_trig.Hiwin_Solo_Action) shake_cont.InitData(-shake_cont.delt_z) def RightCollate(): shake_cont.InitData(shake_cont.delt_z) # shake_cont.Right(shake_cont.Animation_Action) shake_cont.Right(shake_trig.Hiwin_Solo_Action) shake_cont.InitData(-shake_cont.delt_z) def ArmTestAct(): shake_cont.InitData(shake_cont.delt_z) # shake_cont.ArmTest(shake_cont.Animation_Action) shake_cont.ArmTest(shake_trig.Hiwin_Action) shake_cont.InitData(-shake_cont.delt_z) def CupCollate(): global collate_speed shake_cont.InitData(shake_cont.delt_z) # Action=shake_cont.Animation_Action Action=shake_trig.Hiwin_Solo_Action shake_cont.SpeedModeToggle(1) Action.ArmMove(shake_cont.Above_Shake_Pos,collate_speed,shake_cont.gp_stop,'็งปๅ‹•่‡ณ้›ชๅ…‹ๆฏไธŠๆ–น') Action.ArmMove(shake_cont.Pre_Grip_Pos,collate_speed,shake_cont.gp_stop,'่ฝ‰ๅ‹•') Action.ArmMove(shake_cont.Grip_Shake_For_Pour_Pos,collate_speed,shake_cont.gp_stop,'็งปๅ‹•่‡ณ้›ชๅ…‹ๆฏ') tk.messagebox.showinfo(message='Shake OK?') Action.GripCtrl(shake_cont.Grip_Shake_For_Pour_Pos,collate_speed,shake_cont.gp_tight_catch,'็งปๅ‹•่‡ณ้›ชๅ…‹ๆฏ','ๅคพไฝ้›ชๅ…‹ๆฏ') tk.messagebox.showinfo(message='Shake OK?') Action.ArmMove(shake_cont.Lift_Up_Full_Shake_Pos,collate_speed,shake_cont.gp_stop,'็งปๅ‹•่‡ณ้›ชๅ…‹ๆฏ็ฉบไฝไธŠๆ–น') Action.ArmMove(shake_cont.Pour_Product_Ready_Pos,collate_speed,shake_cont.gp_stop,'ๆบ–ๅ‚™ๅ€’้ฃฒๆ–™่‡ณๆ‰‹ๆ–ๆฏ') Action.ArmMove(shake_cont.Pour_Product_Pour_Pos,collate_speed,shake_cont.gp_stop,'ๅ€’้ฃฒๆ–™่‡ณๆ‰‹ๆ–ๆฏ') Action.ArmMove(shake_cont.Pour_Product_Down_Pos,collate_speed,shake_cont.gp_stop,'ๅ‘ไธ‹็งปๅ‹•') tk.messagebox.showinfo(message='Cup OK?') Action.ArmMove(shake_cont.Pour_Product_Pour_Pos,collate_speed,shake_cont.gp_stop,'ๅ‘ไธŠ็งปๅ‹•') Action.ArmMove(shake_cont.Pour_Product_Ready_Pos,collate_speed,shake_cont.gp_stop,'ๅ€’้ฃฒๆ–™่‡ณๆ‰‹ๆ–ๆฏ็ตๆŸ') Action.ArmMove(shake_cont.Lift_Up_Full_Shake_Pos,collate_speed,shake_cont.gp_stop,'็งปๅ‹•่‡ณ้›ชๅ…‹ๆฏ็ฉบไฝไธŠๆ–น') Action.GripCtrl(shake_cont.Grip_Shake_For_Pour_Pos,collate_speed,shake_cont.gp_open,'ๆ”พไธ‹้›ชๅ…‹ๆฏ','้ฌ†้–‹้›ชๅ…‹ๆฏ') tk.messagebox.showinfo(message='Cup OK?') Action.ArmMove(shake_cont.Pre_Grip_Pos,collate_speed,shake_cont.gp_stop,'็งปๅ‹•่‡ณ้›ชๅ…‹ๆฏไธŠๆ–น') Action.ArmMove(shake_cont.Above_Shake_Pos,collate_speed,shake_cont.gp_stop,'่ฝ‰ๅ‹•') tk.messagebox.showinfo(message='Collation Finished!') Action.ArmMove(shake_cont.Home_Pos,collate_speed,shake_cont.gp_stop,'็งปๅ‹•่‡ณๅŽŸไฝ') shake_cont.InitData(-shake_cont.delt_z) def LidCollate(): shake_cont.InitData(shake_cont.delt_z) # Action=shake_cont.Animation_Action Action=shake_trig.Hiwin_Solo_Action shake_cont.SpeedModeToggle(1) Action.LimitArmMove(shake_cont.Above_Lid_Pos,collate_speed,5,shake_cont.gp_stop,'็งปๅ‹•่‡ณ้›ชๅ…‹ๆฏ่“‹ไธŠๆ–น') Action.GripCtrl(shake_cont.Lid_Pos,collate_speed,shake_cont.gp_tight_catch,'็งปๅ‹•่‡ณ้›ชๅ…‹ๆฏ่“‹','ๅคพไฝ้›ชๅ…‹ๆฏ่“‹') tk.messagebox.showinfo(message='Lid OK?') Action.ArmMove(shake_cont.Above_Lid_Pos,collate_speed,shake_cont.gp_stop,'ๆ‹ฟ่ตท้›ชๅ…‹ๆฏ่“‹') Action.ArmMove(shake_cont.Above_Shake_Pos,collate_speed,shake_cont.gp_stop,'็งปๅ‹•่‡ณ้›ชๅ…‹ๆฏไธŠๆ–น') Action.LimitArmMove(shake_cont.Collate_Lid_Pos,collate_speed,5,shake_cont.gp_stop,'่“‹ๆฏ่“‹') tk.messagebox.showinfo(message='Lid OK?') Action.ArmMove(shake_cont.Above_Shake_Pos,collate_speed,shake_cont.gp_stop,'็งปๅ‹•่‡ณ้›ชๅ…‹ๆฏไธŠๆ–น') Action.ArmMove(shake_cont.Above_Lid_Pos,collate_speed,shake_cont.gp_stop,'็งปๅ‹•่‡ณ้›ชๅ…‹ๆฏ่“‹ไธŠๆ–น') Action.GripCtrl(shake_cont.Lid_Pos,collate_speed//2,shake_cont.gp_open,'ๆ”พไธ‹้›ชๅ…‹ๆฏ่“‹','้ฌ†้–‹้›ชๅ…‹ๆฏ่“‹') tk.messagebox.showinfo(message='Collation Finished!') Action.ArmMove(shake_cont.Home_Pos,collate_speed,shake_cont.gp_stop,'็งปๅ‹•่‡ณๅŽŸไฝ') shake_cont.InitData(-shake_cont.delt_z) def PosCollate(): shake_cont.InitData(shake_cont.delt_z) pos_list = [shake_cont.Home_Pos,shake_cont.Full_Ice_Pos,shake_cont.Above_Ice_Pos, shake_cont.Above_Duo_Duo_Pos,shake_cont.Duo_Duo_Pos,shake_cont.Above_Duo_Duo_Pos, shake_cont.Above_Dong_Gua_T_Pos,shake_cont.Dong_Gua_T_Pos,shake_cont.Above_Dong_Gua_T_Pos, shake_cont.Above_Blace_T_Pos,shake_cont.Blace_T_Pos,shake_cont.Above_Blace_T_Pos, shake_cont.Above_Green_T_Pos,shake_cont.Green_T_Pos,shake_cont.Above_Green_T_Pos, shake_cont.Above_Lid_Pos,shake_cont.Back_Sugar_Pos,shake_cont.Above_Sugar_Unspined_Pos, shake_cont.Above_Sugar_Unspined_Pos,shake_cont.Back_Sugar_Pos] pause_list=[1,4,7,10,13,18] shake_cont.SpeedModeToggle(1) for i in range(len(pos_list)): shake_trig.Hiwin_Action.ArmMove(pos_list[i],collate_speed,0,'test point({}/{})'.format(i+1,len(pos_list))) # shake_cont.Animation_Action.ArmMove(pos_list[i],20,0,'test point({}/{})'.format(i+1,len(pos_list))) if i in pause_list: tk.messagebox.showinfo(message='Next Point?') tk.messagebox.showinfo(message='Collation Finished!') # shake_cont.Home(shake_cont.Animation_Action) shake_cont.Home(shake_trig.Hiwin_Action) shake_cont.InitData(-shake_cont.delt_z) def Collation(): collate = tk.Toplevel() collate.title('Coordinate Collation') collate.geometry('620x355') collate.wm_attributes("-topmost",1) def CollateOK(): collate.destroy() # shake_cont.Home(shake_cont.Animation_Action) shake_cont.Home(shake_trig.Hiwin_Solo_Action) arm_test = tk.Button(collate,text='Arm Test',font=('Arial', 15),width=45,height=2,command=ArmTestAct) arm_test.place(x=50,y=35) left_collate = tk.Button(collate,text='Left',font=('Arial', 15),width=19,height=2,command=LeftCollate) left_collate.place(x=50,y=110) right_collate = tk.Button(collate,text='Right',font=('Arial', 15),width=19,height=2,command=RightCollate) right_collate.place(x=335,y=110) pos_collate = tk.Button(collate,text='Pos',font=('Arial', 15),width=12,height=2,command=PosCollate) pos_collate.place(x=50,y=185) cup_collate = tk.Button(collate,text='Cup',font=('Arial', 15),width=12,height=2,command=CupCollate) cup_collate.place(x=230,y=185) lid_collate = tk.Button(collate,text='Lid',font=('Arial', 15),width=12,height=2,command=LidCollate) lid_collate.place(x=410,y=185) collate_ok = tk.Button(collate,text='OK',font=('Arial', 15),width=45,height=2,command=CollateOK) collate_ok.place(x=50,y=260) def BackHome(): collate.destroy() # shake_cont.Home(shake_cont.Animation_Action) shake_cont.Home(shake_trig.Hiwin_Solo_Action) collate.protocol('WM_DELETE_WINDOW', BackHome) collate.mainloop()
[ "tt00621212@gmail.com" ]
tt00621212@gmail.com
5ce0a9c5a2771d2c02defab056fef6f9f18b954d
425348ff17e6dc9bf5e822378aa4c06260ec2e33
/groceries_fwdtest.py
f4a2664871278fde506122239eebfdbc8f61fc05
[]
no_license
themathgeek13/robotautonomyproject2020
002ff2d8b9a058f99611dd3c90086f16f7720660
2e09821ada48872b65d33710d5364e1bca8eedea
refs/heads/master
2022-04-23T19:11:27.451491
2020-04-19T19:00:29
2020-04-19T19:00:29
254,685,153
0
0
null
null
null
null
UTF-8
Python
false
false
6,171
py
import numpy as np import scipy as sp from quaternion import from_rotation_matrix, quaternion from rlbench.environment import Environment from rlbench.action_modes import ArmActionMode, ActionMode from rlbench.observation_config import ObservationConfig from rlbench.tasks import * from perception import CameraIntrinsics, DepthImage def skew(x): return np.array([[0, -x[2], x[1]], [x[2], 0, -x[0]], [-x[1], x[0], 0]]) def sample_normal_pose(pos_scale, rot_scale): ''' Samples a 6D pose from a zero-mean isotropic normal distribution ''' pos = np.random.normal(scale=pos_scale) eps = skew(np.random.normal(scale=rot_scale)) R = sp.linalg.expm(eps) quat_wxyz = from_rotation_matrix(R) return pos, quat_wxyz class RandomAgent: def act(self, obs): delta_pos = [(np.random.rand() * 2 - 1) * 0.005, 0, 0] delta_quat = [0, 0, 0, 1] # xyzw gripper_pos = [np.random.rand() > 0.5] return delta_pos + delta_quat + gripper_pos class NoisyObjectPoseSensor: def __init__(self, env): self._env = env self._pos_scale = [0.005] * 3 self._rot_scale = [0.01] * 3 def get_poses(self): objs = self._env._scene._active_task.get_base().get_objects_in_tree(exclude_base=True, first_generation_only=False) obj_poses = {} for obj in objs: name = obj.get_name() pose = obj.get_pose() pos, quat_wxyz = sample_normal_pose(self._pos_scale, self._rot_scale) gt_quat_wxyz = quaternion(pose[6], pose[3], pose[4], pose[5]) perturbed_quat_wxyz = quat_wxyz * gt_quat_wxyz pose[:3] += pos pose[3:] = [perturbed_quat_wxyz.x, perturbed_quat_wxyz.y, perturbed_quat_wxyz.z, perturbed_quat_wxyz.w] obj_poses[name] = pose return obj_poses if __name__ == "__main__": action_mode = ActionMode(ArmActionMode.ABS_EE_POSE_PLAN) # See rlbench/action_modes.py for other action modes env = Environment(action_mode, '', ObservationConfig(), False) task = env.get_task(PutGroceriesInCupboard) # available tasks: EmptyContainer, PlayJenga, PutGroceriesInCupboard, SetTheTable agent = RandomAgent() obj_pose_sensor = NoisyObjectPoseSensor(env) descriptions, obs = task.reset() print(descriptions) # Set all the object poses (create function because it might change if you drop something) def coffee(): return obj_pose_sensor.get_poses()["coffee_grasp_point"] def chocolate_jello(): return obj_pose_sensor.get_poses()["chocolate_jello_grasp_point"] def crackers(): return obj_pose_sensor.get_poses()["crackers_grasp_point"] def mustard(): return obj_pose_sensor.get_poses()["mustard_grasp_point"] def soup(): return obj_pose_sensor.get_poses()["soup_grasp_point"] def spam(): return obj_pose_sensor.get_poses()["spam_grasp_point"] def strawberry_jello(): return obj_pose_sensor.get_poses()["strawberry_jello_grasp_point"] # Set all the waypoints waypoint1 = obj_pose_sensor.get_poses()["waypoint1"] waypoint2 = obj_pose_sensor.get_poses()["waypoint2"] waypoint3 = obj_pose_sensor.get_poses()["waypoint3"] # just outside cupboard waypoint4 = obj_pose_sensor.get_poses()["waypoint4"] # lower shelf of cupboard startpose = obs.gripper_pose # Go to location above the center of workspace (waypoint 2) #task.step(waypoint2.tolist()+[1]) # Now go to crackers task.step(crackers().tolist()+[1]) # Now close the gripper to try picking it up (close gripper) task.step((obs.gripper_pose).tolist()+[0]) # Now move to waypoint 2 then waypoint 3 once again (but keep the gripper closed) #task.step(waypoint2.tolist()+[0]) task.step(waypoint3.tolist()+[0]) task.step(waypoint4.tolist()+[0]) # Now drop it. task.step((obs.gripper_pose).tolist()+[1]) ####################################################################### # Now move back to startpose task.step(waypoint3.tolist()+[1]) #task.step(startpose.tolist()+[1]) # Now pick up coffee task.step(coffee().tolist()+[1]) # Now close the gripper to try picking it up (close gripper) task.step((obs.gripper_pose).tolist()+[0]) # Now move to waypoint 2 once again (but keep the gripper closed) #task.step(waypoint2.tolist()+[0]) task.step(waypoint3.tolist()+[0]) task.step(waypoint4.tolist()+[0]) # Now drop it. task.step((obs.gripper_pose).tolist()+[1]) ###################################################################### # Now move back to waypoint3 task.step(waypoint3.tolist()+[1]) #task.step(startpose.tolist()+[1]) # Now pick up the mustard task.step(mustard().tolist()+[1]) # Now close the gripper to try picking it up (close gripper) task.step((obs.gripper_pose).tolist()+[0]) # Now move to waypoint 2 once again (but keep the gripper closed) #task.step(waypoint2.tolist()+[0]) task.step(waypoint3.tolist()+[0]) task.step(waypoint4.tolist()+[0]) # Now drop it. task.step((obs.gripper_pose).tolist()+[1]) ###################################################################### # Now move back to waypoint3 task.step(waypoint3.tolist()+[1]) #task.step(startpose.tolist()+[1]) # Now pick up the spam task.step(spam().tolist()+[1]) # Now close the gripper to try picking it up (close gripper) task.step((obs.gripper_pose).tolist()+[0]) # Now move to waypoint 2 once again (but keep the gripper closed) #task.step(waypoint2.tolist()+[0]) task.step(waypoint3.tolist()+[0]) task.step(waypoint4.tolist()+[0]) # Now drop it. task.step((obs.gripper_pose).tolist()+[1]) ###################################################################### # Now move back to waypoint3 task.step(waypoint3.tolist()+[1]) #task.step(startpose.tolist()+[1]) # Now pick up the strawberry jello task.step(strawberry_jello().tolist()+[1]) # Now close the gripper to try picking it up (close gripper) task.step((obs.gripper_pose).tolist()+[0]) # Now move to waypoint 2 once again (but keep the gripper closed) #task.step(waypoint2.tolist()+[0]) task.step(waypoint3.tolist()+[0]) task.step(waypoint4.tolist()+[0]) # Now drop it. task.step((obs.gripper_pose).tolist()+[1]) env.shutdown()
[ "themathgeek13@gmail.com" ]
themathgeek13@gmail.com
1ab06a77f35eb8d3293bafaa982d6bf715318a5c
40785f93b9db553b365ba5afc648ca6146002219
/storage_down.py
4522ff112393f19aab4b7b592539b2fba40fddc0
[]
no_license
Juanmanuelramirez/storage_python_gcp
c088297baff7aee9f547168796344a7e6090b5cb
a1729bf6cc90502a53ef18b7f590b55443f8cdbd
refs/heads/main
2023-02-21T17:18:35.528633
2021-01-25T22:16:31
2021-01-25T22:16:31
332,898,586
0
0
null
null
null
null
UTF-8
Python
false
false
962
py
# -*- coding: utf-8 -*- """ Created on Mon Jan 25 16:02:47 2021 @author: juan m ramรญrez """ from google.cloud import storage def download_blob(bucket_name, source_blob_name, destination_file_name): """Downloads a blob from the bucket.""" bucket_name = "my-photos" source_blob_name = "storage-object-name" destination_file_name = "./puppy02.png" storage_client = storage.Client() bucket = storage_client.bucket(bucket_name) # Construct a client side representation of a blob. # Note `Bucket.blob` differs from `Bucket.get_blob` as it doesn't retrieve # any content from Google Cloud Storage. As we don't need additional data, # using `Bucket.blob` is preferred here. blob = bucket.blob(source_blob_name) blob.download_to_filename(destination_file_name) print( "Blob {} downloaded to {}.".format( source_blob_name, destination_file_name ) )
[ "juanmanuelramirez@users.noreply.github.com" ]
juanmanuelramirez@users.noreply.github.com
5088bebe0a74fe7a49d2306ad3b49bf4a1f417e8
b3aa8da5d15267f9d644dd4a97678deda34edf20
/management/urls_v1.py
666c1d886cb4f9ec954e1883510dfc9ae035c2cb
[]
no_license
igarcez/quarantine-help-api
e6a79a7b8a71d50446ddb59db48afe35452c531e
af0563345c16cddc0c87f0d6f60f23b1f885c82b
refs/heads/master
2021-05-22T17:45:17.010174
2020-04-04T15:38:11
2020-04-04T15:38:11
253,026,248
0
0
null
2020-04-04T15:02:57
2020-04-04T15:02:57
null
UTF-8
Python
false
false
298
py
from django.urls import path from management.views import ListCreateRequestsAPIV1, MeRequestDetailAPIV1 urlpatterns = [ path("requests/", ListCreateRequestsAPIV1.as_view(), name="create_list_requests"), path("requests/<int:pk>/", MeRequestDetailAPIV1.as_view(), name="detail_request"), ]
[ "tony.thomas@keyflow.se" ]
tony.thomas@keyflow.se
61448bc81242a735d68558bf06e984de2a08c430
5e5b1a6cb0d3afe2c0b8e8ff36b53279c453b81b
/POC/POC/urls.py
ea1bc30c604473692e0068cacf39a74b4058abc1
[]
no_license
akshayratimani/GITProjects
a422addd407680097d14fbc1e5e4c78c8a81b96a
1ba9e272c11693337b7b295ab9dedcba75904525
refs/heads/master
2022-12-21T09:06:37.344947
2019-08-22T04:56:57
2019-08-22T04:56:57
195,341,518
0
0
null
2022-12-10T05:34:59
2019-07-05T05:00:40
Python
UTF-8
Python
false
false
792
py
"""POC URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include urlpatterns = [ path('', include('LogReg.urls')), path('admin/', admin.site.urls), ]
[ "akshay.ratimani@gmail.com" ]
akshay.ratimani@gmail.com
e2a9bbdc2ea7cc162fcbc32b492bac04782e2765
a01eb0b3e5f1ab895aa2873154c1e30d67a26767
/venv/lib/site-packages/recordclass/dataclass.py
6314b71002756048efa70598bfc80df6e0ab70b5
[]
no_license
edonadini/SM_Exam
bb20af3826388d34459cbaf79ea57d65757772a5
e1e3cb9ca47e4224c856bb1d9f3477e8fb844e14
refs/heads/master
2022-04-17T16:08:07.735003
2020-02-21T10:30:27
2020-02-21T10:30:27
239,159,329
0
0
null
2020-02-18T17:18:03
2020-02-08T15:59:40
Python
UTF-8
Python
false
false
6,990
py
# coding: utf-8 # The MIT License (MIT) # Copyright (c) ยซ2015-2020ยป ยซShibzukhov Zaur, szport at gmail dot comยป # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software - recordclass library - and associated documentation files # (the "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, distribute, # sublicense, and/or sell copies of the Software, and to permit persons to whom # the Software is furnished to do so, subject to the following conditions: # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. from .utils import dataslot_offset from .utils import check_name, collect_info_from_bases import sys as _sys _PY3 = _sys.version_info[0] >= 3 _PY36 = _PY3 and _sys.version_info[1] >= 6 from keyword import iskeyword as _iskeyword if _PY3: _intern = _sys.intern def _isidentifier(s): return s.isidentifier() if _PY36: from typing import _type_check else: def _type_check(t, msg): if isinstance(t, (type, str)): return t else: raise TypeError('invalid type annotation', t) else: from __builtin__ import intern as _intern import re as _re def _isidentifier(s): return _re.match(r'^[a-z_][a-z0-9_]*$', s, _re.I) is not None def _type_check(t, msg): return t def make_dataclass(typename, fields=None, bases=None, namespace=None, varsize=False, use_dict=False, use_weakref=False, hashable=True, sequence=False, mapping=False, iterable=False, readonly=False, defaults=None, module=None, argsonly=False, gc=False): from ._dataobject import _clsconfig, _enable_gc from ._dataobject import dataobject, datatuple from .datatype import datatype annotations = {} if isinstance(fields, str): fields = fields.replace(',', ' ').split() fields = [fn.strip() for fn in fields] else: msg = "make_dataclass('Name', [(f0, t0), (f1, t1), ...]); each t must be a type" field_names = [] if isinstance(fields, dict): for fn, tp in fields.items(): tp = _type_check(tp, msg) check_name(fn) fn = _intern(fn) annotations[fn] = tp field_names.append(fn) else: for fn in fields: if type(fn) is tuple: fn, tp = fn tp = _type_check(tp, msg) annotations[fn] = tp check_name(fn) fn = _intern(fn) field_names.append(fn) fields = field_names typename = check_name(typename) if defaults is not None: n_fields = len(fields) defaults = tuple(defaults) n_defaults = len(defaults) if n_defaults > n_fields: raise TypeError('Got more default values than fields') else: defaults = None options = { 'readonly':readonly, 'defaults':defaults, 'argsonly':argsonly, 'sequence':sequence, 'mapping':mapping, 'iterable':iterable, 'use_dict':use_dict, 'use_weakref':use_weakref, 'readonly':readonly, 'hashable':hashable, 'gc':gc, } if namespace is None: ns = {} else: ns = namespace.copy() if defaults: for i in range(-n_defaults, 0): fname = fields[i] val = defaults[i] ns[fname] = val if use_dict and '__dict__' not in fields: fields.append('__dict__') if use_weakref and '__weakref__' not in fields: fields.append('__weakref__') ns['__options__'] = options ns['__fields__'] = fields if annotations: ns['__annotations__'] = annotations if bases: base0 = bases[0] if varsize: if not isinstance(base0, datatuple): raise TypeError("First base class should be subclass of datatuple") else: if not isinstance(base0, dataobject): raise TypeError("First base class should be subclass of dataobject") else: if varsize: bases = (datatuple,) else: bases = (dataobject,) if varsize: _sequence = True else: _sequence = sequence if module is None: try: module = _sys._getframe(1).f_globals.get('__name__', '__main__') except (AttributeError, ValueError): pass ns['__module__'] = module cls = datatype(typename, bases, ns) if gc: _enable_gc(cls) return cls make_class = make_dataclass def asdict(ob): _getattr = getattr return {fn:_getattr(ob, fn) for fn in ob.__class__.__fields__} class DataclassStorage: # def __init__(self): self._storage = {} # def make_dataclass(self, name, fields): fields = tuple(fields) key = (name, fields) cls = self._storage.get(key, None) if cls is None: cls = make_dataclass(name, fields) self._storage[key] = cls return cls make_class = make_dataclass def join_dataclasses(name, classes, readonly=False, use_dict=False, gc=False, use_weakref=False, hashable=True, sequence=False, argsonly=False, iterable=False, module=None): from ._dataobject import dataobject, datatuple if not all(issubclass(cls, dataobject) for cls in classes): raise TypeError('All arguments should be child of dataobject') for cls in classes: if isinstance(cls, datatuple): raise TypeError('The class', cls, 'should not be a subclass of datatuple') if not all(hasattr(cls, '__fields__') for cls in classes): raise TypeError('Some of the base classes has not __fields__') _attrs = [] for cls in classes: for a in cls.__fields__: if a in _attrs: raise AttributeError('Duplicate attribute in the base classes') _attrs.append(a) return make_dataclass(name, _attrs, readonly=readonly, use_dict=use_dict, gc=gc, use_weakref=use_weakref, hashable=hashable, sequence=sequence, iterable=iterable, module=module)
[ "fedes770@gmail.com" ]
fedes770@gmail.com
7a024d0157cfc178d4f1771c56c94ee8a96ad515
fd41984178ffba0846fa7ab1f67c1a0843a5e3ff
/่‡ชๅŠจๅŒ–ๅŠžๅ…ฌไธŽ้ผ ๆ ‡้”ฎ็›˜ๆจกๆ‹Ÿ/2.่ฏปๅ–PDFๆ–‡ไปถ/่ฏปๅ–PDFๆ–‡ไปถ.py
f2f9dc6056b35277a8a88b16d765a546092ed2d4
[]
no_license
LasterSmithKim/Python-Base
23f17472ee80f7224e96a4185775c9cd05ac7a98
27756126d999ddabf53b6bdc7114903a297464a0
refs/heads/master
2020-03-28T08:00:11.156911
2018-11-28T09:54:51
2018-11-28T09:54:51
147,939,778
0
0
null
null
null
null
UTF-8
Python
false
false
2,066
py
import sys import importlib importlib.reload(sys) from pdfminer.pdfparser import PDFParser,PDFDocument from pdfminer.pdfinterp import PDFResourceManager,PDFPageInterpreter from pdfminer.converter import PDFPageAggregator from pdfminer.layout import LTTextBoxHorizontal,LAParams from pdfminer.pdfinterp import PDFTextExtractionNotAllowed def readPDF(path,toPath): #ไปฅไบŒ่ฟ›ๅˆถๅฝขๅผๆ‰“ๅผ€PDFๆ–‡ไปถ f = open(path,"rb") #ๅˆ›ๅปบ็ฎก็†ๅ™จ-pdfๆ–‡ๆกฃๅˆ†ๆžๅ™จ parser = PDFParser(f) #ๅˆ›ๅปบไธ€ไธชpdfๆ–‡ๆกฃ pdfFile = PDFDocument() #้“พๆŽฅๅˆ†ๆžๅ™จไธŽๆ–‡ๆกฃๅฏน่ฑก(ๅˆ†ๆžๅ™จๅ’Œๆ–‡ไปถๅŒๅ‘้“พๆŽฅ๏ผ‰ parser.set_document(pdfFile) pdfFile.set_parser(parser) #ๆไพ›ๅˆๅง‹ๅŒ–ๅฏ†็  pdfFile.initialize() #ๆฃ€ๆต‹ๆ–‡ๆกฃๆ˜ฏๅฆๆไพ›txt่ฝฌๆข if not pdfFile.is_extractable: raise PDFTextExtractionNotAllowed else: #่งฃๆžๆ•ฐๆฎ #ๆ•ฐๆฎ็ฎก็†ๅ™จ manager = PDFResourceManager() #ๅˆ›ๅปบไธ€ไธชPDF่ฎพๅค‡็š„ๅฏน่ฑก laparams = LAParams() device = PDFPageAggregator(manager,laparams=laparams) #ๅˆ›ๅปบ่งฃ้‡Šๅ™จๅฏน่ฑก interpreter = PDFPageInterpreter(manager,device) #ๅผ€ๅง‹ๅพช็Žฏๅค„็†๏ผŒๆฏๆฌกๅค„็†ไธ€้กต for page in pdfFile.get_pages(): interpreter.process_page(page) #ๅˆ›ๅปบๆถ‚ๅฑ‚๏ผŒๅพช็Žฏๅค„็†ๆถ‚ๅฑ‚ layout = device.get_result() for x in layout: #ๅˆคๆ–ญ x ๆ˜ฏๅฆๆ˜ฏ LTTextBoxHorizontal็ฑปๅž‹็š„ๆ•ฐๆฎ if(isinstance(x,LTTextBoxHorizontal)): with open(toPath,"a") as f: str = x.get_text() #print(str) f.write(str+"\n") path = r"/Users/jinpeihua/PycharmProjects/Python่ฏญ่จ€ๅŸบ็ก€่ง†้ข‘่ฏพ็จ‹/ๅ…ฅ้—จๆ•™็จ‹ไธ€/่‡ชๅŠจๅŒ–ๅŠžๅ…ฌไธŽ้ผ ๆ ‡้”ฎ็›˜ๆจกๆ‹Ÿ/2.่ฏปๅ–PDFๆ–‡ไปถ/LegalNotices.pdf" toPath = r"/Users/jinpeihua/PycharmProjects/Python่ฏญ่จ€ๅŸบ็ก€่ง†้ข‘่ฏพ็จ‹/ๅ…ฅ้—จๆ•™็จ‹ไธ€/่‡ชๅŠจๅŒ–ๅŠžๅ…ฌไธŽ้ผ ๆ ‡้”ฎ็›˜ๆจกๆ‹Ÿ/2.่ฏปๅ–PDFๆ–‡ไปถ/a.txt" readPDF(path,toPath)
[ "kingone@yeah.net" ]
kingone@yeah.net
7b684337197c473ca2fbb5bd628978519553e9fb
2f07911e75ded21b80cae89ded82ce38f03a7931
/example.py
95c0f6863c126d023a70847fc9d9b552a45d593c
[]
no_license
benmaier/radial-distance-layout
2b1571c34dd167301bfb8ea9750a177ac420cda9
9be12e2906138e239e72eeb6082ebcd3d569b3dc
refs/heads/master
2022-02-23T08:09:58.174365
2022-02-12T21:44:41
2022-02-12T21:44:41
50,359,905
3
2
null
null
null
null
UTF-8
Python
false
false
806
py
from radial_distance_layout import radial_distance_layout import matplotlib.pyplot as pl import networkx as nx paths = [ [ 'a','b','c'] ] paths += [ [ 'a','b','d'] ] paths += [ [ 'a','e','f','g'] ] paths += [ [ 'a','e','f','h'] ] paths += [ [ 'a','e','i'] ] paths += [ [ 'a','j','k'] ] paths += [ [ 'a','j','l'] ] dists = {'a': 0, 'b':1.1, 'e': 1.2, 'j': 1.4, 'c':2.1, 'd': 2.2, 'f': 2.1, 'i': 2.34, 'k':3.8, 'l':2.5, 'g': 3.9, 'h': 3.8} T = nx.DiGraph() for p in paths: T.add_path(p) keystr = 'dist' nx.set_node_attributes(T,keystr,dists) fig,ax = pl.subplots(1,2,figsize=(15,8)) pos = radial_distance_layout(T,keystr,mode='soph') nx.draw_networkx(T,pos,ax=ax[0]) pos = radial_distance_layout(T,keystr,mode='normal') nx.draw_networkx(T,pos,ax=ax[1]) pl.show()
[ "benjaminfrankmaier@gmail.com" ]
benjaminfrankmaier@gmail.com
2578e88ce408cf417424eda2136335cf2eb1c5d0
a851830dbfd27d850e887d1cbc56c906512585d2
/AS0/ps0-4-code.py
7c37625f2438b193a9384e90e5fc0fc757b603e6
[]
no_license
AlexisDrch/Computer-Vision
d6861f1e11401b6c0b131026bc22a76433b74025
dc2687d53af73dd4e973bf969c48ae9f343bd49d
refs/heads/master
2021-01-25T11:55:47.316194
2018-04-06T06:15:49
2018-04-06T06:15:49
123,440,935
8
1
null
null
null
null
UTF-8
Python
false
false
2,549
py
# ### 4. Arithmetic and Geometric operations from scipy import misc from scipy import ndimage import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg # ### a. # input 2 pictures as numpy ndarray picture_1 = misc.imread('./pictures/ps0-1-a-1.jpg') picture_2 = misc.imread('./pictures/ps0-1-a-2.jpg') # set red and blue channel to value 0 mono_g_picture = picture_1.copy() mono_g_picture[:,:,0] = mono_g_picture[:,:,2] = 0 # In[40]: green_mg1_values = mono_g_picture[:,:,1].copy() min_g1_value = np.min(green_mg1_values) max_g1_value = np.max(green_mg1_values) mean_g1_value = np.mean(green_mg1_values) std_g1_value = np.std(green_mg1_values) print('From the MG1 pixel values : min = {} | max = {} | mean = {} | stand dev = {} ' .format(min_g1_value, max_g1_value, mean_g1_value, std_g1_value)) print('\n') print('To compute these values, it is necessary to consider the pixel values as a unique array,' + 'here : the green pixel value of all the instances in the picture (green channel). ' + 'Then, basic mathematic ops can be applied.') # #### b. Operations on mg1 # In[41]: # substracting the mean green_mg1_values = green_mg1_values - mean_g1_value # diving by the std green_mg1_values = green_mg1_values / std_g1_value # multiply by 10 green_mg1_values = green_mg1_values * 10 # add mean green_mg1_values = green_mg1_values + mean_g1_value # plot (for notebook) and output the resulting picture mono_g_picture_flat = mono_g_picture.copy() mono_g_picture_flat[:,:,1] = green_mg1_values #plt.imshow(mono_g_picture_flat) #plt.title('Flat M1g') #plt.show() mpimg.imsave('./output/ps0-4-b-1.jpg', mono_g_picture_flat) # #### c. Shift M1g # In[42]: shifted_mg1 = mono_g_picture.copy() #shift two pixels to the left, except two last columns for i in range(512): for j in range(510): shifted_mg1[i,j] = shifted_mg1[i, j+2] # plot (for notebook) and output resulting picture #plt.imshow(shifted_mg1) #plt.show() mpimg.imsave('./output/ps0-4-c-1.jpg', shifted_mg1) # #### d. M1g - shiftedM1g # In[47]: sub_m1g = mono_g_picture - shifted_mg1 # verif that green chanel has valid values (not < 0) verif_array = np.where(sub_m1g < 0) print(verif_array) # plot (for notebook) and output resulting picture #plt.imshow(sub_m1g) #plt.show() mpimg.imsave('./output/ps0-4-d-1.jpg', sub_m1g) # The value of a pixel represent its light intensity. Since negative light intensity doesn't exist, negative value for a pixel is a bug, and does not represent a physical quantity. exit()
[ "aleksi.durocher@wanadoo.fr" ]
aleksi.durocher@wanadoo.fr
23993e6b312f5319a07ecd4680effe7fcf0d9c67
0561e7ef249845903457870b50331977af95bb7c
/networks/pemp_stage2.py
63de0014b8370800d1d72b8f18b2ed17c6a45622
[ "MIT" ]
permissive
Jarvis73/PEMP
70412d5d600aaabf13eaedea9fe0af0f02d2785c
d7a300f8b7565efe478473ee4a7ee63bf0031c8c
refs/heads/main
2023-05-27T22:24:30.209445
2021-06-07T07:00:57
2021-06-07T07:00:57
372,802,221
8
1
null
null
null
null
UTF-8
Python
false
false
11,778
py
from collections import OrderedDict from pathlib import Path import torch import torch.nn as nn import torch.nn.functional as F from networks import backbones from networks.pemp_stage1 import net_ingredient, PEMPStage1, pretrained_weights, backbone_error PriorNet = PEMPStage1 @net_ingredient.config def priornet_config(): backbone2 = "resnet50" # str, structure of the feature extractor. Default to stage1's backbone. [vgg16, resnet50, resnet101] protos2 = 3 # int, number of prototypes per class drop_rate2 = 0.5 # float, drop rate used in the Dropout of the purifier cm = True # bool, use communication module class PEMPStage2(backbones.BaseModel, nn.Module): """ Stage 1 of the proposed Prior-Enhanced network with Meta-Prototypes. Parameters ---------- shot: int Number of support images in each episode query: int Number of query images in each episode. Fixed to 1. backbone, backbone2, init_channels, out_channels, protos2, drop_rate2, cm: [Config] Notes ----- Parameters denoted with '[Config]' are autofilled by sacred configuration and there is no need to manually input. """ @net_ingredient.capture def __init__(self, shot, query, logger, backbone, backbone2, init_channels, out_channels, protos2, drop_rate2, cm): super(PEMPStage2, self).__init__() if not backbone2: backbone2 = backbone pretrained = pretrained_weights[backbone2] if backbone2 == "vgg16": self.encoder = nn.Sequential(OrderedDict([ ('backbone', backbones.VGG16CM(init_channels + 1, pretrained=pretrained, lastRelu=False, shot_query=shot + query)) ])) self.__class__.__name__ = "PEMP_Stage2/VGG16" + cm * "+CM" elif backbone2 == "resnet50": self.encoder = nn.Sequential(OrderedDict([ ('backbone', backbones.ResNetCM(init_channels + 1, backbones.BottleNeck, layers=[3, 4, 6], freeze_bn=True, ret_features=False, pretrained=pretrained, shot_query=shot + query)), ('purifier', nn.Sequential( nn.Conv2d(1024, 256, kernel_size=1, stride=1, bias=True), nn.ReLU(), nn.Dropout2d(drop_rate2), nn.Conv2d(256, 256, kernel_size=3, stride=1, padding=1, bias=True), nn.ReLU(), nn.Dropout2d(drop_rate2), backbones.ASPP(inc=256, midc=256, outc=out_channels, drop_rate=drop_rate2))) ])) self.__class__.__name__ = f"PEMP_Stage2/Resnet50" + cm * "+CM" elif backbone2 == "resnet101": self.encoder = nn.Sequential(OrderedDict([ ('backbone', backbones.ResNetCM(init_channels + 1, backbones.BottleNeck, layers=[3, 4, 23], freeze_bn=True, ret_features=False, pretrained=pretrained, shot_query=shot + query)), ('purifier', nn.Sequential( nn.Conv2d(1024, 256, kernel_size=1, stride=1, bias=True), nn.ReLU(), nn.Dropout2d(drop_rate2), nn.Conv2d(256, 256, kernel_size=3, stride=1, padding=1, bias=True), nn.ReLU(), nn.Dropout2d(drop_rate2), backbones.ASPP(inc=256, midc=256, outc=out_channels, drop_rate=drop_rate2))) ])) self.__class__.__name__ = f"PEMP_Stage2/Resnet50" + cm * "+CM" else: raise ValueError(backbone_error.format(backbone2)) if protos2 > 0: self.ctr = torch.nn.Parameter(torch.rand(out_channels, protos2 * 2), requires_grad=True) else: self.ctr = None logger.info(f" ==> Model {self.__class__.__name__} created") def forward(self, sup_img, sup_mask, qry_img, qry_prior, out_shape=None, ret_ind=False): """ Parameters ---------- sup_img: torch.Tensor, Support images of the shape [B, S, 3, H, W] and dtype float32 sup_mask: torch.Tensor Support labels of the shape [B, S, 2, H, W] and dtype float32 qry_img: torch.Tensor Query images of the shape [B, Q, 3, H, W] and dtype float32 qry_prior: torch.Tensor Query prior of the shape [BQ, 1, H, W] width dtype float32 out_shape : tuple Output size of the prediction. A tuple of two integers. ret_ind: bool Return indices of prediction map for visualization. Notes ----- Boundary pixels (mask=255) are ignored during training/testing. Therefore sup_mask_fg and sup_mask_bg are not complementary and both of them need to be provided. """ B, S, channel, H, W = sup_img.size() Q = qry_img.size(1) # Input channel 1-3: Images img_cat = torch.cat((sup_img, qry_img), dim=1).view(B * (S + Q), channel, H, W) # Input channel 4: Pirors sup_prior = sup_mask[:, :, :1] # support masks used as the prior # [B, S, 1, H, W] qry_prior = qry_prior.view(B, Q, *qry_prior.shape[-3:]) # [B, Q, 1, H, W] prior_cat = torch.cat((sup_prior, qry_prior.float()), dim=1) prior_cat = prior_cat.view(B * (S + Q), 1, H, W) inputs = torch.cat((img_cat, prior_cat), dim=1) # [B(S + Q), 4, H, W] features = self.encoder((inputs, prior_cat)) # [B(S + Q), c, h, w] _, c, h, w = features.size() features = features.view(B, S + Q, c, h, w) # [B, S + Q, c, h, w] sup_fts = features[:, :S] # [B, S, c, h, w] qry_fts = features[:, S:] # [B, Q, c, h, w] sup_mask = sup_mask.view(B * S, 2, H, W) # [BS, 2, H, W] sup_mask = F.interpolate(sup_mask, (h, w), mode="nearest") # [BS, 2, h, w] sup_mask_fg, sup_mask_bg = sup_mask.unbind(dim=1) # [BS, h, w] pred = self.mpm(sup_fts, qry_fts, sup_mask_fg, sup_mask_bg, ret_ind) # [BQ, 2, h, w] if out_shape is None: out_shape = (H, W) if ret_ind: pred, response = pred output = F.interpolate(pred, out_shape, mode='bilinear', align_corners=True) # [BQ, 2, H, W] response = F.interpolate(response.unsqueeze(dim=1).float(), out_shape, mode='nearest') response = response.squeeze(dim=1).long() # [BQ, H, W] return output, response else: output = F.interpolate(pred, out_shape, mode='bilinear', align_corners=True) # [BQ, 2, H, W] return output @net_ingredient.capture def mpm(self, sup_fts, qry_fts, sup_fg, sup_bg, ret_ind, protos2): B, S, c, h, w = sup_fts.shape sup_fts = sup_fts.reshape(-1, c, h * w) qry_fts = qry_fts.reshape(-1, c, 1, h, w) sup_fg = sup_fg.view(-1, 1, h * w) # [BS, 1, hw] sup_bg = sup_bg.view(-1, 1, h * w) # [BS, 1, hw] if self.ctr is not None: ctr = self.ctr.view(1, c, protos2 * 2) # [1, c, 2p] mask = torch.stack((sup_fg, sup_bg), dim=1) # [BS, 2, 1, hw] D = -((sup_fts.unsqueeze(dim=2) - ctr.unsqueeze(dim=3)) ** 2).sum(dim=1) # [BS, 2p, hw] D = D.view(-1, 2, protos2, h * w) # [BS, 2, p, hw] D = (torch.softmax(D, dim=2) * mask).view(-1, 1, protos2 * 2, h * w) # [BS, 1, 2p, hw] masked_fts = sup_fts.view(-1, c, 1, h * w) * D # [BS, c, 2p, hw] ctr = (masked_fts.sum(dim=3) / (D.sum(dim=3) + 1e-6)).view(B, S, c, 2, protos2) # [B, S, c, 2, p] ctr = ctr.transpose(3, 4).reshape(B, S, c * protos2, 2) # [B, S, cp, 2] ctr = ctr.mean(dim=1) # [B, cp, 2] self.adaptive_p = ctr.view(B, c, protos2, 2).transpose(2, 3).reshape(B, c, -1) # [B, c, 2p] fg_proto, bg_proto = ctr.view(B, c, protos2, 2).unbind(dim=3) # [B, c, p] max_v = self.compute_similarity(fg_proto, bg_proto, qry_fts).max(dim=2) pred = max_v.values # [BQ, 2, h, w] if ret_ind: ind = max_v.indices # [BQ, 2, h, w] response = ind[:, 0].clone() # background select = pred.argmax(dim=1) == 1 response[select] = ind[:, 1][select] + 3 # foreground return pred, response else: fg_vecs = torch.sum(sup_fts * sup_fg, dim=-1) / (sup_fg.sum(dim=-1) + 1e-5) # [BS, c] bg_vecs = torch.sum(sup_fts * sup_bg, dim=-1) / (sup_bg.sum(dim=-1) + 1e-5) # [BS, c] fg_proto = fg_vecs.view(B, S, c).mean(dim=1) bg_proto = bg_vecs.view(B, S, c).mean(dim=1) pred = self.compute_similarity(fg_proto, bg_proto, qry_fts.view(-1, c, h, w)) # [BQ, 2, h, w] return pred @net_ingredient.capture def compute_similarity(self, fg_proto, bg_proto, qry_fts, dist_scalar): """ Make prediction on the query image according to the foreground prototype and the background prototype. Parameters ---------- fg_proto: torch.Tensor Foreground prototype with the shape of [B, c] bg_proto: torch.Tensor Background prototype with the shape of [B, c] qry_fts: torch.Tensor Query feature maps extracted from the backbone with the shape of [BQ, c, h, w] dist_scalar: float, int [Config] Distance scalar when computing similarity. Returns ------- pred: torch.Tensor Prediction of the query image segmentation with the shape of [BQ, 2, p, h, w] """ fg_distance = F.cosine_similarity( qry_fts, fg_proto[..., None, None], dim=1) * dist_scalar # [BQ, 3, h, w] bg_distance = F.cosine_similarity( qry_fts, bg_proto[..., None, None], dim=1) * dist_scalar # [BQ, 3, h, w] pred = torch.stack((bg_distance, fg_distance), dim=1) # [BQ, 2, 3, h, w] return pred ModelClass = PEMPStage2
[ "zjw.math@qq.com" ]
zjw.math@qq.com
f9088491167a8f8b689fd4cfdb455a3caa9daabc
6d85b0c31816d14e37ff2e9ba29edc700aeb072d
/tests/test_log_post.py
cdbc5b26ebfb60308d6fb50a78fe0877b4e746e6
[]
no_license
shayan-7/accesshandler
6221fddf23add8d5d70d7cf4d9494a86ad64e51f
22e25dcbc557f8c3ba087c9480876637db95941d
refs/heads/master
2020-12-30T04:59:44.717051
2020-02-22T11:39:18
2020-02-22T11:39:18
238,868,370
1
0
null
null
null
null
UTF-8
Python
false
false
1,602
py
from bddrest import status, given, when from accesshandler.models import Rule from accesshandler.cache import redisconnection, keystr from .helpers import LocalApplicableTestCase class TestLog(LocalApplicableTestCase): @classmethod def mockup(cls): session = cls.create_session() cls.rule1 = Rule(pattern='/foo/bar', limit='2/min', is_exact_url=True) session.add(cls.rule1) cls.rule2 = Rule(pattern='/foo/.*', limit='2/min') session.add(cls.rule2) session.commit() def test_post(self): redisconn = redisconnection() redisconn.flushdb() json = dict(url=self.rule1.pattern, IP='1.1.1.1') with self.given( 'Post a log to check if passed the limit or not', '/apiv1/logs', 'POST', json=json, ): assert status == 200 assert redisconn.get(keystr(json['IP'], json['url'])) == b'1' when('The specific IP viewed the url one more time') assert status == 200 assert redisconn.get(keystr(json['IP'], json['url'])) == b'2' when('The specific IP viewed the url more than valid limitation') assert status == 429 assert redisconn.get(keystr(json['IP'], json['url'])) == b'3' when( 'IP field is not in form', json=given - 'IP', ) assert status == 400 when( 'URL field is not in form', json=given - 'url', ) assert status == 400
[ "shayan.rokrok@gmail.com" ]
shayan.rokrok@gmail.com
0266bd7134271024524ddc5c990c861f50637257
33e6e2263f5119b9c636a0bcd709d1640ac4e3ad
/ex/ch4-6.py
84ef988befad8c221b56e13a508437158c808018
[]
no_license
jonsant/python
5efee9c4314acedf2ef137cc432910963303ea0c
9f42e2334e40cb59d70ede63f682c94130e84c7d
refs/heads/master
2020-07-01T15:11:06.297789
2019-09-06T07:40:36
2019-09-06T07:40:36
201,206,113
0
0
null
null
null
null
UTF-8
Python
false
false
71
py
numbers = list(range(1, 21, 2)) for number in numbers: print(number)
[ "jonssonanton@hotmail.com" ]
jonssonanton@hotmail.com
1145c0f615ad23c04858d918f11de82d472a12dc
ad3f8004c9618b682be086976b4e684020983614
/AVByPass/asgi.py
2bcce0d7cc7db17592d7ffc2947300ba2e95b410
[]
no_license
h1ck0r/AVByPass
772520e8e5ed06e046bccd027f462fe65a044cd8
45756de452cc1f7d079f5b0bdcf942ef51d8094d
refs/heads/main
2023-07-14T07:45:29.311293
2021-08-27T09:05:54
2021-08-27T09:05:54
null
0
0
null
null
null
null
UTF-8
Python
false
false
393
py
""" ASGI config for AVByPass project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'AVByPass.settings') application = get_asgi_application()
[ "1356654790@qq.com" ]
1356654790@qq.com
434fdb58896efe0f73e59f882ed49683762ff4ed
c78e4099ed26a16e10c6c84fa1340ecab87543f2
/userbot/__main__.py
1acb072dc64b8265230aca7f8b60fbdbe52a84c0
[ "MIT" ]
permissive
Azharjacx/NandiOXbot
6cd903636249471470b2d6fe3d5c29e6cb5541f4
c1ee9162123d4ecda1da79124ae1219d79e148a0
refs/heads/master
2022-04-17T02:20:15.729587
2020-04-18T17:47:21
2020-04-18T17:47:21
256,779,578
0
0
MIT
2020-04-18T14:53:51
2020-04-18T14:53:51
null
UTF-8
Python
false
false
8,938
py
from userbot import bot from sys import argv import sys from telethon.errors.rpcerrorlist import PhoneNumberInvalidError import os from telethon import TelegramClient from var import Var from userbot.utils import load_module from userbot import LOAD_PLUG, BOTLOG_CHATID, LOGS from pathlib import Path import asyncio import telethon.utils async def add_bot(bot_token): await bot.start(bot_token) bot.me = await bot.get_me() bot.uid = telethon.utils.get_peer_id(bot.me) if len(argv) not in (1, 3, 4): bot.disconnect() else: bot.tgbot = None if Var.TG_BOT_USER_NAME_BF_HER is not None: print("Initiating Inline Bot") # ForTheGreatrerGood of beautification bot.tgbot = TelegramClient( "TG_BOT_TOKEN", api_id=Var.APP_ID, api_hash=Var.API_HASH ).start(bot_token=Var.TG_BOT_TOKEN_BF_HER) print("Initialisation finished with no errors") print("Starting Userbot") bot.loop.run_until_complete(add_bot(Var.TG_BOT_USER_NAME_BF_HER)) print("Startup Completed") else: bot.start() import glob path = 'userbot/plugins/*.py' files = glob.glob(path) for name in files: with open(name) as f: path1 = Path(f.name) shortname = path1.stem load_module(shortname.replace(".py", "")) import userbot._core print("""Yay your userbot is officially working. Nikal LAVDE โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–“โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–“โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–“โ–’โ–’โ–‘โ–’โ–’โ–’โ–‘โ–’โ–’โ–’โ–’โ–’โ–’โ–“โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–“โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–ˆโ–ˆโ–ˆโ–“โ–“โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–“โ–’โ–’โ–’โ–’โ–’โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–“โ–ˆโ–ˆโ–ˆโ–“โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–“โ–“โ–ˆโ–ˆโ–ˆโ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–’โ–’โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–“โ–‘โ–‘โ–’โ–“โ–ˆโ–ˆโ–“โ–‘โ–‘โ–’โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–“โ–’โ–‘โ–‘โ–‘โ–“โ–ˆโ–ˆโ–ˆโ–’โ–“โ–’โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–“โ–ˆโ–ˆโ–ˆโ–’โ–‘โ–‘โ–’โ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–’โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–’โ–“โ–’โ–“โ–“โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–“โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–’โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–“โ–’โ–ˆโ–“โ–‘โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–“โ–’โ–“โ–’โ–ˆโ–ˆโ–’โ–’โ–“โ–“โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–‘โ–‘โ–‘โ–’โ–‘โ–’โ–ˆโ–ˆโ–“โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–’โ–‘โ–‘โ–‘โ–‘โ–’โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–“โ–ˆโ–“โ–“โ–’โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘ โ–‘โ–’โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–’โ–“โ–’โ–’โ–’โ–’โ–’โ–“โ–“โ–“โ–“โ–ˆโ–ˆโ–‘โ–‘โ–“โ–ˆโ–“โ–‘โ–’โ–’โ–ˆโ–ˆโ–’โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘ โ–‘โ–“โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–’โ–’โ–’โ–“โ–“โ–’โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–“โ–‘โ–’โ–‘โ–’โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–’โ–ˆโ–‘โ–‘ โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–“โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–“โ–ˆโ–‘โ–ˆโ–“โ–‘โ–ˆโ–’โ–ˆโ–“โ–ˆโ–“โ–‘โ–‘โ–ˆโ–‘โ–‘ โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–’โ–’โ–‘โ–’โ–’โ–‘โ–‘โ–“โ–ˆโ–“โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–ˆโ–’โ–’โ–ˆโ–’โ–ˆโ–’โ–“โ–ˆโ–‘โ–‘โ–ˆโ–‘โ–‘ โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–‘โ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–’โ–ˆโ–‘โ–“โ–ˆโ–‘โ–‘ โ–‘โ–’โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–‘โ–ˆโ–“โ–‘โ–‘ โ–‘โ–‘โ–ˆโ–“โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–‘โ–’โ–ˆโ–‘โ–‘โ–‘ โ–‘โ–‘โ–“โ–ˆโ–‘โ–‘โ–’โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–“โ–‘โ–ˆโ–“โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–’โ–‘โ–‘โ–’โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–‘โ–‘โ–ˆโ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–’โ–‘โ–’โ–‘โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–ˆโ–“โ–‘โ–‘โ–‘โ–’โ–‘โ–’โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–‘โ–’โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–ˆโ–“โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–“โ–“โ–“โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–“โ–ˆโ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–’โ–‘โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–‘โ–’โ–’โ–“โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–‘โ–‘โ–ˆโ–“โ–’โ–“โ–“โ–“โ–’โ–‘โ–‘โ–“โ–ˆโ–‘โ–‘โ–‘โ–ˆโ–’โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–’โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–‘โ–’โ–“โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–’โ–ˆโ–‘โ–‘โ–‘โ–‘โ–’โ–“โ–“โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–’โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–’โ–‘โ–‘โ–‘โ–’โ–‘โ–’โ–‘โ–‘โ–‘โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–’โ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–‘โ–’โ–ˆโ–‘โ–‘โ–ˆโ–’โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–‘โ–‘โ–‘โ–’โ–‘โ–’โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–“โ–’โ–’โ–“โ–“โ–“โ–’โ–‘โ–‘โ–“โ–’โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–’โ–’โ–’โ–’โ–“โ–’โ–“โ–“โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–’โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–’โ–‘โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–“โ–‘โ–‘โ–‘โ–ˆโ–“โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–“โ–ˆโ–‘โ–ˆโ–‘โ–ˆโ–‘โ–‘โ–ˆโ–’โ–‘โ–‘โ–ˆโ–’โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–“โ–‘โ–ˆโ–“โ–‘โ–‘โ–“โ–ˆโ–’โ–’โ–ˆโ–’โ–ˆโ–‘โ–ˆโ–’โ–ˆโ–ˆโ–‘โ–‘โ–’โ–ˆโ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–’โ–‘โ–‘โ–‘โ–’โ–‘โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–“โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ–‘โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–ˆโ–ˆโ–“โ–“โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–“โ–ˆโ–ˆโ–ˆโ–“โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–‘โ–‘โ–’โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ """) if len(argv) not in (1, 3, 4): bot.disconnect() else: bot.run_until_disconnected()
[ "noreply@github.com" ]
noreply@github.com