hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 | qsc_code_num_words_quality_signal int64 | qsc_code_num_chars_quality_signal float64 | qsc_code_mean_word_length_quality_signal float64 | qsc_code_frac_words_unique_quality_signal float64 | qsc_code_frac_chars_top_2grams_quality_signal float64 | qsc_code_frac_chars_top_3grams_quality_signal float64 | qsc_code_frac_chars_top_4grams_quality_signal float64 | qsc_code_frac_chars_dupe_5grams_quality_signal float64 | qsc_code_frac_chars_dupe_6grams_quality_signal float64 | qsc_code_frac_chars_dupe_7grams_quality_signal float64 | qsc_code_frac_chars_dupe_8grams_quality_signal float64 | qsc_code_frac_chars_dupe_9grams_quality_signal float64 | qsc_code_frac_chars_dupe_10grams_quality_signal float64 | qsc_code_frac_chars_replacement_symbols_quality_signal float64 | qsc_code_frac_chars_digital_quality_signal float64 | qsc_code_frac_chars_whitespace_quality_signal float64 | qsc_code_size_file_byte_quality_signal float64 | qsc_code_num_lines_quality_signal float64 | qsc_code_num_chars_line_max_quality_signal float64 | qsc_code_num_chars_line_mean_quality_signal float64 | qsc_code_frac_chars_alphabet_quality_signal float64 | qsc_code_frac_chars_comments_quality_signal float64 | qsc_code_cate_xml_start_quality_signal float64 | qsc_code_frac_lines_dupe_lines_quality_signal float64 | qsc_code_cate_autogen_quality_signal float64 | qsc_code_frac_lines_long_string_quality_signal float64 | qsc_code_frac_chars_string_length_quality_signal float64 | qsc_code_frac_chars_long_word_length_quality_signal float64 | qsc_code_frac_lines_string_concat_quality_signal float64 | qsc_code_cate_encoded_data_quality_signal float64 | qsc_code_frac_chars_hex_words_quality_signal float64 | qsc_code_frac_lines_prompt_comments_quality_signal float64 | qsc_code_frac_lines_assert_quality_signal float64 | qsc_codepython_cate_ast_quality_signal float64 | qsc_codepython_frac_lines_func_ratio_quality_signal float64 | qsc_codepython_cate_var_zero_quality_signal bool | qsc_codepython_frac_lines_pass_quality_signal float64 | qsc_codepython_frac_lines_import_quality_signal float64 | qsc_codepython_frac_lines_simplefunc_quality_signal float64 | qsc_codepython_score_lines_no_logic_quality_signal float64 | qsc_codepython_frac_lines_print_quality_signal float64 | qsc_code_num_words int64 | qsc_code_num_chars int64 | qsc_code_mean_word_length int64 | qsc_code_frac_words_unique null | qsc_code_frac_chars_top_2grams int64 | qsc_code_frac_chars_top_3grams int64 | qsc_code_frac_chars_top_4grams int64 | qsc_code_frac_chars_dupe_5grams int64 | qsc_code_frac_chars_dupe_6grams int64 | qsc_code_frac_chars_dupe_7grams int64 | qsc_code_frac_chars_dupe_8grams int64 | qsc_code_frac_chars_dupe_9grams int64 | qsc_code_frac_chars_dupe_10grams int64 | qsc_code_frac_chars_replacement_symbols int64 | qsc_code_frac_chars_digital int64 | qsc_code_frac_chars_whitespace int64 | qsc_code_size_file_byte int64 | qsc_code_num_lines int64 | qsc_code_num_chars_line_max int64 | qsc_code_num_chars_line_mean int64 | qsc_code_frac_chars_alphabet int64 | qsc_code_frac_chars_comments int64 | qsc_code_cate_xml_start int64 | qsc_code_frac_lines_dupe_lines int64 | qsc_code_cate_autogen int64 | qsc_code_frac_lines_long_string int64 | qsc_code_frac_chars_string_length int64 | qsc_code_frac_chars_long_word_length int64 | qsc_code_frac_lines_string_concat null | qsc_code_cate_encoded_data int64 | qsc_code_frac_chars_hex_words int64 | qsc_code_frac_lines_prompt_comments int64 | qsc_code_frac_lines_assert int64 | qsc_codepython_cate_ast int64 | qsc_codepython_frac_lines_func_ratio int64 | qsc_codepython_cate_var_zero int64 | qsc_codepython_frac_lines_pass int64 | qsc_codepython_frac_lines_import int64 | qsc_codepython_frac_lines_simplefunc int64 | qsc_codepython_score_lines_no_logic int64 | qsc_codepython_frac_lines_print int64 | effective string | hits int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
592b9c985943ad1e676e1dfdbab762975cdac3ec | 52,161 | py | Python | BinanceMT.py | CharlieAlphaFox/BinanceMarginTrader | 8d799be764450b5eaedec73d4874fe419671c24b | [
"MIT"
] | 8 | 2020-08-31T17:21:08.000Z | 2022-02-17T12:39:27.000Z | BinanceMT.py | CharlieAlphaFox/BinanceMarginTrader | 8d799be764450b5eaedec73d4874fe419671c24b | [
"MIT"
] | null | null | null | BinanceMT.py | CharlieAlphaFox/BinanceMarginTrader | 8d799be764450b5eaedec73d4874fe419671c24b | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from binance.exceptions import BinanceAPIException, BinanceRequestException
from pyti.smoothed_moving_average import smoothed_moving_average as sma
from pyti.bollinger_bands import upper_bollinger_band as ubb # Examples of indicators/strategies
from pyti.bollinger_bands import lower_bollinger_band as lbb # Examples of indicators/strategies
from decimal import Decimal as D, ROUND_DOWN, ROUND_UP
from itertools import tee, islice, chain
from datetime import time, datetime
from binance.client import Client
from plotly.offline import plot
import plotly.graph_objs as go
from binance.enums import *
import pandas_ta as ta # Examples of indicators/strategies
from time import sleep
import pandas as pd
import numpy as np
import traceback
import datetime
import decimal
import time
import bikeys
log = open("BinanceMT.txt", "w")
loline = '____________________________________________________________________'
sleepsec = 2.4
trend_count = 0
client = Client(api_key=bikeys.Pass, api_secret=bikeys.Sec)
global trend
pairs = ['BTCUSDT', 'BCHABCUSDT', 'LTCUSDT', 'ETHUSDT', 'ETCUSDT', 'DASHUSDT',
'EOSUSDT', 'LINKUSDT', 'BNBUSDT', 'ZILUSDT', 'VETUSDT', 'ADAUSDT', 'XRPUSDT',
'RVNUSDT']
def Trend(pair):
global trend_count
global pairsmas
altc = pair[:-4]
ticker = client.get_symbol_ticker(symbol=pair)
price = ticker['price']
print('\n')
print(f'Start________Gathering Trend for {altc}______Price:{float(price)}______\n')
candle_no = 480
interval = Client.KLINE_INTERVAL_2HOUR
candles = client.get_klines(symbol=pair, interval=interval, limit=candle_no)
df = pd.DataFrame(data=candles)
# New lists of data
open = df.iloc[:,1].astype(float)
high = df.iloc[:,2].astype(float)
low = df.iloc[:,3].astype(float)
close = df.iloc[:,4].astype(float)
volume = df.iloc[:,5].astype(float)
no_ofTrades = df.iloc[0:100,[8]] #This returns as an integer from the API and the last value is incomplete per interval as is ongoing
# Removes the columns to not use here:
# df.pop(0) # Open time
df.pop(6) # Close time
df.pop(7) # Quote asset volume
df.pop(9) # Taker buy base asset volume
df.pop(10) # Taker buy quote asset volume
df.pop(11) # Can be ignored
df.columns = ['Time','Open','High','Low','Close','Volume', 'Trades'] #Titles the colms
df['Time'] = pd.to_datetime(df['Time'] * 1000000, infer_datetime_format=True)
# Calculates Smoothed moving avgs
fastsma = sma(close,14)
pairsmas = sma(close,30)
slowsma = sma(close, 50)
#
fastsma = float(D("{0:.5f}".format(fastsma[-1])))
pairsma = float(D("{0:.5f}".format(pairsmas[-1])))
slowsma = float(D("{0:.5f}".format(slowsma[-1])))
volma = sma(volume,11)
# print(volma)
vol = volma[-2]
lvol = volma[-1]
candle_no = candle_no-1
avg_vol = (sum(volma) - lvol) / candle_no
vol_perc = vol / avg_vol
vol_perc_txt = D("{0:.3f}".format(vol_perc))
print(f'The volume avg is: {vol_perc_txt} times the norm. Approx ~ {vol_perc_txt*100}%')
# Gets details from other Columns Lows, Highs, No of trades:
late_no_trades = df.Trades.iat[-1]
trades = float(df.Trades.iat[-2])
avg_trades = ((no_ofTrades.sum()) - late_no_trades) /candle_no
avg_trades = float("{0:.4f}".format(avg_trades[8]))
# print(f'Number of trades is in the prev. 5mins is {late_no_trades} and average is {avg_trades} in 90 mins')
trend_lowest = min(low)
# p_lowest = D("{0:.8f}".format(lowest))
# print(f'The lowest candle for {altc} is {p_lowest}')
trend_highest = max(high)
# Calculates Volume Weighted Avg Price:
vwap = float(sum(pairsmas))*float(vol)/sum(volma)
vwap_dec = D("{0:.4f}".format(vwap))
vwap_ratio = (vwap/float(price))*100
vwap_ratio = D("{0:.2f}".format(vwap_ratio))
if vwap_ratio > 100:
oversold = True
else:
oversold = False
trend = 'SIDEWYS'
print(f' the VWAP is : {vwap_dec} and that is {vwap_ratio}% of the price')
late_close = close[99] #The close (interval mins/hrs ago) != price
if float(price) > fastsma and fastsma > pairsma and pairsma > slowsma:
print(f'Classic TREND UP for {altc}')
trend = 'UP'
elif float(price) > fastsma and fastsma > pairsma:
if oversold is False and float(price) > slowsma:
trend = 'UP'
# __________________________________________________________________
if slowsma > pairsma and pairsma > fastsma and fastsma > float(price):
print(f'Classic TREND DWN for {altc}')
trend = 'DWN'
elif pairsma > fastsma and fastsma > float(price):
if float(price) < slowsma and oversold:
trend = 'DWN'
if trend == 'SIDEWYS':
print(f'Trend is Sideways for {altc} on 2h, going for 4h chart')
if trend_count < 1:
interval = Client.KLINE_INTERVAL_4HOUR
trend_count +=1
Trend(pair)
else:
trend = 'SIDEWYS'
print(f'Trend is Sidewys for {altc} on Daily charts')
return trend
def Strategy(pair): # Gets precise Precise data and act from it.
global df
global altc
global price
global profit
global long
global short
global up_bb
global low_bb
global tme_critical
altc = pair[:-4]
ticker = client.get_symbol_ticker(symbol=pair)
price = ticker['price']
# Pivots the daily candles in case your strategy requires daily a pivot:
utc = datetime.datetime.utcnow() # time now
mid_utc = utc.replace(hour=0, minute=0, second=0, microsecond=0)
mins_utc = int((mid_utc-utc).total_seconds() / 60.0)*-1 # time in minutes from UTC
candls_utc = int(mins_utc/5)
interval = Client.KLINE_INTERVAL_5MINUTE
if candls_utc < 24:
if mins_utc < 20:
mins_utc = 20
candls_utc = int(mins_utc/3)
interval = Client.KLINE_INTERVAL_3MINUTE
daily_factor = 0.40
if candls_utc > 118:
daily_factor = candls_utc/296
candle_no = candls_utc
m_one = int(candle_no-1)
print('\n')
print(f'Start________Gathering Strategy for {altc}__________Trend:{trend}______\n')
print(f'From utc--- {candls_utc} :{interval} Candles')
candles = client.get_klines(symbol=pair, interval=interval, limit=candle_no)
df = pd.DataFrame(data=candles)
# New lists of data
open = df.iloc[:,1].astype(float)
high = df.iloc[:,2].astype(float)
low = df.iloc[:,3].astype(float)
close = df.iloc[:,4].astype(float)
volume = df.iloc[:,5].astype(float)
no_ofTrades = df.iloc[0:100,[8]] #This returns as an integer from the API and the last value is incomplete per interval as is ongoing
# Removes the columns to not use here:
# df.pop(0) # Open time
df.pop(6) # Close time
df.pop(7) # Quote asset volume
df.pop(9) # Taker buy base asset volume
df.pop(10) # Taker buy quote asset volume
df.pop(11) # Can be ignored
df.columns = ['time','open','high','low','close','volume','trades'] #Titles the colms
df['time'] = pd.to_datetime(df['time'] * 1000000, infer_datetime_format=True)
open = np.array(open)
l_open = float(open[-1])
if candls_utc < 7:
fastsma = sma(close, int(candls_utc))
else:
fastsma = sma(close, 7)
fastsma = float(fastsma[-1])
fiftysma = sma(close, 50)
fiftysma = float(fiftysma[-1])
highest = max(high)
avg_high = float(sum(high)+highest/int(len(high)+1))
lowest = min(low)
avg_low = float(sum(low)+lowest/int(len(low)+1))
up_bb = ubb(close, 7, 3.0)
lup_bb = up_bb[-1]
low_bb = lbb(close, 7, 3.0)
llow_bb = low_bb[-1]
print(f'The current Upper BB value: {lup_bb}')
print(f'The current Lower BB value: {llow_bb}')
diff = (float(lup_bb) - float(llow_bb))
profit = float(diff/float(price)) + 1
print(f'\n The trading profit for {altc} is potentially {profit} or {profit*float(price)}')
price = float(price)
print(loline)
long = False
short = False
tme_critical = False
if profit > 1.007 and profit < 1.033: #Lateral
scale = profit*0.009
profit = 1.0116 + scale
if price <= float(llow_bb)*0.9984 and l_open < fastsma:
tme_critical = True
if price <= float(llow_bb)*1.0033 and float(llow_bb) < fastsma and fastsma*1.002 < lvwap:
if trend == 'UP' or trend == 'SIDEWYS':
long = True
print(f'\n Very cheap state vs VWAP and smma,. looking to long {altc} for a {profit} prof')
else:
print('Almost there')
if price >= float(lup_bb)*1.0016 and l_open > fastsma:
tme_critical = True
if price > float(lup_bb)*0.9967 and float(lup_bb) > fastsma and fastsma*0.998 > lvwap:
if trend == 'DWN' or trend == 'SIDEWYS':
short = True
print(f'\n Price is a very high vs VWAP and smma,. looking to short {altc} for a {profit} prof')
else:
print('Almost there')
elif profit >= 1.033: #Pumping
if price >= fiftysma and l_open > fastsma:
tme_critical = True
if price >= avg_high:
if trend == 'UP' or trend == 'SIDEWYS': # If trend is UP or SIDEWYS
long = True
print(f'\n Pumping but cheap state vs VWAP and smma,. looking to long {altc} for a {profit} prof')
else:
print('Almost there')
if price <= fiftysma and l_open < fastsma:
tme_critical = True
if price <= avg_low:
if trend == 'DWN' or trend == 'SIDEWYS': # If trend is DWN or SIDEWYS
short = True
print(f'\n Price is falling vs VWAP and smma,. looking to short {altc} for a {profit} prof')
else:
print('Almost there')
else:
print(f'\n Not there yet')
return long
return short
return tme_critical
def OpenOrder(price):
global noLongPosition
global noShortPosition
altc = pair[:-4]
print(f'Checking open order on {altc}')
open_order = client.get_open_margin_orders(symbol= pair)
has_data = float(len(open_order))
noShortPosition= True
noLongPosition = True
if has_data > 0:
for i in range(len(open_order)):
orig_quant = float(open_order[i]['origQty'])
# exec_quant = float(open_order[i]['executedQty'])
orderId = int(open_order[i]['orderId'])
type = str((open_order[i]['type']))
side = str((open_order[i]['side']))
takeprofit = str((open_order[i]['price']))
takeprof = float(takeprofit)
time = pd.to_datetime(float(open_order[i]['price']), infer_datetime_format=True)
print(f'!!!!!\n ___Order of {orig_quant} units of {altc} at price of {takeprof} time{time}!!\n ')
if side == 'SELL': # -----------------------This is a long position
print(open_order)
print('\n There s an open TP Sell order here,.. \n')
noLongPosition = False
if price >= lup_vwap_b and float(price/takeprof) >= 0.9916: #Price is up + bad position
info = client.get_symbol_info(symbol=pair)
price_filter = float(info['filters'][0]['tickSize'])
ticker = client.get_symbol_ticker(symbol=pair)
price = float(ticker['price'])
price = D.from_float(price).quantize(D(str(price_filter)))
minimum = float(info['filters'][2]['minQty']) # 'minQty'
quant = D.from_float(orig_quant).quantize(D(str(minimum)))
result = client.cancel_margin_order(symbol= pair, orderId= orderId)
print('Price is up now + bad position!, Order cancelled')
try:
order = client.create_margin_order(symbol=pair,
side=SIDE_SELL,
type=ORDER_TYPE_MARKET,
quantity= quant)
print(f'Market sold {pair}')
except Exception as e:
traceback.print_exc(file=log)
print(e)
try:
sleep(2)
order = client.create_margin_order(
symbol=pair,
side=SIDE_SELL,
type=ORDER_TYPE_MARKET,
quantity=quant)
print(f'Market sold {pair}')
except Exception as e:
traceback.print_exc(file=log)
print(e)
RepayUSD()
noLongPosition = True
print(f'Sell order for {altc} cleared')
elif trend == 'DWN' or float(price/takeprof) >= 0.9916:
info = client.get_symbol_info(symbol=pair)
price_filter = float(info['filters'][0]['tickSize'])
ticker = client.get_symbol_ticker(symbol=pair)
price = float(ticker['price'])
price = D.from_float(price).quantize(D(str(price_filter)))
minimum = float(info['filters'][2]['minQty']) # 'minQty'
quant = D.from_float(orig_quant).quantize(D(str(minimum)))
result = client.cancel_margin_order(symbol= pair, orderId= orderId)
print('Price is up now + bad position!, Order cancelled')
try:
order = client.create_margin_order(symbol=pair,
side=SIDE_SELL,
type=ORDER_TYPE_MARKET,
quantity= quant)
print(f'Market sold {pair}')
except Exception as e:
traceback.print_exc(file=log)
print(e)
try:
sleep(2)
order = client.create_margin_order(
symbol=pair,
side=SIDE_SELL,
type=ORDER_TYPE_MARKET,
quantity=quant)
print(f'Market sold {pair}')
except Exception as e:
traceback.print_exc(file=log)
print(e)
RepayUSD()
noLongPosition = True
print(f'Sell order for {altc} cleared')
else:
print(f'Sell order for {altc} stays')
return noLongPosition
if side == 'BUY': # -----------------------This is a Short position
print(open_order)
print('\n There is an open TP Buy lower order here already \n')
noShortPosition = False
if price <= llow_vwap_b and float(price/takeprof) <= 1.0084: #price dwn + bad position
info = client.get_symbol_info(symbol=pair)
price_filter = float(info['filters'][0]['tickSize'])
ticker = client.get_symbol_ticker(symbol=pair)
price = float(ticker['price'])
price = D.from_float(price).quantize(D(str(price_filter)))
minimum = float(info['filters'][2]['minQty']) # 'minQty'
quant = D.from_float(orig_quant).quantize(D(str(minimum)), rounding=ROUND_UP)
result = client.cancel_margin_order(symbol= pair, orderId= orderId)
print('This is a loosing position, StopLoss: Order cancelled')
try:
order = client.create_margin_order(symbol=pair,
side=SIDE_BUY,
type=ORDER_TYPE_MARKET,
quantity= quant)
print(f'Market bought {pair} to repay')
except Exception as e:
traceback.print_exc(file=log)
print(e)
try:
order = client.create_margin_order(
symbol=pair,
side=SIDE_BUY,
type=ORDER_TYPE_MARKET,
quantity=quant)
print(f'Market bought {pair} to repay')
except Exception as e:
traceback.print_exc(file=log)
print(e)
RepayAltc()
noShortPosition= True
print(f'Buy order for {altc} cleared')
elif trend == 'UP' or float(price/takeprof) <= 1.0084:
info = client.get_symbol_info(symbol=pair)
price_filter = float(info['filters'][0]['tickSize'])
ticker = client.get_symbol_ticker(symbol=pair)
price = float(ticker['price'])
price = D.from_float(price).quantize(D(str(price_filter)))
minimum = float(info['filters'][2]['minQty']) # 'minQty'
quant = D.from_float(orig_quant).quantize(D(str(minimum)), rounding=ROUND_UP)
result = client.cancel_margin_order(symbol= pair, orderId= orderId)
print('This is a loosing position, StopLoss: Order cancelled')
try:
order = client.create_margin_order(symbol=pair,
side=SIDE_BUY,
type=ORDER_TYPE_MARKET,
quantity= quant)
print(f'Market bought {pair} to repay')
except Exception as e:
traceback.print_exc(file=log)
print(e)
try:
order = client.create_margin_order(
symbol=pair,
side=SIDE_BUY,
type=ORDER_TYPE_MARKET,
quantity=quant)
print(f'Market bought {pair} to repay')
except Exception as e:
traceback.print_exc(file=log)
print(e)
RepayAltc()
noShortPosition= True
print(f'Buy order for {altc} cleared')
else:
print(f'Buy order for {altc} stays for now')
return noShortPosition
else:
print(f'There are no open orders for {altc}')
def RepayUSD():
print(f'^ Checking free balances on USDT')
info = client.get_symbol_info(symbol='ADAUSDT')
minimum = float(info['filters'][2]['minQty']) # 'minQty'
dict_balanc = client.get_margin_account()
balances = (dict_balanc['userAssets'])
for i in balances:
if str('USDT') == i['asset'] and float(i['free']) > 0.00001 and float(i['borrowed']) > 10:
loaned = float(i['borrowed'])
quant = float(i['free'])
print(f'There are {quant} USD free, waiting')
quant1 = D.from_float(quant).quantize(D(str(minimum)), rounding=ROUND_DOWN)
print(f'The balance of USDT wallet is {quant1}')
sleep(5)
dict_balanc = client.get_margin_account()
balances = (dict_balanc['userAssets'])
for i in balances:
if str('USDT') == i['asset'] and float(i['free']) > 0.00001:
quant2 = float(i['free'])
print(f'There are {quant2} USD free, comparing')
quant2 = D.from_float(quant2).quantize(D(str(minimum)), rounding=ROUND_DOWN)
if float(quant) > 10 and quant1 == quant2 and loaned > 10:
print(f'Checking USDT for a repay of the free amount')
try:
quant = D.from_float(quant).quantize(D(str(minimum)))
repay = client.repay_margin_loan(asset='USDT', amount= quant)
print(f'Repayed the collateral for {pair} 1st try')
except Exception as e:
traceback.print_exc(file=log)
print(e)
try:
repay = client.repay_margin_loan(asset='USDT', amount= quant)
print(f'Repayed the collateral for {pair} 2nd try')
except Exception as e:
traceback.print_exc(file=log)
print(e)
if float(quant) > 10 and quant1 == quant2 and float(quant) > loaned:
print(f'Checking USDT for a repay of the free amount')
try:
loaned = D.from_float(loaned).quantize(D(str(minimum)), rounding=ROUND_DOWN)
repay = client.repay_margin_loan(asset='USDT', amount= loaned)
print(f'Repayed the collateral for USDT 1st try')
except Exception as e:
traceback.print_exc(file=log)
print(e)
if float(quant) > 10 and loaned > 10:
repay = client.repay_margin_loan(asset='USDT', amount= quant)
print(f'Repayed the collateral for USDT 1st try')
elif str('USDT') == i['asset'] and float(i['borrowed']) < 10:
print('No borrowed amount')
def RepayAltc():
print(f'^ Checking free balances on {altc}')
ticker = client.get_symbol_ticker(symbol=pair)
price = ticker['price']
info = client.get_symbol_info(symbol=pair)
minimum = float(info['filters'][2]['minQty']) # 'minQty'
dict_balanc = client.get_margin_account()
balances = (dict_balanc['userAssets'])
for i in balances:
if str(altc) == i['asset']:
asset = i
for key, value in asset.items():
if key == 'free' and float(value) >= 0.00001:
quant = float(value)
if key == 'borrowed' and float(value) >= 10.1/float(price):
loan = float(value)
print(f'There are {quant} {altc} free, waiting')
quant1 = D.from_float(quant).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
print(f'The balance of {altc} wallet is {quant1}')
sleep(3)
try:
quant = D.from_float(quant).quantize(D(str(minimum)))
repay = client.repay_margin_loan(asset=altc, amount= quant)
print(f'Repayed the {altc} debt')
except Exception as e:
traceback.print_exc(file=log)
print(traceback.format_exc())
sleep(3.3)
try:
loaned = quant - loaned
loaned = D.from_float(loaned).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
order = client.create_margin_order(
symbol= pair,
side=SIDE_BUY,
type=ORDER_TYPE_MARKET,
quantity=loaned)
print(f'Market bought {altc} to repay borrowed debt')
sleep(16)
repay = client.repay_margin_loan(asset=altc, amount= quant)
print(f'Repayed the {altc} debt')
except Exception as e:
traceback.print_exc(file=log)
print(traceback.format_exc())
try:
loaned = D.from_float(loan).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
order = client.create_margin_order(
symbol= pair,
side=SIDE_BUY,
type=ORDER_TYPE_MARKET,
quantity=loaned)
print(f'Market bought {altc} to repay borrowed debt')
sleep(16)
repay = client.repay_margin_loan(asset=altc, amount= quant)
print(f'Market bought {altc} to repay borrowed debt')
except Exception as e:
traceback.print_exc(file=log)
print(traceback.format_exc())
try:
loaned = D.from_float(loan).quantize(D(str(minimum)))
order = client.create_margin_order(
symbol= pair,
side=SIDE_BUY,
type=ORDER_TYPE_MARKET,
quantity=loaned)
print(f'Market bought {altc} to repay borrowed debt')
sleep(16)
repay = client.repay_margin_loan(asset=altc, amount= dollars)
print(f'Market bought {altc} to repay borrowed debt')
except Exception as e:
traceback.print_exc(file=log)
print(traceback.format_exc())
print(e)
elif key == 'borrowed' and float(value) >= minimum:
loaned = float(value)
if key == 'free' and float(value) > float(loaned):
free = float(value)
loaned = D.from_float(free).quantize(D(str(minimum)))
if free >= 0.0001:
try:
print(f'there is {free} amount of {altc} here')
repay = client.repay_margin_loan(asset=altc, amount= loaned)
print(f'Repayed the {altc} debt in the 1st try')
except Exception as e:
print(f'there is {free} amount of {altc} here')
traceback.print_exc(file=log)
print(traceback.format_exc())
print(e)
def Long(pair):
try:
print(loline)
ticker = client.get_symbol_ticker(symbol=pair)
price = ticker['price']
price = float(price)
price = float("{0:.5f}".format(price))
max_loan = client.get_max_margin_loan(asset='USDT') # Whats the max margin I get?
max_loan = float(max_loan['amount'])
loan = max_loan/6
loan = float(loan)
loan = float("{0:.5f}".format(loan))
print(f' the loan amnt is {loan} out of the max of: {max_loan}')
if max_loan >= 130 and profit > 1.00933:
transaction = client.create_margin_loan(asset='USDT', amount=loan) # Borrows longing asset prepares to Buy> Sale Higher > Repay USDT
print(transaction)
asset = 'USDT'
info = client.get_symbol_info(symbol=pair)
minimum = float(info['filters'][2]['minQty']) # 'minQty'
price_filter = float(info['filters'][0]['tickSize'])
price = D.from_float(price).quantize(D(str(price_filter)))
quant = loan/float(price)
quant = D.from_float(quant).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
try:
print(f'Borrowed USDT and Market buying {altc}')
order = client.create_margin_order(
symbol= pair,
side=SIDE_BUY,
type=ORDER_TYPE_MARKET,
quantity=quant)
sleep(21)
print(f'Borrowed USDT and Market bought {altc}')
except Exception as e:
traceback.print_exc(file=log)
print(e)
try:
price = float(client.get_orderbook_ticker(symbol=str(pair))['askPrice'])
price = D.from_float(price).quantize(D(str(price_filter)))
print('failed to market buy, going for limit on ask price')
order = client.create_margin_order(
symbol= pair,
side=SIDE_BUY,
type=ORDER_TYPE_LIMIT,
timeInForce=TIME_IN_FORCE_GTC,
quantity=quant,
price=price)
print(f'Borrowed USDT and bought {altc}, waiting on order to go trw')
sleep(16)
except Exception as e:
dict_balanc = client.get_margin_account()
balances = (dict_balanc['userAssets'])
for i in balances:
if str(altc) == i['asset'] and float(i['free']) > 0.00:
quant = float(i['free'])
print(quant)
quant = D.from_float(quant).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
print(f'The balance of {altc} wallet is {quant}')
order = client.create_margin_order(
symbol= pair,
side=SIDE_BUY,
type=ORDER_TYPE_LIMIT,
timeInForce=TIME_IN_FORCE_GTC,
quantity=quant,
price=price)
print(f'Borrowed USDT and bought {altc}, waiting on order to go trw')
traceback.print_exc(file=log)
print(e)
try:
print(f'Attempting TP planned at {profit} parts of {price} for {altc} !****')
price = float(price)
dict_balanc = client.get_margin_account()
balances = (dict_balanc['userAssets'])
for i in balances:
if str(altc) == i['asset'] and float(i['free']) > 0.00000001:
quant = float(i['free'])
print(quant)
quant = D.from_float(quant).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
print(f'The balance of {altc}s wallet is {quant}')
profitL = float(profit-1)
profitLong = profitL + 1
price = price*profitLong
price_filter = float(info['filters'][0]['tickSize'])
price = D.from_float(price).quantize(D(str(price_filter)))
order = client.create_margin_order(
symbol= pair,
side=SIDE_SELL,
type=ORDER_TYPE_LIMIT,
timeInForce=TIME_IN_FORCE_GTC,
quantity=quant,
price=price)
print(f' *******Limit SELL order made: {quant} of {altc} * @ * {price} *****')
print(f'Borrowed USDT and bought {altc}, set TP at {price} for {altc}')
Plot(pair, profit)
except Exception as e:
traceback.print_exc(file=log)
print(e)
sleep(16)
print(f'Error with TP trying again')
try:
quant = (float(quant)/float(price))*0.9925 #Lesser amount left after fees
quant = D.from_float(quant).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
order = client.create_margin_order(
symbol= pair,
side=SIDE_SELL,
type=ORDER_TYPE_LIMIT,
timeInForce=TIME_IN_FORCE_GTC,
quantity=quant,
price=price)
print(f' *******Limit SELL order made: {quant} of {altc} * @ * {price} *****')
print(f'Borrowed USDT and bought {altc}, set TP at {price} for {altc}')
Plot(pair, profit)
except Exception as e:
traceback.print_exc(file=log)
print(e)
print(f'Error with TP trying again:')
try:
quant = float(quant)*0.9925 #amount before fees
quant = D.from_float(quant).quantize(D(str(minimum)))
order = client.create_margin_order(
symbol= pair,
side=SIDE_SELL,
type=ORDER_TYPE_LIMIT,
timeInForce=TIME_IN_FORCE_GTC,
quantity=quant,
price=price)
print(f' *******Limit SELL order made: {quant} of {altc} * @ * {price} *****')
print(f'Borrowed USDT and bought {altc}, set TP at {price} for {altc}')
Plot(pair, profit)
except Exception as e:
traceback.print_exc(file=log)
print(e)
try:
quant = float(quant)*0.9925 #amount before fees
quant = D.from_float(quant).quantize(D(str(minimum)))
order = client.create_margin_order(
symbol= pair,
side=SIDE_SELL,
type=ORDER_TYPE_LIMIT,
timeInForce=TIME_IN_FORCE_GTC,
quantity=quant,
price=price)
print(f' *******Limit SELL order made: {quant} of {altc} * @ * {price} *****')
print(f'Borrowed USDT and bought {altc}, set TP at {price} for {altc}')
Plot(pair, profit)
except Exception as e:
traceback.print_exc(file=log)
print(e)
else:
print('******** Not enough margin left, or profit opportunity is low *****')
sleep(sleepsec)
except Exception as e:
traceback.print_exc(file=log)
print(e)
sleep(1)
def Short(pair):
try:
print(loline)
ticker = client.get_symbol_ticker(symbol=pair)
price = ticker['price']
price = float(price)
price = float("{0:.5f}".format(price))
max_loan = client.get_max_margin_loan(asset=altc) # Whats the max margin I get?
max_loan = float(max_loan['amount'])
loan = max_loan/6
loan = float(loan)
loan = float("{0:.5f}".format(loan))
print(f' the loan amnt is {loan} out of the max of: {max_loan}')
if max_loan >= 130/price and float(profit) > 1.00933:
transaction = client.create_margin_loan(asset=altc, amount=loan) # Borrows shorting asset prepares to SELL> Rebuy lower > Repay altc
print(transaction)
asset = altc
info = client.get_symbol_info(symbol=pair)
price_filter = float(info['filters'][0]['tickSize'])
price = D.from_float(price).quantize(D(str(price_filter)))
quant = loan
minimum = float(info['filters'][2]['minQty']) # 'minQty'
quant = D.from_float(quant).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
try:
print(f'Borrowing {altc} and market selling to short')
order = client.create_margin_order(
symbol= pair,
side=SIDE_SELL,
type=ORDER_TYPE_MARKET,
quantity=quant)
sleep(20)
print(f'Borrowed {altc} and market sold FOR USDT')
except Exception as e:
print(f'Error with Order trying again ***************')
traceback.print_exc(file=log)
print(e)
try:
price_filter = float(info['filters'][0]['tickSize'])
price = float(client.get_orderbook_ticker(symbol=str(pair))['bidPrice'])
price = D.from_float(price).quantize(D(str(price_filter)))
order = client.create_margin_order(
symbol= pair,
side=SIDE_SELL,
type=ORDER_TYPE_LIMIT,
timeInForce=TIME_IN_FORCE_GTC,
quantity=quant,
price=price)
print(f'Borrowed {altc} and set a buy for bidPrice {price}, waiting on order to go trw')
sleep(21)
except Exception as e:
try:
print(f'Error with {altc} sell, market selling to short')
order = client.create_margin_order(
symbol= pair,
side=SIDE_SELL,
type=ORDER_TYPE_MARKET,
quantity=quant)
sleep(16)
print(f'Sold {altc} at market FOR USDT')
except Exception as e:
try:
info = client.get_symbol_info(symbol=pair)
price_filter = float(info['filters'][0]['tickSize'])
price = D.from_float(price).quantize(D(price_filter))
minimum = float(info['filters'][2]['minQty']) # 'minQty'
quant = loan
dict_balanc = client.get_margin_account()
balances = (dict_balanc['userAssets'])
for i in balances:
if str(altc) == i['asset'] and float(i['free']) > 0.00:
quant1 = float(i['free'])
print(f'There are {quant1} {altc} free')
sleep(2)
print(f'The balance of {altc} wallet is {quant}')
quant = D.from_float(quant1).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
order = client.create_margin_order(
symbol= pair,
side=SIDE_SELL,
type=ORDER_TYPE_MARKET,
quantity=quant)
except BinanceAPIException as e:
traceback.print_exc(file=log)
try:
info = client.get_symbol_info(symbol=pair)
price_filter = float(info['filters'][0]['tickSize'])
price = D.from_float(price).quantize(D(str(price_filter)))
minimum = float(info['filters'][2]['minQty']) # 'minQty'
dict_balanc = client.get_margin_account()
balances = (dict_balanc['userAssets'])
for i in balances:
if str(altc) == i['asset'] and float(i['free']) > 0.00:
quant = float(i['free'])
print(quant)
quant = D.from_float(quant).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
print(f'The balance of {altc} wallet is {quant}')
order = client.create_margin_order(
symbol= pair,
side=SIDE_SELL,
type=ORDER_TYPE_MARKET,
quantity=quant)
print(f'Sold {altc} at market for ~{quant*price} USDT')
except BinanceAPIException as e:
traceback.print_exc(file=log)
print(f'***** Error with the order reverted and repyaing margin ************!!!!')
order = client.create_margin_order(
symbol= pair,
side=SIDE_BUY,
type=ORDER_TYPE_MARKET,
quantity=quant)
sleep(16)
print(f' Bought {altc} back, repyaing {altc},..')
quant = float(quant)*0.9995
quant = D.from_float(quant).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
repay = client.repay_margin_loan(asset=altc, amount= quant)
print(f'Margin of {altc} of {quant} repayed')
print(e)
profitS = float(profit-1)
profitShort = profitS+1
short_prof = 2-profitShort
info = client.get_symbol_info(symbol=pair)
price = float(price)*float(short_prof)
price_filter = float(info['filters'][0]['tickSize'])
price = D.from_float(price).quantize(D(str(price_filter)))
minimum = float(info['filters'][2]['minQty']) # 'minQty'
quant = loan #*0.9995?
minimum = float(info['filters'][2]['minQty']) # 'minQty'
quant = D.from_float(quant).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
dict_balanc = client.get_margin_account()
balances = (dict_balanc['userAssets'])
for i in balances:
if str('USDT') == i['asset'] and float(i['free']) > 0.00:
quant1 = float(i['free'])
print(quant)
quant1 = D.from_float(quant1).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
print(f'The balance of USDT wallet is {quant1}')
print(f'TP planned at {2-profit} parts of {quant} at price of: {price} for {altc}')
try:
order = client.create_margin_order(
symbol= pair,
side=SIDE_BUY,
type=ORDER_TYPE_LIMIT,
timeInForce=TIME_IN_FORCE_GTC,
quantity=quant,
price=price)
print(f' *******Limit BUY order made: {quant} of {altc} * @ * {price} *****')
print(f'Borrowed USDT and bought {altc}, setting TP at {profit}at: {price} for {altc}')
ShortPlot(pair, profit)
except Exception as e:
traceback.print_exc(file=log)
try:
quant = float(quant)*0.9995
quant = D.from_float(quant).quantize(D(str(minimum)), rounding= decimal.ROUND_DOWN)
order = client.create_margin_order(
symbol= pair,
side=SIDE_BUY,
type=ORDER_TYPE_LIMIT,
timeInForce=TIME_IN_FORCE_GTC,
quantity=quant,
price=price)
print(f' *******Limit BUY order made: {quant} of {altc} * @ * {price} *****')
print(f'Borrowed USDT and bought {altc}, setting TP at {profit}at: {price} for {altc}')
ShortPlot(pair, profit)
except Exception as e:
traceback.print_exc(file=log)
print(e)
else:
print('******** Not enough margin left, or profit opportunity *****')
except Exception as e:
traceback.print_exc(file=log)
print(e)
def ShortPlot(pair, profit):
buy_signals = []
try:
for item, prce in zip (pairsmas, close):
if item >= 1.0055*prce:
buy_signals.append([df['time'][i], close[prce]])
if item == item[-1]:
buy_signals.append([df['time'][i], close[prce]])
except Exception as e:
print(e)
pass
# Amount target to be gained from Buy2sell:
profit = profit-2 # BTC -s fees = 0.0015*quant traded
profit = profit*-1
# Stop loss target for Stop out sell limit orders
stop_out = float(1.06) # 0.06 loss At Sell TP
# plot candlestick chart
def Ploting(df, pairsmas, up_bb, low_bb, sell_signals):
candle = go.Candlestick(
x = df['time'],
open = df['open'],
close = df['close'],
high = df['high'],
low = df['low'],
name = str(altc))
# plot MAs
ssma = go.Scatter(
x = df['time'],
y = pairsmas,
name = "SMA",
line = dict(color = ('rgba(102, 207, 255, 50)'), width = 1))
upbb = go.Scatter(
x = df['time'],
y = up_bb,
name = "Upper BB",
line = dict(color = ('rgba(202, 107, 255)'),dash = 'solid',
shape = 'spline',
smoothing = 1,
width = 2))
lwbb = go.Scatter(
x = df['time'],
y = low_bb,
name = "Lower BB",
line = dict(color = ('rgba(202, 107, 255)'),dash = 'solid',
shape = 'spline',
smoothing = 1,
width = 2))
shorts = go.Scatter(
x = [item[0] for item in sell_signals],
y = [item[1] for item in sell_signals],
name = "Short Signals",
mode = "markers",
)
buyTPs = go.Scatter(
x = [item[0] for item in sell_signals],
y = [item[1]*profit for item in sell_signals],
name = "TP Point",
mode = "markers",
)
stops = go.Scatter(
x = [item[0] for item in sell_signals],
y = [item[1]*stop_out for item in sell_signals],
name = "Stops",
mode = "markers",
)
data = go.Data([candle, ssma, upbb, lwbb, shorts ,buyTPs, stops])
# style and display
layout = go.Layout(title = f'{pair}_{price}_Shorts 5m')
fig = go.Figure(data = data, layout = layout)
plot(fig, filename = str(f'{pair}_5m' + '.html'))
# Ploting(df,pairsmas, up_bb, low_bb, sell_signals)
print('Sleeping 25secs')
sleep(1)
return Ploting(df,pairsmas, up_bb, low_bb, sell_signals)
def Plot(pair, profit):
buy_signals = []
try:
for item, prce in zip (pairsmas, close):
if item <= 0.9945*prce:
buy_signals.append([df['time'][i], close[prce]])
if item == item[-1]:
buy_signals.append([df['time'][i], close[prce]])
except Exception as e:
print(e)
pass
# Amount target to be gained from Buy2sell:
profit = profit # BTC -s fees = 0.0015*quant traded
# Stop loss target for Stop out sell limit orders
stop_out = float(0.94) # 0.05 loss At Sell TP
# plot candlestick chart
def Ploting(df, pairsmas, up_bb, low_bb, buy_signals):
candle = go.Candlestick(
x = df['time'],
open = df['open'],
close = df['close'],
high = df['high'],
low = df['low'],
name = str(altc))
# plot MAs
ssma = go.Scatter(
x = df['time'],
y = df['VWAP'],
name = "VWAP",
line = dict(color = ('rgba(102, 207, 255, 50)'), width = 1))
upbb = go.Scatter(
x = df['time'],
y = up_bb,
name = "Upper BB",
line = dict(color = ('rgba(202, 107, 255)'),dash = 'solid',
shape = 'spline',
smoothing = 1,
width = 2))
lwbb = go.Scatter(
x = df['time'],
y = low_bb,
name = "Lower BB",
line = dict(color = ('rgba(202, 107, 255)'),dash = 'solid',
shape = 'spline',
smoothing = 1,
width = 2))
buys = go.Scatter(
x = [item[0] for item in buy_signals],
y = [item[1] for item in buy_signals],
name = "Buy Signals",
mode = "markers",
)
sells = go.Scatter(
x = [item[0] for item in buy_signals],
y = [item[1]*profit for item in buy_signals],
name = "Sell Signals",
mode = "markers",
)
stops = go.Scatter(
x = [item[0] for item in buy_signals],
y = [item[1]*stop_out for item in buy_signals],
name = "Stop Signals",
mode = "markers",
)
data = go.Data([candle, ssma, upbb, lwbb, buys ,sells, stops])
# style and display
layout = go.Layout(title = f'{pair}_{price}_ 5m')
fig = go.Figure(data = data, layout = layout)
plot(fig, filename = str(f'{pair}_5m' + '.html'))
try:
while True:
try:
for pair in pairs:
trend = Trend(pair)
Strategy(pair)
OpenOrder(price)
if long:
if noLongPosition:
Long(pair)
elif short:
if noShortPosition:
Short(pair)
elif not tme_critical:
print(f'Taking our time')
RepayAltc()
RepayUSD()
sleep(sleepsec)
except Exception as e:
print(traceback.format_exc())
traceback.print_exc(file=log)
print(e)
pass
except KeyboardInterrupt:
pass
| 48.93152 | 146 | 0.480282 | 5,514 | 52,161 | 4.399528 | 0.094305 | 0.024238 | 0.016077 | 0.023744 | 0.749619 | 0.724267 | 0.688281 | 0.671668 | 0.657735 | 0.630199 | 0 | 0.018236 | 0.417573 | 52,161 | 1,065 | 147 | 48.977465 | 0.780283 | 0.045513 | 0 | 0.662351 | 0 | 0.008964 | 0.134648 | 0.004749 | 0 | 0 | 0 | 0 | 0 | 1 | 0.010956 | false | 0.00498 | 0.01992 | 0 | 0.037849 | 0.186255 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
5932057df5d3ab2f1b1fa5c65741d72b5f112ec6 | 329 | py | Python | winter/web/exceptions/exceptions.py | mofr/winter | b7c97887966b3ea6fecbd6087d3e4b87892c1357 | [
"MIT"
] | 9 | 2019-01-24T11:50:19.000Z | 2019-07-05T07:58:46.000Z | winter/web/exceptions/exceptions.py | mofr/winter | b7c97887966b3ea6fecbd6087d3e4b87892c1357 | [
"MIT"
] | 100 | 2019-01-29T08:11:38.000Z | 2020-04-03T12:00:42.000Z | winter/web/exceptions/exceptions.py | mofr/winter | b7c97887966b3ea6fecbd6087d3e4b87892c1357 | [
"MIT"
] | 6 | 2019-01-30T19:51:03.000Z | 2020-03-28T10:22:11.000Z | from http import HTTPStatus
from .problem import problem
@problem(status=HTTPStatus.TOO_MANY_REQUESTS, detail='Request was throttled')
class ThrottleException(Exception):
pass
class RedirectException(Exception):
def __init__(self, redirect_to: str):
super().__init__()
self.redirect_to = redirect_to
| 21.933333 | 77 | 0.75076 | 38 | 329 | 6.157895 | 0.657895 | 0.128205 | 0.136752 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164134 | 329 | 14 | 78 | 23.5 | 0.850909 | 0 | 0 | 0 | 0 | 0 | 0.06383 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0.111111 | 0.222222 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
593741e754840f5bbcc85932e5b6fd87c86f6617 | 1,515 | py | Python | webmux/web_terminal.py | ronreiter/webmux | 0419949a7e574c689694c767504a5baefde88172 | [
"MIT"
] | 63 | 2015-02-10T06:55:41.000Z | 2021-11-14T17:42:45.000Z | webmux/web_terminal.py | ronreiter/webmux | 0419949a7e574c689694c767504a5baefde88172 | [
"MIT"
] | 8 | 2015-04-11T06:04:52.000Z | 2019-05-14T13:49:13.000Z | webmux/web_terminal.py | ronreiter/webmux | 0419949a7e574c689694c767504a5baefde88172 | [
"MIT"
] | 23 | 2015-03-19T07:07:59.000Z | 2021-08-07T10:09:48.000Z | __author__ = 'Ron'
from webmux.terminal import Terminal
# TODO: merge SocketIO / StandardIO objects with Terminal objects
class SocketIO(object):
def __init__(self, client):
self.client = client
def write(self, data):
terminal_id = self.client.session.conn.terminal._id
self.parent.write_to_terminal(terminal_id, data)
def close(self, channel):
terminal_id = self.client.session.conn.terminal._id
self.parent.close_connection(terminal_id)
def loseConnection(self):
print "lose connection"
def loseWriteConnection(self):
print "lose write connection"
class WebTerminal(Terminal):
def __init__(self, parent, id, cols, rows):
self.parent = parent
self._cols = cols
self._rows = rows
self._id = id
self.active_session = None
self.resize_callback = None
self.io = SocketIO
# TODO: fixme - merge SocketIO interface with Terminal interface
self.io.parent = parent
def get_window_size(self):
return self._rows, self._cols, self._cols * 5, self._rows * 13
def get_name(self):
return "xterm-256color"
def resize(self, cols, rows):
self._cols = cols
self._rows = rows
self.resize_callback(rows, cols, cols * 5, rows * 13)
def register_resize_callback(self, resize_callback):
self.resize_callback = resize_callback
def set_active_session(self, session):
self.active_session = session
| 27.545455 | 72 | 0.661386 | 186 | 1,515 | 5.150538 | 0.284946 | 0.06263 | 0.058455 | 0.041754 | 0.217119 | 0.164927 | 0.164927 | 0.106472 | 0.106472 | 0.106472 | 0 | 0.007937 | 0.251485 | 1,515 | 54 | 73 | 28.055556 | 0.836861 | 0.083168 | 0 | 0.162162 | 0 | 0 | 0.038267 | 0 | 0 | 0 | 0 | 0.018519 | 0 | 0 | null | null | 0 | 0.027027 | null | null | 0.054054 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3cb99c2a49458f10abf603b8cb5b70c154264246 | 1,049 | py | Python | jobs/migrations/0005_auto_20210813_2335.py | zain-Z/humimp | fd7e4e211dce62639e2fce2dd9f9506240a7a3d9 | [
"MIT"
] | null | null | null | jobs/migrations/0005_auto_20210813_2335.py | zain-Z/humimp | fd7e4e211dce62639e2fce2dd9f9506240a7a3d9 | [
"MIT"
] | null | null | null | jobs/migrations/0005_auto_20210813_2335.py | zain-Z/humimp | fd7e4e211dce62639e2fce2dd9f9506240a7a3d9 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2021-08-13 21:35
from django.db import migrations, models
import jobs.validators
class Migration(migrations.Migration):
dependencies = [
('jobs', '0004_auto_20210713_1943'),
]
operations = [
migrations.AddField(
model_name='index',
name='image_story_index',
field=models.FileField(blank=True, null=True, upload_to='background/index/', validators=[jobs.validators.validate_image_extension]),
),
migrations.AddField(
model_name='index',
name='text_story_index',
field=models.CharField(default='', max_length=300),
),
migrations.AddField(
model_name='index',
name='whatDoDetail_text',
field=models.CharField(default='', max_length=300),
),
migrations.AddField(
model_name='whatwearedoingdetail',
name='whatDoDetail_icon_name',
field=models.CharField(default='', max_length=300),
),
]
| 29.971429 | 144 | 0.604385 | 105 | 1,049 | 5.847619 | 0.495238 | 0.117264 | 0.149837 | 0.175896 | 0.410423 | 0.410423 | 0.278502 | 0.214984 | 0.214984 | 0.214984 | 0 | 0.052701 | 0.276454 | 1,049 | 34 | 145 | 30.852941 | 0.756258 | 0.042898 | 0 | 0.5 | 1 | 0 | 0.150699 | 0.04491 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.071429 | 0 | 0.178571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3ccb204e0424070670948a9bbc5c563cd2509686 | 18,783 | py | Python | books/model/Organization.py | nudglabs/books-python-wrappers | 8844eca8fe681542644a70749b72a6dc4e48c171 | [
"MIT"
] | 9 | 2015-04-01T08:59:49.000Z | 2022-01-27T01:27:45.000Z | books/model/Organization.py | nudglabs/books-python-wrappers | 8844eca8fe681542644a70749b72a6dc4e48c171 | [
"MIT"
] | 3 | 2020-05-14T04:22:22.000Z | 2021-08-06T11:19:03.000Z | books/model/Organization.py | nudglabs/books-python-wrappers | 8844eca8fe681542644a70749b72a6dc4e48c171 | [
"MIT"
] | 11 | 2016-04-14T10:59:36.000Z | 2020-08-19T13:26:05.000Z | #$Id$
from books.model.Address import Address
class Organization:
"""This class is used to create object for organization."""
def __init__(self):
"""Initialize parameters for organization object. """
self.organization_id = ''
self.name = ''
self.is_default_org = None
self.account_created_date = ''
self.time_zone = ''
self.language_code = ''
self.date_format = ''
self.field_separator = ''
self.fiscal_year_start_month = ''
self.contact_name = ''
self.industry_type = ''
self.industry_size = ''
self.company_id_label = ''
self.company_id_value = ''
self.tax_id_label = ''
self.tax_id_value = ''
self.currency_id = ''
self.currency_code = ''
self.currency_symbol = ''
self.currency_format = ''
self.price_precision = 0
self.address = Address()
self.org_address = ''
self.remit_to_address = ''
self.phone = ''
self.fax = ''
self.website = ''
self.email = ''
self.tax_basis = ''
self.is_org_active = None
self.name = ''
self.value = ''
self.version = ''
self.plan_type = 0
self.plane_name = ''
self.plan_period = ''
self.tax_group_enabled = None
self.account_created_date_formatted = ""
self.zi_migration_status = 0
self.user_role = ''
self.custom_fields = []
self.is_new_customer_custom_fields = None
self.is_portal_enabled = None
self.portal_name = ''
self.tax_type = ''
def set_organization_id(self, organization_id):
"""Set organization id.
Args:
organization_id(str): Organization id.
"""
self.organization_id = organization_id
def get_organization_id(self):
"""Get organization id.
Returns:
str: Organization id.
"""
return self.organization_id
def set_name(self, name):
"""Set name.
Args:
name(str): Name.
"""
self.name = name
def set_is_default_org(self, is_default_org):
"""Set whether it is default organization.
Args:
is_default_org(bool): True if it is default organization else false.
"""
self.is_default_org = is_default_org
def get_is_default_org(self):
"""Get whether it is default organization.
Returns:
bool: True if it is default organization else false.
"""
return self.is_default_org
def set_account_created_date(self, account_created_date):
"""Set account created date.
Args:
account_created_date(str): Account created date.
"""
self.account_created_date = account_created_date
def get_account_created_date(self):
"""Get account created date.
Returns:
str: Account created date.
"""
return self.account_created_date
def set_time_zone(self, time_zone):
"""Set time zone.
Args:
time_zone(str): Time zone.
"""
self.time_zone = time_zone
def get_time_zone(self):
"""Get time zone.
Returns:
str: Time zone.
"""
return self.time_zone
def set_language_code(self, language_code):
"""Set language code.
Args:
language_code(str): Language code.
"""
self.language_code = language_code
def get_language_code(self):
"""Get language code.
Returns:
str: Language code.
"""
return self.language_code
def set_date_format(self, date_format):
"""Set date format.
Args:
date_format(str): Date format.
"""
self.date_format = date_format
def get_date_format(self):
"""Get date format.
Returns:
str: Date format.
"""
return self.date_format
def set_field_separator(self, field_separator):
"""Set field separator.
Args:
field_separator(str): Field separator.
"""
self.field_separator = field_separator
def get_field_separator(self):
"""Get field separator.
Returns:
str: Field separator.
"""
return self.field_separator
def set_fiscal_year_start_month(self, fiscal_year_start_month):
"""Set fiscal year field separator.
Args:
fiscal_year_start_month(str): Fiscal year start month.
"""
self.fiscal_year_start_month = fiscal_year_start_month
def get_fiscal_year_start_month(self):
"""Get fiscal year start month.
Returns:
str: Fiscal year start month.
"""
return self.fiscal_year_start_month
def set_contact_name(self, contact_name):
"""Set contact name.
Args:
contact_name(str): Contact name.
"""
self.contact_name = contact_name
def get_contact_name(self):
"""Get contact name.
Returns:
str: Contact name.
"""
return self.contact_name
def set_industry_type(self, industry_type):
"""Set industry type.
Args:
industry_type(str): Industry type.
"""
self.industry_type = industry_type
def get_industry_type(self):
"""Get industry type.
Returns:
str: Industry type.
"""
return self.industry_type
def set_industry_size(self, industry_size):
"""Set industry size.
Args:
industry_size(str): Industry size.
"""
self.industry_size = industry_size
def get_industry_size(self):
"""Get industry size.
Returns:
str: Industry size.
"""
return self.industry_size
def set_company_id_label(self, company_id_label):
"""Set company id label.
Args:
company_id_label(str): Company id label.
"""
self.company_id_label = company_id_label
def get_company_id_label(self):
"""Get company id label.
Returns:
str: Company id label.
"""
return self.company_id_label
def set_company_id_value(self, company_id_value):
"""Set company id value.
Args:
company_id_value(str): Company id value.
"""
self.company_id_value = company_id_value
def get_company_id_value(self):
"""Get company id value.
Returns:
str: Company id value.
"""
return self.company_id_value
def set_tax_id_label(self, tax_id_label):
"""Set tax id label.
Args:
tax_id_label(str): Tax id label.
"""
self.tax_id_label = tax_id_label
def get_tax_id_label(self):
"""Get tax id label.
Retruns:
str: Tax id label.
"""
return self.tax_id_label
def set_tax_id_value(self, tax_id_value):
"""Set tax id value.
Args:
tax_id_value(str): Tax id value.
"""
self.tax_id_value = tax_id_value
def get_tax_id_value(self):
"""Get atx id value.
Returns:
str: Tax id value.
"""
return self.tax_id_value
def set_currency_id(self, currency_id):
"""Set currency id.
Args:
currency_id(str): Currency id.
"""
self.currency_id = currency_id
def get_currency_id(self):
"""Get currency id.
Returns:
str: Currency id.
"""
return self.currency_id
def set_currency_code(self, currency_code):
"""Set currency code.
Args:
currency_code(str): Currency code.
"""
self.currency_code = currency_code
def get_currency_code(self):
"""Get currency code.
Returns:
str: Currency code.
"""
return self.currency_code
def set_currency_symbol(self, currency_symbol):
"""Set currency symbol.
Args:
currency_symbol(str): Currency symbol.
"""
self.currency_symbol = currency_symbol
def get_currency_symbol(self):
"""Get currency symbol.
Returns:
str: Currency symbol.
"""
return self.currency_symbol
def set_currency_format(self, currency_format):
"""Set currency format.
Args:
currency_format(str): Currency format.
"""
self.currency_format = currency_format
def get_currency_format(self):
"""Get currency format.
Retruns:
str: Currency format.
"""
return self.currency_format
def set_price_precision(self, price_precision):
"""Set price precision.
Args:
price_precision(int): Price precision.
"""
self.price_precision = price_precision
def set_address(self, address):
"""Set address.
Args:
address(instance): Address
"""
self.address = address
def get_address(self):
"""Get address.
Returns:
instance: Address.
"""
return self.address
def set_org_address(self, org_address):
"""Set organization address.
Args:
org_address(str): Organization address.
"""
self.org_address = org_address
def get_org_address(self):
"""Get organization address.
Returns:
str: Organization address.
"""
return self.org_address
def set_remit_to_address(self, remit_to_address):
"""Set remit to address.
Args:
remit_to_address(str): Remit to address.
"""
self.remit_to_address = remit_to_address
def get_remit_to_address(self):
"""Get remit to address.
Returns:
str: Remit to address.
"""
return self.remit_to_address
def set_phone(self, phone):
"""Set phone.
Args:
phone(str): Phone.
"""
self.phone = phone
def get_phone(self):
"""Get phone.
Returns:
str: Phone.
"""
return self.phone
def set_fax(self, fax):
"""Set fax.
Args:
fax(str): Fax.
"""
self.fax = fax
def get_fax(self):
"""Get fax.
Returns:
str: Fax.
"""
return self.fax
def set_website(self, website):
"""Set website.
Args:
website(str): Website.
"""
self.website = website
def set_email(self, email):
"""Set email.
Args:
email(str): Email.
"""
self.email = email
def get_email(self):
"""Get email.
Returns:
str: Email.
"""
return self.email
def set_tax_basis(self, tax_basis):
"""Set tax basis.
Args:
tax_basis(str): Tax basis.
"""
self.tax_basis = tax_basis
def get_tax_basis(self):
"""Get tax basis.
Returns:
str: Tax basis.
"""
return self.tax_basis
def set_is_org_active(self, is_org_active):
"""Set whether it the organization is active or not.
Args:
is_org_active(bool): True if organization is active else false.
"""
self.is_org_active = is_org_active
def set_name(self, name):
"""Set name.
Args:
name(str): Name.
"""
self.name = name
def get_name(self):
"""Get name.
Returns:
str: Name.
"""
return self.name
def set_value(self, value):
"""Set value.
Args:
value(str): Value.
"""
self.value = value
def get_value(self):
"""Get value.
Returns:
str: Value.
"""
return self.value
def set_version(self, version):
"""Set version.
Args:
version(str): Version
"""
self.version = version
def get_version(self):
"""Get version.
Returns:
str: Version.
"""
return self.version
def set_plan_type(self, plan_type):
"""Set plan type.
Args:
plan_type(int): Plan type.
"""
self.plan_type = plan_type
def get_plan_type(self):
"""Get plan type.
Returns:
int: Plan type.
"""
return self.plan_type
def set_plan_name(self, plan_name):
"""Set plan name.
Args:
plan_name(str): Plan name.
"""
self.plan_name = plan_name
def get_plan_name(self):
"""Get plan name.
Args:
str: Plan name.
"""
return self.plan_name
def set_plan_period(self, plan_period):
"""Set plan period.
Args:
plan_period(str): Plan period.
"""
self.plan_period = plan_period
def get_plan_period(self):
"""Get plan period.
Returns:
str: Plan period.
"""
return self.plan_period
def set_tax_group_enabled(self, tax_group_enabled):
"""Set tax group enabled.
Args:
tax_group_enabled(bool): Tax group enabled.
"""
self.tax_group_enabled = tax_group_enabled
def get_tax_group_enabled(self):
"""Get tax group enabled.
Returns:
bool: Tax group enabled.
"""
return self.tax_group_enabled
def set_account_created_date_formatted(self, account_created_date_formatted):
"""Set account created date formatted.
Args:
account_created_date_formatted(str): Account created date formatted.
"""
self.account_created_date_formatted = account_created_date_formatted
def get_account_created_date_formatted(self):
"""Get account created date formatted.
Returns:
str: Account created date formatted.
"""
return self.account_created_date_formatted
def set_zi_migration_status(self, zi_migration_status):
"""Set zi migration status.
Args:
zi_migration_status(int): Zi migration status.
"""
self.zi_migration_status = zi_migration_status
def get_zi_migration_status(self):
"""Get zi migration status .
Returns:
int: Zi migration status.
"""
return self.zi_migration_status
def set_custom_fields(self, custom_field):
"""Set custom fields.
Args:
custom_field(instance): Custom field.
"""
self.custom_fields.append(custom_field)
def get_custom_fields(self):
"""Get custom fields.
Returns:
list of instance: List of custom fields object.
"""
return self.custom_fields
def set_user_role(self, user_role):
"""Set user role.
Args:
user_role(str): User role.
"""
self.user_role = user_role
def get_user_role(self):
"""Get user role.
Returns:
str: User role.
"""
return self.user_role
def set_is_new_customer_custom_fields(self, is_new_customer_custom_fields):
"""Set whether new customer custom fields or not.
Args:
is_new_customer_custom_fields(bool): True if new customer custom fields else False.
"""
self.is_new_customer_custom_fields = is_new_customer_custom_fields
def get_is_new_customer_custom_fields(self):
"""Get whether new customer custom fields or not.
Returns:
bool: True if new customer custom fields else false.
"""
return self.is_new_customer_custom_fields
def set_is_portal_enabled(self, is_portal_enabled):
"""Set whether portal is enabled or not.
Args:
is_portal_enabled(bool): True if portal enabled else false.
"""
self.is_portal_enabled = is_portal_enabled
def get_is_portal_enabled(self):
"""Get whether is portal enabled.
Returns:
bool: True if portal is enabled else false.
"""
return self.is_portal_enabled
def set_portal_name(self, portal_name):
"""Set portal name.
Args:
portal_name(str): Portal name.
"""
self.portal_name = portal_name
def get_portal_name(self):
"""Get portal name.
Returns:
str: Portal name.
"""
return self.portal_name
def set_tax_type(self, tax_type):
"""Set tax type.
Args:
tax_type(str): Tax type.
"""
self.tax_type = tax_type
def get_tax_type(self):
"""Get tax type.
Returns:
str: Tax type.
"""
return self.tax_type
def to_json(self):
"""This method is used to convert organizations object to json format.
Returns:
dict: Dictionary containing json object for organizations.
"""
data = {}
if self.name != '':
data['name'] = self.name
if self.address is not None:
data['address'] = self.address.to_json()
if self.industry_type != '':
data['industry_type'] = self.industry_type
if self.industry_size != '':
data['industry_size'] = self.industry_size
if self.fiscal_year_start_month != '':
data['fiscal_year_start_month'] = self.fiscal_year_start_month
if self.currency_code != '':
data['currency_code'] = self.currency_code
if self.time_zone != '':
data['time_zone'] = self.time_zone
if self.date_format != '':
data['date_format'] = self.date_format
if self.field_separator != '':
data['field_separator'] = self.field_separator
if self.language_code != '':
data['language_code'] = self.language_code
if self.tax_basis != '':
data['tax_basis'] = self.tax_basis
if self.org_address != '':
data['org_address'] = self.org_address
if self.remit_to_address != '':
data['remit_to_address'] = self.remit_to_address
if self.tax_type != '':
data['tax_type'] = self.tax_type
return data
| 21.689376 | 95 | 0.554438 | 2,107 | 18,783 | 4.675368 | 0.050309 | 0.027408 | 0.043853 | 0.028424 | 0.347071 | 0.142016 | 0.124048 | 0.06172 | 0.053396 | 0.011166 | 0 | 0.000247 | 0.35218 | 18,783 | 865 | 96 | 21.714451 | 0.809336 | 0.298994 | 0 | 0.023904 | 0 | 0 | 0.015788 | 0.002201 | 0 | 0 | 0 | 0 | 0 | 1 | 0.350598 | false | 0 | 0.003984 | 0 | 0.525896 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
3cce6a5e106ab87c577f30e9958d57b369c0153e | 899 | py | Python | wafw00f/plugins/netscaler.py | wizard531/wafw00f | dce0d0616db0f970013432c520b51aeef62d387f | [
"BSD-3-Clause"
] | 10 | 2015-08-31T10:38:24.000Z | 2021-09-30T06:39:13.000Z | wafw00f/plugins/netscaler.py | wizard531/wafw00f | dce0d0616db0f970013432c520b51aeef62d387f | [
"BSD-3-Clause"
] | null | null | null | wafw00f/plugins/netscaler.py | wizard531/wafw00f | dce0d0616db0f970013432c520b51aeef62d387f | [
"BSD-3-Clause"
] | 17 | 2015-07-24T20:40:23.000Z | 2021-01-08T19:41:18.000Z | #!/usr/bin/env python
NAME = 'Citrix NetScaler'
def is_waf(self):
"""
First checks if a cookie associated with Netscaler is present,
if not it will try to find if a "Cneonction" or "nnCoection" is returned
for any of the attacks sent
"""
# NSC_ and citrix_ns_id come from David S. Langlands <dsl 'at' surfstar.com>
if self.matchcookie('^(ns_af=|citrix_ns_id|NSC_)'):
return True
if self.matchheader(('Cneonction', 'close'), attack=True):
return True
if self.matchheader(('nnCoection', 'close'), attack=True):
return True
if self.matchheader(('Via', 'NS-CACHE'), attack=True):
return True
if self.matchheader(('x-client-ip', '.'), attack=True):
return True
if self.matchheader(('Location', '\/vpn\/index\.html')):
return True
if self.matchcookie('^pwcount'):
return True
return False
| 31 | 80 | 0.63515 | 121 | 899 | 4.652893 | 0.545455 | 0.0746 | 0.127886 | 0.170515 | 0.328597 | 0.280639 | 0.280639 | 0.149201 | 0 | 0 | 0 | 0 | 0.230256 | 899 | 28 | 81 | 32.107143 | 0.813584 | 0.288098 | 0 | 0.411765 | 0 | 0 | 0.211382 | 0.043902 | 0 | 0 | 0 | 0 | 0 | 1 | 0.058824 | false | 0 | 0 | 0 | 0.529412 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
3ccecf87b913174165f3d12051085fb5985ecfb3 | 533 | py | Python | 2016/01_city_navigation_test.py | pchudzik/adventofcode | e1d6521621f6ca90f9dc53cf3d1ed5b8c5c2b7d1 | [
"MIT"
] | null | null | null | 2016/01_city_navigation_test.py | pchudzik/adventofcode | e1d6521621f6ca90f9dc53cf3d1ed5b8c5c2b7d1 | [
"MIT"
] | null | null | null | 2016/01_city_navigation_test.py | pchudzik/adventofcode | e1d6521621f6ca90f9dc53cf3d1ed5b8c5c2b7d1 | [
"MIT"
] | null | null | null | import importlib
import pytest
distance_calculator = importlib.import_module("01_city_navigation").distance_calculator
distance_calculator_2 = importlib.import_module("01_city_navigation").distance_calculator_2
@pytest.mark.parametrize(
"input, blocks_away", [
("R2, L3", 5),
("R2, R2, R2", 2),
("R5, L5, R5, R3", 12)])
def test_distance_calculator(input, blocks_away):
assert distance_calculator(input) == blocks_away
def test_part_two():
assert distance_calculator_2("R8, R4, R4, R8") == 4
| 28.052632 | 91 | 0.716698 | 70 | 533 | 5.142857 | 0.428571 | 0.35 | 0.158333 | 0.127778 | 0.488889 | 0.305556 | 0.305556 | 0.305556 | 0 | 0 | 0 | 0.055556 | 0.155722 | 533 | 18 | 92 | 29.611111 | 0.744444 | 0 | 0 | 0 | 0 | 0 | 0.183865 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 1 | 0.153846 | false | 0 | 0.307692 | 0 | 0.461538 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
3cd5a59c24add2c25ac76586db4dff2de31bec5d | 651 | gyp | Python | gyp/experimental.gyp | AsdMonio/rr-external_skia | 3839e72932bcef2f26a4f8826bb92b195f6cc396 | [
"Apache-2.0"
] | 27 | 2016-04-27T01:02:03.000Z | 2021-12-13T08:53:19.000Z | gyp/experimental.gyp | AsdMonio/rr-external_skia | 3839e72932bcef2f26a4f8826bb92b195f6cc396 | [
"Apache-2.0"
] | 2 | 2017-03-09T09:00:50.000Z | 2017-09-21T15:48:20.000Z | gyp/experimental.gyp | AsdMonio/rr-external_skia | 3839e72932bcef2f26a4f8826bb92b195f6cc396 | [
"Apache-2.0"
] | 20 | 2017-01-09T01:07:17.000Z | 2020-08-19T06:46:45.000Z | # Copyright 2015 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# GYP file to build experimental directory.
{
'targets': [
{
'target_name': 'experimental',
'type': 'static_library',
'include_dirs': [
'../include/config',
'../include/core',
],
'sources': [
'../experimental/SkSetPoly3To3.cpp',
'../experimental/SkSetPoly3To3_A.cpp',
'../experimental/SkSetPoly3To3_D.cpp',
],
'direct_dependent_settings': {
'include_dirs': [
'../experimental',
],
},
},
],
}
| 23.25 | 72 | 0.556068 | 61 | 651 | 5.803279 | 0.737705 | 0.211864 | 0.158192 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021645 | 0.290323 | 651 | 27 | 73 | 24.111111 | 0.744589 | 0.254992 | 0 | 0.272727 | 0 | 0 | 0.530271 | 0.267223 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3ce13b08027d9143fd7e86f2dd35809d03eaac36 | 644 | py | Python | iogt/settings/test.py | ChrisMarsh82/iogt | 8141421a79b73bd038880a3be92fa6809adced13 | [
"BSD-2-Clause"
] | 20 | 2021-04-29T12:36:25.000Z | 2022-03-27T12:17:41.000Z | iogt/settings/test.py | ChrisMarsh82/iogt | 8141421a79b73bd038880a3be92fa6809adced13 | [
"BSD-2-Clause"
] | 892 | 2021-02-02T13:56:06.000Z | 2022-03-31T11:25:44.000Z | iogt/settings/test.py | ChrisMarsh82/iogt | 8141421a79b73bd038880a3be92fa6809adced13 | [
"BSD-2-Clause"
] | 28 | 2021-02-19T19:28:37.000Z | 2022-03-11T11:46:00.000Z | from .base import *
SECRET_KEY = "nAHoNtaAFSBrVJhLbNfzbwMc751QFvby"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ.get('DB_NAME'),
'USER': os.environ.get('DB_USER'),
'PASSWORD': os.environ.get('DB_PASSWORD'),
'HOST': os.environ.get('DB_HOST'),
'PORT': os.environ.get('DB_PORT'),
}
}
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"
DEBUG = True
ALLOWED_HOSTS = ['*']
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
| 25.76 | 77 | 0.681677 | 69 | 644 | 6.217391 | 0.507246 | 0.104895 | 0.13986 | 0.16317 | 0.312354 | 0.312354 | 0.312354 | 0 | 0 | 0 | 0 | 0.005556 | 0.161491 | 644 | 24 | 78 | 26.833333 | 0.788889 | 0 | 0 | 0 | 0 | 0 | 0.450311 | 0.330745 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.058824 | 0.058824 | 0 | 0.058824 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
3ce49756c485938d52655dbc6a71240172003556 | 37,110 | py | Python | unilangs/unilangs.py | pculture/unilangs | c9f5ef817a3ff76bf966bc24248c33d0e23e6776 | [
"MIT"
] | 3 | 2015-01-10T08:27:34.000Z | 2021-08-17T17:12:54.000Z | unilangs/unilangs.py | pculture/unilangs | c9f5ef817a3ff76bf966bc24248c33d0e23e6776 | [
"MIT"
] | 1 | 2015-02-20T05:43:01.000Z | 2021-12-15T17:14:17.000Z | unilangs/unilangs.py | pculture/unilangs | c9f5ef817a3ff76bf966bc24248c33d0e23e6776 | [
"MIT"
] | 2 | 2019-01-20T12:34:14.000Z | 2020-01-15T17:23:22.000Z | # -*- coding: utf-8 -*-
"""Universal Language Codes
This library aims to provide an [en/de]coding utility for language codes.
To get a "universal" language code you create a LanguageCode object, giving it
the code and the standard it should use to look up that code.
>>> lc = LanguageCode('en', 'iso-639-1')
Internally the code is stored in a custom standard designed specifically for
this purpose. It doesn't have any use in the real world, so to get a useful
representation out you "encode" the code:
>>> lc.encode('iso-639-2')
'eng'
This is similar to Python's handling of Unicode and byte strings:
>>> s = 'Hello, world'.decode('ascii')
>>> s
u'Hello, world'
>>> s.encode('utf-8')
'Hello, world'
"""
import copy
from .bcp47.converter import (
StrictBCP47ToUnilangConverter, LossyBCP47ToUnilangConverter,
UNILANGS_TO_BCP47
)
def _reverse_dict(d):
return dict([(v, k) for k, v in d.items()])
# INTERNAL_NAMES stores the English names for the various languages.
#
# Code -> English name
#
# { 'ar': u'Arabic',
# 'el': u'Greek',
# ... }
INTERNAL_NAMES = {}
# TO_INTERNAL is a dict of dicts.
#
# The first level is a mapping of standard names to their dicts.
#
# The second level (one per standard) is a mapping of that standard's language
# codes to the internal language codes.
#
# { 'iso-639-1': {
# 'ak': 'aka',
# ...
# },
# ... }
TO_INTERNAL = {}
# FROM_INTERNAL is a dict of dicts.
#
# The first level is a mapping of standard names to their dicts.
#
# The second level (one per standard) is a mapping of internal language codes
# to that standard's language codes.
#
# { 'iso-639-1': {
# 'ak': 'aka',
# ...
# },
# ... }
FROM_INTERNAL = {}
gettext_noop = lambda s: s
def convert_bcp47_case(language_code):
"""
en -> en
fr -> fr
fr-ca -> fr-CA
es-mx -> es-MX
zh-cn -> zh-CN
zh-hant -> zh-Hant
zh-hans -> zh-Hans
"""
language_country = language_code.split('-')
if len(language_country) > 1:
if len(language_country[1]) > 2:
language_code = language_country[0] + '-' + language_country[1].capitalize()
else:
language_code = language_country[0] + '-' + language_country[1].upper()
return language_code
def add_standard(standard, mapping, base=None, exclude=None, bcp47_case=False):
"""Add a new standard to the list of supported standards.
`mapping` should be a dictionary mapping your custom standard's codes to the
internal "universal" code used by this library.
`base` is optional. If given it will use the given standard as a base and
copy all of its mappings before updating it with the ones you pass in
through `mappings`.
This can be useful for creating your own custom standard that's mostly like
an existing one except for a few changes:
>>> add_standard('my-standard', {'american': 'en'}, base='iso-639-1')
This example creates a new custom standard, which is pretty much like
ISO-639-1 but adds a code called 'american' that represents the English
language. Now you can do:
>>> lc = LanguageCode('american', 'my-standard')
>>> lc.encode('iso-639-2')
'en'
You can pass a list of codes to exclude from the base through the `exclude`
parameter:
>>> add_standard('my-standard', {'american': 'en'},
base='iso-639-1', exclude=('no', 'en'))
"""
if base:
if base == 'internal':
base_dict = {}
for key in INTERNAL_NAMES:
base_dict[key] = key
from_base_dict = base_dict.copy()
to_base_dict = base_dict
else:
from_base_dict = FROM_INTERNAL[base]
to_base_dict = TO_INTERNAL[base]
if bcp47_case:
forward_map = {}
reverse_map = {}
for key, val in to_base_dict.iteritems():
forward_map[convert_bcp47_case(key)] = val
for key, val in from_base_dict.iteritems():
reverse_map[key] = convert_bcp47_case(val)
else:
forward_map = from_base_dict.copy()
reverse_map = to_base_dict.copy()
forward_map.update(mapping)
if exclude:
for c in exclude:
del forward_map[c]
reverse_map.update(_reverse_dict(mapping))
else:
forward_map = mapping
reverse_map = _reverse_dict(mapping)
TO_INTERNAL[standard] = forward_map
FROM_INTERNAL[standard] = reverse_map
def add_standard_custom(standard, to_internal, from_internal):
"""Add a new standard to the list of supported standards with custom dicts.
`to_internal` should be a dictionary mapping your custom standard's codes to
the internal "universal" code used by this library.
`from_internal` should be a dictionary mapping the internal "universal"
codes to your custom standard's codes.
"""
TO_INTERNAL[standard] = to_internal
FROM_INTERNAL[standard] = from_internal
def _generate_initial_data():
INTERNAL_NAMES.update({
'aa': gettext_noop(u'Afar'),
'ab': gettext_noop(u'Abkhazian'),
'ace': gettext_noop(u'Acehnese'),
'ae': gettext_noop(u'Avestan'),
'aeb': gettext_noop(u'Tunisian Arabic'),
'af': gettext_noop(u'Afrikaans'),
'aka': gettext_noop(u'Akan'),
'am': gettext_noop(u'Amharic'),
'amh': gettext_noop(u'Amharic'),
'ami': gettext_noop(u'Amis'),
'an': gettext_noop(u'Aragonese'),
'ar': gettext_noop(u'Arabic'),
'arc': gettext_noop(u'Aramaic'),
'arq': gettext_noop(u'Algerian Arabic'),
'arz': gettext_noop(u'Egyptian Arabic'),
'as': gettext_noop(u'Assamese'),
'ase': gettext_noop(u'American Sign Language'),
'ast': gettext_noop(u'Asturian'),
'av': gettext_noop(u'Avaric'),
'ay': gettext_noop(u'Aymara'),
'az': gettext_noop(u'Azerbaijani'),
'ba': gettext_noop(u'Bashkir'),
'bam': gettext_noop(u'Bambara'),
'be': gettext_noop(u'Belarusian'),
'bem': gettext_noop(u'Bemba (Zambia)'),
'ber': gettext_noop(u'Berber'),
'bg': gettext_noop(u'Bulgarian'),
'bh': gettext_noop(u'Bihari'),
'bi': gettext_noop(u'Bislama'),
'bn': gettext_noop(u'Bengali'),
'bnt': gettext_noop(u'Ibibio'),
'bo': gettext_noop(u'Tibetan'),
'br': gettext_noop(u'Breton'),
'bs': gettext_noop(u'Bosnian'),
'bug': gettext_noop(u'Buginese'),
'ca': gettext_noop(u'Catalan'),
'cak': gettext_noop(u'Cakchiquel, Central'),
'ce': gettext_noop(u'Chechen'),
'ceb': gettext_noop(u'Cebuano'),
'ch': gettext_noop(u'Chamorro'),
'cho': gettext_noop(u'Choctaw'),
'chr': gettext_noop(u'Cherokee'),
'ckb': gettext_noop(u'Kurdish (Central)'),
'cku': gettext_noop(u'Koasati'),
'cly': gettext_noop(u'Eastern Chatino'),
'cnh': gettext_noop(u'Hakha Chin'),
'co': gettext_noop(u'Corsican'),
'cr': gettext_noop(u'Cree'),
'crs': gettext_noop(u'Seselwa Creole French'),
'cs': gettext_noop(u'Czech'),
'cta': gettext_noop(u'Tataltepec Chatino'),
'ctd': gettext_noop(u'Chin, Tedim'),
'ctu': gettext_noop(u'Chol, Tumbal\xe1'),
'cu': gettext_noop(u'Church Slavic'),
'cv': gettext_noop(u'Chuvash'),
'cy': gettext_noop(u'Welsh'),
'czn': gettext_noop(u'Zenzontepec Chatino'),
'da': gettext_noop(u'Danish'),
'de': gettext_noop(u'German'),
'de-at': gettext_noop(u'German (Austria)'),
'de-ch': gettext_noop(u'German (Switzerland)'),
'din': gettext_noop(u'Dinka'),
'dje': gettext_noop(u'Zarma'),
'dsb': gettext_noop('Lower Sorbian'),
'dv': gettext_noop(u'Divehi'),
'dz': gettext_noop(u'Dzongkha'),
'ee': gettext_noop(u'Ewe'),
'efi': gettext_noop(u'Efik'),
'el': gettext_noop(u'Greek'),
'en': gettext_noop(u'English'),
'en-au': gettext_noop(u'English (Australia)'),
'en-ca': gettext_noop(u'English (Canada)'),
'en-gb': gettext_noop(u'English, British'),
'en-ie': gettext_noop(u'English (Ireland)'),
'en-in': gettext_noop(u'English (India)'),
'en-us': gettext_noop(u'English (United States)'),
'enq': gettext_noop(u'Enga'),
'eo': gettext_noop(u'Esperanto'),
'es': gettext_noop(u'Spanish'),
'es-419': gettext_noop(u'Spanish (Latin America)'),
'es-ar': gettext_noop(u'Spanish, Argentinian'),
'es-ec': gettext_noop(u'Spanish (Ecuador)'),
'es-es': gettext_noop('Spanish (Spain)'),
'es-mx': gettext_noop(u'Spanish, Mexican'),
'es-ni': gettext_noop(u'Spanish, Nicaraguan'),
'et': gettext_noop(u'Estonian'),
'eu': gettext_noop(u'Basque'),
'fa': gettext_noop(u'Persian'),
'fa-af': gettext_noop(u'Persian (Afghanistan)'),
'ff': gettext_noop(u'Fulah'),
'fi': gettext_noop(u'Finnish'),
'fil': gettext_noop(u'Filipino'),
'fj': gettext_noop(u'Fijian'),
'fo': gettext_noop(u'Faroese'),
'fr': gettext_noop(u'French'),
'fr-be': gettext_noop(u'French (Belgium)'),
'fr-ca': gettext_noop(u'French (Canada)'),
'fr-ch': gettext_noop(u'French (Switzerland)'),
'frp': gettext_noop(u'Franco-Provençal (Arpitan)'),
'ful': gettext_noop(u'Fula'),
'fy': gettext_noop('Western Frisian'),
'fy-nl': gettext_noop(u'Frisian'),
'ga': gettext_noop(u'Irish'),
'gd': gettext_noop(u'Scottish Gaelic'),
'gl': gettext_noop(u'Galician'),
'gn': gettext_noop(u'Guarani'),
'got': gettext_noop(u'Gothic'),
'gsw': gettext_noop(u'Swiss German'),
'gu': gettext_noop(u'Gujarati'),
'gug': gettext_noop(u'Paraguayan Guaran\xed'),
'gv': gettext_noop(u'Manx'),
'gwi': gettext_noop(u'Gwich\'in'),
'ha': gettext_noop('Hausa'),
'haa': gettext_noop(u'H\xe4n'),
'hai': gettext_noop(u'Haida'),
'hau': gettext_noop(u'Hausa'),
'haw': gettext_noop(u'Hawaiian'),
'haz': gettext_noop(u'Hazaragi'),
'hb': gettext_noop(u'HamariBoli (Roman Hindi-Urdu)'),
'hch': gettext_noop(u'Huichol'),
'he': gettext_noop(u'Hebrew'),
'hi': gettext_noop(u'Hindi'),
'hmn': gettext_noop(u'Hmong'),
'ho': gettext_noop(u'Hiri Motu'),
'hoc': gettext_noop(u'Ho'),
'hoi': gettext_noop(u'Holikachuk'),
'hr': gettext_noop(u'Croatian'),
'hsb': gettext_noop('Upper Sorbian'),
'ht': gettext_noop(u'Creole, Haitian'),
'hu': gettext_noop(u'Hungarian'),
'hup': gettext_noop(u'Hupa'),
'hus': gettext_noop(u'Huastec, Veracruz'),
'hwc': gettext_noop(u"Hawai'i Creole English"),
'hy': gettext_noop(u'Armenian'),
'hz': gettext_noop(u'Herero'),
'ia': gettext_noop(u'Interlingua'),
'ibo': gettext_noop(u'Igbo'),
'id': gettext_noop(u'Indonesian'),
'ie': gettext_noop(u'Interlingue'),
'ii': gettext_noop(u'Sichuan Yi'),
'ik': gettext_noop(u'Inupia'),
'ilo': gettext_noop(u'Ilocano'),
'inh': gettext_noop(u'Ingush'),
'io': gettext_noop(u'Ido'),
'iro': gettext_noop(u'Iroquoian languages'),
'is': gettext_noop(u'Icelandic'),
'it': gettext_noop(u'Italian'),
'iu': gettext_noop(u'Inuktitut'),
'iw': gettext_noop('Hebrew'),
'ja': gettext_noop(u'Japanese'),
'jv': gettext_noop(u'Javanese'),
'ka': gettext_noop(u'Georgian'),
'kaa': gettext_noop(u'Karakalpak'),
'kar': gettext_noop(u'Karen'),
'kau': gettext_noop(u'Kanuri'),
'kik': gettext_noop(u'Gikuyu'),
'kin': gettext_noop(u'Kinyarwanda'),
'kj': gettext_noop(u'Kuanyama, Kwanyama'),
'kk': gettext_noop(u'Kazakh'),
'kl': gettext_noop(u'Greenlandic'),
'km': gettext_noop(u'Khmer'),
'kn': gettext_noop(u'Kannada'),
'ko': gettext_noop(u'Korean'),
'kon': gettext_noop(u'Kongo'),
'koy': gettext_noop(u'Koyukon'),
'ks': gettext_noop(u'Kashmiri'),
'ksh': gettext_noop(u'Colognian'),
'ku': gettext_noop(u'Kurdish'),
'kv': gettext_noop(u'Komi'),
'kw': gettext_noop(u'Cornish'),
'ky': gettext_noop(u'Kyrgyz'),
'la': gettext_noop(u'Latin'),
'lb': gettext_noop(u'Luxembourgish'),
'lg': gettext_noop(u'Ganda'),
'li': gettext_noop(u'Limburgish'),
'lin': gettext_noop(u'Lingala'),
'lkt': gettext_noop(u'Lakota'),
'lld': gettext_noop(u'Ladin'),
'ln': gettext_noop('Lingala'),
'lo': gettext_noop(u'Lao'),
'loz': gettext_noop(u'Lozi'),
'lt': gettext_noop(u'Lithuanian'),
'ltg': gettext_noop(u'Latgalian'),
'lu': gettext_noop(u'Luba-Katagana'),
'lua': gettext_noop(u'Luba-Kasai'),
'luo': gettext_noop(u'Luo'),
'lus': gettext_noop(u'Mizo'),
'lut': gettext_noop(u'Lushootseed'),
'luy': gettext_noop(u'Luhya'),
'lv': gettext_noop(u'Latvian'),
'mad': gettext_noop(u'Madurese'),
'meta-audio': gettext_noop(u'Metadata: Audio Description'),
'meta-geo': gettext_noop(u'Metadata: Geo'),
'meta-tw': gettext_noop(u'Metadata: Twitter'),
'meta-video': gettext_noop(u'Metadata: Video Description'),
'meta-wiki': gettext_noop(u'Metadata: Wikipedia'),
'mfe': gettext_noop('Mauritian Creole'),
'mg': gettext_noop('Malagasy'),
'mh': gettext_noop(u'Marshallese'),
'mi': gettext_noop(u'Maori'),
'mk': gettext_noop(u'Macedonian'),
'ml': gettext_noop(u'Malayalam'),
'mlg': gettext_noop(u'Malagasy'),
'mn': gettext_noop(u'Mongolian'),
'mni': gettext_noop(u'Manipuri'),
'mnk': gettext_noop(u'Mandinka'),
'mo': gettext_noop(u'Moldavian, Moldovan'),
'moh': gettext_noop(u'Mohawk'),
'mos': gettext_noop(u'Moor\xe9 (Mossi)'),
'mr': gettext_noop(u'Marathi'),
'ms': gettext_noop(u'Malay'),
'mt': gettext_noop(u'Maltese'),
'mus': gettext_noop(u'Muscogee'),
'my': gettext_noop(u'Burmese'),
'na': gettext_noop(u'Naurunan'),
'nan': gettext_noop(u'Hokkien'),
'nb': gettext_noop(u'Norwegian Bokmal'),
'nci': gettext_noop(u'Nahuatl, Classical'),
'ncj': gettext_noop(u'Nahuatl, Northern Puebla'),
'nd': gettext_noop(u'North Ndebele'),
'ne': gettext_noop(u'Nepali'),
'ng': gettext_noop(u'Ndonga'),
'nl': gettext_noop(u'Dutch'),
'nl-be': gettext_noop(u'Dutch (Belgium)'),
'nn': gettext_noop(u'Norwegian Nynorsk'),
'no': gettext_noop(u'Norwegian'),
'nr': gettext_noop(u'Southern Ndebele'),
'nso': gettext_noop(u'Northern Sotho'),
'nv': gettext_noop(u'Navajo'),
'nya': gettext_noop(u'Chewa'),
'oc': gettext_noop(u'Occitan'),
'oji': gettext_noop(u'Ojibwe'),
'om': gettext_noop('Oromo'),
'or': gettext_noop(u'Oriya'),
'orm': gettext_noop(u'Oromo'),
'os': gettext_noop(u'Ossetian, Ossetic'),
'pa': gettext_noop('Punjabi'),
'pam': gettext_noop(u'Kapampangan'),
'pan': gettext_noop(u'Punjabi'),
'pap': gettext_noop(u'Papiamento'),
'pcd': gettext_noop(u'Picard'),
'pcm': gettext_noop(u'Nigerian Pidgin'),
'pi': gettext_noop(u'Pali'),
'pl': gettext_noop(u'Polish'),
'pnb': gettext_noop(u'Western Punjabi'),
'prs': gettext_noop(u'Dari'),
'ps': gettext_noop(u'Pashto'),
'pt': gettext_noop(u'Portuguese'),
'pt-br': gettext_noop(u'Portuguese, Brazilian'),
'pt-pt': gettext_noop('Portuguese (Portugal)'),
'qu': gettext_noop('Quechua'),
'que': gettext_noop(u'Quechua'),
'qvi': gettext_noop(u'Quichua, Imbabura Highland'),
'raj': gettext_noop(u'Rajasthani'),
'rar': gettext_noop(u'Cook Islands M\u0101ori'),
'rm': gettext_noop(u'Romansh'),
'rn': gettext_noop('Rundi'),
'ro': gettext_noop(u'Romanian'),
'ru': gettext_noop(u'Russian'),
'run': gettext_noop(u'Rundi'),
'rup': gettext_noop(u'Macedo'),
'rw': gettext_noop('Kinyarwanda'),
'ry': gettext_noop(u'Rusyn'),
'sa': gettext_noop(u'Sanskrit'),
'sat': gettext_noop(u'Santali'),
'sby': gettext_noop(u'Soli'),
'sc': gettext_noop(u'Sardinian'),
'scn': gettext_noop(u'Sicilian'),
'sco': gettext_noop(u'Scots'),
'sd': gettext_noop(u'Sindhi'),
'se': gettext_noop(u'Northern Sami'),
'sg': gettext_noop(u'Sango'),
'sgn': gettext_noop(u'Sign Languages'),
'sh': gettext_noop(u'Serbo-Croatian'),
'shp': gettext_noop(u'Shipibo-Conibo'),
'si': gettext_noop(u'Sinhala'),
'sk': gettext_noop(u'Slovak'),
'skx': gettext_noop(u'Seko Padang'),
'sl': gettext_noop(u'Slovenian'),
'sm': gettext_noop(u'Samoan'),
'sn': gettext_noop('Shona'),
'sna': gettext_noop(u'Shona'),
'so': gettext_noop('Somali'),
'som': gettext_noop(u'Somali'),
'sot': gettext_noop(u'Sotho'),
'sq': gettext_noop(u'Albanian'),
'sr': gettext_noop(u'Serbian'),
'sr-latn': gettext_noop(u'Serbian, Latin'),
'srp': gettext_noop(u'Montenegrin'),
'ss': gettext_noop(u'Swati'),
'st': gettext_noop(u'Southern Sotho'),
'sto': gettext_noop(u'Stoney (Nakoda)'),
'su': gettext_noop(u'Sundanese'),
'sv': gettext_noop(u'Swedish'),
'sw': gettext_noop('Swahili'),
'swa': gettext_noop(u'Swahili'),
'szl': gettext_noop(u'Silesian'),
'ta': gettext_noop(u'Tamil'),
'taa': gettext_noop(u'Benhti Kenaga’'),
'tao': gettext_noop(u'Yami (Tao)'),
'tar': gettext_noop(u'Tarahumara, Central'),
'te': gettext_noop(u'Telugu'),
'tet': gettext_noop(u'Tetum'),
'tg': gettext_noop(u'Tajik'),
'th': gettext_noop(u'Thai'),
'ti': gettext_noop('Tigrinya'),
'tir': gettext_noop(u'Tigrinya'),
'tk': gettext_noop(u'Turkmen'),
'tl': gettext_noop(u'Tagalog'),
'tlh': gettext_noop(u'Klingon'),
'tn': gettext_noop('Tswana'),
'to': gettext_noop(u'Tonga'),
'tob': gettext_noop('Qom (Toba)'),
'toj': gettext_noop(u'Tojolabal'),
'tr': gettext_noop(u'Turkish'),
'trv': gettext_noop(u'Seediq'),
'ts': gettext_noop(u'Tsonga'),
'tsn': gettext_noop(u'Tswana'),
'tsz': gettext_noop(u'Purepecha'),
'tt': gettext_noop(u'Tatar'),
'tw': gettext_noop(u'Twi'),
'ty': gettext_noop(u'Tahitian'),
'tzh': gettext_noop(u'Tzeltal, Oxchuc'),
'tzo': gettext_noop(u'Tzotzil, Venustiano Carranza'),
'ug': gettext_noop(u'Uyghur'),
'uk': gettext_noop(u'Ukrainian'),
'umb': gettext_noop(u'Umbundu'),
'ur': gettext_noop(u'Urdu'),
'uz': gettext_noop(u'Uzbek'),
've': gettext_noop(u'Venda'),
'vi': gettext_noop(u'Vietnamese'),
'vls': gettext_noop(u'Flemish'),
'vo': gettext_noop(u'Volapuk'),
'wa': gettext_noop(u'Walloon'),
'wau': gettext_noop(u'Wauja'),
'wbl': gettext_noop(u'Wakhi'),
'wo': gettext_noop('Wolof'),
'wol': gettext_noop(u'Wolof'),
'x-other': gettext_noop(u'Other'),
'xh': gettext_noop('Xhosa'),
'xho': gettext_noop(u'Xhosa'),
'yaq': gettext_noop(u'Yaqui'),
'yi': gettext_noop(u'Yiddish'),
'yo': gettext_noop('Yoruba'),
'yor': gettext_noop(u'Yoruba'),
'yua': gettext_noop(u'Maya, Yucat\xe1n'),
'za': gettext_noop(u'Zhuang, Chuang'),
'zam': gettext_noop(u'Zapotec, Miahuatl\xe1n'),
'zh': gettext_noop(u'Chinese, Yue'),
'zh-cn': gettext_noop(u'Chinese, Simplified'),
'zh-hans': gettext_noop('Chinese (Simplified Han)'),
'zh-hant': gettext_noop('Chinese (Traditional Han)'),
'zh-hk': gettext_noop(u'Chinese, Traditional (Hong Kong)'),
'zh-sg': gettext_noop(u'Chinese, Simplified (Singaporean)'),
'zh-tw': gettext_noop(u'Chinese, Traditional'),
'zu': gettext_noop('Zulu'),
'zul': gettext_noop(u'Zulu'),
'zza': gettext_noop(u'Zazaki'),
})
def _add_iso_639_1():
add_standard('iso-639-1', {
'ab': 'ab',
'aa': 'aa',
'af': 'af',
'ak': 'aka',
'sq': 'sq',
'am': 'amh',
'ar': 'ar',
'an': 'an',
'hy': 'hy',
'as': 'as',
'av': 'av',
'ae': 'ae',
'ay': 'ay',
'az': 'az',
'bm': 'bam',
'ba': 'ba',
'eu': 'eu',
'be': 'be',
'bn': 'bn',
'bh': 'bh',
'bi': 'bi',
'bs': 'bs',
'br': 'br',
'bg': 'bg',
'my': 'my',
'ca': 'ca',
'km': 'km',
'ch': 'ch',
'ce': 'ce',
'ny': 'nya',
'zh': 'zh',
'cu': 'cu',
'cv': 'cv',
'kw': 'kw',
'co': 'co',
'cr': 'cr',
'hr': 'hr',
'cs': 'cs',
'da': 'da',
'dv': 'dv',
'nl': 'nl',
'dz': 'dz',
'en': 'en',
'eo': 'eo',
'et': 'et',
'ee': 'ee',
'fo': 'fo',
'fj': 'fj',
'fi': 'fi',
'fr': 'fr',
'ff': 'ff',
'gl': 'gl',
'lg': 'lg',
'ka': 'ka',
'de': 'de',
'el': 'el',
'gn': 'gn',
'gu': 'gu',
'ht': 'ht',
'ha': 'hau',
'he': 'he',
'hz': 'hz',
'hi': 'hi',
'ho': 'ho',
'hu': 'hu',
'is': 'is',
'io': 'io',
'ig': 'ibo',
'id': 'id',
'ia': 'ia',
'ie': 'ie',
'iu': 'iu',
'ik': 'ik',
'ga': 'ga',
'it': 'it',
'ja': 'ja',
'jv': 'jv',
'kl': 'kl',
'kn': 'kn',
'kr': 'kau',
'ks': 'ks',
'kk': 'kk',
'ki': 'kik',
'rw': 'kin',
'ky': 'ky',
'kv': 'kv',
'kg': 'kon',
'ko': 'ko',
'kj': 'kj',
'ku': 'ku',
'lo': 'lo',
'la': 'la',
'lv': 'lv',
'li': 'li',
'ln': 'lin',
'lt': 'lt',
'lu': 'lu',
'lb': 'lb',
'mk': 'mk',
'mg': 'mlg',
'ms': 'ms',
'ml': 'ml',
'mt': 'mt',
'gv': 'gv',
'mi': 'mi',
'mr': 'mr',
'mh': 'mh',
'mo': 'mo',
'mn': 'mn',
'na': 'na',
'nv': 'nv',
'ng': 'ng',
'ne': 'ne',
'nd': 'nd',
'se': 'se',
'no': 'nb',
'nb': 'nb',
'nn': 'nn',
'oc': 'oc',
'oj': 'oji',
'or': 'or',
'om': 'orm',
'os': 'os',
'pi': 'pi',
'pa': 'pa',
'fa': 'fa',
'pl': 'pl',
'pt': 'pt',
'ps': 'ps',
'qu': 'que',
'ro': 'ro',
'rm': 'rm',
'rn': 'run',
'ru': 'ru',
'ry': 'ry',
'sm': 'sm',
'sg': 'sg',
'sa': 'sa',
'sc': 'sc',
'gd': 'gd',
'sr': 'sr',
'sh': 'sh',
'sn': 'sna',
'ii': 'ii',
'sd': 'sd',
'si': 'si',
'sk': 'sk',
'sl': 'sl',
'so': 'som',
'st': 'sot',
'nr': 'nr',
'es': 'es',
'su': 'su',
'sw': 'swa',
'ss': 'ss',
'sv': 'sv',
'tl': 'tl',
'ty': 'ty',
'tg': 'tg',
'ta': 'ta',
'tt': 'tt',
'te': 'te',
'th': 'th',
'bo': 'bo',
'ti': 'tir',
'to': 'to',
'ts': 'ts',
'tn': 'tsn',
'tr': 'tr',
'tk': 'tk',
'tw': 'tw',
'ug': 'ug',
'uk': 'uk',
'ur': 'ur',
'uz': 'uz',
've': 've',
'vi': 'vi',
'vo': 'vo',
'wa': 'wa',
'cy': 'cy',
'fy': 'fy-nl',
'wo': 'wol',
'xh': 'xho',
'yi': 'yi',
'yo': 'yor',
'za': 'za',
'zu': 'zul',
})
def _add_django():
add_standard('django', {
'ar': 'ar',
'az': 'az',
'bg': 'bg',
'bn': 'bn',
'bs': 'bs',
'ca': 'ca',
'cs': 'cs',
'cy': 'cy',
'da': 'da',
'de': 'de',
'el': 'el',
'en': 'en',
'en-gb': 'en-gb',
'es': 'es',
'es-ar': 'es-ar',
'es-mx': 'es-mx',
'es-ni': 'es-ni',
'et': 'et',
'eu': 'eu',
'fa': 'fa',
'fi': 'fi',
'fr': 'fr',
'fr-ca': 'fr-ca',
'fy-nl': 'fy-nl',
'ga': 'ga',
'gl': 'gl',
'he': 'he',
'hi': 'hi',
'hr': 'hr',
'hu': 'hu',
'id': 'id',
'is': 'is',
'it': 'it',
'ja': 'ja',
'ka': 'ka',
'km': 'km',
'kn': 'kn',
'ko': 'ko',
'lt': 'lt',
'lv': 'lv',
'mk': 'mk',
'ml': 'ml',
'mn': 'mn',
'nl': 'nl',
'nb': 'nb',
'nn': 'nn',
'pl': 'pl',
'pt': 'pt',
'pt-br': 'pt-br',
'ro': 'ro',
'ru': 'ru',
'sk': 'sk',
'sl': 'sl',
'sq': 'sq',
'sr': 'sr',
'sr-latn': 'sr-latn',
'sv': 'sv',
'ta': 'ta',
'te': 'te',
'th': 'th',
'tr': 'tr',
'uk': 'uk',
'ur': 'ur',
'vi': 'vi',
'zh-cn': 'zh-cn',
'zh-tw': 'zh-tw',
})
def _add_unisubs():
add_standard('unisubs', {
'aa': 'aa',
'ab': 'ab',
'ace': 'ace',
'ae': 'ae',
'aeb': 'aeb',
'af': 'af',
'aka': 'aka',
'amh': 'amh',
'ami': 'ami',
'an': 'an',
'arc': 'arc',
'arq': 'arq',
'arz': 'arz',
'as': 'as',
'ase': 'ase',
'ast': 'ast',
'av': 'av',
'ay': 'ay',
'ba': 'ba',
'bam': 'bam',
'be': 'be',
'bem': 'bem',
'ber': 'ber',
'bh': 'bh',
'bi': 'bi',
'bnt': 'bnt',
'bo': 'bo',
'br': 'br',
'bug': 'bug',
'cak': 'cak',
'ce': 'ce',
'ceb': 'ceb',
'ch': 'ch',
'cho': 'cho',
'chr': 'chr',
'ckb': 'ckb',
'cku': 'cku',
'cly': 'cly',
'cnh': 'cnh',
'co': 'co',
'cr': 'cr',
'crs': 'crs',
'cta': 'cta',
'ctu': 'ctu',
'ctd': 'ctd',
'cu': 'cu',
'cv': 'cv',
'czn': 'czn',
'de-ch': 'de-ch',
'dje': 'dje',
'dsb': 'dsb',
'dv': 'dv',
'dz': 'dz',
'ee': 'ee',
'efi': 'efi',
'en-gb': 'en-gb',
'enq': 'enq',
'eo': 'eo',
'es-ar': 'es-ar',
'es-419': 'es-419',
'ff': 'ff',
'fil': 'fil',
'fj': 'fj',
'fo': 'fo',
'fr-ca': 'fr-ca',
'frp': 'frp',
'ful': 'ful',
'ga': 'ga',
'gd': 'gd',
'gn': 'gn',
'got': 'got',
'gsw': 'gsw',
'gu': 'gu',
'gug': 'gug',
'gv': 'gv',
'gwi': 'gwi',
'haa': 'haa',
'hai': 'hai',
'hau': 'hau',
'haw': 'haw',
'haz': 'haz',
'hb': 'hb',
'hch': 'hch',
'hmn': 'hmn',
'ho': 'ho',
'hoc': 'hoc',
'hoi': 'hoi',
'hsb': 'hsb',
'ht': 'ht',
'hup': 'hup',
'hus': 'hus',
'hwc': 'hwc',
'hy': 'hy',
'hz': 'hz',
'ia': 'ia',
'ibo': 'ibo',
'ie': 'ie',
'ii': 'ii',
'ik': 'ik',
'ilo': 'ilo',
'iro': 'iro',
'inh': 'inh',
'inh': 'inh',
'io': 'io',
'iro': 'iro',
'iu': 'iu',
'jv': 'jv',
'kaa': 'kaa',
'kar': 'kar',
'kau': 'kau',
'kik': 'kik',
'kin': 'kin',
'kj': 'kj',
'kk': 'kk',
'kl': 'kl',
'kon': 'kon',
'koy': 'koy',
'ks': 'ks',
'ksh' : 'ksh',
'ku': 'ku',
'kv': 'kv',
'kw': 'kw',
'ky': 'ky',
'la': 'la',
'lld': 'lld',
'lb': 'lb',
'lg': 'lg',
'li': 'li',
'lin': 'lin',
'lkt': 'lkt',
'lo': 'lo',
'loz': 'loz',
'ltg': 'ltg',
'lu': 'lu',
'lua': 'lua',
'luo': 'luo',
'lus': 'lus',
'lut': 'lut',
'luy': 'luy',
'meta-audio':'meta-audio',
'meta-geo': 'meta-geo',
'meta-tw': 'meta-tw',
'meta-video':'meta-video',
'meta-wiki': 'meta-wiki',
'mad': 'mad',
'mfe': 'mfe',
'mh': 'mh',
'mi': 'mi',
'ml': 'ml',
'mlg': 'mlg',
'mni': 'mni',
'mnk': 'mnk',
'mo': 'mo',
'moh': 'moh',
'mos': 'mos',
'mr': 'mr',
'ms': 'ms',
'mt': 'mt',
'mus': 'mus',
'my': 'my',
'na': 'na',
'nan': 'nan',
'nci': 'nci',
'ncj': 'ncj',
'nd': 'nd',
'ne': 'ne',
'ng': 'ng',
'nr': 'nr',
'nso': 'nso',
'nv': 'nv',
'nya': 'nya',
'oc': 'oc',
'oji': 'oji',
'or': 'or',
'orm': 'orm',
'os': 'os',
'pam': 'pam',
'pan': 'pan',
'pap': 'pap',
'pcd': 'pcd',
'pcm': 'pcm',
'pi': 'pi',
'pnb': 'pnb',
'prs': 'prs',
'ps': 'ps',
'pt-br': 'pt-br',
'que': 'que',
'qvi': 'qvi',
'raj': 'raj',
'rar': 'rar',
'rm': 'rm',
'run': 'run',
'rup': 'rup',
'ry': 'ry',
'sa': 'sa',
'sat': 'sat',
'sby': 'sby',
'sc': 'sc',
'scn': 'scn',
'sco': 'sco',
'sd': 'sd',
'se': 'se',
'sg': 'sg',
'sgn': 'sgn',
'skx': 'skx',
'sh': 'sh',
'shp': 'shp',
'si': 'si',
'sm': 'sm',
'sna': 'sna',
'som': 'som',
'sot': 'sot',
'sr-latn': 'sr-latn',
'srp': 'srp',
'ss': 'ss',
'st': 'st',
'sto': 'sto',
'su': 'su',
'swa': 'swa',
'szl': 'szl',
'taa': 'taa',
'tao': 'tao',
'tar': 'tar',
'tet': 'tet',
'tg': 'tg',
'tir': 'tir',
'tk': 'tk',
'tl': 'tl',
'tlh': 'tlh',
'to': 'to',
'tob': 'tob',
'toj': 'toj',
'trv': 'trv',
'ts': 'ts',
'tsz': 'tsz',
'tsn': 'tsn',
'tzh': 'tzh',
'tzo': 'tzo',
'tt': 'tt',
'tw': 'tw',
'ty': 'ty',
'ug': 'ug',
'umb': 'umb',
'uz': 'uz',
've': 've',
'vls': 'vls',
'vo': 'vo',
'wa': 'wa',
'wau': 'wau',
'wbl': 'wbl',
'wol': 'wol',
'x-other': 'x-other',
'xho': 'xho',
'yaq': 'yaq',
'yi': 'yi',
'yor': 'yor',
'yua': 'yua',
'za': 'za',
'zam': 'zam',
'zh': 'zh',
'zh-cn': 'zh-cn',
'zh-tw': 'zh-tw',
'zh-sg': 'zh-sg',
'zh-hk': 'zh-hk',
'zul': 'zul',
'zza': 'zza',
}, base='django')
def _add_youtube_with_mapping():
add_standard('youtube_with_mapping', {
'ak': 'aka',
'am': 'amh',
'fy': 'fy-nl',
'ha': 'hau',
'ig': 'ibo',
'iw': 'he',
'mg': 'mlg',
'no': 'nb',
'ny': 'nya',
'pa': 'pan',
'fa-AF': 'prs',
'pt-PT': 'pt',
'rw': 'kin',
'sn': 'sna',
'so': 'som',
'st': 'sot',
'sw': 'swa',
'ti': 'tir',
'tn': 'tsn',
'xh': 'xho',
'yo': 'yor',
'yue-HK': 'zh',
'zh-Hans': 'zh-cn',
'zh-Hant': 'zh-tw',
'zu': 'zul',
}, base='internal', bcp47_case=True)
def _add_youtube():
add_standard('youtube', {}, base='internal', bcp47_case=True)
def _add_gettext():
# translate locale names from our gettext directories to internal language
# codes
add_standard('gettext', {
'az-az': 'az',
}, base='unisubs')
def _add_bcp47():
add_standard_custom('bcp47', StrictBCP47ToUnilangConverter(),
UNILANGS_TO_BCP47)
add_standard_custom('bcp47-lossy', LossyBCP47ToUnilangConverter(),
UNILANGS_TO_BCP47)
_generate_initial_data()
_add_iso_639_1()
_add_django()
_add_unisubs()
_add_youtube()
_add_youtube_with_mapping()
_add_bcp47()
_add_gettext()
class LanguageCode(object):
def __init__(self, language_code, standard):
if standard == 'internal':
self._code = language_code
return
try:
standard_dict = TO_INTERNAL[standard.lower()]
except KeyError:
raise Exception("Standard '%s' is not registred" % standard)
self._code = standard_dict[language_code]
def to_internal(self):
return self._code
def encode(self, standard, fuzzy=False):
"""Return the code for this language in the given standard."""
if standard == 'internal':
return self._code
elif fuzzy:
return self._fuzzy_encode(standard)
else:
return FROM_INTERNAL[standard.lower()][self._code]
def _fuzzy_encode(self, standard):
"""Return the code or closest approximate for this language in the given standard.
This will try harder than the `encode()` function, but may result in
data loss. For example:
>>> lc = LanguageCode('en-gb', 'django')
>>> lc.name()
'British English'
>>> lc.encode('iso-639-1')
KeyError...
>>> lc.fuzzy_encode('iso-639-1')
'en'
Here's an example of how you can lose data:
>>> original = 'en-gb' # Start with 'en-gb'
>>> lc = LanguageCode(original, 'django') # Decode as Django
>>> new_lang = lc.fuzzy_encode('iso-639-1') # Fuzzy encode to ISO-639-1
>>> new_lc = LanguageCode(new_lang, 'iso-639-1') # Decode as ISO-639-1
>>> result = new_lc.encode('django') # Encode back to Django
>>> assert original != result
"""
# TODO: This.
return
def name(self):
"""Return the English name for this language as a unicode string.
Note: The strings returned from this function have already been marked
with gettext_noop, so they should be safe to use with gettext to
translate into another language.
"""
return INTERNAL_NAMES[self._code]
def aliases(self):
"""Return the "aliases" for this language code.
This is easiest to describe with an example:
>>> LanguageCode('en', 'iso-639-1').aliases()
{ 'iso-639-1': 'en',
'iso-639-2': 'eng',
'django': 'en',
# ...
}
"""
standards = FROM_INTERNAL.keys()
return dict([(standard, FROM_INTERNAL[standard][self._code])
for standard in standards
if FROM_INTERNAL[standard].get(self._code)])
def get_language_name_mapping(standard):
"""Return a dict of code -> english name for all languages in the standard."""
if standard == 'internal':
return dict((code, name) for code, name in INTERNAL_NAMES.items())
else:
return dict((code, LanguageCode(code, standard).name())
for code in TO_INTERNAL.get(standard))
def get_language_code_mapping(standard):
"""Return a dict of code -> LanguageCode for all languages in the standard."""
return dict((code, LanguageCode(code, standard))
for code in TO_INTERNAL.get(standard))
def _debug_missing_languages(standard):
"""Return a list of all the languages missing from the given standard."""
return [(internal_code, name)
for internal_code, name in INTERNAL_NAMES.items()
if internal_code not in FROM_INTERNAL]
def _debug_missing_language_codes(standard, reference_standard='unisubs'):
"""
Return a list of all the languages codes missing from the given standard
"""
unisubs_langs = set(get_language_code_mapping(reference_standard).keys())
standard_langs = set()
[standard_langs.add(LanguageCode(lc, standard).encode(reference_standard)) \
for lc in get_language_code_mapping(standard).keys()]
return list(unisubs_langs.difference(standard_langs))
| 30.048583 | 90 | 0.481164 | 4,382 | 37,110 | 3.943633 | 0.215655 | 0.229153 | 0.229848 | 0.007696 | 0.118049 | 0.080204 | 0.061686 | 0.044442 | 0.033679 | 0.033679 | 0 | 0.005735 | 0.318728 | 37,110 | 1,234 | 91 | 30.072934 | 0.677794 | 0.122608 | 0 | 0.378378 | 0 | 0 | 0.229263 | 0 | 0 | 0 | 0 | 0.00081 | 0 | 1 | 0.021236 | false | 0 | 0.001931 | 0.001931 | 0.03861 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3ce7d8edf0c3fa0923cee953849341c1395ee182 | 711 | py | Python | code/42.Trapping-Rain-Water.py | Aden-Q/leetcode | ebd4804edd4f172b9981b22c18d9ff654cf20762 | [
"Apache-2.0"
] | 1 | 2019-09-22T03:08:14.000Z | 2019-09-22T03:08:14.000Z | code/42.Trapping-Rain-Water.py | Aden-Q/leetcode | ebd4804edd4f172b9981b22c18d9ff654cf20762 | [
"Apache-2.0"
] | null | null | null | code/42.Trapping-Rain-Water.py | Aden-Q/leetcode | ebd4804edd4f172b9981b22c18d9ff654cf20762 | [
"Apache-2.0"
] | null | null | null | class Solution:
def trap(self, height: List[int]) -> int:
res = 0
# build memos
max_height_left = [0] * len(height)
max_height_left[0] = height[0]
for i in range(1, len(height)):
max_height_left[i] = max(max_height_left[i-1], height[i])
max_height_right = [0] * len(height)
max_height_right[0] = height[-1]
for i in range(1, len(height)):
max_height_right[i] = max(max_height_right[i-1], height[-i-1])
for i in range(1, len(height) - 1):
l_max = max_height_left[i]
r_max = max_height_right[len(height) - i - 1]
res += min(l_max, r_max) - height[i]
return res | 39.5 | 74 | 0.548523 | 109 | 711 | 3.357798 | 0.229358 | 0.270492 | 0.177596 | 0.196721 | 0.472678 | 0.226776 | 0.226776 | 0.226776 | 0.163934 | 0 | 0 | 0.030864 | 0.316456 | 711 | 18 | 75 | 39.5 | 0.722222 | 0.015471 | 0 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.0625 | false | 0 | 0 | 0 | 0.1875 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3cef0e52a2048eb5b25bb85af93f0adab276a41b | 631 | py | Python | finbyz_dashboard/finbyz_dashboard/dashboard_overrides/install_fixtures.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | 1 | 2021-11-19T05:27:11.000Z | 2021-11-19T05:27:11.000Z | finbyz_dashboard/finbyz_dashboard/dashboard_overrides/install_fixtures.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | null | null | null | finbyz_dashboard/finbyz_dashboard/dashboard_overrides/install_fixtures.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | 2 | 2021-08-21T10:41:38.000Z | 2021-11-19T05:27:13.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.desk.doctype.global_search_settings.global_search_settings import update_global_search_doctypes
# Finbyz CHanges Import
from finbyz_dashboard.finbyz_dashboard.dashboard_overrides.dashboard_utils import sync_dashboards
def install():
update_genders()
update_salutations()
update_global_search_doctypes()
setup_email_linking()
# Finbyz CHanges START
sync_dashboards()
# Finbyz CHanges END
add_unsubscribe() | 30.047619 | 107 | 0.835182 | 81 | 631 | 6.17284 | 0.567901 | 0.096 | 0.08 | 0.104 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008897 | 0.10935 | 631 | 21 | 108 | 30.047619 | 0.880783 | 0.293185 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.083333 | true | 0 | 0.416667 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
3cef62365215544f965f24849d60bf1296a62cee | 5,560 | py | Python | hfc/api/membership/member.py | herocf/fabric-sdk-py | 7ae53d7e0d7db0cfda6c8d21690adeadb34d8dd7 | [
"Apache-2.0"
] | null | null | null | hfc/api/membership/member.py | herocf/fabric-sdk-py | 7ae53d7e0d7db0cfda6c8d21690adeadb34d8dd7 | [
"Apache-2.0"
] | null | null | null | hfc/api/membership/member.py | herocf/fabric-sdk-py | 7ae53d7e0d7db0cfda6c8d21690adeadb34d8dd7 | [
"Apache-2.0"
] | null | null | null | # Copyright esse.io 2016 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.
#
class Member(object):
"""Fabric Member object
A member is an entity that transacts on a chain.
Types of members include end users, peers, etc.
"""
def __init__(self, chain, **kwargs):
"""Constructor for a member.
:param chain (Chain): the chain instance that the member belong to
:param kwargs: includes name=,roles=,affiliation= ...
"""
self.name = ''
self.roles = []
self.affiliation = ''
if 'name' in kwargs:
self.name = kwargs['name']
elif 'enrollmentID' in kwargs:
self.name = kwargs['enrollmentID']
if 'roles' in kwargs:
self.roles = kwargs['roles']
else:
self.roles = ['fabric.user']
if 'affiliation' in kwargs:
self.affiliation = kwargs['affiliation']
self.chain = chain
self.keyValStore = chain.get_key_value_store()
self.keyValStoreName = toKeyValueStoreName(self.name)
self.tcertBatchSize = chain.get_tcert_batch_size()
self.enrollmentSecret = ''
self.enrollment = None
self.certGetterMap = {}
def get_name(self):
"""Get the member name
:return: The member name
"""
return self.name
def get_chain(self):
"""Get the chain.
:return: :class:`Chain` The chain instance
"""
return self.chain
def get_member_services(self):
"""Get the member services.
:return: The member services
"""
pass
def get_roles(self):
"""Get the roles.
:return: The roles.
"""
return self.roles
def set_roles(self, roles):
"""Set the roles.
:param roles: The roles.
"""
self.roles = roles
def get_affiliation(self):
"""Get the affiliation
:return: The affiliation
"""
return self.affiliation
def set_affiliation(self, affiliation):
"""Set the affiliation
:param affiliation: The affiliation
"""
self.affiliation = affiliation
def get_enrollment(self):
"""Get the enrollment info.
:return: The enrollment info
"""
return self.enrollment
def set_enrollment(self, enrollment):
"""Set the enrollment info.
:param enrollment: the enrollment instance
"""
self.enrollment = enrollment
def is_registered(self):
"""Determine if this member name has been registered.
:return: True if registered; otherwise, false
"""
pass
def is_enrolled(self):
"""Determine if this member has been enrolled.
:return: True if enrolled; otherwise, false
"""
pass
def register(self, reginfo):
"""Register the member.
:param reginfo: register user request
:return: the enrollment secrect
"""
pass
def enroll(self, enrollment_secret):
"""Enroll the member and return the enrollment results.
Exchange the enrollment secret (one-time password) for
enrollment certificate (ECert) and save it in the secure
key/value store.
:param enrollment_secret: user password
:return: enrollment
ECert is included in the enrollment instance.
"""
pass
def register_enroll(self, reginfo):
"""Register and enroll a user
Perform both registration and enrollment.
:param reginfo: user register request
:return: enrollment and enrollment secret
ECert is included in the enrollment instance.
"""
pass
def deploy(self, deploy_request):
"""Issue a deploy request on behalf of this member.
:param deploy_request: deploy request
:return: TransactionContext Emits 'submitted',
'complete', and 'error' events.
"""
pass
def send_transaction(self, trans_request):
"""Issue a transaction request on behalf of this member.
:param trans_request: transaction request
:return: TransactionContext Emits 'submitted',
'complete', and 'error' events.
"""
pass
def query(self, query_request):
"""Issue a query request on behalf of this member.
:param query_request: query request
:return: TransactionContext Emits 'submitted',
'complete', and 'error' events.
"""
pass
def to_json_string(self):
"""Save the current state of this member as a json string
:return: The state of this member as a json string
"""
pass
def from_json_string(self, json_str):
"""Get the current state of this member from a json string
:param json_str: The state of this member as a json string
"""
pass
def toKeyValueStoreName(name):
return 'member.' + name
| 26.990291 | 74 | 0.605755 | 632 | 5,560 | 5.268987 | 0.261076 | 0.023123 | 0.025225 | 0.02042 | 0.194895 | 0.166667 | 0.155556 | 0.126727 | 0.117718 | 0.090691 | 0 | 0.002083 | 0.309173 | 5,560 | 205 | 75 | 27.121951 | 0.864879 | 0.508633 | 0 | 0.177419 | 0 | 0 | 0.038462 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.33871 | false | 0.177419 | 0 | 0.016129 | 0.451613 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
3cf121f8c347bdb3db4db08f29b38d5e220e65d5 | 888 | py | Python | advanced/gc.py | xta0/Python-Playground | 513ebd2ad7f0a8c69f2f04b4f7524b31e76fa5bc | [
"MIT"
] | null | null | null | advanced/gc.py | xta0/Python-Playground | 513ebd2ad7f0a8c69f2f04b4f7524b31e76fa5bc | [
"MIT"
] | null | null | null | advanced/gc.py | xta0/Python-Playground | 513ebd2ad7f0a8c69f2f04b4f7524b31e76fa5bc | [
"MIT"
] | null | null | null | import ctypes
import gc
def ref_count(address):
return ctypes.c_long.from_address(address).value
def object_by_id(object_id):
for obj in gc.get_objects():
if id(obj) == object_id:
return "Object Exists"
return "Not Found"
class A:
def __init__(self):
self.b = B(self)
print(f'A: self:{hex(id(self))},b:{hex(id(self.b))}')
class B:
def __init__(self, a):
self.a = a
print(f'B: self:{hex(id(self))},a:{hex(id(self.a))}')
gc.disable()
a = A()
id_a = id(a)
id_b = id(a.b)
print(hex(id_a))
print(hex(id_b))
print(ref_count(id_a))
print(ref_count(id_b))
print(object_by_id(id_a))
print(object_by_id(id_b))
a = None
print(ref_count(id_a))
print(ref_count(id_b))
gc.collect()
print(object_by_id(id_a))
print(object_by_id(id_b))
print(hex(id_a))
print(hex(id_b))
print(ref_count(id_a))
print(ref_count(id_b)) | 18.5 | 61 | 0.647523 | 168 | 888 | 3.14881 | 0.208333 | 0.056711 | 0.10586 | 0.170132 | 0.402647 | 0.402647 | 0.402647 | 0.402647 | 0.402647 | 0.402647 | 0 | 0 | 0.179054 | 888 | 48 | 62 | 18.5 | 0.725652 | 0 | 0 | 0.378378 | 0 | 0 | 0.121485 | 0.089989 | 0 | 0 | 0 | 0 | 0 | 1 | 0.108108 | false | 0 | 0.054054 | 0.027027 | 0.297297 | 0.432432 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
a7068455d40d2902f0b2ad0c8766869218819312 | 257 | py | Python | medium/1780-check-if-number-is-a-sum-of-powers-of-three.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 2 | 2021-03-14T11:38:26.000Z | 2021-03-14T11:38:30.000Z | medium/1780-check-if-number-is-a-sum-of-powers-of-three.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | null | null | null | medium/1780-check-if-number-is-a-sum-of-powers-of-three.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 1 | 2022-01-17T19:33:23.000Z | 2022-01-17T19:33:23.000Z | '''
判断一个数字是否可以表示成三的幂的和
给你一个整数 n ,如果你可以将 n 表示成若干个不同的三的幂之和,请你返回 true ,否则请返回 false 。
对于一个整数 y ,如果存在整数 x 满足 y == 3x ,我们称这个整数 y 是三的幂。
提示:
1 <= n <= 107
'''
'''
思路:数学
对于一个整数x,如果是3的幂的和,说明x=y*3 or x= y*3+1
也就是x是3的整数倍或整数倍+1
不对,是3个不同的幂之和如果是21,3^2+3^2+3^1
TODO
'''
| 14.277778 | 58 | 0.673152 | 47 | 257 | 3.680851 | 0.680851 | 0.023121 | 0.034682 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.093023 | 0.163424 | 257 | 17 | 59 | 15.117647 | 0.711628 | 0.564202 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0.058824 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
a709276ac7646f329892744581df9259789ca714 | 890 | py | Python | setup.py | Tallmyr/Password_Checker | 7cb0a83edc46e69eeeb6fa4454b830cd4d5ef049 | [
"MIT"
] | null | null | null | setup.py | Tallmyr/Password_Checker | 7cb0a83edc46e69eeeb6fa4454b830cd4d5ef049 | [
"MIT"
] | 2 | 2021-10-18T20:30:27.000Z | 2021-10-18T21:32:09.000Z | setup.py | Tallmyr/Password-Checker | 7cb0a83edc46e69eeeb6fa4454b830cd4d5ef049 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup
packages = \
['password_checker']
package_data = \
{'': ['*']}
install_requires = \
['requests>=2.26.0,<3.0.0']
setup_kwargs = {
'name': 'password-checker',
'version': '1.0',
'description': 'Checks passwords against Have I Been Pwned Database',
'long_description': 'Checks passwords against Have I Been Pawned Database\n\nThis can be downloaded and run using main.py for command-line version.\nAlternatively, this can also be installed using the whl in releases.\n',
'author': 'Simon Tallmyr',
'author_email': 'simon@tallmyr.se',
'maintainer': None,
'maintainer_email': None,
'url': 'https://github.com/Tallmyr/Password-Checker',
'packages': packages,
'package_data': package_data,
'install_requires': install_requires,
'python_requires': '>=3.10,<4.0',
}
setup(**setup_kwargs)
| 27.8125 | 225 | 0.675281 | 113 | 890 | 5.20354 | 0.610619 | 0.076531 | 0.061224 | 0.088435 | 0.142857 | 0.142857 | 0.142857 | 0 | 0 | 0 | 0 | 0.020188 | 0.165169 | 890 | 31 | 226 | 28.709677 | 0.771198 | 0.023596 | 0 | 0 | 0 | 0.043478 | 0.608545 | 0.054273 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.217391 | 0.043478 | 0 | 0.043478 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
a70db89467017d181d2017d64c53910bb73769e7 | 620 | py | Python | src/munge/codec/json.py | 20c/munge | 579f5ebd899c11586b7db32a116ba31d70fe4d6b | [
"Apache-2.0"
] | 1 | 2021-08-23T18:12:52.000Z | 2021-08-23T18:12:52.000Z | src/munge/codec/json.py | 20c/munge | 579f5ebd899c11586b7db32a116ba31d70fe4d6b | [
"Apache-2.0"
] | 15 | 2016-06-16T15:40:55.000Z | 2021-08-24T15:43:49.000Z | src/munge/codec/json.py | 20c/munge | 579f5ebd899c11586b7db32a116ba31d70fe4d6b | [
"Apache-2.0"
] | 2 | 2016-06-20T16:24:16.000Z | 2016-10-22T14:58:56.000Z | import json
from munge.base import CodecBase
class Json(CodecBase):
supports_dict = True
supports_list = True
extensions = ["json"]
__kwargs = {}
def set_type(self, name, typ):
if name == "dict":
self.__kwargs["object_pairs_hook"] = typ
def load(self, fobj, **kwargs):
return json.load(fobj, **self.__kwargs)
def loads(self, input_string, **kwargs):
return json.loads(input_string, **self.__kwargs)
def dump(self, data, fobj, **kwargs):
return json.dump(data, fobj, **kwargs)
def dumps(self, data):
return json.dumps(data)
| 22.142857 | 56 | 0.619355 | 78 | 620 | 4.730769 | 0.410256 | 0.097561 | 0.130081 | 0.108401 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.251613 | 620 | 27 | 57 | 22.962963 | 0.795259 | 0 | 0 | 0 | 0 | 0 | 0.040323 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0 | 0.111111 | 0.222222 | 0.888889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
a729cb78f7da854a6f14050e3935ea93e0d7a63f | 182 | py | Python | daily coding problem/11.py | kingRovo/PythonCodingChalenge | b62938592df10ccafec9930b69c14c778e19ad37 | [
"bzip2-1.0.6"
] | 1 | 2021-08-02T16:52:55.000Z | 2021-08-02T16:52:55.000Z | daily coding problem/11.py | kingRovo/PythonCodingChalenge | b62938592df10ccafec9930b69c14c778e19ad37 | [
"bzip2-1.0.6"
] | null | null | null | daily coding problem/11.py | kingRovo/PythonCodingChalenge | b62938592df10ccafec9930b69c14c778e19ad37 | [
"bzip2-1.0.6"
] | null | null | null | def take_List(li,Qu_st):
r=[]
for i in range(len(li)):
if(Qu_st in li[i] ):
r.append(li[i])
print(r)
li=['sser','ser','song']
q='ss'
take_List(li,q)
| 18.2 | 28 | 0.505495 | 35 | 182 | 2.514286 | 0.571429 | 0.181818 | 0.227273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.269231 | 182 | 9 | 29 | 20.222222 | 0.661654 | 0 | 0 | 0 | 0 | 0 | 0.071429 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0 | 0 | 0.111111 | 0.111111 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
a72e3055bc6fd831f65a2068b5efa59a672ec1bf | 44,952 | py | Python | session_server/services/browserquest_broadcast_pb2.py | w359405949/browserquest_py | 20c2569431db9dca74a986efa9bc0ce69ed5a8fc | [
"WTFPL"
] | 1 | 2019-03-27T07:46:15.000Z | 2019-03-27T07:46:15.000Z | session_server/services/browserquest_broadcast_pb2.py | w359405949/browserquest_py | 20c2569431db9dca74a986efa9bc0ce69ed5a8fc | [
"WTFPL"
] | null | null | null | session_server/services/browserquest_broadcast_pb2.py | w359405949/browserquest_py | 20c2569431db9dca74a986efa9bc0ce69ed5a8fc | [
"WTFPL"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import service
from google.protobuf import service_reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='browserquest_broadcast.proto',
package='',
serialized_pb='\n\x1c\x62rowserquest_broadcast.proto\";\n\x0cHelloRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05\x61rmor\x18\x02 \x01(\x05\x12\x0e\n\x06weapon\x18\x03 \x01(\x05\"[\n\x0eWelcomeRequest\x12\x11\n\tplayer_id\x18\x01 \x01(\x05\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\t\n\x01x\x18\x03 \x01(\x05\x12\t\n\x01y\x18\x04 \x01(\x05\x12\x12\n\nhit_points\x18\x05 \x01(\x05\"\x87\x01\n\x0cSpawnRequest\x12\x11\n\tentity_id\x18\x01 \x01(\x05\x12\x0c\n\x04kind\x18\x02 \x01(\x05\x12\t\n\x01x\x18\x03 \x01(\x05\x12\t\n\x01y\x18\x04 \x01(\x05\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x13\n\x0borientation\x18\x06 \x01(\x05\x12\r\n\x05\x61rmor\x18\x07 \x01(\x05\x12\x0e\n\x06weapon\x18\x08 \x01(\x05\"#\n\x0e\x44\x65spawnRequest\x12\x11\n\tentity_id\x18\x01 \x01(\x05\"D\n\x0bMoveRequest\x12\x11\n\tentity_id\x18\x01 \x01(\x05\x12\x10\n\x08\x65ntity_x\x18\x02 \x01(\x05\x12\x10\n\x08\x65ntity_y\x18\x03 \x01(\x05\"K\n\x0fLootMoveRequest\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\x12\x0f\n\x07item_id\x18\x03 \x01(\x05\x12\x11\n\tentity_id\x18\x04 \x01(\x05\"\x1e\n\x0c\x41ggroRequest\x12\x0e\n\x06mob_id\x18\x01 \x01(\x05\"7\n\rAttackRequest\x12\x13\n\x0b\x61ttacker_id\x18\x01 \x01(\x05\x12\x11\n\ttarget_id\x18\x02 \x01(\x05\"\x1c\n\nHitRequest\x12\x0e\n\x06mob_id\x18\x01 \x01(\x05\"\x1d\n\x0bHurtRequest\x12\x0e\n\x06mob_id\x18\x01 \x01(\x05\"4\n\rHealthRequest\x12\x11\n\thitpoints\x18\x01 \x01(\x05\x12\x10\n\x08is_regon\x18\x02 \x01(\x08\"1\n\x0b\x43hatRequest\x12\x11\n\tplayer_id\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\t\"\x1e\n\x0bLootRequest\x12\x0f\n\x07item_id\x18\x01 \x01(\x05\"4\n\x0c\x45quipRequest\x12\x11\n\tplayer_id\x18\x01 \x01(\x05\x12\x11\n\titem_kind\x18\x02 \x01(\x05\"V\n\x0b\x44ropRequest\x12\x0e\n\x06mob_id\x18\x01 \x01(\x05\x12\x0f\n\x07item_id\x18\x02 \x01(\x05\x12\x11\n\titem_kind\x18\x03 \x01(\x05\x12\x13\n\x0bmob_hatlist\x18\x04 \x03(\x05\":\n\x0fTeleportRequest\x12\x11\n\tentity_id\x18\x01 \x01(\x05\x12\t\n\x01x\x18\x02 \x01(\x05\x12\t\n\x01y\x18\x03 \x01(\x05\"2\n\rDamageRequest\x12\x11\n\tentity_id\x18\x01 \x01(\x05\x12\x0e\n\x06\x64\x61mage\x18\x02 \x01(\x05\"1\n\x11PopulationRequest\x12\r\n\x05world\x18\x01 \x01(\x05\x12\r\n\x05total\x18\x02 \x01(\x05\"\x1f\n\x0bKillRequest\x12\x10\n\x08mob_kind\x18\x01 \x01(\x05\"!\n\x0bListRequest\x12\x12\n\nentity_ids\x18\x01 \x03(\x05\"\x0c\n\nWhoRequest\"\r\n\x0bZoneRequest\"#\n\x0e\x44\x65stroyRequest\x12\x11\n\tentity_id\x18\x01 \x01(\x05\")\n\x10HitPointsRequest\x12\x15\n\rmax_hitpoints\x18\x01 \x01(\x05\"\x1f\n\x0c\x42linkRequest\x12\x0f\n\x07item_id\x18\x01 \x01(\x05\"\x1f\n\x0bOpenRequest\x12\x10\n\x08\x63hest_id\x18\x01 \x01(\x05\"\"\n\x0c\x43heckRequest\x12\x12\n\ncheckpoint\x18\x01 \x01(\x05\"\x06\n\x04Void2\xf2\x06\n\x15\x42rowserQuestBroadcast\x12\x1d\n\x05hello\x12\r.HelloRequest\x1a\x05.Void\x12!\n\x07welcome\x12\x0f.WelcomeRequest\x1a\x05.Void\x12\x1d\n\x05spawn\x12\r.SpawnRequest\x1a\x05.Void\x12!\n\x07\x64\x65spawn\x12\x0f.DespawnRequest\x1a\x05.Void\x12\x1b\n\x04move\x12\x0c.MoveRequest\x1a\x05.Void\x12#\n\x08lootmove\x12\x10.LootMoveRequest\x1a\x05.Void\x12\x1d\n\x05\x61ggro\x12\r.AggroRequest\x1a\x05.Void\x12\x1f\n\x06\x61ttack\x12\x0e.AttackRequest\x1a\x05.Void\x12\x19\n\x03hit\x12\x0b.HitRequest\x1a\x05.Void\x12\x1b\n\x04hurt\x12\x0c.HurtRequest\x1a\x05.Void\x12\x1f\n\x06health\x12\x0e.HealthRequest\x1a\x05.Void\x12\x1b\n\x04\x63hat\x12\x0c.ChatRequest\x1a\x05.Void\x12\x1b\n\x04loot\x12\x0c.LootRequest\x1a\x05.Void\x12\x1d\n\x05\x65quip\x12\r.EquipRequest\x1a\x05.Void\x12\x1b\n\x04\x64rop\x12\x0c.DropRequest\x1a\x05.Void\x12#\n\x08teleport\x12\x10.TeleportRequest\x1a\x05.Void\x12\x1f\n\x06\x64\x61mage\x12\x0e.DamageRequest\x1a\x05.Void\x12\'\n\npopulation\x12\x12.PopulationRequest\x1a\x05.Void\x12\x1b\n\x04kill\x12\x0c.KillRequest\x1a\x05.Void\x12\x1b\n\x04list\x12\x0c.ListRequest\x1a\x05.Void\x12\x19\n\x03who\x12\x0b.WhoRequest\x1a\x05.Void\x12\x1b\n\x04zone\x12\x0c.ZoneRequest\x1a\x05.Void\x12!\n\x07\x64\x65stroy\x12\x0f.DestroyRequest\x1a\x05.Void\x12%\n\thitpoints\x12\x11.HitPointsRequest\x1a\x05.Void\x12\x1d\n\x05\x62link\x12\r.BlinkRequest\x1a\x05.Void\x12\x1b\n\x04open\x12\x0c.OpenRequest\x1a\x05.Void\x12\x1d\n\x05\x63heck\x12\r.CheckRequest\x1a\x05.VoidB\x03\x90\x01\x01')
_HELLOREQUEST = descriptor.Descriptor(
name='HelloRequest',
full_name='HelloRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='name', full_name='HelloRequest.name', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=unicode("", "utf-8"),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='armor', full_name='HelloRequest.armor', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='weapon', full_name='HelloRequest.weapon', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=32,
serialized_end=91,
)
_WELCOMEREQUEST = descriptor.Descriptor(
name='WelcomeRequest',
full_name='WelcomeRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='player_id', full_name='WelcomeRequest.player_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='name', full_name='WelcomeRequest.name', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=unicode("", "utf-8"),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='x', full_name='WelcomeRequest.x', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='y', full_name='WelcomeRequest.y', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='hit_points', full_name='WelcomeRequest.hit_points', index=4,
number=5, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=93,
serialized_end=184,
)
_SPAWNREQUEST = descriptor.Descriptor(
name='SpawnRequest',
full_name='SpawnRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='entity_id', full_name='SpawnRequest.entity_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='kind', full_name='SpawnRequest.kind', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='x', full_name='SpawnRequest.x', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='y', full_name='SpawnRequest.y', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='name', full_name='SpawnRequest.name', index=4,
number=5, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=unicode("", "utf-8"),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='orientation', full_name='SpawnRequest.orientation', index=5,
number=6, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='armor', full_name='SpawnRequest.armor', index=6,
number=7, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='weapon', full_name='SpawnRequest.weapon', index=7,
number=8, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=187,
serialized_end=322,
)
_DESPAWNREQUEST = descriptor.Descriptor(
name='DespawnRequest',
full_name='DespawnRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='entity_id', full_name='DespawnRequest.entity_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=324,
serialized_end=359,
)
_MOVEREQUEST = descriptor.Descriptor(
name='MoveRequest',
full_name='MoveRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='entity_id', full_name='MoveRequest.entity_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='entity_x', full_name='MoveRequest.entity_x', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='entity_y', full_name='MoveRequest.entity_y', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=361,
serialized_end=429,
)
_LOOTMOVEREQUEST = descriptor.Descriptor(
name='LootMoveRequest',
full_name='LootMoveRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='x', full_name='LootMoveRequest.x', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='y', full_name='LootMoveRequest.y', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='item_id', full_name='LootMoveRequest.item_id', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='entity_id', full_name='LootMoveRequest.entity_id', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=431,
serialized_end=506,
)
_AGGROREQUEST = descriptor.Descriptor(
name='AggroRequest',
full_name='AggroRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='mob_id', full_name='AggroRequest.mob_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=508,
serialized_end=538,
)
_ATTACKREQUEST = descriptor.Descriptor(
name='AttackRequest',
full_name='AttackRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='attacker_id', full_name='AttackRequest.attacker_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='target_id', full_name='AttackRequest.target_id', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=540,
serialized_end=595,
)
_HITREQUEST = descriptor.Descriptor(
name='HitRequest',
full_name='HitRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='mob_id', full_name='HitRequest.mob_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=597,
serialized_end=625,
)
_HURTREQUEST = descriptor.Descriptor(
name='HurtRequest',
full_name='HurtRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='mob_id', full_name='HurtRequest.mob_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=627,
serialized_end=656,
)
_HEALTHREQUEST = descriptor.Descriptor(
name='HealthRequest',
full_name='HealthRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='hitpoints', full_name='HealthRequest.hitpoints', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='is_regon', full_name='HealthRequest.is_regon', index=1,
number=2, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=658,
serialized_end=710,
)
_CHATREQUEST = descriptor.Descriptor(
name='ChatRequest',
full_name='ChatRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='player_id', full_name='ChatRequest.player_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='message', full_name='ChatRequest.message', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=unicode("", "utf-8"),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=712,
serialized_end=761,
)
_LOOTREQUEST = descriptor.Descriptor(
name='LootRequest',
full_name='LootRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='item_id', full_name='LootRequest.item_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=763,
serialized_end=793,
)
_EQUIPREQUEST = descriptor.Descriptor(
name='EquipRequest',
full_name='EquipRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='player_id', full_name='EquipRequest.player_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='item_kind', full_name='EquipRequest.item_kind', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=795,
serialized_end=847,
)
_DROPREQUEST = descriptor.Descriptor(
name='DropRequest',
full_name='DropRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='mob_id', full_name='DropRequest.mob_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='item_id', full_name='DropRequest.item_id', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='item_kind', full_name='DropRequest.item_kind', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='mob_hatlist', full_name='DropRequest.mob_hatlist', index=3,
number=4, type=5, cpp_type=1, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=849,
serialized_end=935,
)
_TELEPORTREQUEST = descriptor.Descriptor(
name='TeleportRequest',
full_name='TeleportRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='entity_id', full_name='TeleportRequest.entity_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='x', full_name='TeleportRequest.x', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='y', full_name='TeleportRequest.y', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=937,
serialized_end=995,
)
_DAMAGEREQUEST = descriptor.Descriptor(
name='DamageRequest',
full_name='DamageRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='entity_id', full_name='DamageRequest.entity_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='damage', full_name='DamageRequest.damage', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=997,
serialized_end=1047,
)
_POPULATIONREQUEST = descriptor.Descriptor(
name='PopulationRequest',
full_name='PopulationRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='world', full_name='PopulationRequest.world', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
descriptor.FieldDescriptor(
name='total', full_name='PopulationRequest.total', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=1049,
serialized_end=1098,
)
_KILLREQUEST = descriptor.Descriptor(
name='KillRequest',
full_name='KillRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='mob_kind', full_name='KillRequest.mob_kind', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=1100,
serialized_end=1131,
)
_LISTREQUEST = descriptor.Descriptor(
name='ListRequest',
full_name='ListRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='entity_ids', full_name='ListRequest.entity_ids', index=0,
number=1, type=5, cpp_type=1, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=1133,
serialized_end=1166,
)
_WHOREQUEST = descriptor.Descriptor(
name='WhoRequest',
full_name='WhoRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=1168,
serialized_end=1180,
)
_ZONEREQUEST = descriptor.Descriptor(
name='ZoneRequest',
full_name='ZoneRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=1182,
serialized_end=1195,
)
_DESTROYREQUEST = descriptor.Descriptor(
name='DestroyRequest',
full_name='DestroyRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='entity_id', full_name='DestroyRequest.entity_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=1197,
serialized_end=1232,
)
_HITPOINTSREQUEST = descriptor.Descriptor(
name='HitPointsRequest',
full_name='HitPointsRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='max_hitpoints', full_name='HitPointsRequest.max_hitpoints', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=1234,
serialized_end=1275,
)
_BLINKREQUEST = descriptor.Descriptor(
name='BlinkRequest',
full_name='BlinkRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='item_id', full_name='BlinkRequest.item_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=1277,
serialized_end=1308,
)
_OPENREQUEST = descriptor.Descriptor(
name='OpenRequest',
full_name='OpenRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='chest_id', full_name='OpenRequest.chest_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=1310,
serialized_end=1341,
)
_CHECKREQUEST = descriptor.Descriptor(
name='CheckRequest',
full_name='CheckRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
descriptor.FieldDescriptor(
name='checkpoint', full_name='CheckRequest.checkpoint', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=1343,
serialized_end=1377,
)
_VOID = descriptor.Descriptor(
name='Void',
full_name='Void',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
serialized_start=1379,
serialized_end=1385,
)
DESCRIPTOR.message_types_by_name['HelloRequest'] = _HELLOREQUEST
DESCRIPTOR.message_types_by_name['WelcomeRequest'] = _WELCOMEREQUEST
DESCRIPTOR.message_types_by_name['SpawnRequest'] = _SPAWNREQUEST
DESCRIPTOR.message_types_by_name['DespawnRequest'] = _DESPAWNREQUEST
DESCRIPTOR.message_types_by_name['MoveRequest'] = _MOVEREQUEST
DESCRIPTOR.message_types_by_name['LootMoveRequest'] = _LOOTMOVEREQUEST
DESCRIPTOR.message_types_by_name['AggroRequest'] = _AGGROREQUEST
DESCRIPTOR.message_types_by_name['AttackRequest'] = _ATTACKREQUEST
DESCRIPTOR.message_types_by_name['HitRequest'] = _HITREQUEST
DESCRIPTOR.message_types_by_name['HurtRequest'] = _HURTREQUEST
DESCRIPTOR.message_types_by_name['HealthRequest'] = _HEALTHREQUEST
DESCRIPTOR.message_types_by_name['ChatRequest'] = _CHATREQUEST
DESCRIPTOR.message_types_by_name['LootRequest'] = _LOOTREQUEST
DESCRIPTOR.message_types_by_name['EquipRequest'] = _EQUIPREQUEST
DESCRIPTOR.message_types_by_name['DropRequest'] = _DROPREQUEST
DESCRIPTOR.message_types_by_name['TeleportRequest'] = _TELEPORTREQUEST
DESCRIPTOR.message_types_by_name['DamageRequest'] = _DAMAGEREQUEST
DESCRIPTOR.message_types_by_name['PopulationRequest'] = _POPULATIONREQUEST
DESCRIPTOR.message_types_by_name['KillRequest'] = _KILLREQUEST
DESCRIPTOR.message_types_by_name['ListRequest'] = _LISTREQUEST
DESCRIPTOR.message_types_by_name['WhoRequest'] = _WHOREQUEST
DESCRIPTOR.message_types_by_name['ZoneRequest'] = _ZONEREQUEST
DESCRIPTOR.message_types_by_name['DestroyRequest'] = _DESTROYREQUEST
DESCRIPTOR.message_types_by_name['HitPointsRequest'] = _HITPOINTSREQUEST
DESCRIPTOR.message_types_by_name['BlinkRequest'] = _BLINKREQUEST
DESCRIPTOR.message_types_by_name['OpenRequest'] = _OPENREQUEST
DESCRIPTOR.message_types_by_name['CheckRequest'] = _CHECKREQUEST
DESCRIPTOR.message_types_by_name['Void'] = _VOID
class HelloRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _HELLOREQUEST
# @@protoc_insertion_point(class_scope:HelloRequest)
class WelcomeRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _WELCOMEREQUEST
# @@protoc_insertion_point(class_scope:WelcomeRequest)
class SpawnRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _SPAWNREQUEST
# @@protoc_insertion_point(class_scope:SpawnRequest)
class DespawnRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _DESPAWNREQUEST
# @@protoc_insertion_point(class_scope:DespawnRequest)
class MoveRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _MOVEREQUEST
# @@protoc_insertion_point(class_scope:MoveRequest)
class LootMoveRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _LOOTMOVEREQUEST
# @@protoc_insertion_point(class_scope:LootMoveRequest)
class AggroRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _AGGROREQUEST
# @@protoc_insertion_point(class_scope:AggroRequest)
class AttackRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _ATTACKREQUEST
# @@protoc_insertion_point(class_scope:AttackRequest)
class HitRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _HITREQUEST
# @@protoc_insertion_point(class_scope:HitRequest)
class HurtRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _HURTREQUEST
# @@protoc_insertion_point(class_scope:HurtRequest)
class HealthRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _HEALTHREQUEST
# @@protoc_insertion_point(class_scope:HealthRequest)
class ChatRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _CHATREQUEST
# @@protoc_insertion_point(class_scope:ChatRequest)
class LootRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _LOOTREQUEST
# @@protoc_insertion_point(class_scope:LootRequest)
class EquipRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _EQUIPREQUEST
# @@protoc_insertion_point(class_scope:EquipRequest)
class DropRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _DROPREQUEST
# @@protoc_insertion_point(class_scope:DropRequest)
class TeleportRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _TELEPORTREQUEST
# @@protoc_insertion_point(class_scope:TeleportRequest)
class DamageRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _DAMAGEREQUEST
# @@protoc_insertion_point(class_scope:DamageRequest)
class PopulationRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _POPULATIONREQUEST
# @@protoc_insertion_point(class_scope:PopulationRequest)
class KillRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _KILLREQUEST
# @@protoc_insertion_point(class_scope:KillRequest)
class ListRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _LISTREQUEST
# @@protoc_insertion_point(class_scope:ListRequest)
class WhoRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _WHOREQUEST
# @@protoc_insertion_point(class_scope:WhoRequest)
class ZoneRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _ZONEREQUEST
# @@protoc_insertion_point(class_scope:ZoneRequest)
class DestroyRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _DESTROYREQUEST
# @@protoc_insertion_point(class_scope:DestroyRequest)
class HitPointsRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _HITPOINTSREQUEST
# @@protoc_insertion_point(class_scope:HitPointsRequest)
class BlinkRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _BLINKREQUEST
# @@protoc_insertion_point(class_scope:BlinkRequest)
class OpenRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _OPENREQUEST
# @@protoc_insertion_point(class_scope:OpenRequest)
class CheckRequest(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _CHECKREQUEST
# @@protoc_insertion_point(class_scope:CheckRequest)
class Void(message.Message):
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _VOID
# @@protoc_insertion_point(class_scope:Void)
_BROWSERQUESTBROADCAST = descriptor.ServiceDescriptor(
name='BrowserQuestBroadcast',
full_name='BrowserQuestBroadcast',
file=DESCRIPTOR,
index=0,
options=None,
serialized_start=1388,
serialized_end=2270,
methods=[
descriptor.MethodDescriptor(
name='hello',
full_name='BrowserQuestBroadcast.hello',
index=0,
containing_service=None,
input_type=_HELLOREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='welcome',
full_name='BrowserQuestBroadcast.welcome',
index=1,
containing_service=None,
input_type=_WELCOMEREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='spawn',
full_name='BrowserQuestBroadcast.spawn',
index=2,
containing_service=None,
input_type=_SPAWNREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='despawn',
full_name='BrowserQuestBroadcast.despawn',
index=3,
containing_service=None,
input_type=_DESPAWNREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='move',
full_name='BrowserQuestBroadcast.move',
index=4,
containing_service=None,
input_type=_MOVEREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='lootmove',
full_name='BrowserQuestBroadcast.lootmove',
index=5,
containing_service=None,
input_type=_LOOTMOVEREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='aggro',
full_name='BrowserQuestBroadcast.aggro',
index=6,
containing_service=None,
input_type=_AGGROREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='attack',
full_name='BrowserQuestBroadcast.attack',
index=7,
containing_service=None,
input_type=_ATTACKREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='hit',
full_name='BrowserQuestBroadcast.hit',
index=8,
containing_service=None,
input_type=_HITREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='hurt',
full_name='BrowserQuestBroadcast.hurt',
index=9,
containing_service=None,
input_type=_HURTREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='health',
full_name='BrowserQuestBroadcast.health',
index=10,
containing_service=None,
input_type=_HEALTHREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='chat',
full_name='BrowserQuestBroadcast.chat',
index=11,
containing_service=None,
input_type=_CHATREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='loot',
full_name='BrowserQuestBroadcast.loot',
index=12,
containing_service=None,
input_type=_LOOTREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='equip',
full_name='BrowserQuestBroadcast.equip',
index=13,
containing_service=None,
input_type=_EQUIPREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='drop',
full_name='BrowserQuestBroadcast.drop',
index=14,
containing_service=None,
input_type=_DROPREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='teleport',
full_name='BrowserQuestBroadcast.teleport',
index=15,
containing_service=None,
input_type=_TELEPORTREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='damage',
full_name='BrowserQuestBroadcast.damage',
index=16,
containing_service=None,
input_type=_DAMAGEREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='population',
full_name='BrowserQuestBroadcast.population',
index=17,
containing_service=None,
input_type=_POPULATIONREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='kill',
full_name='BrowserQuestBroadcast.kill',
index=18,
containing_service=None,
input_type=_KILLREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='list',
full_name='BrowserQuestBroadcast.list',
index=19,
containing_service=None,
input_type=_LISTREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='who',
full_name='BrowserQuestBroadcast.who',
index=20,
containing_service=None,
input_type=_WHOREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='zone',
full_name='BrowserQuestBroadcast.zone',
index=21,
containing_service=None,
input_type=_ZONEREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='destroy',
full_name='BrowserQuestBroadcast.destroy',
index=22,
containing_service=None,
input_type=_DESTROYREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='hitpoints',
full_name='BrowserQuestBroadcast.hitpoints',
index=23,
containing_service=None,
input_type=_HITPOINTSREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='blink',
full_name='BrowserQuestBroadcast.blink',
index=24,
containing_service=None,
input_type=_BLINKREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='open',
full_name='BrowserQuestBroadcast.open',
index=25,
containing_service=None,
input_type=_OPENREQUEST,
output_type=_VOID,
options=None,
),
descriptor.MethodDescriptor(
name='check',
full_name='BrowserQuestBroadcast.check',
index=26,
containing_service=None,
input_type=_CHECKREQUEST,
output_type=_VOID,
options=None,
),
])
class BrowserQuestBroadcast(service.Service):
__metaclass__ = service_reflection.GeneratedServiceType
DESCRIPTOR = _BROWSERQUESTBROADCAST
class BrowserQuestBroadcast_Stub(BrowserQuestBroadcast):
__metaclass__ = service_reflection.GeneratedServiceStubType
DESCRIPTOR = _BROWSERQUESTBROADCAST
# @@protoc_insertion_point(module_scope)
| 31.087137 | 4,262 | 0.731291 | 5,474 | 44,952 | 5.747716 | 0.064852 | 0.048311 | 0.046912 | 0.034326 | 0.697836 | 0.607221 | 0.534533 | 0.521438 | 0.471029 | 0.464037 | 0 | 0.042829 | 0.145555 | 44,952 | 1,445 | 4,263 | 31.108651 | 0.776328 | 0.034704 | 0 | 0.656081 | 1 | 0.000775 | 0.165014 | 0.116098 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.004648 | 0 | 0.074361 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
a7303abc4d0d5464ac93528cc40e9c916928c97b | 6,706 | py | Python | axelrod/strategies/grudger.py | t0nyt93/Axelroddd | 66d95378d3ece8b32afeb1c77d305397bd9a815e | [
"MIT"
] | null | null | null | axelrod/strategies/grudger.py | t0nyt93/Axelroddd | 66d95378d3ece8b32afeb1c77d305397bd9a815e | [
"MIT"
] | null | null | null | axelrod/strategies/grudger.py | t0nyt93/Axelroddd | 66d95378d3ece8b32afeb1c77d305397bd9a815e | [
"MIT"
] | 1 | 2019-03-11T08:56:09.000Z | 2019-03-11T08:56:09.000Z | from axelrod.actions import Actions, Action
from axelrod.player import Player
C, D = Actions.C, Actions.D
class Grudger(Player):
"""
A player starts by cooperating however will defect if at any point the
opponent has defected.
Names:
- Friedman's strategy: [Axelrod1980]_
- Grudger: [Li2011]_
- Grim: [Berg2015]_
- Grim Trigger: [Banks1980]_
- Spite: [Beaufils1997]_
"""
name = 'Grudger'
classifier = {
'memory_depth': float('inf'), # Long memory
'stochastic': False,
'makes_use_of': set(),
'long_run_time': False,
'inspects_source': False,
'manipulates_source': False,
'manipulates_state': False
}
@staticmethod
def strategy(opponent: Player) -> Action:
"""Begins by playing C, then plays D for the remaining rounds if the
opponent ever plays D."""
if opponent.defections:
return D
return C
class ForgetfulGrudger(Player):
"""A player starts by cooperating however will defect if at any point the
opponent has defected, but forgets after mem_length matches."""
name = 'Forgetful Grudger'
classifier = {
'memory_depth': 10,
'stochastic': False,
'makes_use_of': set(),
'long_run_time': False,
'inspects_source': False,
'manipulates_source': False,
'manipulates_state': False
}
def __init__(self) -> None:
"""Initialised the player."""
super().__init__()
self.mem_length = 10
self.grudged = False
self.grudge_memory = 0
def strategy(self, opponent: Player) -> Action:
"""Begins by playing C, then plays D for mem_length rounds if the
opponent ever plays D."""
if self.grudge_memory >= self.mem_length:
self.grudge_memory = 0
self.grudged = False
if self.grudged:
self.grudge_memory += 1
return D
elif D in opponent.history[-1:]:
self.grudged = True
return D
return C
def reset(self):
"""Resets scores and history."""
super().reset()
self.grudged = False
self.grudge_memory = 0
class OppositeGrudger(Player):
"""A player starts by defecting however will cooperate if at any point the
opponent has cooperated."""
name = 'Opposite Grudger'
classifier = {
'memory_depth': float('inf'), # Long memory
'stochastic': False,
'makes_use_of': set(),
'long_run_time': False,
'inspects_source': False,
'manipulates_source': False,
'manipulates_state': False
}
@staticmethod
def strategy(opponent: Player) -> Action:
"""Begins by playing D, then plays C for the remaining rounds if the
opponent ever plays C."""
if opponent.cooperations:
return C
return D
class Aggravater(Player):
"""Grudger, except that it defects on the first 3 turns"""
name = 'Aggravater'
classifier = {
'memory_depth': float('inf'), # Long memory
'stochastic': False,
'makes_use_of': set(),
'long_run_time': False,
'inspects_source': False,
'manipulates_source': False,
'manipulates_state': False
}
@staticmethod
def strategy(opponent: Player) -> Action:
if len(opponent.history) < 3:
return D
elif opponent.defections:
return D
return C
class SoftGrudger(Player):
"""
A modification of the Grudger strategy. Instead of punishing by always
defecting: punishes by playing: D, D, D, D, C, C. (Will continue to
cooperate afterwards).
For reference see: "Engineering Design of Strategies for Winning
Iterated Prisoner's Dilemma Competitions" by Jiawei Li, Philip Hingston,
and Graham Kendall. IEEE TRANSACTIONS ON COMPUTATIONAL INTELLIGENCE AND AI
IN GAMES, VOL. 3, NO. 4, DECEMBER 2011
"""
name = 'Soft Grudger'
classifier = {
'memory_depth': 6,
'stochastic': False,
'makes_use_of': set(),
'long_run_time': False,
'inspects_source': False,
'manipulates_source': False,
'manipulates_state': False
}
def __init__(self) -> None:
"""Initialised the player."""
super().__init__()
self.grudged = False
self.grudge_memory = 0
def strategy(self, opponent: Player) -> Action:
"""Begins by playing C, then plays D, D, D, D, C, C against a defection
"""
if self.grudged:
strategy = [D, D, D, C, C][self.grudge_memory]
self.grudge_memory += 1
if self.grudge_memory == 5:
self.grudge_memory = 0
self.grudged = False
return strategy
elif D in opponent.history[-1:]:
self.grudged = True
return D
return C
def reset(self):
"""Resets scores and history."""
super().reset()
self.grudged = False
self.grudge_memory = 0
class GrudgerAlternator(Player):
"""
A player starts by cooperating until the first opponents defection,
then alternates D-C.
Names:
- c_then_per_dc: [PRISON1998]_
- Grudger Alternator: Original name by Geraint Palmer
"""
name = 'GrudgerAlternator'
classifier = {
'memory_depth': float('inf'), # Long memory
'stochastic': False,
'makes_use_of': set(),
'long_run_time': False,
'inspects_source': False,
'manipulates_source': False,
'manipulates_state': False
}
def strategy(self, opponent: Player) -> Action:
"""Begins by playing C, then plays Alternator for the remaining rounds
if the opponent ever plays D."""
if opponent.defections:
if self.history[-1] == Actions.C:
return Actions.D
return Actions.C
class EasyGo(Player):
"""
A player starts by defecting however will cooperate if at any point the
opponent has defected.
Names:
- Easy Go [PRISON1998]_
"""
name = 'EasyGo'
classifier = {
'memory_depth': float('inf'), # Long memory
'stochastic': False,
'makes_use_of': set(),
'long_run_time': False,
'inspects_source': False,
'manipulates_source': False,
'manipulates_state': False
}
@staticmethod
def strategy(opponent: Player) -> Action:
"""Begins by playing D, then plays C for the remaining rounds if the
opponent ever plays D."""
if opponent.defections:
return C
return D
| 27.710744 | 79 | 0.592753 | 758 | 6,706 | 5.116095 | 0.217678 | 0.039711 | 0.079422 | 0.041516 | 0.66787 | 0.666581 | 0.655493 | 0.62558 | 0.617586 | 0.612945 | 0 | 0.011415 | 0.307635 | 6,706 | 241 | 80 | 27.825726 | 0.823821 | 0.288697 | 0 | 0.748299 | 0 | 0 | 0.172651 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.07483 | false | 0 | 0.013605 | 0 | 0.346939 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
a7324c158b311d8ccc6651ba64d98b52cd0945ab | 1,025 | py | Python | badapted/choice_functions.py | ae-foster/badapted | 113d4cb8ad23104c852c8e5626a554117964ecf8 | [
"MIT"
] | null | null | null | badapted/choice_functions.py | ae-foster/badapted | 113d4cb8ad23104c852c8e5626a554117964ecf8 | [
"MIT"
] | null | null | null | badapted/choice_functions.py | ae-foster/badapted | 113d4cb8ad23104c852c8e5626a554117964ecf8 | [
"MIT"
] | null | null | null | """
Choice functions.
We focus upon the cumulative normal distribution as the choice function, but you
could impliment your own, eg Logistic, SoftMax, etc.
"""
from scipy.stats import norm
import numpy as np
def StandardCumulativeNormalChoiceFunc(decision_variable, θ, θ_fixed):
"""Cumulative normal choice function, but no alpha parameter"""
p_chose_B = θ_fixed["ϵ"] + (1 - 2 * θ_fixed["ϵ"]) * _Phi(decision_variable)
return p_chose_B
def CumulativeNormalChoiceFunc(decision_variable, θ, θ_fixed):
"""Our default choice function"""
α = 1e-3 + θ["α"].values
p_chose_B = θ_fixed["ϵ"] + (1 - 2 * θ_fixed["ϵ"]) * _Phi(
np.divide(decision_variable, α)
)
return p_chose_B
def _Phi(x):
"""Cumulative normal distribution, provided here as a helper function"""
# NOTE: because some of the data was from a pandas dataframe, the numpy
# arrays are coming out as dtype = object. So we need to cooerce into
# floats.
return norm.cdf(x.astype("float"), loc=0, scale=1)
| 30.147059 | 80 | 0.693659 | 152 | 1,025 | 4.539474 | 0.552632 | 0.052174 | 0.04058 | 0.052174 | 0.188406 | 0.075362 | 0.075362 | 0.075362 | 0.075362 | 0.075362 | 0 | 0.009721 | 0.197073 | 1,025 | 33 | 81 | 31.060606 | 0.828676 | 0.440976 | 0 | 0.153846 | 0 | 0 | 0.018248 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.153846 | 0 | 0.615385 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
a7336cfc80cce72178417c6d4ef20c430969b226 | 2,570 | py | Python | actions/get_version.py | pjimmybrcd/campus_ztp_nps | 2ab266b32fbcddcbdf9031138aabc40942914c3a | [
"Apache-2.0"
] | null | null | null | actions/get_version.py | pjimmybrcd/campus_ztp_nps | 2ab266b32fbcddcbdf9031138aabc40942914c3a | [
"Apache-2.0"
] | null | null | null | actions/get_version.py | pjimmybrcd/campus_ztp_nps | 2ab266b32fbcddcbdf9031138aabc40942914c3a | [
"Apache-2.0"
] | null | null | null | """
Copyright 2016 Brocade Communications Systems, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
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 json
import re
from lib import actions
from lib import ztp_utils
class GetFlashAction(actions.SessionAction):
def __init__(self, config):
super(GetFlashAction, self).__init__(config)
def run(self, via, device, username='', password='', enable_username='', enable_password=''):
ztp_utils.replace_default_userpass(self, username, password,
enable_username, enable_password)
session = ztp_utils.start_session(device, self._username, self._password,
self._enable_username, self._enable_password, via)
command = 'show version'
(success, results) = ztp_utils.send_commands_to_session(session, command, conf_mode=False)
if success:
# Built JSON Record from parsed results
result = {}
unit_and_version = re.compile('(^\s+UNIT )(\d+)(:.+)(labeled as )(.+)')
boot = re.compile('(^\s+.+Boot-Monitor.+ Version:)([\d\w\.]+)')
hardware = re.compile('(^\s+HW: )(Stackable )?([\w\d\-]+)')
for line in results[0]['output']:
match = unit_and_version.match(line)
if match:
if 'firmware' not in results:
result['firmware']=[]
unit = match.group(2)
version = match.group(5)
result['firmware'].append({'unit': int(unit), 'version': version.upper()})
match = hardware.match(line)
if match:
print("matched hardware")
hardware_type = match.group(3)
result.update({'hardware': hardware_type.upper()})
match = boot.match(line)
if match:
boot_version = match.group(2)
result.update({'boot': boot_version.upper()})
return (True, json.dumps(result))
return (False, "Failed")
| 41.451613 | 98 | 0.594163 | 293 | 2,570 | 5.085324 | 0.460751 | 0.040268 | 0.020134 | 0.032215 | 0.05906 | 0.05906 | 0 | 0 | 0 | 0 | 0 | 0.007166 | 0.294163 | 2,570 | 61 | 99 | 42.131148 | 0.814223 | 0.014397 | 0 | 0.078947 | 0 | 0 | 0.103077 | 0.010769 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.131579 | 0.105263 | null | null | 0.026316 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
5951eeb3d149df94970d2e3ab09bb6356322a1f1 | 658 | py | Python | django_application/customers/views.py | NetstationPL/example_event_source_ecommerce | 67e673e91da4e24ff88d17e34e69a312da65b80d | [
"MIT"
] | null | null | null | django_application/customers/views.py | NetstationPL/example_event_source_ecommerce | 67e673e91da4e24ff88d17e34e69a312da65b80d | [
"MIT"
] | null | null | null | django_application/customers/views.py | NetstationPL/example_event_source_ecommerce | 67e673e91da4e24ff88d17e34e69a312da65b80d | [
"MIT"
] | null | null | null | from crm.commands import RegisterCustomer
from django.urls import reverse_lazy
from django.views.generic import FormView, ListView
from infra import command_bus
from .forms import CustomerForm
from .models import Customer
class CustomerListView(ListView):
model = Customer
template_name = "customers/index.html"
context_object_name = "customers"
class CustomerCreateView(FormView):
form_class = CustomerForm
template_name = "customers/new.html"
success_url = reverse_lazy("customers:index")
def form_valid(self, form):
command_bus.call(RegisterCustomer(**form.cleaned_data))
return super().form_valid(form)
| 26.32 | 63 | 0.764438 | 79 | 658 | 6.202532 | 0.544304 | 0.079592 | 0.085714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158055 | 658 | 24 | 64 | 27.416667 | 0.884477 | 0 | 0 | 0 | 0 | 0 | 0.094225 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.058824 | false | 0 | 0.352941 | 0 | 0.941176 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
595b3ca340184dc8927c56cd2ae39f0892be81b7 | 1,923 | py | Python | PyUE4Builder/actions/versioninc.py | rfsheffer/PyUE4Builder | 2b2a978431ba5426238a03ecaae5a73836a0598c | [
"MIT"
] | 12 | 2018-04-15T01:46:01.000Z | 2022-01-06T01:34:34.000Z | PyUE4Builder/actions/versioninc.py | rfsheffer/PyUE4Builder | 2b2a978431ba5426238a03ecaae5a73836a0598c | [
"MIT"
] | null | null | null | PyUE4Builder/actions/versioninc.py | rfsheffer/PyUE4Builder | 2b2a978431ba5426238a03ecaae5a73836a0598c | [
"MIT"
] | 2 | 2017-12-04T18:30:12.000Z | 2018-04-15T01:46:02.000Z |
# def do_game_version_increment(uproject_dir_path):
# """
# Increments the game version number
# Note: This function assumes you are current pushed into the directory jenkins.py resides
# """
# abs_ini_path = os.path.join(uproject_dir_path, game_version_ini)
# if not os.path.isfile(abs_ini_path):
# error_exit('COULD NOT INCREMENT BUILD VERSION ERROR! FILE NOT FOUND!')
#
# # Get the current perforce ticket so we can call p4 commands on the workspace
# if 'P4TICKET' in os.environ:
# # If the ticket is set in the environment already, use that
# p4_ticket = os.environ['P4TICKET']
# else:
# # Try to do a general login on a client machine
# p4_ticket = get_p4_ticket()
#
# # Edit the ini file, we will increment the version number
# click.secho('INI found at {}'.format(abs_ini_path))
# launch('p4 -P {0} edit {1}'.format(p4_ticket, abs_ini_path), False)
#
# fp = open(abs_ini_path, 'r')
# ini_lines = fp.readlines()
# fp.close()
# proj_ver_str = 'ProjectVersion='
# for ini_line_index in range(0, len(ini_lines)):
# if ini_lines[ini_line_index].startswith(proj_ver_str):
# edit_line = ini_lines[ini_line_index].split(proj_ver_str)[1]
# ver_nums = edit_line.split('.')
# ver_nums[len(ver_nums) - 1] = str(int(ver_nums[len(ver_nums) - 1]) + 1)
# ini_lines[ini_line_index] = '{0}{1}\n'.format(proj_ver_str, str.join('.', ver_nums))
#
# fp = open(abs_ini_path, 'w')
# fp.writelines(ini_lines)
# fp.close()
#
# # Submit the version increment edit back to version control
# # UNDONE: This is great for build automation on a dedicated build server, but on local client
# # I am letting the client user submit this themselves.
# # launch('p4 -P {0} submit -d "[proj_name][auto] Automatic version increment"'.format(p4_ticket), False)
| 44.72093 | 110 | 0.654186 | 287 | 1,923 | 4.1777 | 0.407666 | 0.030025 | 0.050042 | 0.037531 | 0.106756 | 0.030025 | 0 | 0 | 0 | 0 | 0 | 0.013441 | 0.226209 | 1,923 | 42 | 111 | 45.785714 | 0.792339 | 0.952678 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
595f1ef7a008208658a3a7ec77ec9027d8231a58 | 77 | py | Python | tests/conftest.py | aleksul/pytest-motor | 20dd246fce777f0e21d1d03244e494e818a3dd52 | [
"MIT"
] | null | null | null | tests/conftest.py | aleksul/pytest-motor | 20dd246fce777f0e21d1d03244e494e818a3dd52 | [
"MIT"
] | null | null | null | tests/conftest.py | aleksul/pytest-motor | 20dd246fce777f0e21d1d03244e494e818a3dd52 | [
"MIT"
] | null | null | null | """Pytest configuration."""
pytest_plugins = ['pytester', 'pytest_asyncio']
| 19.25 | 47 | 0.714286 | 7 | 77 | 7.571429 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 77 | 3 | 48 | 25.666667 | 0.757143 | 0.272727 | 0 | 0 | 0 | 0 | 0.44 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
5972ecfee2c2931b8eb438d1c8cde7deeeb462a3 | 2,274 | py | Python | solutions/LeetCode/Python3/33.py | timxor/leetcode-journal | 5f1cb6bcc44a5bc33d88fb5cdb4126dfc6f4232a | [
"MIT"
] | 854 | 2018-11-09T08:06:16.000Z | 2022-03-31T06:05:53.000Z | solutions/LeetCode/Python3/33.py | timxor/leetcode-journal | 5f1cb6bcc44a5bc33d88fb5cdb4126dfc6f4232a | [
"MIT"
] | 29 | 2019-06-02T05:02:25.000Z | 2021-11-15T04:09:37.000Z | solutions/LeetCode/Python3/33.py | timxor/leetcode-journal | 5f1cb6bcc44a5bc33d88fb5cdb4126dfc6f4232a | [
"MIT"
] | 347 | 2018-12-23T01:57:37.000Z | 2022-03-12T14:51:21.000Z | __________________________________________________________________________________________________
sample 24 ms submission
class Solution:
def search(self, nums: List[int], target: int) -> int:
if len(nums)==0:return -1
left = 0
right = len(nums) - 1
while left <= right:
mid = left + (right-left)//2
if nums[mid]==target:
return mid
if nums[mid]<nums[left]:
if target > nums[mid] and target <= nums[right]:
left = mid + 1
else:
right = mid -1
else:
if target < nums[mid] and target >= nums[left]:
right = mid -1
else:
left = mid + 1
return -1
__________________________________________________________________________________________________
sample 12800 kb submission
class Solution:
def search(self, nums: List[int], target: int) -> int:
# Check whether the input array is None or empty
if not nums:
return -1
# Assumption: nums is sorted and no duplicate exists in the array
# Binary search
left, right = 0, len(nums) - 1
while left <= right:
mid = left + (right - left) // 2
if nums[mid] == target: # Found it
return mid
if nums[mid] < nums[right]: # [left, mid] itself is rotated sorted and [mid, right] is sorted
if nums[mid] < target <= nums[right]:
# The target must lie in the right half.
left = mid + 1
else:
# The target must lie in the left half.
right = mid - 1
else: # [left, mid] is sorted and [mid, right] itself is rotated sorted.
if nums[left] <= target < nums[mid]:
# The target must lie in the left half.
right = mid - 1
else:
# The target must lie in the right half.
left = mid + 1
# Not found
return -1
# Time: O(log n)
__________________________________________________________________________________________________
| 40.607143 | 106 | 0.529903 | 237 | 2,274 | 3.843882 | 0.232068 | 0.061471 | 0.052689 | 0.05708 | 0.567508 | 0.567508 | 0.489572 | 0.428101 | 0.428101 | 0.42371 | 0 | 0.018854 | 0.39358 | 2,274 | 55 | 107 | 41.345455 | 0.641769 | 0.193931 | 0 | 0.711111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
598034ce532f8a287c1fa41c150f55c16c6011ca | 2,150 | py | Python | optimizedGPS/results_provider/TEG_model_stats.py | mickael-grima/optimizedGPS | e82fd864d7e1a3ef1f7ae64db991cb33784d4df3 | [
"Apache-2.0"
] | null | null | null | optimizedGPS/results_provider/TEG_model_stats.py | mickael-grima/optimizedGPS | e82fd864d7e1a3ef1f7ae64db991cb33784d4df3 | [
"Apache-2.0"
] | null | null | null | optimizedGPS/results_provider/TEG_model_stats.py | mickael-grima/optimizedGPS | e82fd864d7e1a3ef1f7ae64db991cb33784d4df3 | [
"Apache-2.0"
] | null | null | null |
from utils import tools
from optimizedGPS.data.data_generator import generate_random_drivers, generate_grid_data
from optimizedGPS.problems.Models import TEGModel
from optimizedGPS.problems.Solver import Solver
def compare_rows_and_columns_number(graph, drivers_numbers=iter([])):
"""
Considering a graph, we compute number of variables and constraints for several drivers_graph (number of driver
up to drivers_number). We return the ratio number_contraints / number_variables
"""
res = {}
for nb_drivers in drivers_numbers:
ratios = []
for _ in range(50): # we take the average over 50 tries
drivers_graph = generate_random_drivers(graph, nb_drivers)
solver = Solver(graph, drivers_graph, TEGModel)
solver.presolve()
ratios.append(tools.get_percentage(
solver.algorithm.number_of_constraints(), solver.algorithm.number_of_variables()))
res[nb_drivers] = sum(ratios) / float(len(ratios))
return res
def get_maximum_ratio_non_zero_variables(graph, drivers_numbers=iter([])):
"""
Compute the worst number of non-zero variable: we assume that each driver has taken the longest path
"""
res = {}
for nb_drivers in drivers_numbers:
ratios = []
for _ in range(50): # we take the average over 50 tries
value = 0
drivers_graph = generate_random_drivers(graph, nb_drivers)
solver = Solver(graph, drivers_graph, TEGModel)
solver.presolve()
for driver in drivers_graph.get_all_drivers():
value += len(graph.get_shortest_path(driver.start, driver.end, key=lambda u, v: - 1))
ratios.append(tools.get_percentage(value, solver.algorithm.number_of_variables()))
res[nb_drivers] = sum(ratios) / float(len(ratios))
return res
if __name__ == "__main__":
graph = generate_grid_data()
graph.set_global_congestion_function(lambda x: 3 * x + 4)
# print compare_rows_and_columns_number(graph, drivers_numbers=(20,))
print get_maximum_ratio_non_zero_variables(graph, drivers_numbers=xrange(1, 10))
| 43 | 115 | 0.696279 | 277 | 2,150 | 5.133574 | 0.34296 | 0.067511 | 0.053446 | 0.048523 | 0.528833 | 0.486639 | 0.486639 | 0.486639 | 0.421941 | 0.351617 | 0 | 0.010107 | 0.217674 | 2,150 | 49 | 116 | 43.877551 | 0.835315 | 0.062791 | 0 | 0.529412 | 1 | 0 | 0.004753 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.117647 | null | null | 0.029412 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
598b422b0ce67917558ab1d4e3136558a3efebaa | 2,032 | py | Python | 1Week_3-Python/exam/2015/calc/add/views.py | wmhst7/- | 1f33084c58a1aaf7120a6182396bbabb7a836ce5 | [
"MIT"
] | 2 | 2019-08-25T05:07:32.000Z | 2019-09-04T07:37:25.000Z | 1Week_3-Python/exam/2015/calc/add/views.py | wmhst7/- | 1f33084c58a1aaf7120a6182396bbabb7a836ce5 | [
"MIT"
] | 1 | 2022-03-05T10:11:21.000Z | 2022-03-05T10:11:21.000Z | 1Week_3-Python/exam/2015/calc/add/views.py | wmhst7/- | 1f33084c58a1aaf7120a6182396bbabb7a836ce5 | [
"MIT"
] | 1 | 2022-03-05T10:15:16.000Z | 2022-03-05T10:15:16.000Z | from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
token=r'{% csrf_token %}'
calculator='''
<form method="post" action="/">
%s
<input type="text" name="input" value="%s">
<table>
<tr>
<td><input type="submit" value="1" name="b"></td>
<td><input type="submit" value="2" name="b"></td>
<td><input type="submit" value="3" name="b"></td>
<td></td>
<td><input type="submit" value="+" name="b"></td>
<td><input type="submit" value="-" name="b"></td>
</tr>
<tr>
<td><input type="submit" value="4" name="b"></td>
<td><input type="submit" value="5" name="b"></td>
<td><input type="submit" value="6" name="b"></td>
<td></td>
<td><input type="submit" value="*" name="b"></td>
<td><input type="submit" value="/" name="b"></td>
</tr>
<tr>
<td><input type="submit" value="7" name="b"></td>
<td><input type="submit" value="8" name="b"></td>
<td><input type="submit" value="9" name="b"></td>
<td></td>
<td><input type="submit" value="=" name="b"></td>
<td><input type="submit" value="C" name="b"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="0" name="b"></td>
</tr>
</table>
</form>
'''
text=""
text2=""
def wr(s):
with open("try.html","w") as f:
f.write(calculator%(token,s))
def calc(request):
global text,text2
print(request.POST)
try:
c=request.POST['b']
except:
c='n'
print(c)
if c=='C' or c=='n':
text=""
text2=""
elif c=='=':
text="%f"%eval(text2)
elif c=='+' or c=='-' or c=='*' or c=='/':
text+=c
text2+='.0'+c
else:
text+=c
text2+=c
print(text,text2)
try:
print(eval(text2))
except:
print("qwq")
wr(text)
return render(request,"try.html") #HttpResponse(calculator%(0))
#if request.POST.has_key('input'):
| 26.051282 | 67 | 0.497539 | 283 | 2,032 | 3.565371 | 0.236749 | 0.079286 | 0.17443 | 0.269574 | 0.492567 | 0.482656 | 0.447968 | 0.4222 | 0.249752 | 0.249752 | 0 | 0.013316 | 0.260827 | 2,032 | 77 | 68 | 26.38961 | 0.658455 | 0.041339 | 0 | 0.314286 | 0 | 0 | 0.641276 | 0 | 0.014286 | 0 | 0 | 0 | 0 | 1 | 0.028571 | false | 0 | 0.028571 | 0 | 0.071429 | 0.071429 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
59c3b3a5f9eee80ba16a2834a630e2be99d7ea4b | 322 | py | Python | python/02-str_format.py | Kirk-Wang/data-science | 7622e7ad41a9aed622fe398726342cff5e487c70 | [
"MIT"
] | 1 | 2019-12-19T14:48:13.000Z | 2019-12-19T14:48:13.000Z | python/02-str_format.py | Kirk-Wang/Data-Science | 7622e7ad41a9aed622fe398726342cff5e487c70 | [
"MIT"
] | null | null | null | python/02-str_format.py | Kirk-Wang/Data-Science | 7622e7ad41a9aed622fe398726342cff5e487c70 | [
"MIT"
] | null | null | null | name = 'Python'
age = 27
new_str = "我是" + name + "," + "今年" + str(age) + "岁了"
print(new_str)
new_str_1 = "我是%s,今年%d岁了" % (name, age)
print(new_str_1)
new_str_2 = "我是{name},今年{age}岁了".format(
name='aaaa', age='bbb'
)
print(new_str_2)
name1 = 'abc'
age1 = 30
new_str_3 = f"我是{name1},今年{age1}岁了"
print(new_str_3) | 14 | 52 | 0.611801 | 62 | 322 | 2.951613 | 0.370968 | 0.262295 | 0.240437 | 0.142077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.052632 | 0.173913 | 322 | 23 | 53 | 14 | 0.635338 | 0 | 0 | 0 | 0 | 0 | 0.22291 | 0 | 0.071429 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.285714 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
59d1937edb0b6b1076917b431883209b8f290e0d | 270 | py | Python | exploration/mor_usin_IRSx.py | tmnewt/Non4ProfitDataGathering | 220e1638af5b5d888c66dd1c2b9c0bc5cc041c7c | [
"MIT"
] | 2 | 2019-12-04T16:23:45.000Z | 2020-09-09T12:51:48.000Z | exploration/mor_usin_IRSx.py | tmnewt/Non4ProfitDataGathering | 220e1638af5b5d888c66dd1c2b9c0bc5cc041c7c | [
"MIT"
] | null | null | null | exploration/mor_usin_IRSx.py | tmnewt/Non4ProfitDataGathering | 220e1638af5b5d888c66dd1c2b9c0bc5cc041c7c | [
"MIT"
] | null | null | null | # nothing to see here... for now.
#from irsx.xmlrunner import XMLRunner
#import os, requests, re, time, numpy as np, pandas as pd, pickle, json
#from IPython.display import clear_output
#from pandas.io.json import json_normalize
#from collections import OrderedDict
| 24.545455 | 71 | 0.774074 | 41 | 270 | 5.04878 | 0.707317 | 0.144928 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148148 | 270 | 10 | 72 | 27 | 0.9 | 0.937037 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
59d2673e61c80dbb5461112507ba094cc725fa5d | 56 | py | Python | src/rez/data/tests/solver/packages/pybah/5/package.py | alexey-pelykh/rez | ad12105d89d658e4d2ea9249e537b3de90391f0e | [
"Apache-2.0"
] | null | null | null | src/rez/data/tests/solver/packages/pybah/5/package.py | alexey-pelykh/rez | ad12105d89d658e4d2ea9249e537b3de90391f0e | [
"Apache-2.0"
] | null | null | null | src/rez/data/tests/solver/packages/pybah/5/package.py | alexey-pelykh/rez | ad12105d89d658e4d2ea9249e537b3de90391f0e | [
"Apache-2.0"
] | 1 | 2020-09-24T08:33:43.000Z | 2020-09-24T08:33:43.000Z | name = "pybah"
version = "5"
requires = ["python-2.5"]
| 11.2 | 25 | 0.589286 | 8 | 56 | 4.125 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.065217 | 0.178571 | 56 | 4 | 26 | 14 | 0.652174 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
59d439f7ac3a444c15d42463d8700b2904dd90a3 | 385 | py | Python | tests/test_installation.py | namiyousef/colab-utils | 9d0bbd1149277df543a260d16b4db711c0748f09 | [
"MIT"
] | null | null | null | tests/test_installation.py | namiyousef/colab-utils | 9d0bbd1149277df543a260d16b4db711c0748f09 | [
"MIT"
] | null | null | null | tests/test_installation.py | namiyousef/colab-utils | 9d0bbd1149277df543a260d16b4db711c0748f09 | [
"MIT"
] | null | null | null | from importlib import import_module
def test_imports():
import os.path, pkgutil
import colabtools
pkgpath = os.path.dirname(colabtools.__file__)
modules = [name for _, name, _ in pkgutil.iter_modules([pkgpath])]
for module in modules:
imported_module = import_module(f'.{module}', package=colabtools.__name__)
if __name__ == '__main__': test_imports() | 25.666667 | 82 | 0.716883 | 47 | 385 | 5.361702 | 0.510638 | 0.095238 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.179221 | 385 | 15 | 83 | 25.666667 | 0.797468 | 0 | 0 | 0 | 0 | 0 | 0.044041 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.666667 | 0 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
59db1792f1726dbb94dc4f112980524ee6ba6050 | 1,031 | py | Python | matplotlib-3.4.3/matplotlib-3.4.3/examples/pie_and_polar_charts/polar_demo.py | JohnLauFoo/clc_packages_Yu | 259f01d9b5c02154ce258734d519ae8995cd0991 | [
"MIT"
] | 1 | 2021-11-13T17:21:44.000Z | 2021-11-13T17:21:44.000Z | matplotlib-3.4.3/matplotlib-3.4.3/examples/pie_and_polar_charts/polar_demo.py | JohnLauFoo/clc_packages_Yu | 259f01d9b5c02154ce258734d519ae8995cd0991 | [
"MIT"
] | null | null | null | matplotlib-3.4.3/matplotlib-3.4.3/examples/pie_and_polar_charts/polar_demo.py | JohnLauFoo/clc_packages_Yu | 259f01d9b5c02154ce258734d519ae8995cd0991 | [
"MIT"
] | null | null | null | """
==========
Polar plot
==========
Demo of a line plot on a polar axis.
"""
import numpy as np
import matplotlib.pyplot as plt
r = np.arange(0, 2, 0.01)
theta = 2 * np.pi * r
fig, ax = plt.subplots(subplot_kw={'projection': 'polar'})
ax.plot(theta, r)
ax.set_rmax(2)
ax.set_rticks([0.5, 1, 1.5, 2]) # Less radial ticks
ax.set_rlabel_position(-22.5) # Move radial labels away from plotted line
ax.grid(True)
ax.set_title("A line plot on a polar axis", va='bottom')
plt.show()
#############################################################################
#
# .. admonition:: References
#
# The use of the following functions, methods, classes and modules is shown
# in this example:
#
# - `matplotlib.axes.Axes.plot` / `matplotlib.pyplot.plot`
# - `matplotlib.projections.polar`
# - `matplotlib.projections.polar.PolarAxes`
# - `matplotlib.projections.polar.PolarAxes.set_rticks`
# - `matplotlib.projections.polar.PolarAxes.set_rmax`
# - `matplotlib.projections.polar.PolarAxes.set_rlabel_position`
| 27.131579 | 78 | 0.634336 | 140 | 1,031 | 4.6 | 0.485714 | 0.163043 | 0.201863 | 0.217391 | 0.242236 | 0.065217 | 0.065217 | 0 | 0 | 0 | 0 | 0.0181 | 0.14258 | 1,031 | 37 | 79 | 27.864865 | 0.710407 | 0.557711 | 0 | 0 | 0 | 0 | 0.134078 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
59df288bacb501cc85a8eae05ca75ad0030a991e | 233 | py | Python | splineslicer/io/ilastik.py | kevinyamauchi/splineslicer | 3816a32494382d42381ef382cbbfa27ecdee7688 | [
"BSD-3-Clause"
] | 3 | 2021-07-22T11:15:50.000Z | 2022-02-22T14:02:09.000Z | splineslicer/io/ilastik.py | kevinyamauchi/splineslicer | 3816a32494382d42381ef382cbbfa27ecdee7688 | [
"BSD-3-Clause"
] | null | null | null | splineslicer/io/ilastik.py | kevinyamauchi/splineslicer | 3816a32494382d42381ef382cbbfa27ecdee7688 | [
"BSD-3-Clause"
] | 1 | 2022-01-26T19:02:29.000Z | 2022-01-26T19:02:29.000Z | import h5py
import numpy as np
from napari.types import ImageData
def load_ilastik_predictions(filepath: str) -> ImageData:
with h5py.File(filepath, 'r') as f:
im = f['exported_data'][:]
return [(im, {}, 'image')]
| 21.181818 | 57 | 0.665236 | 32 | 233 | 4.75 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010695 | 0.197425 | 233 | 10 | 58 | 23.3 | 0.802139 | 0 | 0 | 0 | 0 | 0 | 0.081545 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.428571 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
ab756122c5f02e5120b77f948f5b5bac418356d6 | 2,378 | py | Python | tests/functional_tests/test_register_then_login.py | mcrors/SimPyInvoice | cdd66476900d695c1f02939c572ee51defcf72ac | [
"MIT"
] | null | null | null | tests/functional_tests/test_register_then_login.py | mcrors/SimPyInvoice | cdd66476900d695c1f02939c572ee51defcf72ac | [
"MIT"
] | null | null | null | tests/functional_tests/test_register_then_login.py | mcrors/SimPyInvoice | cdd66476900d695c1f02939c572ee51defcf72ac | [
"MIT"
] | null | null | null | def test_user_can_register_and_then_login_then_logout(simpy_test_container, firefox_browser):
# Edith has heard about a new app to help manage her invoices
# She opens a browser and navigates to the registration page
firefox_browser.get('http://127.0.0.1:5000/')
# She notices that the name of the app is call SimpyInvoice
assert 'SimpyInvoice' in firefox_browser.title
# and that she has been redirected to the login page
assert 'Login' in firefox_browser.title
# Because she does not yet have an account, she clicks on the register link
register_link = firefox_browser.find_element_by_id('register')
register_link.click()
assert 'Register' in firefox_browser.title
# She enters in her details into the registration form
first_name_input_elem = firefox_browser.find_element_by_id('first_name')
first_name_input_elem.send_keys('Edith')
last_name_input_elem = firefox_browser.find_element_by_id('last_name')
last_name_input_elem.send_keys('Jones')
username_input_elem = firefox_browser.find_element_by_id('username')
username_input_elem.send_keys('edith_jones')
email_input_elem = firefox_browser.find_element_by_id('email')
email_input_elem.send_keys('edith@jones.com')
password_input_elem = firefox_browser.find_element_by_id('password')
password_input_elem.send_keys('123456789')
confirm_password_input_elem = firefox_browser.find_element_by_id('password_2')
confirm_password_input_elem.send_keys('123456789')
# She hits the register button and is redirected to the login page
register_elem = firefox_browser.find_element_by_id('submit')
register_elem.click()
assert 'Login' in firefox_browser.title
# She logs into the website with her newly created account
email_input_elem = firefox_browser.find_element_by_id('email')
email_input_elem.send_keys('edith@jones.com')
password_input_elem = firefox_browser.find_element_by_id('password')
password_input_elem.send_keys('123456789')
register_elem = firefox_browser.find_element_by_id('submit')
register_elem.click()
welcome_header_elem = firefox_browser.find_element_by_id('welcome')
assert 'Welcome back Edith' in welcome_header_elem.text
logout_link = firefox_browser.find_element_by_id('logout')
logout_link.click()
assert 'Login' in firefox_browser.title
| 45.730769 | 93 | 0.779226 | 351 | 2,378 | 4.905983 | 0.267806 | 0.162602 | 0.135889 | 0.188734 | 0.597561 | 0.526713 | 0.472706 | 0.375145 | 0.353078 | 0.304297 | 0 | 0.01871 | 0.145921 | 2,378 | 51 | 94 | 46.627451 | 0.829148 | 0.200168 | 0 | 0.454545 | 0 | 0 | 0.131537 | 0 | 0 | 0 | 0 | 0 | 0.181818 | 1 | 0.030303 | false | 0.181818 | 0 | 0 | 0.030303 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
ab802b74bbe50c6b5086c01bafb91e9be7a83594 | 669 | py | Python | Alames/phasorview.py | KLZ-0/Alames | cc9af04674706af2ddbfe955046021acf8bedffa | [
"MIT"
] | null | null | null | Alames/phasorview.py | KLZ-0/Alames | cc9af04674706af2ddbfe955046021acf8bedffa | [
"MIT"
] | null | null | null | Alames/phasorview.py | KLZ-0/Alames | cc9af04674706af2ddbfe955046021acf8bedffa | [
"MIT"
] | null | null | null | from Alames.importer import *
from Alames.phasorscene import PhasorScene
class PhasorView(QGraphicsView):
"""Phasor Diagram View"""
def __init__(self, parent):
super(PhasorView, self).__init__(parent)
self.setScene(PhasorScene())
self.scene().redrawn.connect(self.centerScene)
def reDraw(self):
"""Just a wrapper method for the scene reDraw"""
self.scene().reDraw()
def centerScene(self):
self.centerOn(self.scene().sceneRect().center())
def resizeEvent(self, event):
super(PhasorView, self).resizeEvent(event)
def toggleVisible(self):
self.setVisible(not self.isVisible())
| 26.76 | 56 | 0.668161 | 73 | 669 | 6.013699 | 0.506849 | 0.061503 | 0.08656 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.206278 | 669 | 24 | 57 | 27.875 | 0.826742 | 0.092676 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.133333 | 0 | 0.533333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
ab87de412ad1f544d67a3a60c79b7b5acca30801 | 990 | py | Python | app/main/models/Compra.py | amandapersampa/Franguinho | 940b6601a821ab4857de7f0a5a0ac53f6f54a564 | [
"MIT"
] | null | null | null | app/main/models/Compra.py | amandapersampa/Franguinho | 940b6601a821ab4857de7f0a5a0ac53f6f54a564 | [
"MIT"
] | 8 | 2017-03-14T11:55:07.000Z | 2017-04-03T00:53:32.000Z | app/main/models/Compra.py | amandapersampa/MicroGerencia | 940b6601a821ab4857de7f0a5a0ac53f6f54a564 | [
"MIT"
] | null | null | null | # coding=utf-8
from sqlalchemy.orm import relationship
from app import db
class Compra_dao(db.Model):
__tablename__ = "compra"
id_compra = db.Column(db.Integer, primary_key=True)
quantidade = db.Column(db.Integer)
valor = db.Column(db.Float)
data = db.Column(db.Date)
id_produto = db.Column(db.Integer, db.ForeignKey('produto.id_produto'))
produto = relationship("Produto_dao", back_populates="compra")
def __init__(self, quantidade, valor, data, id_produto):
self.quantidade = quantidade
self.valor = valor
self.data = data
self.id_produto = id_produto
def salvar(self):
db.session.add(self)
db.session.commit()
def listar(id):
return Compra_dao.query.get(id)
@staticmethod
def findAll():
return Compra_dao.query.all()
def __repr__(self):
return str({"id_compra": self.id_compra, "quantidade": self.quantidade, "valor": self.valor,"produto": self.produto}) | 28.285714 | 125 | 0.666667 | 129 | 990 | 4.914729 | 0.356589 | 0.063091 | 0.078864 | 0.080442 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00128 | 0.211111 | 990 | 35 | 125 | 28.285714 | 0.810499 | 0.012121 | 0 | 0 | 0 | 0 | 0.073695 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.08 | 0.12 | 0.72 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
aba2d10118bda2b05bb24591d5e4d1c1c76bd328 | 12,238 | py | Python | tests/mf/test_base.py | mwtoews/moflow | 90469134e029921a63ecff9b51bfac1c658b597e | [
"BSD-2-Clause"
] | 1 | 2015-04-19T21:42:22.000Z | 2015-04-19T21:42:22.000Z | tests/mf/test_base.py | mwtoews/moflow | 90469134e029921a63ecff9b51bfac1c658b597e | [
"BSD-2-Clause"
] | null | null | null | tests/mf/test_base.py | mwtoews/moflow | 90469134e029921a63ecff9b51bfac1c658b597e | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
import os
import pytest
import sys
from numpy import testing
from textwrap import dedent
from moflow.mf.name import Modflow
from moflow.mf.base import MFPackage
from moflow.mf.reader import MFFileReader
if sys.version_info[0] < 3:
from io import BytesIO
StringIO = BytesIO
else:
from io import StringIO, BytesIO
class ExamplePackage(MFPackage):
par1 = None
par2 = None
def test_mf_reader_basics():
p = ExamplePackage()
f = StringIO(dedent('''\
# A comment
100 ignore
200 -2.4E-12
4 500 FREE
-44 888.0
last line
'''))
r = MFFileReader(f, p)
assert r.not_eof
assert r.lineno == 0
assert len(r) == 6
# 0: Text
r.read_text()
assert r.lineno == 1
assert p.text == ['A comment']
# 1: an item
assert r.get_items(1, 1, 'i') == [100]
assert r.lineno == 2
# 2: two named items
with pytest.raises(ValueError):
r.read_named_items(2, ('par1', 'par2'), 'i')
r.lineno -= 1 # manually scroll back 1 line and try again
r.read_named_items(2, ('par1', 'par2'), 'f')
assert p.par1 == 200.0
testing.assert_almost_equal(p.par2, -2.4E-12)
# 3: three named items
items = r.get_named_items(3, ['a', 'b'], 'f')
assert items == {'a': 4.0, 'b': 500.0}
# 4: two named items
r.read_named_items(4, ['par1', 'par2'], 'f')
assert p.par1 == -44.0
testing.assert_almost_equal(p.par2, 888.0)
# post-Data Set
assert r.not_eof
assert r.nextline() == 'last line\n'
assert r.lineno == 6
assert not r.not_eof
# Try to read past EOF
with pytest.raises(IndexError):
r.nextline()
assert r.lineno == 6
def test_mf_reader_empty():
p = ExamplePackage()
f = StringIO('# Empty file')
r = MFFileReader(f, p)
assert r.not_eof
assert r.lineno == 0
assert len(r) == 1
# Item 0: Text
r.read_text()
assert r.lineno == 1
assert p.text == ['Empty file']
assert not r.not_eof
def test_mf_read_free_arrays():
# Examples from page 8-59 of TM6A16_MF2005
m = Modflow()
p = ExamplePackage()
m.append(p)
f = StringIO(dedent('''\
CONSTANT 5.7 This sets an entire array to the value "5.7".
INTERNAL 1.0 (7F4.0) 3 This reads the array values from the ...
1.2 3.7 9.3 4.2 2.2 9.9 1.0
3.3 4.9 7.3 7.5 8.2 8.7 6.6
4.5 5.7 2.2 1.1 1.7 6.7 6.9
7.4 3.5 7.8 8.5 7.4 6.8 8.8
EXTERNAL 52 1.0 (7F4.0) 3 This reads the array from the formatted..
EXTERNAL 47 1.0 (BINARY) 3 This reads the array from the binary ...
OPEN/CLOSE test.dat 1.0 (7F4.0) 3 This reads the array from the ...
'''))
# Prepare ASCII data for unit 52, and for test.dat
d2_str = (
' 1.2 3.7 9.3 4.2 2.2 9.9 1.0\n'
' 3.3 4.9 7.3 7.5 8.2 8.7 6.6\n'
' 4.5 5.7 2.2 1.1 1.7 6.7 6.9\n'
' 7.4 3.5 7.8 8.5 7.4 6.8 8.8\n'
)
m[52] = StringIO(d2_str)
# Prepare binary data for unit 47
d2_expected = np.array(
[[1.2, 3.7, 9.3, 4.2, 2.2, 9.9, 1.0],
[3.3, 4.9, 7.3, 7.5, 8.2, 8.7, 6.6],
[4.5, 5.7, 2.2, 1.1, 1.7, 6.7, 6.9],
[7.4, 3.5, 7.8, 8.5, 7.4, 6.8, 8.8]], 'f')
m[47] = BytesIO(d2_expected.tostring())
r = MFFileReader(f, p)
# Data Number 1: Read constant 4x5 array
d1_shape = (4, 7)
d1_expected = np.ones(d1_shape, 'f') * 5.7
d1 = r.get_array(1, d1_shape, 'f', return_dict=True)
assert not hasattr(d1, 'locat')
assert d1['cntrl'] == 'CONSTANT'
assert d1['cnstnt'] == '5.7'
assert d1['text'] == 'This sets an entire array to the value "5.7".'
testing.assert_array_equal(d1['array'], d1_expected)
assert r.lineno == 1
# Data Number 2: Read internal 4x7 array
d2_shape = (4, 7)
d2 = r.get_array(2, d2_shape, 'f', return_dict=True)
assert d2['cntrl'] == 'INTERNAL'
assert d2['cnstnt'] == '1.0'
assert d2['fmtin'] == '(7F4.0)'
assert d2['iprn'] == '3'
assert d2['text'] == 'This reads the array values from the ...'
testing.assert_array_equal(d2['array'], d2_expected)
assert r.lineno == 6
# Data Number 3: EXTERNAL ASCII
d3 = r.get_array(3, d2_shape, 'f', return_dict=True)
assert d3['cntrl'] == 'EXTERNAL'
assert d3['nunit'] == 52
assert d3['cnstnt'] == '1.0'
assert d3['fmtin'] == '(7F4.0)'
assert d3['iprn'] == '3'
testing.assert_array_equal(d3['array'], d2_expected)
assert r.lineno == 7
# Data Number 4: EXTERNAL BINARY
d4 = r.get_array(4, d2_shape, 'f', return_dict=True)
assert d4['cntrl'] == 'EXTERNAL'
assert d4['nunit'] == 47
assert d4['cnstnt'] == '1.0'
assert d4['fmtin'] == '(BINARY)'
assert d4['iprn'] == '3'
testing.assert_array_equal(d4['array'], d2_expected)
assert r.lineno == 8
# Data Number 5: OPEN/CLOSE test.dat
d5_fname = 'test.dat'
with open(d5_fname, 'w') as fp:
fp.write(d2_str)
d5 = r.get_array(5, d2_shape, 'f', return_dict=True)
os.unlink(d5_fname)
assert d5['cntrl'] == 'OPEN/CLOSE'
assert d5['fname'] == d5_fname
assert d5['cnstnt'] == '1.0'
assert d5['fmtin'] == '(7F4.0)'
assert d5['iprn'] == '3'
testing.assert_array_equal(d5['array'], d2_expected)
assert r.lineno == 9
assert not r.not_eof
def test_mf_read_fixed_arrays():
m = Modflow()
p = ExamplePackage()
p.nunit = 11
m.append(p)
f = StringIO('''\
11 1. (15f4.0) 7 WETDRY-1
2. 2. 2. 2. 2. 2. 2. 2. -2. -2. -2. -2. -2. -2. -2.
2. 2. 2. 2. 2. 2. 2. 2. -2. -2. -2. -2. -2. -2. -2.
2. 2. 2. -2. 2. 2. 2. 2. -2. -2. -2. -2. -2. -2. -2.
2. 2. 2. 2. 2. 2. 2. 2. -2. -2. -2. -2. -2. -2. -2.
2. 2. 2. 2. 2. 2. 2. 2. -2. -2. -2. -2. -2. -2. -2.
2. 2. 2. -2. 2. 2. 2. 2. -2. -2. -2. -2. -2. -2. -2.
2. 2. 2. 2. 2. 2. 2. 2. -2. -2. -2. -2. -2. -2. -2.
11 1(12I2) 3
1 1 1 1 1 1 1 1 1 1 1 1
1 1 9 1 1 1 1 1 1 1 1 1
11 1(13I3) IBOUND L1
-1 1 1 1 1 1 1 1 1 1 1 1 -1
11 1(13I3) IBOUND L2
-1 1 1 1 1 1 1 1 1 1 1 1 -1
0 6. (15f4.0) 7 # Some text
0 8(12I2) 3
-17 1. (binary) 7
16 1(24I3) 3
16 1(24I3) 3
0 145.
''')
# Prepare two ASCII data sets for unit 16
m[16] = StringIO('''\
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
''')
# Prepare binary data for unit 17
d6_expected = np.array(
[[1.2, 3.7, 9.3, 4.2, 2.2, 9.9, 1.0],
[3.3, 4.9, 7.3, 7.5, 8.2, 8.7, 6.6],
[4.5, 5.7, 2.2, 1.1, 1.7, 6.7, 6.9],
[7.4, 3.5, 7.8, 8.5, 7.4, 6.8, 8.8]], 'f')
m[17] = BytesIO(d6_expected.tostring())
r = MFFileReader(f, p)
# Data Number 1
d1_shape = (7, 15)
a = [[2.] * 8 + [-2.] * 7]
b = [[2.] * 3 + [-2.] + [2.] * 4 + [-2.] * 7]
d1_expected = np.array(a * 2 + b + a * 2 + b + a)
d1 = r.get_array(1, d1_shape, 'f', return_dict=True)
assert not hasattr(d1, 'cntrl')
assert d1['locat'] == 11
assert d1['cnstnt'] == '1.'
assert d1['fmtin'] == '(15F4.0)'
assert d1['iprn'] == '7'
assert d1['text'] == 'WETDRY-1'
testing.assert_array_equal(d1['array'], d1_expected)
assert r.lineno == 8
# Data Number 2
d2_shape = (2, 12)
d2_expected = np.ones(d2_shape)
d2_expected[1, 2] = 9
d2 = r.get_array(2, d2_shape, 'i', return_dict=True)
assert d2['locat'] == 11
assert d2['cnstnt'] == '1'
assert d2['fmtin'] == '(12I2)'
assert d2['iprn'] == '3'
assert not hasattr(d2, 'text')
testing.assert_array_equal(d2['array'], d2_expected)
assert r.lineno == 11
# Data Number 3
d3_shape = (2, 13)
d3_expected = np.array(2 * [[-1] + [1] * 11 + [-1]], 'i')
d3a = np.empty(d3_shape, 'i')
for ilay in range(d3_shape[0]):
d3 = r.get_array(3, d3_shape[1], 'i', return_dict=True)
assert d3['locat'] == 11
assert d3['fmtin'] == '(13I3)'
assert d3['iprn'] == ''
assert d3['text'].startswith('IBOUND')
d3a[ilay, :] = d3['array']
assert d3['text'] == 'IBOUND L2'
testing.assert_array_equal(d3a, d3_expected)
assert r.lineno == 15
# Data Number 4
d4_shape = (4, 8)
d4_expected = np.ones(d4_shape, 'f') * 6
d4 = r.get_array(4, d4_shape, 'f', return_dict=True)
assert d4['locat'] == 0
assert d4['cnstnt'] == '6.'
assert d4['fmtin'] == '(15F4.0)'
assert d4['iprn'] == '7'
assert d4['text'] == 'Some text'
testing.assert_array_equal(d4['array'], d4_expected)
assert r.lineno == 16
# Data Number 5
d5_shape = (7, 6)
d5_expected = np.ones(d5_shape) * 8
d5 = r.get_array(5, d5_shape, 'i', return_dict=True)
assert d5['locat'] == 0
assert d5['cnstnt'] == '8'
assert d5['fmtin'] == '(12I2)'
assert d5['iprn'] == '3'
assert not hasattr(d5, 'text')
testing.assert_array_equal(d5['array'], d5_expected)
assert r.lineno == 17
# Data Number 6
d6_shape = (4, 7)
d6 = r.get_array(6, d6_shape, 'f', return_dict=True)
assert d6['locat'] == -17
assert d6['cnstnt'] == '1.'
assert d6['fmtin'] == '(BINARY)'
assert d6['iprn'] == '7'
assert not hasattr(d6, 'text')
testing.assert_array_equal(d6['array'], d6_expected)
assert r.lineno == 18
# Data Number 7
d7_shape = (2, 17, 17)
d7_expected = np.zeros(d7_shape, 'i')
d7_expected[0, 6:11, 6:11] = 1
d7_expected[1, 7:10, 7:10] = 1
d7a = np.empty(d7_shape, 'i')
for ilay in range(d7_shape[0]):
d7 = r.get_array(7, d7_shape[1:], 'i', return_dict=True)
assert d7['locat'] == 16
assert d7['fmtin'] == '(24I3)'
assert d7['iprn'] == '3'
assert not hasattr(d7, 'text')
d7a[ilay, :] = d7['array']
testing.assert_array_equal(d7a, d7_expected)
assert r.lineno == 20
# Data Number 8
d8_shape = (2, 3)
d8_expected = 145.0 * np.ones(d8_shape, 'f')
d8 = r.get_array(8, d8_shape, 'f', return_dict=True)
assert d8['locat'] == 0
assert d8['cnstnt'] == '145.'
assert not hasattr(d8, 'fmtin')
assert not hasattr(d8, 'iprn')
testing.assert_array_equal(d8['array'], d8_expected)
assert r.lineno == 21
assert not r.not_eof
| 35.783626 | 76 | 0.503922 | 2,347 | 12,238 | 2.56029 | 0.079676 | 0.178066 | 0.262606 | 0.34415 | 0.494924 | 0.441172 | 0.370444 | 0.300882 | 0.300882 | 0.273257 | 0 | 0.191329 | 0.347851 | 12,238 | 341 | 77 | 35.888563 | 0.561584 | 0.052868 | 0 | 0.331126 | 0 | 0.05298 | 0.3794 | 0 | 0 | 0 | 0 | 0 | 0.377483 | 1 | 0.013245 | false | 0 | 0.036424 | 0 | 0.059603 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
abae63ff097e9b60f8bf364d5eb2bd78b1e968b7 | 569 | py | Python | test/test_delete_contact.py | leksoid/python-for-qa-training | 0197e7ad9e627e4cebc6ce2094cf83e623fa3b0c | [
"MIT"
] | null | null | null | test/test_delete_contact.py | leksoid/python-for-qa-training | 0197e7ad9e627e4cebc6ce2094cf83e623fa3b0c | [
"MIT"
] | 1 | 2021-06-02T00:57:55.000Z | 2021-06-02T00:57:55.000Z | test/test_delete_contact.py | leksoid/python-for-qa-training | 0197e7ad9e627e4cebc6ce2094cf83e623fa3b0c | [
"MIT"
] | null | null | null | from random import randrange
def test_delete_contact(app, data_provider_contacts):
if app.contact_helper.get_count() == 0:
app.contact_helper.create(data_provider_contacts)
initial_contacts = app.contact_helper.get_contacts()
index = randrange(len(initial_contacts))
app.contact_helper.delete_by_index(index)
app.wd.refresh()
assert len(initial_contacts) - 1 == app.contact_helper.get_count()
final_contacts = app.contact_helper.get_contacts()
initial_contacts[index:index+1] = []
assert initial_contacts == final_contacts
| 37.933333 | 70 | 0.757469 | 75 | 569 | 5.413333 | 0.36 | 0.147783 | 0.236453 | 0.187192 | 0.384236 | 0.172414 | 0 | 0 | 0 | 0 | 0 | 0.00616 | 0.144112 | 569 | 14 | 71 | 40.642857 | 0.827515 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0.083333 | false | 0 | 0.083333 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
abc881297b7e470c6c4c55545b896b351fed688f | 193 | py | Python | tests/__init__.py | ncgr/pytest-datadir-mgr | f92a58b7bde80c5880de736ff10bcb3ec9153d33 | [
"BSD-3-Clause"
] | 1 | 2020-04-15T22:47:06.000Z | 2020-04-15T22:47:06.000Z | tests/__init__.py | ncgr/pytest-datadir-mgr | f92a58b7bde80c5880de736ff10bcb3ec9153d33 | [
"BSD-3-Clause"
] | 155 | 2020-04-27T11:31:08.000Z | 2022-03-28T11:06:04.000Z | tests/__init__.py | joelb123/pytest-datadir-mgr | 86757b5b91eb3b9c689fb260a87892db2a74e233 | [
"BSD-3-Clause"
] | 1 | 2021-02-02T22:37:02.000Z | 2021-02-02T22:37:02.000Z | # -*- coding: utf-8 -*-
"""Shared test objects."""
# standard library imports
from pathlib import Path
TESTFILE = "data1.txt"
NEWPATH = Path("new") / "subdir" / "hello.txt"
DLFILE = "LICENSE"
| 21.444444 | 46 | 0.658031 | 24 | 193 | 5.291667 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01227 | 0.15544 | 193 | 8 | 47 | 24.125 | 0.766871 | 0.352332 | 0 | 0 | 0 | 0 | 0.288136 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
abd6b1c8125eee68ee4512ba38f58e16fb83caaa | 1,351 | py | Python | accelbyte_py_sdk/api/ugc/operations/public_content/__init__.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/ugc/operations/public_content/__init__.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | accelbyte_py_sdk/api/ugc/operations/public_content/__init__.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
"""Auto-generated package that contains models used by the justice-ugc-service."""
__version__ = "2.1.0"
__author__ = "AccelByte"
__email__ = "dev@accelbyte.net"
# pylint: disable=line-too-long
from .create_content_direct import CreateContentDirect
from .create_content_s3 import CreateContentS3
from .delete_content import DeleteContent
from .delete_content_screenshot import DeleteContentScreenshot
from .download_content_by_share_code import DownloadContentByShareCode
from .public_download_content_511956 import PublicDownloadContentByContentID
from .public_download_content_32df1f import PublicDownloadContentPreview
from .public_get_content_bulk import PublicGetContentBulk
from .public_get_user_content import PublicGetUserContent
from .public_search_content import PublicSearchContent
from .search_channel_specific_10d5e8 import SearchChannelSpecificContent
from .update_content_direct import UpdateContentDirect
from .update_content_s3 import UpdateContentS3
from .update_screenshots import UpdateScreenshots
from .upload_content_screenshot import UploadContentScreenshot
| 42.21875 | 82 | 0.863064 | 159 | 1,351 | 6.993711 | 0.591195 | 0.044964 | 0.030576 | 0.044964 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019576 | 0.092524 | 1,351 | 31 | 83 | 43.580645 | 0.887439 | 0.266469 | 0 | 0 | 1 | 0 | 0.031665 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.833333 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
abe3a6fd7ed47a44f89a2d80b69ab44a067d088b | 3,140 | py | Python | tests/serialise/json-serialise/run.py | jonnyrocks/pyangbind | 7a7c6df6ddad7cbec941800431840253b5e2f186 | [
"Apache-2.0"
] | 176 | 2015-06-17T15:44:07.000Z | 2022-03-18T01:16:19.000Z | tests/serialise/json-serialise/run.py | jonnyrocks/pyangbind | 7a7c6df6ddad7cbec941800431840253b5e2f186 | [
"Apache-2.0"
] | 245 | 2015-05-29T07:04:13.000Z | 2022-03-25T14:44:37.000Z | tests/serialise/json-serialise/run.py | jonnyrocks/pyangbind | 7a7c6df6ddad7cbec941800431840253b5e2f186 | [
"Apache-2.0"
] | 118 | 2015-07-02T07:04:36.000Z | 2022-03-31T20:32:38.000Z | #!/usr/bin/env python
import json
import os.path
import unittest
from decimal import Decimal
import six
from bitarray import bitarray
from pyangbind.lib.pybindJSON import dumps
from pyangbind.lib.xpathhelper import YANGPathHelper
from tests.base import PyangBindTestCase
class JSONSerialiseTests(PyangBindTestCase):
yang_files = ["json-serialise.yang"]
pyang_flags = ["--use-xpathhelper"]
def setUp(self):
self.yang_helper = YANGPathHelper()
self.serialise_obj = self.bindings.json_serialise(path_helper=self.yang_helper)
def test_serialise_container(self):
self.serialise_obj.two.string_test = "twenty-two"
with open(os.path.join(os.path.dirname(__file__), "json", "container.json"), "r") as fp:
self.assertEqual(
json.loads(dumps(self.yang_helper.get("/two")[0])),
json.load(fp),
"Invalid output returned when serialising a container.",
)
def test_full_serialise(self):
self.serialise_obj.c1.l1.add(1)
for signed in ["int", "uint"]:
for size in [8, 16, 32, 64]:
name = "%s%s" % (signed, size)
setter = getattr(self.serialise_obj.c1.l1[1], "_set_%s" % name)
setter(1)
self.serialise_obj.c1.l1[1].restricted_integer = 6
self.serialise_obj.c1.l1[1].string = "bear"
self.serialise_obj.c1.l1[1].restricted_string = "aardvark"
self.serialise_obj.c1.l1[1].union = 16
self.serialise_obj.c1.l1[1].union_list.append(16)
self.serialise_obj.c1.l1[1].union_list.append("chicken")
self.serialise_obj.c1.t1.add(16)
self.serialise_obj.c1.t1.add(32)
self.serialise_obj.c1.l1[1].leafref = 16
self.serialise_obj.c1.l1[1].binary = bitarray("010101")
self.serialise_obj.c1.l1[1].boolean = True
self.serialise_obj.c1.l1[1].enumeration = "one"
self.serialise_obj.c1.l1[1].identityref = "idone"
self.serialise_obj.c1.l1[1].typedef_one = "test"
self.serialise_obj.c1.l1[1].typedef_two = 8
self.serialise_obj.c1.l1[1].one_leaf = "hi"
for i in range(1, 5):
self.serialise_obj.c1.l1[1].ll.append(six.text_type(i))
self.serialise_obj.c1.l1[1].next_hop.append("DROP")
self.serialise_obj.c1.l1[1].next_hop.append("192.0.2.1")
self.serialise_obj.c1.l1[1].next_hop.append("fish")
self.serialise_obj.c1.l1[1].typedef_decimal = Decimal("21.21")
self.serialise_obj.c1.l1[1].range_decimal = Decimal("4.44443322")
self.serialise_obj.c1.l1[1].typedef_decimalrange = Decimal("42.42")
self.serialise_obj.c1.l1[1].decleaf = Decimal("42.4422")
for i in range(1, 10):
self.serialise_obj.c1.l2.add(i)
pybind_json = json.loads(dumps(self.serialise_obj))
with open(os.path.join(os.path.dirname(__file__), "json", "expected-output.json"), "r") as fp:
external_json = json.load(fp)
self.assertEqual(pybind_json, external_json, "JSON did not match expected output.")
if __name__ == "__main__":
unittest.main()
| 39.746835 | 102 | 0.647452 | 449 | 3,140 | 4.35412 | 0.291759 | 0.199488 | 0.245524 | 0.248593 | 0.400512 | 0.376982 | 0.246036 | 0.130946 | 0.130946 | 0.078772 | 0 | 0.05623 | 0.212739 | 3,140 | 78 | 103 | 40.25641 | 0.734628 | 0.006369 | 0 | 0 | 0 | 0 | 0.093299 | 0 | 0 | 0 | 0 | 0 | 0.031746 | 1 | 0.047619 | false | 0 | 0.142857 | 0 | 0.238095 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
abeaab50c441741c2bb91e2f8fd9004dee8e7803 | 3,803 | py | Python | blog/migrations/0001_initial.py | zzhouly/django_diy_blog | 2671243c59b99f44947ccd5033296492dea9d5da | [
"Apache-2.0"
] | null | null | null | blog/migrations/0001_initial.py | zzhouly/django_diy_blog | 2671243c59b99f44947ccd5033296492dea9d5da | [
"Apache-2.0"
] | null | null | null | blog/migrations/0001_initial.py | zzhouly/django_diy_blog | 2671243c59b99f44947ccd5033296492dea9d5da | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.4 on 2021-09-24 07:13
import ckeditor.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Blog',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('description', ckeditor.fields.RichTextField(blank=True, null=True)),
('post_date', models.DateTimeField(auto_now_add=True)),
('category', models.CharField(default='coding', max_length=200)),
('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('likes', models.ManyToManyField(related_name='blog_posts', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['-post_date'],
},
),
migrations.CreateModel(
name='Category',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
],
),
migrations.CreateModel(
name='Profile',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('bio', models.TextField()),
('profile_image', models.ImageField(blank=True, null=True, upload_to='images/profile')),
('website_url', models.CharField(blank=True, max_length=200, null=True)),
('facebook_url', models.CharField(blank=True, max_length=200, null=True)),
('twitter_url', models.CharField(blank=True, max_length=200, null=True)),
('insgram_url', models.CharField(blank=True, max_length=200, null=True)),
('github_url', models.CharField(blank=True, max_length=200, null=True)),
('follower', models.ManyToManyField(related_name='follower', to=settings.AUTH_USER_MODEL)),
('following', models.ManyToManyField(related_name='following', to=settings.AUTH_USER_MODEL)),
('user', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Image',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('image', models.ImageField(blank=True, null=True, upload_to='images/')),
('blog', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='blog.blog')),
],
),
migrations.CreateModel(
name='BlogComment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('description', ckeditor.fields.RichTextField(blank=True, null=True)),
('post_date', models.DateTimeField(auto_now_add=True)),
('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
('blog', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.blog')),
],
options={
'ordering': ['post_date'],
},
),
]
| 48.75641 | 132 | 0.597949 | 395 | 3,803 | 5.594937 | 0.227848 | 0.047059 | 0.043439 | 0.066516 | 0.647511 | 0.605882 | 0.605882 | 0.605882 | 0.605882 | 0.605882 | 0 | 0.013864 | 0.260321 | 3,803 | 77 | 133 | 49.38961 | 0.771774 | 0.011833 | 0 | 0.471429 | 1 | 0 | 0.090522 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.057143 | 0 | 0.114286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
abfa39e19546fd9ef4ce8dbb0fc15e1e64639ed6 | 144 | py | Python | 19/01/B_0.py | pylangstudy/201711 | be6222dde61373f67d25a2c926868b602463c5cc | [
"CC0-1.0"
] | null | null | null | 19/01/B_0.py | pylangstudy/201711 | be6222dde61373f67d25a2c926868b602463c5cc | [
"CC0-1.0"
] | 2 | 2017-10-31T23:37:36.000Z | 2017-11-02T23:31:07.000Z | 19/01/B_0.py | pylangstudy/201711 | be6222dde61373f67d25a2c926868b602463c5cc | [
"CC0-1.0"
] | null | null | null | import argparse
parser = argparse.ArgumentParser(prog='PROG', add_help=False)
parser.add_argument('--foo', help='foo help')
parser.print_help()
| 28.8 | 61 | 0.770833 | 20 | 144 | 5.4 | 0.55 | 0.12963 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.069444 | 144 | 4 | 62 | 36 | 0.80597 | 0 | 0 | 0 | 0 | 0 | 0.118056 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
f9f3e2acbf9a5892f84b9c76bbadecf8574c883a | 2,192 | py | Python | ecommerce/orders/views.py | ecanyazgi/Patika-Homework3 | 561a03d4b978176a1bc801a5797cc82f0e61cf08 | [
"MIT"
] | null | null | null | ecommerce/orders/views.py | ecanyazgi/Patika-Homework3 | 561a03d4b978176a1bc801a5797cc82f0e61cf08 | [
"MIT"
] | null | null | null | ecommerce/orders/views.py | ecanyazgi/Patika-Homework3 | 561a03d4b978176a1bc801a5797cc82f0e61cf08 | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from core.mixins import DetailedViewSetMixin
from orders.models import Order, OrderBankAccount, OrderItem, \
BillingAddress, ShippingAddress
from orders.serializers import BillingAddressSerializer, BillingAddressDetailedSerializer, \
ShippingAddressSerializer, ShippingAddressDetailedSerializer, OrderSerializer, \
OrderDetailedSerializer, OrderBankAccountSerializer, OrderBankAccountDetailedSerializer,\
OrderItemSerializer, OrderItemDetailedSerializer
from orders.managers import BillingAddressQuerySet
class BillingAddressViewSet(DetailedViewSetMixin, viewsets.ModelViewSet):
queryset = BillingAddress.objects.action_detailed_list()
serializer_class = BillingAddressSerializer
serializer_action_classes = {
"detailed_list": BillingAddressDetailedSerializer,
"detailed": BillingAddressDetailedSerializer,
}
class ShippingAddressViewSet(DetailedViewSetMixin, viewsets.ModelViewSet):
queryset = ShippingAddress.objects.action_detailed_list()
serializer_class = ShippingAddressSerializer
serializer_action_classes = {
"detailed_list": ShippingAddressDetailedSerializer,
"detailed": ShippingAddressDetailedSerializer,
}
class OrderViewSet(DetailedViewSetMixin, viewsets.ModelViewSet):
queryset = Order.objects.action_detailed_list()
serializer_class = OrderSerializer
serializer_action_classes = {
"detailed_list": OrderDetailedSerializer,
"detailed": OrderDetailedSerializer,
}
class OrderBankAccountViewSet(DetailedViewSetMixin, viewsets.ModelViewSet):
queryset = OrderBankAccount.objects.action_detailed_list()
serializer_class = OrderBankAccountSerializer
serializer_action_classes = {
"detailed_list": OrderBankAccountDetailedSerializer,
"detailed": OrderBankAccountDetailedSerializer,
}
class OrderItemViewSet(DetailedViewSetMixin, viewsets.ModelViewSet):
queryset = OrderItem.objects.action_detailed_list()
serializer_class = OrderItemSerializer
serializer_action_classes = {
"detailed_list": OrderItemDetailedSerializer,
"detailed": OrderItemDetailedSerializer,
}
| 39.854545 | 93 | 0.800182 | 148 | 2,192 | 11.641892 | 0.283784 | 0.069646 | 0.116077 | 0.139292 | 0.217644 | 0.116077 | 0 | 0 | 0 | 0 | 0 | 0 | 0.140055 | 2,192 | 54 | 94 | 40.592593 | 0.914058 | 0 | 0 | 0.113636 | 0 | 0 | 0.047901 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.113636 | 0 | 0.568182 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
f9f473bb650d05526dfcf57cd63fa9522759afda | 2,250 | py | Python | test/test_03_04_signing_up.py | molnarorso/conduit | 69571eb300422fec80d5d57ceb5008539f14ecd0 | [
"MIT"
] | null | null | null | test/test_03_04_signing_up.py | molnarorso/conduit | 69571eb300422fec80d5d57ceb5008539f14ecd0 | [
"MIT"
] | null | null | null | test/test_03_04_signing_up.py | molnarorso/conduit | 69571eb300422fec80d5d57ceb5008539f14ecd0 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
import time
from data import *
class TestSignUp(object):
def setup(self):
browser_options = Options()
browser_options.headless = True
self.driver = webdriver.Chrome(ChromeDriverManager().install(), options=browser_options)
self.driver.get(URL)
self.driver.maximize_window()
self.driver.implicitly_wait(5)
def teardown(self):
time.sleep(0.5)
self.driver.quit()
# Test No.3: Signing up using a non-complying password
def test_sign_up_with_noncomplying_password(self):
self.driver.find_element_by_xpath("//a[normalize-space()='Sign up']").click()
self.driver.find_element_by_xpath("//input[@placeholder='Username']").send_keys(original_username)
self.driver.find_element_by_xpath("//input[@placeholder='Email']").send_keys(fix_email)
self.driver.find_element_by_xpath("//input[@placeholder='Password']").send_keys(non_complying_password)
self.driver.find_element_by_xpath("//button[normalize-space()='Sign up']").click()
time.sleep(2)
assert self.driver.find_element_by_xpath("//div[@class='swal-title']").text == "Registration failed!"
self.driver.find_element_by_xpath("//button[normalize-space()='OK']").click()
# Test No.4: Signing up using a complying password
def test_sign_up_with_complying_password(self):
self.driver.find_element_by_xpath("//a[normalize-space()='Sign up']").click()
self.driver.find_element_by_xpath("//input[@placeholder='Username']").send_keys(original_username)
self.driver.find_element_by_xpath("//input[@placeholder='Email']").send_keys(fix_email)
self.driver.find_element_by_xpath("//input[@placeholder='Password']").send_keys(complying_password)
self.driver.find_element_by_xpath("//button[normalize-space()='Sign up']").click()
time.sleep(4)
assert self.driver.find_element_by_xpath("//div[@class='swal-text']").text == "Your registration was successful!"
self.driver.find_element_by_xpath("//button[normalize-space()='OK']").click()
time.sleep(2)
| 52.325581 | 121 | 0.710222 | 290 | 2,250 | 5.265517 | 0.255172 | 0.124427 | 0.128356 | 0.192534 | 0.637852 | 0.637852 | 0.637852 | 0.59332 | 0.59332 | 0.59332 | 0 | 0.004147 | 0.142667 | 2,250 | 42 | 122 | 53.571429 | 0.787455 | 0.044889 | 0 | 0.342857 | 0 | 0 | 0.229264 | 0.195247 | 0 | 0 | 0 | 0 | 0.057143 | 1 | 0.114286 | false | 0.114286 | 0.142857 | 0 | 0.285714 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
f9faa2fcc714789960b6d5fd4a7c96f066e10615 | 92 | py | Python | mtgproxies/plotting/__init__.py | Buntry/mtg-proxies | dbff7fc9caf984c2c93271ce1b9e8db5114c0f10 | [
"MIT"
] | 10 | 2020-05-17T14:30:10.000Z | 2022-02-11T19:10:20.000Z | mtgproxies/plotting/__init__.py | Buntry/mtg-proxies | dbff7fc9caf984c2c93271ce1b9e8db5114c0f10 | [
"MIT"
] | 11 | 2020-05-01T16:56:23.000Z | 2022-03-30T21:58:32.000Z | mtgproxies/plotting/__init__.py | Buntry/mtg-proxies | dbff7fc9caf984c2c93271ce1b9e8db5114c0f10 | [
"MIT"
] | 2 | 2020-06-12T23:44:10.000Z | 2021-12-13T13:47:29.000Z | from mtgproxies.plotting.splitpages import SplitPages
__all__ = [
'SplitPages',
]
| 15.333333 | 54 | 0.706522 | 8 | 92 | 7.625 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.206522 | 92 | 5 | 55 | 18.4 | 0.835616 | 0 | 0 | 0 | 0 | 0 | 0.114943 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
e60109243b8208165811a47b128762e1bd0bccb6 | 551 | py | Python | test/day_10/test_pt2.py | teagles/teagles-advent-2021 | d49d842663d6382bd0d4d93198ccd66ab68e681b | [
"MIT"
] | null | null | null | test/day_10/test_pt2.py | teagles/teagles-advent-2021 | d49d842663d6382bd0d4d93198ccd66ab68e681b | [
"MIT"
] | null | null | null | test/day_10/test_pt2.py | teagles/teagles-advent-2021 | d49d842663d6382bd0d4d93198ccd66ab68e681b | [
"MIT"
] | null | null | null | import unittest
from test.std_test_utils import STDIOTest
from teagles_advent_2021.day_10.pt2 import main
TEST_INPUT = """[({(<(())[]>[[{[]{<()<>>
[(()[<>])]({[<{<<[]>>(
{([(<{}[<>[]}>{[]{[(<()>
(((({<>}<{<{<>}{[]{[]{}
[[<[([]))<([[{}[[()]]]
[{[{({}]{}}([{[{{{}}([]
{<[[]]>}<{[{[{[]{()[[[]
[<(<(<(<{}))><([]([]()
<{([([[(<>()){}]>(<<{{
<{([{{}}[<[[[<>{}]]]>[]]
"""
class TestDay10Part2(STDIOTest):
def test_with_sample_input(self):
self.assert_stdin_n_out(main, TEST_INPUT, "288957\n")
if __name__ == '__main__':
unittest.main()
| 21.192308 | 61 | 0.422868 | 44 | 551 | 4.818182 | 0.636364 | 0.075472 | 0.122642 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032389 | 0.103448 | 551 | 25 | 62 | 22.04 | 0.396761 | 0 | 0 | 0 | 0 | 0 | 0.462795 | 0.415608 | 0 | 0 | 0 | 0 | 0.052632 | 1 | 0.052632 | false | 0 | 0.157895 | 0 | 0.263158 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
e60ef9e053a01a68ea7fbe342ab1d7158c8efb3f | 2,348 | py | Python | IndieEngine/__init__.py | NotSujal/Indie | 36af87f89675c6aa2726bed307c79191477bac43 | [
"MIT"
] | 1 | 2021-08-18T02:51:14.000Z | 2021-08-18T02:51:14.000Z | IndieEngine/__init__.py | NotSujal/Indie | 36af87f89675c6aa2726bed307c79191477bac43 | [
"MIT"
] | null | null | null | IndieEngine/__init__.py | NotSujal/Indie | 36af87f89675c6aa2726bed307c79191477bac43 | [
"MIT"
] | null | null | null | # coding: ascii
# indieEngine - Indie Engine Library, made with pygame
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the MIT
# License as published by the Free Software Foundation;
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MIT
# License for more details.
#
# You should have received a copy of the MIT
# License along with this library;
# Sujal Choudhari
# https://notsujal.github.io
"""INDIE Engine is a set of Python modules designed for writing games.
It is written on top of the excellent Pygame library. This allows you
to create basic games and multimedia programs in the python
language. The package is highly portable, with games running on
Windows, MacOS, OS X, BeOS, FreeBSD, IRIX, and Linux, as defined by pygame module"""
try:
from .app import *
from .button import BUTTON as Button
from .character_controller import CHARACTER_CONTROLLER as Character_Controller
from .colour import COLOUR as Colour
from .files import FILE as File
from .font import FONT as Font
from .gameobject import GAMEOBJECT as GameObject
from .image import IMAGE as Image
from .input_feild import INPUTFEILD as InputFeild
from .inputs import KEY as Key
from .inputs import EVENT as Event
from .panel import PANEL as Panel
from .physics import *
from .physics import VECTOR as Vector
from .physics import QUAD as Quad
from .sound_manager import SOUND as Sound
from .sound_manager import MUSIC as Music
from .spritesheet import SPRITESHEET as Spritesheet
from .spritestrip_animation import SPRITESTRIP_ANIMATION as Spritestrip_animation
from .text import TEXT as Text
from .tilemap import TILEMAP as Tilemap
from .transform import TRANSFORM as Transform
# editor
# from .editor_classes import WINDOW as Window
# from .editor_classes import INSPECTOR as Inspector
# from .editor_classes import NAVBAR as Navbar
# from .editor_classes import DROPDOWN as Dropdown
# from .editor_classes import NEWPROJECT as NewProject
except Exception as e:
print(e)
print("\n\n\nThanks for using IndieEngine. https://github.com/NotSujal/Indie \n\n\n")
| 39.133333 | 85 | 0.756388 | 344 | 2,348 | 5.122093 | 0.409884 | 0.028377 | 0.048241 | 0.065267 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.198893 | 2,348 | 59 | 86 | 39.79661 | 0.936736 | 0.491482 | 0 | 0 | 0 | 0.038462 | 0.06518 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.846154 | 0 | 0.846154 | 0.076923 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
e611d0bd3ca40bb74eb931e9c8a4ed62927f010e | 34,626 | py | Python | pysnmp-with-texts/CISCO-MMAIL-DIAL-CONTROL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/CISCO-MMAIL-DIAL-CONTROL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/CISCO-MMAIL-DIAL-CONTROL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-MMAIL-DIAL-CONTROL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-MMAIL-DIAL-CONTROL-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:07:42 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint")
cCallHistoryIndex, = mibBuilder.importSymbols("CISCO-DIAL-CONTROL-MIB", "cCallHistoryIndex")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
CvcGUid, = mibBuilder.importSymbols("CISCO-VOICE-COMMON-DIAL-CONTROL-MIB", "CvcGUid")
callActiveIndex, AbsoluteCounter32, callActiveSetupTime = mibBuilder.importSymbols("DIAL-CONTROL-MIB", "callActiveIndex", "AbsoluteCounter32", "callActiveSetupTime")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance")
IpAddress, Integer32, Counter32, Bits, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, Counter64, ModuleIdentity, ObjectIdentity, Gauge32, iso, Unsigned32, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "Integer32", "Counter32", "Bits", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "Counter64", "ModuleIdentity", "ObjectIdentity", "Gauge32", "iso", "Unsigned32", "TimeTicks")
TruthValue, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "TextualConvention", "DisplayString")
ciscoMediaMailDialControlMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 102))
ciscoMediaMailDialControlMIB.setRevisions(('2002-02-25 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ciscoMediaMailDialControlMIB.setRevisionsDescriptions(('Fix for CSCdu86743 and CSCdu86778. The change include: - DEFVAL for cmmIpPeerCfgDeliStatNotification - Add dsnMdn option for cmmIpCallActiveNotification and cmmIpCallHistoryNotification - Object descriptor name change due to length exceeding 32. These are : cmmIpPeerCfgDeliStatNotification cmmIpCallHistoryAcceptMimeTypes cmmIpCallHistoryDiscdMimeTypes - All the lines exceed length 72 are being rewitten ',))
if mibBuilder.loadTexts: ciscoMediaMailDialControlMIB.setLastUpdated('200202250000Z')
if mibBuilder.loadTexts: ciscoMediaMailDialControlMIB.setOrganization('Cisco Systems, Inc.')
if mibBuilder.loadTexts: ciscoMediaMailDialControlMIB.setContactInfo(' Cisco Systems Customer Service Postal: 170 W. Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-voice@cisco.com')
if mibBuilder.loadTexts: ciscoMediaMailDialControlMIB.setDescription('This MIB module enhances the IETF Dial Control MIB (RFC2128) for providing management of dial peers on both a circuit-switched telephony network, and a mail server on IP network. ')
class CmmImgResolution(TextualConvention, Integer32):
reference = 'RFC2301: Section 4.5.2 Encoding and Resolution.'
description = 'Represents possible image resolution in Media Mail. standard - standard resolution. fine - fine resolution. superFine - super fine resolution. '
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(2, 3, 4))
namedValues = NamedValues(("standard", 2), ("fine", 3), ("superFine", 4))
class CmmImgResolutionOrTransparent(TextualConvention, Integer32):
reference = 'RFC2301: Section 4.5.2 Encoding and Resolution.'
description = 'Represents possible image resolution and transparent mode. transparent - pass through mode. standard - standard resolution. fine - fine resolution. superFine - super fine resolution. '
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))
namedValues = NamedValues(("transparent", 1), ("standard", 2), ("fine", 3), ("superFine", 4))
class CmmImgEncoding(TextualConvention, Integer32):
reference = 'RFC2301: Section 1.3 Overview of this draft. ITU-T Rec. T.4 (MH - Modified Huffman). ITU-T Rec. T.4 (MR - Modified READ). ITU-T Rec. T.6 (MRR - Modified MR). '
description = 'Represents possible image encoding types in Media Mail. modifiedHuffman - Modified Huffman (MH). modifiedREAD - Modified READ (MR). modifiedMR - Modified Modified READ (MMR). '
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(2, 3, 4))
namedValues = NamedValues(("modifiedHuffman", 2), ("modifiedREAD", 3), ("modifiedMR", 4))
class CmmImgEncodingOrTransparent(TextualConvention, Integer32):
reference = 'RFC2301: Section 1.3 Overview of this draft. ITU-T Rec. T.4 (MH - Modified Huffman). ITU-T Rec. T.4 (MR - Modified READ). ITU-T Rec. T.6 (MRR - Modified MR). '
description = 'Represents possible image encoding types and transparent mode. transparent - pass through mode. modifiedHuffman - Modified Huffman (MH). modifiedREAD - Modified READ (MR). modifiedMR - Modified Modified READ (MMR). '
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))
namedValues = NamedValues(("transparent", 1), ("modifiedHuffman", 2), ("modifiedREAD", 3), ("modifiedMR", 4))
class CmmFaxHeadingString(DisplayString):
description = "The regular expression for the FAX heading at the top of cover page or text page. The regular expression syntax used in this object is the same as that used by the UNIX grep program. The embedded pattern substitutions are defined as follows: $p$ - translates to the page number as passed by FAX processing. $a$ - translates to human readable year-month-day that is defined in DateAndTime of SNMPv2-TC. $d$ - translates to the called party address. $s$ - translates to the calling party address. $t$ - translates to the time of transmission of the first FAX/image page. The human readable format is defined as year-month-day,hour:minutes:second in the DateAndTime of SNMPv2-TC. Example, 'Date:$a$' means replacing the heading of a FAX page with the the string and date substitution. 'From $s$ Broadcast Service' means replacing the heading of FAX page with the the string and calling party address substitution. 'Page:$p$' means replacing the heading of a FAX page with the string and page number substitution. "
status = 'current'
subtypeSpec = DisplayString.subtypeSpec + ValueSizeConstraint(0, 80)
cmmdcMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 102, 1))
cmmPeer = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 1))
cmmCallActive = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2))
cmmCallHistory = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3))
cmmFaxGeneralCfg = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 4))
cmmIpPeerCfgTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 1, 1), )
if mibBuilder.loadTexts: cmmIpPeerCfgTable.setStatus('current')
if mibBuilder.loadTexts: cmmIpPeerCfgTable.setDescription('The table contains the Media mail peer specific information that is required to accept mail connection or to which it will connect them via IP network with the specified session protocol in cmmIpPeerCfgSessionProtocol. ')
cmmIpPeerCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: cmmIpPeerCfgEntry.setStatus('current')
if mibBuilder.loadTexts: cmmIpPeerCfgEntry.setDescription("A single Media Mail specific Peer. One entry per media mail encapsulation. The entry is created when its associated 'mediaMailOverIp(139)' encapsulation ifEntry is created. This entry is deleted when its associated ifEntry is deleted. ")
cmmIpPeerCfgSessionProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("smtp", 1))).clone('smtp')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmIpPeerCfgSessionProtocol.setStatus('current')
if mibBuilder.loadTexts: cmmIpPeerCfgSessionProtocol.setDescription('The object specifies the session protocol to be used for sending/receiving media mail between local and remote mail sever via IP network. smtp - Simple Mail Transfer Protocol. ')
cmmIpPeerCfgSessionTarget = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 1, 1, 1, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmIpPeerCfgSessionTarget.setStatus('current')
if mibBuilder.loadTexts: cmmIpPeerCfgSessionTarget.setDescription('The object specifies the session target of the peer. Session Targets definitions: The session target has the syntax used by the IETF service location protocol. The syntax is as follows: mapping-type:type-specific-syntax The mapping-type specifies a scheme for mapping the matching dial string to a session target. The type-specific-syntax is exactly that, something that the particular mapping scheme can understand. For example, Session target mailto:+$d$@fax.cisco.com The valid Mapping type definitions for the peer are as follows: mailto - Syntax: mailto:w@x.y.z ')
cmmIpPeerCfgImgEncodingType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 1, 1, 1, 3), CmmImgEncodingOrTransparent().clone('transparent')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmIpPeerCfgImgEncodingType.setStatus('current')
if mibBuilder.loadTexts: cmmIpPeerCfgImgEncodingType.setDescription("This object specifies the image encoding conversion for outgoing mail connection to mail server. If the value of this object is transparent, it means 'pass through' without encoding conversion. ")
cmmIpPeerCfgImgResolution = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 1, 1, 1, 4), CmmImgResolutionOrTransparent().clone('transparent')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmIpPeerCfgImgResolution.setStatus('current')
if mibBuilder.loadTexts: cmmIpPeerCfgImgResolution.setDescription("This object specifies the image resolution conversion for outgoing mail connection to mail server. If the value of this object is transparent, it means 'pass through' without resolution conversion. ")
cmmIpPeerCfgMsgDispoNotification = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 1, 1, 1, 5), TruthValue().clone('false')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmIpPeerCfgMsgDispoNotification.setStatus('current')
if mibBuilder.loadTexts: cmmIpPeerCfgMsgDispoNotification.setDescription('This object specifies the Request of Message Disposition Notification. true - Request Message Disposition Notification. false - No Message Disposition Notification. ')
cmmIpPeerCfgDeliStatNotification = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 1, 1, 1, 6), Bits().clone(namedValues=NamedValues(("success", 0), ("failure", 1), ("delayed", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmIpPeerCfgDeliStatNotification.setStatus('current')
if mibBuilder.loadTexts: cmmIpPeerCfgDeliStatNotification.setDescription('This object specifies the Request of Delivery Status Notification. success - Request Notification if the media mail is successfully delivered to the recipient. failure - Request Notification if the media mail is failed to deliver to the recipient. delayed - Request Notification if the media mail is delayed to deliver to the recipient. ')
cmmIpCallActiveTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1), )
if mibBuilder.loadTexts: cmmIpCallActiveTable.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveTable.setDescription('This table is the Media Mail over IP extension to the call active table of IETF Dial Control MIB. It contains Media Mail over IP call leg information. ')
cmmIpCallActiveEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1, 1), ).setIndexNames((0, "DIAL-CONTROL-MIB", "callActiveSetupTime"), (0, "DIAL-CONTROL-MIB", "callActiveIndex"))
if mibBuilder.loadTexts: cmmIpCallActiveEntry.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveEntry.setDescription('The information regarding a single Media mail over IP call leg. The call leg entry is identified by using the same index objects that are used by Call Active table of IETF Dial Control MIB to identify the call. An entry of this table is created when its associated call active entry in the IETF Dial Control MIB is created and the call active entry contains information for the call establishment to the mail server peer on the IP network via a Media Mail over IP peer. The entry is deleted when its associated call active entry in the IETF Dial Control MIB is deleted. ')
cmmIpCallActiveConnectionId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1, 1, 1), CvcGUid()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallActiveConnectionId.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveConnectionId.setDescription('The global call identifier for the gateway call.')
cmmIpCallActiveRemoteIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1, 1, 2), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallActiveRemoteIPAddress.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveRemoteIPAddress.setDescription('Remote mail server IP address for the Media mail call. ')
cmmIpCallActiveSessionProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("smtp", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallActiveSessionProtocol.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveSessionProtocol.setDescription('The object specifies the session protocol to be used for the media mail call between local and remote mail server via IP network. ')
cmmIpCallActiveSessionTarget = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallActiveSessionTarget.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveSessionTarget.setDescription('The object specifies the session target of the peer that is used for the call. This object is set with the information in the call associated cmmIpPeerCfgSessionTarget object when the media mail call is connected. ')
cmmIpCallActiveMessageId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1, 1, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallActiveMessageId.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveMessageId.setDescription('The global unique message identification of the Media mail. ')
cmmIpCallActiveAccountId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1, 1, 6), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallActiveAccountId.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveAccountId.setDescription('The Account ID of Media mail.')
cmmIpCallActiveImgEncodingType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1, 1, 7), CmmImgEncoding()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallActiveImgEncodingType.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveImgEncodingType.setDescription('The image encoding type of Media mail.')
cmmIpCallActiveImgResolution = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1, 1, 8), CmmImgResolution()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallActiveImgResolution.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveImgResolution.setDescription('The image resolution of Media mail.')
cmmIpCallActiveAcceptMimeTypes = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1, 1, 9), AbsoluteCounter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallActiveAcceptMimeTypes.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveAcceptMimeTypes.setDescription('The number of accepted MIME types for the Media mail call. ')
cmmIpCallActiveDiscdMimeTypes = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1, 1, 10), AbsoluteCounter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallActiveDiscdMimeTypes.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveDiscdMimeTypes.setDescription('The number of discarded MIME types for the Media mail call. ')
cmmIpCallActiveNotification = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("mdn", 2), ("dsn", 3), ("dsnMdn", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallActiveNotification.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallActiveNotification.setDescription('The notification type of the Media mail call. none - No notification. mdn - Message Disposition notification. dsn - Delivery Status notification. dsnMdn - Both Delivery Status and Message Disposition notification ')
cmmIpCallHistoryTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1), )
if mibBuilder.loadTexts: cmmIpCallHistoryTable.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistoryTable.setDescription('This table is the Media Mail extension to the call history table of IETF Dial Control MIB. It contains Media Mail call leg information about specific Media mail gateway call. ')
cmmIpCallHistoryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1, 1), ).setIndexNames((0, "CISCO-DIAL-CONTROL-MIB", "cCallHistoryIndex"))
if mibBuilder.loadTexts: cmmIpCallHistoryEntry.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistoryEntry.setDescription('The information regarding a single Media Mail call leg. The call leg entry is identified by using the same index objects that are used by Call Active table of IETF Dial Control MIB to identify the call. An entry of this table is created when its associated call history entry in the IETF Dial Control MIB is created and the call history entry contains information for the call establishment to the mail server on the IP network via a Media Mail over IP peer. The entry is deleted when its associated call history entry in the IETF Dial Control MIB is deleted. ')
cmmIpCallHistoryConnectionId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1, 1, 1), CvcGUid()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallHistoryConnectionId.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistoryConnectionId.setDescription('The global call identifier for the gateway call.')
cmmIpCallHistoryRemoteIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1, 1, 2), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallHistoryRemoteIPAddress.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistoryRemoteIPAddress.setDescription('Remote mail server IP address for the media mail call. ')
cmmIpCallHistorySessionProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("smtp", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallHistorySessionProtocol.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistorySessionProtocol.setDescription('The object specifies the session protocol to be used for the media mail call between local and remote mail server via IP network. ')
cmmIpCallHistorySessionTarget = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallHistorySessionTarget.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistorySessionTarget.setDescription('The object specifies the session target of the peer that is used for the call. This object is set with the information in the call associated cmmIpPeerCfgSessionTarget object when the media mail call is connected. ')
cmmIpCallHistoryMessageId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1, 1, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallHistoryMessageId.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistoryMessageId.setDescription('The global unique message identification of the Media mail. ')
cmmIpCallHistoryAccountId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1, 1, 6), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallHistoryAccountId.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistoryAccountId.setDescription('The Account ID of Media mail.')
cmmIpCallHistoryImgEncodingType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1, 1, 7), CmmImgEncoding()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallHistoryImgEncodingType.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistoryImgEncodingType.setDescription('The image encoding type of Media mail.')
cmmIpCallHistoryImgResolution = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1, 1, 8), CmmImgResolution()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallHistoryImgResolution.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistoryImgResolution.setDescription('The image resolution of Media mail.')
cmmIpCallHistoryAcceptMimeTypes = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1, 1, 9), AbsoluteCounter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallHistoryAcceptMimeTypes.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistoryAcceptMimeTypes.setDescription('The number of accepted MIME types for the Media mail call. ')
cmmIpCallHistoryDiscdMimeTypes = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1, 1, 10), AbsoluteCounter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallHistoryDiscdMimeTypes.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistoryDiscdMimeTypes.setDescription('The number of discarded MIME types for the Media mail call. ')
cmmIpCallHistoryNotification = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 3, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("mdn", 2), ("dsn", 3), ("dsnMdn", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cmmIpCallHistoryNotification.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallHistoryNotification.setDescription('The notification type of the Media mail call. none - No notification. mdn - Message Disposition notification. dsn - Delivery Status notification. dsnMdn - Both Delivery Status and Message Disposition notification ')
cmmFaxCfgCalledSubscriberId = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 4, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmFaxCfgCalledSubscriberId.setReference('ITU-T T30: Section 5.3.6.2.4 CSI coding format. ')
if mibBuilder.loadTexts: cmmFaxCfgCalledSubscriberId.setStatus('current')
if mibBuilder.loadTexts: cmmFaxCfgCalledSubscriberId.setDescription('The regular expression for the FAX called subscriber identification (CSI) coding format. $d$ in the regular expression substitute CSI with the destination number of the call. ')
cmmFaxCfgXmitSubscriberId = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 4, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmFaxCfgXmitSubscriberId.setReference('ITU-T T30: Section 5.3.6.2.6 TSI coding format. ')
if mibBuilder.loadTexts: cmmFaxCfgXmitSubscriberId.setStatus('current')
if mibBuilder.loadTexts: cmmFaxCfgXmitSubscriberId.setDescription('The regular expression for the FAX Transmitting subscriber identification (TSI) coding format. $s$ in the regular expression substitute TSI with the caller ID of the call. ')
cmmFaxCfgRightHeadingString = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 4, 3), CmmFaxHeadingString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmFaxCfgRightHeadingString.setStatus('current')
if mibBuilder.loadTexts: cmmFaxCfgRightHeadingString.setDescription('The regular expression for the FAX right heading at the top of cover page or text page. The default value of this object is an empty string. ')
cmmFaxCfgCenterHeadingString = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 4, 4), CmmFaxHeadingString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmFaxCfgCenterHeadingString.setStatus('current')
if mibBuilder.loadTexts: cmmFaxCfgCenterHeadingString.setDescription('The regular expression for the FAX center heading at the top of cover page or text page. The default value of this object is an empty string. ')
cmmFaxCfgLeftHeadingString = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 4, 5), CmmFaxHeadingString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmFaxCfgLeftHeadingString.setStatus('current')
if mibBuilder.loadTexts: cmmFaxCfgLeftHeadingString.setDescription('The regular expression for the FAX left heading at the top of cover page or text page. The default value of this object is an empty string. ')
cmmFaxCfgCovergPageControl = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 4, 6), Bits().clone(namedValues=NamedValues(("coverPageEnable", 0), ("coverPageCtlByEmail", 1), ("coverPageDetailEnable", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmFaxCfgCovergPageControl.setStatus('current')
if mibBuilder.loadTexts: cmmFaxCfgCovergPageControl.setDescription('The object controls the generation of cover page of FAX. coverPageEnable - enable the managed system to generate the FAX cover page. coverPageCtlByEmail - allow email to control the FAX cover page generation. coverPageDetailEnable- enable the detailed mail header on the cover page. ')
cmmFaxCfgCovergPageComment = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 4, 7), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmFaxCfgCovergPageComment.setStatus('current')
if mibBuilder.loadTexts: cmmFaxCfgCovergPageComment.setDescription('The object contains the comment on the FAX cover page. ')
cmmFaxCfgFaxProfile = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 102, 1, 4, 8), Bits().clone(namedValues=NamedValues(("profileS", 0), ("profileF", 1), ("profileJ", 2), ("profileC", 3), ("profileL", 4), ("profileM", 5)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cmmFaxCfgFaxProfile.setReference('RFC 2301: Section 2.2.4 New TIFF fields recommended for fax modes. ')
if mibBuilder.loadTexts: cmmFaxCfgFaxProfile.setStatus('current')
if mibBuilder.loadTexts: cmmFaxCfgFaxProfile.setDescription('The profile that applies to TIFF file for facsimile. The default value of this object is profileF. ')
cmmdcMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 102, 3))
cmmdcMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 102, 3, 1))
cmmdcMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 102, 3, 2))
cmmdcMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 102, 3, 1, 1)).setObjects(("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmdcPeerCfgGroup"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallGeneralGroup"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallImageGroup"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmFaxGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cmmdcMIBCompliance = cmmdcMIBCompliance.setStatus('current')
if mibBuilder.loadTexts: cmmdcMIBCompliance.setDescription('The compliance statement for entities which implement the CISCO MMAIL DIAL CONTROL MIB')
cmmdcPeerCfgGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 102, 3, 2, 1)).setObjects(("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpPeerCfgSessionProtocol"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpPeerCfgSessionTarget"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpPeerCfgImgEncodingType"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpPeerCfgImgResolution"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpPeerCfgMsgDispoNotification"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpPeerCfgDeliStatNotification"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cmmdcPeerCfgGroup = cmmdcPeerCfgGroup.setStatus('current')
if mibBuilder.loadTexts: cmmdcPeerCfgGroup.setDescription('A collection of objects providing the Media Mail Dial Control configuration capability. ')
cmmIpCallGeneralGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 102, 3, 2, 2)).setObjects(("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallActiveConnectionId"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallActiveRemoteIPAddress"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallActiveSessionProtocol"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallActiveSessionTarget"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallActiveMessageId"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallActiveAccountId"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallActiveAcceptMimeTypes"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallActiveDiscdMimeTypes"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallActiveNotification"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallHistoryConnectionId"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallHistoryRemoteIPAddress"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallHistorySessionProtocol"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallHistorySessionTarget"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallHistoryMessageId"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallHistoryAccountId"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallHistoryAcceptMimeTypes"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallHistoryDiscdMimeTypes"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallHistoryNotification"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cmmIpCallGeneralGroup = cmmIpCallGeneralGroup.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallGeneralGroup.setDescription('A collection of objects providing the General Media Mail Call capability. ')
cmmIpCallImageGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 102, 3, 2, 3)).setObjects(("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallActiveImgEncodingType"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallActiveImgResolution"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallHistoryImgEncodingType"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmIpCallHistoryImgResolution"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cmmIpCallImageGroup = cmmIpCallImageGroup.setStatus('current')
if mibBuilder.loadTexts: cmmIpCallImageGroup.setDescription('A collection of objects providing the Image related Media Mail Call capability. ')
cmmFaxGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 102, 3, 2, 4)).setObjects(("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmFaxCfgCalledSubscriberId"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmFaxCfgXmitSubscriberId"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmFaxCfgRightHeadingString"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmFaxCfgCenterHeadingString"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmFaxCfgLeftHeadingString"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmFaxCfgCovergPageControl"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmFaxCfgCovergPageComment"), ("CISCO-MMAIL-DIAL-CONTROL-MIB", "cmmFaxCfgFaxProfile"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cmmFaxGroup = cmmFaxGroup.setStatus('current')
if mibBuilder.loadTexts: cmmFaxGroup.setDescription('A collection of objects providing the general FAX configuration capability. ')
mibBuilder.exportSymbols("CISCO-MMAIL-DIAL-CONTROL-MIB", cmmIpCallGeneralGroup=cmmIpCallGeneralGroup, cmmIpCallHistoryConnectionId=cmmIpCallHistoryConnectionId, cmmIpPeerCfgSessionProtocol=cmmIpPeerCfgSessionProtocol, cmmIpCallHistoryImgResolution=cmmIpCallHistoryImgResolution, cmmIpCallImageGroup=cmmIpCallImageGroup, cmmIpPeerCfgImgResolution=cmmIpPeerCfgImgResolution, cmmFaxCfgCalledSubscriberId=cmmFaxCfgCalledSubscriberId, cmmFaxCfgCenterHeadingString=cmmFaxCfgCenterHeadingString, cmmIpCallActiveSessionTarget=cmmIpCallActiveSessionTarget, cmmFaxGeneralCfg=cmmFaxGeneralCfg, cmmIpCallHistoryRemoteIPAddress=cmmIpCallHistoryRemoteIPAddress, cmmdcMIBObjects=cmmdcMIBObjects, cmmIpCallActiveDiscdMimeTypes=cmmIpCallActiveDiscdMimeTypes, CmmImgResolution=CmmImgResolution, cmmIpCallActiveNotification=cmmIpCallActiveNotification, cmmFaxGroup=cmmFaxGroup, cmmIpPeerCfgSessionTarget=cmmIpPeerCfgSessionTarget, cmmIpCallActiveImgEncodingType=cmmIpCallActiveImgEncodingType, cmmIpCallHistorySessionTarget=cmmIpCallHistorySessionTarget, cmmIpCallHistoryEntry=cmmIpCallHistoryEntry, cmmIpCallActiveAccountId=cmmIpCallActiveAccountId, cmmFaxCfgRightHeadingString=cmmFaxCfgRightHeadingString, cmmFaxCfgCovergPageComment=cmmFaxCfgCovergPageComment, ciscoMediaMailDialControlMIB=ciscoMediaMailDialControlMIB, PYSNMP_MODULE_ID=ciscoMediaMailDialControlMIB, cmmIpCallActiveRemoteIPAddress=cmmIpCallActiveRemoteIPAddress, cmmIpCallActiveEntry=cmmIpCallActiveEntry, cmmIpCallActiveSessionProtocol=cmmIpCallActiveSessionProtocol, cmmIpCallHistoryAcceptMimeTypes=cmmIpCallHistoryAcceptMimeTypes, cmmIpCallHistorySessionProtocol=cmmIpCallHistorySessionProtocol, cmmPeer=cmmPeer, cmmFaxCfgLeftHeadingString=cmmFaxCfgLeftHeadingString, cmmIpPeerCfgDeliStatNotification=cmmIpPeerCfgDeliStatNotification, cmmCallActive=cmmCallActive, cmmIpCallActiveAcceptMimeTypes=cmmIpCallActiveAcceptMimeTypes, cmmFaxCfgCovergPageControl=cmmFaxCfgCovergPageControl, cmmdcMIBConformance=cmmdcMIBConformance, CmmImgEncoding=CmmImgEncoding, cmmFaxCfgFaxProfile=cmmFaxCfgFaxProfile, cmmIpPeerCfgEntry=cmmIpPeerCfgEntry, cmmIpCallHistoryDiscdMimeTypes=cmmIpCallHistoryDiscdMimeTypes, cmmdcPeerCfgGroup=cmmdcPeerCfgGroup, CmmImgEncodingOrTransparent=CmmImgEncodingOrTransparent, cmmIpCallHistoryImgEncodingType=cmmIpCallHistoryImgEncodingType, cmmIpPeerCfgTable=cmmIpPeerCfgTable, cmmdcMIBCompliances=cmmdcMIBCompliances, cmmIpPeerCfgMsgDispoNotification=cmmIpPeerCfgMsgDispoNotification, cmmIpPeerCfgImgEncodingType=cmmIpPeerCfgImgEncodingType, cmmIpCallHistoryTable=cmmIpCallHistoryTable, CmmImgResolutionOrTransparent=CmmImgResolutionOrTransparent, cmmFaxCfgXmitSubscriberId=cmmFaxCfgXmitSubscriberId, cmmdcMIBCompliance=cmmdcMIBCompliance, cmmIpCallActiveImgResolution=cmmIpCallActiveImgResolution, cmmIpCallActiveMessageId=cmmIpCallActiveMessageId, cmmdcMIBGroups=cmmdcMIBGroups, cmmIpCallHistoryAccountId=cmmIpCallHistoryAccountId, cmmCallHistory=cmmCallHistory, cmmIpCallActiveTable=cmmIpCallActiveTable, cmmIpCallHistoryNotification=cmmIpCallHistoryNotification, cmmIpCallActiveConnectionId=cmmIpCallActiveConnectionId, CmmFaxHeadingString=CmmFaxHeadingString, cmmIpCallHistoryMessageId=cmmIpCallHistoryMessageId)
| 157.390909 | 3,184 | 0.791342 | 4,001 | 34,626 | 6.848038 | 0.128718 | 0.042483 | 0.074346 | 0.008175 | 0.516734 | 0.394941 | 0.366108 | 0.321399 | 0.310011 | 0.266616 | 0 | 0.03736 | 0.098654 | 34,626 | 219 | 3,185 | 158.109589 | 0.840532 | 0.010108 | 0 | 0.092683 | 0 | 0.165854 | 0.412 | 0.078355 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.02439 | 0.053659 | 0 | 0.190244 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
e61205ff35f5843b1c3acd0dc395548ac3a6acba | 759 | py | Python | cassiopeia/core/staticdata/language.py | artemigkh/cassiopeia | fa78cb8f86ea21857916a707d04de6a05498033e | [
"MIT"
] | 1 | 2021-09-07T05:26:21.000Z | 2021-09-07T05:26:21.000Z | cassiopeia/core/staticdata/language.py | artemigkh/cassiopeia | fa78cb8f86ea21857916a707d04de6a05498033e | [
"MIT"
] | null | null | null | cassiopeia/core/staticdata/language.py | artemigkh/cassiopeia | fa78cb8f86ea21857916a707d04de6a05498033e | [
"MIT"
] | 1 | 2016-10-20T11:54:20.000Z | 2016-10-20T11:54:20.000Z | from typing import Union
from merakicommons.cache import lazy_property
from ...data import Region, Platform
from ..common import CassiopeiaObject, CoreDataList, CassiopeiaLazyList, provide_default_region
from ...dto.staticdata.language import LanguagesDto
class LanguagesData(CoreDataList):
_dto_type = LanguagesDto
_renamed = {}
class Locales(CassiopeiaLazyList):
_data_types = {LanguagesData}
@provide_default_region
def __init__(self, *, region: Union[Region, str] = None):
CassiopeiaObject.__init__(self, region=region)
@lazy_property
def region(self) -> Region:
return Region(self._data[LanguagesData].region)
@lazy_property
def platform(self) -> Platform:
return self.region.platform
| 26.172414 | 95 | 0.741765 | 81 | 759 | 6.691358 | 0.407407 | 0.073801 | 0.073801 | 0.077491 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172596 | 759 | 28 | 96 | 27.107143 | 0.863057 | 0 | 0 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.157895 | false | 0 | 0.263158 | 0.105263 | 0.789474 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
e61d7a4144e284ae9a43f2e77bb07caeebf14701 | 1,440 | py | Python | core/middleware.py | Chase235/cloudcourse | 3174cd634cdfa8f04476f2206bfe52b0d7090c9c | [
"Apache-2.0"
] | null | null | null | core/middleware.py | Chase235/cloudcourse | 3174cd634cdfa8f04476f2206bfe52b0d7090c9c | [
"Apache-2.0"
] | null | null | null | core/middleware.py | Chase235/cloudcourse | 3174cd634cdfa8f04476f2206bfe52b0d7090c9c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2.4
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Middlewares."""
import logging
from django import http
from core import errors
from core import memcache_wrapper
from core import request_cache
# Suppress pylint unused arg and invalid method name (overriden methods)
# pylint: disable-msg=W0613, C6409
class Cache(object):
"""Middleware to handle caching."""
def process_request(self, request):
request_cache.ClearCache()
return None
def __init__(self):
memcache_wrapper.SetupClient()
class ExceptionHandler(object):
"""Middleware to handle exceptions."""
def process_request(self, request):
errors.ClearExceptions()
return None
def process_exception(self, request, exception):
if not isinstance(exception, http.Http404):
logging.error('Uncaught exception: [%s] %s', type(exception), exception)
return None
| 26.181818 | 78 | 0.745139 | 195 | 1,440 | 5.446154 | 0.605128 | 0.056497 | 0.039548 | 0.030132 | 0.052731 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017529 | 0.168056 | 1,440 | 54 | 79 | 26.666667 | 0.868948 | 0.534722 | 0 | 0.263158 | 0 | 0 | 0.042254 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0 | 0.263158 | 0 | 0.736842 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
e628a0389980ed6cec7ba48c51833fac2dca727d | 753 | bzl | Python | rules/java/artifacts.bzl | leoll2/hyperboria | 30a0ae466b290208f690560160ef1f5c16e4a744 | [
"Unlicense"
] | null | null | null | rules/java/artifacts.bzl | leoll2/hyperboria | 30a0ae466b290208f690560160ef1f5c16e4a744 | [
"Unlicense"
] | null | null | null | rules/java/artifacts.bzl | leoll2/hyperboria | 30a0ae466b290208f690560160ef1f5c16e4a744 | [
"Unlicense"
] | null | null | null | """
Java dependencies
"""
load("@rules_jvm_external//:defs.bzl", "maven_install")
def maven_fetch_remote_artifacts():
"""
Fetch maven artifacts
"""
maven_install(
artifacts = [
"com.fasterxml.jackson.core:jackson-core:2.11.2",
"com.fasterxml.jackson.core:jackson-databind:2.11.2",
"org.apache.pdfbox:pdfbox:2.0.20",
"org.apache.kafka:kafka_2.13:2.6.0",
"org.apache.kafka:kafka-clients:2.6.0",
"org.grobid:grobid-core:0.6.1",
"org.yaml:snakeyaml:1.26",
],
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
"https://dl.bintray.com/rookies/maven",
],
)
| 27.888889 | 65 | 0.551129 | 91 | 753 | 4.472527 | 0.472527 | 0.081081 | 0.093366 | 0.113022 | 0.14742 | 0 | 0 | 0 | 0 | 0 | 0 | 0.053114 | 0.2749 | 753 | 26 | 66 | 28.961538 | 0.692308 | 0.051793 | 0 | 0.111111 | 0 | 0 | 0.549928 | 0.400868 | 0 | 0 | 0 | 0 | 0 | 1 | 0.055556 | true | 0 | 0 | 0 | 0.055556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
e6494d4b8593ce1ed54e2cfca3493784f7201ce5 | 58 | py | Python | name.py | john-klingner/sense-project | da05b9d521f4f9532fb4f75e7ea68b8923f1e268 | [
"CC0-1.0"
] | null | null | null | name.py | john-klingner/sense-project | da05b9d521f4f9532fb4f75e7ea68b8923f1e268 | [
"CC0-1.0"
] | null | null | null | name.py | john-klingner/sense-project | da05b9d521f4f9532fb4f75e7ea68b8923f1e268 | [
"CC0-1.0"
] | null | null | null | kBoardId=0x00
kBoardName = 'sense{:02X}'.format(kBoardId) | 29 | 43 | 0.758621 | 7 | 58 | 6.285714 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.092593 | 0.068966 | 58 | 2 | 43 | 29 | 0.722222 | 0 | 0 | 0 | 0 | 0 | 0.189655 | 0 | 0 | 0 | 0.068966 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
e65e628c7bf82714fa168b843b86140087d23a77 | 847 | py | Python | LMS/librarian/migrations/0002_student.py | Hamnafaisal/Library-Management-System-Django-Project- | 0bfc31f77ea23ccdc677a374b2a27e50f884b005 | [
"MIT"
] | null | null | null | LMS/librarian/migrations/0002_student.py | Hamnafaisal/Library-Management-System-Django-Project- | 0bfc31f77ea23ccdc677a374b2a27e50f884b005 | [
"MIT"
] | null | null | null | LMS/librarian/migrations/0002_student.py | Hamnafaisal/Library-Management-System-Django-Project- | 0bfc31f77ea23ccdc677a374b2a27e50f884b005 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-08-23 04:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('librarian', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Student',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('roll_no', models.CharField(max_length=10, unique=True)),
('name', models.CharField(max_length=10)),
('branch', models.CharField(max_length=3)),
('contact_no', models.CharField(max_length=10)),
('total_books_due', models.IntegerField(default=0)),
('email', models.EmailField(max_length=254, unique=True)),
],
),
]
| 32.576923 | 114 | 0.57379 | 88 | 847 | 5.375 | 0.625 | 0.095137 | 0.15222 | 0.20296 | 0.173362 | 0.118393 | 0 | 0 | 0 | 0 | 0 | 0.047934 | 0.285714 | 847 | 25 | 115 | 33.88 | 0.733884 | 0.050767 | 0 | 0 | 1 | 0 | 0.098504 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.052632 | 0 | 0.210526 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0508710bb15a0276a79139fad864ab8bb17f469c | 4,841 | py | Python | thesis/parsers/base.py | alki22/thesis | 079649cee05c1f6aa6b533ef4a41e6658b29b324 | [
"MIT"
] | null | null | null | thesis/parsers/base.py | alki22/thesis | 079649cee05c1f6aa6b533ef4a41e6658b29b324 | [
"MIT"
] | null | null | null | thesis/parsers/base.py | alki22/thesis | 079649cee05c1f6aa6b533ef4a41e6658b29b324 | [
"MIT"
] | 1 | 2018-09-13T15:44:25.000Z | 2018-09-13T15:44:25.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from collections import OrderedDict
from tabulate import tabulate
from thesis.utils import try_number
from tqdm import tqdm
class Word(object):
def __init__(self, word, columns):
word = OrderedDict(zip(columns, word.split()))
self.idx = int(word.pop('idx'))
self.token = word.pop('token')
self.lemma = word.pop('lemma')
self.tag = word.pop('tag')
self._extras = word.copy()
def __contains__(self, item):
return item in self._extras
def __getitem__(self, item):
return try_number(self._extras[item])
def __getattr__(self, item):
if item in self:
return self[item]
else:
raise AttributeError
def __setitem__(self, key, value):
self._extras[key] = value
def __repr__(self):
return '<Word: %s>' % self.token
def __str__(self):
return '%s\t%s\t%s\t%s\t%s' % (self.idx, self.token, self.lemma, self.tag, '\t'.join(self._extras.values()))
@property
def extras(self):
return list(self._extras.values())
@property
def tokens(self):
"""
Method to get different combinations of tokens, with different use of capital letters
in order to look for it in a embedding model.
:return: A list of all possible combinations of a token or a lemma, ordered by importance
"""
if self.tag.startswith('F') and self.tag.lower() != 'fw': # To compatibilize with sbwce
return ('<PUNCTUATION>',) * 3
elif self.tag == 'W':
return ('<DATE>',) * 3
elif self.tag == 'Z':
return ('<NUMBER>',) * 3
else:
return (
self.token,
self.token.lower(),
self.lemma
)
class Sentence(object):
def __init__(self, metadata, sentence, *columns):
self._corpus_name = metadata.pop('META')
self._sentence_index = int(metadata.pop('sentence'))
self._metadata = metadata
self._words = [Word(word, columns) for word in sentence]
def __contains__(self, item):
return item in self._metadata
def __getitem__(self, item):
return try_number(self._metadata[item])
def __getattr__(self, item):
if item in self:
return self[item]
else:
raise AttributeError
def __len__(self):
return len(self._words)
def __setitem__(self, key, value):
self._metadata[key] = value
def __iter__(self):
for word in self._words:
yield word
def __repr__(self):
return '<Sentence: %05d - Corpus: %s>' % (self._sentence_index, self._corpus_name)
def __str__(self):
words = [[word.idx, word.token, word.lemma, word.tag] + word.extras for word in self]
return tabulate(words, tablefmt='plain')
@property
def metadata_string(self):
return 'META:%s sentence:%05d %s' % \
(self._corpus_name, self._sentence_index,
' '.join(':'.join(d) for d in sorted(self._metadata.items())))
def get_word_by_index(self, index):
index = int(index)
assert index > 0 and index == self._words[index-1].idx
return self._words[index-1]
def get_word_windows(self, loc, window_size):
"""
Return the window_size words to the left and right of loc.
:param loc: int
:param window_size: int
:return: Left and right window of words of word in loc.
"""
loc -= 1 # Words are numerated from 1
return self._words[max(0, loc - window_size):loc], self._words[loc+1:loc+window_size+1]
@property
def corpus_name(self):
return self._corpus_name
@property
def sentence_index(self):
return self._sentence_index
class ColumnCorpusParser(object):
def __init__(self, path, *columns, total_lines=0, verbose=False):
self._path = path
self._columns = columns
self._total_lines = total_lines
self._verbose = verbose
@property
def sentences(self):
with open(self._path, 'r') as f:
metadata = {}
sentence = []
for line in tqdm(f, total=self._total_lines, disable=not self._verbose):
if line.strip().startswith('META'):
metadata = dict([tuple(mdata.split(':', 1)) for mdata in line.strip().split()])
elif line.strip() != '':
sentence.append(line.strip())
else:
yield Sentence(metadata, sentence, *self._columns)
metadata = {}
sentence = []
def __repr__(self):
return '<ColumnCorpusParser>'
| 30.639241 | 116 | 0.58397 | 588 | 4,841 | 4.569728 | 0.239796 | 0.044659 | 0.020841 | 0.01898 | 0.150354 | 0.130257 | 0.112021 | 0.108671 | 0.05508 | 0.05508 | 0 | 0.005316 | 0.300558 | 4,841 | 157 | 117 | 30.834395 | 0.788246 | 0.093782 | 0 | 0.294643 | 0 | 0 | 0.043043 | 0 | 0 | 0 | 0 | 0 | 0.008929 | 1 | 0.232143 | false | 0 | 0.044643 | 0.116071 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
050d9461f8b28c550b1cfda85241036985ab1521 | 13,157 | py | Python | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/PyAutoDock/MolecularSystem.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | 8 | 2021-12-14T21:30:01.000Z | 2022-02-14T11:30:03.000Z | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/PyAutoDock/MolecularSystem.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/PyAutoDock/MolecularSystem.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | ## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by
############################################################################
#
# Authors: William Lindstrom, Ruth Huey
#
# Copyright: A. Olson TSRI 2004
#
#############################################################################
#
# $Id: MolecularSystem.py,v 1.9 2008/11/21 20:02:00 vareille Exp $
#
from MolKit.molecule import AtomSet, Atom
from MolecularSystemAdapter import Adapters
import numpy.oldnumeric as Numeric
from math import sqrt
import types
class AbstractMolecularSystem:
"""This class defines the interface that a MolecularSystem must support
for use with a Scorer or other object(s). This class maintains a list of
sets of entities (like Atoms).
The get_supported_attributes method returns the list of attributes that
each Entity supports.
A distance matrix is maintained pairwise by set and pairwise by entities
within the set. NB: is actually the distance, **not** distance-squared.
The reason for this is that for clients (like WeightedMultiTerm scorers)
who must get_dist_mat repeatedly, forcing them to take the sqrt for each
term is a false economy.
An index is returned when adding a set of entities (by the add_entities method).
This index for an entity set can also be found using the get_entity_set_index method.
The molecular system attribute configuration is a 2-tuple of validated
entity_set_index. In its use, the Autodock scorer uses the first as the Receptor
and second as the Ligand.
This class is intended to abstract any number of underlying molecular
representations such as MolKit, mmLib, MMTK, or just a PDB file. The
underlying molecular representation is abstracted as a list of entities
which support the 'supported_attributes'. So, for instance, if your molecular
representation doesn't have charges, its abstraction as a specialized
implementation of this interface (ie the subclass of MolecularSystemBase)
may have to calculate per entity charges.
"""
def __init__(self): pass
def add_entities(self, entity_set, coords_access_func=None): pass
def get_entity_set_index(self, entity_set): pass
def set_coords(self, entity_set_index, coords): pass
def get_dist_mat(self, ix, jx): pass
def clear_dist_mat(self, ix): pass
def get_supported_attributes(self): pass
def check_required_attributes(self, entity_set_index, attribute_list): pass
# @@ do we want to support the following interface??
def get_coords(self, entity_set_index): pass
# @@ or do we want to support the following interface??
def get_entities(self, entity_set_num): pass
def set_configuration(self, ix=None, jx=None ): pass
class MolecularSystem(AbstractMolecularSystem):
"""concrete subclass implementation of AbstractMolecularSystem
"""
def __init__(self, e_set=None, coords_access_func=None):
AbstractMolecularSystem.__init__(self)
self.entity_sets = []
self._dist_mats = {}
# key is entity_set_index: values is dict
# with key second entity_set_index, value distance mat
# _dist_mat holds the square of distances between pairs of
# entities, Distance matrices get computed only when needed
self.configuration = (None, None)
self.coords_access_func_list = []
if e_set is not None:
self.add_entities(e_set, coords_access_func)
# single entity_set results in configuration of (0,0)
# self.configuration = (0, None)
def get_entity_set_index(self, entity_set):
return self.entity_sets.index(entity_set)
def _validate_entity_set_index(self, entity_set_ix):
assert (entity_set_ix < len(self.entity_sets)), \
"Invalid entity_set_index: %d; only %d entity_sets." % \
(entity_set_ix, len(self.entity_sets) )
def get_supported_attributes(self):
raise NotImplementedError
# for check_required_attributes
# the hydrogen bonding term has the required attr of bonds
# for subsetA, so when we implement this make sure that
# 1. bonds is on the attribute_list when Hbonding is involved
# 2. that subsetA does have bonds (or build them!)
#
# this also raises the issue that not all atom_sets need all attributes
# to support a specific scorer term.
#
# also, for desolvation subsetA needs AtVols
def check_required_attributes(self, entity_set_index, attribute_list):
"""Check that all the elements of the given entity_set have all
the attributes in the attribute_list.
"""
# get_entities will validate entity_set_index
entities = self.get_entities( entity_set_index)
if type(entities) == types.GeneratorType:
# @@ figure out how to check generator attributes !!
return
# check each attribute
typeList = [types.ListType, types.DictType]#, types.InstanceType]
from mglutil.util.misc import isInstance
for attr in attribute_list:
# get returns the subset of entities
# for which the expression is true
ents = entities.get( lambda x: hasattr(x, attr))
if ents==None or len(ents)!=len(entities):
raise AttributeError, \
"All Entities do not have required Entity attribute (%s) " % attr
ent0 = entities[0]
if type(getattr(ent0, attr)) in typeList \
or isInstance(getattr(ent0, attr)) is True:
if len(getattr(ent0, attr))==0:
raise ValueError, \
"Required Entity attribute (%s) has zero length" % attr
def _compute_distance_matrix(self, ix, jx):
"""Compute the distance matrix for the given sets
This method should be called from within the class by get_dist_mat
which knows when it's really necessary.
"""
# straight forward distance matrix calculation
mat = []
for c1 in self.get_coords(ix):
l = []
cx, cy, cz = c1
mat.append(l)
for c2 in self.get_coords(jx):
c2x, c2y, c2z = c2
d = cx-c2x, cy-c2y, cz-c2z
l.append(sqrt( d[0]*d[0]+d[1]*d[1]+d[2]*d[2]) )
return mat
def check_distance_cutoff(self, ix, jx, cutoff):
"""check if a distance in the distance matrix for the specified sets
is below a user specified cutoff.
If the distance matrix does not exist if is computed up to the first encounter
of a distance below the cutoff. If such a distance is encountered it is
returned. If the matrix exists the minimum distance is returned if it is below
the cutoff. If distance are all above the cutoff, None is returned.
"""
mat = self._dist_mats[ix][jx]
if mat is None:
mat = self._dist_mats[jx][ix]
result = None
if mat is None:
mat = []
for e1 in self.get_entities(ix):
l = []
cx, cy, cz = e1.coords
mat.append(l)
for e2 in self.get_entities(jx):
c2x, c2y, c2z = e2.coords
d = cx-c2x, cy-c2y, cz-c2z
dist = sqrt( d[0]*d[0]+d[1]*d[1]+d[2]*d[2])
if dist < cutoff:
return dist
l.append( dist)
#if the whole dist matrix is ok, save it
self._dist_mats[ix][jx] = mat
else:
mini = min( map( min, mat))
if mini < cutoff:
result = mini
return result
def get_dist_mat(self, ix, jx):
"""return the distance matrix for the given two sets
"""
mat = self._dist_mats[ix][jx]
tmat = self._dist_mats[jx][ix]
if not mat:
if tmat:
# we just transpose
#mat = Numeric.swapaxes(Numeric.array(tmat), 0, 1).tolist()
mat = [] #eg: 3x4->4x3
for j in xrange(len(tmat[0])):
mat.append([])
for i in xrange(len(tmat)):
mat[j].append(tmat[i][j])
else:
# we must compute
mat = self._compute_distance_matrix(ix,jx)
self._dist_mats[ix][jx] = mat
return mat
def clear_dist_mat(self, ix):
"""clear all distance-squared matrices for the given entity_set
"""
# first clear all the pairs where entity_set is the first key
for set in self._dist_mats[ix].keys():
self._dist_mats[ix][set] = None
# now clear all matrices where entity_set is the second key
for set in self._dist_mats.keys():
self._dist_mats[set][ix] = None
def set_configuration(self, ix=None, jx=None ):
"""For now this is a 2-tuple of entity_set_index that describes
for a scorer which two entity sets are being considered with respect to
one another.
"""
if ix is not None:
self._validate_entity_set_index(ix)
self.configuration = tuple( [ix, self.configuration[1]] )
if jx is not None:
self._validate_entity_set_index(jx)
self.configuration = tuple( [self.configuration[0], jx] )
def add_entities(self, entity_set, coords_access_func=None):
"""add a MolKit.EntitySet to the MolecularSystem
Returns the entity_set_num for the new EntitySet. First two calls to
add_entities set the configuration to use those EntitySets.
"""
entity_set_ix = len(self.entity_sets)
# initialize the dictionary of distance matricies for this set
self._dist_mats[entity_set_ix] = {}
# create an adapter for this entity_set ...
adapter = Adapters[str(entity_set.__class__)](entity_set)
# adapter = MolecularSystemAdapter( entity_set)
# ... and add it to the entity_sets list
self.entity_sets.append(adapter)
# add the coords_access_func
self.coords_access_func_list.append(coords_access_func)
# create a new dict for every set vs. this one
for ix, set in enumerate(self.entity_sets):
self._dist_mats[ix][entity_set_ix] = None
self._dist_mats[entity_set_ix][ix] = None
# set the configuration (only on the first two calls)
if entity_set_ix == 0:
self.set_configuration( ix = entity_set_ix)
# single entity_set results in configuration of (0,0)
self.set_configuration( jx = entity_set_ix)
elif entity_set_ix == 1:
self.set_configuration( jx = entity_set_ix)
return entity_set_ix
def get_entities(self, entity_set_ix=0):
"""return the specified entity_set.
entity_set_ix is an integer that indexes into self.entity_sets"""
# make sure the entity_set_index is valid
self._validate_entity_set_index(entity_set_ix)
return self.entity_sets[entity_set_ix].get_iterator()
# @@ ISSUE: should the MolecularSystem maintain the coordinates
# @@ as state. OR, should this actually change the values in whatever
# @@ underlying Molecule representation that there is ??
#
# for now set_coords changes the MolKit values
def set_coords(self, entity_set_ix, coords, coords_set_func=None):
"""provide new coords for the specified entitySet.
entity_set_ix is the index of an existing entitySet.
coords is a list (of proper length) of anything you want to use
to update coordinate with the coords_set_func you supply.
"""
# validate input
self._validate_entity_set_index(entity_set_ix)
# assert <that coords is a list of coordinates>
# check compatibility
assert len(coords)==len(self.get_entities(entity_set_ix))
if coords_set_func:
for ex, e in enumerate(self.get_entities(entity_set_ix)):
coords_set_func(e, coords[ex])
else:
#NB: this is MolKit AtomSet specific
self.get_entities(entity_set_ix).updateCoords(coords)
# clear distance matrix
self.clear_dist_mat(entity_set_ix)
def get_coords(self, entity_set_ix=0):
"""return the coordinates of the specified entity_set.
DEPRECATED: use get_entities().coords instead.
entity_set_ix is an integer that indexes into self.entity_sets
"""
# raise DeprecationWarning, "use get_entities().coords instead"
# validate input
self._validate_entity_set_index(entity_set_ix)
# get the coordinates accessor function
accessor = self.coords_access_func_list[entity_set_ix]
if accessor:
coords = [accessor(e) for e in self.get_entities(entity_set_ix)]
else:
#in case getattr hasnot been overridden:
coords = [e.coords for e in self.get_entities(entity_set_ix)]
return coords
# MolecularSystem
if __name__ == '__main__':
print "unittests in Tests/test_MolecularSystem.py"
| 37.916427 | 87 | 0.639431 | 1,786 | 13,157 | 4.537514 | 0.210526 | 0.07885 | 0.040721 | 0.019003 | 0.271471 | 0.214215 | 0.153381 | 0.114388 | 0.084403 | 0.076505 | 0 | 0.009036 | 0.276659 | 13,157 | 346 | 88 | 38.026012 | 0.842492 | 0.185909 | 0 | 0.174497 | 0 | 0 | 0.027713 | 0.003979 | 0 | 0 | 0 | 0.00289 | 0.013423 | 0 | null | null | 0.073826 | 0.040268 | null | null | 0.006711 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
0512721af251d9b920967f6640e1d91c5961c8aa | 841 | py | Python | furaffinity/errors.py | lukeroge/python-furaffinity | 40261bf29fde888cd8d79d204cc9b77c4ae74cad | [
"MIT"
] | 3 | 2020-02-18T15:19:41.000Z | 2021-11-26T00:42:08.000Z | furaffinity/errors.py | lukeroge/python-furaffinity | 40261bf29fde888cd8d79d204cc9b77c4ae74cad | [
"MIT"
] | 71 | 2019-11-10T02:21:10.000Z | 2022-03-18T08:52:25.000Z | furaffinity/errors.py | lukeroge/python-furaffinity | 40261bf29fde888cd8d79d204cc9b77c4ae74cad | [
"MIT"
] | 3 | 2020-12-23T14:59:18.000Z | 2021-01-07T09:25:45.000Z | class LoginError(Exception):
""" Could not login to the server. """
pass
class NotLoggedInError(Exception):
""" Cannot properly interact with Fur Affinity unless you are logged in. """
pass
class MaturityError(Exception):
""" Cannot access that submission on this account because of maturity filter. """
pass
class SubmissionNotFoundError(Exception):
""" Could not find that submission. It has either been taken down, or does not exist yet. """
pass
class AccessError(Exception):
""" For some unknown reason Fur Affinity would not allow access to a submission. Try again. """
pass
class SubmissionFileNotAccessible(Exception):
""" Could not find/download the submission file. """
pass
class IPBanError(Exception):
""" You appear to be IP banned. This is not good. """
pass
| 24.735294 | 99 | 0.699168 | 104 | 841 | 5.653846 | 0.625 | 0.091837 | 0.086735 | 0.071429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.211653 | 841 | 33 | 100 | 25.484848 | 0.886878 | 0.527943 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
051ffe2c6a4932efe5dbc7c255c220f789d42456 | 427 | py | Python | game/title_scene.py | cat-in-the-dark/ludum_43_game | 737bc08e6e2b7e3a92bb958b7c0a8ec0674d5a20 | [
"MIT"
] | null | null | null | game/title_scene.py | cat-in-the-dark/ludum_43_game | 737bc08e6e2b7e3a92bb958b7c0a8ec0674d5a20 | [
"MIT"
] | null | null | null | game/title_scene.py | cat-in-the-dark/ludum_43_game | 737bc08e6e2b7e3a92bb958b7c0a8ec0674d5a20 | [
"MIT"
] | null | null | null | import jvcr
from route_machine import Scene
class TitleScene(Scene):
def __init__(self) -> None:
self.timer = 0
def on_activate(self):
self.timer = 0
def update(self, dt) -> str:
self.timer += dt
jvcr.spr(0, 0, 0, 48*16, 256, 144, 0, 0, 0)
if self.timer > 10:
return "next"
if self.timer > 0.5 and jvcr.btn(jvcr.BTN_B, 0):
return "next"
| 20.333333 | 56 | 0.545667 | 64 | 427 | 3.53125 | 0.5 | 0.199115 | 0.132743 | 0.115044 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.080702 | 0.332553 | 427 | 20 | 57 | 21.35 | 0.712281 | 0 | 0 | 0.285714 | 0 | 0 | 0.018735 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0 | 0.142857 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
052880eadf936fdee08e84efbd5ff84ceac52e81 | 2,988 | py | Python | ppysal/fisher_jenks/test_fj.py | ElsevierSoftwareX/SOFTX_2018_242 | 9a7d7c02b2f1d7b6bfd1b08fbb2150c30ddd1046 | [
"NCSA",
"BSD-3-Clause"
] | 22 | 2015-07-16T01:05:44.000Z | 2021-07-28T15:38:19.000Z | ppysal/fisher_jenks/test_fj.py | ElsevierSoftwareX/SOFTX-D-15-00005 | bb0c21ca479db5ac3ecf789ab280d5e45c3c7805 | [
"NCSA",
"BSD-3-Clause"
] | 1 | 2016-07-25T02:25:20.000Z | 2016-07-25T17:38:26.000Z | ppysal/fisher_jenks/test_fj.py | ElsevierSoftwareX/SOFTX-D-15-00005 | bb0c21ca479db5ac3ecf789ab280d5e45c3c7805 | [
"NCSA",
"BSD-3-Clause"
] | 20 | 2015-10-28T15:28:48.000Z | 2021-06-17T14:29:16.000Z | import math
import sys
import time
import numpy as np
from fj_refactored import fisher_jenks, fj_generate_sample
def testfull():
"""
Tests the fully enumerated Fisher-Jenks implementation
"""
cores = [1,2,4,16,32]
classes = [5,6,7]
data_sizes = [500, 1000, 2500, 5000, 7500, 10000, 12500, 15000, 17500, 20000, 22500, 25000]
for c in cores:
for d in data_sizes:
for k in classes:
data = np.random.ranf(size=d)
try:
t1 = time.time()
#wrapped in try since we will blow out RAM at some point
classification = fisher_jenks(data, k, c)
t2 = time.time()
print "Processed {0} data points in {1} classes using {2} cores. Total time: {3}".format(d, k, c, t2-t1)
data = None
except KeyboardInterrupt:
print "Aborting"
sys.exit(1)
except:
print "FAILURE: {0} data points.".format(d)
def testsample():
"""
Tests the sampled Fisher-Jenks implementation
"""
cores = [1,2,4,16,32]
classes = [5,6,7]
data_sizes = [10000, 20000, 40000, 80000, 160000, 320000, 640000, 1280000,
2560000, 5120000, 10240000, 20480000, 40960000, 81920000,
163840000, 327680000, 655360000]
for c in cores:
for d in data_sizes:
for k in classes:
#Generate the test data and save to disk
data = np.random.ranf(size=d)
nobs = len(data)
np.save('testfile.npy', data)
data = None
#Compute the sample size as the sqrt of nobs
sqrt = math.sqrt(nobs)
if sqrt > 40000:
sqrt = 40000
pct = sqrt / float(d)
#Load the data back into memory as a mmapped file
f = np.load('testfile.npy', mmap_mode='r+')
t1 = time.time()
data = fj_generate_sample(f, pct=pct)
t2 = time.time()
print "Randomly sampling {0} percent of {1} observations for a run size of {2} observations took {3} seconds.".format(pct, nobs, sqrt, t2 - t1)
try:
t1 = time.time()
#wrapped in try since we will blow out RAM at some point
classification = fisher_jenks(data, k, c)
t2 = time.time()
print "Processed {0} data points in {1} classes using {2} cores. Total time: {3}".format(d, k, c, t2-t1)
except KeyboardInterrupt:
print "Aborting"
sys.exit(1)
except:
print "FAILURE: {0} data points.".format(d)
if __name__ =='__main__':
#Test the fully enumerated FJ
testfull()
#Test FJ using sampling
testsample()
| 36 | 159 | 0.510375 | 358 | 2,988 | 4.201117 | 0.371508 | 0.031915 | 0.010638 | 0.02992 | 0.482713 | 0.482713 | 0.454787 | 0.454787 | 0.454787 | 0.454787 | 0 | 0.127707 | 0.397256 | 2,988 | 82 | 160 | 36.439024 | 0.707385 | 0.097055 | 0 | 0.610169 | 1 | 0.050847 | 0.135938 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.084746 | null | null | 0.118644 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
052e7c6b22bc0648fa86a82706e2592279eb13fa | 264 | py | Python | practica2/parent_directory_test.py | luisyanezblanco/python_certification | 67ca7f8c2a5f891fbb7efc3e85bd240417b66838 | [
"MIT"
] | null | null | null | practica2/parent_directory_test.py | luisyanezblanco/python_certification | 67ca7f8c2a5f891fbb7efc3e85bd240417b66838 | [
"MIT"
] | null | null | null | practica2/parent_directory_test.py | luisyanezblanco/python_certification | 67ca7f8c2a5f891fbb7efc3e85bd240417b66838 | [
"MIT"
] | null | null | null | import os
def parent_directory():
# Create a relative path to the parent
# of the current working directory
relative_parent = os.path.join("..", os.path.getcwd())
# Return the absolute path of the parent directory
return ___
print(parent_directory()) | 26.4 | 56 | 0.731061 | 37 | 264 | 5.054054 | 0.513514 | 0.240642 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.17803 | 264 | 10 | 57 | 26.4 | 0.861751 | 0.454545 | 0 | 0 | 0 | 0 | 0.014184 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.6 | 0.2 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
053aead8b5cf9cb0fcbf140da605d95f8ebd9c5d | 4,114 | py | Python | cgi-bin/db.py | ddierschow/gallery | 84e850f49f786801948a105ec498b0fc67114ce7 | [
"MIT"
] | null | null | null | cgi-bin/db.py | ddierschow/gallery | 84e850f49f786801948a105ec498b0fc67114ce7 | [
"MIT"
] | null | null | null | cgi-bin/db.py | ddierschow/gallery | 84e850f49f786801948a105ec498b0fc67114ce7 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python
import datetime, MySQLdb, os
class db:
def __init__(self, cgibin='../cgi-bin'):
dbd = eval(open(cgibin + '/.dbconnect').read())
self.db = MySQLdb.connect(user=dbd['user'], passwd=dbd['passwd'], db=dbd['db'])
self.cgibin = cgibin
# user functions
def login(self, name, passwd):
if not self.db:
return None, None
cu = self.db.cursor()
self.log('''select id, privs from user where name = '%s' and passwd = PASSWORD('%s')''' % (name, passwd))
cu.execute('''select id, privs from user where name = '%s' and passwd = PASSWORD('%s')''' % (name, passwd))
ret = cu.fetchone()
if ret:
return ret[0], ret[1]
return None, None
def changepassword(self, id, passwd):
if not self.db:
return None
cu = self.db.cursor()
self.log("""update user set passwd=PASSWORD('%s') where id = '%s'""" % (passwd, id))
cu.execute("""update user set passwd=PASSWORD('%s') where id = '%s'""" % (passwd, id))
self.db.commit()
ret = cu.fetchone()
if ret:
return ret[0]
return None
def changeemail(self, id, email):
if not self.db:
return None
cu = self.db.cursor()
self.log("""update user set email='%s' where id = '%s'""" % (email, id))
cu.execute("""update user set email='%s' where id = '%s'""" % (email, id))
self.db.commit()
ret = cu.fetchone()
if ret:
return ret[0]
return None
def createuser(self, name, passwd, email):
if not self.db:
return None
cu = self.db.cursor()
try:
self.log('''insert user (name, passwd, privs, email, state) values ('%s', PASSWORD('%s'), '', '%s', 0)''' %(name, passwd, email))
cu.execute('''insert user (name, passwd, privs, email, state) values ('%s', PASSWORD('%s'), '', '%s', 0)''' %(name, passwd, email))
except:
return None
return self.login(name, passwd)
# generic functions
def select(self, table, cols=None, where=None, order=None):
if not self.db:
return []
cu = self.db.cursor()
if not cols:
self.log('desc %s' % table)
cu.execute('desc %s' % table)
cols = map(lambda x: x[0], cu.fetchall())
query = '''select %s from %s''' % (','.join(cols), table)
if where:
query += ''' where %s''' % where
if order:
query += ''' order by %s''' % order
try:
#print "<!--",query,"-->"
self.log(query)
cu.execute(query)
except:
return []
res = cu.fetchall()
return map(lambda x: dict(zip(cols, x)), res)
def update(self, table, values, where=None):
if not self.db:
return []
cu = self.db.cursor()
setlist = ','.join(map(lambda x: x + "=" + self.db.literal(str(values[x])), values))
query = '''update %s set %s''' % (table, setlist)
if where:
query += ''' where %s;''' % where
#print "<!--",query,"-->"
try:
self.log(query)
cu.execute(query)
except:
pass
return cu.fetchall()
def updateflag(self, table, values, where=None):
if not self.db:
return []
cu = self.db.cursor()
setlist = ','.join(map(lambda x: x + "=" + str(values[x]), values))
query = '''update %s set %s''' % (table, setlist)
if where:
query += ''' where %s;''' % where
#print "<!--",query,"-->"
try:
self.log(query)
cu.execute(query)
except:
pass
return cu.fetchall()
def insert(self, table, inits):
if not self.db:
return []
cu = self.db.cursor()
cols = []
vals = []
for key in inits:
cols.append(key)
vals.append(self.db.literal(inits[key]))
try:
query = '''insert into %s (%s) values (%s)''' % (table, ','.join(cols), ','.join(vals))
#print "<!--",query,"-->"
self.log(query)
cu.execute(query)
except:
pass
return cu.fetchall()
def remove(self, table, where=None):
if not self.db:
return []
cu = self.db.cursor()
query = '''delete from %s''' % table
if where:
query += ''' where %s''' % where
try:
#print "<!--",query,"-->"
self.log(query)
cu.execute(query)
except:
pass
return cu.fetchall()
def log(self, action):
#print action
file('logs/database.log', 'a').write('%s %s\n' % (str(datetime.datetime.today()), action))
if __name__ == '__main__':
pass
| 25.239264 | 136 | 0.581672 | 583 | 4,114 | 4.084048 | 0.166381 | 0.057959 | 0.034019 | 0.041579 | 0.635447 | 0.635447 | 0.627887 | 0.580008 | 0.568249 | 0.555229 | 0 | 0.002161 | 0.212688 | 4,114 | 162 | 137 | 25.395062 | 0.732942 | 0.045455 | 0 | 0.643411 | 0 | 0.015504 | 0.190148 | 0.01072 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.124031 | 0.007752 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
054a5786d8f23ed7eb6930fdf86026a1b4eddeef | 221 | py | Python | tests/urls.py | hitman711/django-db-storage | 04dafbd795be1d193f85e5c1b5c055570f89db8f | [
"BSD-3-Clause"
] | null | null | null | tests/urls.py | hitman711/django-db-storage | 04dafbd795be1d193f85e5c1b5c055570f89db8f | [
"BSD-3-Clause"
] | null | null | null | tests/urls.py | hitman711/django-db-storage | 04dafbd795be1d193f85e5c1b5c055570f89db8f | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from django.contrib import admin
from dbstorage.urls import dbstorage_url
urlpatterns = [
# admin urls
url(r'^admin/', admin.site.urls),
# dbstorage
dbstorage_url(),
]
| 15.785714 | 40 | 0.701357 | 29 | 221 | 5.275862 | 0.413793 | 0.130719 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.199095 | 221 | 13 | 41 | 17 | 0.864407 | 0.090498 | 0 | 0 | 0 | 0 | 0.035354 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 0.428571 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
0557e6d6a5902c31045e1e617c5fe9f5a93c94ac | 240 | py | Python | plugins/__init__.py | Smarties89/thematrixmonitor | f76d01af19241ec6846ce81e4f21368bde7b55ae | [
"MIT"
] | null | null | null | plugins/__init__.py | Smarties89/thematrixmonitor | f76d01af19241ec6846ce81e4f21368bde7b55ae | [
"MIT"
] | null | null | null | plugins/__init__.py | Smarties89/thematrixmonitor | f76d01af19241ec6846ce81e4f21368bde7b55ae | [
"MIT"
] | null | null | null | #!/usr/bin/python
from cpu import cpu
from network import network
from memorypercent import memorypercent
from processes import processes
# This is the active windows.
columns = [
cpu,
network,
memorypercent,
processes
]
| 15 | 39 | 0.7375 | 29 | 240 | 6.103448 | 0.517241 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208333 | 240 | 15 | 40 | 16 | 0.931579 | 0.183333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
056296db26b868029ce401e6d410dbe0b396458b | 542 | py | Python | pyvisaserver/_knownclasses.py | bfichera/instrumlib-server | c612a4e222c93884296b2ef0329c96500a11a0d9 | [
"MIT"
] | null | null | null | pyvisaserver/_knownclasses.py | bfichera/instrumlib-server | c612a4e222c93884296b2ef0329c96500a11a0d9 | [
"MIT"
] | null | null | null | pyvisaserver/_knownclasses.py | bfichera/instrumlib-server | c612a4e222c93884296b2ef0329c96500a11a0d9 | [
"MIT"
] | null | null | null | from runpy import run_path
from pathlib import Path
from appdirs import user_config_dir
def _get_knownclasses_path(path=None):
if not path:
return (
Path(
user_config_dir('pyvisa-server'),
) / 'known_classes.py'
).absolute()
else:
return Path(path).absolute()
def _get_knownclasses(path):
if not path:
path = _get_knownclasses_path(path)
known_classes = run_path(
_get_knownclasses_path(path),
)['known_classes']
return known_classes
| 22.583333 | 49 | 0.638376 | 65 | 542 | 5 | 0.369231 | 0.123077 | 0.233846 | 0.212308 | 0.24 | 0.24 | 0.24 | 0 | 0 | 0 | 0 | 0 | 0.278598 | 542 | 23 | 50 | 23.565217 | 0.831202 | 0 | 0 | 0.105263 | 0 | 0 | 0.077491 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.105263 | false | 0 | 0.157895 | 0 | 0.421053 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0573283cf5b8a63cab59c7da5767f4023c07a226 | 348 | py | Python | utils/json_utils.py | FMI-RobertoDeresu/fmi-text-to-image | 23b494d4f79f7bef7b0b664ebf5a94917018b50a | [
"Apache-2.0"
] | null | null | null | utils/json_utils.py | FMI-RobertoDeresu/fmi-text-to-image | 23b494d4f79f7bef7b0b664ebf5a94917018b50a | [
"Apache-2.0"
] | 10 | 2020-01-28T22:47:22.000Z | 2022-02-10T00:15:47.000Z | utils/json_utils.py | FMI-RobertoDeresu/fmi-text-to-image | 23b494d4f79f7bef7b0b664ebf5a94917018b50a | [
"Apache-2.0"
] | null | null | null | import json
def load(file_path):
with open(str(file_path)) as f:
data = json.load(f)
return data
def dump(data, file_path, indent=4):
with open(str(file_path), 'w+') as f:
json.dump(data, f, indent=indent)
def dumps(data, indent=4, sort_keys=False):
return json.dumps(data, indent=indent, sort_keys=sort_keys)
| 20.470588 | 63 | 0.66092 | 58 | 348 | 3.844828 | 0.362069 | 0.143498 | 0.098655 | 0.134529 | 0.170404 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00722 | 0.204023 | 348 | 16 | 64 | 21.75 | 0.797834 | 0 | 0 | 0 | 0 | 0 | 0.005747 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.1 | 0.1 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
058666078caea56b381b45bf64d81cf2bce954ec | 700 | py | Python | logcabin/configuration.py | srault95/logcabin | 27f0e589284923d49e9255494bb1e7c23da82ca2 | [
"Apache-2.0"
] | null | null | null | logcabin/configuration.py | srault95/logcabin | 27f0e589284923d49e9255494bb1e7c23da82ca2 | [
"Apache-2.0"
] | null | null | null | logcabin/configuration.py | srault95/logcabin | 27f0e589284923d49e9255494bb1e7c23da82ca2 | [
"Apache-2.0"
] | null | null | null | import sys
import logging
from pipeline import Pipeline
class ConfigException(Exception):
pass
class PyConfigLoader(object):
def __init__(self, path):
self.logger = logging.getLogger('config')
self.path = path
def configure(self):
self.logger.info('Loading configuration: %r' % self.path)
# push implicit top-level context
self.pipeline = Pipeline()
with self.pipeline:
try:
execfile(self.path)
except Exception as ex:
trace = sys.exc_info()[2]
raise ConfigException(ex), None, trace
# pipeline has no final output queue
self.pipeline.setup(None)
| 25.925926 | 65 | 0.61 | 77 | 700 | 5.480519 | 0.584416 | 0.075829 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002053 | 0.304286 | 700 | 26 | 66 | 26.923077 | 0.864476 | 0.094286 | 0 | 0 | 0 | 0 | 0.049128 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.052632 | 0.157895 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
0591368ff45209b045051aab61d5f0921e51200b | 1,505 | py | Python | fitters/n2State.py | zzpwahaha/DataCrylsis | b4436435d6ead3322ce54d22e048077732e39e57 | [
"MIT"
] | null | null | null | fitters/n2State.py | zzpwahaha/DataCrylsis | b4436435d6ead3322ce54d22e048077732e39e57 | [
"MIT"
] | null | null | null | fitters/n2State.py | zzpwahaha/DataCrylsis | b4436435d6ead3322ce54d22e048077732e39e57 | [
"MIT"
] | null | null | null | import numpy as np
import uncertainties.unumpy as unp
def center():
return [2, 3] # or the arg-number of the center.
def args():
return 'amp', 'x0', 'y0', 'sig_x', 'sig_y', 'theta', 'offset'
def f(coordinates, amplitude, xo, yo, sigma_x, sigma_y, offset):
"""
The normal function call for this function. Performs checks on valid arguments, then calls the "raw" function.
:return:
"""
if sigma_x > 50 or sigma_y > 50 or xo < 0 or yo < 0 or amplitude < 0 or sigma_x < 0 or sigma_y < 0:
return 1e10*np.ones(len(coordinates[0])*len(coordinates[0][0]))
res = f_raw(coordinates, amplitude, xo, yo, sigma_x, sigma_y, offset)
return res
def f_noravel(coordinates, amplitude, xo, yo, sigma_x, sigma_y, offset):
x = coordinates[0]
y = coordinates[1]
xo = float(xo)
yo = float(yo)
a = 1/(2*sigma_x**2)
c = 1/(2*sigma_y**2)
xp = x-xo
Norm = 1/(4*sigma_x*sigma_y*np.pi)
return offset + amplitude*Norm*(xp**2/(sigma_x**2)-1)**2*np.exp(-(a*(xp**2) + c*((y-yo)**2)))
def f_raw(coordinates, amplitude, xo, yo, sigma_x, sigma_y, offset):
"""
The raw function call, performs no checks on valid parameters..
:return:
"""
return f_noravel(coordinates, amplitude, xo, yo, sigma_x, sigma_y, offset).ravel()
def guess(key, values):
"""
Returns guess values for the parameters of this function class based on the input. Used for fitting using this
class.
:param key:
:param values:
:return:
"""
| 32.021277 | 114 | 0.63588 | 245 | 1,505 | 3.804082 | 0.310204 | 0.064378 | 0.070815 | 0.077253 | 0.257511 | 0.257511 | 0.257511 | 0.257511 | 0.257511 | 0.257511 | 0 | 0.029813 | 0.219934 | 1,505 | 46 | 115 | 32.717391 | 0.764055 | 0.252492 | 0 | 0 | 0 | 0 | 0.026565 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.083333 | 0.083333 | 0.583333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
0596bda78a3aa6dd5cd50b2c4e37605f548874f3 | 670 | py | Python | python/trr.py | Surya-06/My-Solutions | 58f7c7f1a0a3a28f25eff22d03a09cb2fbcf7806 | [
"MIT"
] | null | null | null | python/trr.py | Surya-06/My-Solutions | 58f7c7f1a0a3a28f25eff22d03a09cb2fbcf7806 | [
"MIT"
] | null | null | null | python/trr.py | Surya-06/My-Solutions | 58f7c7f1a0a3a28f25eff22d03a09cb2fbcf7806 | [
"MIT"
] | null | null | null | class tree:
temp=""
def __init__(self,string):
self.temp=string
def printer(self):
print "Hello ",self.temp,"\n"
a = tree("Surya")
a.printer()
class node:
data = -1
right = None
left = None
def __init__(self,data,r,l):
self.data=data
self.right=r
self.left = l
def print_left(self):
print "Left data is ",self.left.printer()
def print_right(self):
print "Right data is ",self.right.printer()
def printer(self):
return self.data
def print_data(self):
print "Data is ",self.data
node1 = node(10,None,None)
node2 = node(20,None,None)
node3 = node(50,node1,node2)
node3.print_left()
node3.print_right()
node3.print_data()
node3.printer()
| 17.631579 | 45 | 0.686567 | 109 | 670 | 4.091743 | 0.266055 | 0.080717 | 0.067265 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028369 | 0.158209 | 670 | 37 | 46 | 18.108108 | 0.762411 | 0 | 0 | 0.064516 | 0 | 0 | 0.071642 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.451613 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
0597fd05688108282c3b505a334bef6ab1325993 | 15,895 | py | Python | dgp/contribs/pd/metadata_pb2.py | nehalmamgain/dgp | 5652a445a09c74ea28e25ee2d55a0cfdd6b68c71 | [
"MIT"
] | null | null | null | dgp/contribs/pd/metadata_pb2.py | nehalmamgain/dgp | 5652a445a09c74ea28e25ee2d55a0cfdd6b68c71 | [
"MIT"
] | null | null | null | dgp/contribs/pd/metadata_pb2.py | nehalmamgain/dgp | 5652a445a09c74ea28e25ee2d55a0cfdd6b68c71 | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: dgp/contribs/pd/metadata.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='dgp/contribs/pd/metadata.proto',
package='dgp.proto',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x1e\x64gp/contribs/pd/metadata.proto\x12\tdgp.proto\"\x9e\x01\n\x1cParallelDomainSampleMetadata\x12K\n\nattributes\x18\x01 \x03(\x0b\x32\x37.dgp.proto.ParallelDomainSampleMetadata.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd4\x03\n\x1bParallelDomainSceneMetadata\x12\x10\n\x08location\x18\x01 \x01(\t\x12*\n\x0bregion_type\x18\t \x01(\x0e\x32\x15.dgp.proto.RegionType\x12(\n\nscene_type\x18\n \x01(\x0e\x32\x14.dgp.proto.SceneType\x12\x13\n\x0btime_of_day\x18\x02 \x01(\t\x12\x15\n\rsun_elevation\x18\x0b \x01(\x02\x12\x13\n\x0bsun_azimuth\x18\x0c \x01(\x02\x12\x13\n\x0b\x63loud_cover\x18\r \x01(\x02\x12\x15\n\rfog_intensity\x18\x03 \x01(\x02\x12\x16\n\x0erain_intensity\x18\x04 \x01(\x02\x12\x0f\n\x07wetness\x18\x05 \x01(\x02\x12\x15\n\rstreet_lights\x18\x06 \x01(\x02\x12\x10\n\x08\x62\x61tch_id\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\r\x12J\n\nattributes\x18\x0e \x03(\x0b\x32\x36.dgp.proto.ParallelDomainSceneMetadata.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01*F\n\tSceneType\x12\x13\n\x0fSYNTHETIC_SCENE\x10\x00\x12\t\n\x05URBAN\x10\x01\x12\x0c\n\x08SUBURBAN\x10\x02\x12\x0b\n\x07HIGHWAY\x10\x03*I\n\nRegionType\x12\x14\n\x10SYNTHETIC_REGION\x10\x00\x12\x17\n\x13NORTHERN_CALIFORNIA\x10\x01\x12\x0c\n\x08MICHIGAN\x10\x02\x62\x06proto3')
)
_SCENETYPE = _descriptor.EnumDescriptor(
name='SceneType',
full_name='dgp.proto.SceneType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='SYNTHETIC_SCENE', index=0, number=0,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='URBAN', index=1, number=1,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SUBURBAN', index=2, number=2,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HIGHWAY', index=3, number=3,
serialized_options=None,
type=None),
],
containing_type=None,
serialized_options=None,
serialized_start=677,
serialized_end=747,
)
_sym_db.RegisterEnumDescriptor(_SCENETYPE)
SceneType = enum_type_wrapper.EnumTypeWrapper(_SCENETYPE)
_REGIONTYPE = _descriptor.EnumDescriptor(
name='RegionType',
full_name='dgp.proto.RegionType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='SYNTHETIC_REGION', index=0, number=0,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='NORTHERN_CALIFORNIA', index=1, number=1,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='MICHIGAN', index=2, number=2,
serialized_options=None,
type=None),
],
containing_type=None,
serialized_options=None,
serialized_start=749,
serialized_end=822,
)
_sym_db.RegisterEnumDescriptor(_REGIONTYPE)
RegionType = enum_type_wrapper.EnumTypeWrapper(_REGIONTYPE)
SYNTHETIC_SCENE = 0
URBAN = 1
SUBURBAN = 2
HIGHWAY = 3
SYNTHETIC_REGION = 0
NORTHERN_CALIFORNIA = 1
MICHIGAN = 2
_PARALLELDOMAINSAMPLEMETADATA_ATTRIBUTESENTRY = _descriptor.Descriptor(
name='AttributesEntry',
full_name='dgp.proto.ParallelDomainSampleMetadata.AttributesEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='dgp.proto.ParallelDomainSampleMetadata.AttributesEntry.key', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='value', full_name='dgp.proto.ParallelDomainSampleMetadata.AttributesEntry.value', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=_b('8\001'),
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=155,
serialized_end=204,
)
_PARALLELDOMAINSAMPLEMETADATA = _descriptor.Descriptor(
name='ParallelDomainSampleMetadata',
full_name='dgp.proto.ParallelDomainSampleMetadata',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='attributes', full_name='dgp.proto.ParallelDomainSampleMetadata.attributes', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[_PARALLELDOMAINSAMPLEMETADATA_ATTRIBUTESENTRY, ],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=46,
serialized_end=204,
)
_PARALLELDOMAINSCENEMETADATA_ATTRIBUTESENTRY = _descriptor.Descriptor(
name='AttributesEntry',
full_name='dgp.proto.ParallelDomainSceneMetadata.AttributesEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='dgp.proto.ParallelDomainSceneMetadata.AttributesEntry.key', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='value', full_name='dgp.proto.ParallelDomainSceneMetadata.AttributesEntry.value', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=_b('8\001'),
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=155,
serialized_end=204,
)
_PARALLELDOMAINSCENEMETADATA = _descriptor.Descriptor(
name='ParallelDomainSceneMetadata',
full_name='dgp.proto.ParallelDomainSceneMetadata',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='location', full_name='dgp.proto.ParallelDomainSceneMetadata.location', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='region_type', full_name='dgp.proto.ParallelDomainSceneMetadata.region_type', index=1,
number=9, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='scene_type', full_name='dgp.proto.ParallelDomainSceneMetadata.scene_type', index=2,
number=10, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='time_of_day', full_name='dgp.proto.ParallelDomainSceneMetadata.time_of_day', index=3,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='sun_elevation', full_name='dgp.proto.ParallelDomainSceneMetadata.sun_elevation', index=4,
number=11, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='sun_azimuth', full_name='dgp.proto.ParallelDomainSceneMetadata.sun_azimuth', index=5,
number=12, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='cloud_cover', full_name='dgp.proto.ParallelDomainSceneMetadata.cloud_cover', index=6,
number=13, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='fog_intensity', full_name='dgp.proto.ParallelDomainSceneMetadata.fog_intensity', index=7,
number=3, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='rain_intensity', full_name='dgp.proto.ParallelDomainSceneMetadata.rain_intensity', index=8,
number=4, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='wetness', full_name='dgp.proto.ParallelDomainSceneMetadata.wetness', index=9,
number=5, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='street_lights', full_name='dgp.proto.ParallelDomainSceneMetadata.street_lights', index=10,
number=6, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='batch_id', full_name='dgp.proto.ParallelDomainSceneMetadata.batch_id', index=11,
number=7, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='version', full_name='dgp.proto.ParallelDomainSceneMetadata.version', index=12,
number=8, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='attributes', full_name='dgp.proto.ParallelDomainSceneMetadata.attributes', index=13,
number=14, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[_PARALLELDOMAINSCENEMETADATA_ATTRIBUTESENTRY, ],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=207,
serialized_end=675,
)
_PARALLELDOMAINSAMPLEMETADATA_ATTRIBUTESENTRY.containing_type = _PARALLELDOMAINSAMPLEMETADATA
_PARALLELDOMAINSAMPLEMETADATA.fields_by_name['attributes'].message_type = _PARALLELDOMAINSAMPLEMETADATA_ATTRIBUTESENTRY
_PARALLELDOMAINSCENEMETADATA_ATTRIBUTESENTRY.containing_type = _PARALLELDOMAINSCENEMETADATA
_PARALLELDOMAINSCENEMETADATA.fields_by_name['region_type'].enum_type = _REGIONTYPE
_PARALLELDOMAINSCENEMETADATA.fields_by_name['scene_type'].enum_type = _SCENETYPE
_PARALLELDOMAINSCENEMETADATA.fields_by_name['attributes'].message_type = _PARALLELDOMAINSCENEMETADATA_ATTRIBUTESENTRY
DESCRIPTOR.message_types_by_name['ParallelDomainSampleMetadata'] = _PARALLELDOMAINSAMPLEMETADATA
DESCRIPTOR.message_types_by_name['ParallelDomainSceneMetadata'] = _PARALLELDOMAINSCENEMETADATA
DESCRIPTOR.enum_types_by_name['SceneType'] = _SCENETYPE
DESCRIPTOR.enum_types_by_name['RegionType'] = _REGIONTYPE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
ParallelDomainSampleMetadata = _reflection.GeneratedProtocolMessageType('ParallelDomainSampleMetadata', (_message.Message,), dict(
AttributesEntry = _reflection.GeneratedProtocolMessageType('AttributesEntry', (_message.Message,), dict(
DESCRIPTOR = _PARALLELDOMAINSAMPLEMETADATA_ATTRIBUTESENTRY,
__module__ = 'dgp.contribs.pd.metadata_pb2'
# @@protoc_insertion_point(class_scope:dgp.proto.ParallelDomainSampleMetadata.AttributesEntry)
))
,
DESCRIPTOR = _PARALLELDOMAINSAMPLEMETADATA,
__module__ = 'dgp.contribs.pd.metadata_pb2'
# @@protoc_insertion_point(class_scope:dgp.proto.ParallelDomainSampleMetadata)
))
_sym_db.RegisterMessage(ParallelDomainSampleMetadata)
_sym_db.RegisterMessage(ParallelDomainSampleMetadata.AttributesEntry)
ParallelDomainSceneMetadata = _reflection.GeneratedProtocolMessageType('ParallelDomainSceneMetadata', (_message.Message,), dict(
AttributesEntry = _reflection.GeneratedProtocolMessageType('AttributesEntry', (_message.Message,), dict(
DESCRIPTOR = _PARALLELDOMAINSCENEMETADATA_ATTRIBUTESENTRY,
__module__ = 'dgp.contribs.pd.metadata_pb2'
# @@protoc_insertion_point(class_scope:dgp.proto.ParallelDomainSceneMetadata.AttributesEntry)
))
,
DESCRIPTOR = _PARALLELDOMAINSCENEMETADATA,
__module__ = 'dgp.contribs.pd.metadata_pb2'
# @@protoc_insertion_point(class_scope:dgp.proto.ParallelDomainSceneMetadata)
))
_sym_db.RegisterMessage(ParallelDomainSceneMetadata)
_sym_db.RegisterMessage(ParallelDomainSceneMetadata.AttributesEntry)
_PARALLELDOMAINSAMPLEMETADATA_ATTRIBUTESENTRY._options = None
_PARALLELDOMAINSCENEMETADATA_ATTRIBUTESENTRY._options = None
# @@protoc_insertion_point(module_scope)
| 43.428962 | 1,450 | 0.762818 | 1,894 | 15,895 | 6.137276 | 0.116684 | 0.048176 | 0.056005 | 0.034412 | 0.683758 | 0.606762 | 0.561941 | 0.561941 | 0.554628 | 0.52512 | 0 | 0.038393 | 0.120038 | 15,895 | 365 | 1,451 | 43.547945 | 0.792665 | 0.031834 | 0 | 0.643713 | 1 | 0.002994 | 0.220611 | 0.185956 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.017964 | 0 | 0.017964 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
55356eb4e424a46786dd7c725379c89955db8b9a | 8,560 | py | Python | testrunner/tests/am_instrument_parser_tests.py | dalvikfrank/development | 7462df5e131d108177d85f9f5c3ccf0ab2d8802c | [
"Apache-2.0"
] | null | null | null | testrunner/tests/am_instrument_parser_tests.py | dalvikfrank/development | 7462df5e131d108177d85f9f5c3ccf0ab2d8802c | [
"Apache-2.0"
] | null | null | null | testrunner/tests/am_instrument_parser_tests.py | dalvikfrank/development | 7462df5e131d108177d85f9f5c3ccf0ab2d8802c | [
"Apache-2.0"
] | 1 | 2018-02-24T19:04:41.000Z | 2018-02-24T19:04:41.000Z | #!/usr/bin/python2.4
#
#
# Copyright 2009, The Android Open Source Project
#
# 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 sys
import unittest
sys.path.append('../..')
from testrunner import am_instrument_parser
class AmParserTest(unittest.TestCase):
def testParseAmInstResult(self):
result="""INSTRUMENTATION_RESULT: performance.java_size=4871
INSTRUMENTATION_RESULT: stream=
Error: Failed to generate emma coverage.
INSTRUMENTATION_RESULT: performance.cpu_time=33846
INSTRUMENTATION_CODE: -1
"""
bundle_dict = \
am_instrument_parser._ParseInstrumentationFinishedBundle(result)
self.assertEquals(4871, bundle_dict['java_size'])
self.assertEquals(33846, bundle_dict['cpu_time'])
self.assertEquals("\nError: Failed to generate emma coverage.",
bundle_dict['stream'])
def testParseAmInstStatus(self):
# numtests before id
segment1 = """INSTRUMENTATION_STATUS: stream=
INSTRUMENTATION_STATUS: test=testLaunchComplexActivity
INSTRUMENTATION_STATUS: class=LaunchPerformanceTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: numtests=2
INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
INSTRUMENTATION_STATUS_CODE: 1"""
segment2 = """INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testLaunchComplexActivity
INSTRUMENTATION_STATUS: performance.cpu_time=866
INSTRUMENTATION_STATUS: performance.execution_time=1242
INSTRUMENTATION_STATUS: class=LaunchPerformanceTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: numtests=2
INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
INSTRUMENTATION_STATUS_CODE: 0"""
# numtests after id
segment3 = """INSTRUMENTATION_STATUS: stream=
INSTRUMENTATION_STATUS: test=testLaunchSimpleActivity
INSTRUMENTATION_STATUS: class=LaunchPerformanceTest
INSTRUMENTATION_STATUS: current=2
INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
INSTRUMENTATION_STATUS: numtests=8
INSTRUMENTATION_STATUS_CODE: 1"""
segment4 = """INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testLaunchSimpleActivity
INSTRUMENTATION_STATUS: performance.cpu_time=590
INSTRUMENTATION_STATUS: performance.execution_time=1122
INSTRUMENTATION_STATUS: class=LaunchPerformanceTest
INSTRUMENTATION_STATUS: current=2
INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
INSTRUMENTATION_STATUS: numtests=8
INSTRUMENTATION_STATUS_CODE: 0"""
result = am_instrument_parser.TestResult(segment1)
map = result.GetResultFields()
self.assertEquals('testLaunchComplexActivity', map['test'])
self.assertEquals('LaunchPerformanceTest', map['class'])
self.assertEquals('1', map['current'])
self.assertEquals('2', map['numtests'])
self.assertEquals('InstrumentationTestRunner', map['id'])
self.assertEquals(1, result.GetStatusCode())
result = am_instrument_parser.TestResult(segment2)
map = result.GetResultFields()
self.assertEquals('testLaunchComplexActivity', map['test'])
self.assertEquals('866', map['cpu_time'])
self.assertEquals('1242', map['execution_time'])
self.assertEquals('LaunchPerformanceTest', map['class'])
self.assertEquals('1', map['current'])
self.assertEquals('2', map['numtests'])
self.assertEquals('InstrumentationTestRunner', map['id'])
self.assertEquals(0, result.GetStatusCode())
result = am_instrument_parser.TestResult(segment3)
map = result.GetResultFields()
self.assertEquals('testLaunchSimpleActivity', map['test'])
self.assertEquals('LaunchPerformanceTest', map['class'])
self.assertEquals('2', map['current'])
self.assertEquals('8', map['numtests'])
self.assertEquals('InstrumentationTestRunner', map['id'])
self.assertEquals(1, result.GetStatusCode())
result = am_instrument_parser.TestResult(segment4)
map = result.GetResultFields()
self.assertEquals('testLaunchSimpleActivity', map['test'])
self.assertEquals('590', map['cpu_time'])
self.assertEquals('1122', map['execution_time'])
self.assertEquals('LaunchPerformanceTest', map['class'])
self.assertEquals('2', map['current'])
self.assertEquals('8', map['numtests'])
self.assertEquals('InstrumentationTestRunner', map['id'])
self.assertEquals(0, result.GetStatusCode())
def testParseAmInstOutput(self):
result = """INSTRUMENTATION_STATUS: class=LaunchPerformanceTestCase
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
INSTRUMENTATION_STATUS: numtests=2
INSTRUMENTATION_STATUS: stream=
LaunchPerformanceTestCase:
INSTRUMENTATION_STATUS: test=testLaunchComplexActivity
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: class=LaunchPerformanceTestCase
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
INSTRUMENTATION_STATUS: numtests=2
INSTRUMENTATION_STATUS: performance.cpu_time=866
INSTRUMENTATION_STATUS: performance.execution_time=1242
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testLaunchComplexActivity
INSTRUMENTATION_STATUS_CODE: 0
INSTRUMENTATION_STATUS: class=LaunchPerformanceTestCase
INSTRUMENTATION_STATUS: current=2
INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
INSTRUMENTATION_STATUS: numtests=2
INSTRUMENTATION_STATUS: stream=
INSTRUMENTATION_STATUS: test=testLaunchSimpleActivity
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: class=LaunchPerformanceTestCase
INSTRUMENTATION_STATUS: current=2
INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
INSTRUMENTATION_STATUS: numtests=2
INSTRUMENTATION_STATUS: performance.cpu_time=590
INSTRUMENTATION_STATUS: performance.execution_time=1122
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: test=testLaunchSimpleActivity
INSTRUMENTATION_STATUS_CODE: 0
INSTRUMENTATION_RESULT: performance.cpu_time=829
INSTRUMENTATION_RESULT: performance.execution_time=1708
INSTRUMENTATION_RESULT: performance.gc_invocation_count=0
INSTRUMENTATION_RESULT: performance.global_alloc_count=2848
INSTRUMENTATION_RESULT: performance.global_alloc_size=193079
INSTRUMENTATION_RESULT: performance.global_freed_count=1207
INSTRUMENTATION_RESULT: performance.global_freed_size=93040
INSTRUMENTATION_RESULT: performance.java_allocated=2175
INSTRUMENTATION_RESULT: performance.java_free=580
INSTRUMENTATION_RESULT: performance.java_private_dirty=740
INSTRUMENTATION_RESULT: performance.java_pss=1609
INSTRUMENTATION_RESULT: performance.java_shared_dirty=3860
INSTRUMENTATION_RESULT: performance.java_size=2755
INSTRUMENTATION_RESULT: performance.native_allocated=2585
INSTRUMENTATION_RESULT: performance.native_free=34
INSTRUMENTATION_RESULT: performance.native_private_dirty=632
INSTRUMENTATION_RESULT: performance.native_pss=701
INSTRUMENTATION_RESULT: performance.native_shared_dirty=1164
INSTRUMENTATION_RESULT: performance.native_size=2620
INSTRUMENTATION_RESULT: performance.other_private_dirty=896
INSTRUMENTATION_RESULT: performance.other_pss=1226
INSTRUMENTATION_RESULT: performance.other_shared_dirty=804
INSTRUMENTATION_RESULT: performance.pre_received_transactions=-1
INSTRUMENTATION_RESULT: performance.pre_sent_transactions=-1
INSTRUMENTATION_RESULT: performance.received_transactions=-1
INSTRUMENTATION_RESULT: performance.sent_transactions=-1
INSTRUMENTATION_RESULT: stream=
Test results for InstrumentationTestRunner=..
Time: 2.413
OK (2 tests)
INSTRUMENTATION_CODE: -1
"""
(results_list, perf_dict) = \
am_instrument_parser.ParseAmInstrumentOutput(result)
self.assertEquals(829, perf_dict['cpu_time'])
self.assertEquals(2848, perf_dict['global_alloc_count'])
self.assertEquals(93040, perf_dict['global_freed_size'])
self.assertEquals(740, perf_dict['java_private_dirty'])
self.assertEquals(2755, perf_dict['java_size'])
self.assertEquals(632, perf_dict['native_private_dirty'])
self.assertEquals(2620, perf_dict['native_size'])
self.assertEquals(804, perf_dict['other_shared_dirty'])
self.assertEquals(-1, perf_dict['received_transactions'])
self.assertTrue(len(perf_dict['stream']) > 50)
self.assertEquals('-1', perf_dict['code'])
if __name__ == "__main__":
unittest.main()
| 42.376238 | 74 | 0.81764 | 916 | 8,560 | 7.408297 | 0.204148 | 0.198055 | 0.132037 | 0.056587 | 0.653257 | 0.547009 | 0.531388 | 0.51842 | 0.51842 | 0.461981 | 0 | 0.030404 | 0.089369 | 8,560 | 201 | 75 | 42.587065 | 0.840154 | 0.073131 | 0 | 0.553571 | 0 | 0 | 0.667762 | 0.554952 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.017857 | false | 0 | 0.017857 | 0 | 0.041667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
555ace31da053a7da2db3a423d0f06c8201e2215 | 1,486 | py | Python | lsh/utils/strings_utils.py | singhj/locality-sensitive-hashing | 99baa87d3b532ba5aa03fd80ed967275eb98d422 | [
"MIT"
] | 19 | 2015-02-22T15:47:33.000Z | 2020-10-19T12:29:24.000Z | lsh/utils/strings_utils.py | singhj/locality-sensitive-hashing | 99baa87d3b532ba5aa03fd80ed967275eb98d422 | [
"MIT"
] | 7 | 2015-02-10T10:52:06.000Z | 2019-04-01T15:27:00.000Z | lsh/utils/strings_utils.py | singhj/locality-sensitive-hashing | 99baa87d3b532ba5aa03fd80ed967275eb98d422 | [
"MIT"
] | 7 | 2015-02-23T19:22:11.000Z | 2022-02-04T10:27:15.000Z | import re
import string
DEFAULT_TOKENIZER_DELIMITER = ' '
def remove_all_whitespace(str):
"""
Strips all whitespace from a given string.
:return: new string without whitespaces, will return the original string if it is empty or None
"""
if str:
return re.sub(r'\s+', '', str)
else:
return str
def tokenize(str, delimiter=DEFAULT_TOKENIZER_DELIMITER):
"""
Splits a string by a given delimiter. Default delimiter is a single whitespace.
:return: list of string tokens, will return the original string if it is empty or None
"""
if str:
return str.split(delimiter)
else:
return str
def normalize(str):
"""
Normalizes the string making string all lower case and removes all punctuation.
:param str: string to be normalized
:return: normalized string, if str is None or empty it returns the original string
"""
if str:
if isinstance(str, unicode):
not_letters_or_digits = u'!"#%\'()*+,-./:;<=>?@[\]^_`{|}~'
translate_to = u''
translate_table = dict((ord(char), translate_to) for char in not_letters_or_digits)
return str.translate(translate_table)
else:
return str.lower().translate(string.maketrans("",""), string.punctuation)
else:
return str
def get_stem(word):
#TODO: Research stemming libraries and implement method using library functions
return word | 31.617021 | 103 | 0.638627 | 187 | 1,486 | 4.97861 | 0.42246 | 0.058002 | 0.055854 | 0.061224 | 0.118153 | 0.118153 | 0.118153 | 0.118153 | 0.118153 | 0.118153 | 0 | 0 | 0.26716 | 1,486 | 47 | 104 | 31.617021 | 0.854913 | 0.392328 | 0 | 0.384615 | 0 | 0 | 0.011057 | 0 | 0 | 0 | 0 | 0.021277 | 0 | 1 | 0.153846 | false | 0 | 0.076923 | 0.038462 | 0.538462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
555c570c4c6a6730fa30ecfe8e90f75d0f074688 | 1,010 | py | Python | gabin/choice.py | Langenfeld/gabin | 45f54dff5b3cda7da4c1b46cde020dc178bd05e9 | [
"MIT"
] | 1 | 2018-06-21T15:57:38.000Z | 2018-06-21T15:57:38.000Z | gabin/choice.py | Langenfeld/gabin | 45f54dff5b3cda7da4c1b46cde020dc178bd05e9 | [
"MIT"
] | null | null | null | gabin/choice.py | Langenfeld/gabin | 45f54dff5b3cda7da4c1b46cde020dc178bd05e9 | [
"MIT"
] | null | null | null | from typing import List
from menuParser import MenuParser
class Choice:
def __init__(self, ident: str, name: str, menuParser: MenuParser):
self.ident = ident
self.name = name
self.menuParser = menuParser
self.enabled = True
self.yes = 0
self.maybe = 0
self.no = 0
def getAsTuple(self) -> tuple:
return (self.ident, self.name)
def updateMenu(self, nowDate: str):
self.menuParser.updateMenu(nowDate)
def getMenu(self) -> List[str]:
return self.menuParser.getMenu()
def getHasOpened(self) -> bool:
return self.menuParser.open
def countVotes(self, votes: dict):
self.no, self.maybe, self.yes = 0, 0, 0
for session, values in votes.items():
for key, value in values.items():
if key == self.ident:
if value == "0": self.no += 1
if value == "1": self.maybe += 1
if value == "2": self.yes += 1
| 28.055556 | 70 | 0.559406 | 123 | 1,010 | 4.560976 | 0.333333 | 0.064171 | 0.085562 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017725 | 0.329703 | 1,010 | 35 | 71 | 28.857143 | 0.810931 | 0 | 0 | 0 | 0 | 0 | 0.00297 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.074074 | 0.111111 | 0.444444 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
555cbdc752880f4b7184c09424c0d7c35c29b349 | 614 | py | Python | tests/hyperion/metrics/test_acc.py | jsalt2019-diadet/hyperion | 14a11436d62f3c15cd9b1f70bcce3eafbea2f753 | [
"Apache-2.0"
] | 9 | 2019-09-22T05:19:59.000Z | 2022-03-05T18:03:37.000Z | tests/hyperion/metrics/test_acc.py | jsalt2019-diadet/hyperion | 14a11436d62f3c15cd9b1f70bcce3eafbea2f753 | [
"Apache-2.0"
] | null | null | null | tests/hyperion/metrics/test_acc.py | jsalt2019-diadet/hyperion | 14a11436d62f3c15cd9b1f70bcce3eafbea2f753 | [
"Apache-2.0"
] | 4 | 2019-10-10T06:34:05.000Z | 2022-03-05T18:03:56.000Z | """
Copyright 2018 Johns Hopkins University (Author: Jesus Villalba)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from six.moves import xrange
import pytest
import os
import numpy as np
from numpy.testing import assert_allclose
from hyperion.metrics.acc import compute_accuracy
def test_compute_accuracy():
y_true = np.arange(10, dtype='int32')
y_pred = np.arange(10, dtype='int32')
y_pred[:3] = 5
acc = compute_accuracy(y_true, y_pred)
assert acc == 0.7
| 22.740741 | 66 | 0.745928 | 92 | 614 | 4.717391 | 0.554348 | 0.069124 | 0.110599 | 0.092166 | 0.115207 | 0.115207 | 0.115207 | 0 | 0 | 0 | 0 | 0.038986 | 0.164495 | 614 | 26 | 67 | 23.615385 | 0.807018 | 0.198697 | 0 | 0 | 0 | 0 | 0.020747 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 1 | 0.066667 | false | 0 | 0.6 | 0 | 0.666667 | 0.066667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
55633a9ee96b15a82ca62ea8fa771013efffc130 | 138 | py | Python | params/scenarios/aggregate.py | systemsecologygroup/EasterIslandABM | bcd2e1268b41a549c6e47508650ec2ce8958ad1b | [
"MIT"
] | null | null | null | params/scenarios/aggregate.py | systemsecologygroup/EasterIslandABM | bcd2e1268b41a549c6e47508650ec2ce8958ad1b | [
"MIT"
] | null | null | null | params/scenarios/aggregate.py | systemsecologygroup/EasterIslandABM | bcd2e1268b41a549c6e47508650ec2ce8958ad1b | [
"MIT"
] | null | null | null | params_scenario = {
"n_agents_arrival": 1,
"p_split_threshold": int(1e10),
"r_t": 100,
"r_f": 100,
"gamma": 0, # 0
}
| 17.25 | 35 | 0.543478 | 20 | 138 | 3.4 | 0.85 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.118812 | 0.268116 | 138 | 7 | 36 | 19.714286 | 0.554455 | 0.007246 | 0 | 0 | 0 | 0 | 0.325926 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
55873fd932147ab4bed084a859a245527e0cf5e0 | 68 | py | Python | osm_dq/__init__.py | openearth/hydro-osm | a42aec9f4b72a397887e71f664326b4de4fb5b2b | [
"MIT"
] | 10 | 2017-09-16T09:36:18.000Z | 2020-06-09T05:06:56.000Z | osm_dq/__init__.py | openearth/hydro-osm | a42aec9f4b72a397887e71f664326b4de4fb5b2b | [
"MIT"
] | null | null | null | osm_dq/__init__.py | openearth/hydro-osm | a42aec9f4b72a397887e71f664326b4de4fb5b2b | [
"MIT"
] | 5 | 2018-02-05T00:10:45.000Z | 2020-08-10T03:18:32.000Z | __all__ = ["check", "tasks", "filter", "io", "config", "log", "utm"] | 68 | 68 | 0.544118 | 8 | 68 | 4.125 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 68 | 1 | 68 | 68 | 0.55 | 0 | 0 | 0 | 0 | 0 | 0.434783 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
558eeaee58601b878bd9001cff935b5b4dfb4f7c | 1,343 | py | Python | setup.py | ucl-tbr-group-project/regression | ab02f62cdf83ffc43d9b8e88b0c1833190d65b95 | [
"MIT"
] | null | null | null | setup.py | ucl-tbr-group-project/regression | ab02f62cdf83ffc43d9b8e88b0c1833190d65b95 | [
"MIT"
] | null | null | null | setup.py | ucl-tbr-group-project/regression | ab02f62cdf83ffc43d9b8e88b0c1833190d65b95 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='tbr_reg',
version='1.0.0',
author='Petr Mánek, Graham Van Goffrier',
packages=find_packages(exclude=['*tests']),
install_requires=['numpy', 'matplotlib',
'pandas', 'scikit-learn',
'keras', 'pyqt5', 'joblib',
'scikit-optimize', 'smt',
'tensorflow'],
entry_points={
'console_scripts': [
'tbr_train = tbr_reg.endpoints.training:main',
'tbr_ae = tbr_reg.endpoints.autoencoder:main',
'tbr_split = tbr_reg.endpoints.split_batches:main',
'tbr_eval = tbr_reg.endpoints.evaluation:main',
'tbr_eval_ho = tbr_reg.endpoints.evaluation_hyperopt:main',
'tbr_eval_benchmark = tbr_reg.endpoints.evaluation_benchmark:main',
'tbr_search = tbr_reg.endpoints.search:main',
'tbr_search_benchmark = tbr_reg.endpoints.search_benchmark:main',
'tbr_qass1 = tbr_reg.endpoints.qass_v1:main',
'tbr_qass2 = tbr_reg.endpoints.qass_v2:main',
'tbr_qass3 = tbr_reg.endpoints.qass_v3:main',
'tbr_fakeqass = tbr_reg.endpoints.qass_fake:main'
],
'gui_scripts': [
'tbr_visualizer = tbr_reg.endpoints.visualizer:main'
]}
)
| 41.96875 | 79 | 0.599404 | 147 | 1,343 | 5.176871 | 0.421769 | 0.110381 | 0.256242 | 0.099869 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010299 | 0.276992 | 1,343 | 31 | 80 | 43.322581 | 0.773429 | 0 | 0 | 0 | 0 | 0 | 0.578555 | 0.329114 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.033333 | 0 | 0.033333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
5593b6c00026a7eb9934a738b48a1bd4b7b78c89 | 152 | py | Python | scopes/__init__.py | leg100/scopes | 6a31908acf44b9f65f25668230197ed13229a80d | [
"MIT"
] | null | null | null | scopes/__init__.py | leg100/scopes | 6a31908acf44b9f65f25668230197ed13229a80d | [
"MIT"
] | 1 | 2021-11-15T17:47:40.000Z | 2021-11-15T17:47:40.000Z | scopes/__init__.py | leg100/scopes | 6a31908acf44b9f65f25668230197ed13229a80d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for Scopes."""
__author__ = """Louis Garman"""
__email__ = 'louisgarman@gmail.com'
__version__ = '0.1.1'
| 19 | 35 | 0.638158 | 19 | 152 | 4.473684 | 0.947368 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030534 | 0.138158 | 152 | 7 | 36 | 21.714286 | 0.618321 | 0.342105 | 0 | 0 | 0 | 0 | 0.404255 | 0.223404 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
559fc9c9763329272233088f73293ca0c42729c7 | 454 | py | Python | tests/test_helpers.py | arunshan04/pigpy | 8ff0a7340f4eb8e22726b55786111b6cbce79df6 | [
"MIT"
] | 1 | 2015-11-05T18:21:26.000Z | 2015-11-05T18:21:26.000Z | tests/test_helpers.py | edisona/pigpy | 8ff0a7340f4eb8e22726b55786111b6cbce79df6 | [
"MIT"
] | null | null | null | tests/test_helpers.py | edisona/pigpy | 8ff0a7340f4eb8e22726b55786111b6cbce79df6 | [
"MIT"
] | null | null | null | import sys
import os
import unittest
from pigpy.reports import Report, Plan
from pigpy.helpers import filter_report
class test_helpers(unittest.TestCase):
def setUp(self):
self.report = Report("to_filter", "%(this)s = LOAD 'bears.txt'")
def test_basic_filter(self):
basic = Plan(reports=[filter_report(self.report, "$0 == 0")])
self.assert_("to_filter" in basic.pigfile)
self.assert_("$0 == 0" in basic.pigfile)
| 30.266667 | 72 | 0.685022 | 64 | 454 | 4.71875 | 0.4375 | 0.059603 | 0.092715 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010811 | 0.185022 | 454 | 14 | 73 | 32.428571 | 0.805405 | 0 | 0 | 0 | 0 | 0 | 0.129956 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0.166667 | false | 0 | 0.416667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
55bf7fa8ba91ac765f296cd53427b70fd6894497 | 643 | py | Python | tests/test_news_source.py | Alice-Githui/News-App | 0becc86191a999962115d1684dec3a03bb9e8ab3 | [
"MIT"
] | null | null | null | tests/test_news_source.py | Alice-Githui/News-App | 0becc86191a999962115d1684dec3a03bb9e8ab3 | [
"MIT"
] | null | null | null | tests/test_news_source.py | Alice-Githui/News-App | 0becc86191a999962115d1684dec3a03bb9e8ab3 | [
"MIT"
] | null | null | null | import unittest
from app.models import NewsSource
NewsSource = news_source.NewsSource
class NewsSourceTest(unittest.TestCase):
'''
Test Class to test the behaviour of the News Source class
'''
def setUp(self):
'''
set up method that runs before every test
'''
self.new_news_source = NewsSource("Reuters","LifeHacker","What You Need to Know About Buying Cryptocurrency on PayPal","https://lifehacker.com/what-you-need-to-know-about-buying-crypt-on-pa-1846585705","Business", "English", 'US')
def test_instance(self):
self.assertTrue(isinstance(self.new_news_source, NewsSource))
| 32.15 | 238 | 0.70451 | 83 | 643 | 5.385542 | 0.590361 | 0.089485 | 0.134228 | 0.076063 | 0.246085 | 0.12528 | 0.12528 | 0 | 0 | 0 | 0 | 0.019084 | 0.18507 | 643 | 19 | 239 | 33.842105 | 0.833969 | 0.153966 | 0 | 0 | 0 | 0.125 | 0.342574 | 0 | 0 | 0 | 0 | 0 | 0.125 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
e987475e3e2a4ee22903df0ad6c35ea70dee1410 | 548 | py | Python | packages_and_modules/relative_import_from_main/main.py | PovelikinRostislav/python-udemy | acbb0e64be4a0cfe788678857f08880ce96a227a | [
"Apache-2.0"
] | null | null | null | packages_and_modules/relative_import_from_main/main.py | PovelikinRostislav/python-udemy | acbb0e64be4a0cfe788678857f08880ce96a227a | [
"Apache-2.0"
] | null | null | null | packages_and_modules/relative_import_from_main/main.py | PovelikinRostislav/python-udemy | acbb0e64be4a0cfe788678857f08880ce96a227a | [
"Apache-2.0"
] | null | null | null | import unittest
class TestRelativeImport(unittest.TestCase):
def test_relative_import(self):
with self.assertRaises(ModuleNotFoundError):
print(f"__name__ is {__name__}")
print(f"__package__ is {__package__}")
print("From main modules it's not allowed to use relative imports.")
print("AFAIK, if __package__ is None, then relative imports are not allowed either, even if the __name__ is not __main__")
from .module import foo
if __name__ == "__main__":
unittest.main()
| 36.533333 | 134 | 0.678832 | 66 | 548 | 5.060606 | 0.560606 | 0.035928 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.239051 | 548 | 14 | 135 | 39.142857 | 0.800959 | 0 | 0 | 0 | 0 | 0.090909 | 0.420475 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 1 | 0.090909 | false | 0 | 0.545455 | 0 | 0.727273 | 0.363636 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
e9967e5f242fd274da3387719be92e2f063a2c6c | 1,286 | py | Python | textbeat/plugins/fluidsynth.py | cuppajoeman/textbeat | 2dc29c9dc80038d7d45c9687fd91d2d64cac6d1c | [
"MIT"
] | 231 | 2018-08-18T08:10:09.000Z | 2022-03-21T02:35:19.000Z | textbeat/plugins/fluidsynth.py | cuppajoeman/textbeat | 2dc29c9dc80038d7d45c9687fd91d2d64cac6d1c | [
"MIT"
] | 9 | 2018-09-15T20:53:42.000Z | 2022-02-04T20:16:18.000Z | textbeat/plugins/fluidsynth.py | cuppajoeman/textbeat | 2dc29c9dc80038d7d45c9687fd91d2d64cac6d1c | [
"MIT"
] | 7 | 2019-02-21T00:56:35.000Z | 2022-02-20T16:32:10.000Z | #!/usr/bin/env python
import textbeat.instrument as instrument
from textbeat.instrument import Instrument
from shutilwhich import which
ERROR = False
if which('fluidsynth'):
try:
import fluidsynth # https://github.com/flipcoder/pyfluidsynth
except:
ERROR = True
else:
ERROR = True
class FluidSynth(Instrument):
NAME = 'fluidsynth'
def __init__(self, args):
Instrument.__init__(self, FluidSynth.NAME)
self.initialized = False
self.enabled = False
self.soundfonts = []
def init(self):
self.initialized = True
def inited(self):
return self.initialized
def enabled(self):
return self.enabled
def enable(self):
self.fs = fluidsynth.Synth()
self.enabled = True
def soundfont(self, fn, track, bank, preset):
sfid = self.fs.sfload(fn)
self.fs.program_select(track, sfid, bank, preset)
return sfid
def supported(self):
return not ERROR
def support(self):
return ['fluidsynth','soundfonts']
def note_on(self, t, n, v):
self.fs.noteon(t, n, v)
def note_off(self, t, n, v):
self.fs.noteoff(t, v)
pass
def stop(self):
pass
# instrument.export(FluidSynth)
export = FluidSynth
| 25.72 | 69 | 0.628305 | 156 | 1,286 | 5.108974 | 0.391026 | 0.037641 | 0.011292 | 0.017566 | 0.032622 | 0.032622 | 0 | 0 | 0 | 0 | 0 | 0 | 0.267496 | 1,286 | 49 | 70 | 26.244898 | 0.846072 | 0.07154 | 0 | 0.093023 | 0 | 0 | 0.033613 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.255814 | false | 0.046512 | 0.093023 | 0.093023 | 0.511628 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
e99c11c5939df371670bab260b390761fa5f3e2c | 431 | py | Python | tests/sample/fstring.py | JarryShaw/walrus | cb748496974c4c8b1a68907d46eff2845db75e84 | [
"MIT"
] | 4 | 2020-06-01T17:38:15.000Z | 2022-03-26T12:01:16.000Z | tests/sample/fstring.py | pybpc/walrus | cb748496974c4c8b1a68907d46eff2845db75e84 | [
"MIT"
] | 23 | 2020-05-31T09:24:49.000Z | 2021-02-22T19:29:23.000Z | tests/sample/fstring.py | pybpc/walrus | cb748496974c4c8b1a68907d46eff2845db75e84 | [
"MIT"
] | 1 | 2019-11-09T00:34:37.000Z | 2019-11-09T00:34:37.000Z | print(f'{(x := "awesome")!r:20}', x)
class A:
locals = 555
print(f'{(y := 666)}')
print(y)
print(f'''L1 -> {f"""L2 -> {f'L3 -> {f"L4 -> {(z := chr(77))!r} <- L4"} <- L3'} <- L2"""} <- L1''')
print(z)
print(f'see -> {"header " + f"{(w := chr(88))}" + " footer"} <- see')
print(w)
print(locals)
print(globals().get('y'))
print(globals().get('z'))
print(globals().get('w'))
print(callable(locals))
| 22.684211 | 103 | 0.468677 | 65 | 431 | 3.107692 | 0.415385 | 0.118812 | 0.222772 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.058309 | 0.204176 | 431 | 18 | 104 | 23.944444 | 0.530612 | 0 | 0 | 0 | 0 | 0.071429 | 0.422274 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0.142857 | 0.857143 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
e9a1e84dbb83bf941e132c303183ec337621a094 | 390 | py | Python | tests/integration/test_random_user.py | textbook/pyasq | 0736c38d66994662b42a386896680daa168f5057 | [
"0BSD"
] | null | null | null | tests/integration/test_random_user.py | textbook/pyasq | 0736c38d66994662b42a386896680daa168f5057 | [
"0BSD"
] | null | null | null | tests/integration/test_random_user.py | textbook/pyasq | 0736c38d66994662b42a386896680daa168f5057 | [
"0BSD"
] | 1 | 2021-03-26T08:47:17.000Z | 2021-03-26T08:47:17.000Z | import pytest
from examples.random_user import demonstrate, RandomUser
@pytest.fixture
def api():
return RandomUser()
def test_endpoint_url(api):
assert api.user.url == 'https://randomuser.me/api/'
def test_get(api):
user = api.user.get().results[0]
assert isinstance(user.gender, str)
assert isinstance(user.name.first, str)
def test_demo():
demonstrate()
| 16.956522 | 56 | 0.707692 | 53 | 390 | 5.113208 | 0.509434 | 0.077491 | 0.147601 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003077 | 0.166667 | 390 | 22 | 57 | 17.727273 | 0.830769 | 0 | 0 | 0 | 0 | 0 | 0.066667 | 0 | 0 | 0 | 0 | 0 | 0.230769 | 1 | 0.307692 | false | 0 | 0.153846 | 0.076923 | 0.538462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
e9a4568992430a0fd4b94bf597bb1ac56a473679 | 224 | py | Python | examples/todo_app/app/config.py | MarkoShiva/quart | f6709c6082a3cab9dffdcd937122f4d65a5990f7 | [
"MIT"
] | 1,085 | 2017-11-12T10:56:50.000Z | 2022-03-31T15:14:26.000Z | examples/todo_app/app/config.py | MarkoShiva/quart | f6709c6082a3cab9dffdcd937122f4d65a5990f7 | [
"MIT"
] | 139 | 2017-12-04T09:22:48.000Z | 2022-03-26T08:34:07.000Z | examples/todo_app/app/config.py | MarkoShiva/quart | f6709c6082a3cab9dffdcd937122f4d65a5990f7 | [
"MIT"
] | 92 | 2017-12-08T09:55:02.000Z | 2022-03-29T20:45:44.000Z | from pathlib import Path
path = Path().absolute()
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_DATABASE_URI = "sqlite:///" + str(path) + "/Database/database.db"
SECRET_KEY = "e9515dfe457bfe64c1c30d73e161de0f76f6b03f"
| 28 | 76 | 0.785714 | 23 | 224 | 7.434783 | 0.73913 | 0.093567 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.113861 | 0.098214 | 224 | 7 | 77 | 32 | 0.732673 | 0 | 0 | 0 | 0 | 0 | 0.316964 | 0.272321 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
e9a99aba7916af868bf3472c26a50efe42bc433a | 111 | py | Python | src/constants.py | stavros2/Distributed_Lab | a43139e26020e23e0ddf194743015189f70a1071 | [
"MIT"
] | 3 | 2021-07-22T21:12:23.000Z | 2021-12-28T13:10:44.000Z | src/constants.py | stavros2/Distributed_Lab | a43139e26020e23e0ddf194743015189f70a1071 | [
"MIT"
] | null | null | null | src/constants.py | stavros2/Distributed_Lab | a43139e26020e23e0ddf194743015189f70a1071 | [
"MIT"
] | null | null | null | # all the important constants for the system are stored here
CAPACITY = 5;
MINING_DIFFICULTY = 4;
NODES = 5; | 27.75 | 61 | 0.738739 | 17 | 111 | 4.764706 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033708 | 0.198198 | 111 | 4 | 62 | 27.75 | 0.876404 | 0.522523 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
e9d22a95d4ad0dbda74a37a519a683d96967d451 | 213 | py | Python | src/collect_user_statistics_mapper0.py | canek13/Recomendation-system-for-film-ranking | 1c414ff222c3e795407ac927b262e05df708fcef | [
"MIT"
] | null | null | null | src/collect_user_statistics_mapper0.py | canek13/Recomendation-system-for-film-ranking | 1c414ff222c3e795407ac927b262e05df708fcef | [
"MIT"
] | null | null | null | src/collect_user_statistics_mapper0.py | canek13/Recomendation-system-for-film-ranking | 1c414ff222c3e795407ac927b262e05df708fcef | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import numpy
import sys
for line in sys.stdin:
user, movie, rating, _ = line.strip().split(',')
if user != 'userId':
print('%s\t%s\t%s' % (user, movie, str(float(rating) / 5)))
| 23.666667 | 67 | 0.591549 | 33 | 213 | 3.787879 | 0.69697 | 0.144 | 0.048 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011765 | 0.201878 | 213 | 8 | 68 | 26.625 | 0.723529 | 0.079812 | 0 | 0 | 0 | 0 | 0.087179 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.166667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
e9e0b17258ac4e05e2b45f6bb6c2fba0c10e0dd7 | 841 | py | Python | home/migrations/0006_auto_20220326_0732.py | SeanCodeMedia/codeMedia-django | 734284859e35f24bc4a0131154f175614804d4fa | [
"MIT"
] | null | null | null | home/migrations/0006_auto_20220326_0732.py | SeanCodeMedia/codeMedia-django | 734284859e35f24bc4a0131154f175614804d4fa | [
"MIT"
] | null | null | null | home/migrations/0006_auto_20220326_0732.py | SeanCodeMedia/codeMedia-django | 734284859e35f24bc4a0131154f175614804d4fa | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2022-03-26 11:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0005_auto_20220326_0726'),
]
operations = [
migrations.AlterField(
model_name='home',
name='facebook',
field=models.CharField(default='https://www.facebook.com/', max_length=500),
),
migrations.AlterField(
model_name='home',
name='instagram',
field=models.CharField(default='https://www.instagram.com/?hl=en', max_length=500),
),
migrations.AlterField(
model_name='home',
name='youtube',
field=models.CharField(default='https://www.youtube.com/channel/UC8qa9USnmzi-ewkXTMiZ9LA', max_length=500),
),
]
| 29 | 119 | 0.593341 | 88 | 841 | 5.568182 | 0.522727 | 0.122449 | 0.153061 | 0.177551 | 0.489796 | 0.489796 | 0.2 | 0.2 | 0.2 | 0 | 0 | 0.070147 | 0.271106 | 841 | 28 | 120 | 30.035714 | 0.729201 | 0.053508 | 0 | 0.409091 | 1 | 0 | 0.221662 | 0.028967 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.045455 | 0 | 0.181818 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
756973da466d1aae1790936755c0460fcc4232b9 | 280 | py | Python | src/main.py | fguattari/dl4collegehousingprices | 33bc54f61166bc4ff1d7d7ee62317df1d743c1a7 | [
"Apache-2.0"
] | null | null | null | src/main.py | fguattari/dl4collegehousingprices | 33bc54f61166bc4ff1d7d7ee62317df1d743c1a7 | [
"Apache-2.0"
] | null | null | null | src/main.py | fguattari/dl4collegehousingprices | 33bc54f61166bc4ff1d7d7ee62317df1d743c1a7 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
# historical == training data
# realtime == testing data
df = l.csv")
df1 = pd.read_csv("data/r_realtime.csv")
print(df)
print(df1)
| 18.666667 | 52 | 0.778571 | 42 | 280 | 5.071429 | 0.642857 | 0.103286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008264 | 0.135714 | 280 | 14 | 53 | 20 | 0.871901 | 0 | 0 | 0 | 0 | 0 | 0.084444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.5 | null | null | 0.25 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
756ea39610219294fd2a55acd8b1e85857e893ed | 2,163 | py | Python | src/Project 2/commerce/auctions/models.py | aminbeigi/CS50W-Projects | 905f53b1ebf057340114c2ca0283bcac64a16609 | [
"MIT"
] | null | null | null | src/Project 2/commerce/auctions/models.py | aminbeigi/CS50W-Projects | 905f53b1ebf057340114c2ca0283bcac64a16609 | [
"MIT"
] | null | null | null | src/Project 2/commerce/auctions/models.py | aminbeigi/CS50W-Projects | 905f53b1ebf057340114c2ca0283bcac64a16609 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils import timezone
from django.core.validators import MinValueValidator
from decimal import Decimal
class User(AbstractUser):
pass
class Category(models.Model):
name = models.CharField(max_length=25)
slug_name = models.CharField(max_length=25)
description = models.TextField(max_length=255)
def __str__(self):
return f'{self.name}'
class Listing(models.Model):
title = models.CharField(max_length=25)
description = models.TextField(max_length=600)
date_posted = models.DateTimeField(default=timezone.now)
price = models.DecimalField(max_digits=12, decimal_places=2, default=0.00, validators=[MinValueValidator(Decimal('0.01'))])
image = models.ImageField(default='default.jpg', upload_to='images', blank=True)
category = models.ForeignKey(Category, on_delete=models.CASCADE, related_name="categories", null=True)
author = models.ForeignKey(User, on_delete=models.CASCADE)
def __str__(self):
return f'{self.title}'
class Comment(models.Model):
comment = models.TextField(max_length=100)
date_posted = models.DateTimeField(default=timezone.now)
author = models.ForeignKey(User, on_delete=models.CASCADE)
listing = models.ForeignKey(Listing, on_delete=models.CASCADE, default=None, related_name='comments')
def __str__(self):
return f"comment by {self.author.username} in {self.listing.title}"
class Bid(models.Model):
price = models.DecimalField(max_digits=8, decimal_places=2, default=0.00, validators=[MinValueValidator(Decimal('0.01'))])
user = models.ForeignKey(User, on_delete=models.CASCADE)
listing = models.ForeignKey(Listing, on_delete=models.CASCADE, related_name="bids")
def __str__(self):
return f"bid by {self.listing} by {self.author.username} @ ${self.price}"
class Watchlist(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
listing = models.ForeignKey(Listing, on_delete=models.CASCADE, related_name="listings")
def __str__(self):
return f"watchlist of {self.author.username}" | 39.327273 | 127 | 0.74295 | 280 | 2,163 | 5.575 | 0.282143 | 0.081999 | 0.071749 | 0.107623 | 0.589366 | 0.515695 | 0.446509 | 0.386291 | 0.352338 | 0.352338 | 0 | 0.017149 | 0.137309 | 2,163 | 55 | 128 | 39.327273 | 0.8194 | 0 | 0 | 0.268293 | 0 | 0.02439 | 0.107671 | 0.030499 | 0 | 0 | 0 | 0 | 0 | 1 | 0.121951 | false | 0.02439 | 0.121951 | 0.121951 | 0.97561 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
759186149621404bc61a7251ffcc60c996502aaa | 183 | py | Python | src/test/nspawn_test/wrapper/nsenter_test.py | Andrei-Pozolotin/nspawn | 9dd3926f1d1a3a0648f6ec14199cbf4069af1c98 | [
"Apache-2.0"
] | 15 | 2019-10-10T17:35:48.000Z | 2022-01-29T10:41:01.000Z | src/test/nspawn_test/wrapper/nsenter_test.py | Andrei-Pozolotin/nspawn | 9dd3926f1d1a3a0648f6ec14199cbf4069af1c98 | [
"Apache-2.0"
] | null | null | null | src/test/nspawn_test/wrapper/nsenter_test.py | Andrei-Pozolotin/nspawn | 9dd3926f1d1a3a0648f6ec14199cbf4069af1c98 | [
"Apache-2.0"
] | 2 | 2019-10-10T17:36:43.000Z | 2020-06-20T15:28:33.000Z |
from nspawn.wrapper.nsenter import *
def test_nsenter():
print()
machine = "nspawn-image-server"
script = "id; env; exit"
# NSENTER.execute_invoke(machine, script)
| 18.3 | 45 | 0.672131 | 22 | 183 | 5.5 | 0.772727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.202186 | 183 | 9 | 46 | 20.333333 | 0.828767 | 0.213115 | 0 | 0 | 0 | 0 | 0.233577 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.4 | 0.2 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
759c4b783c1d32a58569b1ef5f217e3736713e7f | 890 | py | Python | cli/geo_cli/model/feature.py | tetherless-world/twxplore-geo-app | a94ee22aad56817ce8cd87b809df715ee3fee6ad | [
"Apache-2.0"
] | null | null | null | cli/geo_cli/model/feature.py | tetherless-world/twxplore-geo-app | a94ee22aad56817ce8cd87b809df715ee3fee6ad | [
"Apache-2.0"
] | 26 | 2020-07-01T14:47:21.000Z | 2020-07-01T14:51:33.000Z | cli/geo_cli/model/feature.py | tetherless-world/twxplore-geo-app | a94ee22aad56817ce8cd87b809df715ee3fee6ad | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from typing import Optional, Tuple, NamedTuple
from rdflib import URIRef
from geo_cli.model.geometry import Geometry
class Feature(NamedTuple):
geometry: Geometry
label: str
uri: URIRef
locality: Optional[str] = None
frequency: Optional[float] = None
frequency_range: Optional[Tuple[float, float]] = None
postal_code: Optional[str] = None
regions: Optional[Tuple[str, ...]] = None
timestamp: Optional[datetime] = None
timestamp_range: Optional[Tuple[datetime, datetime]] = None
transmission_power: Optional[int] = None
type: Optional[URIRef] = None
# if regions is not None:
# for region in regions:
# if region not in STATE_NAMES:
# logging.warning("region not a state name: %s", region)
# if timestamp is not None:
# assert timestamp.tzinfo is not None
| 30.689655 | 72 | 0.680899 | 110 | 890 | 5.454545 | 0.418182 | 0.086667 | 0.045 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.232584 | 890 | 28 | 73 | 31.785714 | 0.878477 | 0.248315 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.235294 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
75a0ef1b60ce52bb36ae88b2ea3405dbef234f39 | 682 | py | Python | alipay/aop/api/response/AlipayFundTransPayeeBindQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayFundTransPayeeBindQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayFundTransPayeeBindQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayFundTransPayeeBindQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayFundTransPayeeBindQueryResponse, self).__init__()
self._bind = None
@property
def bind(self):
return self._bind
@bind.setter
def bind(self, value):
self._bind = value
def parse_response_content(self, response_content):
response = super(AlipayFundTransPayeeBindQueryResponse, self).parse_response_content(response_content)
if 'bind' in response:
self.bind = response['bind']
| 26.230769 | 110 | 0.70088 | 70 | 682 | 6.585714 | 0.442857 | 0.069414 | 0.199566 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001842 | 0.203812 | 682 | 25 | 111 | 27.28 | 0.847145 | 0.061584 | 0 | 0 | 0 | 0 | 0.012539 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0.0625 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
75a83d4b8306ef9470fc98559b99f43b3b4d9706 | 5,649 | py | Python | scripts/make_mosaic.py | mtanida/augdat | 96c2edeae277ac09d148e0d469124a2b970318b3 | [
"CC0-1.0"
] | 103 | 2016-01-06T13:59:06.000Z | 2021-11-03T21:38:05.000Z | scripts/make_mosaic.py | mtanida/augdat | 96c2edeae277ac09d148e0d469124a2b970318b3 | [
"CC0-1.0"
] | 3 | 2016-01-06T14:36:54.000Z | 2016-09-29T16:20:58.000Z | scripts/make_mosaic.py | mtanida/augdat | 96c2edeae277ac09d148e0d469124a2b970318b3 | [
"CC0-1.0"
] | 10 | 2016-01-07T13:43:49.000Z | 2021-11-30T14:56:39.000Z | # -*- coding: utf-8 -*-
# Description: generates a mosaic image based on a list of UUIDs
# Example usage:
# python make_mosaic.py ../data/src/pd_items.json ../img/mosaic_800x480.jpg w 800 480 0.2 0.66 10
import json
import math
import os
from PIL import Image
from pprint import pprint
import re
import sys
import urllib2
# input
if len(sys.argv) < 8:
print "Usage: %s <inputfile items json> <output file> <derivative size> <target w> <target h> <cell h start multiplier> <cell h multiplier> <min cell h>" % sys.argv[0]
sys.exit(1)
INPUT_FILE = sys.argv[1]
OUTPUT_FILE = sys.argv[2]
DERIV_CODE = sys.argv[3]
IMAGE_W = int(sys.argv[4])
IMAGE_H = int(sys.argv[5])
CELL_H_MULTIPLIER_START = float(sys.argv[6])
CELL_H_MULTIPLIER = float(sys.argv[7])
MIN_CELL_H = int(sys.argv[8])
# config
imageURLPatternFind = '^http://images\.nypl\.org/index\.php\?id=([^&]+)&t=g$'
imageURLPattern = "http://images.nypl.org/index.php?id=%s&t=" + DERIV_CODE
tmpFolder = "../tmp/"
imageExt = "jpg"
overwriteExisting = False
# a list of item/collection UUIDs
uuids = [
'812e5770-c60c-012f-7167-58d385a7bc34',
# 'e5462600-c5d9-012f-a6a3-58d385a7bc34',
'9ea5d5b0-1117-0132-7932-58d385a7b928',
'56605f50-c6cc-012f-3e5a-58d385a7bc34',
'ab394b60-d4bc-0131-8bd5-58d385a7bbd0',
'8031e230-c612-012f-3daf-58d385a7bc34',
# 'd533f0b0-c5ca-012f-d4a0-58d385a7bc34',
# '6c7dc4f0-c5f5-012f-ff48-58d385a7bc34',
# '34007fd0-c6d2-012f-5566-58d385a7bc34',
'0c73c6d0-c62b-012f-f421-58d385a7bc34',
'2c2da8e0-c6da-012f-0f26-58d385a7bc34',
# '35301010-c58d-012f-1196-58d385a7bc34',
# 'e020e560-c62d-012f-a0f9-58d385a7bc34',
'f1c763b0-c5dd-012f-5b39-58d385a7bc34',
# '41394870-c6b7-012f-942c-3c075448cc4b'
'28d304b0-c612-012f-cd39-58d385a7bc34'
]
excludeCaptures = [
'1229586',
'1229587',
'1229595',
'1229594',
'1229616',
'1161039',
'5206296',
'1229601',
'419504',
'1229590',
'1229610',
'1229611',
'1229583',
'1229582',
'419559',
'1229614',
'1229565',
'1229596',
'1229569',
'1229593',
'1229580',
'5214877',
'419556',
'1229604',
'1229584',
'1229608',
'1229568'
]
# init
captureIds = []
images = []
imageCount = 0
randomBase = 3
# calculations
cellH = CELL_H_MULTIPLIER_START * IMAGE_W
x = 0
y = 0
h = cellH
while y < IMAGE_H:
if x > IMAGE_W:
y += h
x = 0
h *= CELL_H_MULTIPLIER
h = max(h, MIN_CELL_H)
x += h
imageCount += 1
imageCount = int(imageCount * 1.5) # add some padding
print "Requiring %s valid images" % imageCount
print "Looking for images..."
for line in open(INPUT_FILE,'r').readlines():
# Read line as json
item = json.loads(line)
captureId = ""
# no captures
if not "captures" in item or len(item["captures"]) <= 0:
continue
# item not in list of UUIDs
# if not ("collectionUUID" in item and item["collectionUUID"] in uuids) and not ("UUID" in item and item["UUID"] in uuids):
if not ("collectionUUID" in item and item["collectionUUID"] in uuids):
continue
capture = item["captures"][0]
match = re.search(imageURLPatternFind, capture)
if match:
captureId = match.group(1).strip()
if not captureId:
continue
captureIds.append(captureId)
captureCount = len(captureIds)
print "Found %s valid images" % captureCount
if captureCount < imageCount:
print "Too few images found"
sys.exit(1)
# For creating pseudo-random numbers
def halton(index, base):
result = 0.0
f = 1.0 / base
i = 1.0 * index
while(i > 0):
result += f * (i % base)
i = math.floor(i / base)
f = f / base
return result
# Sample images pseudo-randomly
for i in range(imageCount):
h = halton(i, randomBase)
captureId = captureIds[int(h * captureCount)]
if captureId in excludeCaptures:
continue
# See if file exists or overwrite is set to True
fileName = tmpFolder + captureId + "." + imageExt
if overwriteExisting or not os.path.isfile(fileName):
# Download image
imageURL = imageURLPattern % captureId
with open(fileName, 'wb') as f:
try:
f.write(urllib2.urlopen(imageURL).read())
f.close()
print str(i+1) + ". Downloaded " + imageURL + " (" + str(round(1.0 * i / imageCount * 100, 3)) + "%)"
images.append(fileName)
except urllib2.URLError, e:
print str(i+1) + ". URL error: " + imageURL , e.args
except:
print str(i+1) + ". Unexpected error: " + imageURL , sys.exc_info()[0]
raise
else:
images.append(fileName)
print "Retrieved %s images" % len(images)
# Create blank image
print "Creating blank image at (" + str(IMAGE_W) + " x " + str(IMAGE_H) + ")"
imageBase = Image.new("RGB", (IMAGE_W, IMAGE_H), "black")
x = 0
y = 0
h = int(cellH)
for fileName in images:
if y > IMAGE_H:
break
try:
im = Image.open(fileName)
imW, imH = im.size
ratio = 1.0 * imW / imH
if x > IMAGE_W:
y += h
x = 0
h *= CELL_H_MULTIPLIER
h = int(max(h, MIN_CELL_H))
w = int(h * ratio)
im.thumbnail((w, h), Image.ANTIALIAS)
imageBase.paste(im, (x, y))
x += w
except IOError:
print "Cannot read file: " + fileName
except:
print "Unexpected error:", sys.exc_info()[0]
raise
# Save image
print "Saving stiched image..."
imageBase.save(OUTPUT_FILE)
print "Saved image: " + OUTPUT_FILE
| 25.912844 | 171 | 0.612675 | 737 | 5,649 | 4.640434 | 0.386703 | 0.016082 | 0.026316 | 0.011404 | 0.08655 | 0.067251 | 0.067251 | 0.051462 | 0.051462 | 0.051462 | 0 | 0.14208 | 0.251195 | 5,649 | 217 | 172 | 26.032258 | 0.66643 | 0.157727 | 0 | 0.160494 | 1 | 0.006173 | 0.228118 | 0.068499 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.049383 | null | null | 0.092593 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
75b31d7b56a7058eb6d6d147661fcf3924c6ab07 | 74,663 | py | Python | pysnmp-with-texts/BENU-DHCP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/BENU-DHCP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/BENU-DHCP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module BENU-DHCP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BENU-DHCP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:37:16 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection")
benuWAG, = mibBuilder.importSymbols("BENU-WAG-MIB", "benuWAG")
InetAddressIPv4, InetAddressPrefixLength = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressIPv4", "InetAddressPrefixLength")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
ModuleIdentity, MibIdentifier, NotificationType, Unsigned32, Bits, TimeTicks, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, ObjectIdentity, Integer32, iso, Counter64, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "MibIdentifier", "NotificationType", "Unsigned32", "Bits", "TimeTicks", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "ObjectIdentity", "Integer32", "iso", "Counter64", "Counter32")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
bDhcpMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6))
bDhcpMIB.setRevisions(('2015-12-18 00:00', '2015-11-12 00:00', '2015-01-29 00:00', '2015-01-16 00:00', '2014-07-30 00:00', '2014-04-14 00:00', '2013-10-22 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: bDhcpMIB.setRevisionsDescriptions(('Added bDhcpHomeSubnetUsedAddrLow, bDhcpHomeSubnetUsedAddrHigh & added bDhcpv4NotifObjects for supporting Home wrt Home subnets.', 'Added bDhcpSPWiFiGlobalTable and bDhcpHomeGlobalTable', 'Added max. values for ranges & subnet.', 'Updated notification assignments to comply with standards (RFC 2578).', 'bDhcpGlobalTable updated with release indications sent.', 'bDhcpSubnetTable updated with peak addresses held statistic.', 'This version introduces support for DHCPv6',))
if mibBuilder.loadTexts: bDhcpMIB.setLastUpdated('201512180000Z')
if mibBuilder.loadTexts: bDhcpMIB.setOrganization('Benu Networks,Inc')
if mibBuilder.loadTexts: bDhcpMIB.setContactInfo('Benu Networks,Inc Corporate Headquarters 300 Concord Road, Suite 110 Billerica, MA 01821 USA Tel: +1 978-223-4700 Fax: +1 978-362-1908 Email: info@benunets.com')
if mibBuilder.loadTexts: bDhcpMIB.setDescription('The MIB module for entities implementing the server side of the Bootstrap Protocol (BOOTP) and the Dynamic Host Configuration protocol (DHCP) for IPv4 and IPv6. Copyright (C) 2014 by Benu Networks, Inc. All rights reserved.')
bDhcpNotifications = ObjectIdentity((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 0))
if mibBuilder.loadTexts: bDhcpNotifications.setStatus('current')
if mibBuilder.loadTexts: bDhcpNotifications.setDescription('DHCP Notifications are defined in this branch.')
bDhcpv4MIBObjects = ObjectIdentity((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1))
if mibBuilder.loadTexts: bDhcpv4MIBObjects.setStatus('current')
if mibBuilder.loadTexts: bDhcpv4MIBObjects.setDescription('DHCP v4 MIB objects information is defined in this branch.')
bDhcpv4NotifObjects = ObjectIdentity((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 2))
if mibBuilder.loadTexts: bDhcpv4NotifObjects.setStatus('current')
if mibBuilder.loadTexts: bDhcpv4NotifObjects.setDescription('DHCP v4 Notifications are defined in this branch.')
bDhcpv6MIBObjects = ObjectIdentity((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3))
if mibBuilder.loadTexts: bDhcpv6MIBObjects.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6MIBObjects.setDescription('DHCP v6 MIB objects information is defined in this branch.')
bDhcpv6NotifObjects = ObjectIdentity((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 4))
if mibBuilder.loadTexts: bDhcpv6NotifObjects.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6NotifObjects.setDescription('DHCP v6 Notifications are defined in this branch.')
bDhcpSubnetTable = MibTable((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1), )
if mibBuilder.loadTexts: bDhcpSubnetTable.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetTable.setDescription('A list of subnets that are configured in this server.')
bDhcpSubnetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1), ).setIndexNames((0, "BENU-DHCP-MIB", "bDhcpSubnetStatsInterval"), (0, "BENU-DHCP-MIB", "bDhcpSubnetIndex"), (0, "BENU-DHCP-MIB", "bDhcpSubnetRangeIndex"))
if mibBuilder.loadTexts: bDhcpSubnetEntry.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetEntry.setDescription('A logical row in the bDhcpSubnetTable.')
bDhcpSubnetStatsInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 1), Integer32())
if mibBuilder.loadTexts: bDhcpSubnetStatsInterval.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetStatsInterval.setDescription('The interval where the measurements were accumulated. The interval index one indicates the latest interval for which statistics accumulation was completed. Older the statistics interval data greater the interval index value. In a system supporting a history of n intervals with IntervalCount(1) and IntervalCount(n) the most and least recent intervals respectively, the following applies at the end of a interval: - discard the value of IntervalCount(n) - the value of IntervalCount(i) becomes that of IntervalCount(i+1) for 1 <= i <n . - the value of IntervalCount(1) becomes that of CurrentCount')
bDhcpSubnetIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 144)))
if mibBuilder.loadTexts: bDhcpSubnetIndex.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetIndex.setDescription('The index of the subnet entry in the table. DHCP supports max. 144 subnets.')
bDhcpSubnetRangeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16)))
if mibBuilder.loadTexts: bDhcpSubnetRangeIndex.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetRangeIndex.setDescription('The index of the range from the subnet entry in the table. DHCP supports max. 16 ranges per subnet.')
bDhcpSubnetIntervalDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSubnetIntervalDuration.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetIntervalDuration.setDescription('Duration of the interval in minutes.')
bDhcpSubnetStartAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 5), InetAddressIPv4()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSubnetStartAddress.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetStartAddress.setDescription('The first subnet IP address.')
bDhcpSubnetEndAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 6), InetAddressIPv4()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSubnetEndAddress.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetEndAddress.setDescription('The last subnet IP address.')
bDhcpSubnetTotalAddresses = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSubnetTotalAddresses.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetTotalAddresses.setDescription('The total number of addresses in the subnet .')
bDhcpSubnetPeakFreeAddresses = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSubnetPeakFreeAddresses.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetPeakFreeAddresses.setDescription('The peak number of free IP addresses that are available in the subnet')
bDhcpSubnetPeakUsedAddresses = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSubnetPeakUsedAddresses.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetPeakUsedAddresses.setDescription('The peak number of used IP addresses that are used in the subnet')
bDhcpSubnetAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 10), InetAddressIPv4()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSubnetAddress.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetAddress.setDescription('The IP address of the subnet entry in the table.')
bDhcpSubnetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 11), InetAddressPrefixLength()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSubnetMask.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetMask.setDescription('The subnet mask of the subnet.')
bDhcpSubnetUsedAddrLowThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 12), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSubnetUsedAddrLowThreshold.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetUsedAddrLowThreshold.setDescription('The low threshold for used IP addresses in this subnet. If the value for used IP addresses in this subnet becomes equal to or less than this value and the current condition for bDhcpSubnetUsedAddrHigh is raised, then a bDhcpSubnetUsedAddrLow event will be generated. No more bDhcpSubnetUsedAddrLow events will be generated for this subnet during its execution until the value for used addresses has exceeded the value of bDhcpSubnetUsedAddrHighThreshold.')
bDhcpSubnetUsedAddrHighThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 13), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSubnetUsedAddrHighThreshold.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetUsedAddrHighThreshold.setDescription('The high threshold for used IP addresses in this subnet. If a bDhcpSubnetUsedAddrLow event has been generated (or no bDhcpSubnetUsedAddrHigh was generated previously) for this subnet, and the value for used IP addresses in this subnet has exceeded this value then a bDhcpSubnetUsedAddrHigh event will be generated. No more bDhcpSubnetUsedAddrHigh events will be generated for this subnet during its execution until the value for used addresses in this subnet becomes equal to or less than the value of bDhcpSubnetUsedAddrLowThreshold.')
bDhcpSubnetPeakHoldAddresses = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 1, 1, 14), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSubnetPeakHoldAddresses.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetPeakHoldAddresses.setDescription('The peak number of IP addresses that are held within this subnet.')
bDhcpGlobalTable = MibTable((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2), )
if mibBuilder.loadTexts: bDhcpGlobalTable.setStatus('current')
if mibBuilder.loadTexts: bDhcpGlobalTable.setDescription('A list of Global DHCP server information for various intervals.')
bDhcpGlobalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1), ).setIndexNames((0, "BENU-DHCP-MIB", "bDhcpGlobalStatsInterval"))
if mibBuilder.loadTexts: bDhcpGlobalEntry.setStatus('current')
if mibBuilder.loadTexts: bDhcpGlobalEntry.setDescription('A logical row in the bDhcpGlobalTable.')
bDhcpGlobalStatsInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 1), Integer32())
if mibBuilder.loadTexts: bDhcpGlobalStatsInterval.setStatus('current')
if mibBuilder.loadTexts: bDhcpGlobalStatsInterval.setDescription('The interval where the measurements were accumulated. The interval index one indicates the latest interval for which statistics accumulation was completed. Older the statistics interval data greater the interval index value. In a system supporting a history of n intervals with IntervalCount(1) and IntervalCount(n) the most and least recent intervals respectively, the following applies at the end of a interval: - discard the value of IntervalCount(n) - the value of IntervalCount(i) becomes that of IntervalCount(i+1) for 1 <= i <n . - the value of IntervalCount(1) becomes that of CurrentCount')
bDhcpDiscoversRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpDiscoversRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpDiscoversRcvd.setDescription('The number of DHCPDISCOVER packets received.')
bDhcpOffersSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpOffersSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpOffersSent.setDescription('The number of DHCPOFFER packets sent.')
bDhcpRequestsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpRequestsRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpRequestsRcvd.setDescription('The number of DHCPREQUEST packets received.')
bDhcpDeclinesRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpDeclinesRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpDeclinesRcvd.setDescription('The number of DHCPDECLINE packets received.')
bDhcpAcksSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpAcksSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpAcksSent.setDescription('The number of DHCPACK packets sent.')
bDhcpNacksSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpNacksSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpNacksSent.setDescription('The number of DHCPNACK packets sent.')
bDhcpReleasesRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpReleasesRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpReleasesRcvd.setDescription('The number of DHCPRELEASE packets received.')
bDhcpReleasesIndRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpReleasesIndRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpReleasesIndRcvd.setDescription('The number of DHCPRELEASE indication packets received.')
bDhcpReleasesSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpReleasesSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpReleasesSent.setDescription('The number of DHCPRELEASE packets sent.')
bDhcpInformsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpInformsRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpInformsRcvd.setDescription('The number of DHCPINFORM packets received.')
bDhcpInformsAckSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 12), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpInformsAckSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpInformsAckSent.setDescription('The number of DHCPINFORM ACK packets sent.')
bDhcpDropDiscover = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 13), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpDropDiscover.setStatus('current')
if mibBuilder.loadTexts: bDhcpDropDiscover.setDescription('The number of DHCPDISCOVER packets dropped.')
bDhcpDropRequest = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 14), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpDropRequest.setStatus('current')
if mibBuilder.loadTexts: bDhcpDropRequest.setDescription('The number of DHCPREQUEST packets dropped.')
bDhcpDropRelease = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 15), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpDropRelease.setStatus('current')
if mibBuilder.loadTexts: bDhcpDropRelease.setDescription('The number of DHCPRELEASE packets dropped.')
bDhcpLeasesAssigned = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 16), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpLeasesAssigned.setStatus('current')
if mibBuilder.loadTexts: bDhcpLeasesAssigned.setDescription('Total number of leases assigned on DHCP server')
bDhcpLeasesReleased = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 17), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpLeasesReleased.setStatus('current')
if mibBuilder.loadTexts: bDhcpLeasesReleased.setDescription('Total number of leases released on DHCP server')
bDhcpLeasesRelFail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 18), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpLeasesRelFail.setStatus('current')
if mibBuilder.loadTexts: bDhcpLeasesRelFail.setDescription('Total number of leases release failed on DHCP server')
bDhcpLeasesExpired = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 19), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpLeasesExpired.setStatus('current')
if mibBuilder.loadTexts: bDhcpLeasesExpired.setDescription('Total number of leases expired on DHCP server')
bDhcpLeasesRenewed = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 20), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpLeasesRenewed.setStatus('current')
if mibBuilder.loadTexts: bDhcpLeasesRenewed.setDescription('Total number of leases renewed on DHCP server')
bDhcpLeasesRenewFail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 21), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpLeasesRenewFail.setStatus('current')
if mibBuilder.loadTexts: bDhcpLeasesRenewFail.setDescription('Total number of leases renew failed on DHCP server')
bDhcpLeasesNotAssignServIntNotConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 22), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpLeasesNotAssignServIntNotConfig.setStatus('current')
if mibBuilder.loadTexts: bDhcpLeasesNotAssignServIntNotConfig.setDescription('Total number of leases not assigned due to interface not configured on DHCP server')
bDhcpLeasesNotAssignFreeBuffUnavail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 23), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpLeasesNotAssignFreeBuffUnavail.setStatus('current')
if mibBuilder.loadTexts: bDhcpLeasesNotAssignFreeBuffUnavail.setDescription('Total number of leases not assigned due to unavailability of free buffers')
bDhcpIntervalDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 24), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpIntervalDuration.setStatus('current')
if mibBuilder.loadTexts: bDhcpIntervalDuration.setDescription('Duration of the interval in minutes')
bBootpRequestsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 25), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bBootpRequestsRcvd.setStatus('current')
if mibBuilder.loadTexts: bBootpRequestsRcvd.setDescription('Total number of BOOTP request mesages received')
bBootpRepliesSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 26), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bBootpRepliesSent.setStatus('current')
if mibBuilder.loadTexts: bBootpRepliesSent.setDescription('Total number of BOOTP reply mesages sent')
bDhcpReleasesIndSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 2, 1, 27), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpReleasesIndSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpReleasesIndSent.setDescription('The number of DHCPRELEASE indication packets sent.')
bDhcpSPWiFiGlobalTable = MibTable((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4), )
if mibBuilder.loadTexts: bDhcpSPWiFiGlobalTable.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiGlobalTable.setDescription('A list of Global DHCP server information for SPWiFi for various intervals.')
bDhcpSPWiFiGlobalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1), ).setIndexNames((0, "BENU-DHCP-MIB", "bDhcpSPWiFiGlobalStatsInterval"))
if mibBuilder.loadTexts: bDhcpSPWiFiGlobalEntry.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiGlobalEntry.setDescription('A logical row in the bDhcpSPWiFiGlobalTable.')
bDhcpSPWiFiGlobalStatsInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 1), Integer32())
if mibBuilder.loadTexts: bDhcpSPWiFiGlobalStatsInterval.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiGlobalStatsInterval.setDescription('The interval where the measurements were accumulated. The interval index one indicates the latest interval for which statistics accumulation was completed. Older the statistics interval data greater the interval index value. In a system supporting a history of n intervals with IntervalCount(1) and IntervalCount(n) the most and least recent intervals respectively, the following applies at the end of a interval: - discard the value of IntervalCount(n) - the value of IntervalCount(i) becomes that of IntervalCount(i+1) for 1 <= i <n . - the value of IntervalCount(1) becomes that of CurrentCount')
bDhcpSPWiFiDiscoversRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiDiscoversRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiDiscoversRcvd.setDescription('The number of SPWiFi DHCPDISCOVER packets received.')
bDhcpSPWiFiOffersSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiOffersSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiOffersSent.setDescription('The number of SPWiFi DHCPOFFER packets sent.')
bDhcpSPWiFiRequestsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiRequestsRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiRequestsRcvd.setDescription('The number of SPWiFi DHCPREQUEST packets received.')
bDhcpSPWiFiDeclinesRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiDeclinesRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiDeclinesRcvd.setDescription('The number of SPWiFi DHCPDECLINE packets received.')
bDhcpSPWiFiAcksSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiAcksSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiAcksSent.setDescription('The number of SPWiFi DHCPACK packets sent.')
bDhcpSPWiFiNacksSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiNacksSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiNacksSent.setDescription('The number of SPWiFi DHCPNACK packets sent.')
bDhcpSPWiFiReleasesRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiReleasesRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiReleasesRcvd.setDescription('The number of SPWiFi DHCPRELEASE packets received.')
bDhcpSPWiFiReleasesIndRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiReleasesIndRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiReleasesIndRcvd.setDescription('The number of SPWiFi DHCPRELEASE indication packets received.')
bDhcpSPWiFiReleasesSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiReleasesSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiReleasesSent.setDescription('The number of SPWiFi DHCPRELEASE packets sent.')
bDhcpSPWiFiInformsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiInformsRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiInformsRcvd.setDescription('The number of SPWiFi DHCPINFORM packets received.')
bDhcpSPWiFiInformsAckSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 12), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiInformsAckSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiInformsAckSent.setDescription('The number of SPWiFi DHCPINFORM ACK packets sent.')
bDhcpSPWiFiDropDiscover = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 13), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiDropDiscover.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiDropDiscover.setDescription('The number of SPWiFi DHCPDISCOVER packets dropped.')
bDhcpSPWiFiDropRequest = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 14), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiDropRequest.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiDropRequest.setDescription('The number of SPWiFi DHCPREQUEST packets dropped.')
bDhcpSPWiFiDropRelease = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 15), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiDropRelease.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiDropRelease.setDescription('The number of SPWiFi DHCPRELEASE packets dropped.')
bDhcpSPWiFiLeasesAssigned = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 16), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesAssigned.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesAssigned.setDescription('Total number of SPWiFi leases assigned on DHCP server')
bDhcpSPWiFiLeasesReleased = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 17), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesReleased.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesReleased.setDescription('Total number of SPWiFi leases released on DHCP server')
bDhcpSPWiFiLeasesRelFail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 18), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesRelFail.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesRelFail.setDescription('Total number of SPWiFi leases release failed on DHCP server')
bDhcpSPWiFiLeasesExpired = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 19), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesExpired.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesExpired.setDescription('Total number of SPWiFi leases expired on DHCP server')
bDhcpSPWiFiLeasesRenewed = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 20), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesRenewed.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesRenewed.setDescription('Total number of SPWiFi leases renewed on DHCP server')
bDhcpSPWiFiLeasesRenewFail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 21), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesRenewFail.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesRenewFail.setDescription('Total number of SPWiFi leases renew failed on DHCP server')
bDhcpSPWiFiLeasesNotAssignServIntNotConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 22), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesNotAssignServIntNotConfig.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesNotAssignServIntNotConfig.setDescription('Total number of SPWiFi leases not assigned due to interface not configured on DHCP server')
bDhcpSPWiFiLeasesNotAssignFreeBuffUnavail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 23), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesNotAssignFreeBuffUnavail.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiLeasesNotAssignFreeBuffUnavail.setDescription('Total number of SPWiFi leases not assigned due to unavailability of free buffers')
bDhcpSPWiFiIntervalDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 24), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiIntervalDuration.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiIntervalDuration.setDescription('SPWiFi duration of the interval in minutes')
bSPWiFiBootpRequestsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 25), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bSPWiFiBootpRequestsRcvd.setStatus('current')
if mibBuilder.loadTexts: bSPWiFiBootpRequestsRcvd.setDescription('Total number of SPWiFi BOOTP request mesages received')
bSPWiFiBootpRepliesSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 26), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bSPWiFiBootpRepliesSent.setStatus('current')
if mibBuilder.loadTexts: bSPWiFiBootpRepliesSent.setDescription('Total number of SPWiFi BOOTP reply mesages sent')
bDhcpSPWiFiReleasesIndSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 4, 1, 27), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpSPWiFiReleasesIndSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpSPWiFiReleasesIndSent.setDescription('The number of SPWiFi DHCPRELEASE indication packets sent.')
bDhcpHomeGlobalTable = MibTable((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5), )
if mibBuilder.loadTexts: bDhcpHomeGlobalTable.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeGlobalTable.setDescription('A list of Global DHCP server information for Home for various intervals.')
bDhcpHomeGlobalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1), ).setIndexNames((0, "BENU-DHCP-MIB", "bDhcpHomeGlobalStatsInterval"))
if mibBuilder.loadTexts: bDhcpHomeGlobalEntry.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeGlobalEntry.setDescription('A logical row in the bDhcpHomeGlobalTable.')
bDhcpHomeGlobalStatsInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 1), Integer32())
if mibBuilder.loadTexts: bDhcpHomeGlobalStatsInterval.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeGlobalStatsInterval.setDescription('The interval where the measurements were accumulated. The interval index one indicates the latest interval for which statistics accumulation was completed. Older the statistics interval data greater the interval index value. In a system supporting a history of n intervals with IntervalCount(1) and IntervalCount(n) the most and least recent intervals respectively, the following applies at the end of a interval: - discard the value of IntervalCount(n) - the value of IntervalCount(i) becomes that of IntervalCount(i+1) for 1 <= i <n . - the value of IntervalCount(1) becomes that of CurrentCount')
bDhcpHomeDiscoversRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeDiscoversRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeDiscoversRcvd.setDescription('The number of Home DHCPDISCOVER packets received.')
bDhcpHomeOffersSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeOffersSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeOffersSent.setDescription('The number of Home DHCPOFFER packets sent.')
bDhcpHomeRequestsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeRequestsRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeRequestsRcvd.setDescription('The number of Home DHCPREQUEST packets received.')
bDhcpHomeDeclinesRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeDeclinesRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeDeclinesRcvd.setDescription('The number of Home DHCPDECLINE packets received.')
bDhcpHomeAcksSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeAcksSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeAcksSent.setDescription('The number of Home DHCPACK packets sent.')
bDhcpHomeNacksSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeNacksSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeNacksSent.setDescription('The number of Home DHCPNACK packets sent.')
bDhcpHomeReleasesRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeReleasesRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeReleasesRcvd.setDescription('The number of Home DHCPRELEASE packets received.')
bDhcpHomeReleasesIndRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeReleasesIndRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeReleasesIndRcvd.setDescription('The number of Home DHCPRELEASE indication packets received.')
bDhcpHomeReleasesSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeReleasesSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeReleasesSent.setDescription('The number of Home DHCPRELEASE packets sent.')
bDhcpHomeInformsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeInformsRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeInformsRcvd.setDescription('The number of Home DHCPINFORM packets received.')
bDhcpHomeInformsAckSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 12), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeInformsAckSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeInformsAckSent.setDescription('The number of Home DHCPINFORM ACK packets sent.')
bDhcpHomeDropDiscover = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 13), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeDropDiscover.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeDropDiscover.setDescription('The number of Home DHCPDISCOVER packets dropped.')
bDhcpHomeDropRequest = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 14), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeDropRequest.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeDropRequest.setDescription('The number of Home DHCPREQUEST packets dropped.')
bDhcpHomeDropRelease = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 15), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeDropRelease.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeDropRelease.setDescription('The number of Home DHCPRELEASE packets dropped.')
bDhcpHomeLeasesAssigned = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 16), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeLeasesAssigned.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeLeasesAssigned.setDescription('Total number of Home leases assigned on DHCP server')
bDhcpHomeLeasesReleased = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 17), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeLeasesReleased.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeLeasesReleased.setDescription('Total number of Home leases released on DHCP server')
bDhcpHomeLeasesRelFail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 18), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeLeasesRelFail.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeLeasesRelFail.setDescription('Total number of Home leases release failed on DHCP server')
bDhcpHomeLeasesExpired = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 19), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeLeasesExpired.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeLeasesExpired.setDescription('Total number of Home leases expired on DHCP server')
bDhcpHomeLeasesRenewed = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 20), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeLeasesRenewed.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeLeasesRenewed.setDescription('Total number of Home leases renewed on DHCP server')
bDhcpHomeLeasesRenewFail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 21), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeLeasesRenewFail.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeLeasesRenewFail.setDescription('Total number of Home leases renew failed on DHCP server')
bDhcpHomeLeasesNotAssignServIntNotConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 22), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeLeasesNotAssignServIntNotConfig.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeLeasesNotAssignServIntNotConfig.setDescription('Total number of Home leases not assigned due to interface not configured on DHCP server')
bDhcpHomeLeasesNotAssignFreeBuffUnavail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 23), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeLeasesNotAssignFreeBuffUnavail.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeLeasesNotAssignFreeBuffUnavail.setDescription('Total number of Home leases not assigned due to unavailability of free buffers')
bDhcpHomeIntervalDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 24), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeIntervalDuration.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeIntervalDuration.setDescription('Home duration of the interval in minutes')
bHomeBootpRequestsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 25), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bHomeBootpRequestsRcvd.setStatus('current')
if mibBuilder.loadTexts: bHomeBootpRequestsRcvd.setDescription('Total number of Home BOOTP request mesages received')
bHomeBootpRepliesSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 26), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bHomeBootpRepliesSent.setStatus('current')
if mibBuilder.loadTexts: bHomeBootpRepliesSent.setDescription('Total number of Home BOOTP reply mesages sent')
bDhcpHomeReleasesIndSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 5, 1, 27), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpHomeReleasesIndSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeReleasesIndSent.setDescription('The number of Home DHCPRELEASE indication packets sent.')
bDhcpv4ActiveClient = MibScalar((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv4ActiveClient.setStatus('current')
if mibBuilder.loadTexts: bDhcpv4ActiveClient.setDescription('The number of DHCP v4 active clients.')
bDhcpv4ActiveSpWiFiClients = MibScalar((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv4ActiveSpWiFiClients.setStatus('current')
if mibBuilder.loadTexts: bDhcpv4ActiveSpWiFiClients.setDescription('The number of DHCP v4 SP WiFi active clients.')
bDhcpv4ActiveHomeClients = MibScalar((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv4ActiveHomeClients.setStatus('current')
if mibBuilder.loadTexts: bDhcpv4ActiveHomeClients.setDescription('The number of DHCP v4 active Home clients.')
bDhcpv6ActiveClient = MibScalar((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ActiveClient.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ActiveClient.setDescription('The number of DHCP v6 active clients.')
bDhcpv6GlobalTable = MibTable((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2), )
if mibBuilder.loadTexts: bDhcpv6GlobalTable.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6GlobalTable.setDescription('A list of Global DHCPv6 server information for various intervals.')
bDhcpv6GlobalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1), ).setIndexNames((0, "BENU-DHCP-MIB", "bDhcpv6GlobalStatsInterval"))
if mibBuilder.loadTexts: bDhcpv6GlobalEntry.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6GlobalEntry.setDescription('A logical row in the bDhcpv6GlobalTable.')
bDhcpv6GlobalStatsInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 1), Integer32())
if mibBuilder.loadTexts: bDhcpv6GlobalStatsInterval.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6GlobalStatsInterval.setDescription('The interval where the measurements were accumulated. The interval index one indicates the latest interval for which statistics accumulation was completed. Older the statistics interval data greater the interval index value. In a system supporting a history of n intervals with IntervalCount(1) and IntervalCount(n) the most and least recent intervals respectively, the following applies at the end of a interval: - discard the value of IntervalCount(n) - the value of IntervalCount(i) becomes that of IntervalCount(i+1) for 1 <= i <n . - the value of IntervalCount(1) becomes that of CurrentCount')
bDhcpv6SolicitsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6SolicitsRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6SolicitsRcvd.setDescription('The number of DHCPv6 Solicit packets received.')
bDhcpv6OffersSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6OffersSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6OffersSent.setDescription('The number of DHCPOFFER packets sent.')
bDhcpv6RequestsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6RequestsRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6RequestsRcvd.setDescription('The number of DHCPv6 Request packets received.')
bDhcpv6DeclinesRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DeclinesRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DeclinesRcvd.setDescription('The number of DHCPv6 Decline packets received.')
bDhcpv6ReleasesRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ReleasesRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ReleasesRcvd.setDescription('The number of DHCPv6 Release packets received.')
bDhcpv6ReleaseIndRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ReleaseIndRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ReleaseIndRcvd.setDescription('The number of DHCPv6 ReleaseInd packets received.')
bDhcpv6RenewRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6RenewRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6RenewRcvd.setDescription('The number of DHCPv6 Renew packets received.')
bDhcpv6RebindRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6RebindRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6RebindRcvd.setDescription('The number of DHCPv6 Rebind packets received.')
bDhcpv6InformsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6InformsRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6InformsRcvd.setDescription('The number of DHCPv6 Inform packets received.')
bDhcpv6ConfirmsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ConfirmsRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ConfirmsRcvd.setDescription('The number of DHCPv6 Confirm packets received.')
bDhcpv6ReplysSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 12), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ReplysSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ReplysSent.setDescription('The number of DHCPv6 Reply packets sent.')
bDhcpv6AdvertisesSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 13), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6AdvertisesSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6AdvertisesSent.setDescription('The number of DHCPv6 Advertises packets sent.')
bDhcpv6UnknownMsgsRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 14), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6UnknownMsgsRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6UnknownMsgsRcvd.setDescription('The number of DHCPv6 UnknownMsg packets received.')
bDhcpv6ReconfigsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 15), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ReconfigsSent.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ReconfigsSent.setDescription('The number of DHCPv6 Reconfig packets sent.')
bDhcpv6DropSolicit = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 16), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropSolicit.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropSolicit.setDescription('The number of DHCPv6 Solicit packets dropped.')
bDhcpv6DropAdvertise = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 17), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropAdvertise.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropAdvertise.setDescription('The number of DHCPv6 Advertise packets dropped.')
bDhcpv6DropDupSolicit = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 18), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropDupSolicit.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropDupSolicit.setDescription('The number of DHCPv6 Duplicate Solicit packets dropped.')
bDhcpv6DropRequest = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 19), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropRequest.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropRequest.setDescription('The number of DHCPv6 Request packets dropped.')
bDhcpv6DropRelease = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 20), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropRelease.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropRelease.setDescription('The number of DHCPv6 Release packets dropped.')
bDhcpv6DropDecline = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 21), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropDecline.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropDecline.setDescription('The number of DHCPv6 Decline packets dropped.')
bDhcpv6DropRenew = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 22), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropRenew.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropRenew.setDescription('The number of DHCPv6 Renew packets dropped.')
bDhcpv6DropRebind = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 23), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropRebind.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropRebind.setDescription('The number of DHCPv6 Rebind packets dropped.')
bDhcpv6DropConfirm = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 24), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropConfirm.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropConfirm.setDescription('The number of DHCPv6 Confirm packets dropped.')
bDhcpv6DropInform = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 25), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropInform.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropInform.setDescription('The number of DHCPv6 Information-Request packets dropped.')
bDhcpv6DropRelay = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 26), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropRelay.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropRelay.setDescription('The number of DHCPv6 Relay packets dropped.')
bDhcpv6DropReply = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 27), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropReply.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropReply.setDescription('The number of DHCPv6 Reply packets dropped.')
bDhcpv6DropRelayReply = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 28), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropRelayReply.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropRelayReply.setDescription('The number of DHCPv6 Relay-Reply packets dropped.')
bDhcpv6DropReconfig = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 29), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DropReconfig.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DropReconfig.setDescription('The number of DHCPv6 Reconfig packets dropped.')
bDhcpv6LeasesOffered = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 30), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6LeasesOffered.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6LeasesOffered.setDescription('Total number of leases offered on DHCPv6 server')
bDhcpv6LeasesAssigned = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 31), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6LeasesAssigned.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6LeasesAssigned.setDescription('Total number of leases assigned on DHCPv6 server')
bDhcpv6LeasesReleased = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 32), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6LeasesReleased.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6LeasesReleased.setDescription('Total number of leases released on DHCPv6 server')
bDhcpv6LeasesRelFail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 33), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6LeasesRelFail.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6LeasesRelFail.setDescription('Total number of leases release failed on DHCPv6 server')
bDhcpv6LeasesExpired = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 34), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6LeasesExpired.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6LeasesExpired.setDescription('Total number of leases expired on DHCPv6 server')
bDhcpv6LeasesExpiryFail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 35), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6LeasesExpiryFail.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6LeasesExpiryFail.setDescription('Total number of leases expiry failed on DHCPv6 server')
bDhcpv6LeasesRenewed = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 36), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6LeasesRenewed.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6LeasesRenewed.setDescription('Total number of leases renewed on DHCPv6 server')
bDhcpv6LeasesRenewFail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 37), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6LeasesRenewFail.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6LeasesRenewFail.setDescription('Total number of leases renew failed on DHCPv6 server')
bDhcpv6InternalError = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 38), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6InternalError.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6InternalError.setDescription('Total number of Internal Errors')
bDhcpv6NoInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 39), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6NoInterface.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6NoInterface.setDescription('Total number of No Interface Errors')
bDhcpv6ClientIdNotPres = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 40), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ClientIdNotPres.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ClientIdNotPres.setDescription('Total number of ClientId Not Present Errors')
bDhcpv6ServerIdNotPres = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 41), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ServerIdNotPres.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ServerIdNotPres.setDescription('Total number of ServerId Not Present Errors')
bDhcpv6ORONotPres = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 42), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ORONotPres.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ORONotPres.setDescription('Total number of ORO Not Present Errors')
bDhcpv6ClientIdPres = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 43), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ClientIdPres.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ClientIdPres.setDescription('Total number of ClientId Present Errors')
bDhcpv6ServerIdPres = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 44), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ServerIdPres.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ServerIdPres.setDescription('Total number of ServerId Present Errors')
bDhcpv6UnicastSolicitRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 45), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6UnicastSolicitRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6UnicastSolicitRcvd.setDescription('Total number of Unicast Solicit Received Errors')
bDhcpv6UnicastRequestRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 46), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6UnicastRequestRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6UnicastRequestRcvd.setDescription('Total number of Unicast Request Received Errors')
bDhcpv6UnicastRenewRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 47), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6UnicastRenewRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6UnicastRenewRcvd.setDescription('Total number of Unicast Renew Received Errors')
bDhcpv6UnicastConfirmRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 48), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6UnicastConfirmRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6UnicastConfirmRcvd.setDescription('Total number of Unicast Confirm Received Errors')
bDhcpv6UnicastDeclineRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 49), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6UnicastDeclineRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6UnicastDeclineRcvd.setDescription('Total number of Unicast Decline Received Errors')
bDhcpv6UnicastReleaseRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 50), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6UnicastReleaseRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6UnicastReleaseRcvd.setDescription('Total number of Unicast Release Received Errors')
bDhcpv6UnicastRebindRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 51), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6UnicastRebindRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6UnicastRebindRcvd.setDescription('Total number of Unicast Rebind Received Errors')
bDhcpv6RebindWithoutAddrRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 52), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6RebindWithoutAddrRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6RebindWithoutAddrRcvd.setDescription('Total number of Rebind Without Addresses Received Errors')
bDhcpv6ConfirmWithoutAddrRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 53), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ConfirmWithoutAddrRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ConfirmWithoutAddrRcvd.setDescription('Total number of Confirm Without Addresses Received Errors')
bDhcpv6DeclineWithoutAddrRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 54), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6DeclineWithoutAddrRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6DeclineWithoutAddrRcvd.setDescription('Total number of Confirm Without Addresses Received Errors')
bDhcpv6RebindWithoutAddrOrMoreRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 55), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6RebindWithoutAddrOrMoreRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6RebindWithoutAddrOrMoreRcvd.setDescription('Total number of Rebind Without Addresses Or More Received Errors')
bDhcpv6RenewWithoutAddrOrMoreRcvd = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 56), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6RenewWithoutAddrOrMoreRcvd.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6RenewWithoutAddrOrMoreRcvd.setDescription('Total number of Rebind Without Addresses Or More Received Errors')
bDhcpv6RebindFail = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 57), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6RebindFail.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6RebindFail.setDescription('Total number of Rebind Failures')
bDhcpv6ReconfAcceptInSolicitMissing = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 58), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6ReconfAcceptInSolicitMissing.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6ReconfAcceptInSolicitMissing.setDescription('Reconfig-Accept option is Solicit is missing, wherein the configuration mandates')
bDhcpv6IntervalDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 3, 2, 1, 59), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: bDhcpv6IntervalDuration.setStatus('current')
if mibBuilder.loadTexts: bDhcpv6IntervalDuration.setDescription('Duration of the interval in minutes')
bDhcpHomeSubnetHomeId = MibScalar((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 2, 1), Unsigned32()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: bDhcpHomeSubnetHomeId.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeSubnetHomeId.setDescription('Home ID field is unique identifier for each home subnet. It maps to tunnel & vlan.')
bDhcpHomeSubnetStartAddress = MibScalar((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 2, 2), InetAddressIPv4()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: bDhcpHomeSubnetStartAddress.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeSubnetStartAddress.setDescription("Home subnet's range start IPv4 Address.")
bDhcpHomeSubnetEndAddress = MibScalar((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 2, 3), InetAddressIPv4()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: bDhcpHomeSubnetEndAddress.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeSubnetEndAddress.setDescription("Home subnet's range end IPv4 Address.")
bDhcpHomeSubnetTotalAddresses = MibScalar((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 2, 4), Unsigned32()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: bDhcpHomeSubnetTotalAddresses.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeSubnetTotalAddresses.setDescription('The total number of addresses in the home subnet.')
bDhcpHomeSubnetUsedAddrLowThreshold = MibScalar((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 2, 5), Unsigned32()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: bDhcpHomeSubnetUsedAddrLowThreshold.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeSubnetUsedAddrLowThreshold.setDescription('The low threshold for used IP addresses in this home subnet. If the value for used IP addresses in this home subnet becomes equal to or less than this value and the current condition for bDhcpHomeSubnetUsedAddrHigh is raised, then a bDhcpHomeSubnetUsedAddrLow event will be generated. No more bDhcpHomeSubnetUsedAddrLow events will be generated for this subnet during its execution until the value for used addresses has exceeded the value of bDhcpHomeSubnetUsedAddrHighThreshold.')
bDhcpHomeSubnetUsedAddrHighThreshold = MibScalar((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 2, 6), Unsigned32()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: bDhcpHomeSubnetUsedAddrHighThreshold.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeSubnetUsedAddrHighThreshold.setDescription('The high threshold for used IP addresses in this home subnet. If a bDhcpHomeSubnetUsedAddrLow event has been generated (or no bDhcpHomeSubnetUsedAddrHigh was generated previously) for this home subnet, and the value for used IP addresses in this home subnet has exceeded this value then a bDhcpHomeSubnetUsedAddrHigh event will be generated. No more bDhcpHomeSubnetUsedAddrHigh events will be generated for this subnet during its execution until the value for used addresses in this subnet becomes equal to or less than the value of bDhcpHomeSubnetUsedAddrLowThreshold.')
bDhcpSubnetUsedAddrLow = NotificationType((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 0, 1)).setObjects(("BENU-DHCP-MIB", "bDhcpSubnetStartAddress"), ("BENU-DHCP-MIB", "bDhcpSubnetEndAddress"), ("BENU-DHCP-MIB", "bDhcpSubnetTotalAddresses"), ("BENU-DHCP-MIB", "bDhcpSubnetUsedAddrLowThreshold"))
if mibBuilder.loadTexts: bDhcpSubnetUsedAddrLow.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetUsedAddrLow.setDescription('This notification signifies that the number of used addresses for a particular subnet is cleared, meaning that it has fallen below the value of bDhcpSubnetUsedAddrLowThreshold for that subnet.')
bDhcpSubnetUsedAddrHigh = NotificationType((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 0, 2)).setObjects(("BENU-DHCP-MIB", "bDhcpSubnetStartAddress"), ("BENU-DHCP-MIB", "bDhcpSubnetEndAddress"), ("BENU-DHCP-MIB", "bDhcpSubnetTotalAddresses"), ("BENU-DHCP-MIB", "bDhcpSubnetUsedAddrHighThreshold"))
if mibBuilder.loadTexts: bDhcpSubnetUsedAddrHigh.setStatus('current')
if mibBuilder.loadTexts: bDhcpSubnetUsedAddrHigh.setDescription('This notification signifies that the number of used addresses for a particular subnet is raised, meaning that it has risen above the value of bDhcpSubnetUsedAddrHighThreshold for that subnet.')
bDhcpHomeSubnetUsedAddrLow = NotificationType((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 0, 3)).setObjects(("BENU-DHCP-MIB", "bDhcpHomeSubnetHomeId"), ("BENU-DHCP-MIB", "bDhcpHomeSubnetStartAddress"), ("BENU-DHCP-MIB", "bDhcpHomeSubnetEndAddress"), ("BENU-DHCP-MIB", "bDhcpHomeSubnetTotalAddresses"), ("BENU-DHCP-MIB", "bDhcpHomeSubnetUsedAddrLowThreshold"))
if mibBuilder.loadTexts: bDhcpHomeSubnetUsedAddrLow.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeSubnetUsedAddrLow.setDescription('This notification signifies that the number of used addresses for a particular home subnet is cleared, meaning that it has fallen below the value of bDhcpHomeSubnetUsedAddrLowThreshold for that subnet.')
bDhcpHomeSubnetUsedAddrHigh = NotificationType((1, 3, 6, 1, 4, 1, 39406, 2, 1, 6, 0, 4)).setObjects(("BENU-DHCP-MIB", "bDhcpHomeSubnetHomeId"), ("BENU-DHCP-MIB", "bDhcpHomeSubnetStartAddress"), ("BENU-DHCP-MIB", "bDhcpHomeSubnetEndAddress"), ("BENU-DHCP-MIB", "bDhcpHomeSubnetTotalAddresses"), ("BENU-DHCP-MIB", "bDhcpHomeSubnetUsedAddrHighThreshold"))
if mibBuilder.loadTexts: bDhcpHomeSubnetUsedAddrHigh.setStatus('current')
if mibBuilder.loadTexts: bDhcpHomeSubnetUsedAddrHigh.setDescription('This notification signifies that the number of used addresses for a particular home subnet is raised, meaning that it has risen above the value of bDhcpHomeSubnetUsedAddrHighThreshold for that subnet.')
mibBuilder.exportSymbols("BENU-DHCP-MIB", PYSNMP_MODULE_ID=bDhcpMIB, bDhcpHomeLeasesNotAssignFreeBuffUnavail=bDhcpHomeLeasesNotAssignFreeBuffUnavail, bDhcpv6UnicastRebindRcvd=bDhcpv6UnicastRebindRcvd, bDhcpSPWiFiLeasesNotAssignServIntNotConfig=bDhcpSPWiFiLeasesNotAssignServIntNotConfig, bDhcpHomeAcksSent=bDhcpHomeAcksSent, bDhcpHomeSubnetUsedAddrHighThreshold=bDhcpHomeSubnetUsedAddrHighThreshold, bDhcpSPWiFiNacksSent=bDhcpSPWiFiNacksSent, bDhcpNotifications=bDhcpNotifications, bDhcpSubnetIndex=bDhcpSubnetIndex, bDhcpHomeIntervalDuration=bDhcpHomeIntervalDuration, bDhcpv6LeasesAssigned=bDhcpv6LeasesAssigned, bDhcpv6DeclineWithoutAddrRcvd=bDhcpv6DeclineWithoutAddrRcvd, bDhcpv6DropDecline=bDhcpv6DropDecline, bDhcpv6RebindWithoutAddrRcvd=bDhcpv6RebindWithoutAddrRcvd, bDhcpHomeSubnetUsedAddrLow=bDhcpHomeSubnetUsedAddrLow, bDhcpSPWiFiDropRelease=bDhcpSPWiFiDropRelease, bDhcpv6ServerIdNotPres=bDhcpv6ServerIdNotPres, bDhcpHomeGlobalTable=bDhcpHomeGlobalTable, bDhcpv6LeasesRelFail=bDhcpv6LeasesRelFail, bDhcpSubnetAddress=bDhcpSubnetAddress, bDhcpHomeSubnetTotalAddresses=bDhcpHomeSubnetTotalAddresses, bDhcpv6UnicastRequestRcvd=bDhcpv6UnicastRequestRcvd, bDhcpv6RenewWithoutAddrOrMoreRcvd=bDhcpv6RenewWithoutAddrOrMoreRcvd, bDhcpInformsAckSent=bDhcpInformsAckSent, bDhcpv6UnicastReleaseRcvd=bDhcpv6UnicastReleaseRcvd, bDhcpSubnetUsedAddrLow=bDhcpSubnetUsedAddrLow, bDhcpv6ReplysSent=bDhcpv6ReplysSent, bDhcpSPWiFiDeclinesRcvd=bDhcpSPWiFiDeclinesRcvd, bDhcpHomeReleasesIndSent=bDhcpHomeReleasesIndSent, bDhcpSPWiFiInformsAckSent=bDhcpSPWiFiInformsAckSent, bDhcpHomeNacksSent=bDhcpHomeNacksSent, bDhcpv6DropSolicit=bDhcpv6DropSolicit, bDhcpHomeSubnetStartAddress=bDhcpHomeSubnetStartAddress, bDhcpv6DropRebind=bDhcpv6DropRebind, bDhcpSubnetStartAddress=bDhcpSubnetStartAddress, bDhcpHomeLeasesReleased=bDhcpHomeLeasesReleased, bDhcpv6LeasesOffered=bDhcpv6LeasesOffered, bDhcpLeasesAssigned=bDhcpLeasesAssigned, bDhcpv6DropRequest=bDhcpv6DropRequest, bDhcpDeclinesRcvd=bDhcpDeclinesRcvd, bDhcpSubnetTotalAddresses=bDhcpSubnetTotalAddresses, bDhcpv6OffersSent=bDhcpv6OffersSent, bDhcpv6ClientIdNotPres=bDhcpv6ClientIdNotPres, bDhcpSubnetUsedAddrHigh=bDhcpSubnetUsedAddrHigh, bDhcpv6ReleasesRcvd=bDhcpv6ReleasesRcvd, bDhcpSubnetTable=bDhcpSubnetTable, bDhcpGlobalEntry=bDhcpGlobalEntry, bDhcpv6ConfirmsRcvd=bDhcpv6ConfirmsRcvd, bDhcpDropRequest=bDhcpDropRequest, bDhcpv6LeasesRenewFail=bDhcpv6LeasesRenewFail, bDhcpNacksSent=bDhcpNacksSent, bDhcpHomeReleasesRcvd=bDhcpHomeReleasesRcvd, bDhcpSPWiFiGlobalTable=bDhcpSPWiFiGlobalTable, bDhcpLeasesRenewed=bDhcpLeasesRenewed, bDhcpv6ReleaseIndRcvd=bDhcpv6ReleaseIndRcvd, bDhcpInformsRcvd=bDhcpInformsRcvd, bDhcpHomeLeasesExpired=bDhcpHomeLeasesExpired, bDhcpSPWiFiDropRequest=bDhcpSPWiFiDropRequest, bDhcpSubnetPeakUsedAddresses=bDhcpSubnetPeakUsedAddresses, bDhcpv6RequestsRcvd=bDhcpv6RequestsRcvd, bDhcpv6DropDupSolicit=bDhcpv6DropDupSolicit, bDhcpv4MIBObjects=bDhcpv4MIBObjects, bDhcpLeasesNotAssignFreeBuffUnavail=bDhcpLeasesNotAssignFreeBuffUnavail, bDhcpv6GlobalStatsInterval=bDhcpv6GlobalStatsInterval, bDhcpHomeDropDiscover=bDhcpHomeDropDiscover, bDhcpHomeDropRelease=bDhcpHomeDropRelease, bDhcpLeasesRenewFail=bDhcpLeasesRenewFail, bDhcpHomeGlobalStatsInterval=bDhcpHomeGlobalStatsInterval, bDhcpv6DropRelay=bDhcpv6DropRelay, bDhcpv6RebindRcvd=bDhcpv6RebindRcvd, bDhcpv6UnicastDeclineRcvd=bDhcpv6UnicastDeclineRcvd, bDhcpSPWiFiLeasesExpired=bDhcpSPWiFiLeasesExpired, bDhcpv6InformsRcvd=bDhcpv6InformsRcvd, bDhcpSPWiFiInformsRcvd=bDhcpSPWiFiInformsRcvd, bDhcpHomeInformsAckSent=bDhcpHomeInformsAckSent, bDhcpAcksSent=bDhcpAcksSent, bDhcpv6GlobalTable=bDhcpv6GlobalTable, bDhcpHomeReleasesIndRcvd=bDhcpHomeReleasesIndRcvd, bDhcpv6DropAdvertise=bDhcpv6DropAdvertise, bDhcpSPWiFiGlobalStatsInterval=bDhcpSPWiFiGlobalStatsInterval, bDhcpSubnetUsedAddrHighThreshold=bDhcpSubnetUsedAddrHighThreshold, bDhcpSPWiFiReleasesRcvd=bDhcpSPWiFiReleasesRcvd, bDhcpSubnetStatsInterval=bDhcpSubnetStatsInterval, bDhcpHomeSubnetUsedAddrHigh=bDhcpHomeSubnetUsedAddrHigh, bDhcpLeasesReleased=bDhcpLeasesReleased, bDhcpLeasesExpired=bDhcpLeasesExpired, bDhcpDropRelease=bDhcpDropRelease, bDhcpSubnetPeakFreeAddresses=bDhcpSubnetPeakFreeAddresses, bDhcpHomeLeasesAssigned=bDhcpHomeLeasesAssigned, bDhcpSubnetUsedAddrLowThreshold=bDhcpSubnetUsedAddrLowThreshold, bDhcpv6DropReconfig=bDhcpv6DropReconfig, bDhcpDropDiscover=bDhcpDropDiscover, bDhcpv6DropRelease=bDhcpv6DropRelease, bDhcpv6UnicastConfirmRcvd=bDhcpv6UnicastConfirmRcvd, bDhcpSPWiFiReleasesIndSent=bDhcpSPWiFiReleasesIndSent, bDhcpReleasesSent=bDhcpReleasesSent, bDhcpv6ServerIdPres=bDhcpv6ServerIdPres, bDhcpGlobalStatsInterval=bDhcpGlobalStatsInterval, bDhcpSubnetRangeIndex=bDhcpSubnetRangeIndex, bDhcpSPWiFiGlobalEntry=bDhcpSPWiFiGlobalEntry, bDhcpv6NotifObjects=bDhcpv6NotifObjects, bDhcpReleasesRcvd=bDhcpReleasesRcvd, bDhcpSPWiFiLeasesNotAssignFreeBuffUnavail=bDhcpSPWiFiLeasesNotAssignFreeBuffUnavail, bDhcpv6LeasesExpired=bDhcpv6LeasesExpired, bBootpRequestsRcvd=bBootpRequestsRcvd, bSPWiFiBootpRequestsRcvd=bSPWiFiBootpRequestsRcvd, bDhcpv6DeclinesRcvd=bDhcpv6DeclinesRcvd, bDhcpv6UnknownMsgsRcvd=bDhcpv6UnknownMsgsRcvd, bDhcpHomeLeasesRenewFail=bDhcpHomeLeasesRenewFail, bDhcpv6ActiveClient=bDhcpv6ActiveClient, bDhcpv6DropRenew=bDhcpv6DropRenew, bDhcpv6InternalError=bDhcpv6InternalError, bDhcpGlobalTable=bDhcpGlobalTable, bDhcpHomeSubnetHomeId=bDhcpHomeSubnetHomeId, bDhcpHomeSubnetUsedAddrLowThreshold=bDhcpHomeSubnetUsedAddrLowThreshold, bDhcpSPWiFiOffersSent=bDhcpSPWiFiOffersSent, bDhcpSubnetPeakHoldAddresses=bDhcpSubnetPeakHoldAddresses, bDhcpv6ORONotPres=bDhcpv6ORONotPres, bDhcpOffersSent=bDhcpOffersSent, bDhcpSPWiFiLeasesRelFail=bDhcpSPWiFiLeasesRelFail, bDhcpSubnetIntervalDuration=bDhcpSubnetIntervalDuration, bDhcpSPWiFiLeasesRenewed=bDhcpSPWiFiLeasesRenewed, bDhcpv6LeasesRenewed=bDhcpv6LeasesRenewed, bDhcpHomeRequestsRcvd=bDhcpHomeRequestsRcvd, bDhcpv6RenewRcvd=bDhcpv6RenewRcvd, bDhcpv6ReconfAcceptInSolicitMissing=bDhcpv6ReconfAcceptInSolicitMissing, bDhcpSPWiFiIntervalDuration=bDhcpSPWiFiIntervalDuration, bDhcpHomeSubnetEndAddress=bDhcpHomeSubnetEndAddress, bDhcpv6ReconfigsSent=bDhcpv6ReconfigsSent, bDhcpHomeInformsRcvd=bDhcpHomeInformsRcvd, bSPWiFiBootpRepliesSent=bSPWiFiBootpRepliesSent, bDhcpv4ActiveSpWiFiClients=bDhcpv4ActiveSpWiFiClients, bDhcpSPWiFiLeasesRenewFail=bDhcpSPWiFiLeasesRenewFail, bDhcpv6DropRelayReply=bDhcpv6DropRelayReply, bDhcpDiscoversRcvd=bDhcpDiscoversRcvd, bDhcpSPWiFiLeasesAssigned=bDhcpSPWiFiLeasesAssigned, bDhcpv4ActiveHomeClients=bDhcpv4ActiveHomeClients, bDhcpv6UnicastSolicitRcvd=bDhcpv6UnicastSolicitRcvd, bDhcpHomeLeasesNotAssignServIntNotConfig=bDhcpHomeLeasesNotAssignServIntNotConfig, bDhcpv6RebindWithoutAddrOrMoreRcvd=bDhcpv6RebindWithoutAddrOrMoreRcvd, bDhcpv6ConfirmWithoutAddrRcvd=bDhcpv6ConfirmWithoutAddrRcvd, bDhcpv6SolicitsRcvd=bDhcpv6SolicitsRcvd, bDhcpHomeDropRequest=bDhcpHomeDropRequest, bBootpRepliesSent=bBootpRepliesSent, bDhcpHomeLeasesRenewed=bDhcpHomeLeasesRenewed, bDhcpv6DropInform=bDhcpv6DropInform, bDhcpv6DropConfirm=bDhcpv6DropConfirm, bDhcpSubnetEndAddress=bDhcpSubnetEndAddress, bDhcpv4NotifObjects=bDhcpv4NotifObjects, bDhcpSPWiFiDiscoversRcvd=bDhcpSPWiFiDiscoversRcvd, bDhcpSPWiFiLeasesReleased=bDhcpSPWiFiLeasesReleased, bDhcpSPWiFiAcksSent=bDhcpSPWiFiAcksSent, bDhcpHomeDiscoversRcvd=bDhcpHomeDiscoversRcvd, bDhcpSPWiFiReleasesSent=bDhcpSPWiFiReleasesSent, bDhcpHomeGlobalEntry=bDhcpHomeGlobalEntry, bDhcpLeasesRelFail=bDhcpLeasesRelFail, bHomeBootpRequestsRcvd=bHomeBootpRequestsRcvd, bDhcpv6AdvertisesSent=bDhcpv6AdvertisesSent, bDhcpHomeOffersSent=bDhcpHomeOffersSent, bDhcpSPWiFiDropDiscover=bDhcpSPWiFiDropDiscover, bDhcpv6DropReply=bDhcpv6DropReply, bDhcpv6RebindFail=bDhcpv6RebindFail, bDhcpReleasesIndSent=bDhcpReleasesIndSent, bDhcpIntervalDuration=bDhcpIntervalDuration, bDhcpv6NoInterface=bDhcpv6NoInterface, bDhcpMIB=bDhcpMIB, bDhcpReleasesIndRcvd=bDhcpReleasesIndRcvd, bDhcpHomeReleasesSent=bDhcpHomeReleasesSent, bDhcpLeasesNotAssignServIntNotConfig=bDhcpLeasesNotAssignServIntNotConfig, bDhcpv6MIBObjects=bDhcpv6MIBObjects, bDhcpv6ClientIdPres=bDhcpv6ClientIdPres, bDhcpv6LeasesExpiryFail=bDhcpv6LeasesExpiryFail, bDhcpv6IntervalDuration=bDhcpv6IntervalDuration, bDhcpHomeLeasesRelFail=bDhcpHomeLeasesRelFail, bDhcpv4ActiveClient=bDhcpv4ActiveClient, bDhcpv6GlobalEntry=bDhcpv6GlobalEntry, bDhcpHomeDeclinesRcvd=bDhcpHomeDeclinesRcvd, bHomeBootpRepliesSent=bHomeBootpRepliesSent, bDhcpSPWiFiRequestsRcvd=bDhcpSPWiFiRequestsRcvd, bDhcpSPWiFiReleasesIndRcvd=bDhcpSPWiFiReleasesIndRcvd, bDhcpv6LeasesReleased=bDhcpv6LeasesReleased, bDhcpRequestsRcvd=bDhcpRequestsRcvd, bDhcpSubnetEntry=bDhcpSubnetEntry, bDhcpv6UnicastRenewRcvd=bDhcpv6UnicastRenewRcvd, bDhcpSubnetMask=bDhcpSubnetMask)
| 129.848696 | 8,700 | 0.797584 | 8,451 | 74,663 | 7.046267 | 0.070998 | 0.074763 | 0.130836 | 0.014241 | 0.561345 | 0.414707 | 0.343236 | 0.301941 | 0.237237 | 0.184104 | 0 | 0.06369 | 0.089643 | 74,663 | 574 | 8,701 | 130.074913 | 0.812403 | 0.004286 | 0 | 0 | 0 | 0.028269 | 0.258738 | 0.019264 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.014134 | 0 | 0.014134 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
75b6c18dfa446419248388da0312dd8768c0d8d7 | 36,014 | py | Python | engapp/migrations/0001_initial.py | leonolan2020/phoenix | b5956a7003e548f01255cbd5d0d76cfd0ac77a81 | [
"MIT"
] | 1 | 2020-09-19T21:56:40.000Z | 2020-09-19T21:56:40.000Z | engapp/migrations/0001_initial.py | leonolan2020/phoenix | b5956a7003e548f01255cbd5d0d76cfd0ac77a81 | [
"MIT"
] | null | null | null | engapp/migrations/0001_initial.py | leonolan2020/phoenix | b5956a7003e548f01255cbd5d0d76cfd0ac77a81 | [
"MIT"
] | 5 | 2020-09-18T18:53:03.000Z | 2020-10-21T14:42:00.000Z | # Generated by Django 3.1 on 2020-09-16 21:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='ContactMessage',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('fname', models.CharField(max_length=50, verbose_name='First Name')),
('lname', models.CharField(max_length=50, verbose_name='Last Name')),
('email', models.EmailField(max_length=254, verbose_name='Email')),
('subject', models.CharField(max_length=50, verbose_name='Title')),
('message', models.CharField(max_length=50, verbose_name='Message')),
('date_added', models.DateTimeField(auto_now_add=True, verbose_name='Date Added')),
],
options={
'verbose_name': 'ContactMessage',
'verbose_name_plural': 'ContactMessages',
},
),
migrations.CreateModel(
name='FAQ',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('for_home', models.BooleanField(default=False, verbose_name='Show on homepage')),
('icon', models.CharField(choices=[('account_circle', 'account_circle'), ('add_shopping_cart', 'add_shopping_cart'), ('alarm', 'alarm'), ('attach_file', 'attach_file'), ('attach_money', 'attach_money'), ('backup', 'backup'), ('build', 'build'), ('chat', 'chat'), ('dashboard', 'dashboard'), ('delete', 'delete'), ('description', 'description'), ('face', 'face'), ('favorite', 'favorite'), ('get_app', 'get_app'), ('help_outline', 'help_outline'), ('home', 'home'), ('important_devices', 'important_devices'), ('link', 'link'), ('local_shipping', 'local_shipping'), ('lock', 'lock'), ('mail', 'mail'), ('notification_important', 'notification_important'), ('psychology', 'psychology'), ('publish', 'publish'), ('reply', 'reply'), ('schedule', 'schedule'), ('send', 'send'), ('settings', 'settings'), ('share', 'share'), ('sync', 'sync'), ('vpn_key', 'vpn_key')], default='help_outline', max_length=50, verbose_name='Icon')),
('color', models.CharField(choices=[('success', 'success'), ('danger', 'danger'), ('warning', 'warning'), ('primary', 'primary'), ('secondary', 'secondary'), ('info', 'info'), ('light', 'light'), ('dark', 'dark'), ('rose', 'rose')], default='primary', max_length=50, verbose_name='Color')),
('priority', models.IntegerField(verbose_name='Priority')),
('question', models.CharField(max_length=200, verbose_name='Question')),
('answer', models.CharField(max_length=5000, verbose_name='Answer')),
],
options={
'verbose_name': 'FAQ',
'verbose_name_plural': 'FAQs',
},
),
migrations.CreateModel(
name='Icon',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=50, verbose_name='Title')),
('image_origin', models.ImageField(blank=True, null=True, upload_to='engapp/images/OurService/', verbose_name='Image')),
('url', models.CharField(blank=True, max_length=2000, null=True, verbose_name='Link URL')),
('icon_fa', models.CharField(blank=True, max_length=50, null=True, verbose_name='Icon FontAwesome')),
('icon_material', models.CharField(blank=True, choices=[('account_circle', 'account_circle'), ('add_shopping_cart', 'add_shopping_cart'), ('alarm', 'alarm'), ('attach_file', 'attach_file'), ('attach_money', 'attach_money'), ('backup', 'backup'), ('build', 'build'), ('chat', 'chat'), ('dashboard', 'dashboard'), ('delete', 'delete'), ('description', 'description'), ('face', 'face'), ('favorite', 'favorite'), ('get_app', 'get_app'), ('help_outline', 'help_outline'), ('home', 'home'), ('important_devices', 'important_devices'), ('link', 'link'), ('local_shipping', 'local_shipping'), ('lock', 'lock'), ('mail', 'mail'), ('notification_important', 'notification_important'), ('psychology', 'psychology'), ('publish', 'publish'), ('reply', 'reply'), ('schedule', 'schedule'), ('send', 'send'), ('settings', 'settings'), ('share', 'share'), ('sync', 'sync'), ('vpn_key', 'vpn_key')], max_length=100, null=True, verbose_name='Icon Material')),
('icon_svg', models.TextField(blank=True, null=True, verbose_name='Icon svg')),
('color', models.CharField(choices=[('success', 'success'), ('danger', 'danger'), ('warning', 'warning'), ('primary', 'primary'), ('secondary', 'secondary'), ('info', 'info'), ('light', 'light'), ('dark', 'dark'), ('rose', 'rose')], default='primary', max_length=50, verbose_name='Color')),
('width', models.IntegerField(default=128, verbose_name='Width')),
('height', models.IntegerField(default=128, verbose_name='Height')),
],
options={
'verbose_name': 'Icon',
'verbose_name_plural': 'Icons',
},
),
migrations.CreateModel(
name='Jumbotron',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('pretitle', models.CharField(blank=True, max_length=500, null=True, verbose_name='Pre Title')),
('title', models.CharField(blank=True, max_length=500, null=True, verbose_name='Title')),
('posttitle', models.CharField(blank=True, max_length=500, null=True, verbose_name='Post Title')),
('short_description', models.TextField(blank=True, null=True, verbose_name='Short Description')),
('description', models.TextField(blank=True, null=True, verbose_name='Full Description')),
('action_text', models.CharField(blank=True, max_length=100, null=True, verbose_name='Button Text')),
('action_url', models.CharField(blank=True, max_length=2000, null=True, verbose_name='Button Link URL')),
('video_text', models.CharField(blank=True, max_length=100, null=True, verbose_name='Video Text')),
('video_url', models.CharField(blank=True, max_length=2000, null=True, verbose_name='Video Link URL')),
],
options={
'verbose_name': 'Jumbotron',
'verbose_name_plural': 'Jumbotrons',
},
),
migrations.CreateModel(
name='MainPic',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(choices=[('CAROUSEL', 'CAROUSEL'), ('FAQ', 'FAQ'), ('SEARCH', 'SEARCH'), ('VIDEO', 'VIDEO'), ('ABOUT', 'ABOUT'), ('CONTACT_HEADER', 'CONTACT_HEADER'), ('LOGO', 'LOGO'), ('BLOG_HEADER', 'BLOG_HEADER'), ('OUR_WORK_HEADER', 'OUR_WORK_HEADER'), ('PAGE_HEADER_DEFAULT', 'PAGE_HEADER_DEFAULT'), ('TAG_HEADER', 'TAG_HEADER'), ('ABOUT_HEADER', 'ABOUT_HEADER')], max_length=50, verbose_name='Image Title')),
('image_origin', models.ImageField(blank=True, null=True, upload_to='engapp/images/MainPic/', verbose_name='Image')),
],
options={
'verbose_name': 'MainPic',
'verbose_name_plural': 'MainPics',
},
),
migrations.CreateModel(
name='MetaData',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('for_home', models.BooleanField(default=False, verbose_name='Show on homepage')),
('key', models.CharField(default='name', max_length=50, verbose_name='key name')),
('value', models.CharField(default='description', max_length=50, verbose_name='key value')),
('content', models.CharField(max_length=2000, verbose_name='content')),
],
options={
'verbose_name': 'MetaData',
'verbose_name_plural': 'MetaDatas',
},
),
migrations.CreateModel(
name='OurTeam',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('for_home', models.BooleanField(default=False, verbose_name='Show on homepage')),
('name', models.CharField(max_length=100, verbose_name='Full Name')),
('job', models.CharField(max_length=100, verbose_name='Job')),
('description', models.CharField(max_length=500, verbose_name='Description')),
('priority', models.IntegerField(default=1000, verbose_name='Priority')),
('image_origin', models.ImageField(upload_to='engapp/images/OurTeam/', verbose_name='Image')),
],
options={
'verbose_name': 'OurTeam',
'verbose_name_plural': 'OurTeam',
},
),
migrations.CreateModel(
name='Parameter',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(choices=[('ABOUT_US_SHORT', 'ABOUT_US_SHORT'), ('ABOUT_US', 'ABOUT_US'), ('MOBILE', 'MOBILE'), ('URL', 'URL'), ('EMAIL', 'EMAIL'), ('FAX', 'FAX'), ('TEL', 'TEL'), ('LOCATION', 'LOCATION'), ('ADDRESS', 'ADDRESS'), ('SLOGAN', 'SLOGAN'), ('ABOUT_US_TITLE', 'ABOUT_US_TITLE'), ('TITLE', 'TITLE'), ('CURRENCY', 'CURRENCY'), ('PRE_TILTE', 'PRE_TILTE'), ('VIDEO_TITLE', 'VIDEO_TITLE'), ('VIDEO_LINK', 'VIDEO_LINK'), ('CONTACT_US', 'CONTACT_US'), ('POSTAL_CODE', 'POSTAL_CODE'), ('TERMS', 'TERMS'), ('OUR_TEAM_TITLE', 'OUR_TEAM_TITLE'), ('OUR_TEAM_LINK', 'OUR_TEAM_LINK'), ('CSRF_FAILURE_MESSAGE', 'CSRF_FAILURE_MESSAGE'), ('THEME_COLOR', 'THEME_COLOR')], max_length=50, verbose_name='Parameter Name')),
('value', models.CharField(max_length=10000, verbose_name='Parameter Value')),
],
options={
'verbose_name': 'Parameter',
'verbose_name_plural': 'Parameters',
},
),
migrations.CreateModel(
name='Profile',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('status', models.CharField(choices=[('ENABLED', 'ENABLED'), ('DISABLED', 'DISABLED')], default='ENABLED', max_length=50, verbose_name='Status')),
('first_name', models.CharField(max_length=200, verbose_name='First Name')),
('last_name', models.CharField(max_length=200, verbose_name='Last Name')),
('mobile', models.CharField(blank=True, max_length=50, null=True, verbose_name='Mobile')),
('bio', models.CharField(blank=True, max_length=500, null=True, verbose_name='Bio')),
('image_origin', models.ImageField(blank=True, max_length=1200, null=True, upload_to='engapp/images/Profile/', verbose_name='Image')),
],
options={
'verbose_name': 'Profile',
'verbose_name_plural': 'Profiles',
},
),
migrations.CreateModel(
name='Region',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(choices=[('IRAN', 'IRAN'), ('EUROPE', 'EUROPE'), ('AMERICA', 'AMERICA'), ('ASIA', 'ASIA')], default='IRAN', max_length=50, verbose_name='name')),
('priority', models.IntegerField(default=100, verbose_name='Priority')),
],
options={
'verbose_name': 'Region',
'verbose_name_plural': 'Regions',
},
),
migrations.CreateModel(
name='Resume',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('priority', models.IntegerField(verbose_name='priority')),
('title', models.CharField(max_length=50, verbose_name='title')),
('subtitle', models.CharField(max_length=50, verbose_name='subtitle')),
('description', models.CharField(max_length=500, verbose_name='description')),
('date', models.DateTimeField(verbose_name='date')),
],
options={
'verbose_name': 'Resume',
'verbose_name_plural': 'Resumes',
},
),
migrations.CreateModel(
name='SocialLink',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('for_home', models.BooleanField(default=False, verbose_name='Show on homepage')),
('priority', models.IntegerField(default=100, verbose_name='Priority')),
('title', models.CharField(max_length=50, verbose_name='Title')),
('image_origin', models.ImageField(blank=True, null=True, upload_to='engapp/images/OurService/', verbose_name='Image')),
('url', models.CharField(blank=True, max_length=2000, null=True, verbose_name='Link URL')),
('icon_fa', models.CharField(blank=True, max_length=50, null=True, verbose_name='Icon FontAwesome')),
('icon_material', models.CharField(blank=True, choices=[('account_circle', 'account_circle'), ('add_shopping_cart', 'add_shopping_cart'), ('alarm', 'alarm'), ('attach_file', 'attach_file'), ('attach_money', 'attach_money'), ('backup', 'backup'), ('build', 'build'), ('chat', 'chat'), ('dashboard', 'dashboard'), ('delete', 'delete'), ('description', 'description'), ('face', 'face'), ('favorite', 'favorite'), ('get_app', 'get_app'), ('help_outline', 'help_outline'), ('home', 'home'), ('important_devices', 'important_devices'), ('link', 'link'), ('local_shipping', 'local_shipping'), ('lock', 'lock'), ('mail', 'mail'), ('notification_important', 'notification_important'), ('psychology', 'psychology'), ('publish', 'publish'), ('reply', 'reply'), ('schedule', 'schedule'), ('send', 'send'), ('settings', 'settings'), ('share', 'share'), ('sync', 'sync'), ('vpn_key', 'vpn_key')], max_length=100, null=True, verbose_name='Icon Material')),
('icon_svg', models.TextField(blank=True, null=True, verbose_name='Icon svg')),
('color', models.CharField(choices=[('success', 'success'), ('danger', 'danger'), ('warning', 'warning'), ('primary', 'primary'), ('secondary', 'secondary'), ('info', 'info'), ('light', 'light'), ('dark', 'dark'), ('rose', 'rose')], default='primary', max_length=50, verbose_name='Color')),
('width', models.IntegerField(default=128, verbose_name='Width')),
('height', models.IntegerField(default=128, verbose_name='Height')),
],
options={
'verbose_name': 'SocialLink',
'verbose_name_plural': 'SocialLinks',
},
),
migrations.CreateModel(
name='Document',
fields=[
('icon_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='engapp.icon')),
('file', models.FileField(upload_to='engapp/images/Document', verbose_name='File')),
],
options={
'verbose_name': 'Document',
'verbose_name_plural': 'Documents',
},
bases=('engapp.icon',),
),
migrations.CreateModel(
name='GalleryAlbum',
fields=[
('jumbotron_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='engapp.jumbotron')),
('image_origin', models.ImageField(blank=True, null=True, upload_to='engapp/images/Gallery/Album/', verbose_name='Big Image 345*970 ')),
('for_home', models.BooleanField(default=False, verbose_name='Show on homepage')),
('archive', models.BooleanField(default=False, verbose_name='Archive?')),
('priority', models.IntegerField(default=100, verbose_name='Priority')),
('thumbnail_origin', models.ImageField(blank=True, null=True, upload_to='engapp/images/Gallery/Album/Thumbnail/', verbose_name='Thumbnail Image')),
],
options={
'verbose_name': 'GalleryAlbum',
'verbose_name_plural': 'GalleryAlbums',
},
bases=('engapp.jumbotron',),
),
migrations.CreateModel(
name='GalleryPhoto',
fields=[
('jumbotron_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='engapp.jumbotron')),
('image_origin', models.ImageField(upload_to='engapp/images/Gallery/Photo/', verbose_name='Big Image 345*970 ')),
('for_home', models.BooleanField(default=False, verbose_name='Show on homepage')),
('archive', models.BooleanField(default=False, verbose_name='Archive?')),
('priority', models.IntegerField(default=100, verbose_name='Priority')),
('thumbnail_origin', models.ImageField(blank=True, null=True, upload_to='engapp/images/Gallery/Photo/Thumbnail/', verbose_name='Thumbnail Image')),
],
options={
'verbose_name': 'GalleryPhoto',
'verbose_name_plural': 'GalleryPhotos',
},
bases=('engapp.jumbotron',),
),
migrations.CreateModel(
name='HomeSlider',
fields=[
('jumbotron_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='engapp.jumbotron')),
('image_origin', models.ImageField(upload_to='engapp/images/HomeSlider/', verbose_name='Image 1333*2000 ')),
('archive', models.BooleanField(default=False, verbose_name='بایگانی شود؟')),
('priority', models.IntegerField(default=100, verbose_name='Priority')),
('tag_number', models.IntegerField(default=100, verbose_name='Tag Number')),
('tag_text', models.CharField(blank=True, max_length=100, null=True, verbose_name='Tag Text')),
],
options={
'verbose_name': 'HomeSlider',
'verbose_name_plural': 'HomeSliders',
},
bases=('engapp.jumbotron',),
),
migrations.CreateModel(
name='Link',
fields=[
('icon_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='engapp.icon')),
('for_home', models.BooleanField(default=False, verbose_name='Show on homepage')),
('priority', models.IntegerField(default=100, verbose_name='Priority')),
],
options={
'verbose_name': 'Link',
'verbose_name_plural': 'Links',
},
bases=('engapp.icon',),
),
migrations.CreateModel(
name='Page',
fields=[
('jumbotron_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='engapp.jumbotron')),
('for_home', models.BooleanField(default=False, verbose_name='Show on homepage')),
('archive', models.BooleanField(default=False, verbose_name='Archive?')),
('header_image_origin', models.ImageField(blank=True, null=True, upload_to='engapp/images/Page/Banner/', verbose_name='Header Image 345*970 ')),
('image_origin', models.ImageField(blank=True, null=True, upload_to='engapp/images/Page/', verbose_name='Big Image')),
('grid_image_origin', models.ImageField(blank=True, null=True, upload_to='engapp/images/Page/Grid/', verbose_name='Grid Image')),
('thumbnail_origin', models.ImageField(blank=True, null=True, upload_to='engapp/images/Page/thumbnail/', verbose_name='Thumbnail Image')),
('priority', models.IntegerField(default=1000, verbose_name='Priority')),
('date_added', models.DateTimeField(auto_now_add=True, verbose_name='Date Added')),
('title_secondary', models.CharField(blank=True, max_length=200, null=True, verbose_name='Secondary Title')),
('description_secondary', models.CharField(blank=True, max_length=2000, null=True, verbose_name='Secondary Description')),
],
options={
'verbose_name': 'Page',
'verbose_name_plural': 'Pages',
},
bases=('engapp.jumbotron',),
),
migrations.CreateModel(
name='Testimonial',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('for_home', models.BooleanField(default=False, verbose_name='Show on homepage')),
('image_origin', models.ImageField(blank=True, null=True, upload_to='engapp/images/Testimonial/', verbose_name='Image')),
('title', models.CharField(max_length=2000, verbose_name='Title')),
('body', models.CharField(blank=True, max_length=2000, null=True, verbose_name='Body')),
('footer', models.CharField(max_length=200, verbose_name='Footer')),
('priority', models.IntegerField(default=100, verbose_name='Priority')),
('profile', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='engapp.profile', verbose_name='Profile')),
],
options={
'verbose_name': 'Testimonial',
'verbose_name_plural': 'Testimonials',
},
),
migrations.CreateModel(
name='Tag',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('priority', models.IntegerField(default=100, verbose_name='Priority')),
('image_header', models.ImageField(blank=True, null=True, upload_to='engapp/images/Tag/', verbose_name='Header Image')),
('title', models.CharField(max_length=50, verbose_name='Title')),
('icon', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='engapp.icon', verbose_name='Icon')),
],
options={
'verbose_name': 'Tag',
'verbose_name_plural': 'Tags',
},
),
migrations.CreateModel(
name='ResumeCategory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(choices=[('EXPERIENCE', 'EXPERIENCE'), ('EDUCATION', 'EDUCATION'), ('SKILLS', 'SKILLS'), ('INTERESTS', 'INTERESTS'), ('CERTIFICATIONS', 'CERTIFICATIONS'), ('AWARDS', 'AWARDS'), ('WORKS DONE', 'WORKS DONE')], default='EDUCATION', max_length=50, verbose_name='title')),
('priority', models.IntegerField(verbose_name='priority')),
('our_team', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='engapp.ourteam', verbose_name='our_team')),
('resumes', models.ManyToManyField(to='engapp.Resume', verbose_name='resume')),
],
options={
'verbose_name': 'ResumeCategory',
'verbose_name_plural': 'ResumeCategorys',
},
),
migrations.AddField(
model_name='profile',
name='region',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='engapp.region', verbose_name='region'),
),
migrations.AddField(
model_name='profile',
name='user',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='user_eng', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='ourteam',
name='resume_categories',
field=models.ManyToManyField(blank=True, to='engapp.ResumeCategory', verbose_name='ResumeCategories'),
),
migrations.AddField(
model_name='ourteam',
name='social_links',
field=models.ManyToManyField(blank=True, to='engapp.SocialLink', verbose_name='social_links'),
),
migrations.CreateModel(
name='Notification',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=50, verbose_name='Title')),
('body', models.CharField(blank=True, max_length=500, null=True, verbose_name='Description')),
('url', models.CharField(blank=True, max_length=1100, null=True, verbose_name='url')),
('seen', models.BooleanField(default=False, verbose_name='Seen?')),
('priority', models.IntegerField(default=1000, verbose_name='Priority')),
('date_added', models.DateTimeField(auto_now_add=True, verbose_name='Date Added')),
('date_seen', models.DateTimeField(blank=True, null=True, verbose_name='Date Seen')),
('icon', models.CharField(default='notification_important', max_length=50, verbose_name='Icon')),
('color', models.CharField(blank=True, choices=[('success', 'success'), ('danger', 'danger'), ('warning', 'warning'), ('primary', 'primary'), ('secondary', 'secondary'), ('info', 'info'), ('light', 'light'), ('dark', 'dark'), ('rose', 'rose')], default='info', max_length=500, null=True, verbose_name='Color')),
('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='engapp.profile', verbose_name='پروفایل')),
],
options={
'verbose_name': 'Notification',
'verbose_name_plural': 'Notifications',
},
),
migrations.CreateModel(
name='Like',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date_added', models.DateTimeField(auto_now_add=True, verbose_name='Date Added')),
('profile', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='engapp.profile', verbose_name='Profile')),
],
options={
'verbose_name': 'Like',
'verbose_name_plural': 'Likes',
},
),
migrations.CreateModel(
name='Comment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.TextField(verbose_name='Text')),
('date_added', models.DateTimeField(auto_now_add=True, verbose_name='Date Added')),
('profile', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='engapp.profile', verbose_name='Profile')),
('replys', models.ManyToManyField(blank=True, to='engapp.Comment', verbose_name='Replies')),
],
options={
'verbose_name': 'Comment',
'verbose_name_plural': 'Comments',
},
),
migrations.CreateModel(
name='Blog',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='engapp.page')),
],
options={
'verbose_name': 'Blog',
'verbose_name_plural': 'Blogs',
},
bases=('engapp.page',),
),
migrations.CreateModel(
name='OurService',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='engapp.page')),
('icon_fa', models.CharField(blank=True, max_length=50, null=True, verbose_name='Icon FontAwesome')),
('icon_material', models.CharField(blank=True, choices=[('account_circle', 'account_circle'), ('add_shopping_cart', 'add_shopping_cart'), ('alarm', 'alarm'), ('attach_file', 'attach_file'), ('attach_money', 'attach_money'), ('backup', 'backup'), ('build', 'build'), ('chat', 'chat'), ('dashboard', 'dashboard'), ('delete', 'delete'), ('description', 'description'), ('face', 'face'), ('favorite', 'favorite'), ('get_app', 'get_app'), ('help_outline', 'help_outline'), ('home', 'home'), ('important_devices', 'important_devices'), ('link', 'link'), ('local_shipping', 'local_shipping'), ('lock', 'lock'), ('mail', 'mail'), ('notification_important', 'notification_important'), ('psychology', 'psychology'), ('publish', 'publish'), ('reply', 'reply'), ('schedule', 'schedule'), ('send', 'send'), ('settings', 'settings'), ('share', 'share'), ('sync', 'sync'), ('vpn_key', 'vpn_key')], max_length=100, null=True, verbose_name='Icon Material')),
('icon_svg', models.TextField(blank=True, null=True, verbose_name='Icon svg')),
('color', models.CharField(choices=[('success', 'success'), ('danger', 'danger'), ('warning', 'warning'), ('primary', 'primary'), ('secondary', 'secondary'), ('info', 'info'), ('light', 'light'), ('dark', 'dark'), ('rose', 'rose')], default='primary', max_length=50, verbose_name='Color')),
('width', models.IntegerField(default=128, verbose_name='Width')),
('height', models.IntegerField(default=128, verbose_name='Height')),
],
options={
'verbose_name': 'OurService',
'verbose_name_plural': 'OurServices',
},
bases=('engapp.page',),
),
migrations.CreateModel(
name='OurWork',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='engapp.page')),
('location', models.CharField(blank=True, max_length=500, null=True, verbose_name='Google Map Location 400*400')),
],
options={
'verbose_name': 'OurWork',
'verbose_name_plural': 'OurWorks',
},
bases=('engapp.page',),
),
migrations.AddField(
model_name='resume',
name='documents',
field=models.ManyToManyField(blank=True, to='engapp.Document', verbose_name='documents'),
),
migrations.AddField(
model_name='resume',
name='links',
field=models.ManyToManyField(blank=True, to='engapp.Link', verbose_name='links'),
),
migrations.CreateModel(
name='PartialPage',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('pretitle', models.CharField(blank=True, max_length=1000, null=True, verbose_name='Pre Title')),
('title', models.CharField(blank=True, max_length=1000, null=True, verbose_name='Title')),
('posttitle', models.CharField(blank=True, max_length=1000, null=True, verbose_name='Post Title')),
('description', models.TextField(verbose_name='Full Description')),
('image_origin', models.ImageField(blank=True, null=True, upload_to='engapp/images/Blog/Partials/', verbose_name='Big Image')),
('priority', models.IntegerField(default=1000, verbose_name='Priority')),
('date_added', models.DateTimeField(auto_now_add=True, verbose_name='Data Added')),
('profile', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='engapp.profile', verbose_name='توسط')),
('documents', models.ManyToManyField(blank=True, to='engapp.Document', verbose_name='Documents')),
('galleries', models.ManyToManyField(blank=True, to='engapp.GalleryAlbum', verbose_name='Gallery Albums')),
('links', models.ManyToManyField(blank=True, to='engapp.Link', verbose_name='Links')),
],
options={
'verbose_name': 'PartialPage',
'verbose_name_plural': 'PartialPages',
},
),
migrations.AddField(
model_name='page',
name='comments',
field=models.ManyToManyField(blank=True, to='engapp.Comment', verbose_name='Comments'),
),
migrations.AddField(
model_name='page',
name='documents',
field=models.ManyToManyField(blank=True, to='engapp.Document', verbose_name='Documents'),
),
migrations.AddField(
model_name='page',
name='likes',
field=models.ManyToManyField(blank=True, to='engapp.Like', verbose_name='Likes'),
),
migrations.AddField(
model_name='page',
name='links',
field=models.ManyToManyField(blank=True, to='engapp.Link', verbose_name='Links'),
),
migrations.AddField(
model_name='page',
name='meta_datas',
field=models.ManyToManyField(blank=True, to='engapp.MetaData', verbose_name='Meta Datas'),
),
migrations.AddField(
model_name='page',
name='partials',
field=models.ManyToManyField(blank=True, to='engapp.PartialPage', verbose_name='Partial Pages'),
),
migrations.AddField(
model_name='page',
name='profile',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='engapp.profile', verbose_name='توسط'),
),
migrations.AddField(
model_name='page',
name='relateds',
field=models.ManyToManyField(blank=True, to='engapp.Page', verbose_name='Related Pages'),
),
migrations.AddField(
model_name='page',
name='tags',
field=models.ManyToManyField(blank=True, to='engapp.Tag', verbose_name='Tags'),
),
migrations.AddField(
model_name='galleryalbum',
name='photos',
field=models.ManyToManyField(blank=True, to='engapp.GalleryPhoto', verbose_name='Photos'),
),
migrations.AddField(
model_name='document',
name='profile',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='engapp.profile', verbose_name='Profile'),
),
]
| 67.065177 | 957 | 0.591353 | 3,589 | 36,014 | 5.744776 | 0.084703 | 0.125909 | 0.029101 | 0.031332 | 0.763896 | 0.750849 | 0.689737 | 0.645164 | 0.619944 | 0.595596 | 0 | 0.010587 | 0.236769 | 36,014 | 536 | 958 | 67.190299 | 0.739477 | 0.001194 | 0 | 0.551985 | 1 | 0 | 0.256109 | 0.018572 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.015123 | 0 | 0.022684 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
75b83fea074650a12ad398c9b83917801a958322 | 1,993 | py | Python | code-files/frosch2010_Tabu_revenge_timer.py | Frosch2010/discord-tabu | b6d4fd460e18f692892a0402f0c6d0b2584a3cbc | [
"MIT"
] | 2 | 2020-12-30T21:47:19.000Z | 2020-12-30T21:47:40.000Z | code-files/frosch2010_Tabu_revenge_timer.py | Frosch2010/discord-tabu | b6d4fd460e18f692892a0402f0c6d0b2584a3cbc | [
"MIT"
] | 4 | 2021-04-04T14:24:37.000Z | 2021-04-18T20:26:25.000Z | code-files/frosch2010_Tabu_revenge_timer.py | Frosch2010/discord-tabu | b6d4fd460e18f692892a0402f0c6d0b2584a3cbc | [
"MIT"
] | null | null | null | import discord
import asyncio
import copy
import frosch2010_Console_Utils as fCU
import frosch2010_Class_Utils as fCLU
import frosch2010_Discord_Utils as fDU
import frosch2010_Tabu_other_funtions as fTOF
async def revenge_timer(tabuVars, tabuSettings, tabuLanguage, client):
if not tabuVars.tabu_revenge_question:
fCU.log_In_Console("Revenge question time ended...", "REV-TIMER","inf")
return
#Print Countdown to all
for countdown in tabuVars.tabu_revenge_msgs:
if tabuVars.tabu_revenge_question:
try:
await countdown.edit(content=tabuLanguage.tabu_revenge_asking.replace("[ASKING_USER_NAME]", tabuVars.tabuVars.tabu_revenge_asking_player_msg.author.name).replace("[REMAINING_TIME]", str(tabuVars.tabu_revenge_time)))
except:
pass
#Ist die Zeit fuers Team abgelaufen?
if tabuVars.tabu_revenge_time == 0:
fCU.log_In_Console("Time is up!", "REV-TIMER", "inf")
tabuVars.tabu_revenge_time = copy.deepcopy(tabuSettings.tabu_revenge_time)
tabuVars.tabu_revenge_question = False
botMessage = await fDU.send_Message_To_Channel(tabuLanguage.tabu_revenge_canceled, [client.get_channel(tabuSettings.tabu_channelID_team_1), client.get_channel(tabuSettings.tabu_channelID_team_2)])
fCU.log_In_Console("Deleting all revenge questions...", "REV-TIMER", "inf")
tabuVars.tabu_revenge_msgs.append(botMessage)
for old_card in tabuVars.tabu_revenge_msgs:
try:
await old_card.delete()
except:
pass
tabuVars.tabu_revenge_msgs = []
tabuVars.tabu_revenge_player_yes = []
tabuVars.tabu_revenge_asking_player_name = ""
tabuVars.tabu_revenge_asking_player_msg = None
else:
tabuVars.tabu_revenge_time -= 1
fCLU.Timer(1, revenge_timer, [tabuVars, tabuSettings, tabuLanguage, client]) | 34.964912 | 232 | 0.692423 | 238 | 1,993 | 5.478992 | 0.352941 | 0.15184 | 0.218558 | 0.070552 | 0.305982 | 0.243865 | 0.069018 | 0 | 0 | 0 | 0 | 0.013672 | 0.229303 | 1,993 | 57 | 233 | 34.964912 | 0.835286 | 0.0286 | 0 | 0.166667 | 0 | 0 | 0.076637 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.055556 | 0.194444 | 0 | 0.222222 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
75ccd24c10c2ecf4df25c72edd7edb5b13a7eedb | 1,750 | py | Python | 084/test_monopoly.py | bsamseth/project-euler | 60d70b117960f37411935bc18eab5bb2fca220e2 | [
"MIT"
] | null | null | null | 084/test_monopoly.py | bsamseth/project-euler | 60d70b117960f37411935bc18eab5bb2fca220e2 | [
"MIT"
] | null | null | null | 084/test_monopoly.py | bsamseth/project-euler | 60d70b117960f37411935bc18eab5bb2fca220e2 | [
"MIT"
] | null | null | null | from monopoly import *
def test_regmove():
g = Game()
g.move(5)
assert g.pos == squares['R1']
assert g.board[g.pos] == 1
assert sum(g.board) == 1
def test_chest_GO():
g = Game()
g.move(1)
assert g.pos == squares['A1']
g.CC.remove(squares['GO'])
g.CC.appendleft(squares['GO'])
assert g.CC[0] == squares['GO']
g.move(1)
assert g.pos == squares['GO']
assert g.board[g.pos] == 1
assert g.board[squares['CC1']] == 0
def test_chest_JAIL():
g = Game()
g.move(1)
assert g.pos == squares['A1']
g.CC.remove(squares['JAIL'])
g.CC.appendleft(squares['JAIL'])
assert g.CC[0] == squares['JAIL']
g.move(1)
assert g.pos == squares['JAIL']
assert g.board[g.pos] == 1
assert g.board[squares['CC1']] == 0
def test_chance_GO():
g = Game()
g.CH.remove(squares['GO'])
g.CH.appendleft(squares['GO'])
assert g.CH[0] == squares['GO']
g.move(7)
assert g.pos == squares['GO']
assert g.board[g.pos] == 1
assert sum(g.board) == 1
def test_chance_next_R():
g = Game()
g.CH.remove(g.next_R)
g.CH.appendleft(g.next_R)
assert g.CH[0] == g.next_R
g.move(36)
assert g.pos == squares['R1']
assert g.board[g.pos] == 1
assert sum(g.board) == 1
def test_chance_next_U():
g = Game()
g.CH.remove(g.next_U)
g.CH.appendleft(g.next_U)
assert g.CH[0] == g.next_U
g.move(36)
assert g.pos == squares['U1']
assert g.board[g.pos] == 1
assert sum(g.board) == 1
def test_chance_back_3():
g = Game()
g.CH.remove(g.back_3)
g.CH.appendleft(g.back_3)
assert g.CH[0] == g.back_3
g.move(7)
assert g.pos == squares['T1']
assert g.board[g.pos] == 1
assert sum(g.board) == 1
| 23.972603 | 39 | 0.570286 | 303 | 1,750 | 3.211221 | 0.122112 | 0.172662 | 0.092497 | 0.157246 | 0.827338 | 0.67112 | 0.624872 | 0.494347 | 0.494347 | 0.494347 | 0 | 0.032114 | 0.234857 | 1,750 | 72 | 40 | 24.305556 | 0.694548 | 0 | 0 | 0.538462 | 0 | 0 | 0.028571 | 0 | 0 | 0 | 0 | 0 | 0.446154 | 1 | 0.107692 | false | 0 | 0.015385 | 0 | 0.123077 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
75cd11c04ab251026c77901de0d224a9f1438ea1 | 1,023 | py | Python | src/ds_simple_db/core/serializer.py | dmitryshurov/simple_data_storage_library | f6b6aac38082e9cfe547b3cb7a662ffea8db5e8f | [
"MIT"
] | null | null | null | src/ds_simple_db/core/serializer.py | dmitryshurov/simple_data_storage_library | f6b6aac38082e9cfe547b3cb7a662ffea8db5e8f | [
"MIT"
] | null | null | null | src/ds_simple_db/core/serializer.py | dmitryshurov/simple_data_storage_library | f6b6aac38082e9cfe547b3cb7a662ffea8db5e8f | [
"MIT"
] | null | null | null | from typing import List
from ds_simple_db.core.entry import Entry
class Serializer:
"""
The base class for all serializers.
To implement a new serializer you need to implement the following methods:
* entries_to_string (serialize a list of entries to a string)
* entries_from_string (deserialize a list of entries from a string)
"""
def entries_to_string(self, entries: List[Entry]) -> str:
"""
Dump a list of entries to a string.
This must be implemented in a derived class to support serialization
:param entries: A list of entries to serialize
:return: A serialized string
"""
pass
def entries_from_string(self, input_str: str) -> List[Entry]:
"""
Load a list of entries from a string.
This must be implemented in a derived class to support deserialization
:param input_str: A string to serialize
:return: A list of entries deserialized from a string
"""
pass
| 30.088235 | 78 | 0.657869 | 141 | 1,023 | 4.687943 | 0.347518 | 0.045386 | 0.06354 | 0.12708 | 0.305598 | 0.281392 | 0.281392 | 0.157337 | 0.157337 | 0.157337 | 0 | 0 | 0.286413 | 1,023 | 33 | 79 | 31 | 0.905479 | 0.620723 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.285714 | 0.285714 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
75dc160591ff4303d71ca698e733034e4254a3cc | 1,020 | py | Python | main.py | Melumi11/discord.py-starter | 12e83867a15141dbdfd653d2d67e14396e0669b4 | [
"MIT"
] | null | null | null | main.py | Melumi11/discord.py-starter | 12e83867a15141dbdfd653d2d67e14396e0669b4 | [
"MIT"
] | null | null | null | main.py | Melumi11/discord.py-starter | 12e83867a15141dbdfd653d2d67e14396e0669b4 | [
"MIT"
] | null | null | null | # -------------------------------import----------------------------------#
import logging
from client import *
import slashcommands
# -----------------------------------------------------------------------#
# Logging errors
logging.basicConfig(level=logging.ERROR)
# -------------------------------variables-------------------------------#
client = Client() # from client.py (this contains everything needed for the bot to function)
# -----------------------------------------------------------------------#
# -----------------------------slash commands----------------------------#
slashcommands.init_slashcommands(client) # defines all your slash command functions
# -----------------------------------------------------------------------#
# -------------------------------launch bot------------------------------#
with open('token.txt') as f:
TOKEN = f.readline() # put bot token in git ignored file token.txt
client.run(TOKEN)
# -----------------------------------------------------------------------#
| 35.172414 | 92 | 0.35098 | 65 | 1,020 | 5.492308 | 0.646154 | 0.067227 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.082353 | 1,020 | 28 | 93 | 36.428571 | 0.38141 | 0.733333 | 0 | 0 | 0 | 0 | 0.035857 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.