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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e741a17085f69bbb4515f1b6de69e6344e0a8ba2 | 237 | py | Python | src/code/static_network/globals.py | dvaruas/minority_recommendations | 8adcbf5af5c322e4b20d4336b12ecda62a5c4d5f | [
"MIT"
] | null | null | null | src/code/static_network/globals.py | dvaruas/minority_recommendations | 8adcbf5af5c322e4b20d4336b12ecda62a5c4d5f | [
"MIT"
] | null | null | null | src/code/static_network/globals.py | dvaruas/minority_recommendations | 8adcbf5af5c322e4b20d4336b12ecda62a5c4d5f | [
"MIT"
] | null | null | null | import os
PARAMETERS_PATH = os.path.join(os.path.dirname(__file__), os.pardir, "common", "parameters.ini")
STATIC_DATA_PATH = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir,
"data", "synthetic", "static")
| 29.625 | 96 | 0.721519 | 35 | 237 | 4.571429 | 0.371429 | 0.15 | 0.125 | 0.175 | 0.4875 | 0.4875 | 0.4875 | 0.4875 | 0.4875 | 0.4875 | 0 | 0 | 0.101266 | 237 | 7 | 97 | 33.857143 | 0.751174 | 0 | 0 | 0 | 0 | 0 | 0.164557 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 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 |
e74a850eb0a9ef7a3a8e07d6a7a66ec36501cef4 | 7,973 | py | Python | api.py | sVialaret/SCmon2000EP | a7197825462741811129af2980c8acd56073b25c | [
"MIT"
] | 1 | 2018-07-07T21:18:11.000Z | 2018-07-07T21:18:11.000Z | api.py | sVialaret/SCmon2000EP | a7197825462741811129af2980c8acd56073b25c | [
"MIT"
] | null | null | null | api.py | sVialaret/SCmon2000EP | a7197825462741811129af2980c8acd56073b25c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import requests
from datetime import datetime
import hashlib
import urllib
import base64
import random as rd
allocine_secret_key = '29d185d98c984a359e6e6f26a0474269'
allocine_partner = '100043982026'
formatUrl = 'json'
def init_connect():
### Initialisation : user-agent aleatoire
v = str(rd.randint(1, 4)) + '.' + str(rd.randint(0,9))
a = str(rd.randint(0, 9))
b = str(rd.randint(0, 99))
c = str(rd.randint(0, 999))
userAgents = [
"Mozilla/5.0 (Linux; U; Android " + v + "; fr-fr; Nexus One Build/FRF91) AppleWebKit/5" + b + "." + c + " (KHTML, like Gecko) Version/" + a + "." + a + " Mobile Safari/5" + b + "." + c + "",
"Mozilla/5.0 (Linux; U; Android " + v + "; fr-fr; Dell Streak Build/Donut AppleWebKit/5" + b + "." + c + "+ (KHTML, like Gecko) Version/3." + a + ".2 Mobile Safari/ 5" + b + "." + c + ".1",
"Mozilla/5.0 (Linux; U; Android 4." + v + "; fr-fr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
"Mozilla/5.0 (Linux; U; Android 4." + v + "; fr-fr; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
"Mozilla/5.0 (Linux; U; Android " + v + "; en-gb) AppleWebKit/999+ (KHTML, like Gecko) Safari/9" + b + "." + a + "",
"Mozilla/5.0 (Linux; U; Android " + v + ".5; fr-fr; HTC_IncredibleS_S710e Build/GRJ" + b + ") AppleWebKit/5" + b + ".1 (KHTML, like Gecko) Version/4.0 Mobile Safari/5" + b + ".1",
"Mozilla/5.0 (Linux; U; Android 2." + v + "; fr-fr; HTC Vision Build/GRI" + b + ") AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
"Mozilla/5.0 (Linux; U; Android " + v + ".4; fr-fr; HTC Desire Build/GRJ" + b + ") AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
"Mozilla/5.0 (Linux; U; Android 2." + v + "; fr-fr; T-Mobile myTouch 3G Slide Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
"Mozilla/5.0 (Linux; U; Android " + v + ".3; fr-fr; HTC_Pyramid Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
"Mozilla/5.0 (Linux; U; Android 2." + v + "; fr-fr; HTC_Pyramid Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari",
"Mozilla/5.0 (Linux; U; Android 2." + v + "; fr-fr; HTC Pyramid Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/5" + b + ".1",
"Mozilla/5.0 (Linux; U; Android 2." + v + "; fr-fr; LG-LU3000 Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/5" + b + ".1",
"Mozilla/5.0 (Linux; U; Android 2." + v + "; fr-fr; HTC_DesireS_S510e Build/GRI" + a + ") AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/" + c + ".1",
"Mozilla/5.0 (Linux; U; Android 2." + v + "; fr-fr; HTC_DesireS_S510e Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile",
"Mozilla/5.0 (Linux; U; Android " + v + ".3; fr-fr; HTC Desire Build/GRI" + a + ") AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
"Mozilla/5.0 (Linux; U; Android 2." + v + "; fr-fr; HTC Desire Build/FRF" + a + ") AppleWebKit/533.1 (KHTML, like Gecko) Version/" + a + ".0 Mobile Safari/533.1",
"Mozilla/5.0 (Linux; U; Android " + v + "; fr-lu; HTC Legend Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/" + a + "." + a + " Mobile Safari/" + c + "." + a + "",
"Mozilla/5.0 (Linux; U; Android " + v + "; fr-fr; HTC_DesireHD_A9191 Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
"Mozilla/5.0 (Linux; U; Android " + v + ".1; fr-fr; HTC_DesireZ_A7" + c + " Build/FRG83D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/" + c + "." + a + "",
"Mozilla/5.0 (Linux; U; Android " + v + ".1; en-gb; HTC_DesireZ_A7272 Build/FRG83D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/" + c + ".1",
"Mozilla/5.0 (Linux; U; Android " + v + "; fr-fr; LG-P5" + b + " Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
]
headersUA = {'user-agent' : userAgents[rd.randint(0,len(userAgents)-1)]}
return headersUA
def getDate():
dateComplete = datetime.now()
year = dateComplete.year
month = dateComplete.month
day = dateComplete.day
if month < 10:
strMonth = '0' + str(month)
else:
strMonth = str(month)
if day < 10:
strDay = '0' + str(day)
else:
strDay = str(day)
YMDstr = str(year) + strMonth + strDay
return YMDstr
def inputToCity(city):
"""
code de retour :
100 : tout est normal
200 : la requete n'a pas abouti
300 : la ville n'existe pas
"""
headersUA = init_connect()
YMDstr = getDate()
searchField = city
filterField = ''
countField = '500'
pageField = '1'
url = 'q=' + searchField + '&filter=' + filterField + '&count=' + countField + '&page=' + pageField + '&format=json&partner=' + allocine_partner + '&sed=' + YMDstr
toEncrypt = allocine_secret_key + url
sig = urllib.parse.quote_plus(base64.b64encode(hashlib.sha1(toEncrypt.encode('utf-8')).digest()))
urlComplete = 'http://api.allocine.fr/rest/v3/search?' + url + "&sig=" + sig
codeRetour = 200
try:
req = requests.get(urlComplete, headers=headersUA)
except:
return [], codeRetour
if req.status_code == 200:
codeRetour = 100
if 'location' in req.json()['feed']:
return req.json()['feed']['location'], codeRetour
else:
codeRetour = 300
return [], codeRetour
def cityDesc(codePostal):
"""
code de retour :
100 : tout est normal
200 : la requete n'a pas abouti
300 : pas de cine dans la ville
400 : la ville n'existe pas
"""
headersUA = init_connect()
YMDstr = getDate()
searchField = codePostal
filterField = ''
countField = '500'
pageField = '1'
url = 'q=' + searchField + '&filter=' + filterField + '&count=' + countField + '&page=' + pageField + '&format=json&partner=' + allocine_partner + '&sed=' + YMDstr
toEncrypt = allocine_secret_key + url
sig = urllib.parse.quote_plus(base64.b64encode(hashlib.sha1(toEncrypt.encode('utf-8')).digest()))
urlComplete = 'http://api.allocine.fr/rest/v3/search?' + url + "&sig=" + sig
codeRetour = 200
listeCine = []
try:
req = requests.get(urlComplete, headers=headersUA)
except:
return listeCine, codeRetour
# print(req.json())
if req.status_code == 200:
codeRetour = 100
if 'location' in req.json()['feed']:
if 'theater' in req.json()['feed']:
for theaterCity in req.json()['feed']['theater']:
listeCine.append(theaterCity)
else:
codeRetour = 300
else:
codeRetour = 400
return listeCine, codeRetour
def showtimeInTheater(codeTheater, jour):
headersUA = init_connect()
YMDstr = getDate()
searchField = codeTheater
filterField = ''
countField = '500'
pageField = '1'
url = 'theaters=' + searchField + '&date='+ jour + '&filter=' + filterField + '&count=' + countField + '&page=' + pageField + '&format=json&partner=' + allocine_partner + '&sed=' + YMDstr
toEncrypt = allocine_secret_key + url
sig = urllib.parse.quote_plus(base64.b64encode(hashlib.sha1(toEncrypt.encode('utf-8')).digest()))
urlComplete = 'http://api.allocine.fr/rest/v3/showtimelist?' + url + "&sig=" + sig
req = requests.get(urlComplete, headers=headersUA)
return req.json()['feed']
def infoFilm(codeFilm):
headersUA = init_connect()
YMDstr = getDate()
searchField = str(codeFilm)
filterField = ''
countField = '500'
pageField = '1'
url = 'code=' + searchField + '&filter=' + filterField + '&count=' + countField + '&page=' + pageField + '&format=json&partner=' + allocine_partner + '&sed=' + YMDstr
toEncrypt = allocine_secret_key + url
sig = urllib.parse.quote_plus(base64.b64encode(hashlib.sha1(toEncrypt.encode('utf-8')).digest()))
urlComplete = 'http://api.allocine.fr/rest/v3/movie?' + url + "&sig=" + sig
req = requests.get(urlComplete, headers=headersUA)
return req.json()
def getImg(url):
urllib.request.urlretrieve(url, "/tmp/poster.jpg") | 40.887179 | 194 | 0.647059 | 1,137 | 7,973 | 4.502199 | 0.171504 | 0.018754 | 0.038679 | 0.060168 | 0.733151 | 0.717523 | 0.685876 | 0.685681 | 0.655988 | 0.610471 | 0 | 0.066809 | 0.175843 | 7,973 | 195 | 195 | 40.887179 | 0.71222 | 0.045905 | 0 | 0.440299 | 0 | 0.119403 | 0.455894 | 0.017984 | 0 | 0 | 0 | 0 | 0 | 1 | 0.052239 | false | 0 | 0.044776 | 0 | 0.164179 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
e752d03591a27815f5b4f82c7dd8461c80132bef | 1,937 | py | Python | tests/behavioural/features/steps/status_code.py | ONSdigital/ras-secure-message | 0713214e89e84ac0c16f2eb075883e4c05d48179 | [
"MIT"
] | 6 | 2017-06-30T12:31:36.000Z | 2018-03-06T12:34:11.000Z | tests/behavioural/features/steps/status_code.py | ONSdigital/ras-secure-message | 0713214e89e84ac0c16f2eb075883e4c05d48179 | [
"MIT"
] | 97 | 2017-06-28T11:55:43.000Z | 2021-12-24T09:22:17.000Z | tests/behavioural/features/steps/status_code.py | ONSdigital/ras-secure-message | 0713214e89e84ac0c16f2eb075883e4c05d48179 | [
"MIT"
] | 2 | 2017-05-05T10:31:41.000Z | 2021-04-11T07:46:18.000Z | import nose.tools
from behave import then
@then("a success status code 200 is returned")
def step_impl_200_success_returned(context):
"""validate that the status code was 200"""
nose.tools.assert_equal(context.response.status_code, 200)
@then("a success status code no content 204 is returned")
def step_impl_204_success_returned(context):
"""validate that the status code was 204"""
nose.tools.assert_equal(context.response.status_code, 204)
@then("a created status code 201 is returned")
def step_impl_201_success_returned(context):
"""validate that the status code was 201"""
nose.tools.assert_equal(context.response.status_code, 201)
@then("a bad request status code 400 is returned")
def step_impl_a_bad_request_is_returned(context):
"""validate that the status code was 400"""
nose.tools.assert_equal(context.response.status_code, 400)
@then("a forbidden status code 403 is returned")
def step_impl_403_returned(context):
"""validate that the status code was 403"""
nose.tools.assert_equal(context.response.status_code, 403)
@then("a not found status code 404 is returned")
def step_impl_404_returned(context):
"""validate that the status code was 404"""
nose.tools.assert_equal(context.response.status_code, 404)
@then("a not allowed status code (405) is returned")
def step_impl_405_returned(context):
"""validate that the status code was 405"""
nose.tools.assert_equal(context.response.status_code, 405)
@then("a conflict error status code (409) is returned")
def step_impl_409_returned(context):
"""validate that the status code was 409"""
nose.tools.assert_equal(context.response.status_code, 409)
@then("a '{status_code}' status code is returned")
def step_impl_status_code_returned(context, status_code):
"""validate that the status code was a specific value"""
nose.tools.assert_equal(context.response.status_code, int(status_code))
| 33.982456 | 75 | 0.758906 | 296 | 1,937 | 4.780405 | 0.152027 | 0.219081 | 0.082686 | 0.108127 | 0.728622 | 0.563958 | 0.54417 | 0.54417 | 0.106007 | 0 | 0 | 0.055655 | 0.137326 | 1,937 | 56 | 76 | 34.589286 | 0.791143 | 0.182757 | 0 | 0 | 0 | 0 | 0.241379 | 0 | 0 | 0 | 0 | 0 | 0.310345 | 1 | 0.310345 | false | 0 | 0.068966 | 0 | 0.37931 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
e76fbada9c705f5e58be2894e0c55cbee7b88a76 | 173 | py | Python | sources/breakout/breakout03.py | kantel/python-schulung | c319125c4a6f8479aff5ca5e66f3bbfbf48eb22c | [
"MIT"
] | null | null | null | sources/breakout/breakout03.py | kantel/python-schulung | c319125c4a6f8479aff5ca5e66f3bbfbf48eb22c | [
"MIT"
] | null | null | null | sources/breakout/breakout03.py | kantel/python-schulung | c319125c4a6f8479aff5ca5e66f3bbfbf48eb22c | [
"MIT"
] | null | null | null | import tkinter as tk
from gameworld03 import World
if __name__ == "__main__":
root = tk.Tk()
root.title("Hello, Pong!")
world = World(root)
world.mainloop() | 21.625 | 30 | 0.65896 | 23 | 173 | 4.608696 | 0.652174 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014706 | 0.213873 | 173 | 8 | 31 | 21.625 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0.114943 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 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 |
e771210221631e3d7a50994ca92e75bd48791fc0 | 2,233 | py | Python | processor.py | GPrathap/OpenBCIPython | 0f5be167fb09d31c15885003eeafec8cdc08dbfa | [
"MIT"
] | 1 | 2021-11-07T12:01:08.000Z | 2021-11-07T12:01:08.000Z | processor.py | GPrathap/OpenBCIPython | 0f5be167fb09d31c15885003eeafec8cdc08dbfa | [
"MIT"
] | null | null | null | processor.py | GPrathap/OpenBCIPython | 0f5be167fb09d31c15885003eeafec8cdc08dbfa | [
"MIT"
] | 1 | 2020-10-15T08:35:01.000Z | 2020-10-15T08:35:01.000Z |
import pydub
import os
import seaborn as sb
from manager import FeatureManager
from features.energy import Energy
from features.fft import FFT
from features.mean import Mean
from features.mfcc import MFCC
from features.zcr import ZCR
from utils.Audio import Audio
sb.set(style="white", palette="muted")
import random
random.seed(20150420)
class Clip:
RATE = 44100 # All recordings in ESC are 44.1 kHz
FRAME = 248 # Frame size in samples
def __init__(self, filename, file_type):
self.filename = os.path.basename(filename)
self.path = os.path.abspath(filename)
self.directory = os.path.dirname(self.path)
self.category = self.directory.split('/')[-1]
self.audio = Audio(self.path, file_type)
with self.audio as audio:
self.featureManager = FeatureManager()
self.featureManager.addRegisteredFeatures(MFCC(self.audio,None, 32, self.FRAME, self.RATE), "mfcc")
self.featureManager.addRegisteredFeatures(FFT(self.audio,None,1024, self.FRAME, self.RATE), "fft")
# TODO recheck
# self.featureManager.addRegisteredFeatures(Energy(self.audio,None,self.FRAME, self.RATE), "energy")
self.featureManager.addRegisteredFeatures(ZCR(self.audio,None,self.FRAME, self.RATE), "zcr")
self.featureManager.addRegisteredFeatures(Mean(self.audio, None, self.FRAME, self.RATE), "mean")
self.featureManager.getRegisteredFeature("mfcc").compute_mfcc()
self.featureManager.getRegisteredFeature("fft").compute_fft()
#TODO recheck
# self.featureManager.getRegisteredFeature("energy").compute_energy()
# self.featureManager.getRegisteredFeature("energy").compute_energy_entropy()
self.featureManager.getRegisteredFeature("zcr").compute_zcr()
self.featureManager.getRegisteredFeature("mean").compute_mean()
self.feature_list = self.featureManager.getRegisteredFeatures()
def __repr__(self):
return '<{0}/{1}>'.format(self.category, self.filename)
def get_feature_vector(self):
return self.featureManager.getRegisteredFeature("fft").get_logamplitude()
| 24.271739 | 112 | 0.68876 | 249 | 2,233 | 6.092369 | 0.297189 | 0.166117 | 0.175346 | 0.056032 | 0.164799 | 0.134476 | 0.059328 | 0 | 0 | 0 | 0 | 0.015704 | 0.201523 | 2,233 | 91 | 113 | 24.538462 | 0.835109 | 0.145096 | 0 | 0 | 0 | 0 | 0.027361 | 0 | 0 | 0 | 0 | 0.010989 | 0 | 1 | 0.081081 | false | 0 | 0.297297 | 0.054054 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
e776c4a51bd56f025b8a5aa8b6dd6e07e98ccfa4 | 1,249 | py | Python | file_builder/test/__init__.py | btrekkie/file-builder | e85726ed647ad7a73839c7410618ef3f118c96c9 | [
"MIT"
] | 1 | 2020-05-29T17:13:26.000Z | 2020-05-29T17:13:26.000Z | file_builder/test/__init__.py | btrekkie/file-builder | e85726ed647ad7a73839c7410618ef3f118c96c9 | [
"MIT"
] | 4 | 2021-06-14T18:42:55.000Z | 2022-03-27T13:36:54.000Z | file_builder/test/__init__.py | btrekkie/file-builder | e85726ed647ad7a73839c7410618ef3f118c96c9 | [
"MIT"
] | null | null | null | from .args_test import ArgsTest
from .arithmetic_test import ArithmeticTest
from .build_dirs_test import BuildDirsTest
from .build_file_test import BuildFileTest
from .bundle_tags_test import BundleTagsTest
from .caching_test import CachingTest
from .case_test import CaseTest
from .clean_test import CleanTest
from .created_files_test import CreatedFilesTest
from .error_handling_test import ErrorHandlingTest
from .error_test import ErrorTest
from .file_backups_test import FileBackupsTest
from .file_comparison_test import FileComparisonTest
from .hash_dirs_test import HashDirsTest
from .json_util_test import JsonUtilTest
from .lambda_test import LambdaTest
from .setup_failed_test import SetupFailedTest
from .simple_operations_test import SimpleOperationsTest
from .swap_dirs_and_files_test import SwapDirsAndFilesTest
from .versions_test import VersionsTest
__all__ = [
'ArgsTest', 'ArithmeticTest', 'BuildDirsTest', 'BuildFileTest',
'BundleTagsTest', 'CachingTest', 'CaseTest', 'CleanTest',
'CreatedFilesTest', 'ErrorHandlingTest', 'ErrorTest', 'FileBackupsTest',
'FileComparisonTest', 'HashDirsTest', 'JsonUtilTest', 'LambdaTest',
'SetupFailedTest', 'SimpleOperationsTest', 'SwapDirsAndFilesTest',
'VersionsTest']
| 43.068966 | 76 | 0.831865 | 135 | 1,249 | 7.414815 | 0.377778 | 0.1998 | 0.027972 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.102482 | 1,249 | 28 | 77 | 44.607143 | 0.892953 | 0 | 0 | 0 | 0 | 0 | 0.21297 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.740741 | 0 | 0.740741 | 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 |
e7804903cb7c22b31443ae1d6aa38133fef36381 | 1,108 | py | Python | problem_5.py | m-yuhas/project_euler | ea7b5ee0c715426fb08062f576dcd633a824b848 | [
"MIT"
] | null | null | null | problem_5.py | m-yuhas/project_euler | ea7b5ee0c715426fb08062f576dcd633a824b848 | [
"MIT"
] | null | null | null | problem_5.py | m-yuhas/project_euler | ea7b5ee0c715426fb08062f576dcd633a824b848 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from math import ceil, sqrt
def find_prime_factors(n):
"""
Returns an array of the prime factors on n
Loops from 2 to sqrt(n) to pull off a prime factor
Recursively computes factors until the remaining number is prime
"""
for i in range(2,ceil(sqrt(n))+1):
if n % i == 0:
return [i] + find_prime_factors(int(n/i))
return [n]
if __name__ == '__main__':
prime_factors = {}
for i in range(2,21):
prime_factors_of_i = {}
for j in find_prime_factors(i):
if j not in prime_factors_of_i:
prime_factors_of_i[j] = 1
else:
prime_factors_of_i[j] += 1
for key in prime_factors_of_i:
if key not in prime_factors or prime_factors_of_i[key] > prime_factors[key]:
prime_factors[key] = prime_factors_of_i[key]
smallest_multiple = 1
for key in prime_factors:
smallest_multiple *= key ** prime_factors[key]
print("The smallest multiple of the numbers 1 through 20 is "+str(smallest_multiple))
| 35.741935 | 90 | 0.608303 | 167 | 1,108 | 3.772455 | 0.335329 | 0.32381 | 0.155556 | 0.166667 | 0.293651 | 0.190476 | 0 | 0 | 0 | 0 | 0 | 0.016927 | 0.306859 | 1,108 | 30 | 91 | 36.933333 | 0.803385 | 0.157942 | 0 | 0 | 0 | 0 | 0.069397 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.045455 | false | 0 | 0.045455 | 0 | 0.181818 | 0.045455 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
e780e9824ee241c0711032c06c3d25c7ce2099c8 | 177 | py | Python | main.py | rp-bot/Instagram-DM-bot1 | 5c040f5f4533718027254cb171e91b40590b54a8 | [
"MIT"
] | null | null | null | main.py | rp-bot/Instagram-DM-bot1 | 5c040f5f4533718027254cb171e91b40590b54a8 | [
"MIT"
] | null | null | null | main.py | rp-bot/Instagram-DM-bot1 | 5c040f5f4533718027254cb171e91b40590b54a8 | [
"MIT"
] | null | null | null | # run this file
import notification_alert as notif
import reply
if __name__ == '__main__':
away = True
while away:
notif.checkstatus()
reply.bot_init()
| 17.7 | 34 | 0.661017 | 22 | 177 | 4.863636 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.259887 | 177 | 9 | 35 | 19.666667 | 0.816794 | 0.073446 | 0 | 0 | 0 | 0 | 0.049383 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 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 |
e79679623553bf3e6b0c212a4abe4239e1e9c46e | 597 | py | Python | custom_model_metrics_visualize.py | Miso-K/DDCW | aa033e1bf9258eee0a39b6dd69260910179528e0 | [
"MIT"
] | 1 | 2021-12-07T19:22:27.000Z | 2021-12-07T19:22:27.000Z | custom_model_metrics_visualize.py | Miso-K/DDCW | aa033e1bf9258eee0a39b6dd69260910179528e0 | [
"MIT"
] | null | null | null | custom_model_metrics_visualize.py | Miso-K/DDCW | aa033e1bf9258eee0a39b6dd69260910179528e0 | [
"MIT"
] | null | null | null | import pickle
"""Run visualization of internal metrics of DDCW model after evaluation (read saved evaluation object)"""
evaluator = pickle.load(open("evaluatorobject", "rb"))
# Plotting internal model metrics (for DDCW model)
from utils import plot_custom_model_metrics as pc
pc.plot_model_size(evaluator, model_ids=[0,1], model_names=['DDCW-100', 'DDCW-1000'], plot_title='Progress of experts in DDCW with and without diversity')
pc.plot_diversity(evaluator, model_ids=[0,1], model_names=['DDCW-E', 'DDCW-D'], plot_title='Progress of diversity in DDCW with and without diversity')
pc.plt.show()
| 59.7 | 154 | 0.775544 | 92 | 597 | 4.902174 | 0.5 | 0.039911 | 0.075388 | 0.079823 | 0.283814 | 0.283814 | 0.283814 | 0.146341 | 0 | 0 | 0 | 0.020561 | 0.103853 | 597 | 9 | 155 | 66.333333 | 0.82243 | 0.080402 | 0 | 0 | 0 | 0 | 0.352941 | 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 | 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 |
e7bdecb59192c20a3769338156f36e66c6aeb79a | 687 | py | Python | codenames/messages.py | dieret/codenames | dc4bf9c873c2bf96d7a0fd86bc46e570f9721f0f | [
"MIT"
] | null | null | null | codenames/messages.py | dieret/codenames | dc4bf9c873c2bf96d7a0fd86bc46e570f9721f0f | [
"MIT"
] | null | null | null | codenames/messages.py | dieret/codenames | dc4bf9c873c2bf96d7a0fd86bc46e570f9721f0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# std
from typing import List, Optional
# ours
from codenames.users import User
class Message:
def __init__(self, message: str, user: Optional[User] = None):
self.user = user # type: Optional[User]
self.message = message
def to_html(self):
if self.user:
return self.user.to_html() + " " + self.message
else:
return self.message
class Messages:
def __init__(self):
self.messages = [] # type: List[Message]
def add_message(self, message: Message):
self.messages.append(message)
def to_html(self):
return "<br/>".join([m.to_html() for m in self.messages])
| 22.16129 | 66 | 0.615721 | 89 | 687 | 4.606742 | 0.393258 | 0.134146 | 0.073171 | 0.078049 | 0.097561 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00198 | 0.26492 | 687 | 30 | 67 | 22.9 | 0.809901 | 0.103348 | 0 | 0.111111 | 0 | 0 | 0.00982 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0 | 0.111111 | 0.055556 | 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 |
e7c92b00482e580e8ca5918a5b90b90b5f5a5cc8 | 68,133 | py | Python | pysnmp-with-texts/DOCS-RPHY-PTP-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/DOCS-RPHY-PTP-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/DOCS-RPHY-PTP-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 DOCS-RPHY-PTP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DOCS-RPHY-PTP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:53:44 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueSizeConstraint")
clabProjDocsis, = mibBuilder.importSymbols("CLAB-DEF-MIB", "clabProjDocsis")
IfDirection, = mibBuilder.importSymbols("DOCS-IF3-MIB", "IfDirection")
docsRphyRpdDevInfoUniqueId, = mibBuilder.importSymbols("DOCS-RPHY-MIB", "docsRphyRpdDevInfoUniqueId")
IANAPhysicalClass, = mibBuilder.importSymbols("IANA-ENTITY-MIB", "IANAPhysicalClass")
IANAifType, = mibBuilder.importSymbols("IANAifType-MIB", "IANAifType")
ifIndex, InterfaceIndex, InterfaceIndexOrZero = mibBuilder.importSymbols("IF-MIB", "ifIndex", "InterfaceIndex", "InterfaceIndexOrZero")
InetAddressType, InetAddress, InetPortNumber, InetVersion, InetAddressPrefixLength = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddress", "InetPortNumber", "InetVersion", "InetAddressPrefixLength")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup")
TimeTicks, ModuleIdentity, ObjectIdentity, Integer32, NotificationType, iso, Counter64, MibIdentifier, Unsigned32, IpAddress, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "ModuleIdentity", "ObjectIdentity", "Integer32", "NotificationType", "iso", "Counter64", "MibIdentifier", "Unsigned32", "IpAddress", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32", "Bits")
AutonomousType, MacAddress, DateAndTime, DisplayString, TimeStamp, TruthValue, PhysAddress, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "AutonomousType", "MacAddress", "DateAndTime", "DisplayString", "TimeStamp", "TruthValue", "PhysAddress", "TextualConvention")
UUIDorZero, = mibBuilder.importSymbols("UUID-TC-MIB", "UUIDorZero")
docsRphyPtpMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32))
docsRphyPtpMib.setRevisions(('2017-04-13 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: docsRphyPtpMib.setRevisionsDescriptions(('Initial version, created by R-OSSI-N-17.1721-3.',))
if mibBuilder.loadTexts: docsRphyPtpMib.setLastUpdated('201704130000Z')
if mibBuilder.loadTexts: docsRphyPtpMib.setOrganization('Cable Television Laboratories, Inc')
if mibBuilder.loadTexts: docsRphyPtpMib.setContactInfo(' Postal: Cable Television Laboratories, Inc. 400 Centennial Parkway Louisville, Colorado 80027-1266 U.S.A. Phone: +1 303-661-9100 Fax: +1 303-661-9199 E-mail: mibs@cablelabs.com')
if mibBuilder.loadTexts: docsRphyPtpMib.setDescription('This MIB module contains the status and reporting objects for the Remote PHY CCAP Core and RPD PTP management. Copyright 2017 Cable Television Laboratories, Inc. All rights reserved.')
docsRphyPtpNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 0))
docsRphyPtpObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1))
docsRphyPtpConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 2))
docsRphyPtpRpdMibObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1))
docsRphyPtpCcapMibObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2))
docsRphyPtpCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 2, 1))
docsRphyPtpGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 2, 2))
docsRphyPtpCcapDefaultDataSet = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1))
docsRphyPtpCcapDefaultDataSetTwoStepFlag = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 1), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetTwoStepFlag.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetTwoStepFlag.setDescription('This attribute specifies whether the Two Step process is used (i.e., the clock is a two-step clock).')
docsRphyPtpCcapDefaultDataSetClockIdentity = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetClockIdentity.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetClockIdentity.setDescription('This attribute specifies the default Dataset clock identity.')
docsRphyPtpCcapDefaultDataSetPriority1 = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetPriority1.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetPriority1.setDescription('This attribute specifies the default Dataset clock Priority1. Lower values take precedence.')
docsRphyPtpCcapDefaultDataSetPriority2 = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetPriority2.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetPriority2.setDescription('This attribute specifies the default Dataset clock Priority2. Lower values take precedence.')
docsRphyPtpCcapDefaultDataSetSlaveOnly = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 5), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetSlaveOnly.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetSlaveOnly.setDescription('This attribute specifies whether the SlaveOnly flag is set.')
docsRphyPtpCcapDefaultDataSetQualityClass = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetQualityClass.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetQualityClass.setDescription('This attribute of an ordinary or boundary clock denotes the traceability of the time or frequency distributed by the grandmaster clock. See section 7.6.2.4 in [IEEE 1588].')
docsRphyPtpCcapDefaultDataSetQualityAccuracy = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetQualityAccuracy.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetQualityAccuracy.setDescription('This attribute characterizes a clock for the purpose of the best master clock (BMC) algorithm. See section 7.6.2.5 in [IEEE 1588].')
docsRphyPtpCcapDefaultDataSetQualityOffset = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetQualityOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapDefaultDataSetQualityOffset.setDescription('This attribute is the offset, scaled, logarithmic representation of the clock variance. See Section 7.6.3.5 in [IEEE 1588].')
docsRphyPtpCcapCurrentDataSet = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 2))
docsRphyPtpCcapCurrentDataSetStepsRemoved = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 2, 1), Unsigned32()).setUnits('steps').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapCurrentDataSetStepsRemoved.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCurrentDataSetStepsRemoved.setDescription('This attribute is the number of communication paths traversed between the local clock and the grandmaster clock. The initialization value is 0.')
docsRphyPtpCcapCurrentDataSetOffsetFromMaster = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 2, 2), Integer32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapCurrentDataSetOffsetFromMaster.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCurrentDataSetOffsetFromMaster.setDescription('This attribute is an implementation-specific representation of the current value of the time difference between a master and a slave as computed by the slave.')
docsRphyPtpCcapCurrentDataSetMeanPathDelay = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 2, 3), Unsigned32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapCurrentDataSetMeanPathDelay.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCurrentDataSetMeanPathDelay.setDescription('This attribute is an implementation-specific representation of the current value of the mean propagation time between a master and slave clock as computed by the slave. Zero means that the path delay is unavailable.')
docsRphyPtpCcapParentDataSet = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3))
docsRphyPtpCcapParentDataSetParentClockId = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetParentClockId.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetParentClockId.setDescription('This attribute is the clock identifier of the clock port on the master that issues the Sync messages used in synchronizing this clock.')
docsRphyPtpCcapParentDataSetParentPortNumber = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetParentPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetParentPortNumber.setDescription('This attribute is the port number of the clock port on the master that issues the Sync messages used in synchronizing this clock.')
docsRphyPtpCcapParentDataSetParentStats = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 3), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetParentStats.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetParentStats.setDescription('This attribute is set to True if the clock has a port in the slave state and the clock has computed statistically valid estimates of the ClockOffset Scaled Log Variance and the Clock PhaseChangeRate. If either the ClockOffset Scaled Log Variance or the Clock PhaseChangeRate is not computed, then the CCAP core MUST set the value of ParentStats to false.')
docsRphyPtpCcapParentDataSetClockOffset = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 4), Integer32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetClockOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetClockOffset.setDescription("This attribute represents the value of the observed Parent Offset Scaled Log Variance, which is an estimate of the parent clock's PTP variance as observed by the slave clock. The computation of this value is optional, but if not computed, the value of parentStats is FALSE. The initialization value of ClockOffset is 0xFFFF.")
docsRphyPtpCcapParentDataSetPhaseChangeRate = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 5), Integer32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetPhaseChangeRate.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetPhaseChangeRate.setDescription("This attribute represents the value of Phase Change Rate, which is an estimate of the parent clock's phase change rate as observed by the slave clock. If the estimate exceeds the capacity of its data type, this value is set to 0x7FFF FFFF. A positive sign indicates that the parent clock's phase change rate is greater than the rate of the slave clock. The computation of this value is optional, but if not computed,the value of parentStats is FALSE.")
docsRphyPtpCcapParentDataSetGmClockIdentity = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmClockIdentity.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmClockIdentity.setDescription('This attribute represents the clock Identity of the grandmaster clock.')
docsRphyPtpCcapParentDataSetGmPriority1 = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmPriority1.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmPriority1.setDescription('This attribute represents the priority1 of the grandmaster clock. Lower values take precedence.')
docsRphyPtpCcapParentDataSetGmPriority2 = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmPriority2.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmPriority2.setDescription('This attribute represents the priority2 of the grandmaster clock. Lower values take precedence.')
docsRphyPtpCcapParentDataSetGmQualityClass = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmQualityClass.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmQualityClass.setDescription('This attribute is the clock class for the grandmaster clock. The clock class attribute of an ordinary or boundary clock denotes the traceability of the time or frequency distributed by the grandmaster clock. See section 7.6.2.4 in [IEEE 1588].')
docsRphyPtpCcapParentDataSetGmQualityAccuracy = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmQualityAccuracy.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmQualityAccuracy.setDescription('This attribute characterizes the grandmaster clock for the purpose of the best master clock (BMC) algorithm. See section 7.6.2.5 in [IEEE 1588].')
docsRphyPtpCcapParentDataSetGmQualityOffset = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 3, 11), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmQualityOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapParentDataSetGmQualityOffset.setDescription('This attribute represents the offset, scaled, logarithmic representation of the grandmaster clock variance. See Section 7.6.3.5 in [IEEE 1588].')
docsRphyPtpCcapTimeProperties = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4))
docsRphyPtpCcapTimePropertiesCurrentUtcOffsetValid = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 1), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesCurrentUtcOffsetValid.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesCurrentUtcOffsetValid.setDescription('This attribute represents the value of currentUtcOffsetValid is TRUE if the currentUtcOffset is known to be correct.')
docsRphyPtpCcapTimePropertiesCurrentUtcOffset = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 2), Integer32()).setUnits('Seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesCurrentUtcOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesCurrentUtcOffset.setDescription('This attribute represents the offset between International Atomic Time (TAI) and Universal Coordinated Time (UTC).')
docsRphyPtpCcapTimePropertiesLeap59 = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 3), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesLeap59.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesLeap59.setDescription('This attribute represents whether or not there are 59 seconds in the last minute of the current UTC day for PTP systems whose epoch is the PTP epoch,; a TRUE value for Leap59 indicates that the last minute of the current UTC day contains 59 seconds.')
docsRphyPtpCcapTimePropertiesLeap61 = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 4), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesLeap61.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesLeap61.setDescription('This attribute represents whether or not there are 61 seconds in the last minute of the current UTC day for PTP systems whose epoch is the PTP epoch; a TRUE value for Leap61 indicates that the last minute of the current UTC day contains 61 seconds.')
docsRphyPtpCcapTimePropertiesTimeTraceable = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 5), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesTimeTraceable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesTimeTraceable.setDescription('This attribute represents whether the timescale and the value of currentUtcOffset are traceable to a primary reference. TimeTraceable is TRUE if the timescale and the value of currentUtcOffset are traceable to a primary reference; otherwise, the value is FALSE.')
docsRphyPtpCcapTimePropertiesFreqTraceable = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 6), TruthValue().clone('true')).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesFreqTraceable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesFreqTraceable.setDescription('This attribute represents whether the frequency determining the timescale is traceable to a primary reference. The value of FrequencyTraceable is TRUE if the frequency determining the timescale is traceable to a primary reference; otherwise, the value is FALSE.')
docsRphyPtpCcapTimePropertiesPtpTimescale = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 7), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesPtpTimescale.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesPtpTimescale.setDescription('This attribute is always true for grandmaster clocks with a clock timescale of PTP.')
docsRphyPtpCcapTimePropertiesTimeSource = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 4, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesTimeSource.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapTimePropertiesTimeSource.setDescription('This attribute represents the source of time used by the grandmaster clock. See Table 7 in [IEEE 1588]. If the time source of the grandmaster clock is unknown, the CCAP Core MUST set the TimeSource value to INTERNAL_OSCILLATOR (0xA0).')
docsRphyPtpCcapPortDataSetTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 5), )
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetTable.setDescription('See section 8.2.5 in [IEEE 1588] for details of the 1588 port dataset.')
docsRphyPtpCcapPortDataSetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 5, 1), ).setIndexNames((0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortDataSetPortNumber"))
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetEntry.setDescription('The conceptual row of docsRphyPtpCcapPortDataSetTable.')
docsRphyPtpCcapPortDataSetPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 5, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)))
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetPortNumber.setDescription('This key attribute is the port number of the local clock port. Port numbers 0 and 65,535 are reserved and cannot be used for real clock ports. See [IEEE 1588] for more information. When a PTP clock has N ports, the CCAP Core MUST set the port number to a value in the interval 1..N.')
docsRphyPtpCcapPortDataSetPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 5, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetPortState.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetPortState.setDescription('This attribute is the state of this PTP clock port. See Table 8 in [IEEE 1588].')
docsRphyPtpCcapPortDataSetMeanPathDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 5, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetMeanPathDelay.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortDataSetMeanPathDelay.setDescription('This attribute is an implementation-specific representation of the current value of the mean propagation time between a master and slave clock as computed by the slave. Zero means that the path delay is unavailable.')
docsRphyPtpCcapClockStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6))
docsRphyPtpCcapClockStatusClockState = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("freerun", 1), ("holdover", 2), ("acquiring", 3), ("freqLocked", 4), ("phaseAligned", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusClockState.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusClockState.setDescription('This attribute represents the current state of the clock.')
docsRphyPtpCcapClockStatusLastStateChange = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6, 2), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusLastStateChange.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusLastStateChange.setDescription('This attribute represents the value in TimeTicks when the clock state last changed.')
docsRphyPtpCcapClockStatusPacketsSent = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6, 3), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusPacketsSent.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusPacketsSent.setDescription('This attribute represents the number of PTP packets sent for this clock.')
docsRphyPtpCcapClockStatusPacketsReceived = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6, 4), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusPacketsReceived.setDescription('This attribute represents the number of PTP packets received for this clock.')
docsRphyPtpCcapClockStatusComputedPhaseOffset = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6, 5), Unsigned32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusComputedPhaseOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusComputedPhaseOffset.setDescription('This attribute specifies the phase offset that the locking algorithm computed in the last 60 sec interval. 0xFFFFFFFF means offset unknown.')
docsRphyPtpCcapClockStatusCounterDiscontinuityTime = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 6, 6), TimeStamp()).setUnits('TimeTicks').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusCounterDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapClockStatusCounterDiscontinuityTime.setDescription("This attribute represents the value of sysUpTime on the most recent occasion at which any one or more of this interface's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
docsRphyPtpCcapCorePtpPortStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 7), )
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusTable.setDescription('CorePtpCoreStatus is an instantiation of the abstract class PtpPortStatus and inherits those common attributes')
docsRphyPtpCcapCorePtpPortStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 7, 1), ).setIndexNames((0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCorePtpPortStatusPortNumber"))
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusEntry.setDescription('The conceptual row of docsRphyPtpCcapCorePtpPortStatusTable .')
docsRphyPtpCcapCorePtpPortStatusPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 7, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusPortNumber.setDescription('This key attribute is the port number of the local clock port.')
docsRphyPtpCcapCorePtpPortStatusPacketsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 7, 1, 2), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusPacketsSent.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusPacketsSent.setDescription('This attribute represents the number of PTP packets sent for this clock port.')
docsRphyPtpCcapCorePtpPortStatusPacketsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 7, 1, 3), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusPacketsReceived.setDescription('This attribute represents the number of PTP packets received for this clock port.')
docsRphyPtpCcapCorePtpPortStatusCounterDiscontinuityTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 7, 1, 4), TimeStamp()).setUnits('TimeTicks').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusCounterDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCorePtpPortStatusCounterDiscontinuityTime.setDescription("This attribute represents the value of sysUpTime on the most recent occasion at which any one or more of this interface's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
docsRphyPtpCcapPortMasterClockStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8), )
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusTable.setDescription('This table contains Port MasterClock Status attributes.')
docsRphyPtpCcapPortMasterClockStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1), ).setIndexNames((0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCorePtpPortStatusPortNumber"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusMasterPriority"))
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusEntry.setDescription('The conceptual row of docsRphyPtpCcapPortMasterClockStatusTable.')
docsRphyPtpCcapPortMasterClockStatusMasterPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 5)))
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusMasterPriority.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusMasterPriority.setDescription('This key attribute is the priority of the master clock configured for the PTP template assigned to this PTP clock port. Low numbers are higher priority.')
docsRphyPtpCcapPortMasterClockStatusPacketsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 2), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusPacketsSent.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusPacketsSent.setDescription('This attribute represents the number of PTP packets sent to this master for this slave clock port.')
docsRphyPtpCcapPortMasterClockStatusPacketsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 3), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusPacketsReceived.setDescription('This attribute represents the number of PTP packets received from this master for this slave clock port.')
docsRphyPtpCcapPortMasterClockStatusMasterClockId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusMasterClockId.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusMasterClockId.setDescription('This attribute specifies the clock identifier of this master clock.')
docsRphyPtpCcapPortMasterClockStatusMasterClockPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusMasterClockPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusMasterClockPortNumber.setDescription("This attribute specifies master clock's port number.")
docsRphyPtpCcapPortMasterClockStatusTwoStepFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 6), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusTwoStepFlag.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusTwoStepFlag.setDescription('This attribute specifies whether the Two Step process is used (i.e., the clock is a two-step clock).')
docsRphyPtpCcapPortMasterClockStatusIsBmc = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 7), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusIsBmc.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusIsBmc.setDescription('This attribute represents whether or not this master is the current Best Master Clock (i.e., the master clock currently in use for this slave clock).')
docsRphyPtpCcapPortMasterClockStatusIsMasterConnected = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 8), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusIsMasterConnected.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusIsMasterConnected.setDescription('This attribute is set to TRUE if a signaling session with the master is successfully established. When a slave node receives an announce and a sync message from the master, the CCAP Core SHOULD consider the session to be successfully established.')
docsRphyPtpCcapPortMasterClockStatusStatusDomain = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusStatusDomain.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusStatusDomain.setDescription('This attribute is the PTP master domain.')
docsRphyPtpCcapPortMasterClockStatusFreqOffset = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 10), Unsigned32()).setUnits('PPM').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusFreqOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusFreqOffset.setDescription('This attribute specifies the frequency offset that the locking algorithm computed per master in the last 60 sec interval. 0xFFFFFFFF means offset unknown.')
docsRphyPtpCcapPortMasterClockStatusCounterDiscontinuityTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 2, 8, 1, 11), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusCounterDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapPortMasterClockStatusCounterDiscontinuityTime.setDescription("This attribute contains the value of sysUpTime on the most recent occasion at which any one or more of this interface's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
docsRphyPtpRpdCurrentDataSetTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 1), )
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetTable.setDescription('See section 8.2.5 in [IEEE 1588] for details of the 1588 port dataset.')
docsRphyPtpRpdCurrentDataSetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 1, 1), ).setIndexNames((0, "DOCS-RPHY-MIB", "docsRphyRpdDevInfoUniqueId"))
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetEntry.setDescription('The conceptual row of docsRphyPtpRpdCurrentDataSetTable.')
docsRphyPtpRpdCurrentDataSetStepsRemoved = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 1, 1, 1), Unsigned32()).setUnits('steps').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetStepsRemoved.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetStepsRemoved.setDescription('This attribute is the number of communication paths traversed between the local clock and the grandmaster clock. The initialization value is 0.')
docsRphyPtpRpdCurrentDataSetOffsetFromMaster = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 1, 1, 2), Integer32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetOffsetFromMaster.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetOffsetFromMaster.setDescription('This attribute is an implementation-specific representation of the current value of the time difference between a master and a slave as computed by the slave.')
docsRphyPtpRpdCurrentDataSetMeanPathDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 1, 1, 3), Unsigned32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetMeanPathDelay.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdCurrentDataSetMeanPathDelay.setDescription('This attribute is an implementation-specific representation of the current value of the mean propagation time between a master and slave clock as computed by the slave. Zero means that the path delay is unavailable.')
docsRphyPtpRpdClockStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2), )
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusTable.setDescription('See section 8.2.5 in [IEEE 1588] for details of the 1588 port dataset.')
docsRphyPtpRpdClockStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1), ).setIndexNames((0, "DOCS-RPHY-MIB", "docsRphyRpdDevInfoUniqueId"))
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusEntry.setDescription('The conceptual row of docsRphyPtpRpdClockStatusTable.')
docsRphyPtpRpdClockStatusClockState = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("freerun", 1), ("holdover", 2), ("acquiring", 3), ("freqLocked", 4), ("phaseAligned", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusClockState.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusClockState.setDescription('This attribute represents the current state of the clock.')
docsRphyPtpRpdClockStatusLastStateChange = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1, 2), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusLastStateChange.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusLastStateChange.setDescription('This attribute represents the value in TimeTicks when the clock state last changed.')
docsRphyPtpRpdClockStatusPacketsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1, 3), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusPacketsSent.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusPacketsSent.setDescription('This attribute represents the number of PTP packets sent for this clock.')
docsRphyPtpRpdClockStatusPacketsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1, 4), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusPacketsReceived.setDescription('This attribute represents the number of PTP packets received for this clock.')
docsRphyPtpRpdClockStatusComputedPhaseOffset = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1, 5), Unsigned32()).setUnits('Nanoseconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusComputedPhaseOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusComputedPhaseOffset.setDescription('This attribute specifies the phase offset that the locking algorithm computed in the last 60 sec interval. 0xFFFFFFFF means offset unknown.')
docsRphyPtpRpdClockStatusCounterDiscontinuityTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 2, 1, 6), TimeStamp()).setUnits('TimeTicks').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusCounterDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdClockStatusCounterDiscontinuityTime.setDescription("This attribute represents the value of sysUpTime on the most recent occasion at which any one or more of this interface's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
docsRphyPtpRpdPortDataSetTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 3), )
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetTable.setDescription('See section 8.2.5 in [IEEE 1588] for details of the 1588 port dataset.')
docsRphyPtpRpdPortDataSetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 3, 1), ).setIndexNames((0, "DOCS-RPHY-MIB", "docsRphyRpdDevInfoUniqueId"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortDataSetPortNumber"))
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetEntry.setDescription('The conceptual row of docsRphyPtpRpdPortDataSetTable.')
docsRphyPtpRpdPortDataSetPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 3, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)))
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetPortNumber.setDescription('This key attribute is the port number of the local clock port. Port numbers 0 and 65,535 are reserved and cannot be used for real clock ports. See [IEEE 1588] for more information. When a PTP clock has N ports, the CCAP Core MUST set the port number to a value in the interval 1..N.')
docsRphyPtpRpdPortDataSetPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 3, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetPortState.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetPortState.setDescription('This attribute is the state of this PTP clock port. See Table 8 in [IEEE 1588].')
docsRphyPtpRpdPortDataSetMeanPathDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 3, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetMeanPathDelay.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortDataSetMeanPathDelay.setDescription('This attribute is an implementation-specific representation of the current value of the mean propagation time between a master and slave clock as computed by the slave. Zero means that the path delay is unavailable.')
docsRphyPtpRpdPtpPortStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4), )
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusTable.setDescription('Port Ptp Status is an instantiation of the abstract class PtpPortStatus and inherits those common attributes')
docsRphyPtpRpdPtpPortStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1), ).setIndexNames((0, "DOCS-RPHY-MIB", "docsRphyRpdDevInfoUniqueId"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusPortNumber"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex"))
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusEntry.setDescription('The conceptual row of docsRphyPtpRpdCorePtpPortStatusTable .')
docsRphyPtpRpdPtpPortStatusPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusPortNumber.setDescription('This key attribute is the port number of the local clock port.')
docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex.setDescription('This key attribute is the port number of the local clock port.')
docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1, 3), Unsigned32())
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex.setDescription('This key attribute is the port number of the local clock port.')
docsRphyPtpRpdPtpPortStatusPacketsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1, 4), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusPacketsSent.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusPacketsSent.setDescription('This attribute represents the number of PTP packets sent for this clock port.')
docsRphyPtpRpdPtpPortStatusPacketsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1, 5), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusPacketsReceived.setDescription('This attribute represents the number of PTP packets received for this clock port.')
docsRphyPtpRpdPtpPortStatusCounterDiscontinuityTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 4, 1, 6), TimeStamp()).setUnits('TimeTicks').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusCounterDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPtpPortStatusCounterDiscontinuityTime.setDescription("This attribute represents the value of sysUpTime on the most recent occasion at which any one or more of this interface's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
docsRphyPtpRpdPortMasterClockStatusTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5), )
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusTable.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusTable.setDescription('This table contains Port MasterClock Status attributes.')
docsRphyPtpRpdPortMasterClockStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1), ).setIndexNames((0, "DOCS-RPHY-MIB", "docsRphyRpdDevInfoUniqueId"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex"), (0, "DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusMasterPriority"))
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusEntry.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusEntry.setDescription('The conceptual row of docsRphyPtpRpdPortMasterClockStatusTable.')
docsRphyPtpRpdPortMasterClockStatusMasterPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 5)))
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusMasterPriority.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusMasterPriority.setDescription('This key attribute is the priority of the master clock configured for the PTP template assigned to this PTP clock port. Low numbers are higher priority.')
docsRphyPtpRpdPortMasterClockStatusPacketsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 2), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusPacketsSent.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusPacketsSent.setDescription('This attribute represents the number of PTP packets sent to this master for this slave clock port.')
docsRphyPtpRpdPortMasterClockStatusPacketsReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 3), Counter64()).setUnits('Packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusPacketsReceived.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusPacketsReceived.setDescription('This attribute represents the number of PTP packets received from this master for this slave clock port.')
docsRphyPtpRpdPortMasterClockStatusMasterClockId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(8, 8)).setFixedLength(8)).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusMasterClockId.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusMasterClockId.setDescription('This attribute specifies the clock identifier of this master clock.')
docsRphyPtpRpdPortMasterClockStatusMasterClockPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusMasterClockPortNumber.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusMasterClockPortNumber.setDescription("This attribute specifies master clock's port number.")
docsRphyPtpRpdPortMasterClockStatusTwoStepFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 6), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusTwoStepFlag.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusTwoStepFlag.setDescription('This attribute specifies whether the Two Step process is used (i.e., the clock is a two-step clock).')
docsRphyPtpRpdPortMasterClockStatusIsBmc = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 7), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusIsBmc.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusIsBmc.setDescription('This attribute represents whether or not this master is the current Best Master Clock (i.e., the master clock currently in use for this slave clock).')
docsRphyPtpRpdPortMasterClockStatusIsMasterConnected = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 8), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusIsMasterConnected.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusIsMasterConnected.setDescription('This attribute is set to TRUE if a signaling session with the master is successfully established. When a slave node receives an announce and a sync message from the master, the CCAP Core SHOULD consider the session to be successfully established.')
docsRphyPtpRpdPortMasterClockStatusStatusDomain = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusStatusDomain.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusStatusDomain.setDescription('This attribute is the PTP master domain.')
docsRphyPtpRpdPortMasterClockStatusFreqOffset = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 10), Unsigned32()).setUnits('PPM').setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusFreqOffset.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusFreqOffset.setDescription('This attribute specifies the frequency offset that the locking algorithm computed per master in the last 60 sec interval. 0xFFFFFFFF means offset unknown.')
docsRphyPtpRpdPortMasterClockStatusCounterDiscontinuityTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 1, 1, 5, 1, 11), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusCounterDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdPortMasterClockStatusCounterDiscontinuityTime.setDescription("This attribute contains the value of sysUpTime on the most recent occasion at which any one or more of this interface's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
docsRphyPtpCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 2, 1, 1)).setObjects(("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdGroup"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCoreGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
docsRphyPtpCompliance = docsRphyPtpCompliance.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCompliance.setDescription('The compliance statement for CCAP Core and RPD PTP features.')
docsRphyPtpRpdGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 2, 2, 1)).setObjects(("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdCurrentDataSetStepsRemoved"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdCurrentDataSetOffsetFromMaster"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdCurrentDataSetMeanPathDelay"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdClockStatusClockState"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdClockStatusLastStateChange"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdClockStatusPacketsSent"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdClockStatusPacketsReceived"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdClockStatusComputedPhaseOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdClockStatusCounterDiscontinuityTime"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortDataSetPortState"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortDataSetMeanPathDelay"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusPacketsSent"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusPacketsReceived"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPtpPortStatusCounterDiscontinuityTime"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusPacketsSent"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusPacketsReceived"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusMasterClockId"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusMasterClockPortNumber"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusTwoStepFlag"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusIsBmc"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusIsMasterConnected"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusStatusDomain"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusFreqOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpRpdPortMasterClockStatusCounterDiscontinuityTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
docsRphyPtpRpdGroup = docsRphyPtpRpdGroup.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpRpdGroup.setDescription('Group of objects implemented in CCAP Cores which represent RPD managed objects derived via the GCP protocol.')
docsRphyPtpCcapCoreGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4491, 2, 1, 32, 2, 2, 2)).setObjects(("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetTwoStepFlag"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetClockIdentity"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetPriority1"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetPriority2"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetSlaveOnly"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetQualityClass"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetQualityAccuracy"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapDefaultDataSetQualityOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCurrentDataSetStepsRemoved"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCurrentDataSetOffsetFromMaster"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCurrentDataSetMeanPathDelay"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetParentClockId"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetParentPortNumber"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetParentStats"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetClockOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetPhaseChangeRate"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetGmClockIdentity"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetGmPriority1"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetGmPriority2"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetGmQualityClass"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetGmQualityAccuracy"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapParentDataSetGmQualityOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesCurrentUtcOffsetValid"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesCurrentUtcOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesLeap59"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesLeap61"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesTimeTraceable"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesFreqTraceable"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesPtpTimescale"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapTimePropertiesTimeSource"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortDataSetPortState"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortDataSetMeanPathDelay"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapClockStatusClockState"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapClockStatusLastStateChange"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapClockStatusPacketsSent"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapClockStatusPacketsReceived"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapClockStatusComputedPhaseOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapClockStatusCounterDiscontinuityTime"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCorePtpPortStatusPacketsSent"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCorePtpPortStatusPacketsReceived"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapCorePtpPortStatusCounterDiscontinuityTime"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusPacketsSent"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusPacketsReceived"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusMasterClockId"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusMasterClockPortNumber"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusTwoStepFlag"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusIsBmc"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusIsMasterConnected"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusStatusDomain"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusFreqOffset"), ("DOCS-RPHY-PTP-MIB", "docsRphyPtpCcapPortMasterClockStatusCounterDiscontinuityTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
docsRphyPtpCcapCoreGroup = docsRphyPtpCcapCoreGroup.setStatus('current')
if mibBuilder.loadTexts: docsRphyPtpCcapCoreGroup.setDescription('Group of objects implemented in CCAP Cores.')
mibBuilder.exportSymbols("DOCS-RPHY-PTP-MIB", docsRphyPtpCcapCurrentDataSetStepsRemoved=docsRphyPtpCcapCurrentDataSetStepsRemoved, docsRphyPtpCcapPortMasterClockStatusTwoStepFlag=docsRphyPtpCcapPortMasterClockStatusTwoStepFlag, docsRphyPtpRpdPortMasterClockStatusMasterPriority=docsRphyPtpRpdPortMasterClockStatusMasterPriority, docsRphyPtpRpdMibObjects=docsRphyPtpRpdMibObjects, docsRphyPtpCcapDefaultDataSetQualityAccuracy=docsRphyPtpCcapDefaultDataSetQualityAccuracy, docsRphyPtpCompliances=docsRphyPtpCompliances, docsRphyPtpCcapClockStatusLastStateChange=docsRphyPtpCcapClockStatusLastStateChange, docsRphyPtpRpdCurrentDataSetMeanPathDelay=docsRphyPtpRpdCurrentDataSetMeanPathDelay, docsRphyPtpCcapParentDataSetGmPriority2=docsRphyPtpCcapParentDataSetGmPriority2, docsRphyPtpRpdPortMasterClockStatusStatusDomain=docsRphyPtpRpdPortMasterClockStatusStatusDomain, docsRphyPtpCcapTimePropertiesLeap59=docsRphyPtpCcapTimePropertiesLeap59, docsRphyPtpCcapTimePropertiesLeap61=docsRphyPtpCcapTimePropertiesLeap61, docsRphyPtpCcapClockStatus=docsRphyPtpCcapClockStatus, docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex=docsRphyPtpRpdPtpPortStatusRpdEnetPortIndex, docsRphyPtpCcapClockStatusComputedPhaseOffset=docsRphyPtpCcapClockStatusComputedPhaseOffset, docsRphyPtpConformance=docsRphyPtpConformance, docsRphyPtpCcapCorePtpPortStatusPortNumber=docsRphyPtpCcapCorePtpPortStatusPortNumber, docsRphyPtpCcapCurrentDataSetOffsetFromMaster=docsRphyPtpCcapCurrentDataSetOffsetFromMaster, docsRphyPtpCcapCorePtpPortStatusCounterDiscontinuityTime=docsRphyPtpCcapCorePtpPortStatusCounterDiscontinuityTime, docsRphyPtpCcapParentDataSetParentStats=docsRphyPtpCcapParentDataSetParentStats, docsRphyPtpObjects=docsRphyPtpObjects, docsRphyPtpCcapDefaultDataSetQualityClass=docsRphyPtpCcapDefaultDataSetQualityClass, docsRphyPtpCcapDefaultDataSetQualityOffset=docsRphyPtpCcapDefaultDataSetQualityOffset, docsRphyPtpRpdPtpPortStatusPortNumber=docsRphyPtpRpdPtpPortStatusPortNumber, docsRphyPtpRpdPortMasterClockStatusTable=docsRphyPtpRpdPortMasterClockStatusTable, docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex=docsRphyPtpRpdPtpPortStatusRpdPtpPortIndex, docsRphyPtpRpdClockStatusClockState=docsRphyPtpRpdClockStatusClockState, docsRphyPtpCcapPortMasterClockStatusMasterPriority=docsRphyPtpCcapPortMasterClockStatusMasterPriority, docsRphyPtpRpdPtpPortStatusPacketsReceived=docsRphyPtpRpdPtpPortStatusPacketsReceived, docsRphyPtpCcapPortMasterClockStatusFreqOffset=docsRphyPtpCcapPortMasterClockStatusFreqOffset, docsRphyPtpRpdCurrentDataSetOffsetFromMaster=docsRphyPtpRpdCurrentDataSetOffsetFromMaster, docsRphyPtpCcapPortMasterClockStatusIsMasterConnected=docsRphyPtpCcapPortMasterClockStatusIsMasterConnected, docsRphyPtpRpdClockStatusPacketsReceived=docsRphyPtpRpdClockStatusPacketsReceived, docsRphyPtpCcapParentDataSetClockOffset=docsRphyPtpCcapParentDataSetClockOffset, docsRphyPtpRpdPortMasterClockStatusIsBmc=docsRphyPtpRpdPortMasterClockStatusIsBmc, docsRphyPtpCompliance=docsRphyPtpCompliance, docsRphyPtpRpdPortDataSetPortNumber=docsRphyPtpRpdPortDataSetPortNumber, docsRphyPtpCcapParentDataSetParentClockId=docsRphyPtpCcapParentDataSetParentClockId, docsRphyPtpCcapClockStatusPacketsSent=docsRphyPtpCcapClockStatusPacketsSent, docsRphyPtpRpdClockStatusCounterDiscontinuityTime=docsRphyPtpRpdClockStatusCounterDiscontinuityTime, docsRphyPtpCcapPortMasterClockStatusIsBmc=docsRphyPtpCcapPortMasterClockStatusIsBmc, docsRphyPtpRpdClockStatusPacketsSent=docsRphyPtpRpdClockStatusPacketsSent, docsRphyPtpCcapParentDataSet=docsRphyPtpCcapParentDataSet, docsRphyPtpCcapCoreGroup=docsRphyPtpCcapCoreGroup, docsRphyPtpCcapPortDataSetTable=docsRphyPtpCcapPortDataSetTable, docsRphyPtpCcapTimePropertiesTimeSource=docsRphyPtpCcapTimePropertiesTimeSource, docsRphyPtpCcapCorePtpPortStatusPacketsReceived=docsRphyPtpCcapCorePtpPortStatusPacketsReceived, docsRphyPtpCcapParentDataSetParentPortNumber=docsRphyPtpCcapParentDataSetParentPortNumber, PYSNMP_MODULE_ID=docsRphyPtpMib, docsRphyPtpCcapTimePropertiesFreqTraceable=docsRphyPtpCcapTimePropertiesFreqTraceable, docsRphyPtpRpdPortMasterClockStatusMasterClockId=docsRphyPtpRpdPortMasterClockStatusMasterClockId, docsRphyPtpRpdClockStatusLastStateChange=docsRphyPtpRpdClockStatusLastStateChange, docsRphyPtpCcapPortMasterClockStatusPacketsSent=docsRphyPtpCcapPortMasterClockStatusPacketsSent, docsRphyPtpCcapDefaultDataSet=docsRphyPtpCcapDefaultDataSet, docsRphyPtpCcapPortMasterClockStatusMasterClockPortNumber=docsRphyPtpCcapPortMasterClockStatusMasterClockPortNumber, docsRphyPtpRpdPtpPortStatusCounterDiscontinuityTime=docsRphyPtpRpdPtpPortStatusCounterDiscontinuityTime, docsRphyPtpCcapDefaultDataSetPriority2=docsRphyPtpCcapDefaultDataSetPriority2, docsRphyPtpCcapPortMasterClockStatusTable=docsRphyPtpCcapPortMasterClockStatusTable, docsRphyPtpCcapCorePtpPortStatusEntry=docsRphyPtpCcapCorePtpPortStatusEntry, docsRphyPtpGroups=docsRphyPtpGroups, docsRphyPtpRpdPtpPortStatusTable=docsRphyPtpRpdPtpPortStatusTable, docsRphyPtpRpdPortMasterClockStatusFreqOffset=docsRphyPtpRpdPortMasterClockStatusFreqOffset, docsRphyPtpCcapCorePtpPortStatusPacketsSent=docsRphyPtpCcapCorePtpPortStatusPacketsSent, docsRphyPtpRpdPortDataSetEntry=docsRphyPtpRpdPortDataSetEntry, docsRphyPtpCcapPortMasterClockStatusPacketsReceived=docsRphyPtpCcapPortMasterClockStatusPacketsReceived, docsRphyPtpCcapCurrentDataSet=docsRphyPtpCcapCurrentDataSet, docsRphyPtpCcapDefaultDataSetTwoStepFlag=docsRphyPtpCcapDefaultDataSetTwoStepFlag, docsRphyPtpCcapMibObjects=docsRphyPtpCcapMibObjects, docsRphyPtpRpdPortMasterClockStatusTwoStepFlag=docsRphyPtpRpdPortMasterClockStatusTwoStepFlag, docsRphyPtpCcapParentDataSetGmQualityClass=docsRphyPtpCcapParentDataSetGmQualityClass, docsRphyPtpRpdClockStatusEntry=docsRphyPtpRpdClockStatusEntry, docsRphyPtpCcapCurrentDataSetMeanPathDelay=docsRphyPtpCcapCurrentDataSetMeanPathDelay, docsRphyPtpCcapClockStatusCounterDiscontinuityTime=docsRphyPtpCcapClockStatusCounterDiscontinuityTime, docsRphyPtpRpdPortDataSetPortState=docsRphyPtpRpdPortDataSetPortState, docsRphyPtpCcapParentDataSetGmPriority1=docsRphyPtpCcapParentDataSetGmPriority1, docsRphyPtpCcapTimeProperties=docsRphyPtpCcapTimeProperties, docsRphyPtpCcapParentDataSetGmQualityOffset=docsRphyPtpCcapParentDataSetGmQualityOffset, docsRphyPtpRpdCurrentDataSetEntry=docsRphyPtpRpdCurrentDataSetEntry, docsRphyPtpCcapParentDataSetGmClockIdentity=docsRphyPtpCcapParentDataSetGmClockIdentity, docsRphyPtpCcapPortDataSetMeanPathDelay=docsRphyPtpCcapPortDataSetMeanPathDelay, docsRphyPtpRpdPtpPortStatusEntry=docsRphyPtpRpdPtpPortStatusEntry, docsRphyPtpRpdPortDataSetMeanPathDelay=docsRphyPtpRpdPortDataSetMeanPathDelay, docsRphyPtpRpdPtpPortStatusPacketsSent=docsRphyPtpRpdPtpPortStatusPacketsSent, docsRphyPtpCcapTimePropertiesTimeTraceable=docsRphyPtpCcapTimePropertiesTimeTraceable, docsRphyPtpRpdCurrentDataSetTable=docsRphyPtpRpdCurrentDataSetTable, docsRphyPtpRpdPortMasterClockStatusIsMasterConnected=docsRphyPtpRpdPortMasterClockStatusIsMasterConnected, docsRphyPtpMib=docsRphyPtpMib, docsRphyPtpCcapPortMasterClockStatusMasterClockId=docsRphyPtpCcapPortMasterClockStatusMasterClockId, docsRphyPtpCcapPortMasterClockStatusEntry=docsRphyPtpCcapPortMasterClockStatusEntry, docsRphyPtpCcapClockStatusPacketsReceived=docsRphyPtpCcapClockStatusPacketsReceived, docsRphyPtpCcapTimePropertiesCurrentUtcOffset=docsRphyPtpCcapTimePropertiesCurrentUtcOffset, docsRphyPtpCcapPortDataSetPortState=docsRphyPtpCcapPortDataSetPortState, docsRphyPtpRpdPortMasterClockStatusMasterClockPortNumber=docsRphyPtpRpdPortMasterClockStatusMasterClockPortNumber, docsRphyPtpRpdCurrentDataSetStepsRemoved=docsRphyPtpRpdCurrentDataSetStepsRemoved, docsRphyPtpCcapTimePropertiesPtpTimescale=docsRphyPtpCcapTimePropertiesPtpTimescale, docsRphyPtpRpdClockStatusComputedPhaseOffset=docsRphyPtpRpdClockStatusComputedPhaseOffset, docsRphyPtpCcapParentDataSetGmQualityAccuracy=docsRphyPtpCcapParentDataSetGmQualityAccuracy, docsRphyPtpCcapTimePropertiesCurrentUtcOffsetValid=docsRphyPtpCcapTimePropertiesCurrentUtcOffsetValid, docsRphyPtpRpdPortDataSetTable=docsRphyPtpRpdPortDataSetTable, docsRphyPtpCcapDefaultDataSetPriority1=docsRphyPtpCcapDefaultDataSetPriority1, docsRphyPtpRpdPortMasterClockStatusEntry=docsRphyPtpRpdPortMasterClockStatusEntry, docsRphyPtpCcapParentDataSetPhaseChangeRate=docsRphyPtpCcapParentDataSetPhaseChangeRate, docsRphyPtpCcapCorePtpPortStatusTable=docsRphyPtpCcapCorePtpPortStatusTable, docsRphyPtpRpdPortMasterClockStatusPacketsReceived=docsRphyPtpRpdPortMasterClockStatusPacketsReceived, docsRphyPtpCcapDefaultDataSetClockIdentity=docsRphyPtpCcapDefaultDataSetClockIdentity, docsRphyPtpNotifications=docsRphyPtpNotifications, docsRphyPtpRpdPortMasterClockStatusPacketsSent=docsRphyPtpRpdPortMasterClockStatusPacketsSent, docsRphyPtpCcapClockStatusClockState=docsRphyPtpCcapClockStatusClockState, docsRphyPtpCcapPortMasterClockStatusCounterDiscontinuityTime=docsRphyPtpCcapPortMasterClockStatusCounterDiscontinuityTime, docsRphyPtpCcapPortDataSetEntry=docsRphyPtpCcapPortDataSetEntry, docsRphyPtpCcapPortDataSetPortNumber=docsRphyPtpCcapPortDataSetPortNumber, docsRphyPtpCcapPortMasterClockStatusStatusDomain=docsRphyPtpCcapPortMasterClockStatusStatusDomain, docsRphyPtpCcapDefaultDataSetSlaveOnly=docsRphyPtpCcapDefaultDataSetSlaveOnly, docsRphyPtpRpdPortMasterClockStatusCounterDiscontinuityTime=docsRphyPtpRpdPortMasterClockStatusCounterDiscontinuityTime, docsRphyPtpRpdGroup=docsRphyPtpRpdGroup, docsRphyPtpRpdClockStatusTable=docsRphyPtpRpdClockStatusTable)
| 191.923944 | 9,463 | 0.824857 | 6,750 | 68,133 | 8.325481 | 0.084593 | 0.043988 | 0.076979 | 0.008185 | 0.458868 | 0.370429 | 0.356567 | 0.339662 | 0.306796 | 0.286777 | 0 | 0.042695 | 0.077672 | 68,133 | 354 | 9,464 | 192.466102 | 0.851578 | 0.004814 | 0 | 0.011594 | 0 | 0.136232 | 0.325609 | 0.065166 | 0 | 0 | 0.000826 | 0 | 0 | 1 | 0 | false | 0 | 0.043478 | 0 | 0.043478 | 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 |
e7cf7ba0b15891237f5fbb5ea5a2112c17fcf8a2 | 2,095 | py | Python | nerds/test/test_crf_ner_model.py | elsevierlabs-os/nerds | 9c4f32a51e3e08c802498dc88b5f6367c9d2df2d | [
"BSD-3-Clause"
] | 19 | 2018-07-06T10:09:37.000Z | 2020-11-27T18:14:42.000Z | nerds_orig/test/test_crf_ner_model.py | Banguiskode/nerds | 366420b2ec57bf790562de62a79f4973cbd6b3ed | [
"BSD-3-Clause"
] | 6 | 2018-12-28T12:14:12.000Z | 2020-04-22T14:09:12.000Z | nerds/test/test_crf_ner_model.py | elsevierlabs-os/nerds | 9c4f32a51e3e08c802498dc88b5f6367c9d2df2d | [
"BSD-3-Clause"
] | 8 | 2018-07-14T16:50:28.000Z | 2020-11-25T08:03:24.000Z | from nose.tools import assert_equal
from nerds.core.model.input.annotation import Annotation
from nerds.core.model.input.document import Document, AnnotatedDocument
from nerds.core.model.ner.crf import CRF
def test_crf():
content = b"The quick brown fox jumps over the lazy dog."
annotations = [
Annotation("brown", "COLOR", (10, 14)),
Annotation("fox", "ANIMAL", (16, 18)),
Annotation("dog", "ANIMAL", (40, 42))]
annotated_document = AnnotatedDocument(content, annotations=annotations)
# Train.
mod = CRF()
mod.fit([annotated_document])
# Predict. Works!
content = b"The quick brown fox."
document = Document(content)
ann = mod.transform([document])
# 2 annotations, brown and fox
assert_equal(len(ann[0].annotations), 2)
assert_equal(ann[0].annotations[0].text, "brown")
assert_equal(ann[0].annotations[0].label, "COLOR")
assert_equal(ann[0].annotations[0].offset, (10, 14))
assert_equal(ann[0].annotations[1].text, "fox")
assert_equal(ann[0].annotations[1].label, "ANIMAL")
assert_equal(ann[0].annotations[1].offset, (16, 18))
def test_crf_multi_term():
content = b"The dark brown fox jumps over the lazy dog magnificently."
annotations = [
Annotation("dark brown", "COLOR", (4, 13)),
Annotation("fox", "ANIMAL", (15, 17)),
Annotation("dog", "ANIMAL", (40, 42))]
annotated_document = AnnotatedDocument(content, annotations=annotations)
# Train.
mod = CRF()
mod.fit([annotated_document])
# Predict. Works!
content = b"The dark brown fox."
document = Document(content)
ann = mod.transform([document])
# 2 annotations, dark brown and fox
assert_equal(len(ann[0].annotations), 2)
assert_equal(ann[0].annotations[0].text, "dark brown")
assert_equal(ann[0].annotations[0].offset, (4, 13))
assert_equal(ann[0].annotations[0].label, "COLOR")
assert_equal(ann[0].annotations[1].text, "fox")
assert_equal(ann[0].annotations[1].offset, (15, 17))
assert_equal(ann[0].annotations[1].label, "ANIMAL")
| 33.790323 | 76 | 0.666826 | 277 | 2,095 | 4.960289 | 0.216607 | 0.120087 | 0.152838 | 0.131004 | 0.772926 | 0.739447 | 0.710335 | 0.606259 | 0.570597 | 0.570597 | 0 | 0.039558 | 0.179475 | 2,095 | 61 | 77 | 34.344262 | 0.759744 | 0.051551 | 0 | 0.52381 | 0 | 0 | 0.123232 | 0 | 0 | 0 | 0 | 0 | 0.357143 | 1 | 0.047619 | false | 0 | 0.095238 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 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 |
e7d469a2b915f57d7024559e17cd3d524efd509a | 144 | py | Python | config.sample.py | talyguryn/watcher | dc491179f544ec7a120f82b19a67f69a6bed39bc | [
"MIT"
] | null | null | null | config.sample.py | talyguryn/watcher | dc491179f544ec7a120f82b19a67f69a6bed39bc | [
"MIT"
] | null | null | null | config.sample.py | talyguryn/watcher | dc491179f544ec7a120f82b19a67f69a6bed39bc | [
"MIT"
] | 1 | 2019-05-24T19:41:47.000Z | 2019-05-24T19:41:47.000Z | # Domains list
DOMAINS = [
{ 'url': 'https://ifmo.su', 'message': '@guryn' }
]
# Notifications link from https://t.me/wbhkbot
WEBHOOK = ''
| 18 | 53 | 0.604167 | 17 | 144 | 5.117647 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.180556 | 144 | 7 | 54 | 20.571429 | 0.737288 | 0.395833 | 0 | 0 | 0 | 0 | 0.369048 | 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 |
e7e2f0d8909d8aded4b234668a35a9bea452ea64 | 514 | py | Python | src/bromine/exceptions.py | Etiqa/bromine | cabf0931f5a06796c26fdc7fb9f7ecf147554fd5 | [
"BSD-2-Clause"
] | 2 | 2018-09-20T12:37:01.000Z | 2021-08-30T14:44:25.000Z | src/bromine/exceptions.py | Etiqa/bromine | cabf0931f5a06796c26fdc7fb9f7ecf147554fd5 | [
"BSD-2-Clause"
] | null | null | null | src/bromine/exceptions.py | Etiqa/bromine | cabf0931f5a06796c26fdc7fb9f7ecf147554fd5 | [
"BSD-2-Clause"
] | null | null | null | """
Global Bromine exception and warning classes.
"""
from selenium.common.exceptions import (NoSuchElementException, # pylint: disable=unused-import
StaleElementReferenceException,
TimeoutException)
class BromineException(Exception):
"""Base class for all Bromine custom exceptions."""
class MultipleElementsFoundError(BromineException):
"""Multiple instances of a DOM element were found, but only one was expected."""
| 32.125 | 96 | 0.663424 | 44 | 514 | 7.75 | 0.840909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.262646 | 514 | 15 | 97 | 34.266667 | 0.899736 | 0.383268 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
99b3045cad2b02c487f592e3a12fefd9366714c0 | 65 | py | Python | src/__init__.py | neuront/jtrans | 291e04deac061c1848484bb5f80bcfec0d910d6c | [
"MIT"
] | 1 | 2018-10-31T02:12:01.000Z | 2018-10-31T02:12:01.000Z | src/__init__.py | neuront/jtrans | 291e04deac061c1848484bb5f80bcfec0d910d6c | [
"MIT"
] | null | null | null | src/__init__.py | neuront/jtrans | 291e04deac061c1848484bb5f80bcfec0d910d6c | [
"MIT"
] | null | null | null | __version__ = '0.0.3'
REPO = 'https://github.com/neuront/jtrans'
| 21.666667 | 42 | 0.692308 | 10 | 65 | 4.1 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.050847 | 0.092308 | 65 | 2 | 43 | 32.5 | 0.644068 | 0 | 0 | 0 | 0 | 0 | 0.584615 | 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 |
99b840a2a2e359344dc940d3f6572705741d4bad | 6,649 | py | Python | Dev/Cpp/CreateHeader.py | NumAniCloud/Effekseer | f4547a57eea4c85b55cb8218bf6cac6af6d6dd37 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-11-21T01:34:30.000Z | 2020-11-21T01:34:30.000Z | Dev/Cpp/CreateHeader.py | NumAniCloud/Effekseer | f4547a57eea4c85b55cb8218bf6cac6af6d6dd37 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | Dev/Cpp/CreateHeader.py | NumAniCloud/Effekseer | f4547a57eea4c85b55cb8218bf6cac6af6d6dd37 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import re
import codecs
def isValidLine(line):
if re.search('include \"', line) == None or line.find('.PSVita') != -1 or line.find('.PS4') != -1 or line.find('.Switch') != -1 or line.find('.XBoxOne') != -1:
return True
return False
class CreateHeader:
def __init__(self):
self.lines = []
def addLine(self,line):
self.lines.append(line + '\n')
def readLines(self,path):
f = codecs.open(path, 'r','utf-8_sig')
line = f.readline()
while line:
if isValidLine(line):
self.lines.append(line)
line = f.readline()
f.close()
def output(self,path):
f = codecs.open(path, 'w','utf-8_sig')
for line in self.lines:
f.write(line)
f.close()
effekseerHeader = CreateHeader()
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Base.Pre.h')
effekseerHeader.readLines('Effekseer/Effekseer/Utils/Effekseer.CustomAllocator.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Vector2D.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Vector3D.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Color.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.RectF.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Matrix43.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Matrix44.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.File.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.DefaultFile.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Effect.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Manager.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.EffectLoader.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.TextureLoader.h')
effekseerHeader.readLines('Effekseer/Effekseer/Model/ModelLoader.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.MaterialLoader.h')
effekseerHeader.readLines('Effekseer/Effekseer/Model/Model.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Curve.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.CurveLoader.h')
effekseerHeader.readLines('Effekseer/Effekseer/Sound/Effekseer.SoundPlayer.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.SoundLoader.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Setting.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Server.h')
effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Client.h')
effekseerHeader.readLines('Effekseer/Effekseer/Backend/GraphicsDevice.h')
effekseerHeader.output('Effekseer/Effekseer.h')
effekseerInternalHeader = CreateHeader()
effekseerInternalHeader.addLine('#pragma once')
effekseerInternalHeader.addLine('#include "Effekseer.h"')
effekseerInternalHeader.addLine('#include "Effekseer/SIMD/Effekseer.Vec2f.h"')
effekseerInternalHeader.addLine('#include "Effekseer/SIMD/Effekseer.Vec3f.h"')
effekseerInternalHeader.addLine('#include "Effekseer/SIMD/Effekseer.Vec4f.h"')
effekseerInternalHeader.addLine('#include "Effekseer/SIMD/Effekseer.Mat43f.h"')
effekseerInternalHeader.addLine('#include "Effekseer/SIMD/Effekseer.Mat44f.h"')
effekseerInternalHeader.addLine('#include "Effekseer/SIMD/Effekseer.SIMDUtils.h"')
effekseerInternalHeader.addLine('')
effekseerInternalHeader.addLine('// A header to access internal data of effekseer')
effekseerInternalHeader.addLine('')
effekseerInternalHeader.readLines('Effekseer/Effekseer/Parameter/Effekseer.Parameters.h')
effekseerInternalHeader.readLines('Effekseer/Effekseer/Renderer/Effekseer.SpriteRenderer.h')
effekseerInternalHeader.readLines('Effekseer/Effekseer/Renderer/Effekseer.RibbonRenderer.h')
effekseerInternalHeader.readLines('Effekseer/Effekseer/Renderer/Effekseer.RingRenderer.h')
effekseerInternalHeader.readLines('Effekseer/Effekseer/Renderer/Effekseer.ModelRenderer.h')
effekseerInternalHeader.readLines('Effekseer/Effekseer/Renderer/Effekseer.TrackRenderer.h')
effekseerInternalHeader.output('Effekseer/Effekseer.Internal.h')
effekseerRendererDX9Header = CreateHeader()
effekseerRendererDX9Header.readLines('EffekseerRendererDX9/EffekseerRenderer/EffekseerRendererDX9.Base.Pre.h')
effekseerRendererDX9Header.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')
effekseerRendererDX9Header.readLines('EffekseerRendererDX9/EffekseerRenderer/EffekseerRendererDX9.Renderer.h')
effekseerRendererDX9Header.output('EffekseerRendererDX9/EffekseerRendererDX9.h')
effekseerRendererDX11Header = CreateHeader()
effekseerRendererDX11Header.readLines('EffekseerRendererDX11/EffekseerRenderer/EffekseerRendererDX11.Base.Pre.h')
effekseerRendererDX11Header.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')
effekseerRendererDX11Header.readLines('EffekseerRendererDX11/EffekseerRenderer/EffekseerRendererDX11.Renderer.h')
effekseerRendererDX11Header.output('EffekseerRendererDX11/EffekseerRendererDX11.h')
effekseerRendererDX12Header = CreateHeader()
effekseerRendererDX12Header.readLines('EffekseerRendererDX12/EffekseerRenderer/EffekseerRendererDX12.Base.Pre.h')
effekseerRendererDX12Header.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')
effekseerRendererDX12Header.readLines('EffekseerRendererDX12/EffekseerRenderer/EffekseerRendererDX12.Renderer.h')
effekseerRendererDX12Header.output('EffekseerRendererDX12/EffekseerRendererDX12.h')
effekseerRendererVulkanHeader = CreateHeader()
effekseerRendererVulkanHeader.readLines('EffekseerRendererVulkan/EffekseerRenderer/EffekseerRendererVulkan.Base.Pre.h')
effekseerRendererVulkanHeader.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')
effekseerRendererVulkanHeader.readLines('EffekseerRendererVulkan/EffekseerRenderer/EffekseerRendererVulkan.Renderer.h')
effekseerRendererVulkanHeader.output('EffekseerRendererVulkan/EffekseerRendererVulkan.h')
effekseerRendererGLHeader = CreateHeader()
effekseerRendererGLHeader.readLines('EffekseerRendererGL/EffekseerRenderer/EffekseerRendererGL.Base.Pre.h')
effekseerRendererGLHeader.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')
effekseerRendererGLHeader.readLines('EffekseerRendererGL/EffekseerRenderer/EffekseerRendererGL.Renderer.h')
effekseerRendererGLHeader.output('EffekseerRendererGL/EffekseerRendererGL.h')
effekseerRendererMetalHeader = CreateHeader()
effekseerRendererMetalHeader.readLines('EffekseerRendererMetal/EffekseerRenderer/EffekseerRendererMetal.Base.Pre.h')
effekseerRendererMetalHeader.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')
effekseerRendererMetalHeader.readLines('EffekseerRendererMetal/EffekseerRenderer/EffekseerRendererMetal.Renderer.h')
effekseerRendererMetalHeader.output('EffekseerRendererMetal/EffekseerRendererMetal.h')
| 52.769841 | 160 | 0.848097 | 584 | 6,649 | 9.645548 | 0.196918 | 0.169359 | 0.148589 | 0.186402 | 0.62915 | 0.324871 | 0.124268 | 0 | 0 | 0 | 0 | 0.011717 | 0.037299 | 6,649 | 125 | 161 | 53.192 | 0.868302 | 0 | 0 | 0.06 | 0 | 0 | 0.488043 | 0.458866 | 0 | 0 | 0 | 0 | 0 | 1 | 0.05 | false | 0 | 0.02 | 0 | 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 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
99be4754e2c0ff7cecb500a1dc5e5acd0e8dcf60 | 546 | py | Python | src/camera/camera.py | jucoba/IpCamMonitorSystem | 466e22d3cd095dbf99a1238713f1c23cabe514ed | [
"MIT"
] | 1 | 2017-05-13T18:22:03.000Z | 2017-05-13T18:22:03.000Z | src/camera/camera.py | jucoba/IpCamMonitorSystem | 466e22d3cd095dbf99a1238713f1c23cabe514ed | [
"MIT"
] | null | null | null | src/camera/camera.py | jucoba/IpCamMonitorSystem | 466e22d3cd095dbf99a1238713f1c23cabe514ed | [
"MIT"
] | null | null | null | from utils.paramUtils import *
from utils.configUtils import *
class Camera():
json_data = None
paramUtil = ParamUtils()
configUtil = ConfigUtils()
def __init__(self, json_data):
self.json_data = json_data
self.url = self.configUtil.getUrl(json_data)
def motion_detected(self):
params = self.get_status()
alarm_status = params["alarm_status"]
return "1" == alarm_status
def get_status(self):
dic = self.paramUtil.get_status(self.url, "user", "pwd")
return dic
def getUrl(self):
return "192.168.1.101:8080"
| 21.84 | 60 | 0.708791 | 75 | 546 | 4.946667 | 0.426667 | 0.107817 | 0.06469 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033113 | 0.17033 | 546 | 25 | 61 | 21.84 | 0.785872 | 0 | 0 | 0 | 0 | 0 | 0.06947 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.111111 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
99c932b7b330e53a0d1d9e71a543716bac2b814e | 3,534 | py | Python | libdyson/dyson_pure_humidify_cool.py | vbsoftpl/libdyson | 70d890259fe7baaa106f8c3302cd42077697ddd7 | [
"Apache-2.0"
] | 28 | 2021-02-11T22:44:01.000Z | 2022-03-28T22:29:35.000Z | libdyson/dyson_pure_humidify_cool.py | vbsoftpl/libdyson | 70d890259fe7baaa106f8c3302cd42077697ddd7 | [
"Apache-2.0"
] | 20 | 2021-03-07T15:18:58.000Z | 2022-03-07T13:47:30.000Z | libdyson/dyson_pure_humidify_cool.py | vbsoftpl/libdyson | 70d890259fe7baaa106f8c3302cd42077697ddd7 | [
"Apache-2.0"
] | 25 | 2021-02-13T14:55:43.000Z | 2022-03-29T22:27:55.000Z | """Dyson Pure Humidify+Cool device."""
from typing import Optional
from .const import HumidifyOscillationMode, WaterHardness
from .dyson_pure_cool import DysonPureCoolBase
WATER_HARDNESS_ENUM_TO_STR = {
WaterHardness.SOFT: "2025",
WaterHardness.MEDIUM: "1350",
WaterHardness.HARD: "0675",
}
WATER_HARDNESS_STR_TO_ENUM = {
str_: enum for enum, str_ in WATER_HARDNESS_ENUM_TO_STR.items()
}
class DysonPureHumidifyCool(DysonPureCoolBase):
"""Dyson Pure Humidify+Cool device."""
@property
def oscillation(self) -> bool:
"""Return oscillation status."""
return self._get_field_value(self._status, "oson") == "ON"
@property
def oscillation_mode(self) -> HumidifyOscillationMode:
"""Return oscillation mode."""
return HumidifyOscillationMode(self._get_field_value(self._status, "ancp"))
@property
def humidification(self) -> bool:
"""Return if humidification is on."""
return self._get_field_value(self._status, "hume") == "HUMD"
@property
def humidification_auto_mode(self) -> bool:
"""Return if humidification auto mode is on."""
return self._get_field_value(self._status, "haut") == "ON"
@property
def target_humidity(self) -> int:
"""Return target humidity in percentage."""
return int(self._get_field_value(self._status, "humt"))
@property
def auto_target_humidity(self) -> int:
"""Return humidification auto mode target humidity."""
return int(self._get_field_value(self._status, "rect"))
@property
def water_hardness(self) -> WaterHardness:
"""Return the water hardness setting."""
return WATER_HARDNESS_STR_TO_ENUM[self._get_field_value(self._status, "wath")]
@property
def time_until_next_clean(self) -> int:
"""Return the time remaining in hours before the next deep cleaning."""
return int(self._get_field_value(self._status, "cltr"))
@property
def clean_time_remaining(self) -> int:
"""Return the time remaining in minutes before the cleaning finishes."""
return int(self._get_field_value(self._status, "cdrr"))
def enable_oscillation(
self, oscillation_mode: Optional[HumidifyOscillationMode] = None
) -> None:
"""Turn on oscillation."""
if oscillation_mode is None:
oscillation_mode = self.oscillation_mode
self._set_configuration(oson="ON", fpwr="ON", ancp=oscillation_mode.value)
def disable_oscillation(self) -> None:
"""Turn off oscillation."""
self._set_configuration(oson="OFF")
def enable_humidification(self) -> None:
"""Enable humidification."""
self._set_configuration(hume="HUMD")
def disable_humidification(self) -> None:
"""Disable humidification."""
self._set_configuration(hume="OFF")
def enable_humidification_auto_mode(self) -> None:
"""Enable humidification auto mode."""
self._set_configuration(haut="ON")
def disable_humidification_auto_mode(self) -> None:
"""Disable humidification auto mode."""
self._set_configuration(haut="OFF")
def set_target_humidity(self, target_humidity: int) -> None:
"""Set target humidity."""
self._set_configuration(humt=f"{target_humidity:04d}", haut="OFF")
def set_water_hardness(self, water_hardness: WaterHardness) -> None:
"""Set water hardness."""
self._set_configuration(wath=WATER_HARDNESS_ENUM_TO_STR[water_hardness])
| 34.647059 | 86 | 0.679117 | 404 | 3,534 | 5.665842 | 0.20297 | 0.062473 | 0.047182 | 0.066841 | 0.392748 | 0.200524 | 0.176933 | 0.095238 | 0.032329 | 0 | 0 | 0.004961 | 0.201471 | 3,534 | 101 | 87 | 34.990099 | 0.806166 | 0.18223 | 0 | 0.152542 | 0 | 0 | 0.035433 | 0.007516 | 0 | 0 | 0 | 0 | 0 | 1 | 0.288136 | false | 0 | 0.050847 | 0 | 0.508475 | 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 |
99cf2e6c972e6c1e9a70c4c30a8071a16ed1cd47 | 393 | py | Python | edw_fluent/signals/handlers/__init__.py | infolabs/django_edw_fluent | ddb013c0b4dde9c7b00282c9b0c43b06e21b7c19 | [
"MIT"
] | 1 | 2020-10-23T08:55:21.000Z | 2020-10-23T08:55:21.000Z | edw_fluent/signals/handlers/__init__.py | EagerBeager/django-edw-fluent | ab10ffe17000f2d07f29e4a25892ebc0e2e47101 | [
"MIT"
] | 3 | 2020-03-24T14:34:37.000Z | 2021-06-10T21:12:53.000Z | edw_fluent/signals/handlers/__init__.py | EagerBeager/django-edw-fluent | ab10ffe17000f2d07f29e4a25892ebc0e2e47101 | [
"MIT"
] | 2 | 2020-10-23T08:55:19.000Z | 2022-03-02T07:05:45.000Z | # -*- coding: utf-8 -*-
from django.db.utils import ProgrammingError
try:
from edw_fluent.signals.handlers import (
page_layout,
template,
entity,
data_mart,
term,
simple_page,
hot_tag
)
except (AttributeError, ProgrammingError) as e:
# initial migrations hack
print("*** INITIAL MIGRATIONS HACK ***")
print(e.args)
| 21.833333 | 47 | 0.608142 | 42 | 393 | 5.571429 | 0.785714 | 0.145299 | 0.179487 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003584 | 0.290076 | 393 | 17 | 48 | 23.117647 | 0.835125 | 0.114504 | 0 | 0 | 0 | 0 | 0.089855 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.142857 | 0 | 0.142857 | 0.142857 | 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 |
99cfded404e2fff90ba78176653a31e7278d3928 | 1,175 | py | Python | submission/util.py | pwqbot/eoj3 | 46be6a6f192798e74eab7b327bb8df7ca73575d9 | [
"MIT"
] | 107 | 2017-03-15T11:53:45.000Z | 2019-09-06T11:23:44.000Z | submission/util.py | OS-EDU/eoj3 | f117dcd4e3cea7d150c3e3794e7255e00d486c88 | [
"MIT"
] | 27 | 2019-09-24T12:44:48.000Z | 2022-03-11T23:18:21.000Z | submission/util.py | OS-EDU/eoj3 | f117dcd4e3cea7d150c3e3794e7255e00d486c88 | [
"MIT"
] | 25 | 2019-10-11T10:39:12.000Z | 2022-03-18T05:15:57.000Z | class SubmissionStatus(object):
SUBMITTED = -4
WAITING = -3
JUDGING = -2
WRONG_ANSWER = -1
ACCEPTED = 0
TIME_LIMIT_EXCEEDED = 1
IDLENESS_LIMIT_EXCEEDED = 2
MEMORY_LIMIT_EXCEEDED = 3
RUNTIME_ERROR = 4
SYSTEM_ERROR = 5
COMPILE_ERROR = 6
SCORED = 7
REJECTED = 10
JUDGE_ERROR = 11
PRETEST_PASSED = 12
@staticmethod
def is_judged(status):
return status >= SubmissionStatus.WRONG_ANSWER
@staticmethod
def is_penalty(status):
return SubmissionStatus.is_judged(status) and status != SubmissionStatus.COMPILE_ERROR
@staticmethod
def is_accepted(status):
return status == SubmissionStatus.ACCEPTED or status == SubmissionStatus.PRETEST_PASSED
@staticmethod
def is_scored(status):
return status == SubmissionStatus.SCORED
STATUS_CHOICE = (
(-4, 'Submitted'),
(-3, 'In queue'),
(-2, 'Running'),
(-1, 'Wrong answer'),
(0, 'Accepted'),
(1, 'Time limit exceeded'),
(2, 'Idleness limit exceeded'),
(3, 'Memory limit exceeded'),
(4, 'Runtime error'),
(5, 'Denial of judgement'),
(6, 'Compilation error'),
(7, 'Partial score'),
(10, 'Rejected'),
(11, 'Checker error'),
(12, 'Pretest passed'),
)
| 22.596154 | 91 | 0.675745 | 140 | 1,175 | 5.521429 | 0.385714 | 0.100906 | 0.087969 | 0.131953 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.038015 | 0.194043 | 1,175 | 51 | 92 | 23.039216 | 0.778247 | 0 | 0 | 0.088889 | 0 | 0 | 0.173617 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.088889 | false | 0.066667 | 0 | 0.088889 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
99e8b2d89b7758b9057c1a18c6d154fb6590ef35 | 13,221 | py | Python | protos/kokoro_api_pb2.py | portintegration/releasetool | 7567bd29b3c13b14f6336cbdb11965c2d2b65a2e | [
"Apache-2.0"
] | 23 | 2018-10-09T15:14:21.000Z | 2022-01-24T12:18:57.000Z | protos/kokoro_api_pb2.py | portintegration/releasetool | 7567bd29b3c13b14f6336cbdb11965c2d2b65a2e | [
"Apache-2.0"
] | 160 | 2018-09-21T22:16:02.000Z | 2022-03-30T21:51:35.000Z | protos/kokoro_api_pb2.py | portintegration/releasetool | 7567bd29b3c13b14f6336cbdb11965c2d2b65a2e | [
"Apache-2.0"
] | 19 | 2018-10-08T20:39:39.000Z | 2021-07-28T15:17:14.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: kokoro_api.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='kokoro_api.proto',
package='devtools.kokoro.api.proto',
syntax='proto2',
serialized_options=None,
serialized_pb=_b('\n\x10kokoro_api.proto\x12\x19\x64\x65vtools.kokoro.api.proto\"\xf9\x02\n\x0c\x42uildRequest\x12\x15\n\rfull_job_name\x18\x01 \x01(\t\x12<\n\x0cscm_revision\x18\x03 \x01(\x0b\x32&.devtools.kokoro.api.proto.ScmRevision\x12\x18\n\x10input_file_paths\x18\x04 \x03(\t\x12\x46\n\x08\x65nv_vars\x18\x06 \x03(\x0b\x32\x34.devtools.kokoro.api.proto.BuildRequest.EnvVarsEntry\x12N\n\x0c\x62uild_params\x18\x0c \x03(\x0b\x32\x38.devtools.kokoro.api.proto.BuildRequest.BuildParamsEntry\x1a.\n\x0c\x45nvVarsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x42uildParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"i\n\x0bScmRevision\x12K\n\x13github_scm_revision\x18\x04 \x01(\x0b\x32,.devtools.kokoro.api.proto.GithubScmRevisionH\x00\x42\r\n\x0bscmrevision\"\x8d\x01\n\x11GithubScmRevision\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x12\n\ncommit_sha\x18\x01 \x01(\t\x12\x1b\n\x13pull_request_number\x18\x02 \x01(\t\x12\x16\n\x0erepository_url\x18\x03 \x01(\t\x12\r\n\x05owner\x18\x05 \x01(\t\x12\x12\n\nrepository\x18\x06 \x01(\t')
)
_BUILDREQUEST_ENVVARSENTRY = _descriptor.Descriptor(
name='EnvVarsEntry',
full_name='devtools.kokoro.api.proto.BuildRequest.EnvVarsEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='devtools.kokoro.api.proto.BuildRequest.EnvVarsEntry.key', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='value', full_name='devtools.kokoro.api.proto.BuildRequest.EnvVarsEntry.value', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=_b('8\001'),
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=327,
serialized_end=373,
)
_BUILDREQUEST_BUILDPARAMSENTRY = _descriptor.Descriptor(
name='BuildParamsEntry',
full_name='devtools.kokoro.api.proto.BuildRequest.BuildParamsEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='devtools.kokoro.api.proto.BuildRequest.BuildParamsEntry.key', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='value', full_name='devtools.kokoro.api.proto.BuildRequest.BuildParamsEntry.value', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=_b('8\001'),
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=375,
serialized_end=425,
)
_BUILDREQUEST = _descriptor.Descriptor(
name='BuildRequest',
full_name='devtools.kokoro.api.proto.BuildRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='full_job_name', full_name='devtools.kokoro.api.proto.BuildRequest.full_job_name', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='scm_revision', full_name='devtools.kokoro.api.proto.BuildRequest.scm_revision', index=1,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='input_file_paths', full_name='devtools.kokoro.api.proto.BuildRequest.input_file_paths', index=2,
number=4, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='env_vars', full_name='devtools.kokoro.api.proto.BuildRequest.env_vars', index=3,
number=6, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='build_params', full_name='devtools.kokoro.api.proto.BuildRequest.build_params', index=4,
number=12, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[_BUILDREQUEST_ENVVARSENTRY, _BUILDREQUEST_BUILDPARAMSENTRY, ],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=48,
serialized_end=425,
)
_SCMREVISION = _descriptor.Descriptor(
name='ScmRevision',
full_name='devtools.kokoro.api.proto.ScmRevision',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='github_scm_revision', full_name='devtools.kokoro.api.proto.ScmRevision.github_scm_revision', index=0,
number=4, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name='scmrevision', full_name='devtools.kokoro.api.proto.ScmRevision.scmrevision',
index=0, containing_type=None, fields=[]),
],
serialized_start=427,
serialized_end=532,
)
_GITHUBSCMREVISION = _descriptor.Descriptor(
name='GithubScmRevision',
full_name='devtools.kokoro.api.proto.GithubScmRevision',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='name', full_name='devtools.kokoro.api.proto.GithubScmRevision.name', index=0,
number=4, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='commit_sha', full_name='devtools.kokoro.api.proto.GithubScmRevision.commit_sha', index=1,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='pull_request_number', full_name='devtools.kokoro.api.proto.GithubScmRevision.pull_request_number', index=2,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='repository_url', full_name='devtools.kokoro.api.proto.GithubScmRevision.repository_url', index=3,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='owner', full_name='devtools.kokoro.api.proto.GithubScmRevision.owner', index=4,
number=5, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='repository', full_name='devtools.kokoro.api.proto.GithubScmRevision.repository', index=5,
number=6, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=535,
serialized_end=676,
)
_BUILDREQUEST_ENVVARSENTRY.containing_type = _BUILDREQUEST
_BUILDREQUEST_BUILDPARAMSENTRY.containing_type = _BUILDREQUEST
_BUILDREQUEST.fields_by_name['scm_revision'].message_type = _SCMREVISION
_BUILDREQUEST.fields_by_name['env_vars'].message_type = _BUILDREQUEST_ENVVARSENTRY
_BUILDREQUEST.fields_by_name['build_params'].message_type = _BUILDREQUEST_BUILDPARAMSENTRY
_SCMREVISION.fields_by_name['github_scm_revision'].message_type = _GITHUBSCMREVISION
_SCMREVISION.oneofs_by_name['scmrevision'].fields.append(
_SCMREVISION.fields_by_name['github_scm_revision'])
_SCMREVISION.fields_by_name['github_scm_revision'].containing_oneof = _SCMREVISION.oneofs_by_name['scmrevision']
DESCRIPTOR.message_types_by_name['BuildRequest'] = _BUILDREQUEST
DESCRIPTOR.message_types_by_name['ScmRevision'] = _SCMREVISION
DESCRIPTOR.message_types_by_name['GithubScmRevision'] = _GITHUBSCMREVISION
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
BuildRequest = _reflection.GeneratedProtocolMessageType('BuildRequest', (_message.Message,), dict(
EnvVarsEntry = _reflection.GeneratedProtocolMessageType('EnvVarsEntry', (_message.Message,), dict(
DESCRIPTOR = _BUILDREQUEST_ENVVARSENTRY,
__module__ = 'kokoro_api_pb2'
# @@protoc_insertion_point(class_scope:devtools.kokoro.api.proto.BuildRequest.EnvVarsEntry)
))
,
BuildParamsEntry = _reflection.GeneratedProtocolMessageType('BuildParamsEntry', (_message.Message,), dict(
DESCRIPTOR = _BUILDREQUEST_BUILDPARAMSENTRY,
__module__ = 'kokoro_api_pb2'
# @@protoc_insertion_point(class_scope:devtools.kokoro.api.proto.BuildRequest.BuildParamsEntry)
))
,
DESCRIPTOR = _BUILDREQUEST,
__module__ = 'kokoro_api_pb2'
# @@protoc_insertion_point(class_scope:devtools.kokoro.api.proto.BuildRequest)
))
_sym_db.RegisterMessage(BuildRequest)
_sym_db.RegisterMessage(BuildRequest.EnvVarsEntry)
_sym_db.RegisterMessage(BuildRequest.BuildParamsEntry)
ScmRevision = _reflection.GeneratedProtocolMessageType('ScmRevision', (_message.Message,), dict(
DESCRIPTOR = _SCMREVISION,
__module__ = 'kokoro_api_pb2'
# @@protoc_insertion_point(class_scope:devtools.kokoro.api.proto.ScmRevision)
))
_sym_db.RegisterMessage(ScmRevision)
GithubScmRevision = _reflection.GeneratedProtocolMessageType('GithubScmRevision', (_message.Message,), dict(
DESCRIPTOR = _GITHUBSCMREVISION,
__module__ = 'kokoro_api_pb2'
# @@protoc_insertion_point(class_scope:devtools.kokoro.api.proto.GithubScmRevision)
))
_sym_db.RegisterMessage(GithubScmRevision)
_BUILDREQUEST_ENVVARSENTRY._options = None
_BUILDREQUEST_BUILDPARAMSENTRY._options = None
# @@protoc_insertion_point(module_scope)
| 41.971429 | 1,127 | 0.754708 | 1,657 | 13,221 | 5.73446 | 0.112855 | 0.045464 | 0.051568 | 0.07409 | 0.689013 | 0.65281 | 0.631551 | 0.562303 | 0.521153 | 0.509366 | 0 | 0.033248 | 0.117313 | 13,221 | 314 | 1,128 | 42.105096 | 0.780977 | 0.04334 | 0 | 0.640569 | 1 | 0.003559 | 0.231287 | 0.178114 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.017794 | 0 | 0.017794 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
99f3b0b67951876e04128c58901271203717d169 | 1,121 | py | Python | cgee/Producao/py-nlp/GenerateID.py | gustavodsf/java_project | ce0e735d6ce4804d30ae52986285e4c5f5e2d9b7 | [
"Apache-2.0"
] | null | null | null | cgee/Producao/py-nlp/GenerateID.py | gustavodsf/java_project | ce0e735d6ce4804d30ae52986285e4c5f5e2d9b7 | [
"Apache-2.0"
] | null | null | null | cgee/Producao/py-nlp/GenerateID.py | gustavodsf/java_project | ce0e735d6ce4804d30ae52986285e4c5f5e2d9b7 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Empresa: Funcao Coppetec
Desenvolvedor: Gustavo Daniel Soares Figueiredo
Data: 14/12/2014
Descricao: Classe criada para gerar os id dos objetos a serem adicionados no banco de dados, evitando assim mais requisições ao banco de dados.
'''
class GenerateID:
def __init__(self):
# Variável que armazena o último id das palavras
self.idWord = 0
# Variável que armazena o último id do mapeamento entre palavra de id
self.idwordHasTxt = 0
# Variável que armazena o último id dos títulos originais.
self.idSource = 0
# Variável que armazena o último id do radical a ser adicionado.
self.idStem = 0
def getIdWord(self):
return self.idWord
def getIdWordHasTxt(self):
return self.idwordHasTxt
def getIdSource(self):
return self.idSource
def getIdStem(self):
return self.idStem;
def incrementIdWord(self):
self.idWord = self.idWord + 1
def incrementIdWordHasTxt(self):
self.idwordHasTxt = self.idwordHasTxt + 1
def incrementIdSource(self):
self.idSource = self.idSource + 1
def incrementIdStem(self):
self.idStem = self.idStem + 1 | 25.477273 | 143 | 0.742194 | 156 | 1,121 | 5.307692 | 0.487179 | 0.05314 | 0.091787 | 0.096618 | 0.14372 | 0.14372 | 0.109903 | 0.074879 | 0 | 0 | 0 | 0.018418 | 0.176628 | 1,121 | 44 | 144 | 25.477273 | 0.878657 | 0.456735 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.409091 | false | 0 | 0 | 0.181818 | 0.636364 | 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 |
99f3c397e2ceb24adfe2a47d369c5bea4a24c225 | 2,213 | py | Python | postGIS_tools/routines/back_up_entire_machine.py | AltaPlanning/postGIS-tools | c39957d8eda0b67a34c46f629bb5dea1b65085d7 | [
"MIT"
] | 4 | 2020-06-25T17:18:28.000Z | 2020-08-28T15:43:29.000Z | postGIS_tools/routines/back_up_entire_machine.py | AltaPlanning/postGIS-tools | c39957d8eda0b67a34c46f629bb5dea1b65085d7 | [
"MIT"
] | null | null | null | postGIS_tools/routines/back_up_entire_machine.py | AltaPlanning/postGIS-tools | c39957d8eda0b67a34c46f629bb5dea1b65085d7 | [
"MIT"
] | 2 | 2019-10-09T04:29:34.000Z | 2019-11-18T02:37:04.000Z | """
TODO: docstrings all across file
Examples
--------
>>> from postGIS_tools.configurations import get_postGIS_config, USER_DESKTOP
>>> config, _ = get_postGIS_config()
>>> config["localhost"]["debug"] = True
>>> back_up_all_databases(USER_DESKTOP, **config["localhost"])
>>> remove_all_databases(databases_to_keep=["aaron", "postgres"], **config["localhost"])
"""
import psycopg2
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
import postGIS_tools as pGIS
from postGIS_tools.constants import PG_PASSWORD
def back_up_all_databases(
backup_folder: str,
host: str = 'localhost',
username: str = 'postgres',
password: str = PG_PASSWORD,
port: int = 5432,
debug: bool = True
):
""" Save each database to file """
config = {'host': host, 'username': username, 'password': password, 'port': port, 'debug': debug}
for database in pGIS.get_database_list(**config):
pGIS.dump_database_to_sql_file(database, backup_folder, **config)
def remove_all_databases(
databases_to_keep: list = ["postgres"],
host: str = 'localhost',
username: str = 'postgres',
password: str = PG_PASSWORD,
port: int = 5432,
debug: bool = True
):
""" DROP each database that's not in the list of databases_to_keep """
config = {'host': host, 'username': username, 'password': password, 'port': port, 'debug': debug}
for db_name in pGIS.get_database_list(**config):
if db_name not in databases_to_keep:
query = f"DROP DATABASE {db_name}"
if debug:
print(query)
connection = psycopg2.connect(dbname='postgres',
user='postgres',
host=host,
password=password)
connection.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
cursor = connection.cursor()
cursor.execute(query)
cursor.close()
connection.commit()
connection.close()
if __name__ == "__main__":
pass
# remove_all_databases(["postgres", "aaron"])
| 28.012658 | 101 | 0.601446 | 236 | 2,213 | 5.385593 | 0.322034 | 0.047207 | 0.047207 | 0.028324 | 0.325728 | 0.325728 | 0.231314 | 0.231314 | 0.231314 | 0.231314 | 0 | 0.006923 | 0.28197 | 2,213 | 78 | 102 | 28.371795 | 0.792952 | 0.234071 | 0 | 0.341463 | 0 | 0 | 0.087814 | 0 | 0 | 0 | 0 | 0.012821 | 0 | 1 | 0.04878 | false | 0.170732 | 0.097561 | 0 | 0.146341 | 0.02439 | 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 |
99fa473f028db4963001c16010e34535fd4e4605 | 8,157 | py | Python | tests/test_paginated_list.py | eriktews/canvasapi | 132146395ecf55227cae69dc4d5f6d94545172b9 | [
"MIT"
] | null | null | null | tests/test_paginated_list.py | eriktews/canvasapi | 132146395ecf55227cae69dc4d5f6d94545172b9 | [
"MIT"
] | null | null | null | tests/test_paginated_list.py | eriktews/canvasapi | 132146395ecf55227cae69dc4d5f6d94545172b9 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
import requests_mock
from canvasapi import Canvas
from canvasapi.enrollment_term import EnrollmentTerm
from canvasapi.paginated_list import PaginatedList
from canvasapi.user import User
from tests import settings
from tests.util import register_uris
@requests_mock.Mocker()
class TestPaginatedList(unittest.TestCase):
def setUp(self):
self.canvas = Canvas(settings.BASE_URL, settings.API_KEY)
self.requester = self.canvas._Canvas__requester
# various length lists
def test_paginated_list_empty(self, m):
register_uris({"paginated_list": ["empty"]}, m)
pag_list = PaginatedList(User, self.requester, "GET", "empty_list")
item_list = [item for item in pag_list]
self.assertEqual(len(item_list), 0)
def test_paginated_list_single(self, m):
register_uris({"paginated_list": ["single"]}, m)
pag_list = PaginatedList(User, self.requester, "GET", "single_item")
item_list = [item for item in pag_list]
self.assertEqual(len(item_list), 1)
self.assertIsInstance(item_list[0], User)
def test_paginated_list_two_one_page(self, m):
register_uris({"paginated_list": ["2_1_page"]}, m)
pag_list = PaginatedList(User, self.requester, "GET", "two_objects_one_page")
item_list = [item for item in pag_list]
self.assertEqual(len(item_list), 2)
self.assertIsInstance(item_list[0], User)
def test_paginated_list_four_two_pages(self, m):
register_uris({"paginated_list": ["4_2_pages_p1", "4_2_pages_p2"]}, m)
pag_list = PaginatedList(User, self.requester, "GET", "four_objects_two_pages")
item_list = [item for item in pag_list]
self.assertEqual(len(item_list), 4)
self.assertIsInstance(item_list[0], User)
def test_paginated_list_six_three_pages(self, m):
requires = {"paginated_list": ["6_3_pages_p1", "6_3_pages_p2", "6_3_pages_p3"]}
register_uris(requires, m)
pag_list = PaginatedList(User, self.requester, "GET", "six_objects_three_pages")
item_list = [item for item in pag_list]
self.assertEqual(len(item_list), 6)
self.assertIsInstance(item_list[0], User)
# reusing iterator
def test_iterator(self, m):
requires = {"paginated_list": ["6_3_pages_p1", "6_3_pages_p2", "6_3_pages_p3"]}
register_uris(requires, m)
pag_list = PaginatedList(User, self.requester, "GET", "six_objects_three_pages")
list_1 = [item for item in pag_list]
list_2 = [item for item in pag_list]
self.assertEqual(list_1, list_2)
# get item
def test_getitem_first(self, m):
requires = {"paginated_list": ["6_3_pages_p1", "6_3_pages_p2", "6_3_pages_p3"]}
register_uris(requires, m)
pag_list = PaginatedList(User, self.requester, "GET", "six_objects_three_pages")
first_item = pag_list[0]
self.assertIsInstance(first_item, User)
def test_getitem_second_page(self, m):
requires = {"paginated_list": ["6_3_pages_p1", "6_3_pages_p2", "6_3_pages_p3"]}
register_uris(requires, m)
pag_list = PaginatedList(User, self.requester, "GET", "six_objects_three_pages")
third_item = pag_list[2]
self.assertIsInstance(third_item, User)
# slicing
def test_slice_beginning(self, m):
requires = {"paginated_list": ["6_3_pages_p1", "6_3_pages_p2", "6_3_pages_p3"]}
register_uris(requires, m)
pag_list = PaginatedList(User, self.requester, "GET", "six_objects_three_pages")
first_two_items = pag_list[:2]
item_list = [item for item in first_two_items]
self.assertEqual(len(item_list), 2)
self.assertIsInstance(item_list[0], User)
self.assertTrue(hasattr(item_list[0], "id"))
self.assertEqual(item_list[0].id, "1")
def test_slice_middle(self, m):
requires = {"paginated_list": ["6_3_pages_p1", "6_3_pages_p2", "6_3_pages_p3"]}
register_uris(requires, m)
pag_list = PaginatedList(User, self.requester, "GET", "six_objects_three_pages")
middle_two_items = pag_list[2:4]
item_list = [item for item in middle_two_items]
self.assertEqual(len(item_list), 2)
self.assertIsInstance(item_list[0], User)
self.assertTrue(hasattr(item_list[0], "id"))
self.assertEqual(item_list[0].id, "3")
def test_slice_end(self, m):
requires = {"paginated_list": ["6_3_pages_p1", "6_3_pages_p2", "6_3_pages_p3"]}
register_uris(requires, m)
pag_list = PaginatedList(User, self.requester, "GET", "six_objects_three_pages")
middle_two_items = pag_list[4:6]
item_list = [item for item in middle_two_items]
self.assertEqual(len(item_list), 2)
self.assertIsInstance(item_list[0], User)
self.assertTrue(hasattr(item_list[0], "id"))
self.assertEqual(item_list[0].id, "5")
def test_slice_oversize(self, m):
requires = {"paginated_list": ["4_2_pages_p1", "4_2_pages_p2"]}
register_uris(requires, m)
pag_list = PaginatedList(User, self.requester, "GET", "four_objects_two_pages")
oversized_slice = pag_list[0:10]
item_list = [item for item in oversized_slice]
self.assertEqual(len(item_list), 4)
def test_slice_out_of_bounds(self, m):
requires = {"paginated_list": ["4_2_pages_p1", "4_2_pages_p2"]}
register_uris(requires, m)
pag_list = PaginatedList(User, self.requester, "GET", "four_objects_two_pages")
out_of_bounds = pag_list[4:5]
item_list = [item for item in out_of_bounds]
self.assertEqual(len(item_list), 0)
# __repr__()
def test_repr(self, m):
requires = {"paginated_list": ["6_3_pages_p1", "6_3_pages_p2", "6_3_pages_p3"]}
register_uris(requires, m)
pag_list = PaginatedList(User, self.requester, "GET", "six_objects_three_pages")
self.assertEqual(pag_list.__repr__(), "<PaginatedList of type User>")
def test_root_element_incorrect(self, m):
register_uris({"account": ["get_enrollment_terms"]}, m)
pag_list = PaginatedList(
EnrollmentTerm, self.requester, "GET", "accounts/1/terms", _root="wrong"
)
with self.assertRaises(ValueError):
pag_list[0]
def test_root_element(self, m):
register_uris({"account": ["get_enrollment_terms"]}, m)
pag_list = PaginatedList(
EnrollmentTerm,
self.requester,
"GET",
"accounts/1/terms",
_root="enrollment_terms",
)
self.assertIsInstance(pag_list[0], EnrollmentTerm)
def test_negative_index(self, m):
# Regression test for https://github.com/ucfopen/canvasapi/issues/305
# Ensure that we can't use negative indexing, even after loading a page
register_uris({"paginated_list": ["4_2_pages_p1", "4_2_pages_p2"]}, m)
pag_list = PaginatedList(User, self.requester, "GET", "four_objects_two_pages")
pag_list[0]
with self.assertRaises(IndexError):
pag_list[-1]
def test_negative_index_for_slice_start(self, m):
# Regression test for https://github.com/ucfopen/canvasapi/issues/305
# Ensure that we can't slice using a negative index as the start item
register_uris({"paginated_list": ["4_2_pages_p1", "4_2_pages_p2"]}, m)
pag_list = PaginatedList(User, self.requester, "GET", "four_objects_two_pages")
pag_list[0]
with self.assertRaises(IndexError):
pag_list[-1:1]
def test_negative_index_for_slice_end(self, m):
# Regression test for https://github.com/ucfopen/canvasapi/issues/305
# Ensure that we can't slice using a negative index as the end item
register_uris({"paginated_list": ["4_2_pages_p1", "4_2_pages_p2"]}, m)
pag_list = PaginatedList(User, self.requester, "GET", "four_objects_two_pages")
pag_list[0]
with self.assertRaises(IndexError):
pag_list[:-1]
| 39.597087 | 88 | 0.668751 | 1,116 | 8,157 | 4.544803 | 0.116487 | 0.057965 | 0.033123 | 0.078667 | 0.749606 | 0.746254 | 0.693612 | 0.682374 | 0.651222 | 0.651222 | 0 | 0.026825 | 0.213927 | 8,157 | 205 | 89 | 39.790244 | 0.764192 | 0.057987 | 0 | 0.503401 | 0 | 0 | 0.162539 | 0.041189 | 0 | 0 | 0 | 0 | 0.217687 | 1 | 0.136054 | false | 0 | 0.061224 | 0 | 0.204082 | 0.006803 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
8200cf491a16b60f3e40c5f160051d1422366337 | 1,008 | py | Python | src/dice_stats/_magic/mapping.py | sponsfreixes/dice_stats | 47e4909ffca896121a15aedef06c7fae8533bd06 | [
"MIT"
] | 2 | 2020-03-11T04:20:52.000Z | 2020-03-11T16:53:48.000Z | src/dice_stats/_magic/mapping.py | sponsfreixes/dice_stats | 47e4909ffca896121a15aedef06c7fae8533bd06 | [
"MIT"
] | 5 | 2020-03-11T04:29:56.000Z | 2020-03-15T00:50:18.000Z | src/dice_stats/_magic/mapping.py | sponsfreixes/dice_stats | 47e4909ffca896121a15aedef06c7fae8533bd06 | [
"MIT"
] | 2 | 2020-03-11T05:23:22.000Z | 2022-02-18T00:06:40.000Z | """
Mapping interface.
Code to make Dice implement an immutable mapping interface.
This interface helps to keep code that uses dice Pythonic as they can
use standard methods, and it the immutability helps make all the code
simpler to use as we don't need to think about mutability.
"""
from __future__ import annotations
import fractions
from typing import Iterator, Mapping
from .._types import TChancesChance, TChancesValue
from .base_dice import BaseDice
class MappingDice(BaseDice, Mapping[TChancesValue, TChancesChance]):
"""Mapping mixin."""
def __getitem__(self, item: TChancesValue) -> fractions.Fraction:
"""Get :ref:`ds-t-Chances Chance`."""
return self._chances.__getitem__(item) * self._total_chance
def __iter__(self) -> Iterator[TChancesValue]:
"""Get all :ref:`ds-t-Chances Value`."""
return self._chances.__iter__()
def __len__(self) -> int:
"""Count of all :ref:`ds-t-Chances Value`."""
return self._chances.__len__()
| 30.545455 | 69 | 0.717262 | 130 | 1,008 | 5.292308 | 0.515385 | 0.021802 | 0.026163 | 0.056686 | 0.110465 | 0.110465 | 0.110465 | 0.110465 | 0.110465 | 0 | 0 | 0 | 0.180556 | 1,008 | 32 | 70 | 31.5 | 0.83293 | 0.396825 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.416667 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
8217b4796812f86fa895263899add1b8a9eec667 | 1,737 | py | Python | accounts/views.py | omid-taj/Deepfake-Detection-Website | 8ba5cb5dda05df884a25120e7b2faffe900ca251 | [
"MIT"
] | 1 | 2021-08-01T00:17:56.000Z | 2021-08-01T00:17:56.000Z | accounts/views.py | omid-taj/Deepfake-Detection-Website | 8ba5cb5dda05df884a25120e7b2faffe900ca251 | [
"MIT"
] | 8 | 2021-03-30T13:17:39.000Z | 2022-03-12T00:28:19.000Z | accounts/views.py | omid-taj/Deepfake-Detection-Website | 8ba5cb5dda05df884a25120e7b2faffe900ca251 | [
"MIT"
] | null | null | null | from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from django.shortcuts import render, redirect
from django.contrib.auth import login as auth_login
from django.contrib.auth import logout as auth_logout
# Create your views here.
from django.views.generic import View
class SignupView(View):
def get(self, request):
return render(request, 'signup.html', {'user_exist': False})
def post(self, request):
username = request.POST['username']
email = request.POST['email']
password = request.POST['password']
try:
user = User.objects.create_user(username=username, email=email, password=password)
except:
return render(request, 'signup.html', {'user_exist': True})
auth_login(request, user=user)
print(username, 'loged in')
return redirect('home')
class LoginView(View):
def get(self, request):
return render(request, 'login.html', {'check_pass': False})
def post(self, request):
username = request.POST['username']
password = request.POST['password']
try:
user = User.objects.get(username=username)
if user.check_password(password):
auth_login(request, user=user)
print(username, 'loged in')
return redirect('home')
else:
return render(request, 'login.html', {'check_pass': True})
except:
return render(request, 'login.html', {'check_pass': True})
class LogoutView(LoginRequiredMixin, View):
def get(self, request):
auth_logout(request)
return render(request, 'login.html', {'check_pass': False}) | 33.403846 | 94 | 0.639609 | 200 | 1,737 | 5.49 | 0.25 | 0.054645 | 0.103825 | 0.076503 | 0.614754 | 0.546448 | 0.546448 | 0.494536 | 0.288707 | 0.112933 | 0 | 0 | 0.244675 | 1,737 | 52 | 95 | 33.403846 | 0.83689 | 0.013241 | 0 | 0.575 | 0 | 0 | 0.10683 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0.2 | 0.15 | 0.05 | 0.55 | 0.05 | 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 |
82353c7059ffa3a5062b9787ddbc7ad62b5ef466 | 284 | py | Python | classes_and_testsTest/DocumentationFromUnitTestsTestData/DataSet1_py_ClassFile.py | anconaesselmann/LiveUnit | 8edebb49cb02fa898550cbafdf87af7fc22f106b | [
"MIT"
] | null | null | null | classes_and_testsTest/DocumentationFromUnitTestsTestData/DataSet1_py_ClassFile.py | anconaesselmann/LiveUnit | 8edebb49cb02fa898550cbafdf87af7fc22f106b | [
"MIT"
] | null | null | null | classes_and_testsTest/DocumentationFromUnitTestsTestData/DataSet1_py_ClassFile.py | anconaesselmann/LiveUnit | 8edebb49cb02fa898550cbafdf87af7fc22f106b | [
"MIT"
] | null | null | null | class DataClassFile():
def functionName1(self):
""" One Function (without parameters) with one test function (with single line comments)
where the documentation had not been generated.
"""
say = "say"
fu = "fu"
return say + " " + fu | 35.5 | 96 | 0.591549 | 31 | 284 | 5.419355 | 0.774194 | 0.059524 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005128 | 0.31338 | 284 | 8 | 97 | 35.5 | 0.85641 | 0.464789 | 0 | 0 | 0 | 0 | 0.046512 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.6 | 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 | 0 | 0 | 1 | 0 | 0 | 2 |
823e899aecf5881c99e791fd7099ceb1404c2f55 | 418 | py | Python | tests/test_api.py | pinntech/pinn-python | d7d3f2d2a4cdc3eb01ae85a117c0e3d8bc1732bd | [
"MIT"
] | 2 | 2019-03-29T17:36:44.000Z | 2021-11-20T00:05:04.000Z | tests/test_api.py | pinntech/pinn-python | d7d3f2d2a4cdc3eb01ae85a117c0e3d8bc1732bd | [
"MIT"
] | 4 | 2020-03-24T16:52:29.000Z | 2021-06-01T23:36:18.000Z | tests/test_api.py | pinntech/pinn-python | d7d3f2d2a4cdc3eb01ae85a117c0e3d8bc1732bd | [
"MIT"
] | 1 | 2021-11-20T00:05:07.000Z | 2021-11-20T00:05:07.000Z | """
:copyright: (c) 2019 Pinn Technologies, Inc.
:license: MIT
"""
def test_import():
import pinn
def test_configuration_error():
import pinn
try:
pinn.User.create()
except pinn.errors.ConfigurationError:
pass
def test_authentication_error():
import pinn
pinn.secret_key = 'foo'
try:
pinn.User.create()
except pinn.errors.AuthenticationError:
pass
| 16.076923 | 44 | 0.645933 | 47 | 418 | 5.617021 | 0.531915 | 0.079545 | 0.113636 | 0.128788 | 0.25 | 0.25 | 0.25 | 0 | 0 | 0 | 0 | 0.01278 | 0.251196 | 418 | 25 | 45 | 16.72 | 0.830671 | 0.138756 | 0 | 0.6 | 0 | 0 | 0.008523 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0.133333 | 0.266667 | 0 | 0.466667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
412e7307ec9dcf65ea18ba353869dbba281732f1 | 806 | py | Python | tests/core/actions/list_task_statuses/test_list_task_statuses_request.py | Himon-SYNCRAFT/taskplus | 9e6293840941d0cb4fd7bac0f8ff66f8e72cc62b | [
"BSD-3-Clause"
] | null | null | null | tests/core/actions/list_task_statuses/test_list_task_statuses_request.py | Himon-SYNCRAFT/taskplus | 9e6293840941d0cb4fd7bac0f8ff66f8e72cc62b | [
"BSD-3-Clause"
] | null | null | null | tests/core/actions/list_task_statuses/test_list_task_statuses_request.py | Himon-SYNCRAFT/taskplus | 9e6293840941d0cb4fd7bac0f8ff66f8e72cc62b | [
"BSD-3-Clause"
] | null | null | null | from taskplus.core.actions import ListTaskStatusesRequest
def test_list_user_roles_request_without_parameters():
request = ListTaskStatusesRequest()
assert request.filters is None
assert request.is_valid() is True
def test_list_user_roles_request_with_empty_filters():
request = ListTaskStatusesRequest(filters={})
assert request.filters is None
assert request.is_valid() is True
def test_list_user_roles_request_with_filters():
request = ListTaskStatusesRequest(filters={'a': 1, 'b': 2})
assert request.filters == {'a': 1, 'b': 2}
assert request.is_valid() is True
def test_list_user_roles_request_invalid_filters():
request = ListTaskStatusesRequest(filters=5)
assert request.is_valid() is False
assert request.errors[0].parameter == 'filters'
| 26.866667 | 63 | 0.756824 | 102 | 806 | 5.696078 | 0.313725 | 0.179002 | 0.075732 | 0.10327 | 0.521515 | 0.483649 | 0.437177 | 0.376936 | 0.376936 | 0.376936 | 0 | 0.008772 | 0.151365 | 806 | 29 | 64 | 27.793103 | 0.840643 | 0 | 0 | 0.294118 | 0 | 0 | 0.013648 | 0 | 0 | 0 | 0 | 0 | 0.470588 | 1 | 0.235294 | false | 0 | 0.058824 | 0 | 0.294118 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4146a11ae36e37d979012bdedf5e4d1627d1f3bf | 682 | py | Python | pipelines/h1c/idr2/v1/bad_ants/H1C_IDR2_bad_ants.py | HERA-Team/hera_pipelines | d2b46bb494dfb020093b807445fc2095d292e898 | [
"BSD-2-Clause"
] | null | null | null | pipelines/h1c/idr2/v1/bad_ants/H1C_IDR2_bad_ants.py | HERA-Team/hera_pipelines | d2b46bb494dfb020093b807445fc2095d292e898 | [
"BSD-2-Clause"
] | 9 | 2020-08-14T18:11:40.000Z | 2022-03-18T17:38:03.000Z | pipelines/h1c/idr2/v1/bad_ants/H1C_IDR2_bad_ants.py | HERA-Team/hera_pipelines | d2b46bb494dfb020093b807445fc2095d292e898 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""Script for producing bad_ants text files."""
JDs = [
2458098,
2458099,
2458101,
2458102,
2458103,
2458104,
2458105,
2458106,
2458107,
2458108,
2458109,
2458110,
2458111,
2458112,
2458113,
2458114,
2458115,
2458116,
2458140,
]
always_flagged = [0, 2, 50, 98, 136]
for JD in JDs:
flagged = set(always_flagged)
if JD == 2458114:
flagged.add(11)
if JD == 2458140:
flagged.add(68)
flagged.add(104)
flagged.add(117)
with open(str(JD) + ".txt", "w") as f:
for bad_ant in sorted(flagged):
f.write(str(bad_ant) + "\n")
| 17.487179 | 47 | 0.552786 | 84 | 682 | 4.428571 | 0.690476 | 0.107527 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.357759 | 0.319648 | 682 | 38 | 48 | 17.947368 | 0.443966 | 0.090909 | 0 | 0 | 0 | 0 | 0.011401 | 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 | 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 |
4174c16b7b44a20c364180859943cecb67d2ec6d | 447 | py | Python | TWLight/applications/factories.py | jajodiaraghav/TWLight | 22359ab0b95ee3653e8ffa0eb698acd7bb8ebf70 | [
"MIT"
] | 1 | 2019-10-24T04:49:52.000Z | 2019-10-24T04:49:52.000Z | TWLight/applications/factories.py | jajodiaraghav/TWLight | 22359ab0b95ee3653e8ffa0eb698acd7bb8ebf70 | [
"MIT"
] | 1 | 2019-03-29T15:29:45.000Z | 2019-03-29T15:57:20.000Z | TWLight/applications/factories.py | jajodiaraghav/TWLight | 22359ab0b95ee3653e8ffa0eb698acd7bb8ebf70 | [
"MIT"
] | 1 | 2019-09-26T14:40:27.000Z | 2019-09-26T14:40:27.000Z | # -*- coding: utf-8 -*-
import factory
from TWLight.resources.factories import PartnerFactory
from TWLight.users.factories import EditorFactory
from TWLight.applications.models import Application
class ApplicationFactory(factory.django.DjangoModelFactory):
class Meta:
model = Application
strategy = factory.CREATE_STRATEGY
editor = factory.SubFactory(EditorFactory)
partner = factory.SubFactory(PartnerFactory)
| 23.526316 | 60 | 0.771812 | 44 | 447 | 7.818182 | 0.590909 | 0.09593 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002653 | 0.1566 | 447 | 18 | 61 | 24.833333 | 0.909814 | 0.04698 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 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 | 1 | 0 | 1 | 0 | 0 | 2 |
417b57d9a12833b40b6e93faf3fe1e15baea9076 | 143 | py | Python | dcm_anon/__main__.py | LilMit/pl-dcm_anon | 084d3f902f8dae32c4ba3a1ec979ef278186062f | [
"MIT"
] | null | null | null | dcm_anon/__main__.py | LilMit/pl-dcm_anon | 084d3f902f8dae32c4ba3a1ec979ef278186062f | [
"MIT"
] | null | null | null | dcm_anon/__main__.py | LilMit/pl-dcm_anon | 084d3f902f8dae32c4ba3a1ec979ef278186062f | [
"MIT"
] | null | null | null | from dcm_anon.dcm_anon import dcm_anon
def main():
chris_app = dcm_anon()
chris_app.launch()
if __name__ == "__main__":
main()
| 13 | 38 | 0.664336 | 21 | 143 | 3.857143 | 0.52381 | 0.345679 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.216783 | 143 | 10 | 39 | 14.3 | 0.723214 | 0 | 0 | 0 | 0 | 0 | 0.055944 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.333333 | 0 | 1 | 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 | 0 | 0 | 0 | 2 |
417e4e14a59f787a0882eb60937548a0683d9e66 | 299 | py | Python | app/resources/users/resources/__init__.py | admiralobvious/falcon-boilerplate | eb076ff9e1d6fb1e537b18f86d2228afbf123e19 | [
"MIT"
] | 34 | 2016-10-26T17:19:23.000Z | 2020-04-30T09:12:34.000Z | app/resources/users/resources/__init__.py | admiralobvious/falcon-boilerplate | eb076ff9e1d6fb1e537b18f86d2228afbf123e19 | [
"MIT"
] | 2 | 2019-04-09T11:50:38.000Z | 2019-07-05T03:31:57.000Z | app/resources/users/resources/__init__.py | admiralobvious/falcon-boilerplate | eb076ff9e1d6fb1e537b18f86d2228afbf123e19 | [
"MIT"
] | 12 | 2017-01-14T09:40:24.000Z | 2020-04-16T07:40:56.000Z | import falcon
from app.data.db import setup
from .user import User, UserSchema
from .users import Users
def get_routes(app: falcon.App):
db = setup()
app.add_route("/users", Users(db))
app.add_route("/users/{user_id}", User(db))
app.add_route("/user.schema.json", UserSchema())
| 19.933333 | 52 | 0.688963 | 46 | 299 | 4.369565 | 0.391304 | 0.089552 | 0.164179 | 0.159204 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.160535 | 299 | 14 | 53 | 21.357143 | 0.800797 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.444444 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
41862d17d86e2df373c597564852dbddf775109e | 1,567 | py | Python | tensorflow/python/data/experimental/ops/take_while_ops.py | ashutom/tensorflow-upstream | c16069c19de9e286dd664abb78d0ea421e9f32d4 | [
"Apache-2.0"
] | 8 | 2021-08-03T03:57:10.000Z | 2021-12-13T01:19:02.000Z | tensorflow/python/data/experimental/ops/take_while_ops.py | CaptainGizzy21/tensorflow | 3457a2b122e50b4d44ceaaed5a663d635e5c22df | [
"Apache-2.0"
] | 17 | 2021-08-12T19:38:42.000Z | 2022-01-27T14:39:35.000Z | tensorflow/python/data/experimental/ops/take_while_ops.py | CaptainGizzy21/tensorflow | 3457a2b122e50b4d44ceaaed5a663d635e5c22df | [
"Apache-2.0"
] | 4 | 2022-01-13T11:23:44.000Z | 2022-03-02T11:11:42.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""take-while dataset transformation."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.util import deprecation
from tensorflow.python.util.tf_export import tf_export
@deprecation.deprecated(None, "Use `tf.data.Dataset.take_while(...)")
@tf_export("data.experimental.take_while")
def take_while(predicate):
"""A transformation that stops dataset iteration based on a `predicate`.
Args:
predicate: A function that maps a nested structure of tensors (having shapes
and types defined by `self.output_shapes` and `self.output_types`) to a
scalar `tf.bool` tensor.
Returns:
A `Dataset` transformation function, which can be passed to
`tf.data.Dataset.apply`.
"""
def _apply_fn(dataset):
return dataset.take_while(predicate=predicate)
return _apply_fn
| 36.44186 | 80 | 0.724952 | 213 | 1,567 | 5.206573 | 0.535211 | 0.054103 | 0.043282 | 0.028855 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006002 | 0.14933 | 1,567 | 42 | 81 | 37.309524 | 0.825956 | 0.673899 | 0 | 0 | 0 | 0 | 0.13617 | 0.12766 | 0 | 0 | 0 | 0 | 0 | 1 | 0.181818 | false | 0 | 0.454545 | 0.090909 | 0.818182 | 0.090909 | 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 |
4187de5950df159828a7772938f462e9332f2e53 | 526 | py | Python | ustack_etl/mongo.py | ustudio/ustack-etl | ae0c3104178109cd12ca395122ab12aae72e365a | [
"MIT"
] | 1 | 2019-06-28T16:09:09.000Z | 2019-06-28T16:09:09.000Z | ustack_etl/mongo.py | ustudio/ustack-etl | ae0c3104178109cd12ca395122ab12aae72e365a | [
"MIT"
] | null | null | null | ustack_etl/mongo.py | ustudio/ustack-etl | ae0c3104178109cd12ca395122ab12aae72e365a | [
"MIT"
] | null | null | null | import logging
def etl_collection(mongo_db, collection_name, fn):
documents = mongo_db[collection_name].find()
count = mongo_db[collection_name].count_documents({})
logging.info(
f"Processing {count} documents in collection "
f"'{collection_name}'")
for document in documents:
try:
fn(document)
except Exception:
logging.exception(
"Error processing document in collection "
f"'{collection_name}': {document['_id']}")
| 27.684211 | 58 | 0.619772 | 55 | 526 | 5.727273 | 0.418182 | 0.222222 | 0.161905 | 0.2 | 0.171429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.275665 | 526 | 18 | 59 | 29.222222 | 0.826772 | 0 | 0 | 0 | 0 | 0 | 0.26616 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0 | 0.071429 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
418f86a801fe05cec1886299103a277fc6c78c68 | 30,694 | py | Python | plot_results.py | freedmanlab/Context-Dependent-Gating | 14c6ba0f9ab840a43e236e6a7ca536cc97240ffc | [
"Apache-2.0"
] | null | null | null | plot_results.py | freedmanlab/Context-Dependent-Gating | 14c6ba0f9ab840a43e236e6a7ca536cc97240ffc | [
"Apache-2.0"
] | null | null | null | plot_results.py | freedmanlab/Context-Dependent-Gating | 14c6ba0f9ab840a43e236e6a7ca536cc97240ffc | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import pickle
import os
import matplotlib
from itertools import product
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
plt.rcParams["font.family"] = "arial"
def plot_fig2_new():
#savedir = './savedir/mnist/'
savedir = '/media/masse/MySSDataStor1/Context-Dependent Gating/Final MNIST/'
savedir1 = '/media/masse/MySSDataStor1/Context-Dependent Gating/Final MNIST/'
all_same_scale = True
f, ax1 = plt.subplots(1,1,figsize=(4,2.5))
accuracy = {}
ylim_min = 0.6
# Figure 2A
# Plotting: SI, EWC, base
# No dropout on input layer
base = 'mnist_no_stabilization'
EWC = 'mnist_EWC'
SI = 'mnist_SI'
XdG = 'mnist_nostab'
#SI= 'neurons_InpDO_mnist_SI'
b1 = plot_best_result(ax1, savedir + 'Baseline/', base, col=[0,0,0], label='Base')
b2 = plot_best_result(ax1, savedir + 'EWC Fixed/', EWC, col=[0,1,0], label='EWC')
b3 = plot_best_result(ax1, savedir + 'SI/', SI, col=[1,0,1], label='SI')
b4 = plot_best_result(ax1, savedir + 'XdG/', XdG, col=[0,0,0], label='XdG',linestyle='--')
SI_TD = 'neurons_InpDO_mnist_SI'
EWC_TD = 'neurons_InpDO_mnist_EWC'
b5 = plot_best_result(ax1, savedir + 'SI XdG/', SI_TD, col=[1,0,1], label='SI+XdG',linestyle='--')
b6 = plot_best_result(ax1, savedir + 'EWC XdG/', EWC_TD, col=[0,1,0], label='EWC+XdG',linestyle='--')
accuracy['base'] = b1
accuracy['EWC'] = b2
accuracy['SI'] = b3
accuracy['XdG'] = b4
accuracy['SI_XdG'] = b5
accuracy['EWC_XdG'] = b6
ax1.legend(ncol=3, fontsize=9)
ax1.grid(True)
ax1.set_xlim(0,100)
add_subplot_details(ax1, [ylim_min,1],[0,100],[])
plt.tight_layout()
plt.savefig('Figure2.pdf', format='pdf')
plt.show()
f, (ax1, ax2) = plt.subplots(2,1,figsize=(4,6))
ylim_min = 0.85
b5 = plot_best_result(ax1, savedir + 'SI XdG/', SI_TD, col=[1,0,1], label='SI+XdG',linestyle='--')
b6 = plot_best_result(ax1, savedir + 'EWC XdG/', EWC_TD, col=[0,1,0], label='EWC+XdG',linestyle='--')
SI_TDP = 'mnist_SI_rule'
EWC_TDP = 'mnist_EWC_rule'
b1 = plot_best_result(ax1, savedir + 'SI Rule/', SI_TDP, col=[1,0,1], label='SI+Partial')
b3 = plot_best_result(ax1, savedir + 'EWC Rule/', EWC_TDP, col=[0,1,0], label='EWC+Partial')
accuracy['SI_Rule'] = b1
accuracy['EWC_Rule'] = b3
SI_TDPS = 'mnist_SI_split_rule'
EWC_TDPS = 'mnist_EWC_rule_split'
b2 = plot_best_result(ax2, savedir + 'SI Rule Split/', SI_TDPS, col=[1,0,1], label='Split SIRule')
b4 = plot_best_result(ax2, savedir + 'EWC Rule Split/', EWC_TDPS, col=[0,1,0],label='Split EWC+Rule')
b5 = plot_best_result(ax2, savedir + 'SI XdG/', SI_TD, col=[1,0,1], label='SI+XdG',linestyle='--')
b6 = plot_best_result(ax2, savedir + 'EWC XdG/', EWC_TD, col=[0,1,0], label='EWC+XdG',linestyle='--')
accuracy['SI_Rule_Split'] = b1
accuracy['EWC_Rule_Split'] = b4
ax1.legend(ncol=3, fontsize=9)
ax1.grid(True)
ax1.set_xlim(0,100)
add_subplot_details(ax1, [ylim_min,1],[0,100],[])
ax2.legend(ncol=3, fontsize=9)
ax2.grid(True)
ax2.set_xlim(0,100)
add_subplot_details(ax2, [ylim_min,1],[0,100],[])
plt.tight_layout()
plt.savefig('Figure2_control.pdf', format='pdf')
plt.show()
"""
# Figure 2B
# Plotting: SI+TD Partial, SI, EWC+TD Partial, EWC
# No dropout on input layer
b2 = plot_best_result(ax2, savedir + 'SI/', SI, col=[1,0,1], label='SI')
b4 = plot_best_result(ax2, savedir + 'EWC Fixed/', EWC, col=[0,1,0], label='EWC')
b1 = plot_best_result(ax2, savedir + 'SI Rule/', SI_TDP, col=[1,0,1], label='SI+Partial',linestyle='--')
b3 = plot_best_result(ax2, savedir + 'EWC Rule/', EWC_TDP, col=[0,1,0], label='EWC+Partial',linestyle='--')
accuracy['SI_Partial'] = b1
accuracy['EWC_Partial'] = b3
ax2.legend(ncol=2, fontsize=9)
ax2.grid(True)
ax2.set_xlim(0,100)
add_subplot_details(ax2, [ylim_min,1],[0,100],[])
# Figure 2C
# Plotting: SI+TD Partial Split, SI+TD Partial, EWC+TD Partial, EWC+TD Partial Split
# Dropout irrelevant?
SI_TDPS = 'mnist_SI_split_rule'
EWC_TDPS = 'split_InpDO_mnist_EWC'
b1 = plot_best_result(ax3, savedir + 'SI Rule/', SI_TDP, col=[1,0,1], label='SI+Partial',linestyle='--')
b3 = plot_best_result(ax3, savedir + 'EWC Rule/', EWC_TDP, col=[0,1,0], label='EWC+Partial',linestyle='--')
b2 = plot_best_result(ax3, savedir + 'SI Rule Split/', SI_TDPS, col=[1,0,1], label='Split SI+Partial')
b4 = plot_best_result(ax3, savedir + 'EWC Split/', EWC_TDPS, col=[0,1,0],label='Split EWC+Partial')
accuracy['SI_Split'] = b2
accuracy['EWC_Split'] = b4
ax3.legend(ncol=2, fontsize=9)
ax3.grid(True)
ax3.set_xlim(0,100)
add_subplot_details(ax3, [ylim_min,1],[0,100],[])
# Figure 2D
# Plotting: SI+TD Partial Split, SI+TD Full, EWC+TD Full, EWC+TD Partial Split
# Dropout irrelevant?
SI_TD = 'neurons_InpDO_mnist_SI'
EWC_TD = 'neurons_InpDO_mnist_EWC'
b2 = plot_best_result(ax4, savedir + 'SI Rule Split/', SI_TDPS, col=[1,0,1], label='Split SI++Partial')
b4 = plot_best_result(ax4, savedir + 'EWC Split/', EWC_TDPS, col=[0,1,0],label='Split EWC++Partial')
b1 = plot_best_result(ax4, savedir + 'SI XdG/', SI_TD, col=[1,0,1], label='SI+XdG',linestyle='--')
b3 = plot_best_result(ax4, savedir + 'EWC XdG/', EWC_TD, col=[0,1,0], label='EWC+XdG',linestyle='--')
accuracy['SI_XdG'] = b1
accuracy['EWC_XdG'] = b3
ax4.grid(True)
ax4.set_xlim(0,100)
add_subplot_details(ax4, [ylim_min,1],[0,100],[])
ax4.legend(ncol=2, fontsize=9)
"""
for k, v in accuracy.items():
print(k, ' = ', v)
def plot_RNN_fig():
savedir = '/home/masse/Short-term-plasticity-RNN/savedir/CL3/'
all_same_scale = True
f, ax1 = plt.subplots(1,1,figsize=(4,3))
# Figure 2A
# Plotting: SI, EWC, base
# No dropout on input layer
SI = 'RNN_CL_SI_short_h500_gating0'
SI_TD = 'RNN_CL_SI_short_h500_gating75'
b0 = plot_best_result(ax1, savedir, SI, col=[0,0,1], label='SI')
b1 = plot_best_result(ax1, savedir, SI_TD, col=[0,1,0], label='SI+TD Full')
print('A: ', b0 , b1)
ax1.legend(ncol=3, fontsize=9)
ax1.grid(True)
ax1.set_xlim(0,17)
add_subplot_details(ax1, [0.5,1],[0,25],[])
ax1.set_xticks([4,8,12,16,20,24])
plt.tight_layout()
plt.savefig('Figure_ONR.pdf', format='pdf')
plt.show()
def plot_ONR_fig1():
savedir = './savedir/mnist/'
all_same_scale = True
f, (ax1,ax2) = plt.subplots(2,1,figsize=(3,6))
# Figure 2A
# Plotting: SI, EWC, base
# No dropout on input layer
#base = 'mnist_no_stabilization'
EWC = 'mnist_EWC'
SI = 'mnist_SI'
SI_TD = 'neurons_InpDO_mnist_SI'
EWC_TD = 'neurons_InpDO_mnist_EWC'
b3 = plot_best_result(ax1, savedir, SI, col=[0,0,1], label='SI')
b2 = plot_best_result(ax1, savedir, EWC, col=[1,0,0], label='EWC')
b5 = plot_best_result(ax1, savedir, EWC_TD, col=[1,0,1], label='EWC+TD Full',linestyle='--')
b4 = plot_best_result(ax1, savedir, SI_TD, col=[0,1,0], label='SI+TD Full')
print('A: ', b2, b3, b4, b5)
ax1.legend(ncol=3, fontsize=9)
ax1.grid(True)
ax1.set_xlim(0,100)
add_subplot_details(ax1, [0.0,1],[0,100],[])
savedir = './savedir/cifar/'
#base = 'cifar_no_stabilization'
EWC = 'cifar_EWC'
SI = 'cifar_SI'
SI_TD = 'neurons_cifar_SI'
EWC_TD = 'neurons_cifar_EWC'
#b1 = plot_best_result(ax2, savedir, base, col=[0,0,0], label='base')
b2 = plot_best_result(ax2, savedir, EWC, col=[1,0,0], label='EWC')
b3 = plot_best_result(ax2, savedir, SI, col=[0,0,1], label='SI')
b4 = plot_best_result(ax2, savedir, SI_TD, col=[0,1,0], label='SI+TD Full')
b5 = plot_best_result(ax2, savedir, EWC_TD, col=[1,0,1], label='EWC+TD Full',linestyle='--')
print('B: ', b2, b3, b4, b5)
ax2.legend(ncol=3, fontsize=9)
ax2.grid(True)
add_subplot_details(ax2, ylim = [0,1], xlim = [0,20])
plt.tight_layout()
plt.savefig('Figure_ONR.pdf', format='pdf')
plt.show()
def plot_fig3():
savedir = './savedir/mnist/'
all_same_scale = True
f, ax1 = plt.subplots(1,1,figsize=(4,3))
accuracy = {}
# Figure 2A
# Plotting: SI, EWC, base
# No dropout on input layer
SI_5 = 'neurons_InpDO_mnist_SI'
SI_2 = 'neurons_InpDO_mnist_SI_1of2'
SI_3 = 'neurons_InpDO_mnist_SI_1of3'
SI_4 = 'neurons_InpDO_mnist_SI_1of4'
SI_6 = 'neurons_InpDO_mnist_SI_1of6'
#SI= 'neurons_InpDO_mnist_SI'
b1 = plot_best_result(ax1, savedir, SI_2, col=[1,0,0], label='SI_2')
b2 = plot_best_result(ax1, savedir, SI_3, col=[0,0,1], label='SI_3')
b3 = plot_best_result(ax1, savedir, SI_4, col=[0,1,0], label='SI_4')
b4 = plot_best_result(ax1, savedir, SI_5, col=[0,0,0], label='SI_5')
b5 = plot_best_result(ax1, savedir, SI_6, col=[1,0,1], label='SI_6')
accuracy['SI_2'] = b1
accuracy['SI_3'] = b2
accuracy['SI_4'] = b3
accuracy['SI_5'] = b4
accuracy['SI_6'] = b5
ax1.legend(ncol=3, fontsize=9)
ax1.grid(True)
ax1.set_xlim(0,500)
add_subplot_details(ax1, [0.9,1],[0,100],[])
plt.tight_layout()
plt.savefig('Figure3.pdf', format='pdf')
plt.show()
for k, v in accuracy.items():
print(k , ' = ', v)
def plot_fig4():
savedir = '/home/masse/Spin-TD-Network/savedir/mnist/500perms/'
all_same_scale = True
f, ax1 = plt.subplots(1,1,figsize=(4,3))
accuracy = {}
# Figure 2A
# Plotting: SI, EWC, base
# No dropout on input layer
SI = 'mnist_SI_500perms'
SI_XCG = 'neurons_InpDO_mnist_SI_500perms'
#SI= 'neurons_InpDO_mnist_SI'
b1 = plot_best_result(ax1, savedir, SI, col=[0,0,1], label='SI')
b2 = plot_best_result(ax1, savedir, SI_XCG, col=[1,0,0], label='SI_XCG')
accuracy['SI'] = b1
accuracy['SI XdG'] = b2
ax1.legend(ncol=3, fontsize=9)
ax1.grid(True)
ax1.set_xlim(0,500)
add_subplot_details(ax1, [0.5,1],[0,500],[])
plt.tight_layout()
plt.savefig('Figure4_v3.pdf', format='pdf')
plt.show()
for k, v in accuracy.items():
print(k , ' = ', v)
def plot_fig2():
#savedir = './savedir/mnist/'
savedir = '/media/masse/MySSDataStor1/Context-Dependent Gating/Final MNIST/'
savedir1 = '/media/masse/MySSDataStor1/Context-Dependent Gating/Final MNIST/'
all_same_scale = True
f, ((ax1,ax2),(ax3,ax4)) = plt.subplots(2,2,figsize=(8,6))
accuracy = {}
ylim_min = 0.6
# Figure 2A
# Plotting: SI, EWC, base
# No dropout on input layer
base = 'mnist_no_stabilization'
EWC = 'mnist_EWC'
SI = 'mnist_SI'
#SI= 'neurons_InpDO_mnist_SI'
b3 = plot_best_result(ax1, savedir + 'SI/', SI, col=[1,0,1], label='SI')
b1 = plot_best_result(ax1, savedir + 'Baseline/', base, col=[0,0,0], label='Base')
b2 = plot_best_result(ax1, savedir + 'EWC Fixed/', EWC, col=[0,1,0], label='EWC')
accuracy['base'] = b1
accuracy['EWC'] = b2
accuracy['SI'] = b3
ax1.legend(ncol=3, fontsize=9)
ax1.grid(True)
ax1.set_xlim(0,100)
add_subplot_details(ax1, [ylim_min,1],[0,100],[])
# Figure 2B
# Plotting: SI+TD Partial, SI, EWC+TD Partial, EWC
# No dropout on input layer
SI_TDP = 'mnist_SI_rule'
EWC_TDP = 'mnist_EWC_rule'
b2 = plot_best_result(ax2, savedir + 'SI/', SI, col=[1,0,1], label='SI')
b4 = plot_best_result(ax2, savedir + 'EWC Fixed/', EWC, col=[0,1,0], label='EWC')
b1 = plot_best_result(ax2, savedir + 'SI Rule/', SI_TDP, col=[1,0,1], label='SI+Partial',linestyle='--')
b3 = plot_best_result(ax2, savedir + 'EWC Rule/', EWC_TDP, col=[0,1,0], label='EWC+Partial',linestyle='--')
accuracy['SI_Partial'] = b1
accuracy['EWC_Partial'] = b3
ax2.legend(ncol=2, fontsize=9)
ax2.grid(True)
ax2.set_xlim(0,100)
add_subplot_details(ax2, [ylim_min,1],[0,100],[])
# Figure 2C
# Plotting: SI+TD Partial Split, SI+TD Partial, EWC+TD Partial, EWC+TD Partial Split
# Dropout irrelevant?
SI_TDPS = 'mnist_SI_split_rule'
EWC_TDPS = 'split_InpDO_mnist_EWC'
b1 = plot_best_result(ax3, savedir + 'SI Rule/', SI_TDP, col=[1,0,1], label='SI+Partial',linestyle='--')
b3 = plot_best_result(ax3, savedir + 'EWC Rule/', EWC_TDP, col=[0,1,0], label='EWC+Partial',linestyle='--')
b2 = plot_best_result(ax3, savedir + 'SI Rule Split/', SI_TDPS, col=[1,0,1], label='Split SI+Partial')
b4 = plot_best_result(ax3, savedir + 'EWC Split/', EWC_TDPS, col=[0,1,0],label='Split EWC+Partial')
accuracy['SI_Split'] = b2
accuracy['EWC_Split'] = b4
ax3.legend(ncol=2, fontsize=9)
ax3.grid(True)
ax3.set_xlim(0,100)
add_subplot_details(ax3, [ylim_min,1],[0,100],[])
# Figure 2D
# Plotting: SI+TD Partial Split, SI+TD Full, EWC+TD Full, EWC+TD Partial Split
# Dropout irrelevant?
SI_TD = 'neurons_InpDO_mnist_SI'
EWC_TD = 'neurons_InpDO_mnist_EWC'
XdG = 'mnist_nostab'
#b2 = plot_best_result(ax4, savedir + 'SI Rule Split/', SI_TDPS, col=[1,0,1], label='Split SI++Partial')
#b4 = plot_best_result(ax4, savedir + 'EWC Split/', EWC_TDPS, col=[0,1,0],label='Split EWC++Partial')
b3 = plot_best_result(ax4, savedir + 'SI/', SI, col=[1,0,1], label='SI')
b2 = plot_best_result(ax4, savedir + 'EWC Fixed/', EWC, col=[0,1,0], label='EWC')
b1 = plot_best_result(ax4, savedir + 'SI XdG/', SI_TD, col=[1,0,1], label='SI+XdG',linestyle='--')
b3 = plot_best_result(ax4, savedir + 'EWC XdG/', EWC_TD, col=[0,1,0], label='EWC+XdG',linestyle='--')
b5 = plot_best_result(ax4, savedir + 'XdG/', XdG, col=[0,0,0], label='XdG',linestyle='--')
accuracy['SI_XdG'] = b1
accuracy['EWC_XdG'] = b3
accuracy['XdG'] = b5
ax4.grid(True)
ax4.set_xlim(0,100)
add_subplot_details(ax4, [ylim_min,1],[0,100],[])
ax4.legend(ncol=2, fontsize=9)
plt.tight_layout()
plt.savefig('Figure2.pdf', format='pdf')
plt.show()
for k, v in accuracy.items():
print(k, ' = ', v)
def mnist_table():
savedir = './savedir/perm_mnist/archive'
base = 'mnist_n2000_no_stabilization' # archive1
SI = 'perm_mnist_n2000_d1_no_topdown' # archive0
EWC = 'mnist_n2000_EWC' # archive1
SI_TDP = 'perm_mnist_n2000_d1_bias' # archive0
EWC_TDP = 'perm_mnist_n2000_d1_EWC_bias' # archive1
SI_TDPS = 'mnist_n2000_pathint_split_oc' # archive2
EWC_TDPS = 'mnist_n2000_EWC_split_oc' # archive2
SI_TDF = 'perm_mnist_n2000_d1_1of5' # archive0
EWC_TDF = 'perm_mnist_n2000_d1_EWC_1of5' # archive1
archs = [1,0,1,0,1,2,2,0,1]
names = ['Base', 'SI', 'EWC', 'SI + Partial', 'EWC + Partial', \
'SI + Partial + Split', 'EWC + Partial + Split',\
'SI + Full', 'EWC + Full']
locs = [base, SI, EWC, SI_TDP, EWC_TDP, SI_TDPS, EWC_TDPS, SI_TDF, EWC_TDF]
with open('mnist_table_data.tsv', 'w') as f:
f.write('Name\tC\tT1\tT10\tT20\tT50\tT100\n')
for a, s, n in zip(archs, locs, names):
c_opt, acc = retrieve_best_result(savedir+str(a)+'/', s)
f.write(n + '\t' + str(c_opt) + '\t' + str(acc[0])
+ '\t' + str(acc[9])
+ '\t' + str(acc[19])
+ '\t' + str(acc[49])
+ '\t' + str(acc[99]) + '\n')
def cifar_table():
savedir = './savedir/cifar_no_multihead/'
base = 'cifar_n1000_no_stabilization'
SI = 'cifar_n1000_pathint'
EWC = 'cifar_n1000_EWC'
SI_TDP = 'cifar_n1000_partial_pathint'
EWC_TDP = 'cifar_n1000_partial_EWC'
SI_TDPS = 'cifar_n1164_split_pathint'
EWC_TDPS = 'cifar_n1164_split_EWC'
SI_TDF = 'cifar_n1000_full_pathint'
EWC_TDF = 'cifar_n1000_full_EWC'
names = ['Base', 'SI', 'EWC', 'SI + Partial', 'EWC + Partial', \
'SI + Partial + Split', 'EWC + Partial + Split',\
'SI + Full', 'EWC + Full']
locs = [base, SI, EWC, SI_TDP, EWC_TDP, SI_TDPS, EWC_TDPS, SI_TDF, EWC_TDF]
with open('cifar_table_data.tsv', 'w') as f:
f.write('Name\tC\tT1\tT10\tT20\n')
for s, n in zip(locs, names):
c_opt, acc = retrieve_best_result(savedir, s)
f.write(n + '\t' + str(c_opt) + '\t' + str(acc[0])
+ '\t' + str(acc[9])
+ '\t' + str(acc[19]) + '\n')
def fig2_inset():
f, ax = plt.subplots(1,1)
# Figure 2D
# Plotting: SI+TD Partial Split, SI+TD Full, EWC+TD Full, EWC+TD Partial Split
# Dropout irrelevant?
SI_TD = 'perm_mnist_n2000_d1_1of5'
SI_TDPS = 'mnist_n2000_pathint_split_oc'
EWC_TD = 'perm_mnist_n2000_d1_EWC_1of5'
EWC_TDPS = 'mnist_n2000_EWC_split_oc'
b2 = plot_best_result(ax, './savedir/perm_mnist/archive2/', SI_TDPS, col=[0.7,0.7,0], label='Split SI+TD Par.')
b4 = plot_best_result(ax, './savedir/perm_mnist/archive2/', EWC_TDPS, col=[0.7,0.7,0.7],label='Split EWC+TD Par.')
b1 = plot_best_result(ax, './savedir/perm_mnist/archive0/', SI_TD, col=[0,0,1], label='SI+TD Full')
b3 = plot_best_result(ax, './savedir/perm_mnist/archive1/', EWC_TD, col=[0,1,0], label='EWC+TD Full')
ax.grid(True)
ax.set_yticks([0.85,0.90,0.95,1.0])
ax.set_xlim(0,100)
add_subplot_details(ax, [0.85,1],[])
plt.tight_layout()
plt.show()
def plot_fig5():
savedir = '/home/masse/Context-Dependent-Gating/savedir/ImageNet/'
savedir1 = '/media/masse/MySSDataStor1/Context-Dependent Gating/Final ImageNet/'
f, ((ax1,ax2),(ax3,ax4)) = plt.subplots(2,2,figsize=(8,6))
accuracy = {}
# Figure 5A
# Plotting: SI, EWC, base
# No dropout on input layer
base = 'imagenet_base_omega'
EWC = 'ImageNet_EWC_omega'
SI = 'imagenet_SI_omega'
base_MH = 'imagenet_baseMH_'
EWC_MH = 'ImageNet_EWC_MH_omega'
SI_MH = 'imagenet_SI_MH_'
b1 = plot_best_result(ax1, savedir, base, col=[0,0,0], label='base')
b2 = plot_best_result(ax1, savedir1+'EWC/', EWC, col=[0,1,0], label='EWC')
b3 = plot_best_result(ax1, savedir, SI, col=[1,0,1], label='SI')
b4 = plot_best_result(ax1, savedir, base_MH, col=[0,0,0], label='base MH', linestyle='--')
b5 = plot_best_result(ax1, savedir1+'EWC MH/', EWC_MH, col=[0,1,0], label='EWC MH', linestyle='--')
b6 = plot_best_result(ax1, savedir, SI_MH, col=[1,0,1], label='SI MH', linestyle='--')
accuracy['base'] = b1
accuracy['EWC'] = b2
accuracy['SI'] = b3
accuracy['base_MH'] = b4
accuracy['EWC_MH'] = b5
accuracy['SI_MH'] = b6
print('A ', b1,b2,b3,b4,b5,b6)
ax1.legend(ncol=3, fontsize=9)
ax1.grid(True)
add_subplot_details(ax1, ylim = [0,1], xlim = [0,100])
# Figure 3B2
# Plotting: SI+TD Partial, SI, EWC+TD Partial, EWC
# No dropout on input layer
SI_TDP = 'ImageNet_SI_rule_'
EWC_TDP = 'ImageNet_EWC_rule_' # InpDO was a typo, not actually using drop out on iputs
b2 = plot_best_result(ax2, savedir, SI, col=[1,0,1], label='SI')
b4 = plot_best_result(ax2, savedir1+'EWC/', EWC, col=[0,1,0], label='EWC')
b1 = plot_best_result(ax2, savedir1+'SI Rule/', SI_TDP, col=[1,0,1], label='SI+Partial', linestyle='--')
b3 = plot_best_result(ax2, savedir1+'EWC Rule/', EWC_TDP, col=[0,1,0], label='EWC+Partal', linestyle='--')
accuracy['SI Partial'] = b1
accuracy['EWC Partial'] = b3
ax2.set_xlim(0,100)
ax2.legend(ncol=2, fontsize=9)
ax2.grid(True)
add_subplot_details(ax2, ylim = [0,1], xlim = [0,100])
# Figure 3C
# Plotting: SI+TD Partial Split, SI+TD Partial, EWC+TD Partial, EWC+TD Partial Split
# Dropout irrelevant?
SI_TDPS = 'ImageNet_SI_rule_split_'
EWC_TDPS = 'ImageNet_EWC_rule_split_'
b1 = plot_best_result(ax3, savedir1+'SI Rule Split/', SI_TDP, col=[1,0,1], label='Split SI+TD Partial')
b3 = plot_best_result(ax3, savedir1+'EWC Rule/', EWC_TDP, col=[0,1,0], label='EWC+Partal', linestyle='--')
b2 = plot_best_result(ax3, savedir1+'SI Rule/', SI_TDP, col=[1,0,1], label='SI+Partial', linestyle='--')
b4 = plot_best_result(ax3, savedir1+'EWC Rule Split/', EWC_TDPS, col=[0,1,0],label='Split EWC+Partial')
accuracy['SI Split'] = b1
accuracy['EWC Split'] = b4
ax3.set_xlim(0,100)
ax3.legend(ncol=2, fontsize=9)
ax3.grid(True)
add_subplot_details(ax3, ylim = [0,1], xlim = [0,100])
# Figure 3D
# Plotting: SI+TD Partial Split, SI+TD Full, EWC+TD Full, EWC+TD Partial Split
# Dropout irrelevant?
SI_TD = 'ImageNet_SI_XdG_'
EWC_TD = 'ImageNet_EWC_XdG_'
XdG = 'imagenet_nostab'
#b2 = plot_best_result(ax4, savedir1+'SI Rule Split/', SI_TDP, col=[1,0,1], label='Split SI+TD Partial')
#b4 = plot_best_result(ax4, savedir1+'EWC Rule Split/', EWC_TDPS, col=[0,1,0],label='Split EWC+Partial')
b2 = plot_best_result(ax4, savedir1+'EWC/', EWC, col=[0,1,0], label='EWC')
b3 = plot_best_result(ax4, savedir, SI, col=[1,0,1], label='SI')
b1 = plot_best_result(ax4, savedir1+'EWC XdG/', EWC_TD, col=[0,1,0],label='EWC+XdG', linestyle='--')
b3 = plot_best_result(ax4, savedir1+'SI XdG/', SI_TD, col=[1,0,1],label='SI+XdG', linestyle='--')
b5 = plot_best_result(ax4, savedir1+'XdG/', XdG, col=[0,0,0],label='SI+XdG', linestyle='--')
accuracy['SI XdG'] = b3
accuracy['EWC XdG'] = b1
accuracy['XdG'] = b5
ax4.set_xlim(0,100)
ax4.legend(ncol=2, fontsize=9)
ax4.grid(True)
add_subplot_details(ax4, ylim = [0,1], xlim = [0,100])
plt.tight_layout()
plt.savefig('Figure3.pdf', format='pdf')
plt.show()
for k, v in accuracy.items():
print(k , ' = ', v)
def plot_fig5B():
savedir = '/home/masse/Context-Dependent-Gating/savedir/ImageNet/'
f, ax4 = plt.subplots(1,1,figsize=(8,6))
accuracy = {}
SI_TDPS = 'imagenet_SI_split_'
EWC_TDPS = 'imagenet_EWC_split_'
SI_TD = 'imagenet_SI_XdG_'
EWC_TD = 'imagenet_EWC_XdG_'
b2 = plot_best_result(ax4, savedir, SI_TDPS, col=[1,0,1], label='Split SI+Partial')
b4 = plot_best_result(ax4, savedir, EWC_TDPS, col=[0,1,0],label='Split EWC+Partial')
b1 = plot_best_result(ax4, savedir, EWC_TD, col=[0,1,0],label='EWC+XdG', linestyle='--')
b3 = plot_best_result(ax4, savedir, SI_TD, col=[1,0,1],label='SI+XdG', linestyle='--')
accuracy['SI XdG'] = b1
accuracy['EWC XdG'] = b3
ax4.set_xlim(0,100)
ax4.legend(ncol=2, fontsize=9)
ax4.grid(True)
add_subplot_details(ax4, ylim = [0,1], xlim = [0,100])
plt.tight_layout()
plt.savefig('Figure3.pdf', format='pdf')
plt.show()
def plot_ARL_fig():
savedir = '/home/masse/Context-Dependent-Gating/savedir/ImageNet/'
f, ax4 = plt.subplots(1,1,figsize=(8,6))
accuracy = {}
SI = 'imagenet_SI_omega'
SI_TD = 'imagenet_SI_XdG_'
b1 = plot_best_result(ax4, savedir, SI, col=[0,0,1], label='SI')
b2 = plot_best_result(ax4, savedir, SI_TD, col=[1,0,0],label='SI+XdG')
accuracy['SI'] = b1
accuracy['SI_XdG'] = b2
ax4.set_xlim(0,100)
ax4.legend(ncol=2, fontsize=9)
ax4.grid(True)
add_subplot_details(ax4, ylim = [0,0.7], xlim = [0,100])
plt.tight_layout()
plt.savefig('Figure_ARL.pdf', format='pdf')
plt.show()
def plot_mnist_figure():
f = plt.figure(figsize=(6,2.5))
# SI only, no top-down
SI_fn = 'perm_mnist_n2000_d1_no_topdown_omega'
# SI only + top-down
SI_td_fn = 'perm_mnist_n2000_d1_bias_omega'
# SI only + split in 5 + top-down
SI_split_fn = 'perm_mnist_n735_d1_bias_20tasks'
# SI + INH TD, selecting one out of 4
SI_inh_td4_fn = 'perm_mnist_n2000_d1_1of4_omega'
# SI + INH TD, selecting one out of 5
SI_inh_td5_fn = 'perm_mnist_n2000_d1_1of5_omega'
# SI + INH TD, selecting one out of 6
SI_inh_td6_fn = 'perm_mnist_n2000_d1_1of6_omega'
# SI + INH TD, selecting one out of 3
SI_inh_td3_fn = 'perm_mnist_n2000_d1_1of3_omega'
# SI + INH TD, selecting one out of 2
SI_inh_td2_fn = 'perm_mnist_n2000_d1_1of2_omega'
ax = f.add_subplot(1, 2, 1)
plot_best_result(ax, data_dir, SI_fn, col = [0,0,1], description = 'SI only')
plot_best_result(ax, data_dir, SI_td_fn, col = [1,0,0])
plot_best_result(ax, data_dir, SI_split_fn, col = [0,1,0], split = 5)
plot_best_result(ax, data_dir, SI_inh_td5_fn, col = [1,0,1], description = 'SI + TD date 80%')
add_subplot_details(ax, [0.8, 1],[0.85, 0.9,0.95])
ax = f.add_subplot(1, 2, 2)
plot_best_result(ax, data_dir, SI_inh_td5_fn, col = [1,0,1])
plot_best_result(ax, data_dir, SI_inh_td4_fn, col = [0,1,0])
plot_best_result(ax, data_dir, SI_inh_td6_fn, col = [0,0,1], description = 'SI + TD date 86.67%')
plot_best_result(ax, data_dir, SI_inh_td3_fn, col = [0,1,1])
plot_best_result(ax, data_dir, SI_inh_td2_fn, col = [0,0,0])
add_subplot_details(ax, [0.9, 1], [0.95])
plt.tight_layout()
plt.savefig('Fig1.pdf', format='pdf')
plt.show()
def add_subplot_details(ax, ylim = [0,1], xlim = [0,100],yminor = []):
d = ylim[1] - ylim[0]
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.set_ylim([ylim[0], ylim[1]])
for i in yminor:
ax.plot([0,100],[i,i],'k--')
ax.set_xlim([xlim[0], xlim[1]])
ax.set_ylabel('Mean task accuracy')
ax.set_xlabel('Task number')
def plot_best_result(ax, data_dir, prefix, col = [0,0,1], split = 1, description = [], label=None, linestyle = '-'):
# Get filenames
name_and_data = []
for full_fn in os.listdir(data_dir):
if full_fn.startswith(prefix):
x = pickle.load(open(data_dir + full_fn, 'rb'))
name_and_data.append((full_fn, x['accuracy_full'][-1], x['par']['omega_c']))
if prefix == 'mnist_SI_rule':
print('mnist_STI_rule')
print(name_and_data)
print(os.listdir(data_dir))
print(data_dir)
print('XXXX')
# Find number of c's and v's
cids = []
vids = []
xids = []
om_c = []
for (f, _, oc) in name_and_data:
if 'xi' in f:
if f[-12] not in cids:
cids.append(f[-12])
if f[-8] not in xids:
xids.append(f[-8])
if f[-5] not in vids:
vids.append(f[-5])
else:
if f[-9].isdigit():
c = f[-9:-7]
else:
c = f[-8]
if c not in cids:
cids.append(c)
if f[-5] not in vids:
vids.append(f[-5])
xids = [0]
om_c.append(oc)
accuracies = np.zeros((len(xids),len(cids)))
count = np.zeros((len(xids),len(cids)))
cids = sorted(cids)
vids = sorted(vids)
xids = sorted(xids)
print(prefix, cids, vids, xids)
for i, c_id, in enumerate(cids):
for v_id in vids:
for j, x_id in enumerate(xids):
#text_c = 'omega'+str(c_id)
text_c = 'omega'+str(c_id)
text_v = '_v'+str(v_id)
text_x = '_xi'+str(x_id)
for full_fn in os.listdir(data_dir):
if full_fn.startswith(prefix) and 'xi' in full_fn and text_c in full_fn and text_v in full_fn and text_x in full_fn:
#print('c_id', c_id)
x = pickle.load(open(data_dir + full_fn, 'rb'))
accuracies[j,i] += x['accuracy_full'][-1]
count[j,i] += 1
elif full_fn.startswith(prefix) and not 'xi' in full_fn and text_c in full_fn and text_v in full_fn:
#print('c_id', c_id)
x = pickle.load(open(data_dir + full_fn, 'rb'))
accuracies[j,i] += x['accuracy_full'][-1]
count[j,i] += 1
accuracies /= (1e-16+count)
accuracies = np.reshape(accuracies,(1,-1))
print(prefix)
print(accuracies)
ind_best = np.argsort(accuracies)[-1]
best_c = int(ind_best[-1]%len(cids))
best_xi = ind_best[-1]//len(cids)
task_accuracy = []
for v_id in vids:
#text_c = 'omega'+str(cids[best_c])
text_c = 'omega'+str(cids[best_c])
text_xi = 'xi'+str(xids[best_xi])
text_v = '_v'+str(v_id)
print(prefix, text_c, text_xi, text_v)
for full_fn in os.listdir(data_dir):
if full_fn.startswith(prefix) and 'xi' in full_fn and text_c in full_fn and text_v in full_fn and text_x in full_fn:
x = pickle.load(open(data_dir + full_fn, 'rb'))
task_accuracy.append(x['accuracy_full'])
print(prefix,' ', full_fn, ' ', x['par']['stabilization'], ' omega C ', x['par']['omega_c'])
elif full_fn.startswith(prefix) and not 'xi' in full_fn and text_c in full_fn and text_v in full_fn:
x = pickle.load(open(data_dir + full_fn, 'rb'))
task_accuracy.append(x['accuracy_full'])
print(prefix,' ', full_fn, ' ', x['par']['stabilization'], x['par']['gating_type'], x['par']['multihead'], ' omega C ', x['par']['omega_c'], x['par']['omega_xi'])
task_accuracy = np.mean(np.stack(task_accuracy),axis=0)
if split > 1:
task_accuracy = np.array(task_accuracy)
task_accuracy = np.tile(np.reshape(task_accuracy,(-1,1)),(1,split))
task_accuracy = np.reshape(task_accuracy,(1,-1))[0,:]
if not description == []:
print(description , ' ACC after 10 trials = ', task_accuracy[9], ' after 30 trials = ', task_accuracy[29], \
' after 100 trials = ', task_accuracy[99])
ax.plot(np.arange(1, np.shape(task_accuracy)[0]+1), task_accuracy, color = col, linestyle = linestyle, label=label)
return task_accuracy[[9,-1]]
def retrieve_best_result(data_dir, fn):
best_accuracy = -1
val_c = 0.
for f in os.listdir(data_dir):
if f.startswith(fn):
x = pickle.load(open(data_dir+f, 'rb'))
if x['accuracy_full'][-1] > best_accuracy:
best_accuracy = x['accuracy_full'][-1]
task_accuracy = x['accuracy_full']
val_c = x['par']['omega_c']
return val_c, task_accuracy
| 35.159221 | 178 | 0.607904 | 4,832 | 30,694 | 3.647972 | 0.068295 | 0.060135 | 0.081806 | 0.012935 | 0.783911 | 0.745674 | 0.704658 | 0.646338 | 0.602825 | 0.582118 | 0 | 0.059428 | 0.223725 | 30,694 | 872 | 179 | 35.199541 | 0.680363 | 0.077474 | 0 | 0.408425 | 0 | 0 | 0.186002 | 0.074045 | 0 | 0 | 0 | 0 | 0 | 1 | 0.029304 | false | 0 | 0.014652 | 0 | 0.047619 | 0.038462 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 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 |
4199f294a2e28e1458f5bcf7a7ab4d59791be55e | 497 | py | Python | back-end/curso-em-video/python3/Mundo I/Desafios/15F - (Aluguel de Carros).py | gustavocamalionti/cursos-e-linguagens | 615db91aff13db5678a783aac69df11231c925e8 | [
"MIT"
] | null | null | null | back-end/curso-em-video/python3/Mundo I/Desafios/15F - (Aluguel de Carros).py | gustavocamalionti/cursos-e-linguagens | 615db91aff13db5678a783aac69df11231c925e8 | [
"MIT"
] | null | null | null | back-end/curso-em-video/python3/Mundo I/Desafios/15F - (Aluguel de Carros).py | gustavocamalionti/cursos-e-linguagens | 615db91aff13db5678a783aac69df11231c925e8 | [
"MIT"
] | null | null | null | #Desafio 015: escreva um programa que pergunte a quantidade de km percorridos por um carro alugado e a quantidade de dias pelos quais ele foi alugado. Calcule o preço a pagar, sabendo que o carro custa R$60 por dia e R$0.15 por km rodado.
from math import ceil
n1 = float(input('Quantos dias você ficou com o carro? '))
n2 = float(input(f'Ok. já que você ficou {ceil(n1)} dias com ele, andou quantos km? '))
v = n1*60 + n2*0.15
print(f'Legal. Então você precisará pagar R${v:.2f} pelo aluguel. ') | 71 | 238 | 0.732394 | 96 | 497 | 3.791667 | 0.59375 | 0.06044 | 0.071429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.046341 | 0.17505 | 497 | 7 | 239 | 71 | 0.841463 | 0.476861 | 0 | 0 | 0 | 0 | 0.615385 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0.2 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
419b810a097b707c486896ea644d7ea06d891f98 | 499 | py | Python | examples/pytorch/diffpool/model/tensorized_layers/assignment.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 9,516 | 2018-12-08T22:11:31.000Z | 2022-03-31T13:04:33.000Z | examples/pytorch/diffpool/model/tensorized_layers/assignment.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 2,494 | 2018-12-08T22:43:00.000Z | 2022-03-31T21:16:27.000Z | examples/pytorch/diffpool/model/tensorized_layers/assignment.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 2,529 | 2018-12-08T22:56:14.000Z | 2022-03-31T13:07:41.000Z | import torch
from torch import nn as nn
from torch.nn import functional as F
from torch.autograd import Variable
from model.tensorized_layers.graphsage import BatchedGraphSAGE
class DiffPoolAssignment(nn.Module):
def __init__(self, nfeat, nnext):
super().__init__()
self.assign_mat = BatchedGraphSAGE(nfeat, nnext, use_bn=True)
def forward(self, x, adj, log=False):
s_l_init = self.assign_mat(x, adj)
s_l = F.softmax(s_l_init, dim=-1)
return s_l
| 26.263158 | 69 | 0.707415 | 74 | 499 | 4.527027 | 0.527027 | 0.023881 | 0.083582 | 0.101493 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002519 | 0.204409 | 499 | 18 | 70 | 27.722222 | 0.84131 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.153846 | false | 0 | 0.384615 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
41a7633ddffb30cf6b1f5142c98eefc976d7f329 | 1,264 | py | Python | comments/models.py | chench53/jquery-comments-server | 15f4b3dead770846bbb7c0d6aec889c64df6387c | [
"MIT"
] | 2 | 2020-06-02T05:08:30.000Z | 2020-06-02T05:08:33.000Z | comments/models.py | chench53/jquery-comments-server | 15f4b3dead770846bbb7c0d6aec889c64df6387c | [
"MIT"
] | null | null | null | comments/models.py | chench53/jquery-comments-server | 15f4b3dead770846bbb7c0d6aec889c64df6387c | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
# Create your models here.
class Creator(models.Model):
fullname = models.CharField(max_length=30)
profile_picture_url = models.URLField()
def __str__(self):
return self.fullname
class Customer(models.Model):
pass
class File(models.Model):
file_url = models.URLField()
file_mime_type = models.CharField(max_length=20)
class Comment(models.Model):
creator = models.ForeignKey(Creator, models.SET_NULL, null=True)
created = models.DateTimeField(blank=True, null=True)
modified = models.DateTimeField(blank=True, null=True)
content = models.TextField()
parent = models.ForeignKey('self', models.CASCADE, null=True, blank=True)
upvote_count = models.IntegerField(default=0)
def __str__(self):
return '{creator}: {content}...'.format(creator=self.creator, content=self.content[:40])
class Upvote(models.Model):
creator = models.ForeignKey(Creator, models.CASCADE, null=True)
comment = models.ForeignKey(Comment, models.CASCADE, null=True)
class Meta:
unique_together = (("creator", "comment"),)
def __str__(self):
return '{creator} upvote {comment}'.format(creator=creator, comment=comment)
| 28.088889 | 96 | 0.711234 | 154 | 1,264 | 5.694805 | 0.357143 | 0.054732 | 0.034208 | 0.054732 | 0.241733 | 0.189282 | 0.107184 | 0 | 0 | 0 | 0 | 0.006635 | 0.165348 | 1,264 | 44 | 97 | 28.727273 | 0.824645 | 0.018987 | 0 | 0.107143 | 0 | 0 | 0.05412 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.107143 | false | 0.035714 | 0.071429 | 0.107143 | 0.928571 | 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 |
41b54267490971fa18558b1ff581557f6e72fe91 | 491 | py | Python | test/integration/test_attributename.py | immijimmi/managedState | cb24aaa288f7ddb12a5042d104f6f0d6ab79828c | [
"MIT"
] | null | null | null | test/integration/test_attributename.py | immijimmi/managedState | cb24aaa288f7ddb12a5042d104f6f0d6ab79828c | [
"MIT"
] | null | null | null | test/integration/test_attributename.py | immijimmi/managedState | cb24aaa288f7ddb12a5042d104f6f0d6ab79828c | [
"MIT"
] | null | null | null | from managedstate import State, AttributeName
class TestAttributeName:
def test_get_uses_attributename_correctly(self, res):
state = State(res.value_4)
assert state.get(["key_2", AttributeName("attribute_1"), "key_3"]) == 7
def test_set_applies_attributename_correctly(self, res):
state = State(res.value_4)
state.set("value", ["key_2", AttributeName("attribute_2")])
assert state.get(["key_2", AttributeName("attribute_2")]) == "value"
| 30.6875 | 79 | 0.688391 | 61 | 491 | 5.262295 | 0.409836 | 0.037383 | 0.158879 | 0.242991 | 0.635514 | 0.548287 | 0.548287 | 0.299065 | 0.299065 | 0 | 0 | 0.024752 | 0.177189 | 491 | 15 | 80 | 32.733333 | 0.769802 | 0 | 0 | 0.222222 | 0 | 0 | 0.12831 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 1 | 0.222222 | false | 0 | 0.111111 | 0 | 0.444444 | 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 |
41b57c0d33d477d09b1dd88ceeff4ea07dbdc75c | 3,585 | py | Python | tarefas-poo/lista-04/matriz_de_inteiros/model/matriz_de_inteiros.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-04/matriz_de_inteiros/model/matriz_de_inteiros.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-04/matriz_de_inteiros/model/matriz_de_inteiros.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # -------------------------------
# UFSC - CTC - INE - INE5663
# Exercício da Matriz de Inteiros
# -------------------------------
# Classe que representa uma matriz de números inteiros.
#
class MatrizDeInteiros:
def __init__(self, dimensoes_ou_numeros):
'''Cria uma matriz de números inteiros. Há duas formas de criar:
- passando as dimensões da matriz na forma de uma tupla: (número de linhas , número de colunas)
- passando os números da matriz na forma de uma lista contendo listas de números
'''
if type(dimensoes_ou_numeros) is tuple:
(num_linhas, num_colunas) = dimensoes_ou_numeros
self._numeros = self._zeros(num_linhas, num_colunas)
else:
self._numeros = dimensoes_ou_numeros
def _zeros(self, num_linhas, num_colunas):
'''Gera uma lista de listas contendo zeros.
'''
return [ [0] * num_colunas for _ in range(num_linhas)]
def armazene(self, linha, coluna, numero):
'''Armazena um número na matriz em uma determinada posição (linha e coluna).
Atenção: a primeira linha deve ser representada por 1. O mesmo vale para a
primeira coluna.
'''
pass
def obtenha(self, linha, coluna):
'''Retorna o número que está em uma determinada posição (linha e coluna).
Atenção: a primeira linha deve ser representada por 1. O mesmo vale para a
primeira coluna.
'''
return 8
def num_linhas(self):
'''Retorna o número de linhas da matriz.
'''
return 6
def num_colunas(self):
'''Retorna o número de colunas da matriz.
'''
return 3
def linha(self, linha):
'''Retorna uma nova lista contendo os números que estão em uma linha.
Atenção: a primeira linha deve ser representada por 1.
'''
return [3,4,5,6]
def coluna(self, coluna):
'''Retorna uma nova lista contendo os números que estão em uma coluna.
Atenção: a primeira coluna deve ser representada por 1.
'''
return [9,8,7]
def soma_de_linha(self, linha):
'''Retorna a soma dos números que estão em uma linha da matriz.
Atenção: a primeira linha deve ser representada por 1.
'''
return 77
def soma_de_coluna(self, coluna):
'''Retorna a soma dos números que estão em uma coluna da matriz.
Atenção: a primeira coluna deve ser representada por 1.
'''
return 56
def somas_das_linhas(self):
'''Retorna uma lista contendo as somas de cada uma das linhas
da matriz.
'''
return [ 23, 45, 77 ]
def soma_dos_numeros(self):
'''Retorna a soma de todos os números da matriz.
'''
return 99
def multiplique_por_fator(self, fator):
'''Multiplica cada número da matriz por um outro número (fator).
'''
pass
def copia(self):
'''Retorna uma cópia da matriz.
'''
return MatrizDeInteiros([[1,2,3], [4,5,6]])
def __add__(self, outra):
'''Faz a soma da matriz self com outra matriz.
Retorna a matriz resultante da soma ou None quando
não for possível somar.
'''
return None
def __mul__(self, outra):
'''Faz a multiplicação da matriz self com outra matriz.
Retorna a matriz resultante da multiplicação ou None quando
não for possível multiplicar.
'''
return None
| 33.504673 | 103 | 0.590237 | 457 | 3,585 | 4.531729 | 0.260394 | 0.050217 | 0.046354 | 0.063737 | 0.447127 | 0.388218 | 0.333172 | 0.333172 | 0.333172 | 0.299372 | 0 | 0.015971 | 0.318828 | 3,585 | 107 | 104 | 33.504673 | 0.832105 | 0.520502 | 0 | 0.108108 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009346 | 0 | 1 | 0.432432 | false | 0.054054 | 0 | 0 | 0.810811 | 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 |
68c41f425ed9a900c2ffb53250f96b3e217dd617 | 507 | py | Python | etsy_convos/convos/filters.py | jessehon/etsy-convos | 34631f49ec745fa11611af6122a7522adc16d241 | [
"BSD-3-Clause"
] | 2 | 2018-12-17T15:47:43.000Z | 2020-02-29T19:47:30.000Z | etsy_convos/convos/filters.py | jessehon/etsy-convos | 34631f49ec745fa11611af6122a7522adc16d241 | [
"BSD-3-Clause"
] | 2 | 2017-07-12T02:45:33.000Z | 2017-11-02T00:37:59.000Z | etsy_convos/convos/filters.py | jessehon/etsy-convos | 34631f49ec745fa11611af6122a7522adc16d241 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from rest_framework import filters
class ActiveForUserFilter(filters.BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
return queryset.active_for(request.user)
class ThreadFolderFilter(filters.BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
folder = request.QUERY_PARAMS.get('folder', None)
if folder is not None:
queryset = queryset.folder_for(folder, request.user)
return queryset
| 36.214286 | 64 | 0.719921 | 57 | 507 | 6.298246 | 0.526316 | 0.133705 | 0.150418 | 0.183844 | 0.356546 | 0.356546 | 0.356546 | 0.356546 | 0.356546 | 0 | 0 | 0.002421 | 0.185404 | 507 | 13 | 65 | 39 | 0.866828 | 0.04142 | 0 | 0.2 | 0 | 0 | 0.012397 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.1 | 0.1 | 0.7 | 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 |
68d3b22a58336ef88b11279b1b9195714e9a3308 | 350 | py | Python | invoicer/_units/forms.py | mtik00/invoicer | 6128202ca86823dc998b8ea661050702544b9b21 | [
"MIT"
] | null | null | null | invoicer/_units/forms.py | mtik00/invoicer | 6128202ca86823dc998b8ea661050702544b9b21 | [
"MIT"
] | 1 | 2021-08-04T23:32:15.000Z | 2021-08-04T23:32:15.000Z | invoicer/_units/forms.py | mtik00/invoicer | 6128202ca86823dc998b8ea661050702544b9b21 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, FloatField
from wtforms.validators import DataRequired
class UnitForm(FlaskForm):
description = StringField(u'Description', validators=[DataRequired()])
unit_price = FloatField(u'Unit Price', validators=[DataRequired()])
units = StringField(u'Units (e.g. hr, day, etc)')
| 35 | 74 | 0.762857 | 41 | 350 | 6.463415 | 0.536585 | 0.083019 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.128571 | 350 | 9 | 75 | 38.888889 | 0.868852 | 0 | 0 | 0 | 0 | 0 | 0.131429 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 1 | 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 |
68d4db48cd7efced20080ca32fe6dc3a1aa6264d | 799 | py | Python | data/test/python/68d4db48cd7efced20080ca32fe6dc3a1aa6264dfiles.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/test/python/68d4db48cd7efced20080ca32fe6dc3a1aa6264dfiles.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/test/python/68d4db48cd7efced20080ca32fe6dc3a1aa6264dfiles.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | from django.db import models
__all__ = ('PostSaveImageField',)
class PostSaveImageField(models.ImageField):
def __init__(self, *args, **kwargs):
kwargs['null'] = True
kwargs['blank'] = True
super(PostSaveImageField, self).__init__(*args, **kwargs)
def contribute_to_class(self, cls, name):
super(PostSaveImageField, self).contribute_to_class(cls, name)
models.signals.post_save.connect(self.save_file, sender=cls)
def save_file(self, sender, instance, created, **kwargs):
file = super(PostSaveImageField, self).pre_save(instance, created)
if file:
instance.__class__.objects \
.filter(pk=instance.pk).update(**{self.attname: file.name})
def pre_save(self, model_instance, add):
pass
| 30.730769 | 75 | 0.663329 | 91 | 799 | 5.538462 | 0.43956 | 0.136905 | 0.160714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.211514 | 799 | 25 | 76 | 31.96 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0.033792 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.235294 | false | 0.058824 | 0.058824 | 0 | 0.352941 | 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 |
68f3a8745467c301c743a873cdae59b1918cd5b0 | 557 | py | Python | personalcrm/quote/migrations/0007_auto_20210131_1508.py | carlossgv/personalcrm-repo | 2fbe824a62d8976ce09817d75dfac7291ca3d28d | [
"MIT"
] | 2 | 2021-02-11T12:46:06.000Z | 2021-02-22T01:32:35.000Z | personalcrm/quote/migrations/0007_auto_20210131_1508.py | carlossgv/personalcrm-repo | 2fbe824a62d8976ce09817d75dfac7291ca3d28d | [
"MIT"
] | null | null | null | personalcrm/quote/migrations/0007_auto_20210131_1508.py | carlossgv/personalcrm-repo | 2fbe824a62d8976ce09817d75dfac7291ca3d28d | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-01-31 15:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('quote', '0006_quotedproducts_hidden'),
]
operations = [
migrations.AddField(
model_name='quote',
name='tax',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='quotedproducts',
name='price',
field=models.FloatField(blank=True, null=True),
),
]
| 23.208333 | 59 | 0.576302 | 56 | 557 | 5.660714 | 0.625 | 0.113565 | 0.14511 | 0.170347 | 0.239748 | 0.239748 | 0.239748 | 0 | 0 | 0 | 0 | 0.049096 | 0.305206 | 557 | 23 | 60 | 24.217391 | 0.770026 | 0.08079 | 0 | 0.352941 | 1 | 0 | 0.113725 | 0.05098 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.058824 | 0 | 0.235294 | 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 |
ec0b8833358586c61838d39b98d99d94417de4a3 | 460 | py | Python | pycoin/symbols/mona.py | jaschadub/pycoin | 1e8d0d9fe20ce0347b97847bb529cd1bd84c7442 | [
"MIT"
] | 1,210 | 2015-01-02T13:36:28.000Z | 2022-03-30T00:52:22.000Z | pycoin/symbols/mona.py | impactog/pycoin | 3db6f82afa3054d8d07caca4909e1aed3de2fceb | [
"MIT"
] | 280 | 2015-01-05T23:16:47.000Z | 2022-02-22T22:02:17.000Z | pycoin/symbols/mona.py | impactog/pycoin | 3db6f82afa3054d8d07caca4909e1aed3de2fceb | [
"MIT"
] | 459 | 2015-01-10T00:15:57.000Z | 2022-03-16T12:04:40.000Z | from pycoin.networks.bitcoinish import create_bitcoinish_network
network = create_bitcoinish_network(
network_name="Monacoin", symbol="MONA", subnet_name="mainnet",
wif_prefix_hex="b0", sec_prefix="MONASEC:", address_prefix_hex="32", pay_to_script_prefix_hex="37",
bip32_prv_prefix_hex="0488ade4", bip32_pub_prefix_hex="0488b21e", bech32_hrp="mona",
magic_header_hex="fbc0b6db", default_port=9401,
dns_bootstrap=["dnsseed.monacoin.org"])
| 46 | 103 | 0.780435 | 62 | 460 | 5.370968 | 0.677419 | 0.135135 | 0.138138 | 0.18018 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.066986 | 0.091304 | 460 | 9 | 104 | 51.111111 | 0.729665 | 0 | 0 | 0 | 0 | 0 | 0.176087 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 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 |
ec2672ae7bcadf74322cfd2f19354039f5fcb505 | 3,320 | py | Python | src/djlime/forms/widgets.py | freshlimestudio/djlime | 69e177d6e26fdf9cb520ac3316548d7d38b9690e | [
"BSD-3-Clause"
] | null | null | null | src/djlime/forms/widgets.py | freshlimestudio/djlime | 69e177d6e26fdf9cb520ac3316548d7d38b9690e | [
"BSD-3-Clause"
] | null | null | null | src/djlime/forms/widgets.py | freshlimestudio/djlime | 69e177d6e26fdf9cb520ac3316548d7d38b9690e | [
"BSD-3-Clause"
] | null | null | null | """
djlime.forms.widgets
~~~~~~~~~~~~~~
Extended django form widgets.
:copyright: (c) 2012 by Andrey Voronov.
:license: BSD, see LICENSE for more details.
"""
from itertools import chain
from django.forms import widgets
from django.forms.util import flatatt
from django.utils.encoding import force_unicode
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
class RadioInput(widgets.RadioInput):
def __init__(self, name, value, attrs, label_attrs, choice, index):
self.label_attrs = label_attrs
super(RadioInput, self).__init__(name, value, attrs, choice, index)
def __unicode__(self):
if 'id' in self.attrs:
label_for = ' for="%s_%s"' % (self.attrs['id'], self.index)
else:
label_for = ''
choice_label = conditional_escape(force_unicode(self.choice_label))
return mark_safe(u'<label %s %s>%s %s</label>' % (label_for, flatatt(self.label_attrs), self.tag(), choice_label))
class HorizontalRadioRenderer(widgets.RadioSelect.renderer):
def __init__(self, name, value, attrs, label_attrs, choices):
self.label_attrs = label_attrs
super(HorizontalRadioRenderer, self).__init__(name, value, attrs, choices)
def __iter__(self):
for i, choice in enumerate(self.choices):
yield RadioInput(self.name, self.value, self.attrs.copy(), self.label_attrs.copy(), choice, i)
def __getitem__(self, idx):
choice = self.choices[idx] # Let the IndexError propogate
return RadioInput(self.name, self.value, self.attrs.copy(), self.label_attrs.copy(), choice, idx)
def render(self):
return mark_safe(u'\n'.join([u'%s\n' % w for w in self]))
class RadioFieldRenderer(widgets.RadioFieldRenderer):
def __init__(self, name, value, attrs, label_attrs, choices):
self.label_attrs = label_attrs
super(RadioFieldRenderer, self).__init__(name, value, attrs, choices)
def __iter__(self):
for i, choice in enumerate(self.choices):
yield RadioInput(self.name, self.value, self.attrs.copy(), self.label_attrs.copy(), choice, i)
def __getitem__(self, idx):
choice = self.choices[idx] # Let the IndexError propogate
return RadioInput(self.name, self.value, self.attrs.copy(), self.label_attrs.copy(), choice, idx)
class RadioSelect(widgets.RadioSelect):
"""
RadioSelect widget with support for label attributes such is class, id
"""
renderer = RadioFieldRenderer
def __init__(self, *args, **kwargs):
label_attrs = kwargs.pop('label_attrs', {})
self.label_attrs = label_attrs
super(RadioSelect, self).__init__(*args, **kwargs)
def get_renderer(self, name, value, attrs=None, label_attrs=None, choices=()):
"""Returns an instance of the renderer."""
if value is None: value = ''
str_value = force_unicode(value) # Normalize to string.
final_attrs = self.build_attrs(attrs)
choices = list(chain(self.choices, choices))
return self.renderer(name, str_value, final_attrs, label_attrs, choices)
def render(self, name, value, attrs=None, label_attrs=None, choices=()):
return self.get_renderer(name, value, attrs, self.label_attrs, choices).render()
| 37.727273 | 122 | 0.679819 | 424 | 3,320 | 5.096698 | 0.226415 | 0.101805 | 0.064785 | 0.041647 | 0.415086 | 0.404905 | 0.378066 | 0.378066 | 0.36187 | 0.322073 | 0 | 0.001503 | 0.198193 | 3,320 | 87 | 123 | 38.16092 | 0.810293 | 0.10241 | 0 | 0.339623 | 0 | 0 | 0.020137 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.226415 | false | 0 | 0.113208 | 0.037736 | 0.54717 | 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 |
ec3416c60abd3578832e4a31787a9c2b8eb12e3d | 873 | py | Python | S8/objetos.py | Escannor/Algoritmia_21-2 | 284e35a040eae7aa1a0a6cb9336f0d4c2b782a48 | [
"MIT"
] | 1 | 2021-04-18T04:54:04.000Z | 2021-04-18T04:54:04.000Z | S8/objetos.py | Alexship896/Algoritmia_21-2 | 1ffb33fc2b93899d813e67d958e437d66a39070e | [
"MIT"
] | null | null | null | S8/objetos.py | Alexship896/Algoritmia_21-2 | 1ffb33fc2b93899d813e67d958e437d66a39070e | [
"MIT"
] | 1 | 2021-04-18T05:01:08.000Z | 2021-04-18T05:01:08.000Z | ## class <nombre_del_objeto>:
## def <metodo_del_objeto>(self):
# variable -> atributos
# funciones -> metodos
def hola():
print("hola a todos")
hola()
class Persona:
def __init__(self, nombre):
self.nombre = nombre
def hola(self):
print("Hola a todos, soy", self.nombre)
def agregarApellido(self, apellido):
self.apellido = apellido
def agregarEdad(self, edad):
self.edad = edad
def __str__(self):
return self.nombre
class Animal:
def __init__(self, nombre):
self.nombre = nombre
perro = Animal('perro')
perro.edad = 12
perro.raza = 'labrador'
luis = Persona('Luis')
luis.hola()
luis.agregarApellido('Perez')
pedro = Persona('Pedro')
pedro.hola()
pedro.agregarEdad(17)
print(pedro)
pedro.nombre = 'Pablo'
print(pedro)
print(pedro.edad)
pedro.edad = 19
print(pedro.edad) | 15.589286 | 47 | 0.647194 | 109 | 873 | 5.036697 | 0.321101 | 0.10929 | 0.03643 | 0.054645 | 0.120219 | 0.120219 | 0.120219 | 0 | 0 | 0 | 0 | 0.008785 | 0.21764 | 873 | 56 | 48 | 15.589286 | 0.795022 | 0.122566 | 0 | 0.25 | 0 | 0 | 0.080263 | 0 | 0 | 0 | 0 | 0.017857 | 0 | 1 | 0.21875 | false | 0 | 0 | 0.03125 | 0.3125 | 0.1875 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
ec3d018ff3d0640052c42c4cb920908caff7f29a | 501 | py | Python | utility/error.py | ghowland/dirdb | 38d346885c5411884b5b7252dc2f09ba42972caa | [
"MIT"
] | 1 | 2017-07-23T16:04:53.000Z | 2017-07-23T16:04:53.000Z | utility/error.py | ghowland/dirdb | 38d346885c5411884b5b7252dc2f09ba42972caa | [
"MIT"
] | null | null | null | utility/error.py | ghowland/dirdb | 38d346885c5411884b5b7252dc2f09ba42972caa | [
"MIT"
] | null | null | null | """
Error Reporting
"""
import sys
def Error(text, options, exit_code=1):
"""Fail with an error. Options are required to deliver proper output."""
#output = {'error': text, 'exit_code':exit_code}
#
## Format errors and output them, in the specified fashion
#format.FormatAndOuput(output, options)
sys.stderr.write('ERROR: %s\n' % text)
#TODO(g): Clean-up work we have done so far, so this system is not left in
# an unusable state
pass#...
# Exit
sys.exit(exit_code)
| 20.04 | 76 | 0.670659 | 75 | 501 | 4.426667 | 0.666667 | 0.096386 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002494 | 0.199601 | 501 | 24 | 77 | 20.875 | 0.825436 | 0.644711 | 0 | 0 | 0 | 0 | 0.070513 | 0 | 0 | 0 | 0 | 0.041667 | 0 | 1 | 0.2 | false | 0.2 | 0.2 | 0 | 0.4 | 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 |
ec4aacd0ee4112bfaad1f422cbfbb013aa8fd123 | 2,247 | py | Python | tests/test_feature_selection.py | NewKnowledge/punk | 53007a38433023f9a9f5cf39786b1c5a28f1f996 | [
"MIT"
] | 2 | 2017-08-23T16:58:01.000Z | 2020-07-03T01:53:34.000Z | tests/test_feature_selection.py | NewKnowledge/punk | 53007a38433023f9a9f5cf39786b1c5a28f1f996 | [
"MIT"
] | 11 | 2017-08-18T17:19:21.000Z | 2022-03-18T15:54:40.000Z | tests/test_feature_selection.py | NewKnowledge/punk | 53007a38433023f9a9f5cf39786b1c5a28f1f996 | [
"MIT"
] | 2 | 2017-09-11T19:38:04.000Z | 2020-05-28T00:58:05.000Z | import unittest
import numpy as np
import pandas as pd
from sklearn import datasets
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from punk.feature_selection import PCAFeatures
from punk.feature_selection import RFFeatures
class TestPCA(unittest.TestCase):
def setUp(self):
iris = datasets.load_iris()
sc = StandardScaler()
self.X = sc.fit_transform(iris.data)
def test_pca(self):
rankings = PCAFeatures()
importances = rankings.produce(self.X)
self.assertTrue(
np.array_equal(
importances, np.array([2, 3, 0, 1])) )
class TestRFC(unittest.TestCase):
def setUp(self):
df_wine = pd.read_csv('https://raw.githubusercontent.com/rasbt/'
'python-machine-learning-book/master/code/datasets/wine/wine.data',
header=None)
X, y = df_wine.iloc[:, 1:].values, df_wine.iloc[:, 0].values
self.X, _, self.y, _ = train_test_split(X, y, test_size=0.3, random_state=0)
def test_rfc(self):
rf = RFFeatures(problem_type="classification", cv=3,
scoring="accuracy", verbose=0, n_jobs=1)
indices = rf.produce((self.X, self.y))
self.assertTrue( np.all(np.isfinite( rf.feature_importances )) )
importances = np.array([9, 12, 6, 11, 0, 10, 5, 3, 1, 8, 4, 7, 2])
self.assertTrue( np.array_equal(indices, importances) )
class TestRFR(unittest.TestCase):
def setUp(self):
boston = datasets.load_boston()
self.X, self.y = boston.data, boston.target
def test_rfr(self):
rf = RFFeatures(problem_type="regression", cv=3,
scoring="r2", verbose=0, n_jobs=1)
indices = rf.produce((self.X, self.y))
self.assertTrue( np.all(np.isfinite( rf.feature_importances )) )
importances = np.array([5, 12, 7, 0, 4, 10, 9, 6, 11, 2, 8, 1, 3])
self.assertTrue( np.array_equal(indices, importances) )
if __name__ == '__main__':
unittest.main() | 35.666667 | 98 | 0.583 | 277 | 2,247 | 4.592058 | 0.364621 | 0.023585 | 0.035377 | 0.031447 | 0.413522 | 0.237421 | 0.237421 | 0.168239 | 0.168239 | 0.168239 | 0 | 0.030476 | 0.299065 | 2,247 | 63 | 99 | 35.666667 | 0.777143 | 0 | 0 | 0.195652 | 0 | 0 | 0.064947 | 0.02847 | 0 | 0 | 0 | 0 | 0.108696 | 1 | 0.130435 | false | 0 | 0.347826 | 0 | 0.543478 | 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 |
6b6f7a61e5e93d5e09483ec5c09b8dfa71ba3d9c | 58,726 | py | Python | test/_data/generator/dps_pds/gp_practices.py | NHSDigital/list-reconciliation | 37b1ebe99a64275e23b0e7fb6a89415b92d14306 | [
"MIT"
] | 4 | 2021-06-25T08:28:54.000Z | 2021-12-16T11:03:42.000Z | test/_data/generator/dps_pds/gp_practices.py | NHSDigital/list-reconciliation | 37b1ebe99a64275e23b0e7fb6a89415b92d14306 | [
"MIT"
] | 184 | 2021-06-24T15:27:08.000Z | 2022-03-17T12:44:28.000Z | test/_data/generator/dps_pds/gp_practices.py | NHSDigital/list-reconciliation | 37b1ebe99a64275e23b0e7fb6a89415b92d14306 | [
"MIT"
] | 3 | 2021-11-05T10:21:44.000Z | 2022-03-04T14:29:24.000Z | ref = [
"A00002",
"A00005",
"A10001",
"A10002",
"A10003",
"A10004",
"A10005",
"A10006",
"A10007",
"A10008",
"A10009",
"A10010",
"A10011",
"A10012",
"A10013",
"A10014",
"A10015",
"A10016",
"A10017",
"A10018",
"A10019",
"A10020",
"A10021",
"A10022",
"A10023",
"A10024",
"A10025",
"A10026",
"A10027",
"A10028",
"A10029",
"A10030",
"A10031",
"A10032",
"A10033",
"A10034",
"A10035",
"A10036",
"A10037",
"A10038",
"A10039",
"A10040",
"A10041",
"A10042",
"A10043",
"A10044",
"A10045",
"A10046",
"A10047",
"A10048",
"A10049",
"A10050",
"A10051",
"A10052",
"A10053",
"A10054",
"A10055",
"A10056",
"A10057",
"A10058",
"A10059",
"A10060",
"A10061",
"A10062",
"A10063",
"A10064",
"A10065",
"A10066",
"A10067",
"A10068",
"A10069",
"A10070",
"A10071",
"A10072",
"A10073",
"A10074",
"A10075",
"A10076",
"A10077",
"A10078",
"A10079",
"A10080",
"A10081",
"A10082",
"A10083",
"A10084",
"A10085",
"A10086",
"A10087",
"A10088",
"A10089",
"A10090",
"A10091",
"A10092",
"A10093",
"A10094",
"A10095",
"A10096",
"A10097",
"A10098",
"A10099",
"A10100",
"A10101",
"A10102",
"A10103",
"A10104",
"A10105",
"A10106",
"A10107",
"A10108",
"A10109",
"A10110",
"A10111",
"A10112",
"A10113",
"A10114",
"A10115",
"A10116",
"A10117",
"A10118",
"A10119",
"A10120",
"A10121",
"A10122",
"A10123",
"A10124",
"A10125",
"A10150",
"A10151",
"A10152",
"A10153",
"A10154",
"A10155",
"A10156",
"A10157",
"A10158",
"A10159",
"A10160",
"A10161",
"A10162",
"A10163",
"A10164",
"A10165",
"A10166",
"A10167",
"A10168",
"A10169",
"A10170",
"A10171",
"A10172",
"A10173",
"A10174",
"A10175",
"A10176",
"A10177",
"A10178",
"A10179",
"A10180",
"A10181",
"A10182",
"A10183",
"A10184",
"A10185",
"A10186",
"A10187",
"A10188",
"A10189",
"A10190",
"A10191",
"A10192",
"A10193",
"A10194",
"A10195",
"A10196",
"A10197",
"A10198",
"A10199",
"A10201",
"A10202",
"A10203",
"A10204",
"A10205",
"A10206",
"A10207",
"A10210",
"A15501",
"A15502",
"A20000",
"A20001",
"A20002",
"A20003",
"A20004",
"A20005",
"A20006",
"A20007",
"A20008",
"A20009",
"A20010",
"A20011",
"A20012",
"A20013",
"A20014",
"A20015",
"A20016",
"A20017",
"A20018",
"A20019",
"A20020",
"A20021",
"A20022",
"A20023",
"A20024",
"A20025",
"A20026",
"A20027",
"A20028",
"A20030",
"A20031",
"A20032",
"A20033",
"A20034",
"A20035",
"A20043",
"A20044",
"A20045",
"A20046",
"A20047",
"A20052",
"A20053",
"A20055",
"A20056",
"A20058",
"A20060",
"A20062",
"A20063",
"A20065",
"A20066",
"A20067",
"A20074",
"A20076",
"A20079",
"A20092",
"A20093",
"A20094",
"A20095",
"A20096",
"A20097",
"A20098",
"A20099",
"A20101",
"A20102",
"A20103",
"A20104",
"A20105",
"A20106",
"A20107",
"A20127",
"A20130",
"A20135",
"A20140",
"A20145",
"A20150",
"A20200",
"A20201",
"A20202",
"A20203",
"A20204",
"A20205",
"A20206",
"A20207",
"A20208",
"A20209",
"A20210",
"A20211",
"A20212",
"A20213",
"A20214",
"A20215",
"A20216",
"A20217",
"A20218",
"A20219",
"A20220",
"A20221",
"A20222",
"A20223",
"A20224",
"A20225",
"A20226",
"A20227",
"A20228",
"A20229",
"A20230",
"A20231",
"A20232",
"A20233",
"A20234",
"A20235",
"A20236",
"A20237",
"A20238",
"A20239",
"A20240",
"A20241",
"A20242",
"A20243",
"A20244",
"A20245",
"A20246",
"A20247",
"A20248",
"A20249",
"A20250",
"A20251",
"A20252",
"A20253",
"A20254",
"A20255",
"A20256",
"A20257",
"A20258",
"A20259",
"A20260",
"A20261",
"A20262",
"A20263",
"A20264",
"A20265",
"A20266",
"A20267",
"A20268",
"A20269",
"A20270",
"A20271",
"A20272",
"A20273",
"A20274",
"A20275",
"A20276",
"A20277",
"A20278",
"A20279",
"A20280",
"A20281",
"A20282",
"A20283",
"A20284",
"A20285",
"A20286",
"A20287",
"A20288",
"A20289",
"A20290",
"A20291",
"A20292",
"A20293",
"A20294",
"A20295",
"A20296",
"A20297",
"A20298",
"A20299",
"A20300",
"A20301",
"A20302",
"A20303",
"A20304",
"A20305",
"A20306",
"A20307",
"A20308",
"A20309",
"A20310",
"A20311",
"A20312",
"A20313",
"A20314",
"A20315",
"A20316",
"A20317",
"A20318",
"A20319",
"A20320",
"A20321",
"A20322",
"A20323",
"A20324",
"A20325",
"A20326",
"A20327",
"A20328",
"A20329",
"A20330",
"A20331",
"A20332",
"A20333",
"A20334",
"A20335",
"A20336",
"A20337",
"A20338",
"A20339",
"A20340",
"A20341",
"A20342",
"A20343",
"A20344",
"A20345",
"A20346",
"A20347",
"A20348",
"A20349",
"A20350",
"A20351",
"A20352",
"A20353",
"A20354",
"A20355",
"A20356",
"A20357",
"A20358",
"A20359",
"A20360",
"A20361",
"A20362",
"A20363",
"A20364",
"A20365",
"A20366",
"A20367",
"A20368",
"A20369",
"A20370",
"A20371",
"A20372",
"A20373",
"A20374",
"A20375",
"A20376",
"A20377",
"A20378",
"A20379",
"A20380",
"A20381",
"A20382",
"A20383",
"A20384",
"A20385",
"A20386",
"A20387",
"A20388",
"A20389",
"A20390",
"A20391",
"A20392",
"A20393",
"A20394",
"A20395",
"A20396",
"A20397",
"A20398",
"A20399",
"A20400",
"A20401",
"A20402",
"A20403",
"A20405",
"A20406",
"A20407",
"A20408",
"A20409",
"A20410",
"A20411",
"A20412",
"A20413",
"A20414",
"A20415",
"A20416",
"A20417",
"A20418",
"A20419",
"A20420",
"A20421",
"A20422",
"A20423",
"A20424",
"A20425",
"A20426",
"A20427",
"A20428",
"A20429",
"A20430",
"A20431",
"A20432",
"A20433",
"A20434",
"A20435",
"A20436",
"A20437",
"A20438",
"A20440",
"A20441",
"A20442",
"A20443",
"A20444",
"A20445",
"A20446",
"A20447",
"A20448",
"A20449",
"A20450",
"A20451",
"A20452",
"A20453",
"A20454",
"A20455",
"A20456",
"A20458",
"A20459",
"A20460",
"A20461",
"A20462",
"A20463",
"A20464",
"A20465",
"A20466",
"A20467",
"A20468",
"A20469",
"A20470",
"A20471",
"A20472",
"A20473",
"A20474",
"A20475",
"A20476",
"A20477",
"A20478",
"A20479",
"A20480",
"A20481",
"A20482",
"A20483",
"A20484",
"A20485",
"A20486",
"A20487",
"A20488",
"A20489",
"A20490",
"A20491",
"A20492",
"A20493",
"A20494",
"A20495",
"A20496",
"A20497",
"A20498",
"A20499",
"A20650",
"A20651",
"A20652",
"A20653",
"A20654",
"A20655",
"A20656",
"A20657",
"A20658",
"A20659",
"A20660",
"A20661",
"A20662",
"A20663",
"A20664",
"A20665",
"A20666",
"A20667",
"A20668",
"A20669",
"A20670",
"A20671",
"A20672",
"A20673",
"A20674",
"A20675",
"A20676",
"A20677",
"A20678",
"A20679",
"A20680",
"A20681",
"A20682",
"A20683",
"A20684",
"A20685",
"A20686",
"A20687",
"A20688",
"A20689",
"A20690",
"A20691",
"A20693",
"A20694",
"A20695",
"A20696",
"A20697",
"A20698",
"A20699",
"A20700",
"A20701",
"A20702",
"A20703",
"A20704",
"A20705",
"A20706",
"A20707",
"A20708",
"A20709",
"A20710",
"A20711",
"A20712",
"A20713",
"A20714",
"A20715",
"A20716",
"A20717",
"A20718",
"A20719",
"A20720",
"A20721",
"A20722",
"A20723",
"A20724",
"A20725",
"A20726",
"A20727",
"A20728",
"A20729",
"A20730",
"A20731",
"A20732",
"A20734",
"A20735",
"A20736",
"A20737",
"A20738",
"A20739",
"A20740",
"A20741",
"A20742",
"A20743",
"A20744",
"A20745",
"A20746",
"A20747",
"A20748",
"A20749",
"A20750",
"A20751",
"A20752",
"A20753",
"A20754",
"A20755",
"A20756",
"A20757",
"A20758",
"A20759",
"A20760",
"A20761",
"A20762",
"A20763",
"A20764",
"A20765",
"A20766",
"A20767",
"A20768",
"A20769",
"A20770",
"A20771",
"A20772",
"A20773",
"A20774",
"A20775",
"A20776",
"A20777",
"A20778",
"A20779",
"A20780",
"A20781",
"A20782",
"A20783",
"A20784",
"A20785",
"A20786",
"A20787",
"A20788",
"A20789",
"A20790",
"A20791",
"A20792",
"A20793",
"A20794",
"A20795",
"A20796",
"A20797",
"A20798",
"A20799",
"A20800",
"A20801",
"A20802",
"A20803",
"A20804",
"A20805",
"A20806",
"A20807",
"A20808",
"A20809",
"A20810",
"A20811",
"A20812",
"A20813",
"A20814",
"A20815",
"A20816",
"A20817",
"A20818",
"A20819",
"A20820",
"A20821",
"A20822",
"A20823",
"A20824",
"A20825",
"A20826",
"A20827",
"A20828",
"A20829",
"A20830",
"A20831",
"A20832",
"A20833",
"A20834",
"A20835",
"A20836",
"A20837",
"A20838",
"A20839",
"A20840",
"A20841",
"A20842",
"A20843",
"A20844",
"A20845",
"A20846",
"A20847",
"A20848",
"A20849",
"A20850",
"A20851",
"A20852",
"A20853",
"A20854",
"A20855",
"A20856",
"A20857",
"A21099",
"A21163",
"A21164",
"A21165",
"A21166",
"A21172",
"A21173",
"A21174",
"A21175",
"A21176",
"A21177",
"A21178",
"A21180",
"A21181",
"A21182",
"A21183",
"A21184",
"A21185",
"A21186",
"A21187",
"A21199",
"A21202",
"A21203",
"A21204",
"A21205",
"A21206",
"A21207",
"A21208",
"A21209",
"A21210",
"A21211",
"A21215",
"A21216",
"A21217",
"A21218",
"A21219",
"A21220",
"A21225",
"A21226",
"A21229",
"A21230",
"A21235",
"A21244",
"A21245",
"A21246",
"A21247",
"A21248",
"A21249",
"A21254",
"A21257",
"A21261",
"A21262",
"A21270",
"A21271",
"A21292",
"A21293",
"A21294",
"A21295",
"A21296",
"A21297",
"A21299",
"A21401",
"A21402",
"A21405",
"A21410",
"A21412",
"A21413",
"A21425",
"A21426",
"A21427",
"A21428",
"A21429",
"A21431",
"A21433",
"A21434",
"A21435",
"A21436",
"A21461",
"A21463",
"A21464",
"A21465",
"A21467",
"A21468",
"A21471",
"A21472",
"A21473",
"A21474",
"A21475",
"A21476",
"A21477",
"A21479",
"A21484",
"A21490",
"A21998",
"A22020",
"A22265",
"A22266",
"A22267",
"A22268",
"A22269",
"A22270",
"A22271",
"A22272",
"A22273",
"A22274",
"A22275",
"A22276",
"A22277",
"A22279",
"A22283",
"A22289",
"A22290",
"A22291",
"A22300",
"A22301",
"A22302",
"A22303",
"A22304",
"A22305",
"A22306",
"A22307",
"A22308",
"A22309",
"A22310",
"A22311",
"A22312",
"A22313",
"A22314",
"A22315",
"A22316",
"A22317",
"A22318",
"A22319",
"A22320",
"A22321",
"A22322",
"A22323",
"A22324",
"A22325",
"A22326",
"A22327",
"A22328",
"A22329",
"A22330",
"A22331",
"A22332",
"A22333",
"A22334",
"A22335",
"A22336",
"A22337",
"A22338",
"A22339",
"A22340",
"A22341",
"A22342",
"A22343",
"A22344",
"A22345",
"A22346",
"A22347",
"A22348",
"A22349",
"A22350",
"A22351",
"A22352",
"A22353",
"A22354",
"A22355",
"A22356",
"A22357",
"A22358",
"A22359",
"A22360",
"A22361",
"A22362",
"A22363",
"A22364",
"A22365",
"A22366",
"A22367",
"A22368",
"A22369",
"A22370",
"A22371",
"A22372",
"A22373",
"A22374",
"A22375",
"A22376",
"A22377",
"A22378",
"A22379",
"A22380",
"A22381",
"A22382",
"A22383",
"A22384",
"A22385",
"A22386",
"A22387",
"A22388",
"A22389",
"A22390",
"A22391",
"A22392",
"A22393",
"A22394",
"A22395",
"A22396",
"A22397",
"A22398",
"A22399",
"A22400",
"A22401",
"A22601",
"A23020",
"A23571",
"A24185",
"A24264",
"A24379",
"A24595",
"A24701",
"A24915",
"A25630",
"A25736",
"A26201",
"A26543",
"A26611",
"A26684",
"A26990",
"A27003",
"A27185",
"A27593",
"A27691",
"A27915",
"A28009",
"A28097",
"A28394",
"A28492",
"A28665",
"A28741",
"A28830",
"A28947",
"A29252",
"A29271",
"A29344",
"A29434",
"A29586",
"A29683",
"A29792",
"A29811",
"A29812",
"A29813",
"A80016",
"A81001",
"A81002",
"A81003",
"A81004",
"A81005",
"A81006",
"A81007",
"A81008",
"A81009",
"A81010",
"A81011",
"A81012",
"A81013",
"A81014",
"A81015",
"A81016",
"A81017",
"A81018",
"A81019",
"A81020",
"A81021",
"A81022",
"A81023",
"A81025",
"A81026",
"A81027",
"A81029",
"A81030",
"A81031",
"A81032",
"A81033",
"A81034",
"A81035",
"A81036",
"A81037",
"A81038",
"A81039",
"A81040",
"A81041",
"A81042",
"A81043",
"A81044",
"A81045",
"A81046",
"A81047",
"A81048",
"A81049",
"A81051",
"A81052",
"A81053",
"A81054",
"A81055",
"A81056",
"A81057",
"A81058",
"A81060",
"A81061",
"A81063",
"A81064",
"A81065",
"A81066",
"A81067",
"A81068",
"A81069",
"A81070",
"A81071",
"A81602",
"A81605",
"A81608",
"A81609",
"A81610",
"A81611",
"A81612",
"A81613",
"A81616",
"A81618",
"A81620",
"A81621",
"A81622",
"A81623",
"A81625",
"A81627",
"A81629",
"A81630",
"A81631",
"A81632",
"A81633",
"A81634",
"A82001",
"A82003",
"A82004",
"A82005",
"A82006",
"A82007",
"A82008",
"A82009",
"A82010",
"A82011",
"A82012",
"A82013",
"A82014",
"A82015",
"A82016",
"A82017",
"A82018",
"A82019",
"A82020",
"A82021",
"A82022",
"A82023",
"A82024",
"A82025",
"A82026",
"A82027",
"A82028",
"A82029",
"A82030",
"A82031",
"A82032",
"A82033",
"A82034",
"A82035",
"A82036",
"A82037",
"A82038",
"A82039",
"A82040",
"A82041",
"A82042",
"A82044",
"A82045",
"A82046",
"A82047",
"A82048",
"A82049",
"A82050",
"A82052",
"A82053",
"A82055",
"A82056",
"A82057",
"A82058",
"A82060",
"A82061",
"A82062",
"A82063",
"A82064",
"A82065",
"A82068",
"A82070",
"A82071",
"A82072",
"A82074",
"A82075",
"A82077",
"A82502",
"A82607",
"A82608",
"A82609",
"A82613",
"A82614",
"A82615",
"A82616",
"A82617",
"A82618",
"A82619",
"A82620",
"A82621",
"A82622",
"A82623",
"A82624",
"A82625",
"A82627",
"A82629",
"A82630",
"A82631",
"A82632",
"A82635",
"A82636",
"A82641",
"A82642",
"A82645",
"A82646",
"A82647",
"A82648",
"A82649",
"A82650",
"A82651",
"A82654",
"A83001",
"A83003",
"A83004",
"A83005",
"A83006",
"A83007",
"A83008",
"A83009",
"A83010",
"A83011",
"A83012",
"A83013",
"A83014",
"A83015",
"A83016",
"A83017",
"A83018",
"A83019",
"A83020",
"A83021",
"A83022",
"A83023",
"A83024",
"A83025",
"A83026",
"A83027",
"A83028",
"A83029",
"A83030",
"A83031",
"A83032",
"A83033",
"A83034",
"A83035",
"A83036",
"A83037",
"A83038",
"A83040",
"A83041",
"A83042",
"A83043",
"A83044",
"A83045",
"A83046",
"A83047",
"A83048",
"A83049",
"A83050",
"A83051",
"A83052",
"A83054",
"A83055",
"A83057",
"A83060",
"A83061",
"A83066",
"A83068",
"A83070",
"A83071",
"A83072",
"A83073",
"A83074",
"A83075",
"A83076",
"A83603",
"A83610",
"A83616",
"A83617",
"A83618",
"A83619",
"A83622",
"A83626",
"A83627",
"A83630",
"A83632",
"A83634",
"A83635",
"A83636",
"A83637",
"A83638",
"A83641",
"A83642",
"A83644",
"A84002",
"A84003",
"A84005",
"A84006",
"A84007",
"A84008",
"A84009",
"A84011",
"A84013",
"A84014",
"A84015",
"A84016",
"A84018",
"A84020",
"A84021",
"A84022",
"A84024",
"A84025",
"A84026",
"A84027",
"A84028",
"A84029",
"A84030",
"A84031",
"A84032",
"A84033",
"A84034",
"A84035",
"A84036",
"A84037",
"A84038",
"A84039",
"A84040",
"A84042",
"A84043",
"A84044",
"A84045",
"A84047",
"A84048",
"A84604",
"A84609",
"A84613",
"A84614",
"A84619",
"A85001",
"A85002",
"A85003",
"A85004",
"A85005",
"A85006",
"A85007",
"A85008",
"A85009",
"A85010",
"A85011",
"A85012",
"A85013",
"A85014",
"A85015",
"A85016",
"A85017",
"A85018",
"A85019",
"A85020",
"A85021",
"A85023",
"A85024",
"A85025",
"A85026",
"A85601",
"A85605",
"A85609",
"A85611",
"A85614",
"A85615",
"A85616",
"A85617",
"A85618",
"A85619",
"A85620",
"A85621",
"A86003",
"A86004",
"A86005",
"A86006",
"A86007",
"A86008",
"A86009",
"A86010",
"A86011",
"A86012",
"A86013",
"A86015",
"A86016",
"A86017",
"A86018",
"A86020",
"A86021",
"A86022",
"A86023",
"A86024",
"A86025",
"A86026",
"A86027",
"A86028",
"A86029",
"A86030",
"A86031",
"A86033",
"A86035",
"A86036",
"A86037",
"A86038",
"A86040",
"A86041",
"A86601",
"A86608",
"A86612",
"A86618",
"A87002",
"A87003",
"A87004",
"A87005",
"A87006",
"A87007",
"A87008",
"A87009",
"A87011",
"A87012",
"A87013",
"A87014",
"A87015",
"A87016",
"A87017",
"A87019",
"A87020",
"A87022",
"A87023",
"A87027",
"A87029",
"A87030",
"A87600",
"A87604",
"A87608",
"A87612",
"A87615",
"A88001",
"A88002",
"A88003",
"A88004",
"A88005",
"A88006",
"A88007",
"A88008",
"A88009",
"A88010",
"A88011",
"A88012",
"A88013",
"A88014",
"A88015",
"A88016",
"A88018",
"A88020",
"A88022",
"A88023",
"A88025",
"A88601",
"A88603",
"A88608",
"A88611",
"A88613",
"A88614",
"A88616",
"A89001",
"A89002",
"A89003",
"A89004",
"A89005",
"A89006",
"A89007",
"A89008",
"A89009",
"A89010",
"A89011",
"A89012",
"A89013",
"A89014",
"A89015",
"A89016",
"A89017",
"A89018",
"A89019",
"A89020",
"A89021",
"A89022",
"A89023",
"A89024",
"A89025",
"A89026",
"A89027",
"A89028",
"A89029",
"A89030",
"A89031",
"A89032",
"A89034",
"A89035",
"A89036",
"A89038",
"A89040",
"A89041",
"A89042",
"A89603",
"A89604",
"A89610",
"A89611",
"A89612",
"A89614",
"A89616",
"A89617",
"A89620",
"A89621",
"A89623",
"A89624",
"A89630",
"A91023",
"A91024",
"A91168",
"A91180",
"A91181",
"A91182",
"A91192",
"A91193",
"A91299",
"A91346",
"A91580",
"AD2000",
"B81001",
"B81002",
"B81003",
"B81004",
"B81005",
"B81006",
"B81007",
"B81008",
"B81009",
"B81010",
"B81011",
"B81012",
"B81013",
"B81014",
"B81015",
"B81016",
"B81017",
"B81018",
"B81019",
"B81020",
"B81021",
"B81022",
"B81023",
"B81024",
"B81025",
"B81026",
"B81027",
"B81029",
"B81030",
"B81031",
"B81032",
"B81034",
"B81035",
"B81036",
"B81037",
"B81038",
"B81039",
"B81040",
"B81041",
"B81042",
"B81043",
"B81044",
"B81045",
"B81046",
"B81047",
"B81048",
"B81049",
"B81050",
"B81051",
"B81052",
"B81053",
"B81054",
"B81055",
"B81056",
"B81057",
"B81058",
"B81060",
"B81061",
"B81062",
"B81063",
"B81064",
"B81065",
"B81066",
"B81068",
"B81069",
"B81070",
"B81072",
"B81074",
"B81075",
"B81077",
"B81080",
"B81081",
"B81082",
"B81083",
"B81084",
"B81085",
"B81087",
"B81088",
"B81089",
"B81090",
"B81091",
"B81092",
"B81094",
"B81095",
"B81097",
"B81099",
"B81100",
"B81101",
"B81102",
"B81104",
"B81108",
"B81109",
"B81110",
"B81112",
"B81113",
"B81118",
"B81119",
"B81120",
"B81121",
"B81602",
"B81603",
"B81606",
"B81609",
"B81615",
"B81616",
"B81617",
"B81618",
"B81619",
"B81620",
"B81622",
"B81624",
"B81626",
"B81628",
"B81629",
"B81630",
"B81631",
"B81632",
"B81633",
"B81634",
"B81635",
"B81636",
"B81639",
"B81642",
"B81644",
"B81645",
"B81646",
"B81647",
"B81648",
"B81650",
"B81653",
"B81655",
"B81656",
"B81658",
"B81662",
"B81663",
"B81664",
"B81665",
"B81666",
"B81668",
"B81669",
"B81670",
"B81671",
"B81674",
"B81675",
"B81676",
"B81677",
"B81679",
"B81682",
"B81683",
"B81685",
"B81686",
"B81688",
"B81689",
"B81690",
"B81691",
"B81692",
"B81693",
"B81694",
"B81695",
"B81696",
"B81697",
"B82001",
"B82002",
"B82003",
"B82004",
"B82005",
"B82006",
"B82007",
"B82008",
"B82010",
"B82011",
"B82012",
"B82013",
"B82014",
"B82016",
"B82017",
"B82018",
"B82019",
"B82020",
"B82021",
"B82022",
"B82023",
"B82024",
"B82025",
"B82026",
"B82027",
"B82028",
"B82029",
"B82030",
"B82031",
"B82032",
"B82033",
"B82034",
"B82035",
"B82036",
"B82037",
"B82038",
"B82041",
"B82042",
"B82044",
"B82045",
"B82046",
"B82047",
"B82049",
"B82050",
"B82053",
"B82054",
"B82055",
"B82056",
"B82057",
"B82059",
"B82060",
"B82061",
"B82062",
"B82063",
"B82064",
"B82065",
"B82066",
"B82067",
"B82068",
"B82069",
"B82071",
"B82072",
"B82073",
"B82074",
"B82075",
"B82076",
"B82077",
"B82078",
"B82079",
"B82080",
"B82081",
"B82082",
"B82083",
"B82086",
"B82087",
"B82088",
"B82091",
"B82092",
"B82095",
"B82097",
"B82098",
"B82099",
"B82100",
"B82101",
"B82102",
"B82103",
"B82104",
"B82105",
"B82106",
"B82606",
"B82609",
"B82611",
"B82613",
"B82614",
"B82617",
"B82618",
"B82619",
"B82620",
"B82622",
"B82623",
"B82624",
"B82627",
"B82628",
"B82632",
"B82636",
"B82637",
"B82639",
"B82640",
"B82645",
"B82646",
"B82683",
"B83001",
"B83002",
"B83003",
"B83005",
"B83006",
"B83007",
"B83008",
"B83009",
"B83010",
"B83011",
"B83012",
"B83013",
"B83014",
"B83015",
"B83016",
"B83017",
"B83018",
"B83019",
"B83020",
"B83021",
"B83022",
"B83023",
"B83025",
"B83026",
"B83027",
"B83028",
"B83029",
"B83030",
"B83031",
"B83032",
"B83033",
"B83034",
"B83035",
"B83037",
"B83038",
"B83039",
"B83040",
"B83041",
"B83042",
"B83043",
"B83044",
"B83045",
"B83049",
"B83050",
"B83051",
"B83052",
"B83054",
"B83055",
"B83056",
"B83058",
"B83061",
"B83062",
"B83063",
"B83064",
"B83066",
"B83067",
"B83069",
"B83070",
"B83071",
"B83602",
"B83604",
"B83605",
"B83611",
"B83613",
"B83614",
"B83617",
"B83620",
"B83621",
"B83622",
"B83624",
"B83626",
"B83627",
"B83628",
"B83629",
"B83630",
"B83631",
"B83638",
"B83641",
"B83642",
"B83646",
"B83653",
"B83654",
"B83657",
"B83658",
"B83659",
"B83660",
"B83661",
"B83673",
"B84001",
"B84002",
"B84003",
"B84004",
"B84005",
"B84006",
"B84007",
"B84008",
"B84009",
"B84010",
"B84011",
"B84012",
"B84013",
"B84014",
"B84016",
"B84017",
"B84019",
"B84021",
"B84610",
"B84612",
"B84613",
"B84615",
"B84618",
"B84623",
"B85001",
"B85002",
"B85004",
"B85005",
"B85006",
"B85008",
"B85009",
"B85010",
"B85011",
"B85012",
"B85014",
"B85015",
"B85016",
"B85018",
"B85019",
"B85020",
"B85021",
"B85022",
"B85023",
"B85024",
"B85025",
"B85026",
"B85027",
"B85028",
"B85030",
"B85031",
"B85032",
"B85033",
"B85036",
"B85037",
"B85038",
"B85041",
"B85042",
"B85044",
"B85048",
"B85049",
"B85051",
"B85054",
"B85055",
"B85058",
"B85059",
"B85060",
"B85061",
"B85062",
"B85606",
"B85610",
"B85611",
"B85612",
"B85614",
"B85619",
"B85620",
"B85621",
"B85622",
"B85623",
"B85634",
"B85636",
"B85638",
"B85640",
"B85641",
"B85644",
"B85645",
"B85646",
"B85650",
"B85652",
"B85655",
"B85659",
"B85660",
"B86001",
"B86002",
"B86003",
"B86004",
"B86005",
"B86006",
"B86007",
"B86008",
"B86009",
"B86010",
"B86011",
"B86012",
"B86013",
"B86014",
"B86015",
"B86016",
"B86017",
"B86018",
"B86019",
"B86020",
"B86022",
"B86023",
"B86024",
"B86025",
"B86026",
"B86028",
"B86029",
"B86030",
"B86031",
"B86032",
"B86033",
"B86034",
"B86035",
"B86036",
"B86037",
"B86038",
"B86039",
"B86041",
"B86042",
"B86043",
"B86044",
"B86046",
"B86047",
"B86048",
"B86049",
"B86050",
"B86051",
"B86052",
"B86054",
"B86055",
"B86056",
"B86057",
"B86058",
"B86059",
"B86060",
"B86061",
"B86062",
"B86064",
"B86066",
"B86067",
"B86068",
"B86069",
"B86070",
"B86071",
"B86074",
"B86075",
"B86077",
"B86081",
"B86086",
"B86089",
"B86092",
"B86093",
"B86094",
"B86095",
"B86096",
"B86100",
"B86101",
"B86102",
"B86103",
"B86104",
"B86105",
"B86106",
"B86107",
"B86108",
"B86109",
"B86110",
"B86623",
"B86625",
"B86628",
"B86633",
"B86638",
"B86642",
"B86643",
"B86648",
"B86650",
"B86651",
"B86654",
"B86655",
"B86658",
"B86666",
"B86667",
"B86669",
"B86670",
"B86672",
"B86673",
"B86675",
"B86678",
"B86682",
"B86683",
"B87001",
"B87002",
"B87003",
"B87004",
"B87005",
"B87006",
"B87007",
"B87008",
"B87009",
"B87011",
"B87012",
"B87013",
"B87015",
"B87016",
"B87017",
"B87018",
"B87019",
"B87020",
"B87021",
"B87022",
"B87023",
"B87025",
"B87026",
"B87027",
"B87028",
"B87029",
"B87030",
"B87031",
"B87032",
"B87033",
"B87036",
"B87039",
"B87040",
"B87041",
"B87042",
"B87044",
"B87600",
"B87602",
"B87604",
"B87614",
"C81001",
"C81002",
"C81003",
"C81004",
"C81005",
"C81006",
"C81007",
"C81008",
"C81009",
"C81010",
"C81012",
"C81013",
"C81014",
"C81015",
"C81016",
"C81018",
"C81019",
"C81021",
"C81023",
"C81026",
"C81027",
"C81028",
"C81029",
"C81033",
"C81034",
"C81035",
"C81036",
"C81040",
"C81042",
"C81047",
"C81051",
"C81052",
"C81054",
"C81056",
"C81060",
"C81071",
"C81072",
"C81074",
"C81075",
"C81076",
"C81077",
"C81080",
"C81081",
"C81082",
"C81091",
"C81094",
"C81095",
"C81096",
"C81097",
"C81099",
"C81106",
"C81107",
"C81115",
"C81118",
"C81604",
"C81611",
"C81616",
"C81620",
"C81626",
"C81630",
"C81633",
"C81651",
"C81678",
"C82001",
"C82002",
"C82003",
"C82005",
"C82007",
"C82008",
"C82009",
"C82010",
"C82011",
"C82012",
"C82015",
"C82016",
"C82018",
"C82019",
"C82026",
"C82029",
"C82032",
"C82036",
"C82038",
"C82040",
"C82042",
"C82044",
"C82052",
"C82058",
"C82059",
"C82063",
"C82064",
"C82066",
"C82092",
"C82093",
"C82103",
"C82121",
"C82674",
"C83001",
"C83002",
"C83004",
"C83005",
"C83008",
"C83009",
"C83011",
"C83014",
"C83016",
"C83019",
"C83030",
"C83054",
"C83063",
"C83073",
"C83078",
"C83614",
"C83615",
"C83617",
"C83637",
"C83649",
"C83656",
"C84001",
"C84002",
"C84003",
"C84004",
"C84005",
"C84008",
"C84009",
"C84010",
"C84011",
"C84012",
"C84013",
"C84014",
"C84016",
"C84017",
"C84018",
"C84019",
"C84020",
"C84021",
"C84023",
"C84024",
"C84026",
"C84029",
"C84030",
"C84032",
"C84033",
"C84034",
"C84036",
"C84039",
"C84043",
"C84045",
"C84047",
"C84051",
"C84057",
"C84059",
"C84069",
"C84078",
"C84080",
"C84087",
"C84092",
"C84106",
"C84113",
"C84120",
"C84123",
"C84128",
"C84140",
"C84150",
"C84613",
"C84619",
"C84624",
"C84628",
"C84637",
"C84648",
"C84649",
"C84655",
"C84656",
"C84658",
"C84661",
"C84675",
"C84676",
"C84678",
"C84679",
"C84710",
"C85001",
"C85003",
"C85004",
"C85005",
"C85007",
"C85011",
"C85022",
"C85033",
"C85617",
"C85618",
"C85620",
"C86001",
"C86002",
"C86003",
"C86005",
"C86006",
"C86007",
"C86009",
"C86012",
"C86023",
"C86025",
"C86029",
"C86030",
"C86614",
"C86622",
"C87002",
"C87003",
"C87004",
"C87005",
"C87007",
"C87008",
"C87013",
"C87019",
"C87022",
"C87030",
"C87604",
"C87612",
"C87617",
"C87621",
"C88005",
"C88006",
"C88007",
"C88008",
"C88009",
"C88014",
"C88016",
"C88028",
"C88032",
"C88037",
"C88038",
"C88041",
"C88043",
"C88046",
"C88048",
"C88062",
"C88073",
"C88077",
"C88078",
"C88079",
"C88080",
"C88081",
"C88082",
"C88083",
"C88084",
"C88086",
"C88091",
"C88096",
"C88652",
"C88653",
"C88655",
"D81001",
"D81002",
"D81003",
"D81004",
"D81006",
"D81007",
"D81008",
"D81014",
"D81015",
"D81016",
"D81019",
"D81021",
"D81022",
"D81023",
"D81024",
"D81025",
"D81026",
"D81029",
"D81031",
"D81045",
"D81046",
"D81047",
"D81050",
"D81616",
"D81618",
"D81625",
"D81629",
"D81633",
"D82001",
"D82002",
"D82003",
"D82004",
"D82005",
"D82006",
"D82007",
"D82008",
"D82009",
"D82010",
"D82011",
"D82012",
"D82015",
"D82016",
"D82019",
"D82020",
"D82021",
"D82026",
"D82027",
"D82031",
"D82034",
"D82040",
"D82042",
"D82044",
"D82051",
"D82053",
"D82055",
"D82060",
"D82061",
"D82062",
"D82064",
"D82067",
"D82069",
"D82070",
"D82073",
"D82078",
"D82087",
"D82088",
"D82096",
"D82099",
"D82103",
"D82104",
"D82105",
"D82106",
"D82614",
"D82620",
"D82623",
"D82625",
"D82626",
"D82632",
"D82633",
"D82634",
"D82641",
"D82643",
"D83001",
"D83002",
"D83003",
"D83004",
"D83005",
"D83006",
"D83009",
"D83010",
"D83011",
"D83012",
"D83013",
"D83026",
"D83030",
"D83033",
"D83034",
"D83036",
"D83043",
"D83060",
"D83069",
"D83071",
"D83074",
"D83075",
"D83078",
"D83081",
"D83620",
"E00001",
"E81001",
"E81002",
"E81003",
"E81004",
"E81005",
"E81006",
"E81008",
"E81010",
"E81011",
"E81016",
"E81017",
"E81019",
"E81023",
"E81026",
"E81028",
"E81030",
"E81031",
"E81037",
"E81038",
"E81046",
"E81048",
"E81049",
"E81051",
"E81056",
"E81060",
"E81061",
"E81064",
"E81611",
"E81615",
"E81627",
"E81640",
"E82001",
"E82002",
"E82004",
"E82005",
"E82009",
"E82011",
"E82012",
"E82013",
"E82016",
"E82019",
"E82020",
"E82024",
"E82025",
"E82027",
"E82028",
"E82040",
"E82042",
"E82043",
"E82045",
"E82048",
"E82049",
"E82053",
"E82055",
"E82060",
"E82074",
"E82078",
"E82083",
"E82085",
"E82094",
"E82096",
"E82097",
"E82099",
"E82109",
"E82113",
"E82117",
"E82124",
"E82614",
"E82624",
"E82641",
"E82644",
"E82652",
"E82657",
"E82662",
"E83003",
"E83005",
"E83006",
"E83007",
"E83008",
"E83009",
"E83018",
"E83027",
"E83044",
"E83600",
"E83613",
"E83654",
"E84002",
"E84003",
"E84004",
"E84005",
"E84006",
"E84007",
"E84012",
"E84013",
"E84014",
"E84015",
"E84017",
"E84025",
"E84044",
"E84056",
"E84059",
"E84064",
"E84067",
"E84080",
"E84601",
"E84627",
"E84645",
"E84646",
"E84658",
"E84695",
"E84702",
"E85001",
"E85012",
"E85013",
"E85014",
"E85019",
"E85053",
"E85059",
"E85066",
"E85075",
"E85096",
"E85109",
"E85110",
"E85120",
"E85623",
"E85650",
"E85655",
"E85657",
"E85675",
"E85681",
"E85714",
"E85718",
"E85744",
"E86001",
"E86003",
"E86004",
"E86005",
"E86006",
"E86007",
"E86009",
"E86010",
"E86011",
"E86012",
"E86014",
"E86015",
"E86016",
"E86017",
"E86018",
"E86019",
"E86020",
"E86022",
"E86023",
"E86024",
"E86026",
"E86027",
"E86028",
"E86029",
"E86030",
"E86033",
"E86034",
"E86036",
"E86038",
"E86041",
"E86042",
"E86605",
"E86609",
"E86610",
"E86612",
"E86615",
"E86616",
"E86617",
"E86618",
"E86619",
"E86620",
"E86622",
"E86625",
"E86626",
"E86632",
"E86633",
"E86635",
"E86637",
"E86638",
"E86639",
"E86640",
"E87006",
"E87008",
"E87016",
"E87021",
"E87024",
"E87048",
"E87052",
"E87070",
"E87630",
"E87637",
"E87665",
"E87670",
"E87681",
"E87711",
"E87735",
"E87737",
"E87745",
"E87746",
"E87761",
"F81002",
"F81003",
"F81004",
"F81005",
"F81009",
"F81010",
"F81011",
"F81012",
"F81014",
"F81015",
"F81016",
"F81017",
"F81018",
"F81019",
"F81020",
"F81021",
"F81022",
"F81026",
"F81027",
"F81030",
"F81043",
"F81052",
"F81065",
"F81073",
"F81074",
"F81076",
"F81079",
"F81082",
"F81084",
"F81087",
"F81088",
"F81091",
"F81102",
"F81103",
"F81110",
"F81112",
"F81120",
"F81121",
"F81133",
"F81143",
"F81151",
"F81153",
"F81183",
"F81185",
"F81219",
"F81608",
"F81633",
"F81645",
"F81679",
"F81711",
"F81721",
"F81729",
"F81748",
"F82001",
"F82002",
"F82003",
"F82004",
"F82005",
"F82011",
"F82012",
"F82015",
"F82027",
"F82028",
"F82031",
"F82051",
"F82678",
"F82680",
"F83002",
"F83003",
"F83004",
"F83005",
"F83006",
"F83011",
"F83012",
"F83015",
"F83016",
"F83017",
"F83019",
"F83020",
"F83023",
"F83025",
"F83026",
"F83036",
"F83043",
"F83046",
"F83050",
"F83058",
"F83064",
"F83632",
"F83647",
"F83675",
"F84003",
"F84004",
"F84006",
"F84008",
"F84010",
"F84012",
"F84013",
"F84015",
"F84016",
"F84017",
"F84018",
"F84032",
"F84062",
"F84063",
"F84067",
"F84087",
"F84092",
"F84107",
"F84620",
"F84682",
"F84698",
"F84714",
"F84746",
"F84747",
"F85002",
"F85003",
"F85014",
"F85020",
"F85024",
"F85027",
"F85030",
"F85045",
"F85048",
"F85049",
"F85645",
"F85663",
"F85669",
"F86022",
"F86028",
"F86032",
"F86042",
"F86616",
"F86627",
"F86629",
"F86667",
"F86679",
"F86700",
"F86712",
"F86731",
"G81002",
"G81007",
"G81009",
"G81023",
"G81026",
"G81030",
"G81035",
"G81038",
"G81052",
"G81057",
"G81065",
"G81086",
"G81090",
"G81102",
"G81611",
"G81643",
"G81653",
"G81669",
"G81698",
"G82011",
"G82013",
"G82016",
"G82017",
"G82019",
"G82022",
"G82024",
"G82026",
"G82036",
"G82039",
"G82050",
"G82051",
"G82074",
"G82087",
"G82090",
"G82095",
"G82099",
"G82103",
"G82105",
"G82110",
"G82114",
"G82116",
"G82133",
"G82143",
"G82147",
"G82152",
"G82154",
"G82160",
"G82210",
"G82211",
"G82229",
"G82230",
"G82234",
"G82630",
"G82652",
"G82684",
"G82702",
"G82753",
"G82777",
"G83002",
"G83003",
"G83004",
"G83005",
"G83006",
"G83007",
"G83029",
"G83031",
"G83055",
"G83061",
"G83069",
"G83632",
"G83674",
"G83679",
"G84001",
"G84003",
"G84004",
"G84010",
"G84026",
"G84033",
"G84602",
"G85001",
"G85002",
"G85003",
"G85004",
"G85006",
"G85008",
"G85021",
"G85041",
"G85075",
"G85088",
"G85112",
"G85123",
"G85124",
"G85127",
"G85130",
"G85132",
"G85618",
"G85638",
"G85642",
"G85651",
"G85672",
"G85683",
"G85684",
"G85711",
"H81003",
"H81004",
"H81013",
"H81020",
"H81022",
"H81025",
"H81026",
"H81030",
"H81031",
"H81032",
"H81033",
"H81035",
"H81038",
"H81044",
"H81047",
"H81052",
"H81054",
"H81062",
"H81074",
"H81078",
"H81082",
"H81084",
"H81090",
"H81094",
"H81101",
"H81109",
"H81110",
"H81118",
"H81128",
"H81611",
"H81658",
"H81663",
"H81666",
"H81673",
"H82002",
"H82005",
"H82007",
"H82009",
"H82032",
"H82033",
"H82051",
"H82055",
"H82061",
"H82063",
"H82615",
"H82626",
"H82641",
"H82643",
"H83001",
"H83002",
"H83004",
"H83005",
"H83011",
"H83016",
"H83025",
"H83608",
"H83624",
"H83627",
"H84002",
"H84005",
"H84006",
"H84008",
"H84010",
"H84011",
"H84015",
"H84016",
"H84027",
"H84033",
"H84043",
"H84049",
"H84051",
"H84055",
"H84060",
"H84061",
"H84607",
"H84609",
"H84633",
"H84635",
"H84636",
"H85003",
"H85005",
"H85007",
"H85016",
"H85018",
"H85020",
"H85021",
"H85024",
"H85028",
"H85033",
"H85038",
"H85041",
"H85048",
"H85051",
"H85052",
"H85055",
"H85061",
"H85066",
"H85069",
"H85070",
"H85076",
"H85087",
"H85103",
"H85114",
"H85633",
"H85639",
"H85649",
"H85680",
"H85686",
"H85687",
"J81009",
"J81010",
"J81017",
"J81027",
"J81064",
"J81072",
"J81074",
"J81075",
"J81087",
"J81613",
"J81626",
"J81646",
"J82001",
"J82007",
"J82015",
"J82021",
"J82026",
"J82054",
"J82059",
"J82066",
"J82067",
"J82073",
"J82075",
"J82079",
"J82081",
"J82093",
"J82131",
"J82132",
"J82139",
"J82158",
"J82184",
"J82190",
"J82198",
"J82199",
"J82215",
"J82217",
"J82628",
"J82642",
"J82670",
"J83001",
"J83004",
"J83016",
"J83028",
"J83029",
"J83039",
"J83040",
"J83042",
"J83607",
"J83619",
"J83625",
"J84016",
"K81002",
"K81004",
"K81017",
"K81022",
"K81024",
"K81042",
"K81046",
"K81047",
"K81052",
"K81053",
"K81061",
"K81063",
"K81073",
"K81075",
"K81103",
"K81633",
"K81636",
"K81645",
"K81649",
"K81668",
"K82001",
"K82003",
"K82007",
"K82009",
"K82013",
"K82023",
"K82028",
"K82029",
"K82043",
"K82048",
"K82052",
"K82056",
"K82063",
"K82066",
"K82070",
"K82076",
"K82619",
"K82630",
"K82631",
"K82637",
"K83002",
"K83005",
"K83015",
"K83025",
"K83026",
"K83043",
"K83047",
"K83056",
"K83059",
"K83071",
"K83607",
"K83610",
"K83620",
"K83621",
"K83622",
"K83625",
"K84001",
"K84008",
"K84014",
"K84031",
"K84036",
"K84037",
"K84044",
"K84049",
"K84052",
"K84054",
"K84075",
"K84079",
"K84080",
"K84616",
"K84624",
"L81002",
"L81004",
"L81007",
"L81008",
"L81009",
"L81012",
"L81014",
"L81017",
"L81018",
"L81019",
"L81023",
"L81026",
"L81032",
"L81036",
"L81050",
"L81051",
"L81052",
"L81055",
"L81062",
"L81079",
"L81082",
"L81106",
"L81111",
"L81121",
"L81125",
"L81127",
"L81130",
"L81134",
"L81632",
"L81639",
"L81642",
"L81649",
"L82012",
"L82017",
"L82021",
"L82045",
"L82054",
"L82066",
"L83002",
"L83006",
"L83013",
"L83029",
"L83043",
"L83045",
"L83050",
"L83088",
"L83094",
"L83102",
"L83105",
"L83108",
"L83135",
"L83137",
"L83629",
"L83655",
"L83667",
"L84002",
"L84013",
"L84014",
"L84040",
"L84059",
"L84068",
"L84084",
"L84606",
"L85004",
"L85016",
"L85037",
"L85061",
"L85602",
"L85608",
"M81001",
"M81002",
"M81003",
"M81004",
"M81005",
"M81006",
"M81007",
"M81009",
"M81010",
"M81011",
"M81012",
"M81013",
"M81014",
"M81015",
"M81016",
"M81017",
"M81018",
"M81019",
"M81020",
"M81025",
"M81026",
"M81027",
"M81034",
"M81043",
"M81048",
"M81061",
"M81062",
"M81067",
"M81069",
"M81082",
"M81089",
"M82002",
"M82003",
"M82004",
"M82005",
"M82006",
"M82007",
"M82008",
"M82009",
"M82026",
"M82042",
"M82045",
"M82046",
"M82056",
"M82601",
"M83001",
"M83004",
"M83005",
"M83007",
"M83009",
"M83010",
"M83011",
"M83012",
"M83013",
"M83014",
"M83016",
"M83018",
"M83019",
"M83020",
"M83021",
"M83024",
"M83026",
"M83030",
"M83031",
"M83032",
"M83033",
"M83034",
"M83042",
"M83048",
"M83062",
"M83063",
"M83103",
"M83127",
"M83138",
"M83148",
"M83616",
"M83639",
"M83666",
"M83668",
"M83697",
"M84001",
"M84002",
"M84003",
"M84004",
"M84005",
"M84006",
"M84007",
"M84008",
"M84009",
"M84010",
"M84012",
"M84013",
"M84016",
"M84019",
"M84020",
"M84022",
"M84024",
"M84028",
"M84037",
"M84040",
"M84043",
"M84046",
"M84048",
"M84051",
"M84066",
"M84067",
"M84616",
"M84624",
"M84627",
"M84629",
"M85002",
"M85005",
"M85007",
"M85009",
"M85010",
"M85011",
"M85015",
"M85018",
"M85019",
"M85020",
"M85024",
"M85025",
"M85028",
"M85031",
"M85037",
"M85041",
"M85042",
"M85043",
"M85046",
"M85048",
"M85051",
"M85053",
"M85055",
"M85058",
"M85059",
"M85060",
"M85061",
"M85064",
"M85069",
"M85076",
"M85083",
"M85085",
"M85088",
"M85098",
"M85111",
"M85114",
"M85116",
"M85123",
"M85128",
"M85149",
"M85167",
"M85176",
"M85642",
"M85665",
"M85669",
"M85676",
"M85699",
"M85749",
"M85770",
"M85778",
"M85792",
"M85803",
"M86007",
"M86017",
"M86630",
"M87001",
"M87002",
"M87003",
"M87015",
"M87601",
"M87603",
"M87617",
"M88006",
"M88020",
"M88026",
"M88035",
"M89001",
"M89002",
"M89012",
"M89020",
"M89023",
"M89606",
"M91003",
"M91004",
"M91010",
"M91011",
"M91013",
"M91019",
"M91020",
"M91021",
"M91022",
"M91024",
"M91025",
"M91026",
"M91027",
"M91611",
"M91624",
"M91626",
"M91628",
"M91643",
"M92001",
"M92002",
"M92003",
"M92004",
"M92006",
"M92007",
"M92008",
"M92009",
"M92010",
"M92013",
"M92020",
"M92028",
"M92606",
"M92613",
"N81001",
"N81002",
"N81005",
"N81006",
"N81007",
"N81008",
"N81009",
"N81010",
"N81013",
"N81015",
"N81017",
"N81018",
"N81021",
"N81024",
"N81025",
"N81026",
"N81029",
"N81034",
"N81037",
"N81040",
"N81051",
"N81052",
"N81061",
"N81063",
"N81069",
"N81080",
"N81081",
"N81083",
"N81085",
"N81091",
"N81092",
"N81093",
"N81094",
"N81095",
"N81096",
"N81100",
"N81102",
"N81125",
"N81615",
"N81626",
"N81628",
"N81649",
"N81658",
"N82001",
"N82002",
"N82003",
"N82011",
"N82014",
"N82019",
"N82024",
"N82044",
"N82054",
"N82062",
"N82065",
"N82079",
"N82095",
"N82099",
"N82103",
"N82115",
"N82117",
"N82617",
"N82623",
"N82641",
"N82656",
"N82659",
"N82660",
"N82661",
"N82663",
"N82664",
"N82665",
"N82667",
"N82668",
"N82669",
"N82670",
"N82671",
"N82672",
"N82673",
"N82674",
"N82675",
"N82676",
"N82677",
"N82678",
"N83003",
"N83005",
"N83006",
"N83007",
"N83009",
"N83012",
"N83013",
"N83014",
"N83015",
"N83018",
"N83032",
"N83035",
"N83057",
"N84001",
"N84002",
"N84003",
"N84004",
"N84005",
"N84006",
"N84007",
"N84008",
"N84009",
"N84012",
"N84013",
"N84015",
"N84021",
"N84036",
"N84625",
"N85004",
"N85027",
"N85040",
"N85053",
"N85058",
"P81002",
"P81003",
"P81006",
"P81010",
"P81014",
"P81015",
"P81016",
"P81017",
"P81020",
"P81022",
"P81027",
"P81033",
"P81037",
"P81038",
"P81040",
"P81042",
"P81046",
"P81051",
"P81054",
"P81055",
"P81066",
"P81083",
"P81084",
"P81143",
"P81160",
"P81184",
"P81191",
"P81204",
"P81668",
"P81687",
"P81707",
"P81710",
"P81713",
"P81714",
"P81738",
"P81769",
"P82001",
"P82002",
"P82003",
"P82005",
"P82007",
"P82009",
"P82010",
"P82011",
"P82012",
"P82014",
"P82029",
"P82607",
"P82617",
"P82626",
"P83001",
"P83003",
"P83005",
"P83007",
"P83008",
"P83009",
"P83012",
"P83013",
"P83017",
"P83019",
"P83021",
"P83023",
"P83030",
"P83621",
"P83625",
"P84004",
"P84005",
"P84009",
"P84010",
"P84011",
"P84012",
"P84016",
"P84017",
"P84019",
"P84020",
"P84023",
"P84024",
"P84025",
"P84026",
"P84027",
"P84028",
"P84030",
"P84032",
"P84033",
"P84037",
"P84038",
"P84039",
"P84040",
"P84041",
"P84048",
"P84053",
"P84054",
"P84064",
"P84626",
"P84633",
"P84689",
"P85002",
"P85004",
"P85006",
"P85611",
"P85613",
"P86002",
"P86004",
"P86006",
"P86010",
"P86021",
"P86624",
"P87002",
"P87003",
"P87008",
"P87015",
"P87016",
"P87020",
"P87026",
"P87039",
"P87609",
"P87612",
"P87625",
"P87626",
"P87630",
"P87641",
"P87642",
"P87657",
"P87668",
"P88001",
"P88002",
"P88003",
"P88026",
"P88034",
"P88625",
"P88635",
"P89002",
"P89006",
"P89010",
"P91003",
"P91004",
"P91007",
"P91014",
"P91027",
"P91028",
"P91609",
"P92001",
"P92003",
"P92005",
"P92012",
"P92017",
"P92030",
"P92031",
"P92033",
"P92630",
"P92652",
"S16047",
"S16136",
"S16206",
"S16579",
"V02700",
"V81997",
"V81998",
"V81999",
"W00000",
"W00001",
"W00002",
"W00003",
"W00005",
"W00006",
"W00007",
"W00011",
"W91016",
"W91042",
"W91046",
"W91050",
"W92008",
"W92021",
"W92034",
"W92042",
"W92044",
"W92053",
"W93001",
"W93007",
"W93019",
"W93020",
"W93021",
"W93038",
"W93046",
"W94011",
"W94025",
"W94034",
"W94037",
"W94612",
"W95010",
"W95014",
"W95041",
"W95080",
"W95089",
"W95623",
"W95634",
"W96009",
"W96013",
"W97003",
"W97005",
"W97008",
"W97016",
"W97017",
"W97020",
"W97021",
"W97023",
"W97024",
"W97025",
"W97033",
"W97036",
"W97041",
"W97053",
"W97060",
"W97061",
"W97067",
"W97068",
"W97069",
"W97286",
"W97291",
"W97294",
"W97616",
"W99010",
"W99025",
"XCDF56",
"Y00001",
"Y00002",
"Y00003",
"Y00004",
"Y00005",
"Y00006",
"Y00007",
"Y00008",
"Y00009",
"Y00010",
"Y00011",
"Y00012",
"Y00013",
"Y00014",
"Y00017",
"Y00025",
"Y00030",
"Y00038",
"Y00039",
"Y00042",
"Y00062",
"Y00088",
"Y00098",
"Y00133",
"Y00145",
"Y00167",
"Y00172",
"Y00208",
"Y00211",
"Y00212",
"Y00213",
"Y00214",
"Y00215",
"Y00216",
"Y00217",
"Y00218",
"Y00219",
"Y00220",
"Y00221",
"Y00222",
"Y00223",
"Y00241",
"Y00242",
"Y00243",
"Y00253",
"Y00254",
"Y00255",
"Y00259",
"Y00261",
"Y00264",
"Y00265",
"Y00267",
"Y00274",
"Y00275",
"Y00282",
"Y00284",
"Y00286",
"Y00290",
"Y00291",
"Y00292",
"Y00293",
"Y00294",
"Y00295",
"Y00296",
"Y00299",
"Y00300",
"Y00304",
"Y00306",
"Y00307",
"Y00313",
"Y00319",
"Y00328",
"Y00334",
"Y00342",
"Y00352",
"Y00356",
"Y00357",
"Y00358",
"Y00363",
"Y00364",
"Y00369",
"Y00381",
"Y00396",
"Y00399",
"Y00400",
"Y00406",
"Y00408",
"Y00418",
"Y00432",
"Y00437",
"Y00440",
"Y00452",
"Y00483",
"Y00500",
"Y00502",
"Y00514",
"Y00522",
"Y00527",
"Y00542",
"Y00546",
"Y00560",
"Y00561",
"Y00565",
"Y00583",
"Y00627",
"Y00630",
"Y00633",
"Y00647",
"Y00650",
"Y00667",
"Y00705",
"Y00712",
"Y00744",
"Y00756",
"Y00757",
"Y00779",
"Y00780",
"Y00788",
"Y00800",
"Y00836",
"Y00853",
"Y00883",
"Y00897",
"Y00944",
"Y00955",
"Y00994",
"Y00999",
"Y01016",
"Y01055",
"Y01056",
"Y01058",
"Y01059",
"Y01082",
"Y01110",
"Y01122",
"Y01139",
"Y01152",
"Y01153",
"Y01179",
"Y01207",
"Y01227",
"Y01245",
"Y01257",
"Y01280",
"Y01291",
"Y01636",
"Y01637",
"Y01695",
"Y01734",
"Y01860",
"Y01895",
"Y01920",
"Y01948",
"Y01949",
"Y01995",
"Y02002",
"Y02043",
"Y02055",
"Y02075",
"Y02091",
"Y02101",
"Y02139",
"Y02173",
"Y02174",
"Y02175",
"Y02176",
"Y02177",
"Y02178",
"Y02179",
"Y02180",
"Y02181",
"Y02182",
"Y02183",
"Y02184",
"Y02185",
"Y02186",
"Y02187",
"Y02188",
"Y02189",
"Y02190",
"Y02504",
"Y02926",
"Y03108",
"Y03580",
"Y03749",
"Y04573",
"Y05010",
"Y05366",
"Y05496",
"Y05512",
"Y06468",
"Y06469",
"Y40001",
"Y40003",
"Y90002",
"Y90003",
"Y90004",
"Y90005",
"Y90006",
"Y90009",
"Y90012",
"Y90013",
"Y90014",
"Y90015",
"Y90016",
"Y90017",
"Y90018",
"Y90019",
"Y90020",
"Y90021",
"Y90022",
"Y90023",
"Y90024",
"Y90025",
"Y90026",
"Y90027",
"Y90028",
"Y90029",
"Y90030",
"Y90031",
"Y90032",
"Y90033",
"Y90034",
"Y90035",
"Y90036",
"Y90037",
"Y90038",
"Y90039",
"Y90040",
"Y90041",
"Y90042",
"Y90043",
"Y90044",
"Y90045",
"Y90046",
"Y90047",
"Y90048",
"Y90049",
"Y90050",
"Y90051",
"Y90052",
"Y90053",
"Y90054",
"Y90055",
"Y90056",
"Y90057",
"Y90058",
"Y90059",
"Y90060",
"Y90061",
"Y90062",
"Y90063",
"Y90064",
"Y90065",
"Y90066",
"Y90067",
"Y90068",
"Y90069",
"Y90070",
"Y90071",
"Y90072",
"Y90073",
"Y90074",
"Y90075",
"Y90076",
"Y90077",
"Y90078",
"Y90079",
"Y90080",
"Y90081",
"Y90082",
"Y90083",
"Y90084",
"Y90085",
"Y90086",
"Y90087",
"Y90088",
"Y90089",
"Y90090",
"Y90091",
"Y90092",
"Y90093",
"Y90094",
"Y90095",
"Y90096",
"Y90097",
"Y90098",
"Y90099",
"Y90100",
"Y90101",
"Y90102",
"Y90103",
"Y90104",
"Y90105",
"Y90106",
"Y90107",
"Y90108",
"Y90109",
"Y90110",
"Y90111",
"Y90112",
"Y90129",
"Y90181",
"Y90203",
"Y90206",
"Y90207",
"Y90208",
"Y90216",
"Y90217",
"Y90218",
"Y90219",
"Y90220",
"Y90221",
"Y90222",
"Y90223",
"Y90224",
"Y90225",
"Y90226",
"Y90227",
"Y90228",
"Y90229",
"Y90230",
"Y90231",
"Y90232",
"Y90233",
"Y90234",
"Y90235",
"Y90236",
"Y90237",
"Y90239",
"Y90242",
"Y90243",
"Y90244",
"Y90245",
"Y90246",
"Y90247",
"Y90248",
"Y90249",
"Y90250",
"Y90251",
"Y90252",
"Y90253",
"Y90254",
"Y90255",
"Y90256",
"Y90257",
"Y90258",
"Y90259",
"Y90260",
"Y90261",
"Y90262",
"Y90263",
"Y90264",
"Y90265",
"Y90266",
"Y90267",
"Y90270",
"Y90271",
"Y90272",
"Y90273",
"Y90274",
"Y90275",
"Y90276",
"Y90277",
"Y90278",
"Y90279",
"Y90280",
"Y90281",
"Y90282",
"Y90283",
"Y90284",
"Y90285",
"Y90286",
"Y90287",
"Y90288",
"Y90289",
"Y90290",
"Y90291",
"Y90292",
"Y90293",
"Y90294",
"Y90295",
"Y90296",
"Y90297",
"Y90298",
"Y90299",
"Y90300",
"Y90301",
"Y90302",
"Y90303",
"Y90304",
"Y90305",
"Y90306",
"Y90307",
"Y90308",
"Y90309",
"Y90310",
"Y90311",
"Y90312",
"Y90313",
"Y90314",
"Y90315",
"Y90316",
"Y90317",
"Y90318",
"Y90319",
"Y90321",
"Z00001",
]
| 13.992376 | 13 | 0.42855 | 4,195 | 58,726 | 5.999285 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.555361 | 0.35715 | 58,726 | 4,196 | 14 | 13.99571 | 0.111279 | 0 | 0 | 0 | 0 | 0 | 0.428498 | 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 | 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 |
6b7d0be198578062e55a903d8aadba221bbbd6f9 | 354 | py | Python | maintenance/templates/nodeclass.py | JFlynnXYZ/pymel | 2aa254c7982c78aac3e30e8d1b6a85f2465f898e | [
"BSD-3-Clause"
] | 287 | 2015-01-03T21:18:59.000Z | 2022-03-16T07:55:33.000Z | maintenance/templates/nodeclass.py | JFlynnXYZ/pymel | 2aa254c7982c78aac3e30e8d1b6a85f2465f898e | [
"BSD-3-Clause"
] | 412 | 2015-06-19T15:13:33.000Z | 2022-02-25T08:12:25.000Z | maintenance/templates/nodeclass.py | JFlynnXYZ/pymel | 2aa254c7982c78aac3e30e8d1b6a85f2465f898e | [
"BSD-3-Clause"
] | 106 | 2015-01-03T06:46:44.000Z | 2022-03-30T15:43:01.000Z | {% if not existing %}
class {{ classname }}({{ parents }}):
{% endif %}
{% if attrs %}
{% for attr in attrs %}
{% for line in attr.getLines() %}
{{line}}
{% endfor %}
{% endfor %}
{% endif %}
{% if methods %}
{% for method in methods %}
{% for line in method.getLines() %}
{{line}}
{% endfor %}
{% endfor %}
{% else %}
{% endif %}
| 16.090909 | 37 | 0.5 | 38 | 354 | 4.657895 | 0.447368 | 0.079096 | 0.101695 | 0.271186 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.259887 | 354 | 21 | 38 | 16.857143 | 0.675573 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
6b7df49fac50568f5ef0ff875cc4f6710ca60bfc | 8,905 | py | Python | shatter/util/helpers.py | jisazaTappsi/mastermind | bb096119b6e062611dec8e8062feb5f838d5a198 | [
"MIT"
] | 1 | 2016-06-10T05:55:05.000Z | 2016-06-10T05:55:05.000Z | shatter/util/helpers.py | jisazaTappsi/mastermind | bb096119b6e062611dec8e8062feb5f838d5a198 | [
"MIT"
] | 1 | 2016-02-05T06:59:46.000Z | 2016-02-05T06:59:46.000Z | shatter/util/helpers.py | jisazaTappsi/mastermind | bb096119b6e062611dec8e8062feb5f838d5a198 | [
"MIT"
] | 1 | 2016-03-28T11:01:23.000Z | 2016-03-28T11:01:23.000Z | #!/usr/bin/env python
"""Utility and General purpose functions."""
import inspect
import warnings
import os
import re
import shatter.constants as cts
__author__ = 'juan pablo isaza'
def read_file(absolute_path):
"""
:param absolute_path: string path.
:return: list with lines of the file.
"""
return [line.rstrip('\n') for line in open(absolute_path)]
def delete_file(filename):
"""
:param filename: relative path to file.
"""
if os.path.exists(filename):
os.remove(filename)
return True
return False
def write_file(filename, the_list):
"""
:param filename: relative path to file.
:param the_list: new file information.
:return: void
"""
new_file = open(filename, 'a')
for item in the_list:
new_file.write("%s\n" % item)
def rewrite_file(filename, the_list):
"""
Delete and write again
:param filename: relative path to file.
:param the_list: new file information.
:return: void
"""
delete_file(filename)
write_file(filename, the_list)
def bit_in_string(string):
"""
Contains a bit in the string
:param string: arbitrary string
:return: boolean
"""
return ('0' in string) or ('1' in string)
def string_has_bits_for_and(str_bits, index):
"""
Returns true if finds a bit, before and after index.
:param index: int
:param str_bits: string
:return: boolean
"""
str_start = str_bits[:index]
str_end = str_bits[index:]
return index > 0 and bit_in_string(str_start) and bit_in_string(str_end)
def from_bool_to_bit(boolean):
"""
Conversion from boolean to bit
:param boolean: True or False
:return: '1' or '0'
"""
if boolean:
return "1"
else:
return "0"
def get_function_path(f):
"""
Passes the internal func_code to a attribute called internal_code on the wrapper.
Then we call the wrapper attribute which throws metadata of the internal function, and gets the path.
:param f: function
:return: path
"""
# does the wrapper is defining the new attribute, to expose internal func_code? or use std func_code if no decorator
code = f.internal_code if hasattr(f, cts.INTERNAL_CODE) else f.__code__
return code.co_filename
def valid_function(f):
"""
Validates function. Returns warning if it is not a function or it doesn't have a decorator.
:param f: function
:return: passes, raises warning or raises TypeError
"""
if not hasattr(f, '__call__'):
raise TypeError('{} is not a valid function.'.format(f))
if not hasattr(f, cts.INTERNAL_CODE):
warnings.warn('Function {} has no decorator, reading can be harder!!!'.format(f.__name__), UserWarning)
return True
def get_function_line_number(f, file_code):
"""
Returns first line number for decorated and un-decorated methods. -1 if not found.
:param f: function.
:param file_code: the code as a list where each element is a line.
:return: the line of the file(starting in zero), 0 if not found!
"""
for index, line in enumerate(file_code):
pattern = re.compile(cts.PARTICULAR_DEFINITION.pattern.format(name=f.__name__))
definition = re.search(pattern, line)
if definition:
return index
return -1
def get_function_inputs(f):
"""
Given function signatures gets the name of the function.
:param f: a callable function
:return: input names on a tuple.
"""
if hasattr(f, cts.INTERNAL_PARAMETERS):
# 'internal_parameters' is defined inside the solver() annotation, see solver.py for details.
return f.internal_parameters
else:
return f.__code__.co_varnames
def get_function_code(start, file_code):
"""
Gets the source code of function. Opt for not using
inspect package because it doesn't work with decorators
:param start: the starting line number, of the function
:param file_code: the source file lines
:return: code.
"""
def not_space_nor_comment(line):
return len(line.strip()) > 0 and line.strip()[0] != '#'
def inside_function(line_indent, f_indent):
return len(line_indent) > len(f_indent) + 3
base_indent = re.search(cts.INDENT, file_code[start]).group()
end = start
for index, l in enumerate(file_code[start + 1:]):
l_indent = re.search(cts.INDENT, l).group()
# decides if adding to function is required: no black space or comment
if not_space_nor_comment(l):
if inside_function(l_indent, base_indent):
end = index + start + 2 # only add code if non-comment or empty spaces are inside function
else:
# end of function if found lower indent that is not a blank space and not a comment
break
return file_code[start:end]
def var_is_true(var):
"""
Returns True if var= True, else False. Remember here that 1 is a almost True value
but in this case should return False.
:param var: any variable.
:return: boolean
"""
return var and isinstance(var, bool)
def var_is_false(var):
"""
Returns True if var = False, else False. Remember here that 1 is a almost True value
but in this case should return False.
:param var: any variable.
:return: boolean
"""
return not var and isinstance(var, bool)
def has_true_key(d):
"""
Returns True only if it has a True value as key.
Has to be done this way because Python confuses '0' and '1' with False and True.
:param d: dict()
:return: boolean
"""
for key in d:
if var_is_true(key):
return True
return False
def has_return(implementation, definition):
"""
Finds if the implementation already has a return.
:param implementation: array with code implementation
:param definition: function definition
:return: Boolean
"""
last_line = implementation[-1]
indent = get_indent_from_definition(definition)
pattern = r"^{indent} return".format(indent=indent)
return re.search(pattern, last_line) is not None
def has_false_key(d):
"""
Returns True only if it has a False value as key.
Has to be done this way because Python confuses '0' and '1' with False and True.
:param d: dict()
:return: boolean
"""
for key in d:
if var_is_false(key):
return True
return False
def var_is_1(var):
"""
Boolean if var is equal to 1 and not True.
:param var: variable
:return: boolean
"""
if var and not isinstance(var, bool):
return True
return False
def var_is_0(var):
"""
Boolean if var is equal to 0 and not False.
:param var: variable
:return: boolean
"""
if not var and not isinstance(var, bool):
return True
return False
def get_indent_from_definition(definition):
"""
Uses regex to get the indent
:param definition: of a function
:return: indent as string
"""
return re.search(cts.INDENT, definition).group()
def is_function(f):
"""
Is it a function?
:param f: function
:return: boolean
"""
return hasattr(f, '__call__')
def remove_list_from_list(all_list, list_to_remove):
"""
:param all_list: original list
:param list_to_remove: elements that will be removed from the original list.
:return: subtracted list
"""
return [value for value in all_list if value not in list_to_remove]
def is_private_call():
"""
Searches in the stack for places where the package is. If there is something then the
function is being called privately from inside the package, otherwise it is called from outside the package.
:return: boolean
"""
p_name = '/{}/'.format(cts.PACKAGE_NAME)
p = re.match(r'^.*' + p_name, inspect.stack()[0].filename).group()
# the number 2 in 'inspect.stack()[2:]' is because we are not looking inside is_private_call() function nor one
# level above it, where its suppose to tell us if that function is being called privately or publicly.
return any(re.match(p, frame.filename) is not None for frame in inspect.stack()[2:])
def name_in_frame(var, frame):
"""
Looks at the locals of the frame and searches in it for var.
:param var: variable to get name from.
:param frame: a inspect frame
:return: list with strings.
"""
callers_local_vars = frame.f_locals.items()
return [var_name for var_name, var_val in callers_local_vars if var_val is var]
def retrieve_name(var):
"""
Gets the name of var. Does it from the out most frame inner-wards.
:param var: variable to get name from.
:return: string
"""
for fi in reversed(inspect.stack()):
names = name_in_frame(var, fi.frame)
if len(names) > 0:
return names[0]
| 27.741433 | 120 | 0.658956 | 1,299 | 8,905 | 4.384911 | 0.203233 | 0.025105 | 0.014045 | 0.018434 | 0.260885 | 0.184867 | 0.154143 | 0.129565 | 0.129565 | 0.120084 | 0 | 0.004793 | 0.250309 | 8,905 | 320 | 121 | 27.828125 | 0.848412 | 0.447951 | 0 | 0.142857 | 0 | 0 | 0.035182 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.241071 | false | 0 | 0.044643 | 0.017857 | 0.580357 | 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 |
6b8591e59247dad1b7b1305c25ea86898d890846 | 306 | py | Python | src/bot/cocoa/src/basic/systems/cmd_system.py | s-akanksha/DialoGraph_ICLR21 | d5bbc10b2623c9f84d21a99a5e54e7dcfdfb1bcc | [
"Apache-2.0"
] | 12 | 2021-03-17T05:15:33.000Z | 2022-01-19T06:09:21.000Z | src/bot/cocoa/src/basic/systems/cmd_system.py | s-akanksha/DialoGraph_ICLR21 | d5bbc10b2623c9f84d21a99a5e54e7dcfdfb1bcc | [
"Apache-2.0"
] | 2 | 2021-05-25T07:28:46.000Z | 2022-02-11T01:54:43.000Z | src/bot/cocoa/src/basic/systems/cmd_system.py | s-akanksha/DialoGraph_ICLR21 | d5bbc10b2623c9f84d21a99a5e54e7dcfdfb1bcc | [
"Apache-2.0"
] | 4 | 2021-10-11T03:39:38.000Z | 2022-02-01T23:58:50.000Z | from system import System
from src.basic.sessions.cmd_session import CmdSession
class CmdSystem(System):
def __init__(self):
super(CmdSystem, self).__init__()
@classmethod
def name(cls):
return 'cmd'
def new_session(self, agent, kb):
return CmdSession(agent, kb)
| 21.857143 | 53 | 0.679739 | 38 | 306 | 5.210526 | 0.578947 | 0.070707 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.22549 | 306 | 13 | 54 | 23.538462 | 0.835443 | 0 | 0 | 0 | 0 | 0 | 0.009804 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.2 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
6b9a56d04bac907997a092760a7763b29877194d | 335 | py | Python | 0104/test5.py | eto/study | 95f506569657c174bf2347b5240768fafedaa285 | [
"BSD-3-Clause"
] | null | null | null | 0104/test5.py | eto/study | 95f506569657c174bf2347b5240768fafedaa285 | [
"BSD-3-Clause"
] | null | null | null | 0104/test5.py | eto/study | 95f506569657c174bf2347b5240768fafedaa285 | [
"BSD-3-Clause"
] | null | null | null | # file handling
# 1) without using with statement
file = open('t1.txt', 'w')
file.write('hello world !')
file.close()
# 2) without using with statement
file = open('t2.txt', 'w')
try:
file.write('hello world')
finally:
file.close()
# 3) using with statement
with open('t3.txt', 'w') as file:
file.write('hello world !')
| 18.611111 | 33 | 0.644776 | 51 | 335 | 4.235294 | 0.431373 | 0.125 | 0.25 | 0.263889 | 0.305556 | 0.305556 | 0 | 0 | 0 | 0 | 0 | 0.021818 | 0.179104 | 335 | 17 | 34 | 19.705882 | 0.763636 | 0.301493 | 0 | 0.4 | 0 | 0 | 0.253275 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 |
6bb7889b4decd4266d4e92eef2bdbcfe210d5377 | 493 | py | Python | thaniya_server_upload/src/thaniya_server_upload/slots/IUploadSlotContext.py | jkpubsrc/Thaniya | 4ebdf2854e3d7888af7396adffa22628b4ab2267 | [
"Apache-1.1"
] | 1 | 2021-01-20T18:27:22.000Z | 2021-01-20T18:27:22.000Z | thaniya_server_upload/src/thaniya_server_upload/slots/IUploadSlotContext.py | jkpubsrc/Thaniya | 4ebdf2854e3d7888af7396adffa22628b4ab2267 | [
"Apache-1.1"
] | null | null | null | thaniya_server_upload/src/thaniya_server_upload/slots/IUploadSlotContext.py | jkpubsrc/Thaniya | 4ebdf2854e3d7888af7396adffa22628b4ab2267 | [
"Apache-1.1"
] | null | null | null |
from thaniya_server_sudo import SudoScriptRunner
from thaniya_server.usermgr import BackupUserManager
from thaniya_server.sysusers import SystemAccountManager
class IUploadSlotContext:
@property
def backupUserManager(self) -> BackupUserManager:
raise NotImplementedError()
#
@property
def sudoScriptRunner(self) -> SudoScriptRunner:
raise NotImplementedError()
#
@property
def systemAccountManager(self) -> SystemAccountManager:
raise NotImplementedError()
#
#
| 14.085714 | 56 | 0.793103 | 41 | 493 | 9.439024 | 0.414634 | 0.085271 | 0.131783 | 0.180879 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.144016 | 493 | 34 | 57 | 14.5 | 0.917062 | 0 | 0 | 0.461538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.230769 | 0 | 0.538462 | 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 |
6bbda07e389bf551e26624d26ca28aadcfbca0c4 | 217 | py | Python | Curso_Python/Secao2-Python-Basico-Logica-Programacao/37_desempacotamento_listas/37_desempacotamento_listas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao2-Python-Basico-Logica-Programacao/37_desempacotamento_listas/37_desempacotamento_listas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao2-Python-Basico-Logica-Programacao/37_desempacotamento_listas/37_desempacotamento_listas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | """
Desempacotamento de listas em python
"""
lista = ['Luiz', 'João', 'Maria', 1, 2, 3, 4, 5]
n1, n2, *n3 = lista #todo: usando a * cria outra lista, e os valores que eu quiser mostrar, começa pelas ultimas
print(n3)
| 31 | 112 | 0.663594 | 36 | 217 | 4 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.050847 | 0.184332 | 217 | 6 | 113 | 36.166667 | 0.762712 | 0.589862 | 0 | 0 | 0 | 0 | 0.160494 | 0 | 0 | 0 | 0 | 0.166667 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
6bc4bf2d5b5985b5f35826eee953cf4a89bb1e53 | 138 | py | Python | petpy/__main__.py | csmarfan/petpy | d5edaea43a6657e6a93a1f01f3dd27e9e8fbb0cf | [
"Apache-2.0"
] | null | null | null | petpy/__main__.py | csmarfan/petpy | d5edaea43a6657e6a93a1f01f3dd27e9e8fbb0cf | [
"Apache-2.0"
] | 2 | 2019-06-19T12:16:12.000Z | 2019-06-19T12:38:02.000Z | petpy/__main__.py | csmarfan/petpy | d5edaea43a6657e6a93a1f01f3dd27e9e8fbb0cf | [
"Apache-2.0"
] | 1 | 2019-06-19T12:27:06.000Z | 2019-06-19T12:27:06.000Z | import sys
from .petpy import gardner
def main():
vp = float(sys.arv[1])
print(gardner(vp))
if __name__=='__main__':
main()
| 13.8 | 26 | 0.637681 | 20 | 138 | 4 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009174 | 0.210145 | 138 | 9 | 27 | 15.333333 | 0.724771 | 0 | 0 | 0 | 0 | 0 | 0.057971 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.428571 | 0.142857 | 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 |
6bdabddf24475c6a7309d4c9ef42f919cb418158 | 250 | py | Python | bdsim/blocks/__init__.py | petercorke/bdsim | 0b6afee0ae889e39a4be036f2aea8c2261cce0f8 | [
"MIT"
] | 64 | 2020-05-24T01:07:41.000Z | 2022-02-27T10:31:07.000Z | bdsim/blocks/__init__.py | petercorke/bdsim | 0b6afee0ae889e39a4be036f2aea8c2261cce0f8 | [
"MIT"
] | 6 | 2020-06-14T10:48:29.000Z | 2022-02-12T08:30:44.000Z | bdsim/blocks/__init__.py | petercorke/bdsim | 0b6afee0ae889e39a4be036f2aea8c2261cce0f8 | [
"MIT"
] | 17 | 2020-06-13T18:53:53.000Z | 2022-01-10T14:42:51.000Z | from .functions import *
from .sources import *
from .sinks import *
from .transfers import *
from .discrete import *
from .linalg import *
from .displays import *
from .connections import *
url = "https://petercorke.github.io/bdsim/" + __package__
| 22.727273 | 57 | 0.74 | 31 | 250 | 5.83871 | 0.548387 | 0.38674 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152 | 250 | 10 | 58 | 25 | 0.853774 | 0 | 0 | 0 | 0 | 0 | 0.14 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.888889 | 0 | 0.888889 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
6be2face076e8b3accb63a8d1177e6d440d63b46 | 939 | py | Python | src/structurizr/mixin/childless_mixin.py | xolynrac/examen_final_4c | dfa19b44fee6a17b7efc5630f1c8580aabc549e9 | [
"Apache-2.0"
] | 47 | 2020-04-26T20:00:03.000Z | 2022-02-19T14:32:04.000Z | src/structurizr/mixin/childless_mixin.py | xolynrac/examen_final_4c | dfa19b44fee6a17b7efc5630f1c8580aabc549e9 | [
"Apache-2.0"
] | 84 | 2020-05-25T14:49:21.000Z | 2022-01-26T01:55:04.000Z | src/structurizr/mixin/childless_mixin.py | xolynrac/examen_final_4c | dfa19b44fee6a17b7efc5630f1c8580aabc549e9 | [
"Apache-2.0"
] | 14 | 2020-07-01T11:03:25.000Z | 2022-01-11T06:37:31.000Z | # Copyright (c) 2020
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Provide a mixin that indicates an element type does not have children."""
from typing import Iterable
from ..model.element import Element
class ChildlessMixin:
"""Define a mixin for childless element types."""
@property
def child_elements(self) -> Iterable[Element]:
"""Return child elements (from `Element.children`)."""
return []
| 30.290323 | 76 | 0.729499 | 133 | 939 | 5.142857 | 0.654135 | 0.087719 | 0.038012 | 0.046784 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010471 | 0.186368 | 939 | 30 | 77 | 31.3 | 0.884817 | 0.751864 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
6bf1b8faec412f1cce9606a9643d4de5cc1158b7 | 1,125 | py | Python | 3-Python-Advanced (May 2021)/00-Exams-Prep/03-Python-Advanced-Exam-14-Feb-2021/01-Problem-1.py | karolinanikolova/SoftUni-Software-Engineering | 7891924956598b11a1e30e2c220457c85c40f064 | [
"MIT"
] | null | null | null | 3-Python-Advanced (May 2021)/00-Exams-Prep/03-Python-Advanced-Exam-14-Feb-2021/01-Problem-1.py | karolinanikolova/SoftUni-Software-Engineering | 7891924956598b11a1e30e2c220457c85c40f064 | [
"MIT"
] | null | null | null | 3-Python-Advanced (May 2021)/00-Exams-Prep/03-Python-Advanced-Exam-14-Feb-2021/01-Problem-1.py | karolinanikolova/SoftUni-Software-Engineering | 7891924956598b11a1e30e2c220457c85c40f064 | [
"MIT"
] | null | null | null | # Problem 1
# First, you will be given a sequence of integers representing firework effects. Afterwards you will be given another
# sequence of integers representing explosive power.
# You need to start from the first firework effect and try to mix it with the last explosive power.
# If the sum of their values is:
# • divisible by 3, but it is not divisible by 5 – create Palm firework and remove both materials
# • divisible by 5, but it is not divisible by 3 – create Willow firework and remove both materials
# • divisible by both 3 and 5 – create Crossette firework and remove both materials
# Otherwise, decrease the value of the firework effect by 1 and move it at the end of the sequence.
# Then, try to mix the same explosive power with the next firework effect.
# If any value is equal to or below 0, you should remove it from the sequence before trying to mix it with the other.
# When you have successfully prepared enough fireworks for the show or you have no more firework punches or explosive
# power, you need to stop mixing.
# To make the perfect firework show, Maria needs 3 of each of the firework types.
| 75 | 117 | 0.776 | 201 | 1,125 | 4.373134 | 0.432836 | 0.062571 | 0.040956 | 0.071672 | 0.261661 | 0.143345 | 0.095563 | 0.095563 | 0 | 0 | 0 | 0.010989 | 0.191111 | 1,125 | 14 | 118 | 80.357143 | 0.948352 | 0.974222 | 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 |
d4246e25860579a29b30485c3d1b321ea8dadcaf | 275 | py | Python | questao6.py | higorcastro17/Avaliacao1 | 30d727d9c85fd532a6a6264fa50eee7d34a57bbf | [
"Apache-2.0"
] | null | null | null | questao6.py | higorcastro17/Avaliacao1 | 30d727d9c85fd532a6a6264fa50eee7d34a57bbf | [
"Apache-2.0"
] | null | null | null | questao6.py | higorcastro17/Avaliacao1 | 30d727d9c85fd532a6a6264fa50eee7d34a57bbf | [
"Apache-2.0"
] | null | null | null | turno = input('M-matutino, V-vespertino, N-noturno: ')
if (turno == 'M')or(turno == 'm') :
print ('Bom Dia')
if (turno == 'V')or(turno == 'v'):
print ('Boa Tarde')
if (turno == 'N')or(turno == 'n'):
print ('Boa Noite')
else:
print ('Valor inválido')
| 27.5 | 55 | 0.527273 | 39 | 275 | 3.717949 | 0.487179 | 0.144828 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.229091 | 275 | 9 | 56 | 30.555556 | 0.683962 | 0 | 0 | 0 | 0 | 0 | 0.308271 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.444444 | 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 | 0 | 0 | 0 | 1 | 0 | 2 |
d42502013a724d256a3f3b74c173fa598ca64b62 | 490 | py | Python | b0mb3r/services/webbankir.py | Superior0/b0mb3r_r | 216b1851303f5101b09457ba31749b63e4d0d5e8 | [
"Apache-2.0"
] | null | null | null | b0mb3r/services/webbankir.py | Superior0/b0mb3r_r | 216b1851303f5101b09457ba31749b63e4d0d5e8 | [
"Apache-2.0"
] | null | null | null | b0mb3r/services/webbankir.py | Superior0/b0mb3r_r | 216b1851303f5101b09457ba31749b63e4d0d5e8 | [
"Apache-2.0"
] | null | null | null | from b0mb3r.services.service import Service
class WebBankir(Service):
async def run(self):
await self.post(
"https://ng-api.webbankir.com/user/v2/create",
json={
"lastName": self.russian_name,
"firstName": self.russian_name,
"middleName": self.russian_name,
"mobilePhone": self.formatted_phone,
"email": self.email,
"smsCode": "",
},
)
| 28.823529 | 58 | 0.512245 | 45 | 490 | 5.488889 | 0.688889 | 0.133603 | 0.182186 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009709 | 0.369388 | 490 | 16 | 59 | 30.625 | 0.789644 | 0 | 0 | 0 | 0 | 0 | 0.189796 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.071429 | 0 | 0.142857 | 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 |
d4254df5226f1fbca945831c16a37f0346ea800a | 511 | py | Python | login.py | sgravrock/flickr-to-go | 42badc3c08acfb834505ea31e76a50b7b81aec31 | [
"MIT"
] | null | null | null | login.py | sgravrock/flickr-to-go | 42badc3c08acfb834505ea31e76a50b7b81aec31 | [
"MIT"
] | null | null | null | login.py | sgravrock/flickr-to-go | 42badc3c08acfb834505ea31e76a50b7b81aec31 | [
"MIT"
] | null | null | null | import os
import sys
import flickr_api
from flickr_api import auth
a = auth.AuthHandler(key=os.environ['FLICKR_API_KEY'], secret=os.environ['FLICKR_API_SECRET'], callback='oob')
print("Open this in your browser: " + a.get_authorization_url('read'))
print("Once you finish logging in, enter the code from the browser: "),
code = sys.stdin.readline().strip()
a.set_verifier(code)
flickr_api.set_auth_handler(a)
user = flickr_api.test.login()
photos = user.getPhotos()
print "Got %s photos" % photos.info.total
| 30.058824 | 110 | 0.759295 | 82 | 511 | 4.573171 | 0.560976 | 0.144 | 0.08 | 0.096 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107632 | 511 | 16 | 111 | 31.9375 | 0.822368 | 0 | 0 | 0 | 0 | 0 | 0.272016 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.307692 | null | null | 0.230769 | 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 |
d42b94352b7c3c7e5fe8e652dabf68483b72d935 | 524 | py | Python | structures/cycle.py | TheBiggerFish/fishpy | 632a7c603a33ad694650aa2bed058931775a4259 | [
"MIT"
] | null | null | null | structures/cycle.py | TheBiggerFish/fishpy | 632a7c603a33ad694650aa2bed058931775a4259 | [
"MIT"
] | null | null | null | structures/cycle.py | TheBiggerFish/fishpy | 632a7c603a33ad694650aa2bed058931775a4259 | [
"MIT"
] | null | null | null | """
This module provides a sequence class which can be used for cyclic values
"""
from typing import Generic, TypeVar
T = TypeVar('T')
class Cycle(list,Generic[T]):
"""This class can be used to store cyclic values"""
def __getitem__(self,key:int) -> T:
return super().__getitem__(key%len(self))
def __setitem__(self,key:int,value:T):
super().__setitem__(key%len(self),value)
def remove(self,index:int):
"""Remove value at location \"index\""""
del self[index%len(self)]
| 24.952381 | 73 | 0.65458 | 75 | 524 | 4.36 | 0.506667 | 0.06422 | 0.055046 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.20229 | 524 | 20 | 74 | 26.2 | 0.782297 | 0.290076 | 0 | 0 | 0 | 0 | 0.002833 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.1 | 0.1 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
d43acd41d13bbda6864c50e5a66d740ba0abd4a6 | 984 | py | Python | django_vueformgenerator/fields.py | agronick/django-vueformgenerator | 6c59be1d06118327af08cc0e6260d234f12f715e | [
"MIT"
] | 7 | 2016-10-20T11:49:01.000Z | 2020-06-17T22:12:59.000Z | django_vueformgenerator/fields.py | agronick/django-vueformgenerator | 6c59be1d06118327af08cc0e6260d234f12f715e | [
"MIT"
] | 2 | 2019-03-19T15:41:43.000Z | 2019-03-29T17:39:44.000Z | django_vueformgenerator/fields.py | agronick/django-vueformgenerator | 6c59be1d06118327af08cc0e6260d234f12f715e | [
"MIT"
] | 5 | 2016-12-01T15:41:15.000Z | 2019-10-06T02:00:20.000Z | class Field(object):
def render(self, field):
raise NotImplementedError('Field.render needs to be defined')
class Attr(Field):
def __init__(self, attr, default=None, type=None):
self.attr = attr
self.default = default
if type is None:
self.type = lambda x: x
else:
self.type = type
def render(self, field):
try:
x = field
for attr in self.attr.split('.'):
x = getattr(x, attr)
return self.type(x)
except AttributeError:
return self.default
class Name(Field):
def render(self, field):
return field.__name__.replace('__', '.')
class Func(Field):
def __init__(self, func):
self.func = func
def render(self, field):
return self.func(field)
class Literal(Field):
def __init__(self, value):
self.value = value
def render(self, *args, **kwargs):
return self.value
| 22.363636 | 69 | 0.565041 | 118 | 984 | 4.559322 | 0.313559 | 0.083643 | 0.120818 | 0.133829 | 0.089219 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.325203 | 984 | 43 | 70 | 22.883721 | 0.810241 | 0 | 0 | 0.125 | 0 | 0 | 0.036585 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0.09375 | 0.5625 | 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 |
d45e0abbc1b60250ad55d017c7df68087d2d533a | 388 | py | Python | Course.py | timot3/uiuc-course-api | 468043724532f6cc85c2e24dc8d11cd7819f7381 | [
"MIT"
] | 6 | 2021-12-21T21:32:52.000Z | 2021-12-22T04:11:33.000Z | Course.py | timot3/uiuc-course-api | 468043724532f6cc85c2e24dc8d11cd7819f7381 | [
"MIT"
] | null | null | null | Course.py | timot3/uiuc-course-api | 468043724532f6cc85c2e24dc8d11cd7819f7381 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
import json
@dataclass
class Course:
name: str # "CS 124"
number: str # "124"
label: str # "Introduction to Computer Science I"
description: str # "Basic concepts in computing and fundamental techniques for solving computational problems..."
GPA: str # "No Data"
hours: str # "3" | 35.272727 | 120 | 0.608247 | 43 | 388 | 5.488372 | 0.813953 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026415 | 0.31701 | 388 | 11 | 121 | 35.272727 | 0.864151 | 0.412371 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 0.9 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
d469c0222f63a84b0e954f5e839ba9f76753383c | 1,004 | py | Python | tagify_project/music/migrations/old/0001_initial.py | Krayonn/tagify | 5ee7efce3cacfa23a344e4c02070a365f50136a8 | [
"MIT"
] | null | null | null | tagify_project/music/migrations/old/0001_initial.py | Krayonn/tagify | 5ee7efce3cacfa23a344e4c02070a365f50136a8 | [
"MIT"
] | null | null | null | tagify_project/music/migrations/old/0001_initial.py | Krayonn/tagify | 5ee7efce3cacfa23a344e4c02070a365f50136a8 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-03-08 10:44
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Album',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('idd', models.CharField(max_length=50)),
('name', models.CharField(max_length=50)),
('artist', models.CharField(max_length=50)),
('release_date', models.DateTimeField()),
],
),
migrations.CreateModel(
name='Track',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('track_id', models.CharField(max_length=50)),
('tags', models.CharField(max_length=200)),
],
),
]
| 30.424242 | 114 | 0.547809 | 99 | 1,004 | 5.424242 | 0.484848 | 0.139665 | 0.167598 | 0.223464 | 0.487896 | 0.294227 | 0.294227 | 0.294227 | 0.294227 | 0.294227 | 0 | 0.037791 | 0.314741 | 1,004 | 32 | 115 | 31.375 | 0.742733 | 0.044821 | 0 | 0.4 | 1 | 0 | 0.057471 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.04 | 0 | 0.2 | 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 |
d46e84399f4a786d2d9417ea41788e945de9b9f8 | 1,223 | py | Python | intrepyd/colors.py | bobosoft/intrepyd | 13f0912b31f86f9bcc50f52ef4ad870e33f0cf65 | [
"BSD-3-Clause"
] | 2 | 2021-04-25T17:38:03.000Z | 2022-03-20T20:48:50.000Z | intrepyd/colors.py | bobosoft/intrepyd | 13f0912b31f86f9bcc50f52ef4ad870e33f0cf65 | [
"BSD-3-Clause"
] | 1 | 2016-11-30T22:25:00.000Z | 2017-01-16T22:43:39.000Z | intrepyd/colors.py | bobosoft/intrepyd | 13f0912b31f86f9bcc50f52ef4ad870e33f0cf65 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (C) 2017 Roberto Bruttomesso <roberto.bruttomesso@gmail.com>
This file is distributed under the terms of the 3-clause BSD License.
A copy of the license can be found in the root directory or at
https://opensource.org/licenses/BSD-3-Clause.
Author: Roberto Bruttomesso <roberto.bruttomesso@gmail.com>
Date: 27/03/2017
This module implements some color shortcuts
"""
from colorama import Fore, Style
def fail(message):
"""
Color message as failure
"""
return _fmt(Fore.RED, Style.BRIGHT, message)
def warn(message):
"""
Color message as warning
"""
return _fmt(Fore.YELLOW, Style.BRIGHT, message)
def good(message):
"""
Color message as success
"""
return _fmt(Fore.GREEN, Style.BRIGHT, message)
def info(message):
"""
Color message as info
"""
return _fmt(Fore.CYAN, Style.BRIGHT, message)
def dim(message):
"""
dim message
"""
return _fmt(Fore.BLACK, Style.BRIGHT, message)
def enhance(message):
"""
enhance message
"""
return _fmt(Fore.WHITE, Style.BRIGHT, message)
def _fmt(color, style, message):
"""
Helper routine
"""
return color + style + message + Fore.RESET + Style.RESET_ALL
| 21.839286 | 70 | 0.670482 | 161 | 1,223 | 5.043478 | 0.447205 | 0.066502 | 0.096059 | 0.155172 | 0.108374 | 0.108374 | 0 | 0 | 0 | 0 | 0 | 0.014568 | 0.214227 | 1,223 | 55 | 71 | 22.236364 | 0.830385 | 0.421096 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.466667 | false | 0 | 0.066667 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
d476d8dd1be2c7313c00dcab49d959a864de8726 | 352 | py | Python | codeforces.com/1560B/solution.py | zubtsov/competitive-programming | 919d63130144347d7f6eddcf8f5bc2afb85fddf3 | [
"MIT"
] | null | null | null | codeforces.com/1560B/solution.py | zubtsov/competitive-programming | 919d63130144347d7f6eddcf8f5bc2afb85fddf3 | [
"MIT"
] | null | null | null | codeforces.com/1560B/solution.py | zubtsov/competitive-programming | 919d63130144347d7f6eddcf8f5bc2afb85fddf3 | [
"MIT"
] | null | null | null | for i in range(int(input())):
a, b, c = map(int, input().split())
mi = min(a, b)
ma = max(a, b)
half_circle_people = (ma - mi)
full_circle_people = 2 * half_circle_people
if ma > half_circle_people * 2 or c > full_circle_people:
print(-1)
else:
print((c - half_circle_people - 1) % full_circle_people + 1)
| 27.076923 | 68 | 0.59375 | 57 | 352 | 3.421053 | 0.438596 | 0.430769 | 0.328205 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019455 | 0.269886 | 352 | 12 | 69 | 29.333333 | 0.7393 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.2 | 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 |
2e2c18a17632c78bdb14e00bd093659ba759ce89 | 281 | py | Python | src/hyper_prompt/themes/default.py | artbycrunk/hyper-prompt | b78d98e4e5c65647b566368ea778b205a86371de | [
"MIT"
] | 5 | 2019-11-11T15:54:09.000Z | 2022-03-23T00:00:07.000Z | src/hyper_prompt/themes/default.py | artbycrunk/hyper-prompt | b78d98e4e5c65647b566368ea778b205a86371de | [
"MIT"
] | 8 | 2019-12-19T16:03:08.000Z | 2021-10-21T01:42:08.000Z | src/hyper_prompt/themes/default.py | artbycrunk/hyper-prompt | b78d98e4e5c65647b566368ea778b205a86371de | [
"MIT"
] | 3 | 2019-08-09T12:05:19.000Z | 2020-10-06T08:16:24.000Z | from ..theme import BasicTheme
class Theme(BasicTheme):
USERNAME_FG = (188, 188, 188)
USERNAME_BG = (88, 88, 88)
USERNAME_ROOT_BG = (175, 0, 0)
VIRTUAL_ENV_BG = (0, 175, 95)
VIRTUAL_ENV_FG = (0, 0, 0)
SSH_BG = (240, 121, 9)
SSH_FG = (228, 228, 228)
| 20.071429 | 34 | 0.597865 | 45 | 281 | 3.511111 | 0.466667 | 0.037975 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.216346 | 0.259786 | 281 | 13 | 35 | 21.615385 | 0.543269 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.111111 | 0 | 1 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
2e2c874eabf70ce448a8da9afd9c8435d81d6bca | 5,970 | py | Python | uefi_firmware/guids/efiguids_asrock.py | MikeSpreitzer/uefi-firmware-parser | 2af7e41c800300b0509494cec1db7125d2be2de9 | [
"MIT"
] | 492 | 2015-01-14T18:33:34.000Z | 2022-03-28T03:28:24.000Z | uefi_firmware/guids/efiguids_asrock.py | ontikka/uefi-firmware-parser | 044fbde61970eaa626852b5b70821822c612c9f0 | [
"MIT"
] | 59 | 2015-04-11T22:25:29.000Z | 2022-03-09T14:34:19.000Z | uefi_firmware/guids/efiguids_asrock.py | ontikka/uefi-firmware-parser | 044fbde61970eaa626852b5b70821822c612c9f0 | [
"MIT"
] | 142 | 2015-02-05T06:36:30.000Z | 2022-01-13T03:46:42.000Z |
GUIDs = {
"ASROCK_ACPIS4_DXE_GUID": [69196166, 45078, 18382, 175, 197, 34, 105, 237, 212, 173, 100],
"ASROCK_USBRT_GUID": [82487969, 10657, 4567, 136, 56, 0, 80, 4, 115, 212, 235],
"ASROCK_RAID_SETUP_GUID": [152494882, 14144, 12750, 173, 98, 189, 23, 44, 236, 202, 54],
"ASROCK_RAID_LOADER_GUID": [164506669, 19843, 17592, 151, 208, 16, 133, 235, 84, 144, 184],
"ASROCK_SIOSLPSMI_GUID": [204970154, 53806, 19926, 140, 180, 60, 156, 251, 29, 134, 211],
"ASROCK_PLEDDXE_GUID": [260599413, 12329, 20175, 182, 148, 34, 137, 77, 63, 33, 67],
"ASROCK_A_DEFAULT_DXE_GUID": [303480106, 49246, 19565, 145, 231, 235, 142, 55, 173, 59, 122],
"ASROCK_USER_DEF_SETUP_DXE_GUID": [321832763, 48422, 20415, 177, 147, 138, 203, 80, 239, 189, 137],
"ASROCK_WAKEUP_CTRL_SMM_GUID": [460234064, 4836, 19285, 129, 217, 26, 191, 236, 89, 212, 252],
"ASROCK_AMI_AGESA_DXE_GUID": [503020538, 49038, 19729, 151, 102, 47, 176, 208, 68, 35, 16],
"ASROCK_HDD_READY_SMI_GUID": [560462180, 29336, 19087, 154, 42, 191, 228, 152, 214, 0, 168],
"ASROCK_MOUSE_DRIVER_GUID": [719032155, 51156, 20094, 190, 42, 35, 99, 77, 246, 104, 161],
"ASROCK_IDESMM_GUID": [829100592, 1280, 17810, 140, 9, 234, 186, 15, 182, 176, 127],
"ASROCK_BFGSMI_GUID": [978522445, 22131, 19929, 181, 179, 203, 114, 195, 71, 102, 155],
"ASROCK_ASRLOGODXE_GUID": [1033880909, 6629, 19152, 185, 134, 2, 214, 135, 215, 96, 229],
"ASROCK_ASM104_X_DXE_GUID": [1080004582, 21011, 19333, 184, 33, 151, 183, 122, 255, 121, 91],
"ASROCK_HDAUDIO_SMI_GUID": [1254707048, 58961, 19256, 161, 216, 45, 93, 239, 250, 15, 96],
"ASROCK_SM_BUS_DXE_GUID": [1265110573, 3427, 20322, 185, 48, 122, 233, 149, 185, 179, 163],
"ASROCK_USBINT13_GUID": [1275096281, 6586, 17943, 132, 131, 96, 145, 148, 161, 172, 252],
"ASROCK_SLP_SUPPORT_GUID": [1279872597, 22601, 21314, 69, 84, 84, 69, 82, 33, 33, 33],
"ASROCK_PATA_CONTROLLER_GUID": [1334921163, 38702, 20316, 184, 105, 160, 33, 130, 201, 217, 60],
"ASROCK_SATA_CONTROLLER_GUID": [1359869601, 46785, 18760, 174, 231, 89, 242, 32, 248, 152, 189],
"ASROCK_ACPIS4_SMM_GUID": [1368992111, 10248, 19194, 148, 196, 153, 246, 176, 108, 135, 30],
"ASROCK_POST_REPORT_GUID": [1413923475, 13211, 18381, 183, 25, 88, 93, 227, 148, 8, 204],
"ASROCK_CLOCK_GEN_DXE_GUID": [1447053695, 25694, 17937, 185, 21, 230, 130, 200, 189, 71, 131],
"ASROCK_UHCD_GUID": [1477302528, 14429, 4567, 136, 58, 0, 80, 4, 115, 212, 235],
"ASROCK_LEGACY_REGION_GUID": [1495543256, 59343, 18809, 182, 14, 166, 6, 126, 42, 24, 95],
"ASROCK_SLEEP_SMI_GUID": [1654193688, 54767, 17079, 187, 12, 41, 83, 40, 63, 87, 4],
"ASROCK_CMOS_MANAGER_SMM_GUID": [1751762355, 44173, 18803, 139, 55, 227, 84, 219, 243, 74, 221],
"ASROCK_AMD_AGESA_DXE_DRIVER_GUID": [1766895615, 28387, 4573, 173, 139, 8, 0, 32, 12, 154, 102],
"ASROCK_RE_FLASH_GUID": [1893836824, 3041, 17481, 191, 212, 158, 246, 140, 127, 2, 168],
"ASROCK_LEGACY_INTERRUPT_GUID": [1911362257, 9483, 17147, 140, 23, 16, 220, 250, 119, 23, 1],
"ASROCK_SMM_CHILD_DISPATCHER_GUID": [1966485705, 64229, 18345, 187, 191, 136, 214, 33, 205, 114, 130],
"ASROCK_BFGDXE_GUID": [1988600983, 65358, 18687, 188, 170, 103, 219, 246, 92, 66, 209],
"ASROCK_IFLASHSETUP_GUID": [2011543064, 9746, 19496, 188, 223, 162, 177, 77, 138, 62, 254],
"ASROCK_S4_SLEEPDELAY_GUID": [2075935011, 23902, 19484, 149, 209, 48, 235, 164, 135, 1, 202],
"ASROCK_HDD_READY_DXE_GUID": [2179248970, 9868, 20428, 142, 57, 28, 29, 62, 111, 110, 105],
"ASROCK_RTLANDXE_GUID": [2332955475, 13708, 20015, 147, 69, 238, 191, 29, 171, 152, 155],
"ASROCK_AMD_SB900_DXE_GUID": [2333274783, 28981, 20139, 175, 218, 5, 18, 247, 75, 101, 234],
"ASROCK_SB900_SMBUS_LIGHT_GUID": [2551896525, 34437, 19115, 175, 218, 5, 18, 247, 75, 101, 234],
"ASROCK_AAFTBL_SMI_GUID": [2667102838, 46054, 19161, 143, 231, 199, 79, 113, 196, 114, 72],
"ASROCK_NVRAMID_GUID": [2708185858, 25876, 17031, 190, 227, 98, 35, 183, 222, 44, 33],
"ASROCK_IDE_SECURITY_GUID": [2847342799, 414, 19851, 163, 167, 136, 225, 234, 1, 105, 158],
"ASROCK_ASM1061_DXE_GUID": [2848876245, 27959, 17694, 169, 191, 245, 143, 122, 11, 60, 194],
"ASROCK_ASM104_X_SMI_GUID": [2904508538, 47702, 18652, 142, 170, 232, 251, 234, 116, 184, 242],
"ASROCK_RTLANSMI_GUID": [3005543067, 24215, 19449, 180, 224, 81, 37, 193, 246, 5, 213],
"ASROCK_GEC_UPDATE_SMI_GUID": [3092850716, 5882, 17832, 146, 1, 28, 56, 48, 169, 115, 189],
"ASROCK_APMOFF_GUID": [3146872289, 16021, 19326, 135, 80, 157, 106, 163, 78, 183, 246],
"ASROCK_SMIFLASH_GUID": [3157425597, 47490, 20309, 159, 121, 5, 106, 215, 233, 135, 197],
"ASROCK_RAID_X64_GUID": [3295196034, 17744, 18697, 173, 87, 36, 150, 20, 27, 63, 74],
"ASROCK_AMD_SB900_SMM_GUID": [3351810409, 6722, 20062, 179, 75, 230, 131, 6, 113, 201, 166],
"ASROCK_FIREWIRE_GUID": [3367390790, 38937, 17835, 135, 93, 9, 223, 218, 109, 139, 27],
"ASROCK_IDE_SMART_GUID": [3581707566, 32927, 17871, 163, 119, 215, 123, 192, 203, 120, 238],
"ASROCK_SB_INTERFACE_DXE_GUID": [3622218689, 38683, 17947, 181, 228, 60, 55, 102, 38, 122, 217],
"ASROCK_AMD_SB900_SMM_DISPATCHER_GUID": [3748899802, 31298, 20062, 179, 75, 230, 131, 6, 113, 201, 166],
"ASROCK_AMDCPU_DXE_GUID": [3786566962, 16719, 18139, 154, 238, 66, 0, 119, 243, 93, 190],
"ASROCK_SMBIOS_DMIEDIT_GUID": [3802613560, 35124, 18677, 132, 18, 153, 233, 72, 200, 220, 27],
"ASROCK_SECURITY_SELECT_DXE_GUID": [3832130086, 37480, 20144, 160, 135, 221, 76, 238, 55, 64, 75],
"ASROCK_FILE_EXPLORER_LITE_GUID": [3875982164, 33976, 16573, 131, 47, 127, 178, 213, 203, 135, 179],
"ASROCK_PLEDSMM_GUID": [3911953940, 15869, 19568, 159, 230, 56, 153, 243, 108, 120, 70],
"ASROCK_CPU_SMBIOS_DRIVER_GUID": [3930959592, 43089, 19103, 171, 244, 183, 159, 162, 82, 130, 145],
"ASROCK_AAFTBL_DXE_GUID": [4279363330, 35107, 18380, 173, 48, 217, 224, 226, 64, 221, 16],
}
| 90.454545 | 108 | 0.666332 | 939 | 5,970 | 4.029819 | 0.517572 | 0.025899 | 0.011099 | 0.0037 | 0.040698 | 0.040698 | 0.040698 | 0.030655 | 0.030655 | 0.016913 | 0 | 0.509954 | 0.167002 | 5,970 | 65 | 109 | 91.846154 | 0.250955 | 0 | 0 | 0 | 0 | 0 | 0.245602 | 0.195008 | 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 | 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 |
2e3264f2b6283971a43a58d5f49534eec7b0ac2f | 208 | py | Python | tests/server/pong_routing.py | Drachenfels/carp-api | b7f280a645d5116d85dc7cd1d177b449704457de | [
"MIT"
] | null | null | null | tests/server/pong_routing.py | Drachenfels/carp-api | b7f280a645d5116d85dc7cd1d177b449704457de | [
"MIT"
] | null | null | null | tests/server/pong_routing.py | Drachenfels/carp-api | b7f280a645d5116d85dc7cd1d177b449704457de | [
"MIT"
] | null | null | null | from carp_api.routing import router
from . import endpoints # NOQA
# to use pong we need to disable common routes as they are using conflicting
# urls
router.enable(endpoints=[
endpoints.UberPong,
])
| 18.909091 | 76 | 0.754808 | 30 | 208 | 5.2 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.182692 | 208 | 10 | 77 | 20.8 | 0.917647 | 0.403846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
2e3b58116e2d1f608d6de30c24daeb4023443f20 | 2,501 | py | Python | set_dictionary/abstractdict.py | pinmingkenan/python_structure | 8d5d12f739136d49c8585d1e8173ca77fd806180 | [
"Apache-2.0"
] | null | null | null | set_dictionary/abstractdict.py | pinmingkenan/python_structure | 8d5d12f739136d49c8585d1e8173ca77fd806180 | [
"Apache-2.0"
] | null | null | null | set_dictionary/abstractdict.py | pinmingkenan/python_structure | 8d5d12f739136d49c8585d1e8173ca77fd806180 | [
"Apache-2.0"
] | null | null | null | # coding = utf-8
from inherit_abstract.abstractcollection import AbstractCollection
class AbstractDict(AbstractCollection):
"""
Common data and method implementations for dictionaries.
"""
def __init__(self, source_collection):
"""
Will copy items to the collection from source_collection if it's present.
"""
AbstractCollection.__init__(self)
if source_collection:
for key, value in source_collection:
self[key] = value
def __str__(self):
return "{" + ", ".join(map(str, self.items())) + "}"
def __and__(self, other):
"""
Returns a new dictionary containing the contents of self adn other.
:param other:
:return:
"""
result = type(self)(map(lambda item: (item.key, item.value), self.items()))
for key in other:
result[key] = other[key]
return result
def __eq__(self, other):
"""
Returns True if self equals other, or False otherwise.
:param other:
:return:
"""
if self is other:
return True
if type(self) != type(other) or len(self) != len(other):
return False
for key in self:
if not key in other:
return False
return True
def keys(self):
"""
Returns a iterator on the keys in the dictionary.
:return:
"""
return iter(self)
def values(self):
"""
Reutrns an iterator on the values in the dictionary.
:return:
"""
return iter(map(lambda key: self[key], self))
def items(self):
"""
Returns an iterator on the items in the dictionary.
:return:
"""
return iter(map(lambda key: Item(key, self[key]), self))
class Item(object):
"""
Represents a dictionary item. Supports comparisons by key.
"""
def __init__(self, key, value):
self.key = key
self.value = value
def __str__(self):
return str(self.key) + ":" + str(self.value)
def __eq__(self, other):
if type(self) != type(other):
return False
return self.key == other.key
def __lt__(self, other):
if type(self) != type(other):
return False
return self.key < other.key
def __le__(self, other):
if type(self) != type(other):
return False
return self.key <= other.key
| 26.326316 | 83 | 0.554178 | 288 | 2,501 | 4.65625 | 0.260417 | 0.04698 | 0.059657 | 0.04176 | 0.271439 | 0.225951 | 0.202834 | 0.202834 | 0.202834 | 0.138702 | 0 | 0.000606 | 0.340664 | 2,501 | 94 | 84 | 26.606383 | 0.812614 | 0.222311 | 0 | 0.297872 | 0 | 0 | 0.002907 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.255319 | false | 0 | 0.021277 | 0.042553 | 0.659574 | 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 |
2e4b63bd5b4769f7df88e32782400d4e36345165 | 5,920 | py | Python | canvas_sdk/methods/gradebook_history.py | david-house-harvard/canvas_python_sdk | 9c2e59621a9a5667bc43c253ef801482b241a2c1 | [
"MIT"
] | 21 | 2015-06-12T13:49:04.000Z | 2021-11-08T05:37:44.000Z | canvas_sdk/methods/gradebook_history.py | david-house-harvard/canvas_python_sdk | 9c2e59621a9a5667bc43c253ef801482b241a2c1 | [
"MIT"
] | 44 | 2015-02-04T15:26:52.000Z | 2021-12-03T17:47:00.000Z | canvas_sdk/methods/gradebook_history.py | david-house-harvard/canvas_python_sdk | 9c2e59621a9a5667bc43c253ef801482b241a2c1 | [
"MIT"
] | 7 | 2015-07-20T23:56:03.000Z | 2021-02-23T17:13:00.000Z | from canvas_sdk import client, utils
def days_in_gradebook_history_for_this_course(request_ctx, course_id, per_page=None, **request_kwargs):
"""
Returns a map of dates to grader/assignment groups
:param request_ctx: The request context
:type request_ctx: :class:RequestContext
:param course_id: (required) The id of the contextual course for this API call
:type course_id: integer
:param per_page: (optional) Set how many results canvas should return, defaults to config.LIMIT_PER_PAGE
:type per_page: integer or None
:return: Days in gradebook history for this course
:rtype: requests.Response (with array data)
"""
if per_page is None:
per_page = request_ctx.per_page
path = '/v1/courses/{course_id}/gradebook_history/days'
payload = {
'per_page' : per_page,
}
url = request_ctx.base_api_url + path.format(course_id=course_id)
response = client.get(request_ctx, url, payload=payload, **request_kwargs)
return response
def details_for_given_date_in_gradebook_history_for_this_course(request_ctx, course_id, date, per_page=None, **request_kwargs):
"""
Returns the graders who worked on this day, along with the assignments they worked on.
More details can be obtained by selecting a grader and assignment and calling the
'submissions' api endpoint for a given date.
:param request_ctx: The request context
:type request_ctx: :class:RequestContext
:param course_id: (required) The id of the contextual course for this API call
:type course_id: integer
:param date: (required) The date for which you would like to see detailed information
:type date: string
:param per_page: (optional) Set how many results canvas should return, defaults to config.LIMIT_PER_PAGE
:type per_page: integer or None
:return: Details for a given date in gradebook history for this course
:rtype: requests.Response (with array data)
"""
if per_page is None:
per_page = request_ctx.per_page
path = '/v1/courses/{course_id}/gradebook_history/{date}'
payload = {
'per_page' : per_page,
}
url = request_ctx.base_api_url + path.format(course_id=course_id, date=date)
response = client.get(request_ctx, url, payload=payload, **request_kwargs)
return response
def lists_submissions(request_ctx, course_id, date, grader_id, assignment_id, per_page=None, **request_kwargs):
"""
Gives a nested list of submission versions
:param request_ctx: The request context
:type request_ctx: :class:RequestContext
:param course_id: (required) The id of the contextual course for this API call
:type course_id: integer
:param date: (required) The date for which you would like to see submissions
:type date: string
:param grader_id: (required) The ID of the grader for which you want to see submissions
:type grader_id: integer
:param assignment_id: (required) The ID of the assignment for which you want to see submissions
:type assignment_id: integer
:param per_page: (optional) Set how many results canvas should return, defaults to config.LIMIT_PER_PAGE
:type per_page: integer or None
:return: Lists submissions
:rtype: requests.Response (with array data)
"""
if per_page is None:
per_page = request_ctx.per_page
path = '/v1/courses/{course_id}/gradebook_history/{date}/graders/{grader_id}/assignments/{assignment_id}/submissions'
payload = {
'per_page' : per_page,
}
url = request_ctx.base_api_url + path.format(course_id=course_id, date=date, grader_id=grader_id, assignment_id=assignment_id)
response = client.get(request_ctx, url, payload=payload, **request_kwargs)
return response
def list_uncollated_submission_versions(request_ctx, course_id, assignment_id=None, user_id=None, ascending=None, per_page=None, **request_kwargs):
"""
Gives a paginated, uncollated list of submission versions for all matching
submissions in the context. This SubmissionVersion objects will not include
the +new_grade+ or +previous_grade+ keys, only the +grade+; same for
+graded_at+ and +grader+.
:param request_ctx: The request context
:type request_ctx: :class:RequestContext
:param course_id: (required) The id of the contextual course for this API call
:type course_id: integer
:param assignment_id: (optional) The ID of the assignment for which you want to see submissions. If absent, versions of submissions from any assignment in the course are included.
:type assignment_id: integer or None
:param user_id: (optional) The ID of the user for which you want to see submissions. If absent, versions of submissions from any user in the course are included.
:type user_id: integer or None
:param ascending: (optional) Returns submission versions in ascending date order (oldest first). If absent, returns submission versions in descending date order (newest first).
:type ascending: boolean or None
:param per_page: (optional) Set how many results canvas should return, defaults to config.LIMIT_PER_PAGE
:type per_page: integer or None
:return: List uncollated submission versions
:rtype: requests.Response (with array data)
"""
if per_page is None:
per_page = request_ctx.per_page
path = '/v1/courses/{course_id}/gradebook_history/feed'
payload = {
'assignment_id' : assignment_id,
'user_id' : user_id,
'ascending' : ascending,
'per_page' : per_page,
}
url = request_ctx.base_api_url + path.format(course_id=course_id)
response = client.get(request_ctx, url, payload=payload, **request_kwargs)
return response
| 44.511278 | 187 | 0.707095 | 824 | 5,920 | 4.894417 | 0.162621 | 0.062485 | 0.013885 | 0.019836 | 0.729482 | 0.704686 | 0.661046 | 0.644185 | 0.630052 | 0.630052 | 0 | 0.000865 | 0.219257 | 5,920 | 132 | 188 | 44.848485 | 0.871701 | 0.584122 | 0 | 0.590909 | 0 | 0 | 0.141031 | 0.11319 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0 | 0.022727 | 0 | 0.204545 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
2e55cbdc85e25fb41d40bbaf42cdc30151a9b83e | 1,657 | py | Python | Files/Print_text.py | Adian-kids/AWD-Framework-First | 7177d14fd61de780e9b0b0981d8ed4531ee8100a | [
"MIT"
] | 4 | 2020-06-17T04:35:41.000Z | 2020-07-27T13:51:43.000Z | Files/Print_text.py | Adian-kids/AWD-Framework-First | 7177d14fd61de780e9b0b0981d8ed4531ee8100a | [
"MIT"
] | null | null | null | Files/Print_text.py | Adian-kids/AWD-Framework-First | 7177d14fd61de780e9b0b0981d8ed4531ee8100a | [
"MIT"
] | 2 | 2020-10-12T12:49:10.000Z | 2021-09-28T02:04:26.000Z | import os
def Usage():
print("Commands : ") #输出帮助信息
print("+----------------------------------------------------+")
print("|Num|Command | Describe |")
print("+----------------------------------------------------+")
print("|0. | help | Get Usage(This Page) |")
print("|1. | shell | Get into the Single Shell |")
print("|2. | send | Send a Command to All servers |")
print("|3. | down | Download the Source code |")
print("|4. | upload | Upload a file to the website |")
print("|5. | log | Download the log of WebServer |")
print("|6. | script | Get the Attack Script list |")
print("+----------------------------------------------------+")
print("You Can type Num or Command to enter the Function which you want,Input 'exit' to break.\n")
def Print_Welcome_Message(): #输出欢迎信息
print("+---------------------------------------+")
print("| AWD Framework |")
print("+---------------------------------------+")
print("| Made By AdianGg |")
print("| AdianGg's Blog:www.e-wolf.top |")
print("| WgpSec:www.wgpsec.org |")
print("| Have Fun |")
print("+---------------------------------------+")
def Scriptlist(): #输出Script目录下所有文件列表
print("All The Scipts from Internet!")
for root,dirs,files in os.walk(r"Scripts/"):
for file in files:
print(os.path.join(root,file))
| 47.342857 | 102 | 0.388654 | 148 | 1,657 | 4.337838 | 0.594595 | 0.077882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006295 | 0.328908 | 1,657 | 34 | 103 | 48.735294 | 0.571043 | 0.017502 | 0 | 0.206897 | 0 | 0.034483 | 0.656948 | 0.189826 | 0 | 0 | 0 | 0 | 0 | 1 | 0.103448 | false | 0 | 0.034483 | 0 | 0.137931 | 0.793103 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
2e6db740bfd18316b5341b49fe5013fc2673f569 | 2,980 | py | Python | trunk/bin/comparecatalogs.py | drmegannewsome/lcogtsnpipe | f00afa7aa68fb0e7aa35aab57c201e54e293b20b | [
"MIT"
] | null | null | null | trunk/bin/comparecatalogs.py | drmegannewsome/lcogtsnpipe | f00afa7aa68fb0e7aa35aab57c201e54e293b20b | [
"MIT"
] | 60 | 2020-05-11T22:57:18.000Z | 2022-03-29T19:40:22.000Z | trunk/bin/comparecatalogs.py | drmegannewsome/lcogtsnpipe | f00afa7aa68fb0e7aa35aab57c201e54e293b20b | [
"MIT"
] | 6 | 2020-09-01T17:32:08.000Z | 2022-02-23T13:44:29.000Z | #!/usr/bin/env python
import lsc
import os
import argparse
default_catdir = os.path.join(os.getenv('LCOSNDIR', lsc.util.workdirectory), 'standard', 'cat')
parser = argparse.ArgumentParser()
parser.add_argument('-F', '--force', action='store_true', help="try to download catalog even if we've tried before")
parser.add_argument('-R', '--radius', type=float, default=20., help="query for stars within this radius of the coordinates")
parser.add_argument('-f', '--field', nargs='+', choices=['landolt', 'apass', 'sloan', 'gaia'],
default=['landolt', 'apass', 'sloan', 'gaia'], help="catalogs to check (all by default)")
args = parser.parse_args()
if args.force:
cond = '=""' # empty string means we've checked before and it wasn't there
else:
cond = ' is null' # null means we haven't checked yet
for system in args.field:
targets = lsc.mysqldef.query(['select id, ra0, dec0 from targets where ' + system + '_cat' + cond], lsc.conn)
print len(targets), 'targets with no', system, 'catalog'
print
for target in targets:
tid = str(target['id'])
print 'Target ID', tid
names = lsc.mysqldef.query(['select name from targetnames where targetid=' + tid], lsc.conn)
print ' aka '.join([n['name'] for n in names])
filepath = os.path.join(default_catdir, system)
for name in names: # see en.wikipedia.org/wiki/Filename#Comparison_of_filename_limitations
filename = name['name'].translate(None, ' "*:<>?/|\\') + '_' + system + '.cat'
fileexists = os.path.isfile(os.path.join(filepath, filename))
if fileexists:
print 'Adding', filename, 'to database'
lsc.mysqldef.query(['update targets set ' + system + '_cat="' + filename + '", '+ system + '_cat_path where id=' + tid], lsc.conn)
break
if not fileexists and system != 'landolt':
print 'Querying for catalog...'
if system == 'apass':
os.system('queryapasscat.py -r {ra0} -d {dec0} -R {radius} -o '.format(radius=args.radius, **target) + os.path.join(filepath, filename))
elif system == 'sloan':
lsc.lscabsphotdef.sloan2file(target['ra0'], target['dec0'], args.radius, output=os.path.join(filepath, filename))
elif system == 'gaia':
lsc.lscabsphotdef.gaia2file(target['ra0'], target['dec0'],
output=os.path.join(filepath, filename))
fileexists = os.path.isfile(os.path.join(filepath, filename))
if fileexists:
print 'Adding', filename, 'to database'
lsc.mysqldef.query(['update targets set ' + system + '_cat="' + filename + '" where id=' + tid], lsc.conn)
if not fileexists:
print 'No catalog exists'
print
lsc.mysqldef.query(['update targets set ' + system + '_cat="" where ' + system + '_cat is NULL'], lsc.conn) # change NULL to '' if not in field
| 54.181818 | 152 | 0.611074 | 372 | 2,980 | 4.846774 | 0.362903 | 0.02995 | 0.038824 | 0.049917 | 0.255685 | 0.236828 | 0.215752 | 0.175818 | 0.153078 | 0.153078 | 0 | 0.00527 | 0.235906 | 2,980 | 54 | 153 | 55.185185 | 0.786561 | 0.072819 | 0 | 0.166667 | 0 | 0 | 0.249184 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.083333 | 0.0625 | null | null | 0.1875 | 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 |
2e74549502ee3fbceab7d78082a65a25de94f1a2 | 471 | py | Python | pyhsgw/hs_set_value.py | zopyx/pyHSgw | 42f9cdf375130f601f7a35cf1caee3c5a49ab484 | [
"BSD-3-Clause"
] | null | null | null | pyhsgw/hs_set_value.py | zopyx/pyHSgw | 42f9cdf375130f601f7a35cf1caee3c5a49ab484 | [
"BSD-3-Clause"
] | null | null | null | pyhsgw/hs_set_value.py | zopyx/pyHSgw | 42f9cdf375130f601f7a35cf1caee3c5a49ab484 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
import hsgw
from sys import argv, exit
if len(argv) != 4:
print argv[0], "<key> <addr> <value>"
(key, addr, value) = argv[1:]
print "key =", key
print "addr =", addr
print "value =", value
if not hsgw.initConnection(key = key):
print "Could not initialize connection."
exit(1)
print "Setting value of", hsgw.comm_objects[addr]['name'].encode('utf-8'), "[" + str(addr) + "] to ", value
hsgw.setValue(addr, value)
hsgw.closeConnection()
| 21.409091 | 107 | 0.647558 | 69 | 471 | 4.405797 | 0.507246 | 0.088816 | 0.078947 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012755 | 0.167728 | 471 | 21 | 108 | 22.428571 | 0.762755 | 0.03397 | 0 | 0 | 0 | 0 | 0.222467 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.142857 | null | null | 0.428571 | 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 |
2e74ca3a12ea7ed1aacea732de257ba7d9e4fd0b | 4,727 | py | Python | log_to_blockchain.py | sandialabs/idash2018task1 | 46a53c882f3c5f81cabb9c1b0a463f1ec6f9f414 | [
"BSD-3-Clause"
] | 1 | 2020-08-03T20:52:52.000Z | 2020-08-03T20:52:52.000Z | log_to_blockchain.py | sandialabs/idash2018task1 | 46a53c882f3c5f81cabb9c1b0a463f1ec6f9f414 | [
"BSD-3-Clause"
] | null | null | null | log_to_blockchain.py | sandialabs/idash2018task1 | 46a53c882f3c5f81cabb9c1b0a463f1ec6f9f414 | [
"BSD-3-Clause"
] | 2 | 2018-11-25T22:31:08.000Z | 2020-08-03T20:52:56.000Z | #TODO: thread to balance optimize disk i/o vs network, try to saturate
#TODO: look into the rawtransaction way of doing multiple things at once
#TODO: look into optimizing/issuing network directly, instead of through RPC
#import subprocess
import binascii
import math
import json
import time
import random
import argparse
import os
import sys
from Savoir import Savoir
def insert(api,trps):
start_time = time.time()
delta = 1.0/float(trps)
target_time = None
behindct = ontimect = 0
cmd_times = []
addr = api.listaddresses()[0]['address']
#addr = json.loads(subprocess.check_output(["multichain-cli",\
# sys.argv[1],"listaddresses"],\
# stderr=devnull))[0]['address']
numinsertions = 0
d = {}
for line in sys.stdin.readlines():
(d['timestamp'],d['node'],d['id'],d['ref-id'],d['user'],\
d['activity'],d['resource']) = line[:-1].split('\t')
for int_key in ['node', 'id', 'timestamp', 'user', 'ref-id']:
d[int_key] = int(d[int_key])
sends = []
sends.append({'for':'logdata', 'key':'UID_' + str(d['node']) + \
'_' + str(d['id']), 'data': binascii.hexlify(json.dumps(d))})
numinsertions += 1
for (k,v) in d.iteritems():
sends.append({'for':str(k), 'key':str(k)+'_'+str(v), \
'data': binascii.hexlify('UID_' + str(d['node']) + \
'_' + str(d['id']))})
if k == 'timestamp':
sends.append({'for':"node%dtimestamps" % int(d['node']), \
'key':str(v), \
'data':binascii.hexlify('UID_' \
+ str(d['node'])\
+ '_' + str(d['id']))})
#cmd = ['multichain-cli', sys.argv[1], 'createrawsendfrom', \
# '%s' % addr, "{}", "%s" % json.dumps(sends), 'send']
if target_time == None:
target_time = time.time()
if time.time() >= target_time:
behindct += 1
print 'fallen behind :-( (%d+%d=%d)' % (behindct,ontimect,behindct+ontimect)
else:
ontimect += 1
print 'caught back up :-) (%d+%d=%d)' % (behindct,ontimect,behindct+ontimect)
while time.time() < target_time:
pass
cmd_start = time.time()
#subprocess.check_output(cmd,stderr=devnull)
api.createrawsendfrom('%s' % addr, {}, sends, 'send')
cmd_time = time.time()-cmd_start
cmd_times.append(cmd_time)
target_time += delta
elapsed_time = time.time() - start_time
insertionstring = 'insertion took %s seconds, %s secs/record (%s records)' % \
(elapsed_time, elapsed_time/numinsertions, numinsertions)
print insertionstring
histogram = map(lambda x:0, range(40))
bigger = 0
maxval = 0
for sample in cmd_times:
if sample > maxval:
maxval = sample
bucket = int(math.floor(sample/.1))
if bucket > 39:
bigger += 1
else:
histogram[bucket] += 1
print histogram
print bigger
print maxval
if __name__=='__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--rpcuser', \
action='store', \
help='multichain rpc user')
parser.add_argument('--rpcport', \
action='store', \
help='multichain rpc port')
parser.add_argument('--rpcpasswd', \
action='store', \
help='multichain rpc password')
parser.add_argument('--chainname', \
action='store', \
help='multichain chain name')
parser.add_argument('--targetrecordspersecond', \
action='store', \
type=int, \
help='attempt to insert at this rate')
args = parser.parse_args()
if args.rpcuser:
rpcuser = args.rpcuser
else:
rpcuser = 'multichainrpc'
if args.rpcpasswd:
rpcpasswd = args.rpcpasswd
else:
filename = '/home/ubuntu/.multichain/logchain/multichain.conf'
rpcpasswd = dict(map(lambda y: y.split('='), \
filter(lambda x: x, \
open(filename).read().split('\n'))))['rpcpassword']
rpchost = 'localhost'
if args.rpcport:
rpcport = args.rpcport
else:
rpcport = '4920'
if args.chainname:
chainname = args.chainname
else:
chainname = 'logchain'
#print 'connecting Savoir(%s,%s,%s,%s,%s)' % (rpcuser,rpcpasswd,rpchost,rpcport,chainname)
savoirapi = Savoir(rpcuser,rpcpasswd,rpchost,rpcport,chainname)
insert(savoirapi,args.targetrecordspersecond)
| 34.253623 | 94 | 0.549397 | 520 | 4,727 | 4.909615 | 0.328846 | 0.034469 | 0.033294 | 0.03917 | 0.145319 | 0.065413 | 0.065413 | 0.031336 | 0.031336 | 0.031336 | 0 | 0.00786 | 0.30019 | 4,727 | 137 | 95 | 34.50365 | 0.763906 | 0.145547 | 0 | 0.099099 | 0 | 0 | 0.148498 | 0.018128 | 0 | 0 | 0 | 0.007299 | 0 | 0 | null | null | 0.072072 | 0.081081 | null | null | 0.054054 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
2e757cbcf7753e1a41bcc35d789ef83c1bf668e3 | 544 | py | Python | fpl/migrations/0017_auto_20180816_2035.py | sornars/leaguetracker | b83cd21db2edfeeeaecc27b768107e5b7bf0cd93 | [
"MIT"
] | null | null | null | fpl/migrations/0017_auto_20180816_2035.py | sornars/leaguetracker | b83cd21db2edfeeeaecc27b768107e5b7bf0cd93 | [
"MIT"
] | null | null | null | fpl/migrations/0017_auto_20180816_2035.py | sornars/leaguetracker | b83cd21db2edfeeeaecc27b768107e5b7bf0cd93 | [
"MIT"
] | null | null | null | # Generated by Django 2.1 on 2018-08-16 20:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fpl', '0016_auto_20180816_2020'),
]
operations = [
migrations.AlterField(
model_name='classicleague',
name='fpl_league_id',
field=models.IntegerField(),
),
migrations.AlterField(
model_name='headtoheadleague',
name='fpl_league_id',
field=models.IntegerField(),
),
]
| 22.666667 | 45 | 0.582721 | 52 | 544 | 5.923077 | 0.653846 | 0.12987 | 0.162338 | 0.188312 | 0.246753 | 0.246753 | 0.246753 | 0 | 0 | 0 | 0 | 0.079787 | 0.308824 | 544 | 23 | 46 | 23.652174 | 0.739362 | 0.079044 | 0 | 0.470588 | 1 | 0 | 0.162325 | 0.046092 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.058824 | 0 | 0.235294 | 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 |
2e7a4d5bb577ab8e56c7765e7aa74cfa6de7a904 | 176 | py | Python | crawl_cvs-project/crawl_cvs/url_builder.py | MacHu-GWU/learn_scrapy-project | e6324471704a2ba092ec59abedf617d98d18d436 | [
"MIT"
] | null | null | null | crawl_cvs-project/crawl_cvs/url_builder.py | MacHu-GWU/learn_scrapy-project | e6324471704a2ba092ec59abedf617d98d18d436 | [
"MIT"
] | null | null | null | crawl_cvs-project/crawl_cvs/url_builder.py | MacHu-GWU/learn_scrapy-project | e6324471704a2ba092ec59abedf617d98d18d436 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import crawlib
class CvsUrlBuilder(crawlib.BaseUrlBuilder):
domain = "https://www.cvs.com/"
urlbuilder = CvsUrlBuilder()
| 14.666667 | 44 | 0.681818 | 20 | 176 | 6 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006667 | 0.147727 | 176 | 11 | 45 | 16 | 0.793333 | 0.238636 | 0 | 0 | 0 | 0 | 0.151515 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.75 | 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 | 0 | 0 | 1 | 0 | 0 | 2 |
2e7a800956a7899680c40d12d8132141d36264a0 | 689 | py | Python | app/models/oj.py | Kyooooma/view-oj-backend | 3b2fc9ed0b8b52029b45cd30f90e8dd925a09d35 | [
"Apache-2.0"
] | 6 | 2019-08-05T13:01:19.000Z | 2021-07-16T09:59:45.000Z | app/models/oj.py | Kyooooma/view-oj-backend | 3b2fc9ed0b8b52029b45cd30f90e8dd925a09d35 | [
"Apache-2.0"
] | null | null | null | app/models/oj.py | Kyooooma/view-oj-backend | 3b2fc9ed0b8b52029b45cd30f90e8dd925a09d35 | [
"Apache-2.0"
] | 6 | 2019-12-05T13:04:38.000Z | 2020-07-05T15:05:40.000Z | from sqlalchemy import Boolean, Column, Integer, String
from app.models.base import Base
class OJ(Base):
__tablename__ = 'oj'
fields = ['id', 'name', 'status', 'need_password']
id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(String(100), unique=True)
url = Column(String(1000))
status = Column(Integer, nullable=False)
need_password = Column(Boolean, nullable=False, default=False)
need_single_thread = Column(Boolean, nullable=False, default=False)
@classmethod
def get_by_name(cls, name):
r = cls.search(name=name)['data']
if r:
return r[0]
return cls.create(name=name, status=0)
| 28.708333 | 71 | 0.666183 | 89 | 689 | 5.033708 | 0.494382 | 0.087054 | 0.09375 | 0.116071 | 0.169643 | 0.169643 | 0 | 0 | 0 | 0 | 0 | 0.016514 | 0.208999 | 689 | 23 | 72 | 29.956522 | 0.805505 | 0 | 0 | 0 | 0 | 0 | 0.044993 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.058824 | false | 0.117647 | 0.117647 | 0 | 0.823529 | 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 |
2e7b8c7a1f96576a8ce83e77e893389b85c02c65 | 413 | py | Python | Expressions/Operations/Pow.py | nerdsupremacist/LlamaLang | 84484b03eb24f326d7889c9dd4e9605d4eca9f8d | [
"MIT"
] | 5 | 2019-04-03T12:27:37.000Z | 2022-02-18T08:20:12.000Z | Expressions/Operations/Pow.py | nerdsupremacist/LlamaLang | 84484b03eb24f326d7889c9dd4e9605d4eca9f8d | [
"MIT"
] | 7 | 2016-05-26T13:46:33.000Z | 2016-06-15T20:57:15.000Z | Expressions/Operations/Pow.py | mathiasquintero/LlamaLang | 84484b03eb24f326d7889c9dd4e9605d4eca9f8d | [
"MIT"
] | null | null | null | from Expressions.Number import Number
class Pow(Number):
def __init__(self, left, right):
self.left = left
self.right = right
def eval(self):
if self.left.type() == Number and self.right.type() == Number:
return self.left.eval() ** self.right.eval()
else:
raise Exception('Invalid Input: Not Numbers')
def type(self):
return Number
| 22.944444 | 70 | 0.590799 | 51 | 413 | 4.705882 | 0.45098 | 0.133333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.292978 | 413 | 17 | 71 | 24.294118 | 0.821918 | 0 | 0 | 0 | 0 | 0 | 0.062954 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.083333 | 0.083333 | 0.583333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
2e8188e1b5844062b4f166f34c4b31931a6fc142 | 801 | py | Python | merlion/models/anomaly/forecast_based/arima.py | ankitakashyap05/Merlion | 7dc95fbf64002e22bfce89625bdb76b7a3cbfbfc | [
"BSD-3-Clause"
] | 2,215 | 2021-09-21T18:11:36.000Z | 2022-03-31T20:21:42.000Z | merlion/models/anomaly/forecast_based/arima.py | ankitakashyap05/Merlion | 7dc95fbf64002e22bfce89625bdb76b7a3cbfbfc | [
"BSD-3-Clause"
] | 56 | 2021-09-22T14:45:50.000Z | 2022-03-29T22:28:19.000Z | merlion/models/anomaly/forecast_based/arima.py | ankitakashyap05/Merlion | 7dc95fbf64002e22bfce89625bdb76b7a3cbfbfc | [
"BSD-3-Clause"
] | 181 | 2021-09-22T09:04:22.000Z | 2022-03-29T16:04:43.000Z | #
# Copyright (c) 2021 salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
"""
Classic ARIMA (AutoRegressive Integrated Moving Average) forecasting model,
adapted for anomaly detection.
"""
from merlion.models.anomaly.forecast_based.base import ForecastingDetectorBase
from merlion.models.anomaly.base import DetectorConfig
from merlion.models.forecast.arima import ArimaConfig, Arima
from merlion.post_process.threshold import AggregateAlarms
class ArimaDetectorConfig(ArimaConfig, DetectorConfig):
_default_threshold = AggregateAlarms(alm_threshold=2.5)
class ArimaDetector(ForecastingDetectorBase, Arima):
config_class = ArimaDetectorConfig
| 34.826087 | 110 | 0.815231 | 96 | 801 | 6.739583 | 0.645833 | 0.068006 | 0.078825 | 0.074189 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011173 | 0.106117 | 801 | 22 | 111 | 36.409091 | 0.892458 | 0.393258 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
2e8465e06a15db8c637c5ad1006b7946b8ad2cd0 | 1,788 | py | Python | Code/set.py | escofresco/makeschool_cs13_core_ds | 74195ea836338c84c912ecd15da3cb7aab229fb5 | [
"MIT"
] | null | null | null | Code/set.py | escofresco/makeschool_cs13_core_ds | 74195ea836338c84c912ecd15da3cb7aab229fb5 | [
"MIT"
] | 4 | 2020-02-17T22:25:41.000Z | 2020-03-10T08:49:06.000Z | Code/set.py | escofresco/makeschool_cs13_core_ds | 74195ea836338c84c912ecd15da3cb7aab229fb5 | [
"MIT"
] | null | null | null | """This module is a custom implement of the set data type.
Implements:
Set data type class."""
from binarytree import BinarySearchTree
from copy import deepcopy
class Set:
"""Implements a set using BinarySearchTree"""
__slots__ = ("data",)
def __init__(self, it=()):
self.data = BinarySearchTree(it)
def add(self, elm):
self.data.insert(elm)
def remove(self, elm):
self.data.delete(elm)
def union(self, other_set):
bigger_set = max(self, other_set, key=lambda set: set.size)
smaller_set = min(self, other_set, key=lambda set: set.size)
return Set(self.items() + other_set.items())
def intersection(self, other_set):
bigger_set = max(self, other_set, key=lambda set: set.size)
smaller_set = min(self, other_set, key=lambda set: set.size)
return Set(tuple(elm for elm in smaller_set.items()
if bigger_set.contains(elm)))
def difference(self, other_set):
res = Set()
for elm in self.items():
if not other_set.contains(elm):
res.add(elm)
return res
def is_subset(self, other_set):
for elm in self.items():
if not other_set.contains(elm):
return False
return True
def items(self):
return self.data.items_in_order()
def contains(self, elm):
return self.data.contains(elm)
@property
def size(self):
return self.data.size
def __eq__(self, other):
if isinstance(other, BinarySearchTree):
return self.data == other
elif isinstance(other, Set):
return self.data == other.data
else:
raise TypeError("Can only compare with BinarySearchTree and Set")
| 28.380952 | 77 | 0.60962 | 234 | 1,788 | 4.521368 | 0.282051 | 0.090737 | 0.090737 | 0.056711 | 0.287335 | 0.287335 | 0.287335 | 0.287335 | 0.287335 | 0.287335 | 0 | 0 | 0.288031 | 1,788 | 62 | 78 | 28.83871 | 0.831108 | 0.074385 | 0 | 0.181818 | 0 | 0 | 0.030414 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.045455 | 0.068182 | 0.568182 | 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 |
2e84f7f317a9e66ebbebbcae3a975ec7b991d53f | 937 | py | Python | xos/grpc/tests/api_user_crud.py | pan2za/xos | c2a4da2ccaa12360b2718be303b247866aefdfe6 | [
"Apache-2.0"
] | null | null | null | xos/grpc/tests/api_user_crud.py | pan2za/xos | c2a4da2ccaa12360b2718be303b247866aefdfe6 | [
"Apache-2.0"
] | 5 | 2020-06-05T17:47:15.000Z | 2021-09-23T23:21:27.000Z | xos/grpc/tests/api_user_crud.py | pan2za/xos | c2a4da2ccaa12360b2718be303b247866aefdfe6 | [
"Apache-2.0"
] | null | null | null | import sys
sys.path.append("..")
import grpc_client
from testconfig import *
print "api_user_crud"
#c=grpc_client.InsecureClient("localhost")
c=grpc_client.SecureClient("xos-core.cord.lab", username=USERNAME, password=PASSWORD)
u=grpc_client.User()
import random, string
u.email=''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
u.site_id=1
u2=c.stub.CreateUser(u)
# update the user
u2.password="foobar"
c.stub.UpdateUser(u2)
# do a listall and make sure user exists
u_all = c.stub.ListUser(grpc_client.Empty()).items
u_all = [x for x in u_all if x.email == u.email]
assert(len(u_all)==1)
u3=c.stub.GetUser(grpc_client.ID(id=u2.id))
assert(u3.id == u2.id)
assert(u3.password=="foobar")
c.stub.DeleteUser(grpc_client.ID(id=u3.id))
# make sure it is deleted
u_all = c.stub.ListUser(grpc_client.Empty()).items
u_all = [x for x in u_all if x.email == u.email]
assert(len(u_all)==0)
print " okay"
| 24.025641 | 89 | 0.735326 | 169 | 937 | 3.952663 | 0.402367 | 0.11976 | 0.032934 | 0.056886 | 0.278443 | 0.236527 | 0.236527 | 0.236527 | 0.236527 | 0.236527 | 0 | 0.016746 | 0.107791 | 937 | 38 | 90 | 24.657895 | 0.782297 | 0.128068 | 0 | 0.166667 | 0 | 0 | 0.064039 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 0 | null | null | 0.125 | 0.166667 | null | null | 0.083333 | 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 |
cf07e4d49362a937cf48cd3216faa6ecbaf0289e | 1,142 | py | Python | qunetsim/utils/constants.py | rheaparekh/QuNetSim | f09335d4994fc9f82f15c0bebbbe3d21b945b4ea | [
"MIT"
] | null | null | null | qunetsim/utils/constants.py | rheaparekh/QuNetSim | f09335d4994fc9f82f15c0bebbbe3d21b945b4ea | [
"MIT"
] | null | null | null | qunetsim/utils/constants.py | rheaparekh/QuNetSim | f09335d4994fc9f82f15c0bebbbe3d21b945b4ea | [
"MIT"
] | 1 | 2020-09-17T15:43:34.000Z | 2020-09-17T15:43:34.000Z | class Constants:
# DATA TYPES
GENERATE_EPR_IF_NONE = 'generate_epr_if_none'
AWAIT_ACK = 'await_ack'
SEQUENCE_NUMBER = 'sequence_number'
PAYLOAD = 'payload'
PAYLOAD_TYPE = 'payload_type'
SENDER = 'sender'
RECEIVER = 'receiver'
PROTOCOL = 'protocol'
KEY = 'key'
# WAIT TIME
WAIT_TIME = 10
# QUBIT TYPES
EPR = 0
DATA = 1
GHZ = 2
# DATA KINDS
SIGNAL = 'signal'
CLASSICAL = 'classical'
QUANTUM = 'quantum'
# SIGNALS
ACK = 'qunetsim_ACK__'
NACK = 'qunetsim_NACK__'
# PROTOCOL IDs
REC_EPR = 'rec_epr'
SEND_EPR = 'send_epr'
REC_TELEPORT = 'rec_teleport'
SEND_TELEPORT = 'send_teleport'
REC_SUPERDENSE = 'rec_superdense'
SEND_SUPERDENSE = 'send_superdense'
REC_CLASSICAL = 'rec_classical'
SEND_CLASSICAL = 'send_classical'
SEND_BROADCAST = 'send_broadcast'
RELAY = 'relay'
SEND_QUBIT = 'send_qubit'
REC_QUBIT = 'rec_qubit'
SEND_KEY = 'send_key'
REC_KEY = 'rec_key'
SEND_GHZ = 'send_ghz'
REC_GHZ = 'rec_ghz'
# MISC
QUBITS = 'qubits'
HOSTS = 'hosts'
KEYSIZE = 'keysize'
| 21.54717 | 49 | 0.62697 | 133 | 1,142 | 5.015038 | 0.330827 | 0.058471 | 0.038981 | 0.050975 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006046 | 0.275832 | 1,142 | 52 | 50 | 21.961538 | 0.800484 | 0.06042 | 0 | 0 | 1 | 0 | 0.301408 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
cf2441e808929b6faa57cc3a71cd5dfe5c01ef11 | 388 | py | Python | mach/models.py | RobDBennett/mach2 | c6beac71712acbec01fbec68809d759be13e891b | [
"MIT"
] | null | null | null | mach/models.py | RobDBennett/mach2 | c6beac71712acbec01fbec68809d759be13e891b | [
"MIT"
] | null | null | null | mach/models.py | RobDBennett/mach2 | c6beac71712acbec01fbec68809d759be13e891b | [
"MIT"
] | null | null | null | """SQLAlchemy models and utility functions for Sprint."""
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class Record(db.Model):
id = db.Column(db.Integer, primary_key=True)
datetime = db.Column(db.String(25))
value = db.Column(db.Float, nullable=False)
def __repr__(self):
return f'Record[id:{self.id},datetime{self.datetime},value{self.value}]'
| 24.25 | 80 | 0.703608 | 54 | 388 | 4.944444 | 0.592593 | 0.089888 | 0.11236 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006116 | 0.157216 | 388 | 15 | 81 | 25.866667 | 0.810398 | 0.131443 | 0 | 0 | 0 | 0 | 0.187879 | 0.187879 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.125 | 0.125 | 0.875 | 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 |
cf5af642f862583555a72b1ffb31c75257f89438 | 1,939 | py | Python | test.py | iNateDawg/Craft | 07cc0002d74ed4842861e318f8fffb1d7883f0e8 | [
"MIT"
] | null | null | null | test.py | iNateDawg/Craft | 07cc0002d74ed4842861e318f8fffb1d7883f0e8 | [
"MIT"
] | 23 | 2020-02-13T23:36:55.000Z | 2020-04-27T18:24:04.000Z | test.py | iNateDawg/Craft | 07cc0002d74ed4842861e318f8fffb1d7883f0e8 | [
"MIT"
] | null | null | null | import normalize
norm = normalize.normalize("heightdata.png", 6, 6)
class TestNormArray:
"""test_norm_array references requirement 3.0 because it shows 2x2 block area of (0,0),
(0,1), (1,0), (1,1), this area will for sure be a 2x2 block area"""
# \brief Ref : Req 3.0 One pixel in topographic image shall correspond to a 2x2 block area
def test_norm_array(self):
assert norm.getval(0, 0) == 66
assert norm.getval(0, 1) == 66
assert norm.getval(1, 0) == 66
assert norm.getval(1, 1) == 66
"""test_array_dimensions reference requirement 3.0 because if each pixel corresponds
to a 2x2 area, then the height and width will be doubled from 6x6 to 12x12 as an example"""
# \brief Ref : Req 3.0 One pixel in topographic image shall correspond to a 2x2 block area
def test_array_dimensions(self):
assert norm.height == 12
assert norm.width == 12
# \brief Ref : Req 1.2 Pixel values shall be normalized to represent a realistic range of block heights
# \brief Ref : Req 1.3 The realistic range of block heights shall be a minimum of 20 blocks and a maximum of 100 blocks
def test_max(self):
assert norm.get_max() == [100, 8, 8]
# \brief Ref : Req 1.2 Pixel values shall be normalized to represent a realistic range of block heights
# \brief Ref : Req 1.3 The realistic range of block heights shall be a minimum of 20 blocks and a maximum of 100 blocks
def test_min(self):
assert norm.get_min() == [20, 2, 0]
class TestProcessImage:
# \brief Ref : Req Req 1.1 Topographic image shall be a .png image
def test_file_ending(self):
## test file not ending in .png
assert normalize.process_image("heightdata.jpg", 10, 10) == 'File must be a .png \n'
def test_file_not_found(self):
## test file that doesn't exist
assert normalize.process_image("heightfile.png", 10, 10) == None
| 46.166667 | 123 | 0.676122 | 317 | 1,939 | 4.07571 | 0.29653 | 0.06192 | 0.059598 | 0.037152 | 0.439628 | 0.394737 | 0.394737 | 0.394737 | 0.394737 | 0.394737 | 0 | 0.06157 | 0.237751 | 1,939 | 41 | 124 | 47.292683 | 0.812585 | 0.459515 | 0 | 0 | 0 | 0 | 0.0761 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0.3 | false | 0 | 0.05 | 0 | 0.45 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
cf5e44c6b2e424b2b5948c67c6cd8e692e1cb91a | 916 | py | Python | code/util/rototranslation.py | goldleaf3i/declutter-reconstruct | 954b755a1eced34af50d31ee2e3938a0b751cc4d | [
"MIT"
] | 2 | 2022-03-14T07:37:45.000Z | 2022-03-25T09:01:48.000Z | code/util/rototranslation.py | goldleaf3i/declutter-reconstruct | 954b755a1eced34af50d31ee2e3938a0b751cc4d | [
"MIT"
] | 1 | 2022-03-24T07:34:16.000Z | 2022-03-27T11:20:27.000Z | code/util/rototranslation.py | goldleaf3i/declutter-reconstruct | 954b755a1eced34af50d31ee2e3938a0b751cc4d | [
"MIT"
] | 1 | 2022-03-08T05:37:22.000Z | 2022-03-08T05:37:22.000Z | import math
def rototranslate(x0, y0, angle):
alpha = float(angle)*math.pi/180.0
cos = math.cos
sin = math.sin
def RT(x, y):
return x0+x*cos(alpha)-y*sin(alpha),y0+x*sin(alpha)+y*cos(alpha)
return RT
def inverseRT(x0, y0, angle):
alpha = float(angle)*math.pi/180.0
cos = math.cos
sin = math.sin
def iRT(x, y):
return -x0*cos(alpha)-y0*sin(alpha)+cos(alpha)*x+sin(alpha)*y, x0*sin(alpha)-y0*cos(alpha)-x*sin(alpha)+y*cos(alpha)
return iRT
def transform_points(x0, y0, angle):
# x0,y0 e' il punto da traslare, angle e' l'angolo del piano
# calcolo la rotazione del piano
rotation = 90-angle
inverse = -rotation
# proietto le coordinate (0,0) nel sistema di riferimento assoluto nel sistema di riferimento del punto
iRT = inverseRT(x0, y0, inverse)
(xc, yc) = iRT(0, 0)
#restituisco la funzione che transforma rispetto al piano xc yc angolato di alfa
return rototranslate(xc,yc,rotation)
| 26.941176 | 118 | 0.706332 | 163 | 916 | 3.96319 | 0.337423 | 0.074303 | 0.041796 | 0.04644 | 0.291022 | 0.291022 | 0.250774 | 0.176471 | 0.176471 | 0.176471 | 0 | 0.03881 | 0.156114 | 916 | 33 | 119 | 27.757576 | 0.796895 | 0.29476 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.238095 | false | 0 | 0.047619 | 0.095238 | 0.52381 | 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 |
cf68231df974fd2bf1dc647492649911b88dec93 | 925 | py | Python | dayu_database/status/__init__.py | phenom-films/dayu_database | 221f965a77a5ea1d4074135903d29bc0a9d9b1c7 | [
"MIT"
] | 7 | 2018-10-11T07:44:57.000Z | 2020-10-08T14:44:52.000Z | dayu_database/status/__init__.py | phenom-films/dayu_database | 221f965a77a5ea1d4074135903d29bc0a9d9b1c7 | [
"MIT"
] | null | null | null | dayu_database/status/__init__.py | phenom-films/dayu_database | 221f965a77a5ea1d4074135903d29bc0a9d9b1c7 | [
"MIT"
] | 6 | 2018-10-16T02:54:37.000Z | 2022-02-16T13:43:02.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
__author__ = 'andyguo'
from functools import wraps
class DayuDatabaseStatusNotConnect(object):
pass
class DayuDatabaseStatusConnected(object):
pass
def validate_status(status):
def outter_wrapper(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
current_status = getattr(self, 'status', None)
if current_status is None:
from dayu_database.error import DayuStatusNotSetError
raise DayuStatusNotSetError('{} status not set or without status'.format(self))
if not isinstance(current_status, status):
from dayu_database.error import DayuStatusInvalidateError
raise DayuStatusInvalidateError('{} not match {}'.format(current_status, status))
return func(self, *args, **kwargs)
return wrapper
return outter_wrapper | 28.030303 | 97 | 0.658378 | 93 | 925 | 6.408602 | 0.494624 | 0.087248 | 0.04698 | 0.07047 | 0.090604 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001447 | 0.252973 | 925 | 33 | 98 | 28.030303 | 0.861071 | 0.047568 | 0 | 0.1 | 0 | 0 | 0.071591 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.15 | false | 0.1 | 0.15 | 0 | 0.55 | 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 |
cf72823e6134abf9dc68d82573bb0ef74467bab2 | 431 | py | Python | yepes/contrib/emails/models.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | yepes/contrib/emails/models.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | yepes/contrib/emails/models.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
from yepes.apps import apps
AbstractConnection = apps.get_class('emails.abstract_models', 'AbstractConnection')
AbstractDelivery = apps.get_class('emails.abstract_models', 'AbstractDelivery')
AbstractMessage = apps.get_class('emails.abstract_models', 'AbstractMessage')
class Connection(AbstractConnection):
pass
class Delivery(AbstractDelivery):
pass
class Message(AbstractMessage):
pass
| 22.684211 | 83 | 0.774942 | 44 | 431 | 7.454545 | 0.431818 | 0.064024 | 0.109756 | 0.164634 | 0.292683 | 0.292683 | 0 | 0 | 0 | 0 | 0 | 0.002611 | 0.111369 | 431 | 18 | 84 | 23.944444 | 0.853786 | 0.046404 | 0 | 0.3 | 0 | 0 | 0.281863 | 0.161765 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.3 | 0.1 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
cf7428c27c691770110fa52f6694724bc3c98a7d | 1,345 | py | Python | pentominos.py | wusui/pentomino_redux | 258b2f541329a6e7e20fc6b58534ab4201b6082f | [
"MIT"
] | null | null | null | pentominos.py | wusui/pentomino_redux | 258b2f541329a6e7e20fc6b58534ab4201b6082f | [
"MIT"
] | null | null | null | pentominos.py | wusui/pentomino_redux | 258b2f541329a6e7e20fc6b58534ab4201b6082f | [
"MIT"
] | null | null | null | """
Top level function calls for pentomino solver
"""
from tree_find_pents import build_pent_tree
from rect_find_x import solve_case
def fill_rectangles_with_pentominos(io_obj=print, low=3, high=7):
"""
Loop through rectangle sizes and solve for each. build_pent_tree
is called to initialize the tree. Io_obj is a routine to be used
to display or store results. It defaults to a straight print in
python3, but can be overridden.
"""
_solve_rectangles(build_pent_tree(), tuple(range(low, high)), io_obj)
def _solve_rectangles(tree, zrange, io_obj):
"""
Call wrap_rectangle for all values inside the range of rectangle heights
"""
tuple(map(_wrap_rectangle(tree)(io_obj), zrange))
def _wrap_rectangle(tree):
"""
Curry process_rectangle calls (called from inside a map function)
"""
def _inner0(io_obj):
def _inner1(ysize):
_process_rectangle(tree, ysize, io_obj)
return _inner1
return _inner0
def _process_rectangle(tree, ysize, io_obj):
"""
Call solve case. Generate layout of the rectangle first (ysize rows each
of which are 60 // ysize squares long)
"""
solve_case([[0 for _ in range(60 // ysize)]
for _ in range(ysize)], tree, io_obj)
if __name__ == "__main__":
fill_rectangles_with_pentominos()
| 28.617021 | 77 | 0.692937 | 193 | 1,345 | 4.544041 | 0.450777 | 0.051311 | 0.04447 | 0.063854 | 0.068415 | 0.068415 | 0 | 0 | 0 | 0 | 0 | 0.011472 | 0.222305 | 1,345 | 46 | 78 | 29.23913 | 0.82696 | 0.391078 | 0 | 0 | 0 | 0 | 0.010884 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.352941 | false | 0 | 0.117647 | 0 | 0.588235 | 0.058824 | 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 |
cf746234a79fd1b2603a547db20b86892c27b565 | 95 | py | Python | tests/custom_template_path_root/conf.py | TimKam/sphinx-pretty-searchresults | 65fc8133f0fab70627c665e1ccfc6a5d45d16fc3 | [
"MIT"
] | 12 | 2016-07-30T21:33:03.000Z | 2018-04-30T22:05:07.000Z | tests/custom_template_path_root/conf.py | TimKam/sphinx-pretty-searchresults | 65fc8133f0fab70627c665e1ccfc6a5d45d16fc3 | [
"MIT"
] | 20 | 2016-08-02T09:34:35.000Z | 2018-05-27T12:40:12.000Z | tests/custom_template_path_root/conf.py | TimKam/sphinx-pretty-searchresults | 65fc8133f0fab70627c665e1ccfc6a5d45d16fc3 | [
"MIT"
] | 3 | 2020-11-23T05:56:53.000Z | 2020-11-23T05:57:11.000Z | master_doc = 'index'
extensions = ['sphinxprettysearchresults']
templates_path = ['_templates'] | 31.666667 | 42 | 0.778947 | 8 | 95 | 8.875 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.084211 | 95 | 3 | 43 | 31.666667 | 0.816092 | 0 | 0 | 0 | 0 | 0 | 0.416667 | 0.260417 | 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 |
cf88808935b10cbd4d8294c1021bdfebd7c7988d | 3,500 | py | Python | test_autofit/tools/test_edenise/test_import.py | rhayes777/PyAutoF | 87f56419348833b285b00da1a524e329588e0b01 | [
"MIT"
] | 39 | 2019-01-24T10:45:23.000Z | 2022-03-18T09:37:59.000Z | test_autofit/tools/test_edenise/test_import.py | rhayes777/PyAutoF | 87f56419348833b285b00da1a524e329588e0b01 | [
"MIT"
] | 260 | 2018-11-27T12:56:33.000Z | 2022-03-31T16:08:59.000Z | test_autofit/tools/test_edenise/test_import.py | rhayes777/PyAutoF | 87f56419348833b285b00da1a524e329588e0b01 | [
"MIT"
] | 13 | 2018-11-30T16:49:05.000Z | 2022-01-21T17:39:29.000Z | import pytest
from autofit.tools.edenise import Package, Import, LineItem
@pytest.fixture(
name="import_"
)
def make_import(package):
return Import(
"from autofit.tools.edenise import Line",
parent=package
)
@pytest.fixture(
name="local_import"
)
def make_local_import(
package
):
return LineItem(
" from autofit.tools.edenise import Line",
parent=package
)
def test_local_import_type(
local_import
):
assert isinstance(
local_import,
Import
)
def test_local_import_target(
local_import
):
string = " from VIS_CTI_Autofit.VIS_CTI_Tools.VIS_CTI_Edenise import Line"
assert local_import.target_import_string == string
def test_project_import(import_, package):
import_.parent = package["tools"]["edenise"]["converter"]
assert "autofit/tools/edenise" in str(import_.path)
assert import_.is_in_project is True
def test_non_project_import(package):
import_ = Import(
"import os",
parent=package
)
import_.parent = package
assert import_.is_in_project is False
def test_target_import_string(import_):
string = "from VIS_CTI_Autofit.VIS_CTI_Tools.VIS_CTI_Edenise import Line"
assert import_.target_import_string == string
def test_multi_import(
package
):
import_ = Import(
"from autofit.tools.edenise import Package, File, Import",
parent=package
)
string = "from VIS_CTI_Autofit.VIS_CTI_Tools.VIS_CTI_Edenise import Package, File, Import"
assert import_.target_import_string == string
def test_import_as(
package
):
import_ = Import(
"from autofit.tools import edenise as e",
parent=package
)
string = "from VIS_CTI_Autofit.VIS_CTI_Tools import VIS_CTI_Edenise as e"
assert import_.target_import_string == string
def test_package_import(
package
):
import_ = Import(
"from autofit.tools import edenise",
parent=package["tools"]
)
assert isinstance(
package["tools"]["edenise"],
Package
)
assert import_.module_path == ["autofit", "tools"]
assert isinstance(
import_.module["edenise"],
Package
)
string = "from VIS_CTI_Autofit.VIS_CTI_Tools import VIS_CTI_Edenise"
assert import_.target_import_string == string
@pytest.mark.parametrize(
"string, result",
[
("from . import util", "from autofit.tools import util"),
("from .. import conf", "from autofit import conf"),
("from ..tools import util", "from autofit.tools import util")
]
)
def test_relative_import(
package,
string,
result
):
import_ = Import(
string,
parent=package["tools"]["namer"]
)
assert import_.string == result
def test_module_import_name(
package
):
conf = package["conf"]
assert conf.target_import_string == "VIS_CTI_Conf as conf"
assert conf.target_file_name == "VIS_CTI_Conf.py"
package._should_rename_modules = False
assert conf.target_import_string == "conf"
assert conf.target_file_name == "conf.py"
def test_module_path_import_name(
package
):
package._should_rename_modules = False
import_ = Import(
"from autofit.non_linear.samples import NestSamples, Sample",
parent=package
)
assert import_.target_string == "from VIS_CTI_Autofit.VIS_CTI_NonLinear.VIS_CTI_Samples import NestSamples, Sample"
| 23.489933 | 119 | 0.673429 | 420 | 3,500 | 5.302381 | 0.130952 | 0.053884 | 0.057476 | 0.043107 | 0.527616 | 0.462506 | 0.370903 | 0.287831 | 0.148181 | 0.148181 | 0 | 0 | 0.236 | 3,500 | 148 | 120 | 23.648649 | 0.832835 | 0 | 0 | 0.40678 | 0 | 0 | 0.284571 | 0.100571 | 0 | 0 | 0 | 0 | 0.152542 | 1 | 0.110169 | false | 0 | 0.5 | 0.016949 | 0.627119 | 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 |
d84175e37630d255baf90653a9fe79cb0117e569 | 644 | py | Python | corere/main/migrations/0012_auto_20210730_1522.py | Xarthisius/dataverse-corere | 016b80445c7b226ae7fb44d34daa84399b9acab6 | [
"MIT"
] | 9 | 2019-06-18T20:11:27.000Z | 2021-02-10T19:20:08.000Z | corere/main/migrations/0012_auto_20210730_1522.py | Xarthisius/dataverse-corere | 016b80445c7b226ae7fb44d34daa84399b9acab6 | [
"MIT"
] | 9 | 2020-01-10T22:11:56.000Z | 2021-07-28T18:19:53.000Z | corere/main/migrations/0012_auto_20210730_1522.py | Xarthisius/dataverse-corere | 016b80445c7b226ae7fb44d34daa84399b9acab6 | [
"MIT"
] | 2 | 2021-09-17T15:48:28.000Z | 2021-10-07T13:32:38.000Z | # Generated by Django 3.2.5 on 2021-07-30 15:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0011_auto_20210729_2147'),
]
operations = [
migrations.AddField(
model_name='curation',
name='needs_verification',
field=models.BooleanField(default=True, verbose_name='Needs Verification'),
),
migrations.AddField(
model_name='historicalcuration',
name='needs_verification',
field=models.BooleanField(default=True, verbose_name='Needs Verification'),
),
]
| 26.833333 | 87 | 0.624224 | 63 | 644 | 6.238095 | 0.603175 | 0.091603 | 0.21374 | 0.137405 | 0.422392 | 0.422392 | 0.422392 | 0.422392 | 0.422392 | 0.422392 | 0 | 0.065678 | 0.267081 | 644 | 23 | 88 | 28 | 0.766949 | 0.069876 | 0 | 0.470588 | 1 | 0 | 0.20938 | 0.038526 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.058824 | 0 | 0.235294 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
d84fb543ffa833bbe5448f17c96e8318c6bb4f0d | 1,234 | py | Python | bin/MLEout2tab_NA.py | gaofeng21cn/IDP-fusion | 052ac4f868fd416e10165ef4891804d25edc8862 | [
"Apache-2.0"
] | 5 | 2017-09-18T18:21:26.000Z | 2020-05-01T23:29:26.000Z | bin/MLEout2tab_NA.py | gaofeng21cn/IDP-fusion | 052ac4f868fd416e10165ef4891804d25edc8862 | [
"Apache-2.0"
] | 3 | 2018-11-26T16:35:12.000Z | 2021-11-22T07:16:51.000Z | bin/MLEout2tab_NA.py | gaofeng21cn/IDP-fusion | 052ac4f868fd416e10165ef4891804d25edc8862 | [
"Apache-2.0"
] | 4 | 2018-01-02T13:06:39.000Z | 2020-04-14T13:20:52.000Z | #!/usr/bin/python
import sys
import os
if len(sys.argv) >= 2 :
exp_filename = sys.argv[1]
else:
print("usage: ")
print("or ")
sys.exit(1)
################################################################################
exp_dt = {}
exp_file = open(exp_filename,'r')
i=0
for line in exp_file:
ls = line.strip().split('\t')
if 1:
if i%3 == 0:
ls = line.strip().split('\t')
gene_name = ls[0]
elif i%3 == 1:
ID_ls = line.strip().split('\t')
elif i%3 == 2:
exp_str_ls = line.strip().split('\t')
j = 0
for ID in ID_ls:
if not exp_dt.has_key(gene_name):
exp_dt[gene_name] = {}
if not exp_str_ls[j] == "NA":
exp_dt[gene_name][ID]= float(exp_str_ls[j])
else:
exp_dt[gene_name][ID]= "NA"
j += 1
i+=1
exp_file.close()
#print exp_dt
################################################################################
for gene_name in exp_dt:
for ID in exp_dt[gene_name]:
if ID!="Total":
print '\t'.join([ID, str(exp_dt[gene_name][ID]), str(exp_dt[gene_name]["Total"])] )
| 28.697674 | 95 | 0.419773 | 166 | 1,234 | 2.921687 | 0.277108 | 0.103093 | 0.11134 | 0.160825 | 0.338144 | 0.074227 | 0 | 0 | 0 | 0 | 0 | 0.017668 | 0.311994 | 1,234 | 42 | 96 | 29.380952 | 0.553592 | 0.02269 | 0 | 0.111111 | 0 | 0 | 0.033525 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.055556 | null | null | 0.083333 | 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 |
d853bf37352fcda986f521a35690300e37f1e3db | 145 | py | Python | ABC066/ABC066a.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC066/ABC066a.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC066/ABC066a.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | # ABC066a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
bell = tuple(map(int, input().split()))
print(sum(bell)-max(bell))
| 18.125 | 39 | 0.717241 | 22 | 145 | 4.727273 | 0.772727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.045802 | 0.096552 | 145 | 7 | 40 | 20.714286 | 0.748092 | 0.048276 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 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 |
d8555ee45594776fd2dc1479324c7089491c7c52 | 694 | py | Python | src/plottoolbox/skill_metrics/pc_bias.py | timcera/plottoolbox | b5f4b634d366eb5ba244e2f1fd33a7ef0eba7298 | [
"BSD-3-Clause"
] | 5 | 2016-10-13T18:06:41.000Z | 2021-06-29T19:47:36.000Z | src/tstoolbox/skill_metrics/pc_bias.py | timcera/tstoolbox | a32fa399d96082f01b7eedfd6c8893bdb881845c | [
"BSD-3-Clause"
] | 21 | 2016-04-28T16:48:03.000Z | 2021-12-16T18:07:07.000Z | src/plottoolbox/skill_metrics/pc_bias.py | timcera/plottoolbox | b5f4b634d366eb5ba244e2f1fd33a7ef0eba7298 | [
"BSD-3-Clause"
] | 3 | 2018-03-21T21:07:52.000Z | 2021-01-22T20:07:49.000Z | # -*- coding: utf-8 -*-
import numpy as np
from . import utils
def pc_bias(simulated, observed):
"""
Calculate the percent bias between simulated and observed.
B = 100.0*sum(s-o)/sum(o)
where s is the simulated values, and o is the observed values.
Note that s & o must have the same number of values.
Input:
simulated : simulated field
observed : observed field
Output:
B : percent bias between simulated and observed
"""
# Check that dimensions of simulated and observed fields match
utils.check_arrays(simulated, observed)
# Calculate bias in means
b = 100.0 * np.sum(simulated - observed) / np.sum(observed)
return b
| 23.133333 | 66 | 0.67147 | 99 | 694 | 4.686869 | 0.464646 | 0.109914 | 0.12931 | 0.116379 | 0.163793 | 0.163793 | 0 | 0 | 0 | 0 | 0 | 0.017241 | 0.247839 | 694 | 29 | 67 | 23.931034 | 0.871648 | 0.618156 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | 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 |
d860768aa401303e4e43e3b81af80668a675fe4e | 400 | py | Python | apps/setup.py | nlantoing/Astrarium | f1899caed01b8946e0e024bca559f5aaafdd69ea | [
"MIT"
] | null | null | null | apps/setup.py | nlantoing/Astrarium | f1899caed01b8946e0e024bca559f5aaafdd69ea | [
"MIT"
] | null | null | null | apps/setup.py | nlantoing/Astrarium | f1899caed01b8946e0e024bca559f5aaafdd69ea | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='Astrarium',
version='0.0.1',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=[
'Flask',
'SQLAlchemy',
'flask_sqlalchemy',
'flask_migrate',
'flask_script',
'flask_cors',
'pytest',
'coverage',
'pykep'
],
)
| 19.047619 | 43 | 0.5625 | 38 | 400 | 5.657895 | 0.736842 | 0.111628 | 0.186047 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01087 | 0.31 | 400 | 20 | 44 | 20 | 0.768116 | 0 | 0 | 0 | 0 | 0 | 0.2475 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.052632 | 0 | 0.052632 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.