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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
365493226ef8ff623b67882ccdb1d5957462cc3b | 80 | py | Python | releases/_version.py | Nicusor97/releases | 97a763e41bbe7374106a1c648b89346a0d935429 | [
"BSD-2-Clause"
] | null | null | null | releases/_version.py | Nicusor97/releases | 97a763e41bbe7374106a1c648b89346a0d935429 | [
"BSD-2-Clause"
] | null | null | null | releases/_version.py | Nicusor97/releases | 97a763e41bbe7374106a1c648b89346a0d935429 | [
"BSD-2-Clause"
] | null | null | null | __version_info__ = (1, 6, 1)
__version__ = '.'.join(map(str, __version_info__))
| 26.666667 | 50 | 0.7 | 11 | 80 | 3.818182 | 0.636364 | 0.52381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042254 | 0.1125 | 80 | 2 | 51 | 40 | 0.549296 | 0 | 0 | 0 | 0 | 0 | 0.0125 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 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 | 3 |
365f7a0a4d0f8739674bb26bb9651db410c27bb4 | 410 | py | Python | compiler/dna/components/DNASuitEdge.py | AnonymousDeveloper65535/libpandadna | 3110a8d576d22093e4c735081c5f639d28397a17 | [
"BSD-3-Clause"
] | 36 | 2015-01-29T19:43:45.000Z | 2022-01-19T11:49:28.000Z | compiler/dna/components/DNASuitEdge.py | AnonymousDeveloper65535/libpandadna | 3110a8d576d22093e4c735081c5f639d28397a17 | [
"BSD-3-Clause"
] | 44 | 2015-01-16T16:09:30.000Z | 2022-01-25T02:29:15.000Z | compiler/dna/components/DNASuitEdge.py | AnonymousDeveloper65535/libpandadna | 3110a8d576d22093e4c735081c5f639d28397a17 | [
"BSD-3-Clause"
] | 42 | 2015-01-03T08:43:21.000Z | 2022-01-11T04:29:11.000Z | class DNASuitEdge:
COMPONENT_CODE = 22
def __init__(self, startPoint, endPoint, zoneId):
self.startPoint = startPoint
self.endPoint = endPoint
self.zoneId = zoneId
def setStartPoint(self, startPoint):
self.startPoint = startPoint
def setEndPoint(self, endPoint):
self.endPoint = endPoint
def setZoneId(self, zoneId):
self.zoneId = zoneId
| 24.117647 | 53 | 0.656098 | 41 | 410 | 6.439024 | 0.341463 | 0.212121 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006645 | 0.265854 | 410 | 16 | 54 | 25.625 | 0.870432 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3661e55cade9d0047ddb0c329454134c08c3a612 | 4,277 | py | Python | test/test_px_proxy.py | wizzard/perimeterx-python-3-wsgi | 03aded2c868dda3ad198c1f3ee944c775557d818 | [
"MIT"
] | 1 | 2021-11-06T16:47:51.000Z | 2021-11-06T16:47:51.000Z | test/test_px_proxy.py | wizzard/perimeterx-python-3-wsgi | 03aded2c868dda3ad198c1f3ee944c775557d818 | [
"MIT"
] | 1 | 2020-08-31T10:50:25.000Z | 2020-08-31T10:50:25.000Z | test/test_px_proxy.py | wizzard/perimeterx-python-3-wsgi | 03aded2c868dda3ad198c1f3ee944c775557d818 | [
"MIT"
] | 4 | 2020-04-01T10:37:09.000Z | 2020-12-03T12:34:13.000Z | import unittest
import requests_mock
from werkzeug.test import EnvironBuilder
from werkzeug.wrappers import Request
from perimeterx import px_constants
from perimeterx.px_config import PxConfig
from perimeterx.px_context import PxContext
from perimeterx.px_proxy import PxProxy
class Test_PXProxy(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.config = PxConfig({'app_id': 'PXfake_app_id'})
cls.headers = {'X-FORWARDED-FOR': '127.0.0.1',
'remote-addr': '127.0.0.1',
'content_length': '100'}
def test_should_reverse_request(self):
builder = EnvironBuilder(headers=self.headers, path='/fake_app_id/init.js')
env = builder.get_environ()
request = Request(env)
context = PxContext(request, self.config)
px_proxy = PxProxy(self.config)
should_reverse = px_proxy.should_reverse_request(context.uri)
self.assertTrue(should_reverse)
should_reverse = px_proxy.should_reverse_request(context.uri)
self.assertTrue(should_reverse)
should_reverse = px_proxy.should_reverse_request(context.uri)
self.assertTrue(should_reverse)
@requests_mock.mock()
def test_send_reverse_client_request(self, mock):
content = 'client js content'
builder = EnvironBuilder(headers=self.headers, path='/fake_app_id/init.js')
env = builder.get_environ()
request = Request(env)
context = PxContext(request, self.config)
headers = {'host': px_constants.CLIENT_HOST,
px_constants.FIRST_PARTY_HEADER: '1',
px_constants.ENFORCER_TRUE_IP_HEADER: context.ip,
px_constants.FIRST_PARTY_FORWARDED_FOR: '127.0.0.1'}
mock.get(url='https://client.perimeterx.net/PXfake_app_id/main.min.js', text=content, request_headers=headers,
status_code=200, reason='OK')
px_proxy = PxProxy(self.config)
status, headers, body = px_proxy.send_reverse_client_request(config=self.config, ctx=context)
self.assertEqual(content, body.decode("utf-8"))
@requests_mock.mock()
def test_send_reverse_captcha_request(self, mock):
content = 'captcha js content'
builder = EnvironBuilder(headers=self.headers, path='/fake_app_id/captcha/captcha.js', query_string='a=c&u=cfe74220-f484-11e8-9b14-d7280325a290&v=0701bb80-f482-11e8-8a31-a37cf9620569&m=0')
env = builder.get_environ()
request = Request(env)
context = PxContext(request, self.config)
headers = {'host': px_constants.CAPTCHA_HOST,
px_constants.FIRST_PARTY_HEADER: '1',
px_constants.ENFORCER_TRUE_IP_HEADER: context.ip,
px_constants.FIRST_PARTY_FORWARDED_FOR: '127.0.0.1'}
mock.get(
url='https://captcha.px-cdn.net/PXfake_app_id/captcha.js?a=c&u=cfe74220-f484-11e8-9b14-d7280325a290&v=0701bb80-f482-11e8-8a31-a37cf9620569&m=0',
text=content, request_headers=headers, status_code=200, reason='OK')
px_proxy = PxProxy(self.config)
status, headers, body = px_proxy.send_reverse_captcha_request(config=self.config, ctx=context)
self.assertEqual(content, body.decode("utf-8"))
@requests_mock.mock()
def test_send_reverse_xhr_request(self, mock):
content = 'xhr content'
builder = EnvironBuilder(headers=self.headers, path='/fake_app_id/xhr/api/v1/collector', method='POST')
env = builder.get_environ()
request = Request(env)
context = PxContext(request, self.config)
headers = {'host': self.config.collector_host,
px_constants.FIRST_PARTY_HEADER: '1',
px_constants.ENFORCER_TRUE_IP_HEADER: context.ip,
px_constants.FIRST_PARTY_FORWARDED_FOR: '127.0.0.1'}
mock.post(url='https://collector-pxfake_app_id.perimeterx.net/api/v1/collector', text=content,
request_headers=headers, status_code=200, reason='OK')
px_proxy = PxProxy(self.config)
status, headers, body = px_proxy.send_reverse_xhr_request(config=self.config, ctx=context, body=content)
self.assertEqual(content, body.decode("utf-8"))
| 45.989247 | 208 | 0.676876 | 543 | 4,277 | 5.106814 | 0.191529 | 0.047602 | 0.03462 | 0.045438 | 0.729535 | 0.72088 | 0.702488 | 0.677245 | 0.677245 | 0.677245 | 0 | 0.0438 | 0.20996 | 4,277 | 92 | 209 | 46.48913 | 0.776857 | 0 | 0 | 0.513158 | 0 | 0.026316 | 0.154548 | 0.037643 | 0 | 0 | 0 | 0 | 0.078947 | 1 | 0.065789 | false | 0 | 0.105263 | 0 | 0.184211 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
36625b8ef7dfda999b8814af3148b3e2460eb4ae | 1,683 | py | Python | PI/Events/Event.py | HotShot0901/PI | 7e6fd0f68b4222e09ea825f27709ec5b1e51e928 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"bzip2-1.0.6",
"BSD-3-Clause"
] | null | null | null | PI/Events/Event.py | HotShot0901/PI | 7e6fd0f68b4222e09ea825f27709ec5b1e51e928 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"bzip2-1.0.6",
"BSD-3-Clause"
] | null | null | null | PI/Events/Event.py | HotShot0901/PI | 7e6fd0f68b4222e09ea825f27709ec5b1e51e928 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"bzip2-1.0.6",
"BSD-3-Clause"
] | null | null | null | # This just shifts 1 to i th BIT
def BIT(i: int) -> int:
return int(1 << i)
# This class is equvalent to a C++ enum
class EventType:
Null, \
WindowClose, WindowResize, WindowFocus, WindowMoved, \
AppTick, AppUpdate, AppRender, \
KeyPressed, KeyReleased, CharInput, \
MouseButtonPressed, MouseButtonReleased, MouseMoved, MouseScrolled \
= range(0, 15)
# This class is equvalent to a C++ enum
# It uses bitstream to represent flags, so
# a single Event can have multiple flags
class EventCategory:
Null = 0
Application = BIT(0)
Input = BIT(1)
Keyboard = BIT(2)
Mouse = BIT(3)
MouseButton = BIT(4)
class Event:
Handled = False
@property
def EventType(self) -> int:
pass
@property
def Name(self) -> str:
return type(self)
@property
def CategoryFlags(self) -> int:
pass
def ToString(self) -> str:
return self.GetName()
def IsInCategory(self, category: int) -> bool:
return bool(self.CategoryFlags & category)
def __repr__(self) -> str:
return self.ToString()
class EventDispatcher:
__slots__ = ("_Event",)
def __init__(self, event: Event) -> None:
self._Event = event
def Dispach(self, func, eventType: int) -> bool:
if (self._Event.EventType == eventType):
handeled = func(self._Event)
self._Event.Handled = handeled
return True
return False
| 26.714286 | 87 | 0.541889 | 172 | 1,683 | 5.203488 | 0.465116 | 0.050279 | 0.043575 | 0.044693 | 0.06257 | 0.06257 | 0.06257 | 0.06257 | 0 | 0 | 0 | 0.010377 | 0.370172 | 1,683 | 62 | 88 | 27.145161 | 0.833962 | 0.110517 | 0 | 0.116279 | 0 | 0 | 0.004024 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.209302 | false | 0.046512 | 0 | 0.116279 | 0.651163 | 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 | 1 | 0 | 0 | 3 |
367177f87916e9f31a627747b9f2f2e7f5f23e29 | 1,771 | py | Python | NLP-Model/GraphGenerator.py | AdityaPrasadMishra/NLP--Project-Group-16 | fb62cc6a1db4a494058171f11c14a2be3933a9a1 | [
"MIT"
] | null | null | null | NLP-Model/GraphGenerator.py | AdityaPrasadMishra/NLP--Project-Group-16 | fb62cc6a1db4a494058171f11c14a2be3933a9a1 | [
"MIT"
] | null | null | null | NLP-Model/GraphGenerator.py | AdityaPrasadMishra/NLP--Project-Group-16 | fb62cc6a1db4a494058171f11c14a2be3933a9a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 24 22:03:42 2018
@author: aditya
"""
import codecs
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import re
import time
import random
training_errors= [2.880890389084816, 2.589109110832214, 2.529299919307232, 2.4656221523880957, 2.403166337311268, 2.4464233142137526, 2.375447287261486, 2.3676583436131478, 2.3073809832334518, 2.359292232692242, 2.3350265485048296, 2.2823567962646485, 2.2687944075465203, 2.2951272314786912, 2.282493242323399, 2.2626508274674415, 2.258985004425049, 2.2431524062156676, 2.226141297519207, 2.2092211750149726, 2.215476005077362, 2.209359174370766, 2.1948138630390166, 2.193422330915928, 2.1807888588309288]
validation_errors=[2.435073028564453, 2.3433548278808596, 2.315739807128906, 2.2985709838867185, 2.2562687683105467, 2.2732557678222656, 2.2361006469726563, 2.222836364746094, 2.2145645141601564, 2.2109912719726563, 2.20832763671875, 2.1882525634765626, 2.1855752868652343, 2.183926452636719, 2.180730743408203, 2.1761441955566405, 2.1777948303222656, 2.1717729797363283, 2.1632617797851563, 2.161899658203125, 2.16302978515625, 2.155210754394531, 2.147050506591797, 2.1581705627441408, 2.1517400207519533]
epochnum=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
fig1 = plt.figure()
axes1 = fig1.add_axes([0.1,0.1,0.8,0.8])
axes1.plot(epochnum,training_errors,'r')
axes1.set_xlabel('Train Epochs')
axes1.set_ylabel('Training Error')
fig1.savefig('trainAccuracy.png')
fig2 = plt.figure()
axes2 = fig2.add_axes([0.1,0.1,0.8,0.8])
axes2.plot(epochnum,validation_errors,'b')
axes2.set_xlabel('Train Epochs')
axes2.set_ylabel('Validation Error')
fig2.savefig('valAccuracy.png')
plt.plot()
| 52.088235 | 506 | 0.784303 | 241 | 1,771 | 5.721992 | 0.53112 | 0.005801 | 0.008702 | 0.013053 | 0.021755 | 0.021755 | 0.021755 | 0.021755 | 0.021755 | 0.021755 | 0 | 0.559582 | 0.080745 | 1,771 | 33 | 507 | 53.666667 | 0.287469 | 0.054207 | 0 | 0 | 0 | 0 | 0.052821 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.304348 | 0 | 0.304348 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
36794b18530c7dfbe909565c90c9010f724df448 | 150 | py | Python | scripts.py | intendednull/lcu_connectorpy | deb1050fe3a3fdc513d63d2ab08ab92bc86ac2f9 | [
"MIT"
] | null | null | null | scripts.py | intendednull/lcu_connectorpy | deb1050fe3a3fdc513d63d2ab08ab92bc86ac2f9 | [
"MIT"
] | 1 | 2020-03-05T18:54:17.000Z | 2020-03-05T18:54:17.000Z | scripts.py | Zer0897/lcu_connectorpy | deb1050fe3a3fdc513d63d2ab08ab92bc86ac2f9 | [
"MIT"
] | 1 | 2020-10-06T01:10:13.000Z | 2020-10-06T01:10:13.000Z | import subprocess as subp
def doc():
subp.run([
'pdoc', '--html', '--overwrite',
'--html-dir', 'docs', 'lcu_connectorpy'
])
| 16.666667 | 47 | 0.52 | 16 | 150 | 4.8125 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.266667 | 150 | 8 | 48 | 18.75 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | true | 0 | 0.166667 | 0 | 0.333333 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
367a9bce756118fb872d4491d7235406c6ce91d1 | 95 | py | Python | Right_Angle/trans.py | kameranis/IEEExtreme-8.0 | 8ba80224b5218eb759ca91508b4f169788ff5571 | [
"MIT"
] | null | null | null | Right_Angle/trans.py | kameranis/IEEExtreme-8.0 | 8ba80224b5218eb759ca91508b4f169788ff5571 | [
"MIT"
] | null | null | null | Right_Angle/trans.py | kameranis/IEEExtreme-8.0 | 8ba80224b5218eb759ca91508b4f169788ff5571 | [
"MIT"
] | null | null | null | N=input()
num = [int(raw_input().split()[2]) for i in range(N)]
num = list(set(num))
print num
| 19 | 53 | 0.631579 | 19 | 95 | 3.105263 | 0.736842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012195 | 0.136842 | 95 | 4 | 54 | 23.75 | 0.707317 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
367c714d55fb20ba8891983bb594b981f3b9fa1a | 470 | py | Python | backend/client/admin.py | katserafine/GenieHub | b7542b5b2a5dfc137b763a08b64d43e1dbe53af7 | [
"MIT"
] | 1 | 2020-06-24T04:44:33.000Z | 2020-06-24T04:44:33.000Z | backend/client/admin.py | katserafine/GenieHub | b7542b5b2a5dfc137b763a08b64d43e1dbe53af7 | [
"MIT"
] | null | null | null | backend/client/admin.py | katserafine/GenieHub | b7542b5b2a5dfc137b763a08b64d43e1dbe53af7 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.utils.html import format_html
from django.contrib.auth.models import Permission
from .models import *
# Register your models here.
admin.site.register(projectWorker)
admin.site.register(project)
admin.site.register(leadContact)
class ClientAdmin(admin.ModelAdmin):
list_display = ('name', 'inactive')
list_display_links = list_display
list_filter = ('name', 'inactive')
admin.site.register(Client, ClientAdmin) | 29.375 | 49 | 0.785106 | 60 | 470 | 6.05 | 0.466667 | 0.099174 | 0.187328 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.112766 | 470 | 16 | 50 | 29.375 | 0.870504 | 0.055319 | 0 | 0 | 0 | 0 | 0.054176 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
369d292bf15ec11e1c3a4ad6d68821a207a8fc33 | 1,124 | py | Python | vectors/vectormath.py | sbanwart/data-science | 07f568e5f55a43339a9dca3ba3a13b263f54a37c | [
"MIT"
] | null | null | null | vectors/vectormath.py | sbanwart/data-science | 07f568e5f55a43339a9dca3ba3a13b263f54a37c | [
"MIT"
] | null | null | null | vectors/vectormath.py | sbanwart/data-science | 07f568e5f55a43339a9dca3ba3a13b263f54a37c | [
"MIT"
] | null | null | null | import math
def vector_add(v, w):
"""adds corresponding elements"""
return [v_i + w_i
for v_i, w_i in zip(v, w)]
def vector_subtract(v, w):
"""subtracts corresponding elements"""
return [v_i - w_i
for v_i, w_i in zip(v, w)]
def vector_sum(vectors):
return reduce(vector_add, vectors)
def scalar_multiply(c, v):
"""c is a number, v is a vector"""
return [c * v_i for v_i in v]
def vector_means(vectors):
"""compute the vector whose ith element is the mean of the
ith elements of the input vectors"""
n = len(vectors)
return scalar_multiply(1 / n, vector_sum(vectors))
def dot(v, w):
"""v_1 * w_1 + ... + v_n * w_n"""
return sum(v_i * w_i
for v_i, w_i in zip(v, w))
def sum_of_squares(v):
"""v_1 * v_1 + ... + v_n * v_n"""
return dot(v, v)
def magnitude(v):
return math.sqrt(sum_of_squares(v)) # math.sqrt is the square root function
def squared_distance(v, w):
"""(v_1 - w_1) ** 2 + ... + (v_n - w_n) ** 2"""
return sum_of_squares(vector_subtract(v, w))
def distance(v, w):
return magnitude(vector_subtract(v, w))
| 25.545455 | 79 | 0.615658 | 203 | 1,124 | 3.197044 | 0.236453 | 0.030817 | 0.027735 | 0.03698 | 0.217257 | 0.217257 | 0.198767 | 0.198767 | 0.198767 | 0.198767 | 0 | 0.010514 | 0.238434 | 1,124 | 43 | 80 | 26.139535 | 0.747664 | 0.282028 | 0 | 0.08 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.04 | 0.12 | 0.84 | 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 | 1 | 0 | 0 | 3 |
36a07f1b483e17aa9a2719b08beb5635ce843a05 | 1,106 | py | Python | cpgames/modules/core/__init__.py | Wasabii88/Games | 33262ca1958207a24e57e3532feded7e275b1dd1 | [
"MIT"
] | 1 | 2022-03-07T11:13:08.000Z | 2022-03-07T11:13:08.000Z | cpgames/modules/core/__init__.py | Wasabii88/Games | 33262ca1958207a24e57e3532feded7e275b1dd1 | [
"MIT"
] | null | null | null | cpgames/modules/core/__init__.py | Wasabii88/Games | 33262ca1958207a24e57e3532feded7e275b1dd1 | [
"MIT"
] | null | null | null | '''initialize'''
from .ski import SkiGame
from .maze import MazeGame
from .gobang import GobangGame
from .tetris import TetrisGame
from .pacman import PacmanGame
from .gemgem import GemGemGame
from .tankwar import TankWarGame
from .sokoban import SokobanGame
from .pingpong import PingpongGame
from .trexrush import TRexRushGame
from .bomberman import BomberManGame
from .whacamole import WhacAMoleGame
from .catchcoins import CatchCoinsGame
from .flappybird import FlappyBirdGame
from .angrybirds import AngryBirdsGame
from .magictower import MagicTowerGame
from .aircraftwar import AircraftWarGame
from .bunnybadger import BunnyBadgerGame
from .minesweeper import MineSweeperGame
from .greedysnake import GreedySnakeGame
from .puzzlepieces import PuzzlePiecesGame
from .towerdefense import TowerDefenseGame
from .alieninvasion import AlienInvasionGame
from .breakoutclone import BreakoutcloneGame
from .twentyfourpoint import TwentyfourPointGame
from .flipcardbymemory import FlipCardByMemoryGame
from .twozerofoureight import TwoZeroFourEightGame
from .voicecontrolpikachu import VoiceControlPikachuGame | 38.137931 | 56 | 0.867993 | 113 | 1,106 | 8.495575 | 0.522124 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.101266 | 1,106 | 29 | 56 | 38.137931 | 0.965795 | 0.009042 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
36a5039b731ed609ed21354c488bea0e48e4d31a | 502 | py | Python | lambda_handlers/errors.py | renovate-tests/lambda-handlers | 0b14013f19b597524a8d50f7ea8813ee726c584c | [
"Apache-2.0"
] | null | null | null | lambda_handlers/errors.py | renovate-tests/lambda-handlers | 0b14013f19b597524a8d50f7ea8813ee726c584c | [
"Apache-2.0"
] | null | null | null | lambda_handlers/errors.py | renovate-tests/lambda-handlers | 0b14013f19b597524a8d50f7ea8813ee726c584c | [
"Apache-2.0"
] | null | null | null | class LambdaError(Exception):
def __init__(self, description):
self.description = description
class BadRequestError(LambdaError):
pass
class ForbiddenError(LambdaError):
pass
class InternalServerError(LambdaError):
pass
class NotFoundError(LambdaError):
pass
class ValidationError(LambdaError):
pass
class FormattingError(LambdaError):
pass
class EventValidationError(ValidationError):
pass
class ResultValidationError(ValidationError):
pass
| 13.944444 | 45 | 0.750996 | 42 | 502 | 8.880952 | 0.380952 | 0.168901 | 0.321716 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183267 | 502 | 35 | 46 | 14.342857 | 0.909756 | 0 | 0 | 0.421053 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.052632 | false | 0.421053 | 0 | 0 | 0.526316 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
36b29aea512c076457ac717e34101b418e8451d8 | 1,838 | py | Python | acvrct.py | lyzcoote/VRChat-Py-Launcher | 307fc26d2a464ba97e93293f757e7fdaa29098de | [
"MIT"
] | null | null | null | acvrct.py | lyzcoote/VRChat-Py-Launcher | 307fc26d2a464ba97e93293f757e7fdaa29098de | [
"MIT"
] | null | null | null | acvrct.py | lyzcoote/VRChat-Py-Launcher | 307fc26d2a464ba97e93293f757e7fdaa29098de | [
"MIT"
] | null | null | null | ################################################################################
# #
# Modules #
# #
################################################################################
import otherUtils as otherUtils
import sys
import os
################################################################################
# #
# Functions #
# #
################################################################################
def override_where():
""" overrides certifi.core.where to return actual location of cacert.pem"""
return os.path.abspath("cacert.pem")
if hasattr(sys, "frozen"):
import certifi.core
os.environ["REQUESTS_CA_BUNDLE"] = override_where()
certifi.core.where = override_where
import requests.utils
import requests.adapters
requests.utils.DEFAULT_CA_BUNDLE_PATH = override_where()
requests.adapters.DEFAULT_CA_BUNDLE_PATH = override_where()
################################################################################
# #
# Main App #
# #
################################################################################
if __name__ == "__main__":
sys.tracebacklimit = 0
otherUtils.launcherMenu()
| 40.844444 | 80 | 0.259521 | 81 | 1,838 | 5.62963 | 0.469136 | 0.142544 | 0.070175 | 0.083333 | 0.140351 | 0.140351 | 0 | 0 | 0 | 0 | 0 | 0.000967 | 0.437432 | 1,838 | 44 | 81 | 41.772727 | 0.440039 | 0.357998 | 0 | 0 | 0 | 0 | 0.075134 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.0625 | true | 0 | 0.375 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
36c93b1ef9b9eeb9b865aada75df7cf42d64021f | 29,950 | py | Python | Colab/vision_transformer_dogs_and_cats_python_generator.py | Thanusan19/Vision_Transformer | 80179d57e617ef6cd9599de93c7c7633f891f9a9 | [
"Apache-2.0"
] | 1 | 2021-07-02T13:55:11.000Z | 2021-07-02T13:55:11.000Z | Colab/vision_transformer_dogs_and_cats_python_generator.py | Thanusan19/Vision_Transformer | 80179d57e617ef6cd9599de93c7c7633f891f9a9 | [
"Apache-2.0"
] | null | null | null | Colab/vision_transformer_dogs_and_cats_python_generator.py | Thanusan19/Vision_Transformer | 80179d57e617ef6cd9599de93c7c7633f891f9a9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Vision Transformer Dogs and Cats Python Generator
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/12u7r2OMkt_rFmOQq2g5FtX7Z0EbyPYFN
See code at https://github.com/google-research/vision_transformer/
See paper at https://arxiv.org/abs/2010.11929
This Colab allows you to run the [JAX](https://jax.readthedocs.org) implementation of the Vision Transformer.
## 1) Using generator
### 1.1) Download the dataset and unpack it on the colab machine
"""
!pwd
!mkdir dataset
!ls
!wget -c "https://download.microsoft.com/download/3/E/1/3E1C3F21-ECDB-4869-8368-6DEBA77B919F/kagglecatsanddogs_3367a.zip" -P dataset/
!ls dataset/
# Quiet and overwrite, will create folder and unpack in CatsAndDogs
!unzip -qo dataset/kagglecatsanddogs_3367a.zip -d dataset/CatsAndDogs
# Print the number of cats and dogs images in the set
!ls -l dataset/CatsAndDogs/PetImages/Cat/*.jpg | wc -l
!ls -l dataset/CatsAndDogs/PetImages/Dog/*.jpg | wc -l
# Sanity check for later
!ls dataset/CatsAndDogs/PetImages/Cat/*.jpg | sed -E 's#.*/##' | sort > /tmp/Cats.txt
!ls dataset/CatsAndDogs/PetImages/Dog/*.jpg | sed -E 's#.*/##' | sort > /tmp/Dogs.txt
!diff /tmp/Cats.txt /tmp/Dogs.txt
"""### 1.2) Find the corrupted files
#### Find the corrupted files
"""
# Will be quiet, except for errors
# see [https://peteris.rocks/blog/quiet-and-unattended-installation-with-apt-get/]
!apt-get install imagemagick -qq > /dev/null
# Examples that are corrupted : Cat/1418.jpg, Cat/4293.jpg, Cat/666.jpg
# Can take a bit of time to check all 25000 images
!mogrify -set comment 'Image rewritten with ImageMagick' dataset/CatsAndDogs/PetImages/*/*.jpg |& tee dataset/CatsAndDogs/mogrify_output
#!cat dataset/CatsAndDogs/mogrify_output
"""#### Fix some problems with a certain picture in Cats (handmade)"""
# Sanity check for later
!ls dataset/CatsAndDogs/PetImages/Cat/*.jpg | sed -E 's#.*/##' | sort > /tmp/Cats.txt
!ls dataset/CatsAndDogs/PetImages/Dog/*.jpg | sed -E 's#.*/##' | sort > /tmp/Dogs.txt
!diff /tmp/Cats.txt /tmp/Dogs.txt
# Cat 10404 has three versions...
from google.colab import files
import time
files.view('dataset/CatsAndDogs/PetImages/Cat/10404-0.jpg')
time.sleep(0.5)
files.view('dataset/CatsAndDogs/PetImages/Cat/10404-1.jpg')
time.sleep(0.5)
files.view('dataset/CatsAndDogs/PetImages/Cat/10404-2.jpg')
!rm dataset/CatsAndDogs/PetImages/Cat/10404-1.jpg dataset/CatsAndDogs/PetImages/Cat/10404-2.jpg
!mv dataset/CatsAndDogs/PetImages/Cat/10404-0.jpg dataset/CatsAndDogs/PetImages/Cat/10404.jpg
# Sanity check for later
!ls dataset/CatsAndDogs/PetImages/Cat/*.jpg | sed -E 's#.*/##' | sort > /tmp/Cats.txt
!ls dataset/CatsAndDogs/PetImages/Dog/*.jpg | sed -E 's#.*/##' | sort > /tmp/Dogs.txt
!diff /tmp/Cats.txt /tmp/Dogs.txt
"""### 1.3) Create the exclusion and description files
#### Functions to create the exclusion list and the global description
"""
from pathlib import Path
import re
import time
def checkExistanceAndEmptiness(output_file_path:str, doOverwrite:bool):
okayToOverwrite = True
output_path = Path(output_file_path)
if output_path.exists():
print('File exists')
if output_path.stat().st_size != 0:
print('File is not empty')
if not doOverwrite:
okayToOverwrite = False
print('not over-writing')
else:
mode = 'w+'
print('over-writing')
else:
print('File is empty')
mode = 'w+'
else:
print('File don\'t exist')
mode = 'w'
return mode, okayToOverwrite
def createExclusionFile(dataset_dir_path:str, mogrify_output_file_path:str,
output_file_path:str, doOverwrite:bool=False):
"""
dataset_dir_path le chemin d'accès au dossier du dataset
output_file_path le chemin du fichier que l'on veut créer
doOverwrite permet d'écraser le fichier, si il existe déjà, si le paramètre
est passé à True (False par defaut).
"""
print
# Check if file exists or not and gives the write or write and read depending,
# as well as the bolean to overwrite or not the file
mode, okayToOverwrite = checkExistanceAndEmptiness(output_file_path, doOverwrite)
dataset_path = Path(dataset_dir_path)
output_path = Path(output_file_path)
print(dataset_path)
if okayToOverwrite:
with output_path.open(mode) as outfile:
#writing in the file
# Lecture du fichier d'exclusion
mogrify_output = Path(mogrify_output_file_path)
regex_files = re.compile('dataset/.*/[0-9]*.jpg')
added_lines = []
with mogrify_output.open('r') as infile:
for line in infile.readlines():
# time.sleep(1)
if line.endswith("\n"):
line = line[:-1]
first_match = regex_files.findall(line)[0]
first_path = Path(first_match)
string = str(first_path.relative_to(dataset_path))
# string = first_match.replace(str(dataset_path)+"/", "")
if string not in added_lines:
outfile.write(string+"\n")
added_lines.append(string)
def createGlobalDescription(dataset_dir_path:str, exclude_img_file_path:str,
output_file_path:str, doOverwrite:bool=False):
"""
Va generer le fichier de tout le dataset
dataset_dir_path le chemin d'accès au dossier du dataset
exclude_img_file_path le chemin d'accès d'un fichier d'exclusion de fichiers
corrompus dans la liste. De la forme :
path/vers/le/fichier1.jpg
path/vers/le/fichier2.jpg
path/vers/le/fichier3.jpg
path/vers/le/fichier4.jpg
output_file_path le chemin du fichier que l'on veut créer
doOverwrite permet d'écraser le fichier, si il existe déjà, si le paramètre
est passé à True (False par defaut).
"""
# Lecture du fichier d'exclusion
exclude_path = Path(exclude_img_file_path)
exclude_img_list = []
with exclude_path.open('r') as file:
for line in file.readlines():
if line.endswith("\n"):
line = line[:-1]
line = str(Path(line)) # To be able to compare it to other file path
#print("exclude file line :", line)
exclude_img_list.append(line)
print("exclude_img_list", exclude_img_list)
# Compter celui qui a le plus d'exclus, pour en avoir le même nombre de
# chaque coté
count_cat = 0; count_dog = 0
for exclude_file in exclude_img_list:
#print("Cat or Dog ?", exclude_file.split("/")[-2])
if exclude_file.split("/")[-2] == 'Cat':
count_cat += 1
else:
count_dog += 1
print("count_cat", count_cat, "count_dog", count_dog)
left_to_exclude_dogs = count_cat-count_dog if count_cat >= count_dog else 0
left_to_exclude_cats = count_dog-count_cat if count_dog >= count_cat else 0
# Check if file exists or not and gives the write or write and read depending,
# as well as the bolean to overwrite or not the file
mode, okayToOverwrite = checkExistanceAndEmptiness(output_file_path, doOverwrite)
output_path = Path(output_file_path)
# Ecriture du fichier
if okayToOverwrite:
with output_path.open(mode) as file:
#writing in the file
ds_dir_path = Path(dataset_dir_path)
#print("ds_dir_path", ds_dir_path)
class_num = -1
for class_dir in ds_dir_path.joinpath("PetImages").iterdir():
if class_dir.is_dir():
class_num += 1
print(" class_dir", class_dir)
print(" class_num", class_num)
if str(class_dir).endswith('Cat'):
left_to_exclude_count = left_to_exclude_cats
print(" left_to_exclude_count for Cats is :", left_to_exclude_count)
else:
left_to_exclude_count = left_to_exclude_dogs
print(" left_to_exclude_count for Dogs is :", left_to_exclude_count)
added_count = 0
for class_img in class_dir.iterdir():
if class_img.match('[0-9]*.jpg'):
local_image_path = class_img.relative_to(ds_dir_path)
# Check for exclusion
#print("class_img:", class_img)
#print("exclude_img_list:", exclude_img_list)
#print("class_img relative to:", str(class_img.relative_to(ds_dir_path)))
#time.sleep(2)
if str(local_image_path) not in exclude_img_list:
#print(" ds_dir_path", ds_dir_path)
#print(" class_dir", class_dir)
#print(" class_img", class_img)
if left_to_exclude_count > 0:
left_to_exclude_count -= 1
#print(" class_img", class_img)
print(" > that was a left to exclude", local_image_path)
#time.sleep(1)
else:
file.write(str(local_image_path) + "\t" + str(class_num) + "\n")
added_count += 1
else:
#print(" class_img", class_img)
print(" > excluded from the exclusion list", local_image_path)
#time.sleep(1)
if str(class_dir).endswith('Cat'):
print("Added", added_count, "cats to the description file")
else:
print("Added", added_count, "dogs to the description file")
"""#### Create the exclusion list and the global description"""
createExclusionFile(dataset_dir_path='./dataset/CatsAndDogs',
mogrify_output_file_path='./dataset/CatsAndDogs/mogrify_output',
output_file_path='./dataset/CatsAndDogs/exclude.txt',
doOverwrite=True)
createGlobalDescription(dataset_dir_path='./dataset/CatsAndDogs',
exclude_img_file_path='./dataset/CatsAndDogs/exclude.txt',
output_file_path='./dataset/CatsAndDogs/description.txt',
doOverwrite=True)
"""### 1.4) Create a training and a test set
##### The python generator for the dataset
"""
from pathlib import Path
import tensorflow as tf
import numpy as np
import cv2
import random
import math
class MyDogsCats:
def __init__(self, ds_description_path:str, dataset_path:str, set_type:str, train_prop:float) -> None:
"""
ds_description_path : fichier avec les paths de chaque fichiers du dataset et sa classe
Exemple de fichier (tabulation entre le path et la classe):
/truc/bidule/chat/01.jpg 0
/truc/bidule/chien/01.jpg 1
Etc ...
"""
# Lire le fichier de description et regrouper par classes
img_list_par_classes = {}
path = Path(ds_description_path)
with path.open('r') as file:
for line in file.readlines():
if line.endswith("\n"):
line = line[:-1]
splits = line.split("\t")
if line != "":
img_text = splits[0]
lbl_text = int(splits[1])
if lbl_text in img_list_par_classes.keys():
img_list_par_classes[lbl_text].append(img_text)
else:
img_list_par_classes[lbl_text] = [img_text]
#print(img_list_par_classes)
# Obtenir la liste de train OU de test
self._img_list = []
self._lbl_list = []
self._num_class = len(img_list_par_classes)
for num_class in img_list_par_classes:
# Definir les proportions
num_files = len(img_list_par_classes[num_class])
if set_type == "train":
num_per_class_to_keep = math.ceil((num_files // self._num_class) * train_prop)
class_files = img_list_par_classes[num_class][0:num_per_class_to_keep]
elif set_type == "test":
num_per_class_to_keep = math.floor((num_files // self._num_class) * (1 - train_prop))
class_files = img_list_par_classes[num_class][-num_per_class_to_keep:]
else:
class_files = img_list_par_classes[num_class]
# Ajouter les images qui correspondent à la liste des images
self._img_list.extend(class_files)
# De même pour les labels
#print("num_class:", num_class)
#print("type num_class:", type(num_class))
#print("len num_class:", len(class_files))
self._lbl_list.extend([num_class for i in range(len(class_files))])
#print("_img_list", self._img_list[0:100])
#print("_lbl_list", self._lbl_list[0:100])
assert(len(self._lbl_list) == len(self._img_list))
self.num_samples = len(self._lbl_list)
if set_type == "train" or set_type == "test":
self._set_type = set_type
else:
self._set_type = "whole"
self._img_size = 384
self._img_dim = (self._img_size, self._img_size)
self._num_channels = 3
self._one_hot_depth = 2
self._ds_path = Path(dataset_path)
def getDataset(self):
generator = self._generator
return tf.data.Dataset.from_generator(generator,
args=[],
output_types={'image': tf.float32, 'label': tf.int32},
output_shapes={'image': tf.TensorShape((self._img_size, self._img_size, self._num_channels)),
'label': tf.TensorShape((self._one_hot_depth))})
def _generator(self):
img_list = self._img_list
lbl_list = self._lbl_list
# Shuffle
c = list(zip(img_list, lbl_list))
random.shuffle(c)
img_list, lbl_list = zip(*c)
for i in range(self.num_samples):
#print('Reading from :', img_list[i])
#print('Good path :', self._ds_path/img_list[i])
#self._ds_path/img_list[i]
#print(self._ds_path/img_list[i])
# img_path_i = Path(img_list[i])
im = cv2.imread(str(self._ds_path/img_list[i]),-1)
if im is None:
i = 0
im = cv2.imread(str(self._ds_path/img_list[0]),-1)
if len(im.shape) < 3:
im = np.repeat(np.expand_dims(im, -1), 3, -1)
#print(type(im))
img = cv2.resize(im, self._img_dim)
img = img/255.0
#img = np.expand_dims(im, -1)
lbl = tf.one_hot(lbl_list[i], depth=self._one_hot_depth, dtype=tf.int32)
yield {'image': img, 'label': lbl}
"""## 2) ViT Colab
##### Copyright 2020 Google LLC.
"""
#@title Licensed under the Apache License, Version 2.0 (the "License");
# 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.
"""<a href="https://colab.research.google.com/github/google-research/vision_transformer/blob/master/vit_jax.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
### Setup
Needs to be executed once in every VM.
The cell below downloads the code from Github and install necessary dependencies.
"""
#@markdown Select whether you would like to store data in your personal drive.
#@markdown
#@markdown If you select **yes**, you will need to authorize Colab to access
#@markdown your personal drive
#@markdown
#@markdown If you select **no**, then any changes you make will diappear when
#@markdown this Colab's VM restarts after some time of inactivity...
use_gdrive = 'yes' #@param ["yes", "no"]
if use_gdrive == 'yes':
from google.colab import drive
drive.mount('/gdrive')
root = '/gdrive/My Drive/vision_transformer_colab'
import os
if not os.path.isdir(root):
os.mkdir(root)
os.chdir(root)
print(f'\nChanged CWD to "{root}"')
else:
from IPython import display
display.display(display.HTML(
'<h1 style="color:red">CHANGES NOT PERSISTED</h1>'))
# Clone repository and pull latest changes.
![ -d vision_transformer ] || git clone --depth=1 https://github.com/google-research/vision_transformer
!cd vision_transformer && git pull
!pip install -qr vision_transformer/vit_jax/requirements.txt
#!pip install -r vision_transformer/vit_jax/requirements.txt
"""### Imports"""
# Shows all available pre-trained models.
!gsutil ls -lh gs://vit_models/*
"""For now let's try with `ViT-B_16` (pre-trained on imagenet21k, no fine tunning)."""
# Download a pre-trained model.
model = 'ViT-B_16'
![ -e "$model".npz ] || gsutil cp gs://vit_models/imagenet21k/"$model".npz .
#@markdown TPU setup : Boilerplate for connecting JAX to TPU.
import os
if 'google.colab' in str(get_ipython()) and 'COLAB_TPU_ADDR' in os.environ:
# Make sure the Colab Runtime is set to Accelerator: TPU.
import requests
if 'TPU_DRIVER_MODE' not in globals():
url = 'http://' + os.environ['COLAB_TPU_ADDR'].split(':')[0] + ':8475/requestversion/tpu_driver0.1-dev20191206'
resp = requests.post(url)
TPU_DRIVER_MODE = 1
# The following is required to use TPU Driver as JAX's backend.
from jax.config import config
config.FLAGS.jax_xla_backend = "tpu_driver"
config.FLAGS.jax_backend_target = "grpc://" + os.environ['COLAB_TPU_ADDR']
print('Registered TPU:', config.FLAGS.jax_backend_target)
else:
print('No TPU detected. Can be changed under "Runtime/Change runtime type".')
import flax
import jax
from matplotlib import pyplot as plt
import numpy as np
import tqdm
# Shows the number of available devices.
# In a CPU/GPU runtime this will be a single device.
# In a TPU runtime this will be 8 cores.
jax.local_devices()
# Open some code files in a split editor on the right.
# You can open more files in the file tab on the left.
from google.colab import files
files.view('vision_transformer/vit_jax/checkpoint.py')
files.view('vision_transformer/vit_jax/input_pipeline.py')
files.view('vision_transformer/vit_jax/models.py')
files.view('vision_transformer/vit_jax/momentum_clip.py')
files.view('vision_transformer/vit_jax/train.py')
files.view('vision_transformer/vit_jax/hyper.py')
# Commented out IPython magic to ensure Python compatibility.
# Import files from repository.
# Updating the files in the editor on the right will immediately update the
# modules by re-importing them.
import sys
if './vision_transformer' not in sys.path:
sys.path.append('./vision_transformer')
# From https://ipython.org/ipython-doc/3/config/extensions/autoreload.html
# Reload all modules (except those excluded by %aimport) every time before
# executing the Python code typed.
# %load_ext autoreload
# %autoreload 2
from vit_jax import checkpoint
from vit_jax import hyper
from vit_jax import input_pipeline
from vit_jax import logging
from vit_jax import models
from vit_jax import momentum_clip
from vit_jax import train
logger = logging.setup_logger('./logs')
# Helper functions for images.
labelnames = dict(
# https://www.cs.toronto.edu/~kriz/cifar.html
cifar10=('airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck'),
# https://www.cs.toronto.edu/~kriz/cifar.html
cifar100=('apple', 'aquarium_fish', 'baby', 'bear', 'beaver', 'bed', 'bee', 'beetle', 'bicycle', 'bottle', 'bowl', 'boy', 'bridge', 'bus', 'butterfly', 'camel', 'can', 'castle', 'caterpillar', 'cattle', 'chair', 'chimpanzee', 'clock', 'cloud', 'cockroach', 'couch', 'crab', 'crocodile', 'cup', 'dinosaur', 'dolphin', 'elephant', 'flatfish', 'forest', 'fox', 'girl', 'hamster', 'house', 'kangaroo', 'computer_keyboard', 'lamp', 'lawn_mower', 'leopard', 'lion', 'lizard', 'lobster', 'man', 'maple_tree', 'motorcycle', 'mountain', 'mouse', 'mushroom', 'oak_tree', 'orange', 'orchid', 'otter', 'palm_tree', 'pear', 'pickup_truck', 'pine_tree', 'plain', 'plate', 'poppy', 'porcupine', 'possum', 'rabbit', 'raccoon', 'ray', 'road', 'rocket', 'rose', 'sea', 'seal', 'shark', 'shrew', 'skunk', 'skyscraper', 'snail', 'snake', 'spider', 'squirrel', 'streetcar', 'sunflower', 'sweet_pepper', 'table', 'tank', 'telephone', 'television', 'tiger', 'tractor', 'train', 'trout', 'tulip', 'turtle', 'wardrobe', 'whale', 'willow_tree', 'wolf', 'woman', 'worm'),
# Addition for Dogs and Cats
dogscats=('dog', 'cat')
)
def make_label_getter(dataset):
"""Returns a function converting label indices to names."""
def getter(label):
if dataset in labelnames:
return labelnames[dataset][label]
return f'label={label}'
return getter
def show_img(img, ax=None, title=None):
"""Shows a single image."""
if ax is None:
ax = plt.gca()
ax.imshow(img[...])
ax.set_xticks([])
ax.set_yticks([])
if title:
ax.set_title(title)
def show_img_grid(imgs, titles):
"""Shows a grid of images."""
n = int(np.ceil(len(imgs)**.5))
_, axs = plt.subplots(n, n, figsize=(3 * n, 3 * n))
for i, (img, title) in enumerate(zip(imgs, titles)):
img = (img + 1) / 2 # Denormalize
show_img(img, axs[i // n][i % n], title)
"""### Load the Python Generator"""
def _shard(data):
data['image'] = tf.reshape(data['image'], [num_devices, -1, 384, 384, 3])
data['label'] = tf.reshape(data['label'], [num_devices, -1, 2])
return data
num_devices = len(jax.local_devices())
# The bypass
batch_size = 64
num_classes = 2
dataset = 'dogscats'
dgscts_train = MyDogsCats(ds_description_path='/content/dataset/CatsAndDogs/description.txt',
dataset_path='/content/dataset/CatsAndDogs',
set_type='train',
train_prop=0.8)
dgscts_test = MyDogsCats(ds_description_path='/content/dataset/CatsAndDogs/description.txt',
dataset_path='/content/dataset/CatsAndDogs',
set_type='test',
train_prop=0.8)
ds_train = dgscts_train.getDataset().batch(batch_size, drop_remainder=True)
ds_test = dgscts_test.getDataset().batch(batch_size, drop_remainder=True)
if num_devices is not None:
ds_train = ds_train.map(_shard, tf.data.experimental.AUTOTUNE)
ds_test = ds_test.map(_shard, tf.data.experimental.AUTOTUNE)
ds_test = ds_test.prefetch(buffer_size=tf.data.experimental.AUTOTUNE)
ds_train = ds_train.prefetch(buffer_size=tf.data.experimental.AUTOTUNE)
"""### Load dataset"""
# Fetch a batch of test images for illustration purposes.
batch = next(iter(ds_test.as_numpy_iterator()))
# Note the shape : [num_local_devices, local_batch_size, h, w, c]
# print(batch)
print(batch['image'].shape)
print(batch['label'].shape)
# Show some imags with their labels.
images, labels = batch['image'][1][:9], batch['label'][1][:9]
titles = map(make_label_getter(dataset), labels.argmax(axis=1))
show_img_grid(images, titles)
# Same as above, but with train images.
# Do you spot a difference?
# Check out input_pipeline.get_data() in the editor at your right to see how the
# images are preprocessed differently.
batch = next(iter(ds_train.as_numpy_iterator()))
images, labels = batch['image'][1][:9], batch['label'][1][:9]
titles = map(make_label_getter(dataset), labels.argmax(axis=1))
show_img_grid(images, titles)
[print(i.shape) for i in images]
"""### Load pre-trained"""
# Load model definition & initialize random parameters.
VisionTransformer = models.KNOWN_MODELS[model].partial(num_classes=num_classes)
_, params = VisionTransformer.init_by_shape(
jax.random.PRNGKey(0),
# Discard the "num_local_devices" dimension of the batch for initialization.
[(batch['image'].shape[1:], batch['image'].dtype.name)])
# Load and convert pretrained checkpoint.
# This involves loading the actual pre-trained model results, but then also also
# modifying the parameters a bit, e.g. changing the final layers, and resizing
# the positional embeddings.
# For details, refer to the code and to the methods of the paper.
params = checkpoint.load_pretrained(
pretrained_path=f'{model}.npz',
init_params=params,
model_config=models.CONFIGS[model],
logger=logger,
)
"""### Evaluate"""
# So far, all our data is in the host memory. Let's now replicate the arrays
# into the devices.
# This will make every array in the pytree params become a ShardedDeviceArray
# that has the same data replicated across all local devices.
# For TPU it replicates the params in every core.
# For a single GPU this simply moves the data onto the device.
# For CPU it simply creates a copy.
params_repl = flax.jax_utils.replicate(params)
print('params.cls:', type(params['cls']).__name__, params['cls'].shape)
print('params_repl.cls:', type(params_repl['cls']).__name__, params_repl['cls'].shape)
# Then map the call to our model's forward pass onto all available devices.
vit_apply_repl = jax.pmap(VisionTransformer.call)
def get_accuracy(params_repl):
"""Returns accuracy evaluated on the test set."""
good = total = 0
steps = dgscts_test.num_samples // batch_size
#steps = input_pipeline.get_dataset_info(dataset, 'test')['num_examples'] // batch_size
for _, batch in zip(tqdm.notebook.trange(steps), ds_test.as_numpy_iterator()):
predicted = vit_apply_repl(params_repl, batch['image'])
is_same = predicted.argmax(axis=-1) == batch['label'].argmax(axis=-1)
good += is_same.sum()
total += len(is_same.flatten())
return good / total
# Random performance without fine-tuning.
get_accuracy(params_repl)
"""### Fine-tune"""
# 100 Steps take approximately 15 minutes in the TPU runtime.
total_steps = 10 ## 100
warmup_steps = 5
decay_type = 'cosine'
grad_norm_clip = 1
# This controls in how many forward passes the batch is split. 8 works well with
# a TPU runtime that has 8 devices. 64 should work on a GPU. You can of course
# also adjust the batch_size above, but that would require you to adjust the
# learning rate accordingly.
accum_steps = 8
base_lr = 0.03
# Check out train.make_update_fn in the editor on the right side for details.
update_fn_repl = train.make_update_fn(VisionTransformer.call, accum_steps)
# We use a momentum optimizer that uses half precision for state to save
# memory. It als implements the gradient clipping.
opt = momentum_clip.Optimizer(grad_norm_clip=grad_norm_clip).create(params)
opt_repl = flax.jax_utils.replicate(opt)
lr_fn = hyper.create_learning_rate_schedule(total_steps, base_lr, decay_type, warmup_steps)
# Prefetch entire learning rate schedule onto devices. Otherwise we would have
# a slow transfer from host to devices in every step.
lr_iter = hyper.lr_prefetch_iter(lr_fn, 0, total_steps)
# Initialize PRNGs for dropout.
update_rngs = jax.random.split(jax.random.PRNGKey(0), jax.local_device_count())
# The world's simplest training loop.
# Completes in ~20 min on the TPU runtime.
for step, batch, lr_repl in zip(
tqdm.notebook.trange(1, total_steps + 1),
ds_train.as_numpy_iterator(),
lr_iter
):
print("loop", step, batch['image'].shape, batch['label'].shape)
opt_repl, loss_repl, update_rngs = update_fn_repl(
opt_repl, lr_repl, batch, update_rngs)
print("fini la loop", type(opt_repl), type(loss_repl), type(update_rngs))
# Should be ~97.2% for CIFAR10
# Should be ~71.2% for CIFAR100
get_accuracy(opt_repl.target)
"""### Inference"""
# Download model pre-trained on imagenet21k and fine-tuned on imagenet2012.
![ -e "$model"_imagenet2012.npz ] || gsutil cp gs://vit_models/imagenet21k+imagenet2012/"$model".npz "$model"_imagenet2012.npz
VisionTransformer = models.KNOWN_MODELS[model].partial(num_classes=1000)
# Load and convert pretrained checkpoint.
params = checkpoint.load(f'{model}_imagenet2012.npz')
params['pre_logits'] = {} # Need to restore empty leaf for Flax.
# Get imagenet labels.
!wget https://storage.googleapis.com/bit_models/ilsvrc2012_wordnet_lemmas.txt
imagenet_labels = dict(enumerate(open('ilsvrc2012_wordnet_lemmas.txt')))
# Get a random picture with the correct dimensions.
!wget https://picsum.photos/384 -O picsum.jpg
import PIL
img = PIL.Image.open('picsum.jpg')
img
# Predict on a batch with a single item (note very efficient TPU usage...)
logits, = VisionTransformer.call(params, (np.array(img) / 128 - 1)[None, ...])
preds = flax.nn.softmax(logits)
for idx in preds.argsort()[:-11:-1]:
print(f'{preds[idx]:.5f} : {imagenet_labels[idx]}', end='')
"""## 3) Nos test
### Resize sans garder les proportions
"""
# Get a random picture with the correct dimensions.
!wget https://lorraine.gatech.edu/sites/default/files/uploads/images/superblock_images/metz-campus.jpeg -O pic_gatech.jpg
import PIL
img = PIL.Image.open('pic_gatech.jpg')
#img
img = img.resize((384,384))
img
# Predict on a batch with a single item (note very efficient TPU usage...)
logits, = VisionTransformer.call(params, (np.array(img) / 128 - 1)[None, ...])
preds = flax.nn.softmax(logits)
for idx in preds.argsort()[:-11:-1]:
print(f'{preds[idx]:.5f} : {imagenet_labels[idx]}', end='')
"""### Resize en gardant une propostion carré"""
# Get a random picture with the correct dimensions.
!wget https://lorraine.gatech.edu/sites/default/files/uploads/images/superblock_images/metz-campus.jpeg -O pic_gatech.jpg
import PIL
img = PIL.Image.open('pic_gatech.jpg')
(w, h) = (img.width, img.height)
if w>=h:
crop_box = ((w/2)-(h/2), 0, (w/2)+(h/2), h)
else:
crop_box = ((h/2)-(w/2), 0, (h/2)+(w/2), w)
img = img.resize((384,384), box=crop_box)
img
# Predict on a batch with a single item (note very efficient TPU usage...)
logits, = VisionTransformer.call(params, (np.array(img) / 128 - 1)[None, ...])
preds = flax.nn.softmax(logits)
for idx in preds.argsort()[:-11:-1]:
print(f'{preds[idx]:.5f} : {imagenet_labels[idx]}', end='') | 38.007614 | 1,046 | 0.67576 | 4,292 | 29,950 | 4.552423 | 0.221342 | 0.012539 | 0.02211 | 0.016889 | 0.34966 | 0.284252 | 0.245151 | 0.193766 | 0.169558 | 0.162598 | 0 | 0.016886 | 0.199199 | 29,950 | 788 | 1,047 | 38.007614 | 0.797782 | 0.234457 | 0 | 0.221675 | 1 | 0.036946 | 0.145047 | 0.049223 | 0 | 0 | 0 | 0 | 0.002463 | 0 | null | null | 0 | 0.083744 | null | null | 0.076355 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
36da2c9e737689743389837a193464187fe5262e | 154 | py | Python | Python/WSClock/Page.py | Camiloasc1/OperativeSystemsUNAL | a07bfc235789b7a8848280a549a6b2c9602e61b5 | [
"MIT"
] | null | null | null | Python/WSClock/Page.py | Camiloasc1/OperativeSystemsUNAL | a07bfc235789b7a8848280a549a6b2c9602e61b5 | [
"MIT"
] | null | null | null | Python/WSClock/Page.py | Camiloasc1/OperativeSystemsUNAL | a07bfc235789b7a8848280a549a6b2c9602e61b5 | [
"MIT"
] | null | null | null |
class Page(object):
def __init__(self, params):
self.size = 2 ** 10
self.Time = False
self.R = False
self.M = False
| 17.111111 | 31 | 0.519481 | 20 | 154 | 3.8 | 0.7 | 0.236842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030928 | 0.37013 | 154 | 8 | 32 | 19.25 | 0.752577 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 1 | 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 | 3 |
36e6a531b83457a4c48394e73a9fc94d96c25f64 | 77 | py | Python | 2022-02-24-ftx-rest-api-python/local_settings.py | georgehaan/analyzingalpha | f1f821e8d74d64addf410bfd205cb089ddf5517e | [
"Unlicense"
] | null | null | null | 2022-02-24-ftx-rest-api-python/local_settings.py | georgehaan/analyzingalpha | f1f821e8d74d64addf410bfd205cb089ddf5517e | [
"Unlicense"
] | null | null | null | 2022-02-24-ftx-rest-api-python/local_settings.py | georgehaan/analyzingalpha | f1f821e8d74d64addf410bfd205cb089ddf5517e | [
"Unlicense"
] | null | null | null | ftxus = {
'api_key':'YOUR_API_KEY',
'api_secret':'YOUR_API_SECRET'
}
| 15.4 | 34 | 0.636364 | 11 | 77 | 3.909091 | 0.454545 | 0.27907 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | 77 | 4 | 35 | 19.25 | 0.68254 | 0 | 0 | 0 | 0 | 0 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 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 | 3 |
36e9aa3443706da87ee4f539703a4f5d9195cf72 | 166 | py | Python | Solutions/print all subset.py | Adityasriram0901/Python-Thunder | 192920c48092ce1783d56c7b45cdd7e7a50246fa | [
"MIT"
] | 81 | 2020-09-25T15:02:11.000Z | 2020-10-12T14:20:31.000Z | Solutions/print all subset.py | Adityasriram0901/Python-Thunder | 192920c48092ce1783d56c7b45cdd7e7a50246fa | [
"MIT"
] | 196 | 2020-09-25T13:52:13.000Z | 2020-10-12T20:20:00.000Z | Solutions/print all subset.py | Adityasriram0901/Python-Thunder | 192920c48092ce1783d56c7b45cdd7e7a50246fa | [
"MIT"
] | 209 | 2020-09-25T16:15:46.000Z | 2020-10-12T20:08:08.000Z | a = [1, 2, 3, 4]
def subset(a, n):
if n == 1:
return n
else:
return (subset(a[n - 1]), subset(a[n - 2]))
print(subset(a, n=4))
| 13.833333 | 52 | 0.415663 | 29 | 166 | 2.37931 | 0.413793 | 0.405797 | 0.463768 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.078431 | 0.385542 | 166 | 11 | 53 | 15.090909 | 0.598039 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.428571 | 0.142857 | 1 | 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 | 3 |
7fc49c5390bfb96b900f097bb43b1a2528a313d1 | 6,522 | py | Python | pysnmp-with-texts/Intel-Common-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/Intel-Common-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/Intel-Common-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 Intel-Common-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Intel-Common-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:54:14 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint", "SingleValueConstraint")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
ModuleIdentity, ObjectIdentity, iso, Integer32, Bits, Counter64, Counter32, Gauge32, NotificationType, Unsigned32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, TimeTicks, enterprises = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "ObjectIdentity", "iso", "Integer32", "Bits", "Counter64", "Counter32", "Gauge32", "NotificationType", "Unsigned32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "TimeTicks", "enterprises")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
intel = MibIdentifier((1, 3, 6, 1, 4, 1, 343))
identifiers = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1))
products = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2))
experimental = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 3))
information_technology = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 4)).setLabel("information-technology")
sysProducts = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 5))
mib2ext = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 6))
hw = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 7))
wekiva = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 111))
systems = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1))
objects = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 2))
comm_methods = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 3)).setLabel("comm-methods")
pc_systems = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 1)).setLabel("pc-systems")
proxy_systems = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 2)).setLabel("proxy-systems")
hub_systems = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3)).setLabel("hub-systems")
switch_systems = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 4)).setLabel("switch-systems")
local_proxy_1 = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 3, 1)).setLabel("local-proxy-1")
pc_novell_1 = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 3, 2)).setLabel("pc-novell-1")
express10_100Stack = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3, 1)).setLabel("express10-100Stack")
express12TX = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3, 2))
express24TX = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3, 3))
expressReserved = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3, 4))
expressBridge = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3, 6))
express210_12 = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3, 7)).setLabel("express210-12")
express210_24 = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3, 8)).setLabel("express210-24")
express220_12 = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3, 9)).setLabel("express220-12")
express220_24 = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3, 10)).setLabel("express220-24")
express300Stack = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3, 11))
express320_16 = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3, 12)).setLabel("express320-16")
express320_24 = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 1, 1, 3, 13)).setLabel("express320-24")
pc_products = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 1)).setLabel("pc-products")
hub_products = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 2)).setLabel("hub-products")
proxy = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 3))
print_products = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 4)).setLabel("print-products")
network_products = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 5)).setLabel("network-products")
snmp_agents = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 6)).setLabel("snmp-agents")
nic_products = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 7)).setLabel("nic-products")
server_management = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 10)).setLabel("server-management")
switch_products = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 11)).setLabel("switch-products")
i2o = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 120))
express110 = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 2, 1))
netport_1 = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 4, 1)).setLabel("netport-1")
netport_2 = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 4, 2)).setLabel("netport-2")
netport_express = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 4, 3)).setLabel("netport-express")
lanDesk = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 5, 1))
ld_alarms = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 5, 1, 1)).setLabel("ld-alarms")
internetServer_2 = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 5, 2)).setLabel("internetServer-2")
iS_alarms = MibIdentifier((1, 3, 6, 1, 4, 1, 343, 2, 5, 2, 1)).setLabel("iS-alarms")
mibBuilder.exportSymbols("Intel-Common-MIB", express220_24=express220_24, express110=express110, snmp_agents=snmp_agents, switch_systems=switch_systems, objects=objects, proxy=proxy, lanDesk=lanDesk, express12TX=express12TX, mib2ext=mib2ext, experimental=experimental, express210_24=express210_24, sysProducts=sysProducts, netport_1=netport_1, internetServer_2=internetServer_2, intel=intel, pc_novell_1=pc_novell_1, products=products, express320_24=express320_24, proxy_systems=proxy_systems, express320_16=express320_16, identifiers=identifiers, express300Stack=express300Stack, wekiva=wekiva, express10_100Stack=express10_100Stack, hub_systems=hub_systems, ld_alarms=ld_alarms, server_management=server_management, switch_products=switch_products, i2o=i2o, netport_express=netport_express, network_products=network_products, expressBridge=expressBridge, express220_12=express220_12, local_proxy_1=local_proxy_1, systems=systems, comm_methods=comm_methods, express210_12=express210_12, pc_products=pc_products, hub_products=hub_products, expressReserved=expressReserved, netport_2=netport_2, pc_systems=pc_systems, hw=hw, express24TX=express24TX, print_products=print_products, information_technology=information_technology, iS_alarms=iS_alarms, nic_products=nic_products)
| 103.52381 | 1,274 | 0.713891 | 991 | 6,522 | 4.60444 | 0.148335 | 0.028052 | 0.032216 | 0.16831 | 0.398641 | 0.355249 | 0.355249 | 0.355249 | 0.321499 | 0.291037 | 0 | 0.143547 | 0.111316 | 6,522 | 62 | 1,275 | 105.193548 | 0.64372 | 0.049985 | 0 | 0 | 0 | 0 | 0.136415 | 0.010668 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.109091 | 0 | 0.109091 | 0.036364 | 0 | 0 | 0 | null | 0 | 0 | 1 | 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 | 3 |
7fc62c697596e38c94228733e0069508642f51ad | 198 | py | Python | app/emails/__init__.py | zollf/CITS3200 | 95fb7569dad325c057e441cd7265d3e85735c058 | [
"CC0-1.0"
] | null | null | null | app/emails/__init__.py | zollf/CITS3200 | 95fb7569dad325c057e441cd7265d3e85735c058 | [
"CC0-1.0"
] | null | null | null | app/emails/__init__.py | zollf/CITS3200 | 95fb7569dad325c057e441cd7265d3e85735c058 | [
"CC0-1.0"
] | null | null | null | from django.apps import AppConfig
class EmailAppConfig(AppConfig):
name = 'app.emails'
label = 'email_app'
verbose_name = 'Emails App'
default_app_config = 'app.emails.EmailAppConfig'
| 22 | 48 | 0.737374 | 24 | 198 | 5.916667 | 0.625 | 0.126761 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 198 | 8 | 49 | 24.75 | 0.860606 | 0 | 0 | 0 | 0 | 0 | 0.272727 | 0.126263 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.833333 | 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 | 1 | 0 | 0 | 3 |
7fc87ac068a828700f0e5927697f90ef933d4e60 | 293 | py | Python | docs/examples/http_proxy/constructor_argument.py | dupontz/libcloud | 419c69441ea10e7bbf37319e5e8d02e82e7e6b40 | [
"Apache-2.0"
] | 4 | 2017-11-14T17:24:12.000Z | 2020-10-30T01:46:02.000Z | docs/examples/http_proxy/constructor_argument.py | dupontz/libcloud | 419c69441ea10e7bbf37319e5e8d02e82e7e6b40 | [
"Apache-2.0"
] | 11 | 2017-01-29T08:59:21.000Z | 2018-07-02T09:17:47.000Z | docs/examples/http_proxy/constructor_argument.py | dupontz/libcloud | 419c69441ea10e7bbf37319e5e8d02e82e7e6b40 | [
"Apache-2.0"
] | 4 | 2016-04-04T08:01:48.000Z | 2018-06-06T08:04:36.000Z | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
PROXY_URL_NO_AUTH_1 = 'http://<proxy hostname 1>:<proxy port 2>'
cls = get_driver(Provider.RACKSPACE)
driver = cls('username', 'api key', region='ord',
http_proxy=PROXY_URL_NO_AUTH_1)
| 32.555556 | 64 | 0.750853 | 44 | 293 | 4.75 | 0.568182 | 0.114833 | 0.181818 | 0.133971 | 0.143541 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01581 | 0.136519 | 293 | 8 | 65 | 36.625 | 0.810277 | 0 | 0 | 0 | 0 | 0 | 0.197952 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
7fe7a7ef4cedcf3d41ec5da04172536952412a93 | 570 | py | Python | conans/test/model/username_test.py | jbaruch/conan | 263722b5284828c49774ffe18d314b24ee11e178 | [
"MIT"
] | null | null | null | conans/test/model/username_test.py | jbaruch/conan | 263722b5284828c49774ffe18d314b24ee11e178 | [
"MIT"
] | null | null | null | conans/test/model/username_test.py | jbaruch/conan | 263722b5284828c49774ffe18d314b24ee11e178 | [
"MIT"
] | 1 | 2021-03-03T17:15:46.000Z | 2021-03-03T17:15:46.000Z | import unittest
from conans.errors import ConanException
from conans.model.username import Username
class UsernameTest(unittest.TestCase):
def username_test(self):
Username("userwith-hypens")
self.assertRaises(ConanException, Username, "")
self.assertRaises(ConanException, Username, "A"*31)
Username("A"*30)
self.assertRaises(ConanException, Username, "1A")
self.assertRaises(ConanException, Username, "_A")
Username("A1")
Username("a_")
self.assertRaises(ConanException, Username, "$$") | 28.5 | 59 | 0.684211 | 55 | 570 | 7.036364 | 0.4 | 0.206718 | 0.387597 | 0.490956 | 0.20155 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013158 | 0.2 | 570 | 20 | 60 | 28.5 | 0.835526 | 0 | 0 | 0 | 0 | 0 | 0.047285 | 0 | 0 | 0 | 0 | 0 | 0.357143 | 1 | 0.071429 | false | 0 | 0.214286 | 0 | 0.357143 | 0 | 0 | 0 | 0 | null | 1 | 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 | 3 |
7feeefa1c9cfdfdf846929d05b2027d327b3a9e6 | 60 | py | Python | user_login.py | pieddro/football | d5a021da26a2252dcece752c51818f03d1d3db46 | [
"Apache-2.0"
] | null | null | null | user_login.py | pieddro/football | d5a021da26a2252dcece752c51818f03d1d3db46 | [
"Apache-2.0"
] | null | null | null | user_login.py | pieddro/football | d5a021da26a2252dcece752c51818f03d1d3db46 | [
"Apache-2.0"
] | null | null | null | Meine neuer Code..
Neue Codezeile ....
Tst stash zum 2. mal | 20 | 20 | 0.7 | 10 | 60 | 4.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020408 | 0.183333 | 60 | 3 | 21 | 20 | 0.836735 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3d05d97057af36632d639c5d678cfee0618bd44e | 197 | py | Python | sdk/python/opencannabis/media/__init__.py | CookiesCo/OpenCannabis | a7bb1f71200c6b8f56c509df47039198f0c3bd4c | [
"MIT"
] | 2 | 2020-08-27T00:45:49.000Z | 2021-06-19T08:01:13.000Z | sdk/python/opencannabis/media/__init__.py | CookiesCo/OpenCannabis | a7bb1f71200c6b8f56c509df47039198f0c3bd4c | [
"MIT"
] | 67 | 2020-08-27T03:16:33.000Z | 2022-03-26T14:33:38.000Z | sdk/python/opencannabis/media/__init__.py | CookiesCo/OpenCannabis | a7bb1f71200c6b8f56c509df47039198f0c3bd4c | [
"MIT"
] | 1 | 2020-11-12T04:26:43.000Z | 2020-11-12T04:26:43.000Z | # ~*~ coding: utf-8 ~*~
__doc__ = """
`opencannabis.media`
---------------------------
Records and definitions that structure digital media and related assets.
"""
# `opencannabis.media`
| 16.416667 | 74 | 0.573604 | 18 | 197 | 6.055556 | 0.777778 | 0.311927 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006098 | 0.167513 | 197 | 11 | 75 | 17.909091 | 0.658537 | 0.213198 | 0 | 0 | 0 | 0 | 0.861842 | 0.177632 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3d29b2ee51f536c799b3a2e3518fab0b83469961 | 26 | py | Python | pug-bot/apitoken.py | stevenktruong/pug-bot | 315c21363eebb51d67d5b5c9fa9326cd8bcb2b54 | [
"MIT"
] | 17 | 2018-06-27T03:49:03.000Z | 2021-04-13T07:32:43.000Z | pug-bot/apitoken.py | stevenktruong/pug-bot | 315c21363eebb51d67d5b5c9fa9326cd8bcb2b54 | [
"MIT"
] | 3 | 2020-03-26T06:49:10.000Z | 2020-04-23T07:20:41.000Z | pug-bot/apitoken.py | stevenktruong/pug-bot | 315c21363eebb51d67d5b5c9fa9326cd8bcb2b54 | [
"MIT"
] | 14 | 2018-06-27T03:49:06.000Z | 2021-10-07T23:28:44.000Z | TOKEN = "YOUR_TOKEN_HERE"
| 13 | 25 | 0.769231 | 4 | 26 | 4.5 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115385 | 26 | 1 | 26 | 26 | 0.782609 | 0 | 0 | 0 | 0 | 0 | 0.576923 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
3d3d56ea2024a56958685b39631e50240545177c | 304 | py | Python | tools/load_save.py | zs-liu/Pytorch-AS | 4e41f96522cce7a35f6625bdbe3863c0b74ee0ca | [
"MIT"
] | null | null | null | tools/load_save.py | zs-liu/Pytorch-AS | 4e41f96522cce7a35f6625bdbe3863c0b74ee0ca | [
"MIT"
] | null | null | null | tools/load_save.py | zs-liu/Pytorch-AS | 4e41f96522cce7a35f6625bdbe3863c0b74ee0ca | [
"MIT"
] | null | null | null | import torch
def save_checkpoint(save_dir, model, optimizer):
torch.save({'model_state_dict': model.state_dict(),
'optimizer_state_dict': optimizer.state_dict()}, save_dir)
return True
def load_checkpoint(load_dir):
checkpoint = torch.load(load_dir)
return checkpoint
| 23.384615 | 74 | 0.713816 | 39 | 304 | 5.25641 | 0.333333 | 0.17561 | 0.136585 | 0.22439 | 0.219512 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.184211 | 304 | 12 | 75 | 25.333333 | 0.826613 | 0 | 0 | 0 | 0 | 0 | 0.118421 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0 | 0.625 | 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 | 1 | 0 | 0 | 3 |
3d550a112ff51ab3601284d3bb247c868ab1d733 | 2,062 | py | Python | test/sample_data/get_observation_histogram_week.py | eduramirezh/pyinaturalist | e5da7ced7fae31f27310868bdb2d349bdff8e0d4 | [
"MIT"
] | 47 | 2019-07-23T08:18:02.000Z | 2022-03-17T16:32:17.000Z | test/sample_data/get_observation_histogram_week.py | eduramirezh/pyinaturalist | e5da7ced7fae31f27310868bdb2d349bdff8e0d4 | [
"MIT"
] | 219 | 2019-08-22T14:45:20.000Z | 2022-03-30T02:39:35.000Z | test/sample_data/get_observation_histogram_week.py | eduramirezh/pyinaturalist | e5da7ced7fae31f27310868bdb2d349bdff8e0d4 | [
"MIT"
] | 9 | 2020-02-28T04:29:13.000Z | 2022-02-23T03:02:32.000Z | from datetime import datetime
{
datetime(2019, 12, 30, 0, 0): 35,
datetime(2020, 1, 6, 0, 0): 27,
datetime(2020, 1, 13, 0, 0): 39,
datetime(2020, 1, 20, 0, 0): 120,
datetime(2020, 1, 27, 0, 0): 73,
datetime(2020, 2, 3, 0, 0): 48,
datetime(2020, 2, 10, 0, 0): 35,
datetime(2020, 2, 17, 0, 0): 89,
datetime(2020, 2, 24, 0, 0): 81,
datetime(2020, 3, 2, 0, 0): 116,
datetime(2020, 3, 9, 0, 0): 90,
datetime(2020, 3, 16, 0, 0): 195,
datetime(2020, 3, 23, 0, 0): 406,
datetime(2020, 3, 30, 0, 0): 642,
datetime(2020, 4, 6, 0, 0): 652,
datetime(2020, 4, 13, 0, 0): 684,
datetime(2020, 4, 20, 0, 0): 1393,
datetime(2020, 4, 27, 0, 0): 1755,
datetime(2020, 5, 4, 0, 0): 1251,
datetime(2020, 5, 11, 0, 0): 1566,
datetime(2020, 5, 18, 0, 0): 1986,
datetime(2020, 5, 25, 0, 0): 2141,
datetime(2020, 6, 1, 0, 0): 1581,
datetime(2020, 6, 8, 0, 0): 1640,
datetime(2020, 6, 15, 0, 0): 1406,
datetime(2020, 6, 22, 0, 0): 1902,
datetime(2020, 6, 29, 0, 0): 2078,
datetime(2020, 7, 6, 0, 0): 1821,
datetime(2020, 7, 13, 0, 0): 1854,
datetime(2020, 7, 20, 0, 0): 2308,
datetime(2020, 7, 27, 0, 0): 2637,
datetime(2020, 8, 3, 0, 0): 2275,
datetime(2020, 8, 10, 0, 0): 1717,
datetime(2020, 8, 17, 0, 0): 1474,
datetime(2020, 8, 24, 0, 0): 2234,
datetime(2020, 8, 31, 0, 0): 2275,
datetime(2020, 9, 7, 0, 0): 2180,
datetime(2020, 9, 14, 0, 0): 1824,
datetime(2020, 9, 21, 0, 0): 1609,
datetime(2020, 9, 28, 0, 0): 1714,
datetime(2020, 10, 5, 0, 0): 2849,
datetime(2020, 10, 12, 0, 0): 1425,
datetime(2020, 10, 19, 0, 0): 569,
datetime(2020, 10, 26, 0, 0): 210,
datetime(2020, 11, 2, 0, 0): 331,
datetime(2020, 11, 9, 0, 0): 229,
datetime(2020, 11, 16, 0, 0): 162,
datetime(2020, 11, 23, 0, 0): 164,
datetime(2020, 11, 30, 0, 0): 102,
datetime(2020, 12, 7, 0, 0): 75,
datetime(2020, 12, 14, 0, 0): 55,
datetime(2020, 12, 21, 0, 0): 150,
datetime(2020, 12, 28, 0, 0): 11,
}
| 35.551724 | 39 | 0.532978 | 375 | 2,062 | 2.930667 | 0.229333 | 0.096451 | 0.059145 | 0.021838 | 0.061874 | 0 | 0 | 0 | 0 | 0 | 0 | 0.425574 | 0.260427 | 2,062 | 57 | 40 | 36.175439 | 0.295082 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.017857 | 0 | 0.017857 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3d5a3b5d8a7ee8e5a8d60b3408e8aa8d46c512c1 | 346 | py | Python | {{cookiecutter.app_name}}/search_indexes.py | rickydunlop/cookiecutter-django-app-template-drf-haystack | 8ea9034c371950628b3d312639964753899c8c5d | [
"MIT"
] | null | null | null | {{cookiecutter.app_name}}/search_indexes.py | rickydunlop/cookiecutter-django-app-template-drf-haystack | 8ea9034c371950628b3d312639964753899c8c5d | [
"MIT"
] | null | null | null | {{cookiecutter.app_name}}/search_indexes.py | rickydunlop/cookiecutter-django-app-template-drf-haystack | 8ea9034c371950628b3d312639964753899c8c5d | [
"MIT"
] | null | null | null | from haystack import indexes
from .models import {{ cookiecutter.model_name }}
class {{ cookiecutter.model_name }}Index(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
name = indexes.CharField(model_attr='name')
def get_model(self):
return {{ cookiecutter.model_name }}
| 28.833333 | 81 | 0.736994 | 41 | 346 | 6.073171 | 0.560976 | 0.204819 | 0.253012 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.150289 | 346 | 11 | 82 | 31.454545 | 0.846939 | 0 | 0 | 0 | 0 | 0 | 0.011561 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.285714 | null | null | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e9eda2a3fc73ffe30b97e1cd86e60cd02bdf72a7 | 1,402 | py | Python | bigflow_python/python/bigflow/pipeline/test/testdata/columns/columns/column_sum.py | advancedxy/bigflow_python | 8a244b483404fde7afc42eee98bc964da8ae03e2 | [
"Apache-2.0"
] | 1,236 | 2017-11-14T11:10:10.000Z | 2022-03-08T11:54:41.000Z | bigflow_python/python/bigflow/pipeline/test/testdata/columns/columns/column_sum.py | advancedxy/bigflow_python | 8a244b483404fde7afc42eee98bc964da8ae03e2 | [
"Apache-2.0"
] | 38 | 2017-11-14T16:29:12.000Z | 2020-01-23T08:32:04.000Z | bigflow_python/python/bigflow/pipeline/test/testdata/columns/columns/column_sum.py | advancedxy/bigflow_python | 8a244b483404fde7afc42eee98bc964da8ae03e2 | [
"Apache-2.0"
] | 184 | 2017-11-27T07:23:36.000Z | 2022-03-14T02:54:16.000Z | #!/usr/bin/env python
# encoding: utf-8
########################################################################
#
# Copyright (c) 2016 Baidu, Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
########################################################################
from bigflow import transforms
def column_sum(pcollection, columns):
"""
对输入的PCollection,求所有元素按指定列相加的结果
Args:
pcollection (PCollection): 输入PCollection
columns(list):要计算的列
Returns:
PObject: 聚合结果
>>> import columns
>>> _p = _pipeline.parallelize([(1, 1, 1), (1, 2, 2), (1, 3, 1)])
>>> columns.column_sum(_p, [0, 1]).get()
[3, 6]
"""
cols = columns
def _get_columns(record):
return [record[column] for column in cols]
return pcollection.map(_get_columns) \
.reduce(lambda x, y: [a + b for a, b in zip(x, y)])
| 28.04 | 74 | 0.597004 | 176 | 1,402 | 4.704545 | 0.619318 | 0.072464 | 0.031401 | 0.038647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019713 | 0.203994 | 1,402 | 49 | 75 | 28.612245 | 0.722222 | 0.624108 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0.142857 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
e9f29e0f95ccd2b1945aff6967594472289887d8 | 21,120 | py | Python | build/lib/mrgaze/pupilometry.py | jmtyszka/mrgaze | 29217eab9ea431686fd200f08bddd6615c45d0d3 | [
"MIT"
] | 18 | 2016-01-22T02:47:45.000Z | 2021-09-23T18:37:51.000Z | build/lib/mrgaze/pupilometry.py | jmtyszka/mrgaze | 29217eab9ea431686fd200f08bddd6615c45d0d3 | [
"MIT"
] | 7 | 2015-05-26T21:33:16.000Z | 2020-05-26T11:47:54.000Z | build/lib/mrgaze/pupilometry.py | jmtyszka/mrgaze | 29217eab9ea431686fd200f08bddd6615c45d0d3 | [
"MIT"
] | 7 | 2016-02-06T00:17:52.000Z | 2021-02-22T03:51:55.000Z | #!/usr/bin/env python
#
# Video pupilometry functions
# - takes calibration and gaze video filenames as input
# - controls calibration and gaze estimation workflow
#
# USAGE : mrgaze.py <Calibration Video> <Gaze Video>
#
# AUTHOR : Mike Tyszka
# PLACE : Caltech
# DATES : 2014-05-07 JMT From scratch
# 2016-02-22 JMT Update print for python3. Remove unused vars, imports
#
# This file is part of mrgaze.
#
# mrgaze is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# mrgaze is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with mrgaze. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright 2014 California Institute of Technology.
import os
import time
import getpass
import cv2
from mrgaze import media, utils, config, calibrate, report, engine
def LivePupilometry(data_dir, live_eyetracking=False):
"""
Perform pupil boundary ellipse fitting on camera feed
Arguments
----
data_dir : string
Root data directory path.
cfg :
Analysis configuration parameters
Returns
----
pupils : boolean
Completion status (True = successful)
"""
# If user did not provide a root data directory, we use HOME/mrgaze
if data_dir == '':
data_dir = os.path.join(os.getenv("HOME"), 'mrgaze')
# Full video file paths
hostname = os.uname()[1]
username = getpass.getuser()
ss_dir = os.path.join(data_dir, "%s_%s_%s" % (hostname, username, int(time.time())))
else:
ss_dir = data_dir
# Load Configuration
cfg = config.LoadConfig(data_dir)
cfg_ts = time.time()
# Output flags
verbose = cfg.getboolean('OUTPUT', 'verbose')
overwrite = cfg.getboolean('OUTPUT', 'overwrite')
# Video information
# vin_ext = cfg.get('VIDEO', 'inputextension')
vout_ext = cfg.get('VIDEO' ,'outputextension')
# vin_fps = cfg.getfloat('VIDEO', 'inputfps')
# Flag for freeze frame
freeze_frame = False
vid_dir = os.path.join(ss_dir, 'videos')
res_dir = os.path.join(ss_dir, 'results')
vout_path = os.path.join(vid_dir, 'gaze' + vout_ext)
cal_vout_path = os.path.join(vid_dir, 'cal' + vout_ext)
# if we do live eye-tracking, we read in what would be the output of the live eye-tracking
if not live_eyetracking:
vin_path = vout_path
cal_vin_path = cal_vout_path
else:
vin_path = 0
# Raw and filtered pupilometry CSV file paths
cal_pupils_csv = os.path.join(res_dir, 'cal_pupils.csv')
pupils_csv = os.path.join(res_dir, 'gaze_pupils.csv')
# Check that output directory exists
if not os.path.isdir(res_dir):
os.makedirs(res_dir)
print('* %s does not exist - creating' % res_dir)
if not os.path.isdir(vid_dir):
os.makedirs(vid_dir)
print('* %s does not exist - creating' % vid_dir)
# Set up the LBP cascade classifier
LBP_path = os.path.join(utils._package_root(), 'Cascade/cascade.xml')
print(' Loading LBP cascade')
cascade = cv2.CascadeClassifier(LBP_path)
if cascade.empty():
print('* LBP cascade is empty - mrgaze installation problem')
return False
# Check for output CSV existance and overwrite flag
if os.path.isfile(pupils_csv):
print('+ Pupilometry output already exists - checking overwrite flag')
if overwrite:
print('+ Overwrite allowed - continuing')
else:
print('+ Overwrite forbidden - skipping pupilometry')
return True
#
# Camera Input
#
print(' Opening camera stream')
try:
if not live_eyetracking:
vin_stream = cv2.VideoCapture(vin_path)
cal_vin_stream = cv2.VideoCapture(cal_vin_path)
else:
vin_stream = cv2.VideoCapture(vin_path)
cal_vin_stream = vin_stream
except:
print('* Problem opening input video stream - skipping pupilometry')
return False
while not vin_stream.isOpened():
print("Waiting for Camera.")
key = utils._waitKey(500)
if key == 'ESC':
print("User Abort.")
break
if not vin_stream.isOpened():
print('* Video input stream not opened - skipping pupilometry')
return False
if not cal_vin_stream.isOpened():
print('* Calibration video input stream not opened - skipping pupilometry')
return False
# Video FPS from metadata
# TODO: may not work with Quicktime videos
# fps = vin_stream.get(cv2.cv.CV_CAP_PROP_FPS)
# fps = cfg.getfloat('CAMERA', 'fps')
# Desired time between frames in milliseconds
# time_bw_frames = 1000.0 / fps
vin_stream.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, 320)
vin_stream.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, 240)
vin_stream.set(cv2.cv.CV_CAP_PROP_FPS, 30)
# Total number of frames in video file
# nf = vin_stream.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT)
# print(' Video has %d frames at %0.3f fps' % (nf, vin_fps))
# Read first preprocessed video frame from stream
keep_going, frame_orig = media.LoadVideoFrame(vin_stream, cfg)
if keep_going:
frame, art_power = media.Preproc(frame_orig, cfg)
else:
art_power = 0.0
# Get size of preprocessed frame for output video setup
nx, ny = frame.shape[1], frame.shape[0]
# By default we start in non-calibration mode
# switch between gaze/cal modes by pressing key "c"
do_cal = False
while keep_going:
if do_cal == False:
#
# Output video
#
if live_eyetracking:
print(' Opening output video stream')
# Output video codec (MP4V - poor quality compression)
# TODO : Find a better multiplatform codec
fourcc = cv2.cv.CV_FOURCC('m','p','4','v')
try:
vout_stream = cv2.VideoWriter(vout_path, fourcc, 30, (nx, ny), True)
except:
print('* Problem creating output video stream - skipping pupilometry')
return False
if not vout_stream.isOpened():
print('* Output video not opened - skipping pupilometry')
return False
# Open pupilometry CSV file to write
try:
pupils_stream = open(pupils_csv, 'w')
except:
print('* Problem opening pupilometry CSV file - skipping pupilometry')
return False
#
# Main Video Frame Loop
#
# Print verbose column headers
if verbose:
print('')
print(' %10s %10s %10s %10s %10s' % (
'Time (s)', 'Area', 'Blink', 'Artifact', 'FPS'))
# Init frame counter
fc = 0
# Init processing timer
t0 = time.time()
t = t0
while keep_going:
# check whether config file has been updated, reload of that is the case
if fc % 30 == 0:
cfg_mtime = os.path.getmtime(os.path.join(data_dir, 'mrgaze.cfg'))
if cfg_mtime > cfg_ts:
print("Updating Configuration")
cfg = config.LoadConfig(data_dir)
cfg_ts = time.time()
# Current video time in seconds
t = time.time()
# -------------------------------------
# Pass this frame to pupilometry engine
# -------------------------------------
# b4_engine = time.time()
pupil_ellipse, roi_rect, blink, glint, frame_rgb = engine.PupilometryEngine(frame, cascade, cfg)
# print "Enging took %s ms" % (time.time() - b4_engine)
# Derive pupilometry parameters
px, py, area = engine.PupilometryPars(pupil_ellipse, glint, cfg)
# Write data line to pupilometry CSV file
pupils_stream.write(
'%0.4f,%0.3f,%0.3f,%0.3f,%d,%0.3f,\n' %
(t, area, px, py, blink, art_power)
)
if live_eyetracking:
# Write output video frame
vout_stream.write(frame_orig)
# Read next frame, unless we want to figure out the correct settings for this frame
if not freeze_frame:
keep_going, frame_orig = media.LoadVideoFrame(vin_stream, cfg)
if keep_going:
frame, art_power = media.Preproc(frame_orig, cfg)
else:
art_power = 0.0
# Increment frame counter
fc = fc + 1
# Report processing FPS
if verbose:
if fc % 100 == 0:
pfps = fc / (time.time() - t0)
print(' %10.1f %10.1f %10d %10.3f %10.1f' % (
t, area, blink, art_power, pfps))
t0 = time.time()
fc = 0
# wait whether user pressed esc to exit the experiment
key = utils._waitKey(1)
if key == 'ESC':
# Clean up
if live_eyetracking:
vout_stream.release()
pupils_stream.close()
keep_going = False
elif key == 'c':
# Clean up
if live_eyetracking:
vout_stream.release()
pupils_stream.close()
do_cal = True
print("Starting calibration.")
break
elif key == 'f':
freeze_frame = not freeze_frame
else: # do calibration
#
# Output video
#
if live_eyetracking:
print(' Opening output video stream')
# Output video codec (MP4V - poor quality compression)
# TODO : Find a better multiplatform codec
fourcc = cv2.cv.CV_FOURCC('m','p','4','v')
try:
cal_vout_stream = cv2.VideoWriter(cal_vout_path, fourcc, 30, (nx, ny), True)
except:
print('* Problem creating output video stream - skipping pupilometry')
return False
if not cal_vout_stream.isOpened():
print('* Output video not opened - skipping pupilometry')
return False
# Open pupilometry CSV file to write
try:
cal_pupils_stream = open(cal_pupils_csv, 'w')
except:
print('* Problem opening pupilometry CSV file - skipping pupilometry')
return False
#
# Main Video Frame Loop
#
# Print verbose column headers
if verbose:
print('')
print(' %10s %10s %10s %10s %10s' % (
'Time (s)', 'Area', 'Blink', 'Artifact', 'FPS'))
# Init frame counter
fc = 0
# Init processing timer
t0 = time.time()
t = t0
while keep_going:
# check whether config file has been updated, reload of that is the case
if fc % 30 == 0:
cfg_mtime = os.path.getmtime(os.path.join(data_dir, 'mrgaze.cfg'))
if cfg_mtime > cfg_ts:
print("Updating Configuration")
cfg = config.LoadConfig(data_dir)
cfg_ts = time.time()
# Current video time in seconds
t = time.time()
# -------------------------------------
# Pass this frame to pupilometry engine
# -------------------------------------
# b4_engine = time.time()
pupil_ellipse, roi_rect, blink, glint, frame_rgb = engine.PupilometryEngine(frame, cascade, cfg)
# print "Engine took %s ms" % (time.time() - b4_engine)
# Derive pupilometry parameters
px, py, area = engine.PupilometryPars(pupil_ellipse, glint, cfg)
# Write data line to pupilometry CSV file
cal_pupils_stream.write(
'%0.4f,%0.3f,%0.3f,%0.3f,%d,%0.3f,\n' %
(t, area, px, py, blink, art_power)
)
# Write output video frame
if live_eyetracking:
cal_vout_stream.write(frame_orig)
# Read next frame (if available)
# if verbose:
# b4_frame = time.time()
keep_going, frame_orig = media.LoadVideoFrame(vin_stream, cfg)
if keep_going:
frame, art_power = media.Preproc(frame_orig, cfg)
else:
art_power = 0.0
#if verbose:
# print "Time to load frame: %s" % (time.time() - b4_frame)
# Increment frame counter
fc = fc + 1
# Report processing FPS
if verbose:
if fc % 100 == 0:
pfps = fc / (time.time() - t0)
print(' %10.1f %10.1f %10d %10.3f %10.1f' % (
t, area, blink, art_power, pfps))
t0 = time.time()
fc = 0
# wait whether user pressed esc to exit the experiment
key = utils._waitKey(1)
if key == 'ESC':
keep_going = False
# Clean up
if live_eyetracking:
cal_vout_stream.release()
cal_pupils_stream.close()
elif key == 'v' or not keep_going:
do_cal = False
print("Stopping calibration.")
# Clean up
if live_eyetracking:
cal_vout_stream.release()
cal_pupils_stream.close()
break
print(' Create calibration model')
C, central_fix = calibrate.AutoCalibrate(res_dir, cfg)
if not C.any():
print('* Empty calibration matrix detected - skipping')
try:
print(' Calibrate pupilometry')
calibrate.ApplyCalibration(ss_dir, C, central_fix, cfg)
except UnboundLocalError:
print(' No calibration data found')
cv2.destroyAllWindows()
vin_stream.release()
print('')
print(' Generate Report')
print(' ---------------')
report.WriteReport(ss_dir, cfg)
# Return pupilometry timeseries
return t, px, py, area, blink, art_power
def VideoPupilometry(data_dir, subj_sess, v_stub, cfg):
"""
Perform pupil boundary ellipse fitting on entire video
Arguments
----
data_dir : string
Root data directory path.
subj_sess : string
Subject/Session name used for subdirectory within data_dir
v_stub : string
Video filename stub, eg 'cal' or 'gaze'
cfg :
Analysis configuration parameters
Returns
----
pupils : boolean
Completion status (True = successful)
"""
# Output flags
verbose = cfg.getboolean('OUTPUT', 'verbose')
overwrite = cfg.getboolean('OUTPUT','overwrite')
# Video information
vin_ext = cfg.get('VIDEO', 'inputextension')
vout_ext = cfg.get('VIDEO' ,'outputextension')
vin_fps = cfg.getfloat('VIDEO', 'inputfps')
# Full video file paths
ss_dir = os.path.join(data_dir, subj_sess)
vid_dir = os.path.join(ss_dir, 'videos')
res_dir = os.path.join(ss_dir, 'results')
vin_path = os.path.join(vid_dir, v_stub + vin_ext)
vout_path = os.path.join(res_dir, v_stub + '_pupils' + vout_ext)
# Raw and filtered pupilometry CSV file paths
pupils_csv = os.path.join(res_dir, v_stub + '_pupils.csv')
# Check that input video file exists
if not os.path.isfile(vin_path):
print('* %s does not exist - returning' % vin_path)
return False
# Set up the LBP cascade classifier
LBP_path = os.path.join(utils._package_root(), 'Cascade/cascade.xml')
print(' Loading LBP cascade')
cascade = cv2.CascadeClassifier(LBP_path)
if cascade.empty():
print('* LBP cascade is empty - mrgaze installation problem')
return False
# Check for output CSV existance and overwrite flag
if os.path.isfile(pupils_csv):
print('+ Pupilometry output already exists - checking overwrite flag')
if overwrite:
print('+ Overwrite allowed - continuing')
else:
print('+ Overwrite forbidden - skipping pupilometry')
return True
#
# Input video
#
print(' Opening input video stream')
try:
vin_stream = cv2.VideoCapture(vin_path)
except:
print('* Problem opening input video stream - skipping pupilometry')
return False
if not vin_stream.isOpened():
print('* Video input stream not opened - skipping pupilometry')
return False
# Video FPS from metadata
# TODO: may not work with Quicktime videos
# fps = vin_stream.get(cv2.cv.CV_CAP_PROP_FPS)
# Total number of frames in video file
nf = vin_stream.get(cv2.CAP_PROP_FRAME_COUNT)
print(' Video has %d frames at %0.3f fps' % (nf, vin_fps))
# Read first preprocessed video frame from stream
keep_going, frame_orig = media.LoadVideoFrame(vin_stream, cfg)
if keep_going:
frame, art_power = media.Preproc(frame_orig, cfg)
else:
art_power = 0.0
# Get size of preprocessed frame for output video setup
nx, ny = frame.shape[1], frame.shape[0]
#
# Output video
#
print(' Opening output video stream')
# Output video codec (MP4V - poor quality compression)
fourcc = cv2.VideoWriter_fourcc('m','p','4','v')
try:
vout_stream = cv2.VideoWriter(vout_path, fourcc, 30, (nx, ny), True)
except:
print('* Problem creating output video stream - skipping pupilometry')
return False
if not vout_stream.isOpened():
print('* Output video not opened - skipping pupilometry')
return False
# Open pupilometry CSV file to write
try:
pupils_stream = open(pupils_csv, 'w')
except:
print('* Problem opening pupilometry CSV file - skipping pupilometry')
return False
#
# Main Video Frame Loop
#
# Print verbose column headers
if verbose:
print('')
print(' %10s %10s %10s %10s %10s %10s' % (
'Time (s)', '% Done', 'Area', 'Blink', 'Artifact', 'FPS'))
# Init frame counter
fc = 0
# Init processing timer
t0 = time.time()
while keep_going:
# Current video time in seconds
t = fc / vin_fps
# -------------------------------------
# Pass this frame to pupilometry engine
# -------------------------------------
pupil_ellipse, roi_rect, blink, glint, frame_rgb = engine.PupilometryEngine(frame, cascade, cfg)
# Derive pupilometry parameters
px, py, area = engine.PupilometryPars(pupil_ellipse, glint, cfg)
# Write data line to pupilometry CSV file
pupils_stream.write(
'%0.3f,%0.3f,%0.3f,%0.3f,%d,%0.3f,\n' %
(t, area, px, py, blink, art_power)
)
# Write output video frame
vout_stream.write(frame_rgb)
# Read next frame (if available)
keep_going, frame_orig = media.LoadVideoFrame(vin_stream, cfg)
if keep_going:
frame, art_power = media.Preproc(frame_orig, cfg)
else:
art_power = 0.0
# Increment frame counter
fc = fc + 1
# Report processing FPS
if verbose:
if fc % 100 == 0:
perc_done = fc / float(nf) * 100.0
pfps = fc / (time.time() - t0)
print(' %10.1f %10.1f %10.1f %10d %10.3f %10.1f' % (
t, perc_done, area, blink, art_power, pfps))
# Clean up
cv2.destroyAllWindows()
vin_stream.release()
vout_stream.release()
pupils_stream.close()
# Return pupilometry timeseries
return t, px, py, area, blink, art_power
| 33.051643 | 112 | 0.550284 | 2,426 | 21,120 | 4.666529 | 0.170651 | 0.01325 | 0.0159 | 0.037099 | 0.74852 | 0.721756 | 0.69561 | 0.668934 | 0.643759 | 0.630686 | 0 | 0.018007 | 0.350521 | 21,120 | 638 | 113 | 33.103448 | 0.807319 | 0.261364 | 0 | 0.730061 | 0 | 0.01227 | 0.1603 | 0.006856 | 0 | 0 | 0 | 0.003135 | 0 | 1 | 0.006135 | false | 0.006135 | 0.015337 | 0 | 0.08589 | 0.168712 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
18070effada07af1c287eb2501ebc5c7848149ff | 2,499 | py | Python | __init__.py | kotn3l/blender-flver | 3476d720337a6d7a28bd55f9b112524c0f61581d | [
"MIT"
] | 11 | 2020-04-28T03:21:13.000Z | 2022-03-23T13:18:33.000Z | __init__.py | kotn3l/blender-flver | 3476d720337a6d7a28bd55f9b112524c0f61581d | [
"MIT"
] | 2 | 2021-06-28T07:44:42.000Z | 2022-03-18T00:47:42.000Z | __init__.py | elizagamedev/blender-flver | 25cc152de19acb4028035d3ed389706df25e094a | [
"MIT"
] | 2 | 2021-12-23T13:31:57.000Z | 2022-03-16T06:30:13.000Z | bl_info = {
"name": "Import Fromsoft FLVER models",
"description":
"Import models from various Fromsoft games such as Dark Souls",
"author": "Eliza Velasquez",
"version": (0, 1, 0),
"blender": (2, 80, 0),
"category": "Import-Export",
"location": "File > Import",
"warning": "",
"support": "COMMUNITY",
"wiki_url": "", # TODO: wiki url
"tracker_url": "", # TODO: tracker url
}
_submodules = {
"importer",
"flver",
"reader",
}
# Reload submodules on addon reload
if "bpy" in locals():
import importlib
for submodule in _submodules:
if submodule in locals():
importlib.reload(locals()[submodule])
import bpy
from . import importer
from bpy_extras.io_utils import ImportHelper
from bpy.props import StringProperty, BoolProperty
class FlverImporter(bpy.types.Operator, ImportHelper):
bl_idname = "import_scene.flver"
bl_label = "Fromsoft (.flver)"
filter_glob = StringProperty(default="*.flver", options={"HIDDEN"})
transpose_y_and_z = BoolProperty(
name="Transpose Y and Z axes",
description=("This will correct the orientation of the model. " +
"Rarely necessary to disable."),
default=True)
import_skeleton = BoolProperty(
name="Import skeleton",
description=("Disable to prevent the creation of an Armature " +
"and corresponding vertex groups."),
default=True)
connect_bones = BoolProperty(
name="Connect bones",
description=(
"Disable to import disjointed bones rotated about their " +
"original Euler angles. This may be potentially desireable "
"for authoring derivative FLVER files."),
default=True)
def execute(self, context):
importer.run(context=context,
path=self.filepath,
transpose_y_and_z=self.transpose_y_and_z,
import_skeleton=self.import_skeleton,
connect_bones=self.connect_bones)
return {"FINISHED"}
def menu_import(self, context):
self.layout.operator(FlverImporter.bl_idname)
def register():
bpy.utils.register_class(FlverImporter)
bpy.types.TOPBAR_MT_file_import.append(menu_import)
def unregister():
bpy.types.TOPBAR_MT_file_import.remove(menu_import)
bpy.utils.unregister_class(FlverImporter)
| 30.47561 | 74 | 0.620648 | 267 | 2,499 | 5.666667 | 0.468165 | 0.026438 | 0.034369 | 0.037013 | 0.034369 | 0.034369 | 0 | 0 | 0 | 0 | 0 | 0.003872 | 0.276511 | 2,499 | 81 | 75 | 30.851852 | 0.832965 | 0.026411 | 0 | 0.046875 | 0 | 0 | 0.278961 | 0 | 0 | 0 | 0 | 0.012346 | 0 | 1 | 0.0625 | false | 0 | 0.375 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
181dd4525734f8cc34fa28f835971bb355463f95 | 516 | py | Python | src/removeElement.py | ianxin/algorithm | 22214b6c81bee926f5a1c74c9417b2e7edd3ceed | [
"MIT"
] | 2 | 2018-03-13T08:59:14.000Z | 2018-03-13T08:59:25.000Z | src/removeElement.py | ianxin/Algorithm | 22214b6c81bee926f5a1c74c9417b2e7edd3ceed | [
"MIT"
] | null | null | null | src/removeElement.py | ianxin/Algorithm | 22214b6c81bee926f5a1c74c9417b2e7edd3ceed | [
"MIT"
] | null | null | null | """
@param: A: A list of integers
@param: elem: An integer
@return: The new length after remove
"""
#倒序遍历list
def removeElement(self, A, elem):
# write your code here
for i in range(len(A)-1,-1,-1):
if A[i] == elem:
A.pop(i)
return len(A)
#遍历拷贝的list ,操作原始list
def removeElement(self, A, elem):
# write your code here
for i in A[:]:
if i == elem:
A.remove(i)
return len(A)
| 23.454545 | 40 | 0.484496 | 69 | 516 | 3.623188 | 0.463768 | 0.048 | 0.16 | 0.168 | 0.384 | 0.384 | 0.384 | 0.384 | 0.384 | 0.384 | 0 | 0.009646 | 0.397287 | 516 | 21 | 41 | 24.571429 | 0.794212 | 0 | 0 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.047619 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1833d1d97b94601d7c7672bd7240b57d03e2cddf | 3,961 | py | Python | recsys/util/feature_helper.py | manazhao/tf_recsys | 6053712d11165c068e5d618989f716b2a0f60186 | [
"Apache-2.0"
] | 1 | 2019-04-20T15:05:37.000Z | 2019-04-20T15:05:37.000Z | recsys/util/feature_helper.py | manazhao/tf_recsys | 6053712d11165c068e5d618989f716b2a0f60186 | [
"Apache-2.0"
] | null | null | null | recsys/util/feature_helper.py | manazhao/tf_recsys | 6053712d11165c068e5d618989f716b2a0f60186 | [
"Apache-2.0"
] | null | null | null | import logging
import tensorflow as tf
import recsys.util.proto.config_pb2 as config
def int64_feature(val):
return tf.train.Feature(int64_list = tf.train.Int64List(value=[val]))
def int64_list_feature(val_list):
return tf.train.Feature(int64_list = tf.train.Int64List(value=val_list))
def bytes_feature(val):
return tf.train.Feature(bytes_list = tf.train.BytesList(value=[val]))
def bytes_list_feature(val_list):
return tf.train.Feature(bytes_list = tf.train.BytesList(value=val_list))
def float_feature(val):
return tf.train.Feature(float_list = tf.train.FloatList(value=[val]))
def float_list_feature(val_list):
return tf.train.Feature(float_list = tf.train.FloatList(value=val_list))
def string_feature(str):
return tf.train.Feature(bytes_list = tf.train.BytesList(value=[str.encode('utf-8')]))
def string_list_feature(str_list):
str_bytes_list = [k.encode('utf-8') for k in str_list]
return bytes_list_feature(str_bytes_list)
# Constructs a tf.Example with feature dictionary where key is feature name and
# value is tf.train.Feature
def example_from_feature_dict(feature_dict):
return tf.train.Example(features = tf.train.Features(feature = feature_dict))
def get_int64_feature(example, feature_name):
return example.features.feature[feature_name].int64_list.value[0]
def get_int64_list_feature(example, feature_name):
return list(example.features.feature[feature_name].int64_list.value)
def get_float_feature(example, feature_name):
return example.features.feature[feature_name].float_list.value[0]
def get_float_list_feature(example, feature_name):
return list(example.features.feature[feature_name].float_list.value)
def get_bytes_feature(example, feature_name):
return example.features.feature[feature_name].bytes_list.value[0]
def get_bytes_list_feature(example, feature_name):
return example.features.feature[feature_name].bytes_list.value
def get_string_feature(example, feature_name):
return example.features.feature[feature_name].bytes_list.value[0].decode('utf-8')
def get_string_list_feature(example, feature_name):
return [s.decode('utf-8') for s in example.features.feature[feature_name].bytes_list.value]
# Reads batched features and labels from given files, and consumes them through
# callback function "consum_batch_fn".
# feature_spec: dictionary specifying the type of each feature.
# input_config: settings for generating batched features and labels.
# consume_batch_fn: callback function that defines the consumption of the
# batched features and labels.
def fetch_and_process_features(filenames, feature_spec, input_config, consume_batch_fn):
# Reads examples from the filenames and parse them into features.
def _read_and_decode(filename_queue, feature_spec, batch_size = 2, capacity = 30, num_threads = 2, min_after_dequeue = 10):
reader = tf.TFRecordReader()
_, serialized_example = reader.read(filename_queue)
features = tf.parse_single_example(
serialized_example, features = feature_spec)
batched_features = tf.train.shuffle_batch(features,
batch_size = batch_size,
capacity = capacity,
num_threads = num_threads,
min_after_dequeue = min_after_dequeue)
return batched_features
filename_queue = tf.train.string_input_producer(
filenames, num_epochs = input_config.num_epochs)
features = _read_and_decode(
filename_queue,
feature_spec,
batch_size = input_config.batch_size,
capacity = input_config.capacity,
num_threads = input_config.num_threads,
min_after_dequeue = input_config.min_after_dequeue
)
init_op = tf.group(tf.global_variables_initializer(),
tf.local_variables_initializer())
with tf.Session() as sess:
sess.run(init_op)
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(coord=coord)
for i in range(input_config.num_batches):
logging.info('current batch:{}'.format(i))
consume_batch_fn(sess, features)
coord.request_stop()
coord.join(threads) | 39.61 | 124 | 0.789447 | 582 | 3,961 | 5.099656 | 0.21134 | 0.049528 | 0.066712 | 0.067385 | 0.425876 | 0.402291 | 0.379043 | 0.379043 | 0.326146 | 0.295148 | 0 | 0.00996 | 0.11285 | 3,961 | 100 | 125 | 39.61 | 0.834661 | 0.129513 | 0 | 0 | 0 | 0 | 0.010468 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.267606 | false | 0 | 0.042254 | 0.225352 | 0.56338 | 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 | 1 | 0 | 0 | 3 |
1839ffd1101b5584269c5f29639d17cc7d6a6e7c | 194 | py | Python | Preprocessing/preprocessing.py | nadineazhalia/CSH4H3-TEXT-MINING | 77b2ffb862314d664f575757a40038cc69f86c60 | [
"Apache-2.0"
] | null | null | null | Preprocessing/preprocessing.py | nadineazhalia/CSH4H3-TEXT-MINING | 77b2ffb862314d664f575757a40038cc69f86c60 | [
"Apache-2.0"
] | null | null | null | Preprocessing/preprocessing.py | nadineazhalia/CSH4H3-TEXT-MINING | 77b2ffb862314d664f575757a40038cc69f86c60 | [
"Apache-2.0"
] | null | null | null | file_berita = open("berita.txt", "r")
berita = file_berita.read()
berita = berita.split()
berita = [x.lower() for x in berita]
berita = list(set(berita))
berita = sorted(berita)
print (berita) | 21.555556 | 37 | 0.695876 | 29 | 194 | 4.586207 | 0.517241 | 0.270677 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.134021 | 194 | 9 | 38 | 21.555556 | 0.791667 | 0 | 0 | 0 | 0 | 0 | 0.05641 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0 | 0 | null | 1 | 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 | 3 |
183d4dac8cfc4c8ac345fb08043e4248c6a0257b | 467 | py | Python | tests/integration/test_entry_point.py | jacksmith15/delfino | 38972e0e0e610c2694462306250a51537a04b1e9 | [
"MIT"
] | null | null | null | tests/integration/test_entry_point.py | jacksmith15/delfino | 38972e0e0e610c2694462306250a51537a04b1e9 | [
"MIT"
] | null | null | null | tests/integration/test_entry_point.py | jacksmith15/delfino | 38972e0e0e610c2694462306250a51537a04b1e9 | [
"MIT"
] | null | null | null | import toml
from delfino.constants import ENTRY_POINT, PYPROJECT_TOML_FILENAME
from delfino.models.pyproject_toml import PyprojectToml
from tests.constants import PROJECT_ROOT
class TestEntrypointConstant:
@staticmethod
def should_match_entrypoint_in_pyproject_toml():
file_path = PROJECT_ROOT / PYPROJECT_TOML_FILENAME
pyproject_toml = PyprojectToml(**toml.load(file_path))
assert ENTRY_POINT in pyproject_toml.tool.poetry.scripts
| 33.357143 | 66 | 0.807281 | 57 | 467 | 6.298246 | 0.508772 | 0.21727 | 0.116992 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.143469 | 467 | 13 | 67 | 35.923077 | 0.8975 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 1 | 0.1 | false | 0 | 0.4 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
184a025720245d69fec4505befed933cb56ea1a7 | 178 | py | Python | exercicio13.py | LuizHps18/infosatc-lp-avaliativo-01 | 0b891d74a98705182175a53e023b6cbbe8cc880a | [
"MIT"
] | null | null | null | exercicio13.py | LuizHps18/infosatc-lp-avaliativo-01 | 0b891d74a98705182175a53e023b6cbbe8cc880a | [
"MIT"
] | null | null | null | exercicio13.py | LuizHps18/infosatc-lp-avaliativo-01 | 0b891d74a98705182175a53e023b6cbbe8cc880a | [
"MIT"
] | null | null | null | k = float(input("Digite uma distância em quilometros: "))
m = k / 1.61
print("A distância digitada é de {} quilometros, essa distância convertida é {:.2f} milhas" .format(k,m)) | 35.6 | 105 | 0.696629 | 28 | 178 | 4.428571 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026667 | 0.157303 | 178 | 5 | 105 | 35.6 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0.670391 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
187614996f13120eae23f5d092c2a9efde0e80bf | 76,079 | py | Python | pyLMS7002Soapy/LMS7002_BIAS.py | Surfndez/pyLMS7002Soapy | ea230dcb12048007300477e1e2e4decc5414f954 | [
"Apache-2.0"
] | 46 | 2016-11-29T05:10:36.000Z | 2021-10-31T19:27:46.000Z | pyLMS7002M/LMS7002_BIAS.py | myriadrf/pyLMS7002M | b866deea1f05dba44c9ed1a1a4666352b811b66b | [
"Apache-2.0"
] | 2 | 2017-04-15T21:36:01.000Z | 2017-06-08T09:44:26.000Z | pyLMS7002Soapy/LMS7002_BIAS.py | Surfndez/pyLMS7002Soapy | ea230dcb12048007300477e1e2e4decc5414f954 | [
"Apache-2.0"
] | 16 | 2016-11-28T20:47:55.000Z | 2021-04-07T01:48:20.000Z | #***************************************************************
#* Name: LMS7002_BIAS.py
#* Purpose: Class implementing LMS7002 BIAS functions
#* Author: Lime Microsystems ()
#* Created: 2016-11-14
#* Copyright: Lime Microsystems (limemicro.com)
#* License:
#**************************************************************
from LMS7002_base import *
class LMS7002_BIAS(LMS7002_base):
__slots__ = ['allowLDO'] # Used to generate error on typos
def __init__(self, chip):
self.chip = chip
self.channel = None
self.prefix = "BIAS_"
self.allowLDO = False # Do not allow changing of LDO voltage
#
# BIAS_CFG (0x0084)
#
# MUX_BIAS_OUT<1:0>
@property
def MUX_BIAS_OUT(self):
"""
Get the value of MUX_BIAS_OUT<1:0>
"""
return self._readReg('CFG', 'MUX_BIAS_OUT<1:0>')
@MUX_BIAS_OUT.setter
def MUX_BIAS_OUT(self, value):
"""
Set the value of MUX_BIAS_OUT<1:0>
"""
if not(0 <= value <= 3):
raise ValueError("Value must be [0..3]")
self._writeReg('CFG', 'MUX_BIAS_OUT<1:0>', value)
# RP_CALIB_BIAS<4:0>
@property
def RP_CALIB_BIAS(self):
"""
Get the value of RP_CALIB_BIAS<4:0>
"""
return self._readReg('CFG', 'RP_CALIB_BIAS<4:0>')
@RP_CALIB_BIAS.setter
def RP_CALIB_BIAS(self, value):
"""
Set the value of RP_CALIB_BIAS<4:0>
"""
if not(0 <= value <= 31):
raise ValueError("Value must be [0..31]")
self._writeReg('CFG', 'RP_CALIB_BIAS<4:0>', value)
# PD_FRP_BIAS
@property
def PD_FRP_BIAS(self):
"""
Get the value of PD_FRP_BIAS
"""
return self._readReg('CFG', 'PD_FRP_BIAS')
@PD_FRP_BIAS.setter
def PD_FRP_BIAS(self, value):
"""
Set the value of PD_FRP_BIAS
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG', 'PD_FRP_BIAS', value)
# PD_F_BIAS
@property
def PD_F_BIAS(self):
"""
Get the value of PD_F_BIAS
"""
return self._readReg('CFG', 'PD_F_BIAS')
@PD_F_BIAS.setter
def PD_F_BIAS(self, value):
"""
Set the value of PD_F_BIAS
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG', 'PD_F_BIAS', value)
# PD_PTRP_BIAS
@property
def PD_PTRP_BIAS(self):
"""
Get the value of PD_PTRP_BIAS
"""
return self._readReg('CFG', 'PD_PTRP_BIAS')
@PD_PTRP_BIAS.setter
def PD_PTRP_BIAS(self, value):
"""
Set the value of PD_PTRP_BIAS
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG', 'PD_PTRP_BIAS', value)
# PD_PT_BIAS
@property
def PD_PT_BIAS(self):
"""
Get the value of PD_PT_BIAS
"""
return self._readReg('CFG', 'PD_PT_BIAS')
@PD_PT_BIAS.setter
def PD_PT_BIAS(self, value):
"""
Set the value of PD_PT_BIAS
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG', 'PD_PT_BIAS', value)
# PD_BIAS_MASTER
@property
def PD_BIAS_MASTER(self):
"""
Get the value of PD_BIAS_MASTER
"""
return self._readReg('CFG', 'PD_BIAS_MASTER')
@PD_BIAS_MASTER.setter
def PD_BIAS_MASTER(self, value):
"""
Set the value of PD_BIAS_MASTER
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG', 'PD_BIAS_MASTER', value)
#
# BIAS_CFG0 (0x0092)
#
# EN_LDO_DIG
@property
def EN_LDO_DIG(self):
"""
Get the value of EN_LDO_DIG
"""
return self._readReg('CFG0', 'EN_LDO_DIG')
@EN_LDO_DIG.setter
def EN_LDO_DIG(self, value):
"""
Set the value of EN_LDO_DIG
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_DIG', value)
# EN_LDO_DIGGN
@property
def EN_LDO_DIGGN(self):
"""
Get the value of EN_LDO_DIGGN
"""
return self._readReg('CFG0', 'EN_LDO_DIGGN')
@EN_LDO_DIGGN.setter
def EN_LDO_DIGGN(self, value):
"""
Set the value of EN_LDO_DIGGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_DIGGN', value)
# EN_LDO_DIGSXR
@property
def EN_LDO_DIGSXR(self):
"""
Get the value of EN_LDO_DIGSXR
"""
return self._readReg('CFG0', 'EN_LDO_DIGSXR')
@EN_LDO_DIGSXR.setter
def EN_LDO_DIGSXR(self, value):
"""
Set the value of EN_LDO_DIGSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_DIGSXR', value)
# EN_LDO_DIGSXT
@property
def EN_LDO_DIGSXT(self):
"""
Get the value of EN_LDO_DIGSXT
"""
return self._readReg('CFG0', 'EN_LDO_DIGSXT')
@EN_LDO_DIGSXT.setter
def EN_LDO_DIGSXT(self, value):
"""
Set the value of EN_LDO_DIGSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_DIGSXT', value)
# EN_LDO_DIVGN
@property
def EN_LDO_DIVGN(self):
"""
Get the value of EN_LDO_DIVGN
"""
return self._readReg('CFG0', 'EN_LDO_DIVGN')
@EN_LDO_DIVGN.setter
def EN_LDO_DIVGN(self, value):
"""
Set the value of EN_LDO_DIVGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_DIVGN', value)
# EN_LDO_DIVSXR
@property
def EN_LDO_DIVSXR(self):
"""
Get the value of EN_LDO_DIVSXR
"""
return self._readReg('CFG0', 'EN_LDO_DIVSXR')
@EN_LDO_DIVSXR.setter
def EN_LDO_DIVSXR(self, value):
"""
Set the value of EN_LDO_DIVSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_DIVSXR', value)
# EN_LDO_DIVSXT
@property
def EN_LDO_DIVSXT(self):
"""
Get the value of EN_LDO_DIVSXT
"""
return self._readReg('CFG0', 'EN_LDO_DIVSXT')
@EN_LDO_DIVSXT.setter
def EN_LDO_DIVSXT(self, value):
"""
Set the value of EN_LDO_DIVSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_DIVSXT', value)
# EN_LDO_LNA12
@property
def EN_LDO_LNA12(self):
"""
Get the value of EN_LDO_LNA12
"""
return self._readReg('CFG0', 'EN_LDO_LNA12')
@EN_LDO_LNA12.setter
def EN_LDO_LNA12(self, value):
"""
Set the value of EN_LDO_LNA12
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_LNA12', value)
# EN_LDO_LNA14
@property
def EN_LDO_LNA14(self):
"""
Get the value of EN_LDO_LNA14
"""
return self._readReg('CFG0', 'EN_LDO_LNA14')
@EN_LDO_LNA14.setter
def EN_LDO_LNA14(self, value):
"""
Set the value of EN_LDO_LNA14
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_LNA14', value)
# EN_LDO_MXRFE
@property
def EN_LDO_MXRFE(self):
"""
Get the value of EN_LDO_MXRFE
"""
return self._readReg('CFG0', 'EN_LDO_MXRFE')
@EN_LDO_MXRFE.setter
def EN_LDO_MXRFE(self, value):
"""
Set the value of EN_LDO_MXRFE
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_MXRFE', value)
# EN_LDO_RBB
@property
def EN_LDO_RBB(self):
"""
Get the value of EN_LDO_RBB
"""
return self._readReg('CFG0', 'EN_LDO_RBB')
@EN_LDO_RBB.setter
def EN_LDO_RBB(self, value):
"""
Set the value of EN_LDO_RBB
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_RBB', value)
# EN_LDO_RXBUF
@property
def EN_LDO_RXBUF(self):
"""
Get the value of EN_LDO_RXBUF
"""
return self._readReg('CFG0', 'EN_LDO_RXBUF')
@EN_LDO_RXBUF.setter
def EN_LDO_RXBUF(self, value):
"""
Set the value of EN_LDO_RXBUF
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_RXBUF', value)
# EN_LDO_TBB
@property
def EN_LDO_TBB(self):
"""
Get the value of EN_LDO_TBB
"""
return self._readReg('CFG0', 'EN_LDO_TBB')
@EN_LDO_TBB.setter
def EN_LDO_TBB(self, value):
"""
Set the value of EN_LDO_TBB
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_TBB', value)
# EN_LDO_TIA12
@property
def EN_LDO_TIA12(self):
"""
Get the value of EN_LDO_TIA12
"""
return self._readReg('CFG0', 'EN_LDO_TIA12')
@EN_LDO_TIA12.setter
def EN_LDO_TIA12(self, value):
"""
Set the value of EN_LDO_TIA12
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_TIA12', value)
# EN_LDO_TIA14
@property
def EN_LDO_TIA14(self):
"""
Get the value of EN_LDO_TIA14
"""
return self._readReg('CFG0', 'EN_LDO_TIA14')
@EN_LDO_TIA14.setter
def EN_LDO_TIA14(self, value):
"""
Set the value of EN_LDO_TIA14
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_LDO_TIA14', value)
# EN_G_LDO
@property
def EN_G_LDO(self):
"""
Get the value of EN_G_LDO
"""
return self._readReg('CFG0', 'EN_G_LDO')
@EN_G_LDO.setter
def EN_G_LDO(self, value):
"""
Set the value of EN_G_LDO
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG0', 'EN_G_LDO', value)
#
# BIAS_CFG1 (0x0093)
#
# EN_LOADIMP_LDO_TLOB
@property
def EN_LOADIMP_LDO_TLOB(self):
"""
Get the value of EN_LOADIMP_LDO_TLOB
"""
return self._readReg('CFG1', 'EN_LOADIMP_LDO_TLOB')
@EN_LOADIMP_LDO_TLOB.setter
def EN_LOADIMP_LDO_TLOB(self, value):
"""
Set the value of EN_LOADIMP_LDO_TLOB
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LOADIMP_LDO_TLOB', value)
# EN_LOADIMP_LDO_TPAD
@property
def EN_LOADIMP_LDO_TPAD(self):
"""
Get the value of EN_LOADIMP_LDO_TPAD
"""
return self._readReg('CFG1', 'EN_LOADIMP_LDO_TPAD')
@EN_LOADIMP_LDO_TPAD.setter
def EN_LOADIMP_LDO_TPAD(self, value):
"""
Set the value of EN_LOADIMP_LDO_TPAD
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LOADIMP_LDO_TPAD', value)
# EN_LOADIMP_LDO_TXBUF
@property
def EN_LOADIMP_LDO_TXBUF(self):
"""
Get the value of EN_LOADIMP_LDO_TXBUF
"""
return self._readReg('CFG1', 'EN_LOADIMP_LDO_TXBUF')
@EN_LOADIMP_LDO_TXBUF.setter
def EN_LOADIMP_LDO_TXBUF(self, value):
"""
Set the value of EN_LOADIMP_LDO_TXBUF
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LOADIMP_LDO_TXBUF', value)
# EN_LOADIMP_LDO_VCOGN
@property
def EN_LOADIMP_LDO_VCOGN(self):
"""
Get the value of EN_LOADIMP_LDO_VCOGN
"""
return self._readReg('CFG1', 'EN_LOADIMP_LDO_VCOGN')
@EN_LOADIMP_LDO_VCOGN.setter
def EN_LOADIMP_LDO_VCOGN(self, value):
"""
Set the value of EN_LOADIMP_LDO_VCOGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LOADIMP_LDO_VCOGN', value)
# EN_LOADIMP_LDO_VCOSXR
@property
def EN_LOADIMP_LDO_VCOSXR(self):
"""
Get the value of EN_LOADIMP_LDO_VCOSXR
"""
return self._readReg('CFG1', 'EN_LOADIMP_LDO_VCOSXR')
@EN_LOADIMP_LDO_VCOSXR.setter
def EN_LOADIMP_LDO_VCOSXR(self, value):
"""
Set the value of EN_LOADIMP_LDO_VCOSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LOADIMP_LDO_VCOSXR', value)
# EN_LOADIMP_LDO_VCOSXT
@property
def EN_LOADIMP_LDO_VCOSXT(self):
"""
Get the value of EN_LOADIMP_LDO_VCOSXT
"""
return self._readReg('CFG1', 'EN_LOADIMP_LDO_VCOSXT')
@EN_LOADIMP_LDO_VCOSXT.setter
def EN_LOADIMP_LDO_VCOSXT(self, value):
"""
Set the value of EN_LOADIMP_LDO_VCOSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LOADIMP_LDO_VCOSXT', value)
# EN_LDO_AFE
@property
def EN_LDO_AFE(self):
"""
Get the value of EN_LDO_AFE
"""
return self._readReg('CFG1', 'EN_LDO_AFE')
@EN_LDO_AFE.setter
def EN_LDO_AFE(self, value):
"""
Set the value of EN_LDO_AFE
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LDO_AFE', value)
# EN_LDO_CPGN
@property
def EN_LDO_CPGN(self):
"""
Get the value of EN_LDO_CPGN
"""
return self._readReg('CFG1', 'EN_LDO_CPGN')
@EN_LDO_CPGN.setter
def EN_LDO_CPGN(self, value):
"""
Set the value of EN_LDO_CPGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LDO_CPGN', value)
# EN_LDO_CPSXR
@property
def EN_LDO_CPSXR(self):
"""
Get the value of EN_LDO_CPSXR
"""
return self._readReg('CFG1', 'EN_LDO_CPSXR')
@EN_LDO_CPSXR.setter
def EN_LDO_CPSXR(self, value):
"""
Set the value of EN_LDO_CPSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LDO_CPSXR', value)
# EN_LDO_TLOB
@property
def EN_LDO_TLOB(self):
"""
Get the value of EN_LDO_TLOB
"""
return self._readReg('CFG1', 'EN_LDO_TLOB')
@EN_LDO_TLOB.setter
def EN_LDO_TLOB(self, value):
"""
Set the value of EN_LDO_TLOB
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LDO_TLOB', value)
# EN_LDO_TPAD
@property
def EN_LDO_TPAD(self):
"""
Get the value of EN_LDO_TPAD
"""
return self._readReg('CFG1', 'EN_LDO_TPAD')
@EN_LDO_TPAD.setter
def EN_LDO_TPAD(self, value):
"""
Set the value of EN_LDO_TPAD
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LDO_TPAD', value)
# EN_LDO_TXBUF
@property
def EN_LDO_TXBUF(self):
"""
Get the value of EN_LDO_TXBUF
"""
return self._readReg('CFG1', 'EN_LDO_TXBUF')
@EN_LDO_TXBUF.setter
def EN_LDO_TXBUF(self, value):
"""
Set the value of EN_LDO_TXBUF
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LDO_TXBUF', value)
# EN_LDO_VCOGN
@property
def EN_LDO_VCOGN(self):
"""
Get the value of EN_LDO_VCOGN
"""
return self._readReg('CFG1', 'EN_LDO_VCOGN')
@EN_LDO_VCOGN.setter
def EN_LDO_VCOGN(self, value):
"""
Set the value of EN_LDO_VCOGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LDO_VCOGN', value)
# EN_LDO_VCOSXR
@property
def EN_LDO_VCOSXR(self):
"""
Get the value of EN_LDO_VCOSXR
"""
return self._readReg('CFG1', 'EN_LDO_VCOSXR')
@EN_LDO_VCOSXR.setter
def EN_LDO_VCOSXR(self, value):
"""
Set the value of EN_LDO_VCOSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LDO_VCOSXR', value)
# EN_LDO_VCOSXT
@property
def EN_LDO_VCOSXT(self):
"""
Get the value of EN_LDO_VCOSXT
"""
return self._readReg('CFG1', 'EN_LDO_VCOSXT')
@EN_LDO_VCOSXT.setter
def EN_LDO_VCOSXT(self, value):
"""
Set the value of EN_LDO_VCOSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LDO_VCOSXT', value)
# EN_LDO_CPSXT
@property
def EN_LDO_CPSXT(self):
"""
Get the value of EN_LDO_CPSXT
"""
return self._readReg('CFG1', 'EN_LDO_CPSXT')
@EN_LDO_CPSXT.setter
def EN_LDO_CPSXT(self, value):
"""
Set the value of EN_LDO_CPSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG1', 'EN_LDO_CPSXT', value)
#
# BIAS_CFG2 (0x0094)
#
# EN_LOADIMP_LDO_CPSXT
@property
def EN_LOADIMP_LDO_CPSXT(self):
"""
Get the value of EN_LOADIMP_LDO_CPSXT
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_CPSXT')
@EN_LOADIMP_LDO_CPSXT.setter
def EN_LOADIMP_LDO_CPSXT(self, value):
"""
Set the value of EN_LOADIMP_LDO_CPSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_CPSXT', value)
# EN_LOADIMP_LDO_DIG
@property
def EN_LOADIMP_LDO_DIG(self):
"""
Get the value of EN_LOADIMP_LDO_DIG
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_DIG')
@EN_LOADIMP_LDO_DIG.setter
def EN_LOADIMP_LDO_DIG(self, value):
"""
Set the value of EN_LOADIMP_LDO_DIG
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_DIG', value)
# EN_LOADIMP_LDO_DIGGN
@property
def EN_LOADIMP_LDO_DIGGN(self):
"""
Get the value of EN_LOADIMP_LDO_DIGGN
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_DIGGN')
@EN_LOADIMP_LDO_DIGGN.setter
def EN_LOADIMP_LDO_DIGGN(self, value):
"""
Set the value of EN_LOADIMP_LDO_DIGGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_DIGGN', value)
# EN_LOADIMP_LDO_DIGSXR
@property
def EN_LOADIMP_LDO_DIGSXR(self):
"""
Get the value of EN_LOADIMP_LDO_DIGSXR
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_DIGSXR')
@EN_LOADIMP_LDO_DIGSXR.setter
def EN_LOADIMP_LDO_DIGSXR(self, value):
"""
Set the value of EN_LOADIMP_LDO_DIGSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_DIGSXR', value)
# EN_LOADIMP_LDO_DIGSXT
@property
def EN_LOADIMP_LDO_DIGSXT(self):
"""
Get the value of EN_LOADIMP_LDO_DIGSXT
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_DIGSXT')
@EN_LOADIMP_LDO_DIGSXT.setter
def EN_LOADIMP_LDO_DIGSXT(self, value):
"""
Set the value of EN_LOADIMP_LDO_DIGSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_DIGSXT', value)
# EN_LOADIMP_LDO_DIVGN
@property
def EN_LOADIMP_LDO_DIVGN(self):
"""
Get the value of EN_LOADIMP_LDO_DIVGN
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_DIVGN')
@EN_LOADIMP_LDO_DIVGN.setter
def EN_LOADIMP_LDO_DIVGN(self, value):
"""
Set the value of EN_LOADIMP_LDO_DIVGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_DIVGN', value)
# EN_LOADIMP_LDO_DIVSXR
@property
def EN_LOADIMP_LDO_DIVSXR(self):
"""
Get the value of EN_LOADIMP_LDO_DIVSXR
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_DIVSXR')
@EN_LOADIMP_LDO_DIVSXR.setter
def EN_LOADIMP_LDO_DIVSXR(self, value):
"""
Set the value of EN_LOADIMP_LDO_DIVSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_DIVSXR', value)
# EN_LOADIMP_LDO_DIVSXT
@property
def EN_LOADIMP_LDO_DIVSXT(self):
"""
Get the value of EN_LOADIMP_LDO_DIVSXT
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_DIVSXT')
@EN_LOADIMP_LDO_DIVSXT.setter
def EN_LOADIMP_LDO_DIVSXT(self, value):
"""
Set the value of EN_LOADIMP_LDO_DIVSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_DIVSXT', value)
# EN_LOADIMP_LDO_LNA12
@property
def EN_LOADIMP_LDO_LNA12(self):
"""
Get the value of EN_LOADIMP_LDO_LNA12
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_LNA12')
@EN_LOADIMP_LDO_LNA12.setter
def EN_LOADIMP_LDO_LNA12(self, value):
"""
Set the value of EN_LOADIMP_LDO_LNA12
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_LNA12', value)
# EN_LOADIMP_LDO_LNA14
@property
def EN_LOADIMP_LDO_LNA14(self):
"""
Get the value of EN_LOADIMP_LDO_LNA14
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_LNA14')
@EN_LOADIMP_LDO_LNA14.setter
def EN_LOADIMP_LDO_LNA14(self, value):
"""
Set the value of EN_LOADIMP_LDO_LNA14
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_LNA14', value)
# EN_LOADIMP_LDO_MXRFE
@property
def EN_LOADIMP_LDO_MXRFE(self):
"""
Get the value of EN_LOADIMP_LDO_MXRFE
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_MXRFE')
@EN_LOADIMP_LDO_MXRFE.setter
def EN_LOADIMP_LDO_MXRFE(self, value):
"""
Set the value of EN_LOADIMP_LDO_MXRFE
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_MXRFE', value)
# EN_LOADIMP_LDO_RBB
@property
def EN_LOADIMP_LDO_RBB(self):
"""
Get the value of EN_LOADIMP_LDO_RBB
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_RBB')
@EN_LOADIMP_LDO_RBB.setter
def EN_LOADIMP_LDO_RBB(self, value):
"""
Set the value of EN_LOADIMP_LDO_RBB
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_RBB', value)
# EN_LOADIMP_LDO_RXBUF
@property
def EN_LOADIMP_LDO_RXBUF(self):
"""
Get the value of EN_LOADIMP_LDO_RXBUF
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_RXBUF')
@EN_LOADIMP_LDO_RXBUF.setter
def EN_LOADIMP_LDO_RXBUF(self, value):
"""
Set the value of EN_LOADIMP_LDO_RXBUF
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_RXBUF', value)
# EN_LOADIMP_LDO_TBB
@property
def EN_LOADIMP_LDO_TBB(self):
"""
Get the value of EN_LOADIMP_LDO_TBB
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_TBB')
@EN_LOADIMP_LDO_TBB.setter
def EN_LOADIMP_LDO_TBB(self, value):
"""
Set the value of EN_LOADIMP_LDO_TBB
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_TBB', value)
# EN_LOADIMP_LDO_TIA12
@property
def EN_LOADIMP_LDO_TIA12(self):
"""
Get the value of EN_LOADIMP_LDO_TIA12
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_TIA12')
@EN_LOADIMP_LDO_TIA12.setter
def EN_LOADIMP_LDO_TIA12(self, value):
"""
Set the value of EN_LOADIMP_LDO_TIA12
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_TIA12', value)
# EN_LOADIMP_LDO_TIA14
@property
def EN_LOADIMP_LDO_TIA14(self):
"""
Get the value of EN_LOADIMP_LDO_TIA14
"""
return self._readReg('CFG2', 'EN_LOADIMP_LDO_TIA14')
@EN_LOADIMP_LDO_TIA14.setter
def EN_LOADIMP_LDO_TIA14(self, value):
"""
Set the value of EN_LOADIMP_LDO_TIA14
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG2', 'EN_LOADIMP_LDO_TIA14', value)
#
# BIAS_CFG3 (0x0095)
#
# BYP_LDO_TBB
@property
def BYP_LDO_TBB(self):
"""
Get the value of BYP_LDO_TBB
"""
return self._readReg('CFG3', 'BYP_LDO_TBB')
@BYP_LDO_TBB.setter
def BYP_LDO_TBB(self, value):
"""
Set the value of BYP_LDO_TBB
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG3', 'BYP_LDO_TBB', value)
# BYP_LDO_TIA12
@property
def BYP_LDO_TIA12(self):
"""
Get the value of BYP_LDO_TIA12
"""
return self._readReg('CFG3', 'BYP_LDO_TIA12')
@BYP_LDO_TIA12.setter
def BYP_LDO_TIA12(self, value):
"""
Set the value of BYP_LDO_TIA12
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG3', 'BYP_LDO_TIA12', value)
# BYP_LDO_TIA14
@property
def BYP_LDO_TIA14(self):
"""
Get the value of BYP_LDO_TIA14
"""
return self._readReg('CFG3', 'BYP_LDO_TIA14')
@BYP_LDO_TIA14.setter
def BYP_LDO_TIA14(self, value):
"""
Set the value of BYP_LDO_TIA14
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG3', 'BYP_LDO_TIA14', value)
# BYP_LDO_TLOB
@property
def BYP_LDO_TLOB(self):
"""
Get the value of BYP_LDO_TLOB
"""
return self._readReg('CFG3', 'BYP_LDO_TLOB')
@BYP_LDO_TLOB.setter
def BYP_LDO_TLOB(self, value):
"""
Set the value of BYP_LDO_TLOB
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG3', 'BYP_LDO_TLOB', value)
# BYP_LDO_TPAD
@property
def BYP_LDO_TPAD(self):
"""
Get the value of BYP_LDO_TPAD
"""
return self._readReg('CFG3', 'BYP_LDO_TPAD')
@BYP_LDO_TPAD.setter
def BYP_LDO_TPAD(self, value):
"""
Set the value of BYP_LDO_TPAD
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG3', 'BYP_LDO_TPAD', value)
# BYP_LDO_TXBUF
@property
def BYP_LDO_TXBUF(self):
"""
Get the value of BYP_LDO_TXBUF
"""
return self._readReg('CFG3', 'BYP_LDO_TXBUF')
@BYP_LDO_TXBUF.setter
def BYP_LDO_TXBUF(self, value):
"""
Set the value of BYP_LDO_TXBUF
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG3', 'BYP_LDO_TXBUF', value)
# BYP_LDO_VCOGN
@property
def BYP_LDO_VCOGN(self):
"""
Get the value of BYP_LDO_VCOGN
"""
return self._readReg('CFG3', 'BYP_LDO_VCOGN')
@BYP_LDO_VCOGN.setter
def BYP_LDO_VCOGN(self, value):
"""
Set the value of BYP_LDO_VCOGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG3', 'BYP_LDO_VCOGN', value)
# BYP_LDO_VCOSXR
@property
def BYP_LDO_VCOSXR(self):
"""
Get the value of BYP_LDO_VCOSXR
"""
return self._readReg('CFG3', 'BYP_LDO_VCOSXR')
@BYP_LDO_VCOSXR.setter
def BYP_LDO_VCOSXR(self, value):
"""
Set the value of BYP_LDO_VCOSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG3', 'BYP_LDO_VCOSXR', value)
# BYP_LDO_VCOSXT
@property
def BYP_LDO_VCOSXT(self):
"""
Get the value of BYP_LDO_VCOSXT
"""
return self._readReg('CFG3', 'BYP_LDO_VCOSXT')
@BYP_LDO_VCOSXT.setter
def BYP_LDO_VCOSXT(self, value):
"""
Set the value of BYP_LDO_VCOSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG3', 'BYP_LDO_VCOSXT', value)
# EN_LOADIMP_LDO_AFE
@property
def EN_LOADIMP_LDO_AFE(self):
"""
Get the value of EN_LOADIMP_LDO_AFE
"""
return self._readReg('CFG3', 'EN_LOADIMP_LDO_AFE')
@EN_LOADIMP_LDO_AFE.setter
def EN_LOADIMP_LDO_AFE(self, value):
"""
Set the value of EN_LOADIMP_LDO_AFE
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG3', 'EN_LOADIMP_LDO_AFE', value)
# EN_LOADIMP_LDO_CPGN
@property
def EN_LOADIMP_LDO_CPGN(self):
"""
Get the value of EN_LOADIMP_LDO_CPGN
"""
return self._readReg('CFG3', 'EN_LOADIMP_LDO_CPGN')
@EN_LOADIMP_LDO_CPGN.setter
def EN_LOADIMP_LDO_CPGN(self, value):
"""
Set the value of EN_LOADIMP_LDO_CPGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG3', 'EN_LOADIMP_LDO_CPGN', value)
# EN_LOADIMP_LDO_CPSXR
@property
def EN_LOADIMP_LDO_CPSXR(self):
"""
Get the value of EN_LOADIMP_LDO_CPSXR
"""
return self._readReg('CFG3', 'EN_LOADIMP_LDO_CPSXR')
@EN_LOADIMP_LDO_CPSXR.setter
def EN_LOADIMP_LDO_CPSXR(self, value):
"""
Set the value of EN_LOADIMP_LDO_CPSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG3', 'EN_LOADIMP_LDO_CPSXR', value)
#
# BIAS_CFG4 (0x0096)
#
# BYP_LDO_AFE
@property
def BYP_LDO_AFE(self):
"""
Get the value of BYP_LDO_AFE
"""
return self._readReg('CFG4', 'BYP_LDO_AFE')
@BYP_LDO_AFE.setter
def BYP_LDO_AFE(self, value):
"""
Set the value of BYP_LDO_AFE
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_AFE', value)
# BYP_LDO_CPGN
@property
def BYP_LDO_CPGN(self):
"""
Get the value of BYP_LDO_CPGN
"""
return self._readReg('CFG4', 'BYP_LDO_CPGN')
@BYP_LDO_CPGN.setter
def BYP_LDO_CPGN(self, value):
"""
Set the value of BYP_LDO_CPGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_CPGN', value)
# BYP_LDO_CPSXR
@property
def BYP_LDO_CPSXR(self):
"""
Get the value of BYP_LDO_CPSXR
"""
return self._readReg('CFG4', 'BYP_LDO_CPSXR')
@BYP_LDO_CPSXR.setter
def BYP_LDO_CPSXR(self, value):
"""
Set the value of BYP_LDO_CPSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_CPSXR', value)
# BYP_LDO_CPSXT
@property
def BYP_LDO_CPSXT(self):
"""
Get the value of BYP_LDO_CPSXT
"""
return self._readReg('CFG4', 'BYP_LDO_CPSXT')
@BYP_LDO_CPSXT.setter
def BYP_LDO_CPSXT(self, value):
"""
Set the value of BYP_LDO_CPSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_CPSXT', value)
# BYP_LDO_DIG
@property
def BYP_LDO_DIG(self):
"""
Get the value of BYP_LDO_DIG
"""
return self._readReg('CFG4', 'BYP_LDO_DIG')
@BYP_LDO_DIG.setter
def BYP_LDO_DIG(self, value):
"""
Set the value of BYP_LDO_DIG
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_DIG', value)
# BYP_LDO_DIGGN
@property
def BYP_LDO_DIGGN(self):
"""
Get the value of BYP_LDO_DIGGN
"""
return self._readReg('CFG4', 'BYP_LDO_DIGGN')
@BYP_LDO_DIGGN.setter
def BYP_LDO_DIGGN(self, value):
"""
Set the value of BYP_LDO_DIGGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_DIGGN', value)
# BYP_LDO_DIGSXR
@property
def BYP_LDO_DIGSXR(self):
"""
Get the value of BYP_LDO_DIGSXR
"""
return self._readReg('CFG4', 'BYP_LDO_DIGSXR')
@BYP_LDO_DIGSXR.setter
def BYP_LDO_DIGSXR(self, value):
"""
Set the value of BYP_LDO_DIGSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_DIGSXR', value)
# BYP_LDO_DIGSXT
@property
def BYP_LDO_DIGSXT(self):
"""
Get the value of BYP_LDO_DIGSXT
"""
return self._readReg('CFG4', 'BYP_LDO_DIGSXT')
@BYP_LDO_DIGSXT.setter
def BYP_LDO_DIGSXT(self, value):
"""
Set the value of BYP_LDO_DIGSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_DIGSXT', value)
# BYP_LDO_DIVGN
@property
def BYP_LDO_DIVGN(self):
"""
Get the value of BYP_LDO_DIVGN
"""
return self._readReg('CFG4', 'BYP_LDO_DIVGN')
@BYP_LDO_DIVGN.setter
def BYP_LDO_DIVGN(self, value):
"""
Set the value of BYP_LDO_DIVGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_DIVGN', value)
# BYP_LDO_DIVSXR
@property
def BYP_LDO_DIVSXR(self):
"""
Get the value of BYP_LDO_DIVSXR
"""
return self._readReg('CFG4', 'BYP_LDO_DIVSXR')
@BYP_LDO_DIVSXR.setter
def BYP_LDO_DIVSXR(self, value):
"""
Set the value of BYP_LDO_DIVSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_DIVSXR', value)
# BYP_LDO_DIVSXT
@property
def BYP_LDO_DIVSXT(self):
"""
Get the value of BYP_LDO_DIVSXT
"""
return self._readReg('CFG4', 'BYP_LDO_DIVSXT')
@BYP_LDO_DIVSXT.setter
def BYP_LDO_DIVSXT(self, value):
"""
Set the value of BYP_LDO_DIVSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_DIVSXT', value)
# BYP_LDO_LNA12
@property
def BYP_LDO_LNA12(self):
"""
Get the value of BYP_LDO_LNA12
"""
return self._readReg('CFG4', 'BYP_LDO_LNA12')
@BYP_LDO_LNA12.setter
def BYP_LDO_LNA12(self, value):
"""
Set the value of BYP_LDO_LNA12
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_LNA12', value)
# BYP_LDO_LNA14
@property
def BYP_LDO_LNA14(self):
"""
Get the value of BYP_LDO_LNA14
"""
return self._readReg('CFG4', 'BYP_LDO_LNA14')
@BYP_LDO_LNA14.setter
def BYP_LDO_LNA14(self, value):
"""
Set the value of BYP_LDO_LNA14
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_LNA14', value)
# BYP_LDO_MXRFE
@property
def BYP_LDO_MXRFE(self):
"""
Get the value of BYP_LDO_MXRFE
"""
return self._readReg('CFG4', 'BYP_LDO_MXRFE')
@BYP_LDO_MXRFE.setter
def BYP_LDO_MXRFE(self, value):
"""
Set the value of BYP_LDO_MXRFE
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_MXRFE', value)
# BYP_LDO_RBB
@property
def BYP_LDO_RBB(self):
"""
Get the value of BYP_LDO_RBB
"""
return self._readReg('CFG4', 'BYP_LDO_RBB')
@BYP_LDO_RBB.setter
def BYP_LDO_RBB(self, value):
"""
Set the value of BYP_LDO_RBB
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_RBB', value)
# BYP_LDO_RXBUF
@property
def BYP_LDO_RXBUF(self):
"""
Get the value of BYP_LDO_RXBUF
"""
return self._readReg('CFG4', 'BYP_LDO_RXBUF')
@BYP_LDO_RXBUF.setter
def BYP_LDO_RXBUF(self, value):
"""
Set the value of BYP_LDO_RXBUF
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG4', 'BYP_LDO_RXBUF', value)
#
# BIAS_CFG5 (0x0097)
#
# SPDUP_LDO_DIVSXR
@property
def SPDUP_LDO_DIVSXR(self):
"""
Get the value of SPDUP_LDO_DIVSXR
"""
return self._readReg('CFG5', 'SPDUP_LDO_DIVSXR')
@SPDUP_LDO_DIVSXR.setter
def SPDUP_LDO_DIVSXR(self, value):
"""
Set the value of SPDUP_LDO_DIVSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_DIVSXR', value)
# SPDUP_LDO_DIVSXT
@property
def SPDUP_LDO_DIVSXT(self):
"""
Get the value of SPDUP_LDO_DIVSXT
"""
return self._readReg('CFG5', 'SPDUP_LDO_DIVSXT')
@SPDUP_LDO_DIVSXT.setter
def SPDUP_LDO_DIVSXT(self, value):
"""
Set the value of SPDUP_LDO_DIVSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_DIVSXT', value)
# SPDUP_LDO_LNA12
@property
def SPDUP_LDO_LNA12(self):
"""
Get the value of SPDUP_LDO_LNA12
"""
return self._readReg('CFG5', 'SPDUP_LDO_LNA12')
@SPDUP_LDO_LNA12.setter
def SPDUP_LDO_LNA12(self, value):
"""
Set the value of SPDUP_LDO_LNA12
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_LNA12', value)
# SPDUP_LDO_LNA14
@property
def SPDUP_LDO_LNA14(self):
"""
Get the value of SPDUP_LDO_LNA14
"""
return self._readReg('CFG5', 'SPDUP_LDO_LNA14')
@SPDUP_LDO_LNA14.setter
def SPDUP_LDO_LNA14(self, value):
"""
Set the value of SPDUP_LDO_LNA14
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_LNA14', value)
# SPDUP_LDO_MXRFE
@property
def SPDUP_LDO_MXRFE(self):
"""
Get the value of SPDUP_LDO_MXRFE
"""
return self._readReg('CFG5', 'SPDUP_LDO_MXRFE')
@SPDUP_LDO_MXRFE.setter
def SPDUP_LDO_MXRFE(self, value):
"""
Set the value of SPDUP_LDO_MXRFE
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_MXRFE', value)
# SPDUP_LDO_RBB
@property
def SPDUP_LDO_RBB(self):
"""
Get the value of SPDUP_LDO_RBB
"""
return self._readReg('CFG5', 'SPDUP_LDO_RBB')
@SPDUP_LDO_RBB.setter
def SPDUP_LDO_RBB(self, value):
"""
Set the value of SPDUP_LDO_RBB
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_RBB', value)
# SPDUP_LDO_RXBUF
@property
def SPDUP_LDO_RXBUF(self):
"""
Get the value of SPDUP_LDO_RXBUF
"""
return self._readReg('CFG5', 'SPDUP_LDO_RXBUF')
@SPDUP_LDO_RXBUF.setter
def SPDUP_LDO_RXBUF(self, value):
"""
Set the value of SPDUP_LDO_RXBUF
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_RXBUF', value)
# SPDUP_LDO_TBB
@property
def SPDUP_LDO_TBB(self):
"""
Get the value of SPDUP_LDO_TBB
"""
return self._readReg('CFG5', 'SPDUP_LDO_TBB')
@SPDUP_LDO_TBB.setter
def SPDUP_LDO_TBB(self, value):
"""
Set the value of SPDUP_LDO_TBB
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_TBB', value)
# SPDUP_LDO_TIA12
@property
def SPDUP_LDO_TIA12(self):
"""
Get the value of SPDUP_LDO_TIA12
"""
return self._readReg('CFG5', 'SPDUP_LDO_TIA12')
@SPDUP_LDO_TIA12.setter
def SPDUP_LDO_TIA12(self, value):
"""
Set the value of SPDUP_LDO_TIA12
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_TIA12', value)
# SPDUP_LDO_TIA14
@property
def SPDUP_LDO_TIA14(self):
"""
Get the value of SPDUP_LDO_TIA14
"""
return self._readReg('CFG5', 'SPDUP_LDO_TIA14')
@SPDUP_LDO_TIA14.setter
def SPDUP_LDO_TIA14(self, value):
"""
Set the value of SPDUP_LDO_TIA14
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_TIA14', value)
# SPDUP_LDO_TLOB
@property
def SPDUP_LDO_TLOB(self):
"""
Get the value of SPDUP_LDO_TLOB
"""
return self._readReg('CFG5', 'SPDUP_LDO_TLOB')
@SPDUP_LDO_TLOB.setter
def SPDUP_LDO_TLOB(self, value):
"""
Set the value of SPDUP_LDO_TLOB
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_TLOB', value)
# SPDUP_LDO_TPAD
@property
def SPDUP_LDO_TPAD(self):
"""
Get the value of SPDUP_LDO_TPAD
"""
return self._readReg('CFG5', 'SPDUP_LDO_TPAD')
@SPDUP_LDO_TPAD.setter
def SPDUP_LDO_TPAD(self, value):
"""
Set the value of SPDUP_LDO_TPAD
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_TPAD', value)
# SPDUP_LDO_TXBUF
@property
def SPDUP_LDO_TXBUF(self):
"""
Get the value of SPDUP_LDO_TXBUF
"""
return self._readReg('CFG5', 'SPDUP_LDO_TXBUF')
@SPDUP_LDO_TXBUF.setter
def SPDUP_LDO_TXBUF(self, value):
"""
Set the value of SPDUP_LDO_TXBUF
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_TXBUF', value)
# SPDUP_LDO_VCOGN
@property
def SPDUP_LDO_VCOGN(self):
"""
Get the value of SPDUP_LDO_VCOGN
"""
return self._readReg('CFG5', 'SPDUP_LDO_VCOGN')
@SPDUP_LDO_VCOGN.setter
def SPDUP_LDO_VCOGN(self, value):
"""
Set the value of SPDUP_LDO_VCOGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_VCOGN', value)
# SPDUP_LDO_VCOSXR
@property
def SPDUP_LDO_VCOSXR(self):
"""
Get the value of SPDUP_LDO_VCOSXR
"""
return self._readReg('CFG5', 'SPDUP_LDO_VCOSXR')
@SPDUP_LDO_VCOSXR.setter
def SPDUP_LDO_VCOSXR(self, value):
"""
Set the value of SPDUP_LDO_VCOSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_VCOSXR', value)
# SPDUP_LDO_VCOSXT
@property
def SPDUP_LDO_VCOSXT(self):
"""
Get the value of SPDUP_LDO_VCOSXT
"""
return self._readReg('CFG5', 'SPDUP_LDO_VCOSXT')
@SPDUP_LDO_VCOSXT.setter
def SPDUP_LDO_VCOSXT(self, value):
"""
Set the value of SPDUP_LDO_VCOSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG5', 'SPDUP_LDO_VCOSXT', value)
#
# BIAS_CFG6 (0x0098)
#
# SPDUP_LDO_AFE
@property
def SPDUP_LDO_AFE(self):
"""
Get the value of SPDUP_LDO_AFE
"""
return self._readReg('CFG6', 'SPDUP_LDO_AFE')
@SPDUP_LDO_AFE.setter
def SPDUP_LDO_AFE(self, value):
"""
Set the value of SPDUP_LDO_AFE
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG6', 'SPDUP_LDO_AFE', value)
# SPDUP_LDO_CPGN
@property
def SPDUP_LDO_CPGN(self):
"""
Get the value of SPDUP_LDO_CPGN
"""
return self._readReg('CFG6', 'SPDUP_LDO_CPGN')
@SPDUP_LDO_CPGN.setter
def SPDUP_LDO_CPGN(self, value):
"""
Set the value of SPDUP_LDO_CPGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG6', 'SPDUP_LDO_CPGN', value)
# SPDUP_LDO_CPSXR
@property
def SPDUP_LDO_CPSXR(self):
"""
Get the value of SPDUP_LDO_CPSXR
"""
return self._readReg('CFG6', 'SPDUP_LDO_CPSXR')
@SPDUP_LDO_CPSXR.setter
def SPDUP_LDO_CPSXR(self, value):
"""
Set the value of SPDUP_LDO_CPSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG6', 'SPDUP_LDO_CPSXR', value)
# SPDUP_LDO_CPSXT
@property
def SPDUP_LDO_CPSXT(self):
"""
Get the value of SPDUP_LDO_CPSXT
"""
return self._readReg('CFG6', 'SPDUP_LDO_CPSXT')
@SPDUP_LDO_CPSXT.setter
def SPDUP_LDO_CPSXT(self, value):
"""
Set the value of SPDUP_LDO_CPSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG6', 'SPDUP_LDO_CPSXT', value)
# SPDUP_LDO_DIG
@property
def SPDUP_LDO_DIG(self):
"""
Get the value of SPDUP_LDO_DIG
"""
return self._readReg('CFG6', 'SPDUP_LDO_DIG')
@SPDUP_LDO_DIG.setter
def SPDUP_LDO_DIG(self, value):
"""
Set the value of SPDUP_LDO_DIG
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG6', 'SPDUP_LDO_DIG', value)
# SPDUP_LDO_DIGGN
@property
def SPDUP_LDO_DIGGN(self):
"""
Get the value of SPDUP_LDO_DIGGN
"""
return self._readReg('CFG6', 'SPDUP_LDO_DIGGN')
@SPDUP_LDO_DIGGN.setter
def SPDUP_LDO_DIGGN(self, value):
"""
Set the value of SPDUP_LDO_DIGGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG6', 'SPDUP_LDO_DIGGN', value)
# SPDUP_LDO_DIGSXR
@property
def SPDUP_LDO_DIGSXR(self):
"""
Get the value of SPDUP_LDO_DIGSXR
"""
return self._readReg('CFG6', 'SPDUP_LDO_DIGSXR')
@SPDUP_LDO_DIGSXR.setter
def SPDUP_LDO_DIGSXR(self, value):
"""
Set the value of SPDUP_LDO_DIGSXR
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG6', 'SPDUP_LDO_DIGSXR', value)
# SPDUP_LDO_DIGSXT
@property
def SPDUP_LDO_DIGSXT(self):
"""
Get the value of SPDUP_LDO_DIGSXT
"""
return self._readReg('CFG6', 'SPDUP_LDO_DIGSXT')
@SPDUP_LDO_DIGSXT.setter
def SPDUP_LDO_DIGSXT(self, value):
"""
Set the value of SPDUP_LDO_DIGSXT
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG6', 'SPDUP_LDO_DIGSXT', value)
# SPDUP_LDO_DIVGN
@property
def SPDUP_LDO_DIVGN(self):
"""
Get the value of SPDUP_LDO_DIVGN
"""
return self._readReg('CFG6', 'SPDUP_LDO_DIVGN')
@SPDUP_LDO_DIVGN.setter
def SPDUP_LDO_DIVGN(self, value):
"""
Set the value of SPDUP_LDO_DIVGN
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG6', 'SPDUP_LDO_DIVGN', value)
#
# BIAS_CFG7 (0x0099)
#
# RDIV_VCOSXR<7:0>
@property
def RDIV_VCOSXR(self):
"""
Get the value of RDIV_VCOSXR<7:0>
"""
return self._readReg('CFG7', 'RDIV_VCOSXR<7:0>')
@RDIV_VCOSXR.setter
def RDIV_VCOSXR(self, value):
"""
Set the value of RDIV_VCOSXR<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG7', 'RDIV_VCOSXR<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_VCOSXT<7:0>
@property
def RDIV_VCOSXT(self):
"""
Get the value of RDIV_VCOSXT<7:0>
"""
return self._readReg('CFG7', 'RDIV_VCOSXT<7:0>')
@RDIV_VCOSXT.setter
def RDIV_VCOSXT(self, value):
"""
Set the value of RDIV_VCOSXT<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG7', 'RDIV_VCOSXT<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG8 (0x009A)
#
# RDIV_TXBUF<7:0>
@property
def RDIV_TXBUF(self):
"""
Get the value of RDIV_TXBUF<7:0>
"""
return self._readReg('CFG8', 'RDIV_TXBUF<7:0>')
@RDIV_TXBUF.setter
def RDIV_TXBUF(self, value):
"""
Set the value of RDIV_TXBUF<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG8', 'RDIV_TXBUF<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_VCOGN<7:0>
@property
def RDIV_VCOGN(self):
"""
Get the value of RDIV_VCOGN<7:0>
"""
return self._readReg('CFG8', 'RDIV_VCOGN<7:0>')
@RDIV_VCOGN.setter
def RDIV_VCOGN(self, value):
"""
Set the value of RDIV_VCOGN<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG8', 'RDIV_VCOGN<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG9 (0x009B)
#
# RDIV_TLOB<7:0>
@property
def RDIV_TLOB(self):
"""
Get the value of RDIV_TLOB<7:0>
"""
return self._readReg('CFG9', 'RDIV_TLOB<7:0>')
@RDIV_TLOB.setter
def RDIV_TLOB(self, value):
"""
Set the value of RDIV_TLOB<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG9', 'RDIV_TLOB<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_TPAD<7:0>
@property
def RDIV_TPAD(self):
"""
Get the value of RDIV_TPAD<7:0>
"""
return self._readReg('CFG9', 'RDIV_TPAD<7:0>')
@RDIV_TPAD.setter
def RDIV_TPAD(self, value):
"""
Set the value of RDIV_TPAD<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG9', 'RDIV_TPAD<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG10 (0x009C)
#
# RDIV_TIA12<7:0>
@property
def RDIV_TIA12(self):
"""
Get the value of RDIV_TIA12<7:0>
"""
return self._readReg('CFG10', 'RDIV_TIA12<7:0>')
@RDIV_TIA12.setter
def RDIV_TIA12(self, value):
"""
Set the value of RDIV_TIA12<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG10', 'RDIV_TIA12<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_TIA14<7:0>
@property
def RDIV_TIA14(self):
"""
Get the value of RDIV_TIA14<7:0>
"""
return self._readReg('CFG10', 'RDIV_TIA14<7:0>')
@RDIV_TIA14.setter
def RDIV_TIA14(self, value):
"""
Set the value of RDIV_TIA14<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG10', 'RDIV_TIA14<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG11 (0x009D)
#
# RDIV_RXBUF<7:0>
@property
def RDIV_RXBUF(self):
"""
Get the value of RDIV_RXBUF<7:0>
"""
return self._readReg('CFG11', 'RDIV_RXBUF<7:0>')
@RDIV_RXBUF.setter
def RDIV_RXBUF(self, value):
"""
Set the value of RDIV_RXBUF<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG11', 'RDIV_RXBUF<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_TBB<7:0>
@property
def RDIV_TBB(self):
"""
Get the value of RDIV_TBB<7:0>
"""
return self._readReg('CFG11', 'RDIV_TBB<7:0>')
@RDIV_TBB.setter
def RDIV_TBB(self, value):
"""
Set the value of RDIV_TBB<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG11', 'RDIV_TBB<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG12 (0x009E)
#
# RDIV_MXRFE<7:0>
@property
def RDIV_MXRFE(self):
"""
Get the value of RDIV_MXRFE<7:0>
"""
return self._readReg('CFG12', 'RDIV_MXRFE<7:0>')
@RDIV_MXRFE.setter
def RDIV_MXRFE(self, value):
"""
Set the value of RDIV_MXRFE<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG12', 'RDIV_MXRFE<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_RBB<7:0>
@property
def RDIV_RBB(self):
"""
Get the value of RDIV_RBB<7:0>
"""
return self._readReg('CFG12', 'RDIV_RBB<7:0>')
@RDIV_RBB.setter
def RDIV_RBB(self, value):
"""
Set the value of RDIV_RBB<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG12', 'RDIV_RBB<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG13 (0x009F)
#
# RDIV_LNA12<7:0>
@property
def RDIV_LNA12(self):
"""
Get the value of RDIV_LNA12<7:0>
"""
return self._readReg('CFG13', 'RDIV_LNA12<7:0>')
@RDIV_LNA12.setter
def RDIV_LNA12(self, value):
"""
Set the value of RDIV_LNA12<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG13', 'RDIV_LNA12<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_LNA14<7:0>
@property
def RDIV_LNA14(self):
"""
Get the value of RDIV_LNA14<7:0>
"""
return self._readReg('CFG13', 'RDIV_LNA14<7:0>')
@RDIV_LNA14.setter
def RDIV_LNA14(self, value):
"""
Set the value of RDIV_LNA14<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG13', 'RDIV_LNA14<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG14 (0x00A0)
#
# RDIV_DIVSXR<7:0>
@property
def RDIV_DIVSXR(self):
"""
Get the value of RDIV_DIVSXR<7:0>
"""
return self._readReg('CFG14', 'RDIV_DIVSXR<7:0>')
@RDIV_DIVSXR.setter
def RDIV_DIVSXR(self, value):
"""
Set the value of RDIV_DIVSXR<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG14', 'RDIV_DIVSXR<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_DIVSXT<7:0>
@property
def RDIV_DIVSXT(self):
"""
Get the value of RDIV_DIVSXT<7:0>
"""
return self._readReg('CFG14', 'RDIV_DIVSXT<7:0>')
@RDIV_DIVSXT.setter
def RDIV_DIVSXT(self, value):
"""
Set the value of RDIV_DIVSXT<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG14', 'RDIV_DIVSXT<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG15 (0x00A1)
#
# RDIV_DIGSXT<7:0>
@property
def RDIV_DIGSXT(self):
"""
Get the value of RDIV_DIGSXT<7:0>
"""
return self._readReg('CFG15', 'RDIV_DIGSXT<7:0>')
@RDIV_DIGSXT.setter
def RDIV_DIGSXT(self, value):
"""
Set the value of RDIV_DIGSXT<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG15', 'RDIV_DIGSXT<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_DIVGN<7:0>
@property
def RDIV_DIVGN(self):
"""
Get the value of RDIV_DIVGN<7:0>
"""
return self._readReg('CFG15', 'RDIV_DIVGN<7:0>')
@RDIV_DIVGN.setter
def RDIV_DIVGN(self, value):
"""
Set the value of RDIV_DIVGN<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG15', 'RDIV_DIVGN<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG16 (0x00A2)
#
# RDIV_DIGGN<7:0>
@property
def RDIV_DIGGN(self):
"""
Get the value of RDIV_DIGGN<7:0>
"""
return self._readReg('CFG16', 'RDIV_DIGGN<7:0>')
@RDIV_DIGGN.setter
def RDIV_DIGGN(self, value):
"""
Set the value of RDIV_DIGGN<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG16', 'RDIV_DIGGN<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_DIGSXR<7:0>
@property
def RDIV_DIGSXR(self):
"""
Get the value of RDIV_DIGSXR<7:0>
"""
return self._readReg('CFG16', 'RDIV_DIGSXR<7:0>')
@RDIV_DIGSXR.setter
def RDIV_DIGSXR(self, value):
"""
Set the value of RDIV_DIGSXR<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG16', 'RDIV_DIGSXR<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG17 (0x00A3)
#
# RDIV_CPSXT<7:0>
@property
def RDIV_CPSXT(self):
"""
Get the value of RDIV_CPSXT<7:0>
"""
return self._readReg('CFG17', 'RDIV_CPSXT<7:0>')
@RDIV_CPSXT.setter
def RDIV_CPSXT(self, value):
"""
Set the value of RDIV_CPSXT<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG17', 'RDIV_CPSXT<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_DIG<7:0>
@property
def RDIV_DIG(self):
"""
Get the value of RDIV_DIG<7:0>
"""
return self._readReg('CFG17', 'RDIV_DIG<7:0>')
@RDIV_DIG.setter
def RDIV_DIG(self, value):
"""
Set the value of RDIV_DIG<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG17', 'RDIV_DIG<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG18 (0x00A4)
#
# RDIV_CPGN<7:0>
@property
def RDIV_CPGN(self):
"""
Get the value of RDIV_CPGN<7:0>
"""
return self._readReg('CFG18', 'RDIV_CPGN<7:0>')
@RDIV_CPGN.setter
def RDIV_CPGN(self, value):
"""
Set the value of RDIV_CPGN<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG18', 'RDIV_CPGN<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_CPSXR<7:0>
@property
def RDIV_CPSXR(self):
"""
Get the value of RDIV_CPSXR<7:0>
"""
return self._readReg('CFG18', 'RDIV_CPSXR<7:0>')
@RDIV_CPSXR.setter
def RDIV_CPSXR(self, value):
"""
Set the value of RDIV_CPSXR<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG18', 'RDIV_CPSXR<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG19 (0x00A5)
#
# RDIV_SPIBUF<7:0>
@property
def RDIV_SPIBUF(self):
"""
Get the value of RDIV_SPIBUF<7:0>
"""
return self._readReg('CFG19', 'RDIV_SPIBUF<7:0>')
@RDIV_SPIBUF.setter
def RDIV_SPIBUF(self, value):
"""
Set the value of RDIV_SPIBUF<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG19', 'RDIV_SPIBUF<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_AFE<7:0>
@property
def RDIV_AFE(self):
"""
Get the value of RDIV_AFE<7:0>
"""
return self._readReg('CFG19', 'RDIV_AFE<7:0>')
@RDIV_AFE.setter
def RDIV_AFE(self, value):
"""
Set the value of RDIV_AFE<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG19', 'RDIV_AFE<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
#
# BIAS_CFG20 (0x00A6)
#
# ISINK_SPIBUFF<2:0>
@property
def ISINK_SPIBUFF(self):
"""
Get the value of ISINK_SPIBUFF<2:0>
"""
if self.chip.chipID == self.chip.chipIDMR3:
return self._readReg('CFG20', 'ISINK_SPIBUFF<2:0>')
else:
raise ValueError("Bitfield ISINK_SPIBUFF<2:0> is not supported on chip version "+str(self.chip.chipID))
@ISINK_SPIBUFF.setter
def ISINK_SPIBUFF(self, value):
"""
Set the value of ISINK_SPIBUFF<2:0>
"""
if self.chip.chipID == self.chip.chipIDMR3:
if value not in range(0,8):
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'ISINK_SPIBUFF<2:0>', value)
else:
raise ValueError("Bitfield ISINK_SPIBUFF<2:0> is not supported on chip version "+str(self.chip.chipID))
# SPDUP_LDO_SPIBUF
@property
def SPDUP_LDO_SPIBUF(self):
"""
Get the value of SPDUP_LDO_SPIBUF
"""
return self._readReg('CFG20', 'SPDUP_LDO_SPIBUF')
@SPDUP_LDO_SPIBUF.setter
def SPDUP_LDO_SPIBUF(self, value):
"""
Set the value of SPDUP_LDO_SPIBUF
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'SPDUP_LDO_SPIBUF', value)
# SPDUP_LDO_DIGIp2
@property
def SPDUP_LDO_DIGIp2(self):
"""
Get the value of SPDUP_LDO_DIGIp2
"""
return self._readReg('CFG20', 'SPDUP_LDO_DIGIp2')
@SPDUP_LDO_DIGIp2.setter
def SPDUP_LDO_DIGIp2(self, value):
"""
Set the value of SPDUP_LDO_DIGIp2
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'SPDUP_LDO_DIGIp2', value)
# SPDUP_LDO_DIGIp1
@property
def SPDUP_LDO_DIGIp1(self):
"""
Get the value of SPDUP_LDO_DIGIp1
"""
return self._readReg('CFG20', 'SPDUP_LDO_DIGIp1')
@SPDUP_LDO_DIGIp1.setter
def SPDUP_LDO_DIGIp1(self, value):
"""
Set the value of SPDUP_LDO_DIGIp1
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'SPDUP_LDO_DIGIp1', value)
# BYP_LDO_SPIBUF
@property
def BYP_LDO_SPIBUF(self):
"""
Get the value of BYP_LDO_SPIBUF
"""
return self._readReg('CFG20', 'BYP_LDO_SPIBUF')
@BYP_LDO_SPIBUF.setter
def BYP_LDO_SPIBUF(self, value):
"""
Set the value of BYP_LDO_SPIBUF
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'BYP_LDO_SPIBUF', value)
# BYP_LDO_DIGIp2
@property
def BYP_LDO_DIGIp2(self):
"""
Get the value of BYP_LDO_DIGIp2
"""
return self._readReg('CFG20', 'BYP_LDO_DIGIp2')
@BYP_LDO_DIGIp2.setter
def BYP_LDO_DIGIp2(self, value):
"""
Set the value of BYP_LDO_DIGIp2
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'BYP_LDO_DIGIp2', value)
# BYP_LDO_DIGIp1
@property
def BYP_LDO_DIGIp1(self):
"""
Get the value of BYP_LDO_DIGIp1
"""
return self._readReg('CFG20', 'BYP_LDO_DIGIp1')
@BYP_LDO_DIGIp1.setter
def BYP_LDO_DIGIp1(self, value):
"""
Set the value of BYP_LDO_DIGIp1
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'BYP_LDO_DIGIp1', value)
# EN_LOADIMP_LDO_SPIBUF
@property
def EN_LOADIMP_LDO_SPIBUF(self):
"""
Get the value of EN_LOADIMP_LDO_SPIBUF
"""
return self._readReg('CFG20', 'EN_LOADIMP_LDO_SPIBUF')
@EN_LOADIMP_LDO_SPIBUF.setter
def EN_LOADIMP_LDO_SPIBUF(self, value):
"""
Set the value of EN_LOADIMP_LDO_SPIBUF
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'EN_LOADIMP_LDO_SPIBUF', value)
# EN_LOADIMP_LDO_DIGIp2
@property
def EN_LOADIMP_LDO_DIGIp2(self):
"""
Get the value of EN_LOADIMP_LDO_DIGIp2
"""
return self._readReg('CFG20', 'EN_LOADIMP_LDO_DIGIp2')
@EN_LOADIMP_LDO_DIGIp2.setter
def EN_LOADIMP_LDO_DIGIp2(self, value):
"""
Set the value of EN_LOADIMP_LDO_DIGIp2
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'EN_LOADIMP_LDO_DIGIp2', value)
# EN_LOADIMP_LDO_DIGIp1
@property
def EN_LOADIMP_LDO_DIGIp1(self):
"""
Get the value of EN_LOADIMP_LDO_DIGIp1
"""
return self._readReg('CFG20', 'EN_LOADIMP_LDO_DIGIp1')
@EN_LOADIMP_LDO_DIGIp1.setter
def EN_LOADIMP_LDO_DIGIp1(self, value):
"""
Set the value of EN_LOADIMP_LDO_DIGIp1
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'EN_LOADIMP_LDO_DIGIp1', value)
# PD_LDO_SPIBUF
@property
def PD_LDO_SPIBUF(self):
"""
Get the value of PD_LDO_SPIBUF
"""
return self._readReg('CFG20', 'PD_LDO_SPIBUF')
@PD_LDO_SPIBUF.setter
def PD_LDO_SPIBUF(self, value):
"""
Set the value of PD_LDO_SPIBUF
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'PD_LDO_SPIBUF', value)
# PD_LDO_DIGIp2
@property
def PD_LDO_DIGIp2(self):
"""
Get the value of PD_LDO_DIGIp2
"""
return self._readReg('CFG20', 'PD_LDO_DIGIp2')
@PD_LDO_DIGIp2.setter
def PD_LDO_DIGIp2(self, value):
"""
Set the value of PD_LDO_DIGIp2
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'PD_LDO_DIGIp2', value)
# PD_LDO_DIGIp1
@property
def PD_LDO_DIGIp1(self):
"""
Get the value of PD_LDO_DIGIp1
"""
return self._readReg('CFG20', 'PD_LDO_DIGIp1')
@PD_LDO_DIGIp1.setter
def PD_LDO_DIGIp1(self, value):
"""
Set the value of PD_LDO_DIGIp1
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'PD_LDO_DIGIp1', value)
# EN_G_LDOP
@property
def EN_G_LDOP(self):
"""
Get the value of EN_G_LDOP
"""
return self._readReg('CFG20', 'EN_G_LDOP')
@EN_G_LDOP.setter
def EN_G_LDOP(self, value):
"""
Set the value of EN_G_LDOP
"""
if value not in [0, 1]:
raise ValueError("Value must be [0,1]")
self._writeReg('CFG20', 'EN_G_LDOP', value)
#
# BIAS_CFG21 (0x00A7)
#
# RDIV_DIGIp2<7:0>
@property
def RDIV_DIGIp2(self):
"""
Get the value of RDIV_DIGIp2<7:0>
"""
return self._readReg('CFG21', 'RDIV_DIGIp2<7:0>')
@RDIV_DIGIp2.setter
def RDIV_DIGIp2(self, value):
"""
Set the value of RDIV_DIGIp2<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG21', 'RDIV_DIGIp2<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
# RDIV_DIGIp1<7:0>
@property
def RDIV_DIGIp1(self):
"""
Get the value of RDIV_DIGIp1<7:0>
"""
return self._readReg('CFG21', 'RDIV_DIGIp1<7:0>')
@RDIV_DIGIp1.setter
def RDIV_DIGIp1(self, value):
"""
Set the value of RDIV_DIGIp1<7:0>
"""
if self.allowLDO:
if not(0<= value <=255):
raise ValueError("Value must be [0..255]")
self._writeReg('CFG21', 'RDIV_DIGIp1<7:0>', value)
else:
self.chip.log("Changing LDO voltage is not permitted. To change the LDO voltage, set BIAS.allowLDO=True")
| 27.604862 | 148 | 0.557736 | 10,071 | 76,079 | 3.94221 | 0.017377 | 0.06045 | 0.075563 | 0.056672 | 0.843434 | 0.741147 | 0.643293 | 0.499723 | 0.400106 | 0.353307 | 0 | 0.037984 | 0.32486 | 76,079 | 2,755 | 149 | 27.614882 | 0.73497 | 0.17148 | 0 | 0.412173 | 0 | 0 | 0.200809 | 0.006762 | 0 | 0 | 0 | 0 | 0 | 1 | 0.231895 | false | 0 | 0.00077 | 0 | 0.349769 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
187b747a40ae7c538023582dc3ed2250cb3040ca | 135 | py | Python | mullvad_python/__init__.py | linusg/mullpy | 6f29c33174e30ea2ba360327daae9bafe140c997 | [
"MIT"
] | 12 | 2018-08-02T20:05:54.000Z | 2020-06-24T18:42:53.000Z | mullvad_python/__init__.py | linusg/mullpy | 6f29c33174e30ea2ba360327daae9bafe140c997 | [
"MIT"
] | 3 | 2018-08-04T13:53:01.000Z | 2020-06-24T19:03:42.000Z | mullvad_python/__init__.py | linusg/mullpy | 6f29c33174e30ea2ba360327daae9bafe140c997 | [
"MIT"
] | 2 | 2018-08-05T14:06:39.000Z | 2020-06-24T18:45:47.000Z | """Initialization package."""
from .api import Mullpy
from .banner import banner
__all__ = ['Mullpy', 'banner']
__version__ = '0.3.1'
| 19.285714 | 30 | 0.703704 | 17 | 135 | 5.117647 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025641 | 0.133333 | 135 | 6 | 31 | 22.5 | 0.717949 | 0.17037 | 0 | 0 | 0 | 0 | 0.160377 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
43f6879757f40989d16e1db4126c95e8352e1759 | 492 | py | Python | src/seedwork/domain/rules.py | pgorecki/python-ddd | 0073ccce35c651be263f5d7d3d63f9a49bc0b78a | [
"MIT"
] | 10 | 2022-03-16T19:26:51.000Z | 2022-03-31T23:50:51.000Z | src/seedwork/domain/rules.py | pgorecki/python-ddd | 0073ccce35c651be263f5d7d3d63f9a49bc0b78a | [
"MIT"
] | null | null | null | src/seedwork/domain/rules.py | pgorecki/python-ddd | 0073ccce35c651be263f5d7d3d63f9a49bc0b78a | [
"MIT"
] | 2 | 2022-03-16T19:26:54.000Z | 2022-03-27T13:21:02.000Z | from pydantic import BaseModel
class BusinessRule(BaseModel):
"""This is a base class for implementing domain rules"""
class Config:
arbitrary_types_allowed = True
# This is an error message that broken rule reports back
__message: str = "Business rule is broken"
def get_message(self) -> str:
return self.__message
def is_broken(self) -> bool:
pass
def __str__(self):
return f"{self.__class__.__name__} {super().__str__()}"
| 23.428571 | 63 | 0.666667 | 62 | 492 | 4.903226 | 0.612903 | 0.039474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.245935 | 492 | 20 | 64 | 24.6 | 0.819407 | 0.215447 | 0 | 0 | 0 | 0 | 0.178947 | 0.065789 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0.090909 | 0.090909 | 0.181818 | 0.818182 | 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 | 1 | 0 | 0 | 0 | 3 |
a10e3d1311566cfbb4eeacef8a5558e6389ab6c2 | 147 | py | Python | rest_framework_bulk/__init__.py | xordoquy/django-rest-framework-bulk | 484df717a790591a7bc58d5fed34f958ae82929a | [
"MIT"
] | 1 | 2019-08-20T02:08:33.000Z | 2019-08-20T02:08:33.000Z | rest_framework_bulk/__init__.py | xordoquy/django-rest-framework-bulk | 484df717a790591a7bc58d5fed34f958ae82929a | [
"MIT"
] | null | null | null | rest_framework_bulk/__init__.py | xordoquy/django-rest-framework-bulk | 484df717a790591a7bc58d5fed34f958ae82929a | [
"MIT"
] | null | null | null | __version__ = '0.1.3'
__author__ = 'Miroslav Shubernetskiy'
try:
from .generics import *
from .mixins import *
except Exception:
pass
| 16.333333 | 37 | 0.687075 | 17 | 147 | 5.470588 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026087 | 0.217687 | 147 | 8 | 38 | 18.375 | 0.782609 | 0 | 0 | 0 | 0 | 0 | 0.183673 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.142857 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
a114b71d6021e2552fc945ad4a1ac94774faab77 | 189 | py | Python | test.py | j178/spotlight | 1e65ff35826fee9a9d522b502cd781e86fbed01f | [
"WTFPL"
] | 5 | 2016-12-06T04:03:16.000Z | 2020-09-24T14:08:49.000Z | test.py | j178/spotlight | 1e65ff35826fee9a9d522b502cd781e86fbed01f | [
"WTFPL"
] | 1 | 2020-05-04T02:19:09.000Z | 2020-06-10T08:44:11.000Z | test.py | j178/spotlight | 1e65ff35826fee9a9d522b502cd781e86fbed01f | [
"WTFPL"
] | null | null | null | from weibo import WeiboClient
from weibo.watchyou import fetch_replies
for r in fetch_replies(): # fetch_replies所依赖的weibo全局变量是在watchyou模块中存在的, 函数无法访问到这个模块中的全局变量
print(r['text'])
| 31.5 | 91 | 0.793651 | 21 | 189 | 7 | 0.666667 | 0.122449 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 189 | 5 | 92 | 37.8 | 0.907407 | 0.322751 | 0 | 0 | 0 | 0 | 0.033058 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
a11c3d72105134f3cd78ad0e461a7ff2f92aa01d | 4,713 | py | Python | Tests/testGalaxy.py | elsiehupp/traveller_pyroute | 32a43665910894896b807576125acee56ef02797 | [
"MIT"
] | 12 | 2017-02-09T08:58:16.000Z | 2021-09-04T22:12:57.000Z | Tests/testGalaxy.py | elsiehupp/traveller_pyroute | 32a43665910894896b807576125acee56ef02797 | [
"MIT"
] | 23 | 2017-07-14T05:04:30.000Z | 2022-03-27T02:20:06.000Z | Tests/testGalaxy.py | elsiehupp/traveller_pyroute | 32a43665910894896b807576125acee56ef02797 | [
"MIT"
] | 4 | 2016-12-31T06:23:47.000Z | 2022-03-03T19:36:43.000Z | """
Created on Nov 30, 2021
@author: CyberiaResurrection
"""
import unittest
import re
import sys
sys.path.append('../PyRoute')
from Galaxy import Galaxy
from Galaxy import Sector
class testGalaxy(unittest.TestCase):
"""
A very simple, barebones test to check that Verge and Reft end up in their correct relative positions
- Verge being immediately rimward of Reft
"""
def testVerticalOrdering(self):
galaxy = Galaxy(0)
reft = Sector("Reft", "# -3, 0")
self.assertEqual(-3, reft.x)
self.assertEqual(0, reft.y)
verge = Sector("Verge", "# -3, -1")
self.assertEqual(-3, verge.x)
self.assertEqual(-1, verge.y)
galaxy.sectors[reft.name] = reft
galaxy.sectors[verge.name] = verge
# verify, before bounding sectors gets run, nothing is hooked up
self.assertIsNone(galaxy.sectors[reft.name].coreward)
self.assertIsNone(galaxy.sectors[reft.name].rimward)
self.assertIsNone(galaxy.sectors[reft.name].spinward)
self.assertIsNone(galaxy.sectors[reft.name].trailing)
self.assertIsNone(galaxy.sectors[verge.name].coreward)
self.assertIsNone(galaxy.sectors[verge.name].rimward)
self.assertIsNone(galaxy.sectors[verge.name].spinward)
self.assertIsNone(galaxy.sectors[verge.name].trailing)
# set bounding sectors
galaxy.set_bounding_sectors()
# now assert that Reft is coreward from Verge, and (likewise), Verge is rimward from Reft, and nothing else
# got set
self.assertEqual(galaxy.sectors[reft.name], galaxy.sectors[verge.name].coreward, "Reft should be coreward of Verge")
self.assertIsNone(galaxy.sectors[verge.name].rimward, "Nothing should be rimward of Verge")
self.assertIsNone(galaxy.sectors[verge.name].spinward, "Nothing should be spinward of Verge")
self.assertIsNone(galaxy.sectors[verge.name].trailing, "Nothing should be trailing of Verge")
self.assertIsNone(galaxy.sectors[reft.name].coreward, "Nothing should be coreward of Reft")
self.assertIsNone(galaxy.sectors[reft.name].trailing, "Nothing should be trailing of Reft")
self.assertIsNone(galaxy.sectors[reft.name].spinward, "Nothing should be spinward of Reft")
self.assertEqual(galaxy.sectors[verge.name], galaxy.sectors[reft.name].rimward, "Verge should be rimward of Reft")
"""
A very simple, barebones test to check that Dagudashaag and Core end up in their correct relative positions
- Dagudashaag being immediately spinward of Core
"""
def testHorizontalOrdering(self):
galaxy = Galaxy(0)
core = Sector("Core", "# 0, 0")
self.assertEqual(0, core.x)
self.assertEqual(0, core.y)
dagudashaag = Sector("Dagudashaag", "# -1, 0")
self.assertEqual(-1, dagudashaag.x)
self.assertEqual(0, dagudashaag.y)
galaxy.sectors[core.name] = core
galaxy.sectors[dagudashaag.name] = dagudashaag
# verify, before bounding sectors gets run, nothing is hooked up
self.assertIsNone(galaxy.sectors[core.name].coreward)
self.assertIsNone(galaxy.sectors[core.name].rimward)
self.assertIsNone(galaxy.sectors[core.name].spinward)
self.assertIsNone(galaxy.sectors[core.name].trailing)
self.assertIsNone(galaxy.sectors[dagudashaag.name].coreward)
self.assertIsNone(galaxy.sectors[dagudashaag.name].rimward)
self.assertIsNone(galaxy.sectors[dagudashaag.name].spinward)
self.assertIsNone(galaxy.sectors[dagudashaag.name].trailing)
# set bounding sectors
galaxy.set_bounding_sectors()
# now assert that Dagudashaag is spinward from Core, Core is trailing of Dagudashaag, and nothing else
# got set
self.assertEqual(galaxy.sectors[dagudashaag.name], galaxy.sectors[core.name].spinward, "Dagudashaag should be spinward of core")
self.assertIsNone(galaxy.sectors[core.name].coreward, "Nothing should be coreward of Core")
self.assertIsNone(galaxy.sectors[core.name].rimward, "Nothing should be rimward of Core")
self.assertIsNone(galaxy.sectors[core.name].trailing, "Nothing should be trailing of core")
self.assertIsNone(galaxy.sectors[dagudashaag.name].coreward, "Nothing should be coreward of Dagudashaag")
self.assertIsNone(galaxy.sectors[dagudashaag.name].rimward, "Nothing should be rimward of Dagudashaag")
self.assertIsNone(galaxy.sectors[dagudashaag.name].spinward, "Nothing should be spinward of Dagudashaag")
self.assertEqual(galaxy.sectors[core.name], galaxy.sectors[dagudashaag.name].trailing, "Core should be trailing of Dagudashaag")
| 46.205882 | 136 | 0.70401 | 577 | 4,713 | 5.743501 | 0.131716 | 0.15691 | 0.185878 | 0.245021 | 0.678636 | 0.641521 | 0.585999 | 0.278817 | 0.117683 | 0.088715 | 0 | 0.006275 | 0.188415 | 4,713 | 101 | 137 | 46.663366 | 0.860131 | 0.124973 | 0 | 0.065574 | 0 | 0 | 0.160961 | 0 | 0 | 0 | 0 | 0 | 0.655738 | 1 | 0.032787 | false | 0 | 0.081967 | 0 | 0.131148 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a11c870ae3ef5f8dd838f6f8d4edc0a12f86fa5e | 188 | py | Python | py_boot/test.py | davidcawork/Investigacion | ed25678cbab26e30370e9e2d07b84029bbad4d0b | [
"Apache-2.0"
] | null | null | null | py_boot/test.py | davidcawork/Investigacion | ed25678cbab26e30370e9e2d07b84029bbad4d0b | [
"Apache-2.0"
] | null | null | null | py_boot/test.py | davidcawork/Investigacion | ed25678cbab26e30370e9e2d07b84029bbad4d0b | [
"Apache-2.0"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Firefox()
driver.get('https://www.google.com')
time.sleep(60)
driver.close()
| 20.888889 | 47 | 0.787234 | 27 | 188 | 5.481481 | 0.62963 | 0.162162 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011696 | 0.090426 | 188 | 8 | 48 | 23.5 | 0.853801 | 0 | 0 | 0 | 0 | 0 | 0.117021 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 0.428571 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
a12cb244767dfa01e9b581f3a545006ea34d4ac7 | 1,568 | py | Python | string_1/hello_name.py | nhutnamhcmus/coding-bat-solutions | 5f780a4027a6c3523a72961db1bad547c997fdc6 | [
"MIT"
] | 1 | 2020-09-19T18:02:13.000Z | 2020-09-19T18:02:13.000Z | string_1/hello_name.py | nhutnamhcmus/coding-bat-solutions | 5f780a4027a6c3523a72961db1bad547c997fdc6 | [
"MIT"
] | null | null | null | string_1/hello_name.py | nhutnamhcmus/coding-bat-solutions | 5f780a4027a6c3523a72961db1bad547c997fdc6 | [
"MIT"
] | null | null | null | # =======================================================================================================================================
# VNU-HCM, University of Science
# Department Computer Science, Faculty of Information Technology
# Authors: Nhut-Nam Le (Tich Phan Suy Rong)
# © 2020
"""
Given a string name, e.g. "Bob", return a greeting of the form "Hello Bob!".
For example test case:
hello_name('Bob') → 'Hello Bob!'
hello_name('Alice') → 'Hello Alice!'
hello_name('X') → 'Hello X!'
"""
import unittest
def hello_name(name):
return "Hello " + name + "!"
class TestHelloName(unittest.TestCase):
def test_case_00(self):
self.assertEqual(hello_name('Bob'), 'Hello Bob!')
def test_case_01(self):
self.assertEqual(hello_name('Alice'), 'Hello Alice!')
def test_case_02(self):
self.assertEqual(hello_name('X'), 'Hello X!')
def test_case_03(self):
self.assertEqual(hello_name('Dolly'), 'Hello Dolly!')
def test_case_04(self):
self.assertEqual(hello_name('Alpha'), 'Hello Alpha!')
def test_case_05(self):
self.assertEqual(hello_name('Omega'), 'Hello Omega!')
def test_case_06(self):
self.assertEqual(hello_name('Goodbye'), 'Hello Goodbye!')
def test_case_07(self):
self.assertEqual(hello_name('ho ho ho'), 'Hello ho ho ho!')
def test_case_08(self):
self.assertEqual(hello_name('xyz!'), 'Hello xyz!!')
def test_case_09(self):
self.assertEqual(hello_name('Hello'), 'Hello Hello!')
if __name__ == "__main__":
unittest.main()
| 27.508772 | 137 | 0.598852 | 201 | 1,568 | 4.482587 | 0.323383 | 0.149834 | 0.122087 | 0.266371 | 0.310766 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018576 | 0.17602 | 1,568 | 56 | 138 | 28 | 0.675697 | 0.305485 | 0 | 0 | 0 | 0 | 0.168059 | 0 | 0 | 0 | 0 | 0 | 0.384615 | 1 | 0.423077 | false | 0 | 0.038462 | 0.038462 | 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 | 1 | 0 | 0 | 3 |
a12f2dc13e43b20caf3450c97b9fa9395b547d8a | 335 | py | Python | materials/ch_04/escape_str.py | epsilonxe/RMUTT_09090016 | 863dd8a6471b560831b742da4aec27209c294df5 | [
"MIT"
] | null | null | null | materials/ch_04/escape_str.py | epsilonxe/RMUTT_09090016 | 863dd8a6471b560831b742da4aec27209c294df5 | [
"MIT"
] | null | null | null | materials/ch_04/escape_str.py | epsilonxe/RMUTT_09090016 | 863dd8a6471b560831b742da4aec27209c294df5 | [
"MIT"
] | null | null | null | text1 = '''ABCDEF
GHIJKL
MNOPQRS
TUVWXYZ
'''
text2 = 'ABCDEF\
GHIJKL\
MNOPQRS\
TUVWXYZ'
text3 = 'ABCD\'EF\'GHIJKL'
text4 = 'ABCDEF\nGHIJKL\nMNOPQRS\nTUVWXYZ'
text5 = 'ABCDEF\fGHIJKL\fMNOPQRS\fTUVWXYZ'
print(text1)
print('-' * 25)
print(text2)
print('-' * 25)
print(text3)
print('-' * 25)
print(text4)
print('-' * 25)
print(text5) | 12.884615 | 42 | 0.671642 | 42 | 335 | 5.357143 | 0.452381 | 0.124444 | 0.213333 | 0.231111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.061856 | 0.131343 | 335 | 26 | 43 | 12.884615 | 0.71134 | 0 | 0 | 0.190476 | 0 | 0 | 0.324405 | 0.190476 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.428571 | 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 | 1 | 0 | 3 |
a13d78de55aa35e5195b6d00dd9af4b319aa1688 | 5,290 | py | Python | misc/src/scheduler_plugin.py | hivesolutions/colony_plugins | cfd8fb2ac58037e01002966704b8a642feb37895 | [
"Apache-1.1"
] | 1 | 2016-10-30T09:51:06.000Z | 2016-10-30T09:51:06.000Z | misc/src/scheduler_plugin.py | hivesolutions/colony_plugins | cfd8fb2ac58037e01002966704b8a642feb37895 | [
"Apache-1.1"
] | 1 | 2015-12-29T18:51:07.000Z | 2015-12-29T18:51:07.000Z | misc/src/scheduler_plugin.py | hivesolutions/colony_plugins | cfd8fb2ac58037e01002966704b8a642feb37895 | [
"Apache-1.1"
] | 1 | 2018-01-26T12:54:13.000Z | 2018-01-26T12:54:13.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Colony Framework
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Colony Framework.
#
# Hive Colony Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foundation, either version 2.0 of the License, or (at your option) any
# later version.
#
# Hive Colony Framework is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Apache License for more details.
#
# You should have received a copy of the Apache License along with
# Hive Colony Framework. If not, see <http://www.apache.org/licenses/>.
__author__ = "João Magalhães <joamag@hive.pt>"
""" The author(s) of the module """
__version__ = "1.0.0"
""" The version of the module """
__revision__ = "$LastChangedRevision$"
""" The revision number of the module """
__date__ = "$LastChangedDate$"
""" The last change date of the module """
__copyright__ = "Copyright (c) 2008-2020 Hive Solutions Lda."
""" The copyright for the module """
__license__ = "Apache License, Version 2.0"
""" The license for the module """
import colony
class SchedulerPlugin(colony.Plugin):
"""
The main class for the Scheduler plugin.
"""
id = "pt.hive.colony.plugins.misc.scheduler"
name = "Scheduler"
description = "A plugin to manage the scheduling of tasks"
version = "1.0.0"
author = "Hive Solutions Lda. <development@hive.pt>"
platforms = [
colony.CPYTHON_ENVIRONMENT
]
capabilities = [
"main",
"scheduler",
"console_command_extension"
]
dependencies = [
colony.PluginDependency("pt.hive.colony.plugins.misc.guid"),
colony.PluginDependency("pt.hive.colony.plugins.console")
]
main_modules = [
"scheduler_c"
]
def load_plugin(self):
colony.Plugin.load_plugin(self)
import scheduler_c
self.system = scheduler_c.Scheduler(self)
self.console = scheduler_c.ConsoleScheduler(self)
self.release_ready_semaphore()
def end_load_plugin(self):
colony.Plugin.end_load_plugin(self)
self.system.load_scheduler()
def unload_plugin(self):
colony.Plugin.unload_plugin(self)
self.system.unload_scheduler()
self.release_ready_semaphore()
def end_unload_plugin(self):
colony.Plugin.end_unload_plugin(self)
self.release_ready_semaphore()
@colony.set_configuration_property
def set_configuration_property(self, property_name, property):
colony.Plugin.set_configuration_property(self, property_name, property)
@colony.unset_configuration_property
def unset_configuration_property(self, property_name):
colony.Plugin.unset_configuration_property(self, property_name)
def get_console_extension_name(self):
return self.console.get_console_extension_name()
def get_commands_map(self):
return self.console.get_commands_map()
def register_task(self, task, time):
return self.system.register_task(task, time)
def register_task_absolute(self, task, absolute_time):
return self.system.register_task_absolute(task, absolute_time)
def register_task_date_time(self, task, date_time):
return self.system.register_task_date_time(task, date_time)
def register_task_date_time_absolute(self, task, absolute_date_time):
return self.system.register_task_date_time_absolute(task, absolute_date_time)
def register_task_recursive(self, task, time, recursion_list):
return self.system.register_task_recursive(task, time, recursion_list)
def register_task_absolute_recursive(self, task, absolute_time, recursion_list):
return self.system.register_task_absolute_recursive(task, absolute_time, recursion_list)
def register_task_date_time_recursive(self, task, date_time, recursion_list):
return self.system.register_task_date_time_recursive(task, date_time, recursion_list)
def register_task_date_time_absolute_recursive(self, task, absolute_date_time, recursion_list):
return self.system.register_task_date_time_absolute_recursive(task, absolute_date_time, recursion_list)
def unregister_task(self, task):
return self.system.unregister_task(task)
def get_task_class(self):
"""
Retrieves the class that represents
a task in the current scope.
:rtype: Class
:return: The task class for the current scope.
"""
return self.system.get_task_class()
@colony.set_configuration_property_method("startup_configuration")
def startup_configuration_set_configuration_property(self, property_name, property):
self.system.set_startup_configuration_property(property)
@colony.unset_configuration_property_method("startup_configuration")
def startup_configuration_unset_configuration_property(self, property_name):
self.system.unset_startup_configuration_property()
| 35.986395 | 112 | 0.709074 | 655 | 5,290 | 5.451908 | 0.236641 | 0.053766 | 0.040325 | 0.053766 | 0.464576 | 0.354803 | 0.210585 | 0.178101 | 0.056567 | 0.031924 | 0 | 0.006427 | 0.20586 | 5,290 | 146 | 113 | 36.232877 | 0.843609 | 0.17259 | 0 | 0.0375 | 0 | 0 | 0.109697 | 0.05294 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.025 | 0.1375 | 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 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
a17f65f1db1e9d6fc0255b219c8e7f7acd085081 | 287 | py | Python | simple_functions/__init__.py | JihaoXin/ci_acse1 | 6ba30368cc2000bb13aab0dc213837d530753612 | [
"MIT"
] | null | null | null | simple_functions/__init__.py | JihaoXin/ci_acse1 | 6ba30368cc2000bb13aab0dc213837d530753612 | [
"MIT"
] | null | null | null | simple_functions/__init__.py | JihaoXin/ci_acse1 | 6ba30368cc2000bb13aab0dc213837d530753612 | [
"MIT"
] | null | null | null | from .functions1 import my_sum, factorial
from .constants import pi
from .print import myprint
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
pass
| 28.7 | 64 | 0.811847 | 34 | 287 | 6.5 | 0.705882 | 0.135747 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004082 | 0.146341 | 287 | 9 | 65 | 31.888889 | 0.897959 | 0.083624 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.125 | 0.5 | 0 | 0.5 | 0.125 | 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 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
a1b3738a830ad504560b84aa6870219df1d05595 | 182 | py | Python | tudo/ex052.py | Ramon-Erik/Exercicios-Python | 158a7f1846dd3d486aa0517fa337d46d73aab649 | [
"MIT"
] | 1 | 2021-07-08T00:35:57.000Z | 2021-07-08T00:35:57.000Z | tudo/ex052.py | Ramon-Erik/Exercicios-Python | 158a7f1846dd3d486aa0517fa337d46d73aab649 | [
"MIT"
] | null | null | null | tudo/ex052.py | Ramon-Erik/Exercicios-Python | 158a7f1846dd3d486aa0517fa337d46d73aab649 | [
"MIT"
] | null | null | null | n = int(input('Digite um número: '))
if n % 2 == 0 and n % 3 == 0 and n % 5 == 0:
print('{} é um número primo!'.format(n))
else:
print('{} não é um número primo!'.format(n))
| 30.333333 | 48 | 0.543956 | 34 | 182 | 2.911765 | 0.529412 | 0.242424 | 0.10101 | 0.282828 | 0.424242 | 0.424242 | 0 | 0 | 0 | 0 | 0 | 0.043478 | 0.241758 | 182 | 5 | 49 | 36.4 | 0.673913 | 0 | 0 | 0 | 0 | 0 | 0.351648 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.4 | 0 | 0 | 0 | null | 1 | 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 | 3 |
a1b607b0cbf4748eb3756401b6e1bc4bdb961ebc | 115 | py | Python | ex016.py | Rhodytesla/PythonMundo01 | bac3e1a7ca3934c712423bfc606d16a4ea9af53a | [
"MIT"
] | null | null | null | ex016.py | Rhodytesla/PythonMundo01 | bac3e1a7ca3934c712423bfc606d16a4ea9af53a | [
"MIT"
] | null | null | null | ex016.py | Rhodytesla/PythonMundo01 | bac3e1a7ca3934c712423bfc606d16a4ea9af53a | [
"MIT"
] | null | null | null | import math
a = float(input('insira um valor'))
print('a porção inteira do valor {} é {}'.format(a,math.trunc(a))) | 28.75 | 66 | 0.678261 | 20 | 115 | 3.9 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 115 | 4 | 66 | 28.75 | 0.78 | 0 | 0 | 0 | 0 | 0 | 0.413793 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
a1bbcc80b20916c2b274dcf7f69fc4ce858c7f88 | 735 | py | Python | secondstate/converters.py | fruiti-ltd/secondstate | 81fe6916b92c7024372a95f0eb9d50f6275dfc69 | [
"BSD-3-Clause"
] | 1 | 2021-05-28T23:02:08.000Z | 2021-05-28T23:02:08.000Z | secondstate/converters.py | fruiti-ltd/secondstate | 81fe6916b92c7024372a95f0eb9d50f6275dfc69 | [
"BSD-3-Clause"
] | null | null | null | secondstate/converters.py | fruiti-ltd/secondstate | 81fe6916b92c7024372a95f0eb9d50f6275dfc69 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2021, Fruiti Limited
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from datetime import datetime
def convert_custom_timestamp_range(timestamp_range: str) -> list:
result = timestamp_range.split("_")
result[0] = convert_timestamp_to_iso_datetime(result[0])
result[1] = convert_timestamp_to_iso_datetime(result[1])
return result
def convert_iso_datetime_to_timestamp(iso_datetime: str) -> int:
return int(datetime.fromisoformat(iso_datetime).timestamp())
def convert_timestamp_to_iso_datetime(timestamp: int) -> str:
return str(datetime.fromtimestamp(int(timestamp)).isoformat())
| 29.4 | 71 | 0.771429 | 101 | 735 | 5.376238 | 0.455446 | 0.121547 | 0.099448 | 0.116022 | 0.18232 | 0.128913 | 0 | 0 | 0 | 0 | 0 | 0.012638 | 0.138776 | 735 | 24 | 72 | 30.625 | 0.845182 | 0.246259 | 0 | 0 | 0 | 0 | 0.001821 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.1 | 0.2 | 0.7 | 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 | 1 | 0 | 0 | 3 |
a1c01c9ff8dac8f635383495ea6d6042923c0487 | 2,849 | py | Python | mini projects/school_manager.py | Tryst480/python-tutorial | 056803f185b9cf31235fdfc221a3a490c353cd70 | [
"MIT"
] | null | null | null | mini projects/school_manager.py | Tryst480/python-tutorial | 056803f185b9cf31235fdfc221a3a490c353cd70 | [
"MIT"
] | null | null | null | mini projects/school_manager.py | Tryst480/python-tutorial | 056803f185b9cf31235fdfc221a3a490c353cd70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# This is gonna be up to you. But basically I envisioned a system where you have a students in a classroom. Where the
# classroom only has information, like who is the teacher, how many students are there. And it's like an online class,
# so students don't know who their peers are, or who their teacher is, but can do things like study, and take test and
# stuff. Etc. But get used to how objects interact with each other and try to call stuff from other places while being
# commanded all in main():
class Student:
def __init__(self, name, laziness=5):
self.name = name
self.preparedness = 0
self._laziness = laziness
def takeTest(self, hardness):
# TODO: return a score that's 100 - difference between hardness and preparedness (score capped at 100)
return 0
def doHomework(self):
# TODO: return a score of either 0 or 100 depending on how lazy they are. Implementation is up to you.
return 0
def study(self):
# TODO: increment preparedness by a random number between 1-10 (prerparedness capped at 100)
pass
class Teacher:
def __init__(self, name):
self.name = name
self.classroom = None
self.test_grades = {}
self.homework_grades = {}
def administerTest(self, students, hardness):
# TODO: Given a hardness of a test and list of students. Make each student take test and log their grades
pass
def giveHomework(self, students):
# TODO: Given homework to student and log in their grades
pass
def giveGrades(self, students):
# TODO: Given all the test scores and homework score in each student, give 30% to HW and 70% to test.
# TODO: Return list of passed students and remove them from classroom. Clear grades for all remaining students
pass
class ClassRoom:
def __init__(self):
self.class_size_limit = 10
self.students = {}
self.teacher = None
def addStudent(self, student):
# TODO: add student to class. Print something if they try to add the same student or go over the limit
pass
def assignTeacherToClass(self, teacher):
# TODO: Assign teacher, also prompt user if they want to switch teacher if one already assigned or same teacher
pass
def getStudents(self):
# TODO: return a list of students
return
if __name__ == '__main__':
classroom = ClassRoom()
teacher = Teacher('Doctor Jones')
mike = Student('Mike')
sally = Student('Sally', laziness=1)
lebron = Student('Lebron', laziness=10)
# TODO: Assign a teacher to the classroom and add the students to the classroom. Then make the students study
# TODO: Make Students to homework, etc, exams, then pass or fail them, etc. Play around with it.
| 36.525641 | 119 | 0.67708 | 413 | 2,849 | 4.610169 | 0.382567 | 0.016807 | 0.017332 | 0.015756 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014211 | 0.259038 | 2,849 | 77 | 120 | 37 | 0.887731 | 0.568972 | 0 | 0.25 | 0 | 0 | 0.028926 | 0 | 0 | 0 | 0 | 0.012987 | 0 | 1 | 0.3 | false | 0.15 | 0 | 0.075 | 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 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
b811e4d73c683e7404a77a68edf057c683bf41a7 | 1,872 | py | Python | tools/stimgen/gen_recall.py | herenvarno/gsbn | 47ed0932b605d8b3cf9661f9308908364ad5892e | [
"MIT"
] | 2 | 2016-08-12T15:06:02.000Z | 2021-10-05T08:12:17.000Z | tools/stimgen/gen_recall.py | herenvarno/gsbn | 47ed0932b605d8b3cf9661f9308908364ad5892e | [
"MIT"
] | 2 | 2017-04-23T17:22:23.000Z | 2017-05-25T14:22:51.000Z | tools/stimgen/gen_recall.py | herenvarno/gsbn | 47ed0932b605d8b3cf9661f9308908364ad5892e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import re
import math
import random
import matplotlib.pyplot as plt
import numpy as np
from google.protobuf import text_format
sys.path.append(os.path.dirname(os.path.realpath(__file__))+"/../../build")
import gsbn_pb2
if len(sys.argv) < 1:
print("Arguments wrong! Please retry with command :")
print("python "+os.path.realpath(__file__)+" <output file name>")
exit(-1)
filename = sys.argv[1]
patterns = []
masks = []
DIM_HCU = 10
DIM_MCU = 10
rd = gsbn_pb2.StimRawData()
p = [0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff]
patterns.append(p)
p = [0,1,2,3,4,5,6,7,8,9]
patterns.append(p)
p = [0,1,2,3,4,5,6,7,8,0xfffffff]
patterns.append(p)
p = [0,1,2,3,4,5,6,7,0x7fffffff,0x7fffffff]
patterns.append(p)
p = [0,1,2,3,4,5,6,0x7fffffff,0x7fffffff,0x7fffffff]
patterns.append(p)
p = [0,1,2,3,4,5,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff]
patterns.append(p)
p = [0,1,2,3,4,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff]
patterns.append(p)
p = [0,1,2,3,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff]
patterns.append(p)
p = [0,1,2,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff]
patterns.append(p)
p = [0,1,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff]
patterns.append(p)
p = [0,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff]
patterns.append(p)
m = [0,0,0,0,0,0,0,0,0,0]
masks.append(m)
m = [1,1,1,1,1,1,1,1,1,1]
masks.append(m)
for p in patterns:
for v in p:
rd.data.append(v)
for p in masks:
for v in p:
rd.mask.append(v)
rd.data_rows = len(patterns)
rd.data_cols = DIM_HCU
rd.mask_rows = len(masks)
rd.mask_cols = DIM_HCU
with open(filename, "wb+") as f:
f.write(rd.SerializeToString())
| 25.643836 | 115 | 0.744658 | 318 | 1,872 | 4.323899 | 0.242138 | 0.654545 | 0.785455 | 0.814545 | 0.586909 | 0.573818 | 0.573818 | 0.573818 | 0.573818 | 0.552 | 0 | 0.113596 | 0.092415 | 1,872 | 72 | 116 | 26 | 0.695703 | 0.010684 | 0 | 0.258621 | 0 | 0 | 0.045921 | 0 | 0 | 0 | 0.296596 | 0 | 0 | 1 | 0 | false | 0 | 0.155172 | 0 | 0.155172 | 0.034483 | 0 | 0 | 0 | null | 1 | 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 | 3 |
b81ecc580a437a3d551ab5dfa4a59c26d6b5e052 | 367 | py | Python | tests/routes/test_pages.py | Biosystems-Analytics-Lab/shellcast | 8d578bfa3d66d75502f1a133fe6263d376694247 | [
"CC-BY-4.0"
] | 5 | 2021-03-24T19:19:48.000Z | 2022-01-11T09:27:13.000Z | tests/routes/test_pages.py | Biosystems-Analytics-Lab/shellcast | 8d578bfa3d66d75502f1a133fe6263d376694247 | [
"CC-BY-4.0"
] | 1 | 2022-01-13T15:11:09.000Z | 2022-01-13T21:16:10.000Z | tests/routes/test_pages.py | Biosystems-Analytics-Lab/shellcast | 8d578bfa3d66d75502f1a133fe6263d376694247 | [
"CC-BY-4.0"
] | null | null | null | import pytest
def test_index(client):
res = client.get('/')
assert res.status_code == 200
def test_about(client):
res = client.get('/about')
assert res.status_code == 200
def test_preferences(client):
res = client.get('/preferences')
assert res.status_code == 200
def test_signin(client):
res = client.get('/signin')
assert res.status_code == 200
| 20.388889 | 34 | 0.700272 | 53 | 367 | 4.698113 | 0.283019 | 0.11245 | 0.240964 | 0.289157 | 0.437751 | 0.349398 | 0.349398 | 0 | 0 | 0 | 0 | 0.038835 | 0.158038 | 367 | 17 | 35 | 21.588235 | 0.76699 | 0 | 0 | 0.307692 | 0 | 0 | 0.070845 | 0 | 0 | 0 | 0 | 0 | 0.307692 | 1 | 0.307692 | false | 0 | 0.076923 | 0 | 0.384615 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b81fcb30f8bd89568af442548e95ceeba2331cfd | 412 | py | Python | Task -01/loop.py | kanzul12/cp19_voice_detector | db5478b118bab46897b4230d366e11b9ad65e0ce | [
"MIT"
] | 2 | 2019-04-19T08:26:09.000Z | 2019-04-30T12:52:58.000Z | Task -01/loop.py | kanzul12/cp19_voice_detector | db5478b118bab46897b4230d366e11b9ad65e0ce | [
"MIT"
] | 5 | 2019-05-03T07:47:35.000Z | 2019-05-13T08:37:11.000Z | Task -01/loop.py | kanzul12/cp19_voice_detector | db5478b118bab46897b4230d366e11b9ad65e0ce | [
"MIT"
] | null | null | null | num= int (input("enter number of rows="))
for i in range (1,num+1):
for j in range(1,num-i+1):
print (" ",end="")
for j in range(2 and 9):
print("2","9")
for i in range(1, 6):
for j in range(1, 10):
if i==5 or i+j==5 or j-i==4:
print("*", end="")
else:
print(end=" ")
print()
| 16.48 | 44 | 0.383495 | 63 | 412 | 2.507937 | 0.396825 | 0.221519 | 0.202532 | 0.208861 | 0.303797 | 0 | 0 | 0 | 0 | 0 | 0 | 0.069869 | 0.444175 | 412 | 24 | 45 | 17.166667 | 0.620087 | 0 | 0 | 0 | 0 | 0 | 0.064677 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.384615 | 0 | 0 | 0 | null | 1 | 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 | 3 |
629facc04419dcfc8b14e0e646d18577710d3fd8 | 134 | py | Python | Python/School/C7/q2.py | abdalrhmanyasser/Abdalrhman_Rep | e0fc3caa2cc04e92f591ccd7934586986d194000 | [
"CC0-1.0"
] | null | null | null | Python/School/C7/q2.py | abdalrhmanyasser/Abdalrhman_Rep | e0fc3caa2cc04e92f591ccd7934586986d194000 | [
"CC0-1.0"
] | null | null | null | Python/School/C7/q2.py | abdalrhmanyasser/Abdalrhman_Rep | e0fc3caa2cc04e92f591ccd7934586986d194000 | [
"CC0-1.0"
] | null | null | null | from random import *
l = []
for i in range(50):
l.append(randint(1, 100))
print(l)
for i in range(len(l)):
l[i] **= 2
print(l) | 16.75 | 29 | 0.58209 | 27 | 134 | 2.888889 | 0.592593 | 0.102564 | 0.128205 | 0.179487 | 0.307692 | 0 | 0 | 0 | 0 | 0 | 0 | 0.066667 | 0.216418 | 134 | 8 | 30 | 16.75 | 0.67619 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.125 | 0.25 | 1 | 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 | 3 |
62ae8dd259b43e9f8c27ede31598aad711abeea2 | 234 | py | Python | patches/reduceRNG.py | muffinjets/LADXR | bbd82a5b7bac015561bb6a4cfe1c5fa017f827f5 | [
"MIT"
] | 13 | 2020-09-13T16:50:28.000Z | 2022-03-22T20:49:54.000Z | patches/reduceRNG.py | muffinjets/LADXR | bbd82a5b7bac015561bb6a4cfe1c5fa017f827f5 | [
"MIT"
] | 10 | 2020-06-27T12:34:38.000Z | 2022-01-03T12:15:42.000Z | patches/reduceRNG.py | muffinjets/LADXR | bbd82a5b7bac015561bb6a4cfe1c5fa017f827f5 | [
"MIT"
] | 18 | 2020-05-29T17:48:04.000Z | 2022-02-08T03:36:08.000Z | from assembler import ASM
def slowdownThreeOfAKind(rom):
rom.patch(0x06, 0x096B, ASM("ldh a, [$E7]\nand $0F"), ASM("ldh a, [$E7]\nand $3F"))
def fixHorseHeads(rom):
rom.patch(0x07, 0x3653, "00010400", "00010000")
| 23.4 | 88 | 0.636752 | 32 | 234 | 4.65625 | 0.65625 | 0.080537 | 0.147651 | 0.120805 | 0.174497 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183246 | 0.183761 | 234 | 9 | 89 | 26 | 0.596859 | 0 | 0 | 0 | 0 | 0 | 0.257778 | 0 | 0 | 0 | 0.088889 | 0 | 0 | 1 | 0.4 | false | 0 | 0.2 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
62ca4cc5761e9a0a5eb64bd672778ab82de9c1ca | 1,676 | py | Python | wmata/rail/station.py | emma-k-alexandra/pywmata | b11e851f864defc0bda84f012dbe2a2c31c202d1 | [
"MIT"
] | 5 | 2019-12-28T20:18:22.000Z | 2021-09-12T17:28:00.000Z | wmata/rail/station.py | emma-k-alexandra/pywmata | b11e851f864defc0bda84f012dbe2a2c31c202d1 | [
"MIT"
] | null | null | null | wmata/rail/station.py | emma-k-alexandra/pywmata | b11e851f864defc0bda84f012dbe2a2c31c202d1 | [
"MIT"
] | 1 | 2021-06-28T16:08:08.000Z | 2021-06-28T16:08:08.000Z | """MetroRail Station related structures
"""
from enum import Enum
from typing import Any, Optional
class Station(Enum):
"""A MetroRail Station
"""
A01 = "A01"
A02 = "A02"
A03 = "A03"
A04 = "A04"
A05 = "A05"
A06 = "A06"
A07 = "A07"
A08 = "A08"
A09 = "A09"
A10 = "A10"
A11 = "A11"
A12 = "A12"
A13 = "A13"
A14 = "A14"
A15 = "A15"
B01 = "B01"
B02 = "B02"
B03 = "B03"
B04 = "B04"
B05 = "B05"
B06 = "B06"
B07 = "B07"
B08 = "B08"
B09 = "B09"
B10 = "B10"
B11 = "B11"
B35 = "B35"
C01 = "C01"
C02 = "C02"
C03 = "C03"
C04 = "C04"
C05 = "C05"
C06 = "C06"
C07 = "C07"
C08 = "C08"
C09 = "C09"
C10 = "C10"
C12 = "C12"
C13 = "C13"
C14 = "C14"
C15 = "C15"
D01 = "D01"
D02 = "D02"
D03 = "D03"
D04 = "D04"
D05 = "D05"
D06 = "D06"
D07 = "D07"
D08 = "D08"
D09 = "D09"
D10 = "D10"
D11 = "D11"
D12 = "D12"
D13 = "D13"
E01 = "E01"
E02 = "E02"
E03 = "E03"
E04 = "E04"
E05 = "E05"
E06 = "E06"
E07 = "E07"
E08 = "E08"
E09 = "E09"
E10 = "E10"
F01 = "F01"
F02 = "F02"
F03 = "F03"
F04 = "F04"
F05 = "F05"
F06 = "F06"
F07 = "F07"
F08 = "F08"
F09 = "F09"
F10 = "F10"
F11 = "F11"
G01 = "G01"
G02 = "G02"
G03 = "G03"
G04 = "G04"
G05 = "G05"
J02 = "J02"
J03 = "J03"
K01 = "K01"
K02 = "K02"
K03 = "K03"
K04 = "K04"
K05 = "K05"
K06 = "K06"
K07 = "K07"
K08 = "K08"
N01 = "N01"
N02 = "N02"
N03 = "N03"
N04 = "N04"
N06 = "N06"
| 16.115385 | 39 | 0.406325 | 209 | 1,676 | 3.258373 | 0.511962 | 0.04699 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.386965 | 0.414081 | 1,676 | 103 | 40 | 16.271845 | 0.306517 | 0.036396 | 0 | 0 | 0 | 0 | 0.177792 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.020408 | 0 | 1 | 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 | 1 | 0 | 0 | 3 |
62e0a00977882b69ee47910edb8fb49b209ff9a7 | 1,251 | py | Python | applications/admin/models/menu.py | forca-inf/forca | 99b63c63a7aaebd6f11cb4f73ec54de54ce25986 | [
"BSD-3-Clause"
] | 6 | 2018-01-25T01:07:55.000Z | 2019-04-26T23:58:29.000Z | applications/admin/models/menu.py | forca-inf/forca | 99b63c63a7aaebd6f11cb4f73ec54de54ce25986 | [
"BSD-3-Clause"
] | null | null | null | applications/admin/models/menu.py | forca-inf/forca | 99b63c63a7aaebd6f11cb4f73ec54de54ce25986 | [
"BSD-3-Clause"
] | 2 | 2018-02-03T02:55:56.000Z | 2018-02-06T19:55:10.000Z | # ###########################################################
# ## generate menu
# ###########################################################
_a = request.application
_c = request.controller
_f = request.function
response.title = '%s %s' % (_f, '/'.join(request.args))
response.subtitle = 'admin'
response.menu = [(T('site'), _f == 'site', URL(_a,'default','site'))]
if request.args:
_t = request.args[0]
response.menu.append((T('edit'), _c == 'default' and _f == 'design',
URL(_a,'default','design',args=_t)))
response.menu.append((T('about'), _c == 'default' and _f == 'about',
URL(_a,'default','about',args=_t)))
response.menu.append((T('errors'), _c == 'default' and _f == 'errors',
URL(_a,'default','errors',args=_t)))
response.menu.append((T('versioning'),
_c == 'mercurial' and _f == 'commit',
URL(_a,'mercurial','commit',args=_t)))
if not session.authorized:
response.menu = [(T('login'), True, '')]
else:
response.menu.append((T('logout'), False,
URL(_a,'default',f='logout')))
response.menu.append((T('help'), False, URL('examples','default','index')))
| 37.909091 | 75 | 0.490807 | 134 | 1,251 | 4.402985 | 0.313433 | 0.162712 | 0.183051 | 0.19322 | 0.122034 | 0.122034 | 0 | 0 | 0 | 0 | 0 | 0.001027 | 0.221423 | 1,251 | 32 | 76 | 39.09375 | 0.604723 | 0.010392 | 0 | 0 | 1 | 0 | 0.188288 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
62f07ff59fb064975f519a1d53028c1dfda5c299 | 4,582 | py | Python | typed_python/compiler/type_wrappers/ref_to_wrapper.py | APrioriInvestments/typed_python | a3191e5d30333eba156c2a910abc78f7813dcaa3 | [
"Apache-2.0"
] | 105 | 2019-12-02T01:44:46.000Z | 2022-03-28T20:27:38.000Z | typed_python/compiler/type_wrappers/ref_to_wrapper.py | APrioriInvestments/typed_python | a3191e5d30333eba156c2a910abc78f7813dcaa3 | [
"Apache-2.0"
] | 173 | 2019-10-08T19:37:06.000Z | 2022-01-24T18:43:42.000Z | typed_python/compiler/type_wrappers/ref_to_wrapper.py | APrioriInvestments/typed_python | a3191e5d30333eba156c2a910abc78f7813dcaa3 | [
"Apache-2.0"
] | 1 | 2020-01-23T00:06:42.000Z | 2020-01-23T00:06:42.000Z | # Copyright 2017-2019 typed_python Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typed_python.compiler.type_wrappers.wrapper import Wrapper
from typed_python.compiler.typed_expression import TypedExpression
from typed_python._types import refTo
import typed_python.compiler.native_ast as native_ast
import typed_python.compiler
typeWrapper = lambda t: typed_python.compiler.python_object_representation.typedPythonTypeToTypeWrapper(t)
class RefToObjectWrapper(Wrapper):
is_pod = True
is_empty = False
is_pass_by_ref = False
def __init__(self):
super().__init__(refTo)
def getNativeLayoutType(self):
return native_ast.Type.Void()
@Wrapper.unwrapOneOfAndValue
def convert_call(self, context, expr, args, kwargs):
if len(args) != 1 or kwargs:
return super().convert_call(context, expr, args, kwargs)
return args[0].expr_type.convert_refTo(context, args[0])
class RefToWrapper(Wrapper):
is_pod = True
is_empty = False
is_pass_by_ref = False
def __init__(self, t):
super().__init__(t)
self.layoutType = typeWrapper(t.ElementType).getNativeLayoutType().pointer()
def underlyingTypeWrapper(self):
return typeWrapper(self.typeRepresentation.ElementType)
def getNativeLayoutType(self):
return self.layoutType
def convert_assign(self, context, target, toStore):
assert target.isReference
context.pushEffect(
target.expr.store(toStore.nonref_expr)
)
def convert_copy_initialize(self, context, target, toStore):
assert target.isReference
context.pushEffect(
target.expr.store(toStore.nonref_expr)
)
def deref(self, instance):
return TypedExpression(
instance.context,
instance.nonref_expr,
typeWrapper(self.typeRepresentation.ElementType),
True
)
def convert_destroy(self, context, instance):
pass
def _can_convert_to_type(self, targetType, conversionLevel):
return self.underlyingTypeWrapper._can_convert_to_type(targetType, conversionLevel)
def convert_to_type_with_target(self, context, instance, targetVal, conversionLevel, mayThrowOnFailure=False):
return self.deref(instance).convert_to_type_with_target(targetVal, conversionLevel)
def convert_bin_op(self, context, left, op, right, inplace):
return self.deref(left).convert_bin_op(op, right, inplace)
def convert_unary_op(self, context, left, op):
return self.deref(left).convert_unary_op(op)
def convert_attribute(self, context, instance, attr):
return self.deref(instance).convert_attribute(attr)
def convert_getitem(self, context, instance, key):
return self.deref(instance).convert_getitem(key)
def convert_setitem(self, context, instance, key, val):
return self.deref(instance).convert_setitem(key, val)
def convert_method_call(self, context, instance, methodname, args, kwargs):
return self.deref(instance).convert_method_call(methodname, args, kwargs)
def convert_set_attribute(self, context, instance, attribute, value):
return self.deref(instance).convert_set_attribute(attribute, value)
def convert_hash(self, context, expr):
return self.deref(expr).convert_hash()
def convert_call(self, context, expr, args, kwargs):
self.deref(expr).convert_call(args, kwargs)
def convert_len(self, context, expr):
self.deref(expr).convert_len()
def convert_abs(self, context, expr):
self.deref(expr).convert_abs()
def convert_repr(self, context, expr):
self.deref(expr).convert_repr()
def convert_builtin(self, f, context, expr, a1=None):
self.deref(expr).convert_builtin(a1)
def convert_comparison(self, context, l, op, r):
self.deref(l).convert_comparison(op, r)
def convert_bin_op_reverse(self, context, r, op, l, inplace):
self.deref(r).convert_bin_op_reverse(op, l, inplace)
| 34.451128 | 114 | 0.712134 | 573 | 4,582 | 5.502618 | 0.275742 | 0.063432 | 0.042816 | 0.043768 | 0.253727 | 0.155725 | 0.155725 | 0.122423 | 0.097685 | 0.097685 | 0 | 0.00462 | 0.196857 | 4,582 | 132 | 115 | 34.712121 | 0.852174 | 0.126582 | 0 | 0.192771 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024096 | 1 | 0.325301 | false | 0.036145 | 0.060241 | 0.168675 | 0.674699 | 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 | 1 | 0 | 0 | 3 |
1a021e021146cbc33766d3c7997455d63709bb09 | 167 | py | Python | python/testData/inspections/PyUnresolvedReferencesInspection3K/asyncInitMethod.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/inspections/PyUnresolvedReferencesInspection3K/asyncInitMethod.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/inspections/PyUnresolvedReferencesInspection3K/asyncInitMethod.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | class A:
<error descr="function \"__init__\" cannot be async">async</error> def __init__(self):
self.foo = '2'
self.bar = '3'
a = A()
print(a.foo) | 23.857143 | 90 | 0.580838 | 25 | 167 | 3.56 | 0.64 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015748 | 0.239521 | 167 | 7 | 91 | 23.857143 | 0.685039 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.166667 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1a183c6499418e4965e990ea2623cf57e6ec50c1 | 340 | py | Python | turtle/snowflake.py | yunzhang599/Python3_Package_Examples | 3e479925f3f6818bf35e46123f720839acf075eb | [
"MIT"
] | 1 | 2019-11-16T05:06:01.000Z | 2019-11-16T05:06:01.000Z | turtle/snowflake.py | yunzhang599/Python3_Package_Examples | 3e479925f3f6818bf35e46123f720839acf075eb | [
"MIT"
] | null | null | null | turtle/snowflake.py | yunzhang599/Python3_Package_Examples | 3e479925f3f6818bf35e46123f720839acf075eb | [
"MIT"
] | null | null | null |
from turtle import forward, left, right, width, color, clearscreen
clearscreen()
color("lightblue")
width(3)
for i in range(6):
forward(50)
left(60)
forward(25)
left(180)
forward(25)
left(60)
forward(25)
left(180)
forward(25)
right(120)
forward(25)
left(180)
forward(75)
left(120)
| 14.782609 | 66 | 0.608824 | 47 | 340 | 4.404255 | 0.468085 | 0.217391 | 0.251208 | 0.231884 | 0.410628 | 0.299517 | 0.299517 | 0.299517 | 0 | 0 | 0 | 0.139442 | 0.261765 | 340 | 22 | 67 | 15.454545 | 0.685259 | 0 | 0 | 0.526316 | 0 | 0 | 0.026549 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.052632 | 0 | 0.052632 | 0 | 0 | 0 | 0 | null | 1 | 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 | 3 |
1a20018810aca71e231531dd6b4c27f07d98ddd0 | 289 | py | Python | gadget/reboot.py | vaginessa/RaspberryPiZero_HID_MultiTool | c6227c7263cb1321a5655f938462392eb014a352 | [
"Apache-2.0"
] | 54 | 2017-01-06T21:43:40.000Z | 2022-02-14T02:57:57.000Z | gadget/reboot.py | vaginessa/RaspberryPiZero_HID_MultiTool | c6227c7263cb1321a5655f938462392eb014a352 | [
"Apache-2.0"
] | null | null | null | gadget/reboot.py | vaginessa/RaspberryPiZero_HID_MultiTool | c6227c7263cb1321a5655f938462392eb014a352 | [
"Apache-2.0"
] | 13 | 2017-01-31T23:35:21.000Z | 2021-12-22T12:48:59.000Z | #!/usr/bin/python
import RPi.GPIO as GPIO
import os
gpio_pin_number=21
GPIO.setmode(GPIO.BCM)
GPIO.setup(gpio_pin_number, GPIO.IN, pull_up_down=GPIO.PUD_UP)
try:
GPIO.wait_for_edge(gpio_pin_number, GPIO.FALLING)
os.system("sudo shutdown -h now")
except:
pass
GPIO.cleanup()
| 18.0625 | 62 | 0.750865 | 51 | 289 | 4.039216 | 0.627451 | 0.101942 | 0.18932 | 0.165049 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007937 | 0.128028 | 289 | 15 | 63 | 19.266667 | 0.809524 | 0.055363 | 0 | 0 | 0 | 0 | 0.073801 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.090909 | 0.181818 | 0 | 0.181818 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
1a257d44848898125832b45b07d58d12e6e91f60 | 1,266 | py | Python | modelzoo/migrations/0024_auto_20201014_1425.py | SuperElastix/ElastixModelZooWebsite | 00d7b4aec8eb04c285d3771d53310079a3443fab | [
"Apache-2.0"
] | 1 | 2021-11-15T07:30:24.000Z | 2021-11-15T07:30:24.000Z | modelzoo/migrations/0024_auto_20201014_1425.py | SuperElastix/ElastixModelZooWebsite | 00d7b4aec8eb04c285d3771d53310079a3443fab | [
"Apache-2.0"
] | null | null | null | modelzoo/migrations/0024_auto_20201014_1425.py | SuperElastix/ElastixModelZooWebsite | 00d7b4aec8eb04c285d3771d53310079a3443fab | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.3 on 2020-10-14 12:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('modelzoo', '0023_model_con_mod_dims'),
]
operations = [
migrations.RemoveField(
model_name='model',
name='author_email',
),
migrations.RemoveField(
model_name='model',
name='author_name',
),
migrations.RemoveField(
model_name='model',
name='description',
),
migrations.RemoveField(
model_name='model',
name='paper',
),
migrations.RemoveField(
model_name='model',
name='readme_txt',
),
migrations.RemoveField(
model_name='model',
name='screenshot',
),
migrations.RemoveField(
model_name='model',
name='short_description',
),
migrations.AlterField(
model_name='model',
name='modality',
field=models.CharField(blank=True, choices=[('CT', 'CT'), ('Ultrasound', 'Ultrasound'), ('MRI', 'MRI'), ('PET', 'PET'), ('X-Ray', 'X-Ray')], default='', max_length=15),
),
]
| 26.93617 | 180 | 0.518167 | 112 | 1,266 | 5.705357 | 0.473214 | 0.225352 | 0.175274 | 0.225352 | 0.446009 | 0.446009 | 0.140845 | 0 | 0 | 0 | 0 | 0.02515 | 0.340442 | 1,266 | 46 | 181 | 27.521739 | 0.74012 | 0.035545 | 0 | 0.575 | 1 | 0 | 0.164889 | 0.018868 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.025 | 0 | 0.1 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1a2b8e3fe78c16eea9e7fc19485f21ac4d60d622 | 22 | py | Python | middleman/api/application/__init__.py | scooterman/middleman | c765c9157cce02574e7191608dacd573156e333b | [
"Xnet",
"X11"
] | 5 | 2020-03-19T07:19:49.000Z | 2021-09-29T06:33:47.000Z | trends/__init__.py | victorkifer/SocialMediaTopTrends | 32098f1621059700d9ca6437a988956ebe1d319a | [
"MIT"
] | 22 | 2015-09-20T14:00:16.000Z | 2021-06-10T20:08:25.000Z | trends/__init__.py | victorkifer/SocialMediaTopTrends | 32098f1621059700d9ca6437a988956ebe1d319a | [
"MIT"
] | 6 | 2015-12-14T21:05:01.000Z | 2019-11-02T19:35:24.000Z | __author__ = 'victor'
| 11 | 21 | 0.727273 | 2 | 22 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136364 | 22 | 1 | 22 | 22 | 0.631579 | 0 | 0 | 0 | 0 | 0 | 0.272727 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
a7f28bd0d14c90ec88699bf98d0a9fe7b8320366 | 583 | py | Python | tests/test_decisions.py/test_binary_decision.py | evanofslack/pyminion | 0d0bfc6d8e84e9f33e617c7d01b6edb649166290 | [
"MIT"
] | 5 | 2021-12-17T20:34:55.000Z | 2022-01-24T15:18:05.000Z | tests/test_decisions.py/test_binary_decision.py | evanofslack/pyminion | 0d0bfc6d8e84e9f33e617c7d01b6edb649166290 | [
"MIT"
] | 31 | 2021-10-29T21:05:00.000Z | 2022-03-22T03:27:14.000Z | tests/test_decisions.py/test_binary_decision.py | evanofslack/pyminion | 0d0bfc6d8e84e9f33e617c7d01b6edb649166290 | [
"MIT"
] | 1 | 2021-12-23T18:32:47.000Z | 2021-12-23T18:32:47.000Z | from pyminion.decisions import binary_decision
def test_yes_input(monkeypatch):
monkeypatch.setattr("builtins.input", lambda _: "y")
assert binary_decision(prompt="test") is True
def test_no_input(monkeypatch):
monkeypatch.setattr("builtins.input", lambda _: "n")
assert binary_decision(prompt="test") is False
def test_invalid_input(monkeypatch):
import pytest
from pyminion.exceptions import InvalidBinaryInput
monkeypatch.setattr("builtins.input", lambda _: "")
with pytest.raises(InvalidBinaryInput):
binary_decision(prompt="test")
| 27.761905 | 56 | 0.749571 | 67 | 583 | 6.328358 | 0.41791 | 0.132075 | 0.183962 | 0.21934 | 0.488208 | 0.400943 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0.147513 | 583 | 20 | 57 | 29.15 | 0.853119 | 0 | 0 | 0 | 0 | 0 | 0.096055 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 1 | 0.230769 | false | 0 | 0.230769 | 0 | 0.461538 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a7fd2734a072f2bcad84ee84ad66f361e1da1371 | 865 | py | Python | products/migrations/0004_auto_20210715_2006.py | keeks-mtl/go-tennis | af3f325a9cfb2faba4d935824492f4aea6d10309 | [
"W3C",
"PostgreSQL"
] | null | null | null | products/migrations/0004_auto_20210715_2006.py | keeks-mtl/go-tennis | af3f325a9cfb2faba4d935824492f4aea6d10309 | [
"W3C",
"PostgreSQL"
] | null | null | null | products/migrations/0004_auto_20210715_2006.py | keeks-mtl/go-tennis | af3f325a9cfb2faba4d935824492f4aea6d10309 | [
"W3C",
"PostgreSQL"
] | null | null | null | # Generated by Django 3.2.3 on 2021-07-15 20:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0003_auto_20210709_0117'),
]
operations = [
migrations.AlterField(
model_name='category',
name='friendly_name',
field=models.CharField(blank=True, max_length=50),
),
migrations.AlterField(
model_name='category',
name='name',
field=models.CharField(max_length=50),
),
migrations.AlterField(
model_name='product',
name='name',
field=models.CharField(max_length=100),
),
migrations.AlterField(
model_name='product',
name='sku',
field=models.CharField(max_length=50),
),
]
| 25.441176 | 62 | 0.557225 | 84 | 865 | 5.595238 | 0.47619 | 0.170213 | 0.212766 | 0.246809 | 0.578723 | 0.578723 | 0.308511 | 0 | 0 | 0 | 0 | 0.068729 | 0.327168 | 865 | 33 | 63 | 26.212121 | 0.738832 | 0.052023 | 0 | 0.592593 | 1 | 0 | 0.103912 | 0.028117 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.037037 | 0 | 0.148148 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c51c826bcad9a887b4123c7790037f70e652cfae | 1,250 | py | Python | fix_ccJSON.py | boada/wmh | f2abe5ff2aeeae6eebab2e8c40803b3fcec9ac3a | [
"MIT"
] | null | null | null | fix_ccJSON.py | boada/wmh | f2abe5ff2aeeae6eebab2e8c40803b3fcec9ac3a | [
"MIT"
] | null | null | null | fix_ccJSON.py | boada/wmh | f2abe5ff2aeeae6eebab2e8c40803b3fcec9ac3a | [
"MIT"
] | null | null | null | import pandas as pd
import sys
def fix(lists):
df = pd.read_json(lists)
df2 = pd.DataFrame([p for p1 in df.players for p in p1])
df2['theme1'] = ''
df2['theme2'] = ''
for i, l in df2.list2.iteritems():
try:
df2.theme2.iloc[i] = l['theme']
except KeyError:
continue
except TypeError:
continue
for i, l in df2.list2.iteritems():
try:
df2.theme2.iloc[i] = l['theme']
except KeyError:
df2.theme2.iloc[i] = 'None'
except TypeError:
continue
for i, l in df2.list1.iteritems():
try:
df2.theme1.iloc[i] = l['theme']
except KeyError:
df2.theme1.iloc[i] = 'None'
except TypeError:
continue
for i, l in df2.list2.iteritems():
try:
df2.list2.iloc[i] = l['list']
except KeyError:
continue
except TypeError:
continue
for i, l in df2.list1.iteritems():
try:
df2.list1.iloc[i] = l['list']
except KeyError:
continue
except TypeError:
continue
df2.to_json('fixed.json')
if __name__ == "__main__":
fix(sys.argv[1])
| 24.038462 | 60 | 0.508 | 151 | 1,250 | 4.139073 | 0.271523 | 0.032 | 0.04 | 0.056 | 0.7168 | 0.7168 | 0.7168 | 0.6672 | 0.6672 | 0.6672 | 0 | 0.042146 | 0.3736 | 1,250 | 51 | 61 | 24.509804 | 0.756066 | 0 | 0 | 0.666667 | 0 | 0 | 0.0488 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.022222 | false | 0 | 0.044444 | 0 | 0.066667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
c51e94a6e708f618911c4ecc6deceed3e193e44e | 1,107 | py | Python | internal/handlers/singapore.py | fillingthemoon/cartogram-web | 58b645bca0c22b9bccdb2a5a8213a5a24a7e5958 | [
"MIT"
] | null | null | null | internal/handlers/singapore.py | fillingthemoon/cartogram-web | 58b645bca0c22b9bccdb2a5a8213a5a24a7e5958 | [
"MIT"
] | null | null | null | internal/handlers/singapore.py | fillingthemoon/cartogram-web | 58b645bca0c22b9bccdb2a5a8213a5a24a7e5958 | [
"MIT"
] | null | null | null | import settings
import handlers.base_handler
import csv
class CartogramHandler(handlers.base_handler.BaseCartogramHandler):
def get_name(self):
return "Singapore (by Region)"
def get_gen_file(self):
return "{}/singapore_map_processedmap.json".format(settings.CARTOGRAM_DATA_DIR)
def validate_values(self, values):
if len(values) != 5:
return False
for v in values:
if type(v) != float:
return False
return True
def gen_area_data(self, values):
return """1 {} CENTRAL REGION
2 {} EAST REGION
3 {} NORTH REGION
4 {} NORTH-EAST REGION
5 {} WEST REGION""".format(*values)
def expect_geojson_output(self):
return True
def csv_to_area_string_and_colors(self, csvfile):
return self.order_by_example(csv.reader(csvfile), "Region", 0, 1, 2, 3, ["CENTRAL REGION","EAST REGION","NORTH REGION","NORTH-EAST REGION","WEST REGION"], [0.0 for i in range(0,5)], {"CENTRAL REGION":"1","EAST REGION":"2","NORTH REGION":"3","NORTH-EAST REGION":"4","WEST REGION":"5"})
| 29.918919 | 292 | 0.641373 | 149 | 1,107 | 4.624161 | 0.409396 | 0.087083 | 0.065312 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022248 | 0.228546 | 1,107 | 36 | 293 | 30.75 | 0.784543 | 0 | 0 | 0.16 | 0 | 0 | 0.261969 | 0.030714 | 0 | 0 | 0 | 0 | 0 | 1 | 0.24 | false | 0 | 0.12 | 0.2 | 0.72 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
c53d72e1616e580f62f88e5fc1f0a262cb103728 | 94 | py | Python | app/db_manager/apps.py | PragmaticCoder/Linkedin-Analytics | a990b5cae02f0d758bc3123bde643d13a439efa3 | [
"MIT"
] | 13 | 2018-07-31T15:37:47.000Z | 2021-12-20T04:48:13.000Z | app/db_manager/apps.py | PragmaticCoder/Linkedin-Analytics | a990b5cae02f0d758bc3123bde643d13a439efa3 | [
"MIT"
] | 25 | 2019-12-10T20:03:48.000Z | 2022-03-11T23:26:11.000Z | app/db_manager/apps.py | PragmaticCoder/Linkedin-Analytics | a990b5cae02f0d758bc3123bde643d13a439efa3 | [
"MIT"
] | 4 | 2020-03-24T20:13:50.000Z | 2022-02-05T20:40:48.000Z | from django.apps import AppConfig
class DbManagerConfig(AppConfig):
name = 'db_manager'
| 15.666667 | 33 | 0.765957 | 11 | 94 | 6.454545 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.159574 | 94 | 5 | 34 | 18.8 | 0.898734 | 0 | 0 | 0 | 0 | 0 | 0.106383 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
c556608e317003e7eff23a5318cc565b380cac29 | 174 | py | Python | TrainAndTest/Fbank/LSTMs/__init__.py | Wenhao-Yang/DeepSpeaker-pytorch | 99eb8de3357c85e2b7576da2a742be2ffd773ead | [
"MIT"
] | 8 | 2020-08-26T13:32:56.000Z | 2022-01-18T21:05:46.000Z | TrainAndTest/Fbank/LSTMs/__init__.py | Wenhao-Yang/DeepSpeaker-pytorch | 99eb8de3357c85e2b7576da2a742be2ffd773ead | [
"MIT"
] | 1 | 2020-07-24T17:06:16.000Z | 2020-07-24T17:06:16.000Z | TrainAndTest/Fbank/LSTMs/__init__.py | Wenhao-Yang/DeepSpeaker-pytorch | 99eb8de3357c85e2b7576da2a742be2ffd773ead | [
"MIT"
] | 5 | 2020-12-11T03:31:15.000Z | 2021-11-23T15:57:55.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
@Author: yangwenhao
@Contact: 874681044@qq.com
@Software: PyCharm
@File: __init__.py.py
@Time: 2020/3/27 10:43 AM
@Overview:
"""
| 14.5 | 26 | 0.689655 | 27 | 174 | 4.296296 | 0.962963 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137255 | 0.12069 | 174 | 11 | 27 | 15.818182 | 0.620915 | 0.925287 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 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 | 3 |
c567553f0cf12169873a1f6859559b2967a6ea7a | 275 | py | Python | snake_debug.py | xlrobotics/PPOC-balance-bot | 41dae4b2bbfce94ed04841fa9ba122eb57459e5a | [
"MIT"
] | 3 | 2020-11-10T01:45:35.000Z | 2021-09-27T11:39:06.000Z | snake_debug.py | xlrobotics/PPOC-balance-bot | 41dae4b2bbfce94ed04841fa9ba122eb57459e5a | [
"MIT"
] | null | null | null | snake_debug.py | xlrobotics/PPOC-balance-bot | 41dae4b2bbfce94ed04841fa9ba122eb57459e5a | [
"MIT"
] | 2 | 2020-01-25T17:26:33.000Z | 2021-02-16T16:39:38.000Z | import gym
# from stable_baselines import DQN as deepq
from stable_baselines import A2C as ac
from stable_baselines.common.policies import MlpLnLstmPolicy
import snake_bot
if __name__ == '__main__':
env = gym.make("snakebot-v0")
env.debug_mode()
exit(0) | 27.5 | 61 | 0.741818 | 39 | 275 | 4.897436 | 0.666667 | 0.157068 | 0.298429 | 0.26178 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013393 | 0.185455 | 275 | 10 | 62 | 27.5 | 0.839286 | 0.149091 | 0 | 0 | 0 | 0 | 0.084821 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
3d640bec431e81affc07c61301d5e5f1d49c75e8 | 411 | py | Python | app/domain/company/models.py | JBizarri/fast-api-crud | 3eb0391c1a1f2e054092de717b73898c7efed5cb | [
"MIT"
] | null | null | null | app/domain/company/models.py | JBizarri/fast-api-crud | 3eb0391c1a1f2e054092de717b73898c7efed5cb | [
"MIT"
] | null | null | null | app/domain/company/models.py | JBizarri/fast-api-crud | 3eb0391c1a1f2e054092de717b73898c7efed5cb | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import TYPE_CHECKING, List
from sqlalchemy import Column, String
from sqlalchemy.orm import relationship
from ...database import BaseModel
if TYPE_CHECKING:
from ..user.models import User
class Company(BaseModel):
name: str = Column(String)
users: List[User] = relationship(
"User", back_populates="company", cascade="all, delete"
)
| 20.55 | 63 | 0.737226 | 50 | 411 | 5.92 | 0.56 | 0.081081 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.180049 | 411 | 19 | 64 | 21.631579 | 0.878338 | 0 | 0 | 0 | 0 | 0 | 0.053528 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
3d6b7691e8c5eed4e135eafd2eed629b0d7310de | 4,752 | py | Python | ott2butKAMA1/jessetkdata/dnafiles/BNB-USDT 2018-02-15 2021-01-01.py | ysdede/jesse_strategies | ade9f4ba42cec11207c766d267b9d8feb8bce648 | [
"CC0-1.0"
] | 38 | 2021-09-18T15:33:28.000Z | 2022-02-21T17:29:08.000Z | ott2butKAMA1/jessetkdata/dnafiles/BNB-USDT 2018-02-15 2021-01-01.py | ysdede/jesse_strategies | ade9f4ba42cec11207c766d267b9d8feb8bce648 | [
"CC0-1.0"
] | 4 | 2022-01-02T14:46:12.000Z | 2022-02-16T18:39:41.000Z | ott2butKAMA1/jessetkdata/dnafiles/BNB-USDT 2018-02-15 2021-01-01.py | ysdede/jesse_strategies | ade9f4ba42cec11207c766d267b9d8feb8bce648 | [
"CC0-1.0"
] | 11 | 2021-10-19T06:21:43.000Z | 2022-02-21T17:29:10.000Z | dnas = [
['jVXfX<', 37, 64, 24.67, 14, 7, -4.53, {'ott_len': 42, 'ott_percent': 508, 'stop_loss': 263, 'risk_reward': 65, 'chop_rsi_len': 31, 'chop_bandwidth': 83}],
['o:JK9p', 50, 62, 32.74, 37, 8, -0.2, {'ott_len': 45, 'ott_percent': 259, 'stop_loss': 201, 'risk_reward': 41, 'chop_rsi_len': 12, 'chop_bandwidth': 274}],
['tGVME/', 35, 74, 20.06, 20, 10, -4.75, {'ott_len': 48, 'ott_percent': 375, 'stop_loss': 254, 'risk_reward': 43, 'chop_rsi_len': 20, 'chop_bandwidth': 36}],
['a<<sMo', 59, 27, 25.74, 33, 6, -1.06, {'ott_len': 36, 'ott_percent': 277, 'stop_loss': 139, 'risk_reward': 76, 'chop_rsi_len': 24, 'chop_bandwidth': 271}],
['`Ol@gL', 29, 65, 9.47, 25, 8, -2.95, {'ott_len': 36, 'ott_percent': 446, 'stop_loss': 351, 'risk_reward': 31, 'chop_rsi_len': 40, 'chop_bandwidth': 142}],
['SWJi?Y', 36, 73, 32.8, 37, 8, -0.92, {'ott_len': 28, 'ott_percent': 516, 'stop_loss': 201, 'risk_reward': 68, 'chop_rsi_len': 16, 'chop_bandwidth': 190}],
['v@WLkU', 46, 47, 45.51, 20, 10, -4.43, {'ott_len': 49, 'ott_percent': 313, 'stop_loss': 258, 'risk_reward': 42, 'chop_rsi_len': 43, 'chop_bandwidth': 175}],
['lR\\iHN', 38, 62, 35.84, 28, 7, -4.01, {'ott_len': 43, 'ott_percent': 472, 'stop_loss': 280, 'risk_reward': 68, 'chop_rsi_len': 21, 'chop_bandwidth': 149}],
['l7\\gc^', 60, 35, 42.7, 25, 8, -1.2, {'ott_len': 43, 'ott_percent': 233, 'stop_loss': 280, 'risk_reward': 66, 'chop_rsi_len': 38, 'chop_bandwidth': 208}],
['wLXY\\1', 36, 71, 20.85, 14, 7, -4.76, {'ott_len': 50, 'ott_percent': 419, 'stop_loss': 263, 'risk_reward': 53, 'chop_rsi_len': 34, 'chop_bandwidth': 43}],
['i7nMgb', 54, 24, 28.38, 0, 4, -2.04, {'ott_len': 41, 'ott_percent': 233, 'stop_loss': 360, 'risk_reward': 43, 'chop_rsi_len': 40, 'chop_bandwidth': 223}],
['F/0eI[', 40, 154, 33.68, 42, 21, 2.91, {'ott_len': 20, 'ott_percent': 162, 'stop_loss': 85, 'risk_reward': 64, 'chop_rsi_len': 22, 'chop_bandwidth': 197}],
['\\ERgMp', 53, 28, 16.3, 33, 6, -2.59, {'ott_len': 33, 'ott_percent': 357, 'stop_loss': 236, 'risk_reward': 66, 'chop_rsi_len': 24, 'chop_bandwidth': 274}],
['_7@QqN', 44, 87, 28.24, 46, 15, 3.21, {'ott_len': 35, 'ott_percent': 233, 'stop_loss': 156, 'risk_reward': 46, 'chop_rsi_len': 46, 'chop_bandwidth': 149}],
['OEJO,F', 41, 105, 33.62, 20, 10, -4.61, {'ott_len': 25, 'ott_percent': 357, 'stop_loss': 201, 'risk_reward': 45, 'chop_rsi_len': 4, 'chop_bandwidth': 120}],
['5swn)a', 30, 86, 13.25, 8, 12, -6.03, {'ott_len': 9, 'ott_percent': 765, 'stop_loss': 400, 'risk_reward': 72, 'chop_rsi_len': 3, 'chop_bandwidth': 219}],
['4juD3[', 36, 95, 32.91, 14, 7, -3.13, {'ott_len': 8, 'ott_percent': 685, 'stop_loss': 391, 'risk_reward': 35, 'chop_rsi_len': 9, 'chop_bandwidth': 197}],
['91u6iJ', 33, 163, 31.1, 25, 27, -3.59, {'ott_len': 12, 'ott_percent': 180, 'stop_loss': 391, 'risk_reward': 22, 'chop_rsi_len': 41, 'chop_bandwidth': 135}],
['c3rg61', 39, 91, 11.05, 27, 11, -1.18, {'ott_len': 38, 'ott_percent': 197, 'stop_loss': 378, 'risk_reward': 66, 'chop_rsi_len': 11, 'chop_bandwidth': 43}],
['\\BAZGb', 40, 71, 22.33, 36, 11, -3.44, {'ott_len': 33, 'ott_percent': 330, 'stop_loss': 161, 'risk_reward': 54, 'chop_rsi_len': 21, 'chop_bandwidth': 223}],
['H<XF,l', 40, 98, 31.16, 16, 12, -5.22, {'ott_len': 21, 'ott_percent': 277, 'stop_loss': 263, 'risk_reward': 37, 'chop_rsi_len': 4, 'chop_bandwidth': 260}],
['5Bl/TL', 32, 153, 26.35, 28, 21, 0.03, {'ott_len': 9, 'ott_percent': 330, 'stop_loss': 351, 'risk_reward': 16, 'chop_rsi_len': 29, 'chop_bandwidth': 142}],
['DFRlX-', 38, 112, 21.16, 27, 11, -1.95, {'ott_len': 18, 'ott_percent': 366, 'stop_loss': 236, 'risk_reward': 70, 'chop_rsi_len': 31, 'chop_bandwidth': 28}],
['1EkquE', 33, 156, 45.58, 27, 18, -1.61, {'ott_len': 7, 'ott_percent': 357, 'stop_loss': 347, 'risk_reward': 75, 'chop_rsi_len': 49, 'chop_bandwidth': 116}],
['D9YmB.', 35, 139, 12.09, 42, 14, -1.17, {'ott_len': 18, 'ott_percent': 251, 'stop_loss': 267, 'risk_reward': 71, 'chop_rsi_len': 18, 'chop_bandwidth': 32}],
['_(KrZG', 40, 145, 18.09, 28, 21, -4.73, {'ott_len': 35, 'ott_percent': 100, 'stop_loss': 205, 'risk_reward': 76, 'chop_rsi_len': 32, 'chop_bandwidth': 124}],
['1CndgF', 34, 156, 49.82, 41, 17, 2.8, {'ott_len': 7, 'ott_percent': 339, 'stop_loss': 360, 'risk_reward': 63, 'chop_rsi_len': 40, 'chop_bandwidth': 120}],
['tutp,b', 50, 40, 52.45, 0, 5, -5.75, {'ott_len': 48, 'ott_percent': 782, 'stop_loss': 387, 'risk_reward': 74, 'chop_rsi_len': 4, 'chop_bandwidth': 223}],
['07t1iJ', 30, 199, 23.05, 26, 30, -1.64, {'ott_len': 6, 'ott_percent': 233, 'stop_loss': 387, 'risk_reward': 18, 'chop_rsi_len': 41, 'chop_bandwidth': 135}],
['75\\adC', 37, 200, 68.9, 21, 32, -4.78, {'ott_len': 10, 'ott_percent': 215, 'stop_loss': 280, 'risk_reward': 61, 'chop_rsi_len': 38, 'chop_bandwidth': 109}],
]
| 144 | 159 | 0.619529 | 858 | 4,752 | 3.184149 | 0.240093 | 0.065886 | 0.10981 | 0.02489 | 0.474744 | 0.230234 | 0.020498 | 0 | 0 | 0 | 0 | 0.213739 | 0.120791 | 4,752 | 32 | 160 | 148.5 | 0.440163 | 0 | 0 | 0 | 0 | 0 | 0.443182 | 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 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3d6d1e7bb92fb8ada9eb142b244859a83f2f343d | 2,909 | py | Python | modules/winrm/isodate/__init__.py | frankyrumple/smc | 975945ddcff754dd95f2e1a8bd4bf6e43a0f91f6 | [
"MIT"
] | null | null | null | modules/winrm/isodate/__init__.py | frankyrumple/smc | 975945ddcff754dd95f2e1a8bd4bf6e43a0f91f6 | [
"MIT"
] | null | null | null | modules/winrm/isodate/__init__.py | frankyrumple/smc | 975945ddcff754dd95f2e1a8bd4bf6e43a0f91f6 | [
"MIT"
] | null | null | null | ##############################################################################
# Copyright 2009, Gerhard Weis
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of the authors nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT
##############################################################################
'''
Import all essential functions and constants to re-export them here for easy
access.
This module contains also various pre-defined ISO 8601 format strings.
'''
from .isodates import parse_date, date_isoformat
from .isotime import parse_time, time_isoformat
from .isodatetime import parse_datetime, datetime_isoformat
from .isoduration import parse_duration, duration_isoformat, Duration
from .isoerror import ISO8601Error
from .isotzinfo import parse_tzinfo, tz_isoformat
from .tzinfo import UTC, FixedOffset, LOCAL
from .duration import Duration
from .isostrf import strftime
from .isostrf import DATE_BAS_COMPLETE, DATE_BAS_ORD_COMPLETE
from .isostrf import DATE_BAS_WEEK, DATE_BAS_WEEK_COMPLETE
from .isostrf import DATE_CENTURY, DATE_EXT_COMPLETE
from .isostrf import DATE_EXT_ORD_COMPLETE, DATE_EXT_WEEK
from .isostrf import DATE_EXT_WEEK_COMPLETE, DATE_MONTH, DATE_YEAR
from .isostrf import TIME_BAS_COMPLETE, TIME_BAS_MINUTE
from .isostrf import TIME_EXT_COMPLETE, TIME_EXT_MINUTE
from .isostrf import TIME_HOUR
from .isostrf import TZ_BAS, TZ_EXT, TZ_HOUR
from .isostrf import DT_BAS_COMPLETE, DT_EXT_COMPLETE
from .isostrf import DT_BAS_ORD_COMPLETE, DT_EXT_ORD_COMPLETE
from .isostrf import DT_BAS_WEEK_COMPLETE, DT_EXT_WEEK_COMPLETE
from .isostrf import D_DEFAULT, D_WEEK, D_ALT_EXT, D_ALT_BAS
from .isostrf import D_ALT_BAS_ORD, D_ALT_EXT_ORD
| 51.946429 | 78 | 0.77243 | 411 | 2,909 | 5.289538 | 0.403893 | 0.075897 | 0.117295 | 0.068997 | 0.232751 | 0.090156 | 0.062558 | 0.062558 | 0.062558 | 0.062558 | 0 | 0.00476 | 0.133379 | 2,909 | 55 | 79 | 52.890909 | 0.857596 | 0.515641 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
3d7a603d1af477e68cfea29362bbe8cb1160699c | 10,713 | py | Python | custom/icds_reports/ucr/tests/test_infra_form_ucr.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | custom/icds_reports/ucr/tests/test_infra_form_ucr.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | 1 | 2021-06-02T04:45:16.000Z | 2021-06-02T04:45:16.000Z | custom/icds_reports/ucr/tests/test_infra_form_ucr.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | from mock import patch
from custom.icds_reports.ucr.tests.test_base_form_ucr import BaseFormsTest
@patch('custom.icds_reports.ucr.expressions._get_user_location_id',
lambda user_id: 'qwe56poiuytr4xcvbnmkjfghwerffdaa')
@patch('corehq.apps.locations.ucr_expressions._get_location_type_name',
lambda loc_id, context: 'awc')
class TestInfraForms(BaseFormsTest):
ucr_name = "static-icds-cas-static-infrastructure_form"
def test_infra_form_v10326(self):
self._test_data_source_results(
'infrastructure_details_v10326',
[{
"doc_id": None,
"submitted_on": None,
"month": None,
"where_housed": None,
"provided_building": None,
"other_building": None,
"awc_building": None,
"access_physically_challenged": '',
"toilet_facility": "2",
"type_toilet": None,
"source_drinking_water": "2",
"kitchen": '',
"space_storing_supplies": '',
"adequate_space_pse": '',
"space_pse": None,
"medicine_kits_available": 0,
"preschool_kit_available": None,
"baby_scale_available": 0,
"flat_scale_available": 0,
"adult_scale_available": 1,
"cooking_utensils_available": 0,
"iec_bcc_available": 0,
"nhed_kit_available": 0,
"referral_slip_available": 0,
"plates_available": 0,
"tumblers_available": 0,
"measure_cups_available": 0,
"food_storage_available": 0,
"water_storage_available": 0,
"chair_available": 0,
"table_available": 0,
"mats_available": 0,
"medicine_kits_usable": 0,
"preschool_kit_usable": None,
"baby_scale_usable": 0,
"flat_scale_usable": 0,
"adult_scale_usable": 0,
"cooking_utensils_usable": 0,
"iec_bcc_usable": 0,
"nhed_kit_usable": 0,
"referral_slip_usable": 0,
"plates_usable": 0,
"tumblers_usable": 0,
"measure_cups_usable": 0,
"food_storage_usable": 0,
"water_storage_usable": 0,
"chair_usable": 0,
"table_usable": 0,
"mats_usable": 0,
"use_salt": 0,
"type_of_building": None,
"type_of_building_pucca": 0,
"type_of_building_semi_pucca": 0,
"type_of_building_kuccha": 0,
"type_of_building_partial_covered_space": 0,
"clean_water": 1,
"functional_toilet": 0,
"has_adequate_space_pse": 0,
"electricity_awc": None,
"infantometer": None,
"stadiometer": None,
}])
def test_infra_form_v10475(self):
self._test_data_source_results(
'infrastructure_details_v10475',
[{
"doc_id": None,
"submitted_on": None,
"month": None,
"where_housed": None,
"provided_building": None,
"other_building": None,
"awc_building": None,
"access_physically_challenged": '1',
"toilet_facility": '1',
"type_toilet": '1',
"source_drinking_water": '2',
"kitchen": '1',
"space_storing_supplies": '1',
"adequate_space_pse": '1',
"space_pse": '1',
"medicine_kits_available": 1,
"preschool_kit_available": 1,
"baby_scale_available": 0,
"flat_scale_available": 1,
"adult_scale_available": 1,
"cooking_utensils_available": 1,
"iec_bcc_available": 0,
"nhed_kit_available": 0,
"referral_slip_available": 1,
"plates_available": 1,
"tumblers_available": 1,
"measure_cups_available": 0,
"food_storage_available": 1,
"water_storage_available": 1,
"chair_available": 1,
"table_available": 1,
"mats_available": 1,
"medicine_kits_usable": 1,
"preschool_kit_usable": 1,
"baby_scale_usable": 0,
"flat_scale_usable": 0,
"adult_scale_usable": 1,
"cooking_utensils_usable": 1,
"iec_bcc_usable": 0,
"nhed_kit_usable": 0,
"referral_slip_usable": 1,
"plates_usable": 1,
"tumblers_usable": 1,
"measure_cups_usable": 0,
"food_storage_usable": 1,
"water_storage_usable": 1,
"chair_usable": 1,
"table_usable": 1,
"mats_usable": 1,
"use_salt": 1,
"type_of_building": None,
"type_of_building_pucca": 0,
"type_of_building_semi_pucca": 0,
"type_of_building_kuccha": 0,
"type_of_building_partial_covered_space": 0,
"clean_water": 1,
"functional_toilet": 1,
"has_adequate_space_pse": 1,
"electricity_awc": 1,
"infantometer": 1,
"stadiometer": 1,
}])
@patch('custom.icds_reports.ucr.expressions._get_user_location_id',
lambda user_id: 'qwe56poiuytr4xcvbnmkjfghwerffdaa')
@patch('corehq.apps.locations.ucr_expressions._get_location_type_name',
lambda loc_id, context: 'awc')
class TestInfraFormsV2(BaseFormsTest):
ucr_name = "static-icds-cas-static-infrastructure_form_v2"
def test_infra_form_v10326(self):
self._test_data_source_results(
'infrastructure_details_v10326',
[{
"doc_id": None,
"timeend": None,
"where_housed": None,
"provided_building": None,
"other_building": None,
"awc_building": None,
"access_physically_challenged": None,
"toilet_facility": 2,
"type_toilet": None,
"source_drinking_water": 2,
"kitchen": None,
"space_storing_supplies": None,
"adequate_space_pse": None,
"space_pse": None,
"medicine_kits_available": None,
"preschool_kit_available": None,
"baby_scale_available": 0,
"flat_scale_available": None,
"adult_scale_available": 1,
"cooking_utensils_available": None,
"iec_bcc_available": None,
"nhed_kit_available": None,
"referral_slip_available": None,
"plates_available": None,
"tumblers_available": None,
"measure_cups_available": None,
"food_storage_available": None,
"water_storage_available": None,
"chair_available": None,
"table_available": None,
"mats_available": None,
"medicine_kits_usable": None,
"preschool_kit_usable": None,
"baby_scale_usable": None,
"adult_scale_usable": None,
"cooking_utensils_usable": None,
"iec_bcc_usable": None,
"nhed_kit_usable": None,
"referral_slip_usable": None,
"plates_usable": None,
"tumblers_usable": None,
"measure_cups_usable": None,
"food_storage_usable": None,
"water_storage_usable": None,
"chair_usable": None,
"table_usable": None,
"mats_usable": None,
"use_salt": None,
"toilet_functional": None,
"electricity_awc": None,
"infantometer_usable": None,
"stadiometer_usable": None,
}])
def test_infra_form_v10475(self):
self._test_data_source_results(
'infrastructure_details_v10475',
[{
"doc_id": None,
"timeend": None,
"where_housed": None,
"provided_building": None,
"other_building": None,
"awc_building": None,
"access_physically_challenged": 1,
"toilet_facility": 1,
"type_toilet": 1,
"source_drinking_water": 2,
"kitchen": 1,
"space_storing_supplies": 1,
"adequate_space_pse": 1,
"space_pse": 1,
"medicine_kits_available": 1,
"preschool_kit_available": 1,
"baby_scale_available": 0,
"flat_scale_available": 1,
"adult_scale_available": 1,
"cooking_utensils_available": 1,
"iec_bcc_available": 0,
"nhed_kit_available": 0,
"referral_slip_available": 1,
"plates_available": 1,
"tumblers_available": 1,
"measure_cups_available": 0,
"food_storage_available": 1,
"water_storage_available": 1,
"chair_available": 1,
"table_available": 1,
"mats_available": 1,
"medicine_kits_usable": 1,
"preschool_kit_usable": 1,
"baby_scale_usable": 0,
"adult_scale_usable": 1,
"cooking_utensils_usable": 1,
"iec_bcc_usable": 0,
"nhed_kit_usable": 0,
"referral_slip_usable": 1,
"plates_usable": 1,
"tumblers_usable": 1,
"measure_cups_usable": 0,
"food_storage_usable": 1,
"water_storage_usable": 1,
"chair_usable": 1,
"table_usable": 1,
"mats_usable": 1,
"use_salt": 1,
"toilet_functional": 1,
"electricity_awc": 1,
"infantometer_usable": 1,
"stadiometer_usable": 1,
}])
| 39.677778 | 74 | 0.493419 | 953 | 10,713 | 5.104932 | 0.116474 | 0.057554 | 0.028777 | 0.021583 | 0.757657 | 0.746146 | 0.73258 | 0.686742 | 0.686742 | 0.663309 | 0 | 0.030403 | 0.407449 | 10,713 | 269 | 75 | 39.825279 | 0.73598 | 0 | 0 | 0.619231 | 0 | 0 | 0.409129 | 0.175021 | 0 | 0 | 0 | 0 | 0 | 1 | 0.015385 | false | 0 | 0.007692 | 0 | 0.038462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
3d9dc45f332b2fb283e892734ee2a5da821f63dd | 118 | py | Python | Exercicios7/percorrendoLista.py | vinihf/Prog1_ADS_2019 | 97d2e0cddf72c00a73d0bc3070bb9731e66e19e2 | [
"CC-BY-4.0"
] | 1 | 2019-04-18T13:43:15.000Z | 2019-04-18T13:43:15.000Z | Exercicios7/percorrendoLista.py | vinihf/Prog1_ADS_2019 | 97d2e0cddf72c00a73d0bc3070bb9731e66e19e2 | [
"CC-BY-4.0"
] | null | null | null | Exercicios7/percorrendoLista.py | vinihf/Prog1_ADS_2019 | 97d2e0cddf72c00a73d0bc3070bb9731e66e19e2 | [
"CC-BY-4.0"
] | null | null | null | lista = list(range(0,10001))
for cont in range(0,10001):
print(lista[cont])
for valor in lista:
print(valor) | 16.857143 | 28 | 0.669492 | 20 | 118 | 3.95 | 0.5 | 0.151899 | 0.278481 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 0.186441 | 118 | 7 | 29 | 16.857143 | 0.697917 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.4 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3dc7bf9b590e7454e8a84ae7d5b2f66655fcd2d8 | 9,121 | py | Python | rxmarbles/theme/pencil.py | enbandari/rx-marbles | b95813b5e24818eee272ab7ecf0f130510e60f39 | [
"MIT"
] | null | null | null | rxmarbles/theme/pencil.py | enbandari/rx-marbles | b95813b5e24818eee272ab7ecf0f130510e60f39 | [
"MIT"
] | null | null | null | rxmarbles/theme/pencil.py | enbandari/rx-marbles | b95813b5e24818eee272ab7ecf0f130510e60f39 | [
"MIT"
] | null | null | null | from numpy.random import random
import random
root = '''<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="%spx"
height="%spx"
viewBox="0 0 %s %s "
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
>
<defs
id="defs4">
<filter
style="color-interpolation-filters:sRGB;"
inkscape:label="Drop Shadow"
id="filter3443"
x="-25%%"
y="-25%%"
width="150%%"
height="150%%"
>
<feFlood
flood-opacity="0.498039"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood3445" />
<feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite3447" />
<feGaussianBlur
in="composite1"
stdDeviation="3"
result="blur"
id="feGaussianBlur3449" />
<feOffset
dx="2"
dy="3"
result="offset"
id="feOffset3451" />
<feComposite
in="SourceGraphic"
in2="offset"
operator="over"
result="composite2"
id="feComposite3453" />
</filter>
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow1Lend"
style="overflow:visible;"
inkscape:isstock="true">
<path
d="M -3.0,0.0 L -3.0,-5.0 L -12.5,0.0 L -3.0,5.0 L -3.0,0.0 z "
style="fill-rule:evenodd;stroke:#003080;stroke-width:1pt;stroke-opacity:1;fill:#003080;fill-opacity:1"
transform="scale(0.8) rotate(180) translate(12.5,0)" />
</marker>
</defs>
%s
</svg>
'''
circ1 = '''
<g transform="translate(%s %s)">
<path
sodipodi:nodetypes="cccc"
inkscape:connector-curvature="0"
id="circle"
d="m 4.9388474,-19.439462 c 16.0642996,-0.12398 28.5596096,25.2132203 13.6726596,35.64262 -11.0573896,9.63907 -34.34364,12.39205 -40.14488,-4.43275 -5.99947,-18.2070397 12.2740204,-28.34201 25.6703704,-34.96158"
style="fill:#ffffff;fill-opacity:0.8627451;fill-rule:evenodd;stroke:#000000;stroke-width:1.42857146px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
inkscape:label="#path3567" />
<text
y="11"
x="0"
style="font-size:28px;font-family:purisa;text-align:center;text-anchor:middle;fill:#000000;"
xml:space="preserve">%s</text>
</g>
'''
circ2 = '''
<g transform="translate(%s %s)">
<path
sodipodi:nodetypes="ccc"
style="fill:#ffffff;fill-opacity:0.8627451;fill-rule:evenodd;stroke:#000000;stroke-width:1.42857158px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 1.5925919,21.477458 C 54.657578,22.391841 -4.4465257,-49.196211 -20.218549,-5.7426508 -25.112801,8.7120558 -15.351552,21.857363 2.9582607,24.135679"
id="circ2"
inkscape:connector-curvature="0"
inkscape:label="#path3569" />
<text
y="11"
x="0"
style="font-size:28px;font-family:purisa;text-align:center;text-anchor:middle;fill:#000000;"
xml:space="preserve">%s</text>
</g>
'''
circ3 = '''
<g transform="translate(%s %s)">
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="circ3"
d="M 4.0475415,-21.306002 C -11.703304,-26.547792 -23.641751,-7.9231854 -22.516473,6.1088129 -20.059942,26.830243 12.722358,33.867273 22.337406,14.863588 27.656584,4.0579388 23.204578,-8.3517124 15.784624,-16.859919 c -1.822,-3.127279 -5.336267,-5.723574 -9.3972065,-5.54123"
style="fill:#ffffff;fill-opacity:0.8627451;fill-rule:evenodd;stroke:#000000;stroke-width:1.42857158px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
inkscape:label="#path3571" />
<text
y="11"
x="0"
style="font-size:28px;font-family:purisa;text-align:center;text-anchor:middle;fill:#000000;"
xml:space="preserve">%s</text>
</g>
'''
circ4 = '''
<g transform="translate(%s %s)">
<path
style="fill:#ffffff;fill-opacity:0.8627451;fill-rule:evenodd;stroke:#000000;stroke-width:1.42857146px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 2.0536007,-17.942742 C -52.370629,-18.905944 8.2474086,56.504162 24.423439,10.730643 29.443049,-4.4957928 16.207176,-22.177911 -2.5716488,-24.577866"
id="circ5"
inkscape:connector-curvature="0"
inkscape:label="#path3433" />
<text
y="11"
x="0"
style="font-size:28px;font-family:purisa;text-align:center;text-anchor:middle;fill:#000000;"
xml:space="preserve">%s</text>
</g>
'''
arrow = '''
<g transform="scale(%s %s) translate(%s %s)">
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M -0.67660398,1.4566587 C 51.393331,1.3820987 103.49025,-3.9934243 155.52767,1.1808467 c 33.34887,0.89417 67.21197,-1.95060293 99.84156,5.535708 44.03188,2.2890288 88.09651,1.698567 131.74849,-3.79605 21.2474,-0.841106 42.51228,0.139269 63.76647,-0.199798"
id="axisLine"
inkscape:connector-curvature="0"
inkscape:label="#path3511" />
</g>
<g transform="translate(%s %s)">
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.42857146px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m -13.085216,-10.419073 c 2.66757,0.133318 4.1293297,2.8477214 6.5645197,3.6415244 2.19618,1.483387 4.27915,3.129365 6.74184,4.165938 3.6572898,1.62997797 0.28555,4.903303 -1.90365,6.045673 -2.08841,1.84505 -3.80877,3.732465 -6.63704,4.785017 -1.8518597,0.870578 -3.6440197,1.8066886 -5.3976897,2.8506076"
id="arrow_end"
inkscape:connector-curvature="0"
inkscape:label="#path3528" />
</g>
'''
end = '''
<g>
<path d="m %s,%s -1,32"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4px;" />
</g>
'''
err = '''
<g id="error">
<path
inkscape:connector-curvature="0"
d="m %s,%s -34,36"
style="stroke:#000000;stroke-width:3px;" />
<path
style="stroke:#000000;stroke-width:3px;"
d="m %s,%s 36,36"
/>
</g>
'''
# this one is used for operator box
block = '''
<g transform="scale(%s %s) translate(%s %s)">
<path
style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:1.42857146px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3.6131775,2.4809559 C 7.7262916,27.136376 -4.8390181,67.388756 10.311791,81.793736 c 56.57601,-7.35809 113.842299,-2.82956 170.815959,-4.56434 48.9116,1.31804 98.12281,2.30369 146.89949,0.25237 36.73272,-6.08907 74.34343,-4.60865 110.81369,1.7655 26.17801,-6.87142 7.26874,-47.02276 10.85636,-67.94864 C 435.2653,-11.614984 389.13054,8.5049456 362.01772,0.90526594 300.94038,0.67314594 239.26649,2.7131859 178.67384,0.60705594 118.08119,-1.4990741 86.699905,6.8117156 57.753682,4.3549359 28.807462,1.8981559 17.816805,1.4648659 0.01403178,-4.669534"
id="operator_box"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccczzc"
inkscape:label="#path3549" />
</g>
<text
x="%s"
y="%s"
style="font-size:24px;font-family:purisa;text-align:center;text-anchor:middle;fill:#000000;"
xml:space="preserve">%s</text>
'''
# - this one is used for groupping
groupping_block = '''
<g >
<rect
ry="25px"
rx="25px"
y="%s"
x="%s"
width="%s"
height="%s"
style="opacity:1;fill:%s;fill-opacity:0;stroke:#000000;stroke-width:1px;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
'''
#==================================================
# this is the theme interface
#==================================================
class Circle:
def __init__(self, x, y, text, color):
global circ1
global circ2
global circ3
shapes = [circ1, circ2, circ3]
index = random.randint(0, len(shapes) - 1)
circ = shapes[index]
self.node = circ % (x + 25, y, text)
class Arrow:
def __init__(self, x, y, start, size):
global arrow
self.node = arrow % (1.0 * size / 450.0, 0.75, x + 25 + start, y, x + 22 + start + size, y + 2)
class End:
def __init__(self, x, y):
global end
self.node = end % (x + 25, y - 12)
class Err:
def __init__(self, x, y):
global err
self.node = err % (x + 25 + 18, y - 18, x + 25 - 14, y - 18)
class BlockWithText:
def __init__(self, x, y, text, color, width, height):
global groupping_block
self.node = groupping_block % (y - 22, x, width, height, "white")
class Block:
def __init__(self, x, y, width, height, text, color):
global block
self.node = block % (width / 460.0, 1, x, y, x + width / 2.0, y + height / 2.0, text)
| 36.338645 | 559 | 0.621642 | 1,354 | 9,121 | 4.166174 | 0.336041 | 0.004609 | 0.0351 | 0.04485 | 0.384329 | 0.363765 | 0.317674 | 0.301365 | 0.268924 | 0.268924 | 0 | 0.254005 | 0.185506 | 9,121 | 250 | 560 | 36.484 | 0.505317 | 0.02127 | 1 | 0.352174 | 0 | 0.108696 | 0.856614 | 0.35639 | 0 | 0 | 0 | 0 | 0 | 1 | 0.026087 | false | 0 | 0.008696 | 0 | 0.06087 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3dd4c39c91d920a780223d1076fe94897deaabd0 | 2,639 | py | Python | python/GafferUI/ProgressBar.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/ProgressBar.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/ProgressBar.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2011-2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided with
# the distribution.
#
# * Neither the name of John Haddon nor the names of
# any other contributors to this software may be used to endorse or
# promote products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
##########################################################################
import IECore
import GafferUI
QtGui = GafferUI._qtImport( "QtGui" )
class ProgressBar( GafferUI.Widget ) :
def __init__( self, progress = 0, range = ( 0, 100 ), text = "%p%", **kw ) :
GafferUI.Widget.__init__( self, QtGui.QProgressBar(), **kw )
self._qtWidget().setRange( range[0], range[1] )
self.setRange( range )
self.setProgress( progress )
self.setText( text )
def setRange( self, range ) :
self._qtWidget().setRange( range[0], range[1] )
def getRange( self ) :
return ( self._qtWidget().minimum(), self._qtWidget().maximum() )
def setProgress( self, progress ) :
self._qtWidget().setValue( progress )
def getProgress( self ) :
return self._qtWidget().value()
def setText( self, text ) :
self._qtWidget().setFormat( text )
def getText( self ) :
return self._qtWidget().format()
| 33.833333 | 77 | 0.675256 | 325 | 2,639 | 5.430769 | 0.495385 | 0.054391 | 0.023796 | 0.037394 | 0.14051 | 0.113314 | 0.113314 | 0.077054 | 0.077054 | 0.077054 | 0 | 0.007951 | 0.189845 | 2,639 | 77 | 78 | 34.272727 | 0.817587 | 0.602122 | 0 | 0.090909 | 0 | 0 | 0.009227 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.318182 | false | 0 | 0.136364 | 0.136364 | 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 | 1 | 0 | 0 | 3 |
3dd842d4edbdc348779300fb523036992a49b5b2 | 125 | py | Python | manage.py | Stupnitskiy/BinaryAPI | e448936ceed96da72e2aa65847030ea56edb224f | [
"MIT"
] | null | null | null | manage.py | Stupnitskiy/BinaryAPI | e448936ceed96da72e2aa65847030ea56edb224f | [
"MIT"
] | null | null | null | manage.py | Stupnitskiy/BinaryAPI | e448936ceed96da72e2aa65847030ea56edb224f | [
"MIT"
] | null | null | null | from flask_script import Manager
from src import app
manager = Manager(app)
if __name__ == "__main__":
manager.run()
| 12.5 | 32 | 0.72 | 17 | 125 | 4.764706 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.192 | 125 | 9 | 33 | 13.888889 | 0.80198 | 0 | 0 | 0 | 0 | 0 | 0.064 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
3dffaaba0f49d4e4bcf7fb58f40e51bc3b413470 | 448 | py | Python | simple_amqp_rpc/data.py | rudineirk/py-simple-amqp-rpc | 823b6efe271732495d4e3ccdcb9f4d85138c1d42 | [
"MIT"
] | null | null | null | simple_amqp_rpc/data.py | rudineirk/py-simple-amqp-rpc | 823b6efe271732495d4e3ccdcb9f4d85138c1d42 | [
"MIT"
] | 1 | 2021-06-01T22:28:43.000Z | 2021-06-01T22:28:43.000Z | simple_amqp_rpc/data.py | rudineirk/py-simple-amqp-rpc | 823b6efe271732495d4e3ccdcb9f4d85138c1d42 | [
"MIT"
] | null | null | null | from typing import Any, List
from dataclasses import dataclass, replace
from .consts import OK
class Data:
def replace(self, **kwargs):
return replace(self, **kwargs)
@dataclass(frozen=True)
class RpcCall(Data):
route: str
service: str
method: str
args: List[Any]
@dataclass(frozen=True)
class RpcResp(Data):
status: int
body: Any = None
@property
def ok(self):
return self.status == OK
| 15.448276 | 42 | 0.654018 | 58 | 448 | 5.051724 | 0.517241 | 0.075085 | 0.116041 | 0.163823 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.245536 | 448 | 28 | 43 | 16 | 0.866864 | 0 | 0 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.105263 | false | 0 | 0.157895 | 0.105263 | 0.842105 | 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 | 1 | 1 | 0 | 0 | 3 |
9a89981de0ecebc2323be5e00e13a157cd8dc62f | 8,490 | py | Python | pynaja/common/struct.py | xiaoxiamiya/naja | 222c3e1135bbd2b9a02181273a8a70201fbdf0f5 | [
"Apache-2.0"
] | 1 | 2021-09-07T07:13:53.000Z | 2021-09-07T07:13:53.000Z | pynaja/common/struct.py | xiaoxiamiya/naja | 222c3e1135bbd2b9a02181273a8a70201fbdf0f5 | [
"Apache-2.0"
] | null | null | null | pynaja/common/struct.py | xiaoxiamiya/naja | 222c3e1135bbd2b9a02181273a8a70201fbdf0f5 | [
"Apache-2.0"
] | null | null | null | import struct
from collections import OrderedDict
from configparser import RawConfigParser
from pynaja.common.async_base import Utils
from pynaja.common.error import ConstError
class Result(dict):
"""返回结果类
"""
def __init__(self, code=0, data=None, msg=None, details=None):
super().__init__(code=code)
if data is not None:
self.__setitem__(r'data', data)
if msg is not None:
self.__setitem__(r'msg', msg)
if details is not None:
self.__setitem__(r'details', details)
def __bool__(self):
return self.code == 0
@property
def code(self):
return self.get(r'code')
@property
def data(self):
return self.get(r'data', None)
@property
def msg(self):
return self.get(r'msg', None)
@property
def details(self):
return self.get(r'details', None)
class Const(OrderedDict):
"""常量类
"""
def __getattr__(self, key):
return self.__getitem__(key)
def __setattr__(self, key, val):
if key[:1] == r'_':
super().__setattr__(key, val)
else:
self.__setitem__(key, val)
def __delattr__(self, key):
if key[:1] == r'_':
super().__delattr__(key)
else:
raise ConstError()
def __setitem__(self, key, val):
if key in self:
raise ConstError()
else:
super().__setitem__(key, val)
def __delitem__(self, key):
raise ConstError()
def exist(self, val):
return val in self.values()
class ByteArrayAbstract:
"""ByteArray抽象类
"""
NETWORK = r'!'
NATIVE = r'='
NATIVE_ALIGNMENT = r'@'
LITTLE_ENDIAN = r'<'
BIG_ENDIAN = r'>'
def __init__(self):
self._endian = self.NETWORK
def get_endian(self):
return self._endian
def set_endian(self, val):
self._endian = val
def read(self, size):
raise NotImplementedError()
def write(self, buffer):
raise NotImplementedError()
def read_pad_byte(self, _len):
struct.unpack(f'{self._endian}{_len}x', self.read(_len))
def write_pad_byte(self, _len):
self.write(struct.pack(f'{self._endian}{_len}x'))
def read_char(self):
return struct.unpack(f'{self._endian}c', self.read(1))[0]
def write_char(self, val):
self.write(struct.pack(f'{self._endian}c', val))
def read_signed_char(self):
return struct.unpack(f'{self._endian}b', self.read(1))[0]
def write_signed_char(self, val):
self.write(struct.pack(f'{self._endian}b', val))
def read_unsigned_char(self):
return struct.unpack(f'{self._endian}B', self.read(1))[0]
def write_unsigned_char(self, val):
self.write(struct.pack(f'{self._endian}B', val))
def read_bool(self):
return struct.unpack(f'{self._endian}?', self.read(1))[0]
def write_bool(self, val):
self.write(struct.pack(f'{self._endian}?', val))
def read_short(self):
return struct.unpack(f'{self._endian}h', self.read(2))[0]
def write_short(self, val):
self.write(struct.pack(f'{self._endian}h', val))
def read_unsigned_short(self):
return struct.unpack(f'{self._endian}H', self.read(2))[0]
def write_unsigned_short(self, val):
self.write(struct.pack(f'{self._endian}H', val))
def read_int(self):
return struct.unpack(f'{self._endian}i', self.read(4))[0]
def write_int(self, val):
self.write(struct.pack(f'{self._endian}i', val))
def read_unsigned_int(self):
return struct.unpack(f'{self._endian}I', self.read(4))[0]
def write_unsigned_int(self, val):
self.write(struct.pack(f'{self._endian}I', val))
def read_long(self):
return struct.unpack(f'{self._endian}l', self.read(4))[0]
def write_long(self, val):
self.write(struct.pack(f'{self._endian}l', val))
def read_unsigned_long(self):
return struct.unpack(f'{self._endian}L', self.read(4))[0]
def write_unsigned_long(self, val):
self.write(struct.pack(f'{self._endian}L', val))
def read_long_long(self):
return struct.unpack(f'{self._endian}q', self.read(8))[0]
def write_long_long(self, val):
self.write(struct.pack(f'{self._endian}q', val))
def read_unsigned_long_long(self):
return struct.unpack(f'{self._endian}Q', self.read(8))[0]
def write_unsigned_long_long(self, val):
self.write(struct.pack(f'{self._endian}Q', val))
def read_float(self):
return struct.unpack(f'{self._endian}f', self.read(4))[0]
def write_float(self, val):
self.write(struct.pack(f'{self._endian}f', val))
def read_double(self):
return struct.unpack(f'{self._endian}d', self.read(8))[0]
def write_double(self, val):
self.write(struct.pack(f'{self._endian}d', val))
def read_bytes(self, _len):
return struct.unpack(f'{self._endian}{_len}s', self.read(_len))[0]
def write_bytes(self, val):
self.write(struct.pack(f'{self._endian}{len(val)}s', val))
def read_string(self, _len):
return self.read_bytes(_len).decode()
def write_string(self, val):
self.write_bytes(val.encode())
def read_pascal_bytes(self, _len):
return struct.unpack(f'{self._endian}{_len}p', self.read(_len))[0]
def write_pascal_bytes(self, val):
self.write(struct.pack(f'{self._endian}{len(val)}p', val))
def read_pascal_string(self, _len):
return self.read_pascal_bytes(_len).decode()
def write_pascal_string(self, val):
self.write_pascal_bytes(val.encode())
def read_python_int(self, _len):
return struct.unpack(f'{self._endian}{_len}P', self.read(_len))[0]
def write_python_int(self, val):
self.write(struct.pack(f'{self._endian}{len(val)}P', val))
class ConfigParser(RawConfigParser):
"""配置解析类
"""
def getstr(self, section, option, default=None, **kwargs):
val = self.get(section, option, **kwargs)
return val if val else default
def getjson(self, section, option, **kwargs):
val = self.get(section, option, **kwargs)
result = Utils.json_encode(val)
return result
def _split_host(self, val):
if val.find(r':') > 0:
host, port = val.split(r':', 2)
return host.strip(), int(port.strip())
else:
return None
def get_split_host(self, section, option, **kwargs):
val = self.get(section, option, **kwargs)
return self._split_host(val)
def get_split_str(self, section, option, sep=r'|', **kwargs):
val = self.get(section, option, **kwargs)
return tuple(Utils.split_str(val, sep))
def get_split_int(self, section, option, sep=r',', **kwargs):
val = self.get(section, option, **kwargs)
return tuple(Utils.split_int(val, sep))
def split_float(self, val, sep=r','):
result = tuple(float(item.strip()) for item in val.split(sep))
return result
def get_split_float(self, section, option, sep=r',', **kwargs):
val = self.get(section, option, **kwargs)
return self.split_float(val, sep)
class Configure(Const):
"""配置类
"""
def __init__(self):
super().__init__()
self._parser = ConfigParser()
def _init_options(self):
self.clear()
def get_option(self, section, option):
return self._parser.get(section, option)
def get_options(self, section):
parser = self._parser
options = {}
for option in parser.options(section):
options[option] = parser.get(section, option)
return options
def set_options(self, section, **options):
if not self._parser.has_section(section):
self._parser.add_section(section)
for option, value in options.items():
self._parser.set(section, option, value)
self._init_options()
def read(self, files):
self._parser.clear()
self._parser.read(files, r'utf-8')
self._init_options()
def read_str(self, val):
self._parser.clear()
self._parser.read_string(val)
self._init_options()
def read_dict(self, val):
self._parser.clear()
self._parser.read_dict(val)
self._init_options()
| 21.493671 | 74 | 0.607538 | 1,153 | 8,490 | 4.248916 | 0.111015 | 0.079608 | 0.080833 | 0.062053 | 0.580935 | 0.504797 | 0.450908 | 0.427434 | 0.39008 | 0.367422 | 0 | 0.005949 | 0.247585 | 8,490 | 394 | 75 | 21.548223 | 0.760958 | 0.006125 | 0 | 0.154589 | 0 | 0 | 0.077317 | 0.021411 | 0 | 0 | 0 | 0 | 0 | 1 | 0.352657 | false | 0 | 0.024155 | 0.135266 | 0.608696 | 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 | 1 | 0 | 0 | 3 |
9a9199cd090e7135e6e6634b2297f724636eb3bf | 5,021 | py | Python | people.py | sabek/Guess-who | 91c3f527d258ec81370e3f49fa9b8d23407af3ce | [
"MIT"
] | null | null | null | people.py | sabek/Guess-who | 91c3f527d258ec81370e3f49fa9b8d23407af3ce | [
"MIT"
] | null | null | null | people.py | sabek/Guess-who | 91c3f527d258ec81370e3f49fa9b8d23407af3ce | [
"MIT"
] | null | null | null | class HiddenPeople():
"""Class for holding information on people"""
def __init__(self):
self.people = {
'Paul': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'man', 'hair': 'white', 'hat': False,
'glasses': True, 'moustache': False},
'Richard': {'bald': True, 'beard': True, 'eyes': 'brown', 'gender': 'man', 'hair': 'brown',
'hat': False, 'glasses': False, 'moustache': True},
'George': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'boy', 'hair': 'white',
'hat': True, 'glasses': False, 'moustache': False},
'Frans': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'boy', 'hair': 'red', 'hat': False,
'glasses': False, 'moustache': False},
'Bernard': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'boy', 'hair': 'brown',
'hat': True, 'glasses': True, 'moustache': False},
'Anne': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'girl', 'hair': 'black',
'hat': False, 'glasses': False, 'moustache': False},
'Joe': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'boy', 'hair': 'blonde', 'hat': False,
'glasses': True, 'moustache': False},
'Peter': {'bald': False, 'beard': False, 'eyes': 'blue', 'gender': 'boy', 'hair': 'white', 'hat': False,
'glasses': False, 'moustache': False},
'Tom': {'bald': True, 'beard': False, 'eyes': 'blue', 'gender': 'boy', 'hair': 'black', 'hat': False,
'glasses': True, 'moustache': False},
'Susan': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'girl', 'hair': 'blonde',
'hat': False, 'glasses': False, 'moustache': False},
'Sam': {'bald': True, 'beard': False, 'eyes': 'brown', 'gender': 'boy', 'hair': 'white', 'hat': False,
'glasses': True, 'moustache': False},
'Maria': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'girl', 'hair': 'brown',
'hat': True, 'glasses': False, 'moustache': False},
'Robert': {'bald': False, 'beard': False, 'eyes': 'blue', 'gender': 'boy', 'hair': 'brown',
'hat': False, 'glasses': False, 'moustache': False},
'Alex': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'boy', 'hair': 'black', 'hat': False,
'glasses': False, 'moustache': True},
'Charles': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'boy', 'hair': 'blonde',
'hat': False, 'glasses': False, 'moustache': True},
'Philip': {'bald': False, 'beard': True, 'eyes': 'brown', 'gender': 'boy', 'hair': 'black',
'hat': False, 'glasses': False, 'moustache': False},
'David': {'bald': False, 'beard': True, 'eyes': 'brown', 'gender': 'boy', 'hair': 'blonde',
'hat': False, 'glasses': False, 'moustache': False},
'Eric': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'boy', 'hair': 'blonde',
'hat': True, 'glasses': False, 'moustache': False},
'Bill': {'bald': True, 'beard': True, 'eyes': 'brown', 'gender': 'boy', 'hair': 'red',
'hat': False, 'glasses': False, 'moustache': False},
'Alfred': {'bald': False, 'beard': False, 'eyes': 'blue', 'gender': 'boy', 'hair': 'red', 'hat': False,
'glasses': False, 'moustache': True},
'Anita': {'bald': False, 'beard': False, 'eyes': 'blue', 'gender': 'girl', 'hair': 'white',
'hat': False, 'glasses': False, 'moustache': False},
'Max': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'boy', 'hair': 'black', 'hat': False,
'glasses': False, 'moustache': True},
'Herman': {'bald': True, 'beard': False, 'eyes': 'brown', 'gender': 'boy', 'hair': 'red', 'hat': False,
'glasses': False, 'moustache': False},
'Claire': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'girl', 'hair': 'red', 'hat': True,
'glasses': True, 'moustache': False}}
def removeperson(self, attribute):
"""Remove a person from listing of people to choose"""
removelist = []
for person in self.people:
if self.people[person][attribute]:
removelist.append(person)
for person in removelist:
del self.people[person]
def printpeople(self):
for person in self.people:
print(person + ": " + str(self.people[person]))
| 74.940299 | 120 | 0.466441 | 470 | 5,021 | 4.974468 | 0.151064 | 0.085543 | 0.11976 | 0.138152 | 0.823353 | 0.795124 | 0.705304 | 0.60308 | 0.499145 | 0.280582 | 0 | 0 | 0.316073 | 5,021 | 66 | 121 | 76.075758 | 0.680839 | 0.017526 | 0 | 0.393443 | 0 | 0 | 0.291751 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.04918 | false | 0 | 0 | 0 | 0.065574 | 0.032787 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 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 | 3 |
9a9a50511abf52afcd61e02d8aeff1032454c0a6 | 3,379 | py | Python | utils/videoJob.py | dbpeng/aws-lambda-python-example-zencoder | 3c3e2d2ea88be824a62e41f16d6bdd79deeef2a0 | [
"MIT"
] | 1 | 2018-05-01T11:54:33.000Z | 2018-05-01T11:54:33.000Z | utils/videoJob.py | dbpeng/aws-lambda-python-example-zencoder | 3c3e2d2ea88be824a62e41f16d6bdd79deeef2a0 | [
"MIT"
] | 1 | 2021-06-01T22:18:53.000Z | 2021-06-01T22:18:53.000Z | utils/videoJob.py | dbpeng/aws-lambda-python-example-zencoder | 3c3e2d2ea88be824a62e41f16d6bdd79deeef2a0 | [
"MIT"
] | null | null | null | import os
import sys
from sqlalchemy import Column, ForeignKey, Integer, String, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from datetime import datetime
import json
from base import Session, engine, Base
from enum import Enum
VIDEOS_S3_PATH = os.environ["VIDEOS_S3_PATH"]
class VideoJobState(Enum):
INIT = 0
DONE = 3
CANCEL = 4
class VideoTranscodeJob(Base):
__tablename__ = "TranscodingJob"
id = Column("ID", Integer, primary_key=True)
src = Column("Src", String(100))
dst = Column("Dst", String(100))
playUrl = Column("VideoUrl", String(256))
config = Column("Config", String(100))
vendor = Column("Vendor", String(100))
jobId = Column("JobId", String(100))
progress = Column("Progress", Integer)
webhook = Column("Webhook", String(300))
created_At = Column("Created_At", DateTime, default=datetime.now)
updated_At = Column("Updated_At", DateTime, onupdate=datetime.now)
def __init__(self):
self.progress = 0
def setConfig(self, config):
self.config = config
filename = "profiles/"+self.config+".json"
with open(filename, 'r') as f:
datastore = json.load(f)
self.configContext = datastore
def getConfig(self):
return self.config
def getConfigContext(self):
return self.configContext
def setSrc(self, src):
self.src = src
def getSrc(self):
return self.src
def setPlaybackUrl(self, url):
# TODO: should validate url scheme here
self.playUrl = url
def getPlaybackUrl(self):
return self.playUrl
def setDst(self, dst):
# this part needs a revamp, we should not by default assume it's HLS
self.dst = VIDEOS_S3_PATH + dst + "/playlist.m3u8"
def getDst(self):
return self.dst
def setVendor(self, vendorId):
self.vendor = vendorId
def getVendor(self):
return self.vendor
def setJobId(self, jobid):
self.jobId = jobid
def getJobId(self):
return self.jobId
def setWebhook(self, url):
self.webhook = url
def getWebhook(self):
return self.webhook
def setProgress(self, status):
self.progress = status
def getProgress(self):
return self.progress
def getCreatedTime(self):
return self.createTime
def getUpdatedTime(self):
return self.updatedTime
def setId(self, id):
self.id = id
def getId(self):
return self.id
def getJobDescription(self):
# self.configContext['input'] = self.getSrc()
for output in self.configContext['output']:
output['base_url'] = self.getDst()
return self.configContext
def submit(self):
pass
# if __name__ == "__main__":
# session = Session()
# vjob = VideoTranscodeJob()
# vjob.setSrc("s3://wowza-video/hk33456678.mp4")
# vjob.setDst("13ffjsdhr")
# vjob.setConfig("zen-hls")
# vjob.setJobId("13556245")
# vjob.setVendor("zencoder")
# session.add(vjob)
# session.commit()
# # jobs = session.query(VideoTranscodeJob).all()
# # for job in jobs:
# # job.setProgress(4)
# # session.commit()
# session.close()
| 25.406015 | 76 | 0.629772 | 389 | 3,379 | 5.393316 | 0.362468 | 0.061964 | 0.080076 | 0.024786 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020408 | 0.260432 | 3,379 | 132 | 77 | 25.598485 | 0.819128 | 0.17372 | 0 | 0.02439 | 0 | 0 | 0.050199 | 0 | 0 | 0 | 0 | 0.007576 | 0 | 1 | 0.292683 | false | 0.012195 | 0.121951 | 0.146341 | 0.780488 | 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 | 1 | 0 | 0 | 3 |
9aa39e5e7763187b713ab547d0e364010f1b3d6f | 106 | py | Python | examples/plugin_example/setup.py | linshoK/pysen | 2b84a15240c5a47cadd8e3fc8392c54c2995b0b1 | [
"MIT"
] | 423 | 2021-03-22T08:45:12.000Z | 2022-03-31T21:05:53.000Z | examples/plugin_example/setup.py | linshoK/pysen | 2b84a15240c5a47cadd8e3fc8392c54c2995b0b1 | [
"MIT"
] | 1 | 2022-02-23T08:53:24.000Z | 2022-03-23T14:11:54.000Z | examples/plugin_example/setup.py | linshoK/pysen | 2b84a15240c5a47cadd8e3fc8392c54c2995b0b1 | [
"MIT"
] | 9 | 2021-03-26T14:20:07.000Z | 2022-03-24T13:17:06.000Z | from setuptools import setup
setup(
name="example-advanced-package", version="0.0.0", packages=[],
)
| 17.666667 | 66 | 0.698113 | 14 | 106 | 5.285714 | 0.785714 | 0.054054 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032609 | 0.132075 | 106 | 5 | 67 | 21.2 | 0.771739 | 0 | 0 | 0 | 0 | 0 | 0.273585 | 0.226415 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9aae954a3239c945002696eff2a9d8adff07720d | 3,110 | py | Python | examples/python/macOS/hack_or_die.py | kitazaki/NORA_Badge | 9b04a57235f0763641ffa8e90e499f141dc57570 | [
"Apache-2.0"
] | null | null | null | examples/python/macOS/hack_or_die.py | kitazaki/NORA_Badge | 9b04a57235f0763641ffa8e90e499f141dc57570 | [
"Apache-2.0"
] | null | null | null | examples/python/macOS/hack_or_die.py | kitazaki/NORA_Badge | 9b04a57235f0763641ffa8e90e499f141dc57570 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import time
import uuid
import Adafruit_BluefruitLE
CHARACTERISTIC_SERVICE_UUID = uuid.UUID('0000fee0-0000-1000-8000-00805f9b34fb')
CHARACTERISTIC_DATA_UUID = uuid.UUID('0000fee1-0000-1000-8000-00805f9b34fb')
provider = Adafruit_BluefruitLE.get_provider()
def main():
provider.clear_cached_data()
adapter = provider.get_default_adapter()
if not adapter.is_powered:
adapter.power_on()
print('Searching for device...')
try:
adapter.start_scan()
device = provider.find_device(service_uuids=[CHARACTERISTIC_SERVICE_UUID])
if device is None:
raise RuntimeError('Failed to find device!')
else:
print(device)
print('device: {0}'.format(device.name))
print('id: {0}'.format(device.id))
finally:
adapter.stop_scan()
print('Connecting to device...')
device.connect()
try:
print('Discovering services...')
device.discover([CHARACTERISTIC_SERVICE_UUID], [CHARACTERISTIC_DATA_UUID])
service = device.find_service(CHARACTERISTIC_SERVICE_UUID)
print('service uuid: {0}'.format(service.uuid))
data = service.find_characteristic(CHARACTERISTIC_DATA_UUID)
print('characteristic uuid: {0}'.format(data.uuid))
print('Writing Data..')
bs = bytes(range(16))
bs = b'\x77\x61\x6E\x67\x00\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00'
data.write_value(bs)
time.sleep(0.1)
bs = b'\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
data.write_value(bs)
time.sleep(0.1)
bs = b'\x00\x00\x00\x00\x00\x00\xE1\x0C\x06\x17\x2D\x23\x00\x00\x00\x00'
data.write_value(bs)
time.sleep(0.1)
bs = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
data.write_value(bs)
time.sleep(0.1)
bs = b'\x00\x00\xc6\xc6\xc6\xfe\xc6\xc6\xc6\xc6\x00\x00\x00\xfe\xc6\xc6'
data.write_value(bs)
time.sleep(0.1)
bs = b'\xfe\xc6\xc6\xc6\xc6\x00\x00\x00\xfe\xc6\xc0\xc0\xc6\xc6\xc6\xfe'
data.write_value(bs)
time.sleep(0.1)
bs = b'\x00\x00\x00\xc6\xcc\xd8\xf0\xd8\xcc\xc6\xc6\x00\x00\x00\x00\x00'
data.write_value(bs)
time.sleep(0.1)
bs = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x6c\x6c'
data.write_value(bs)
time.sleep(0.1)
bs = b'\x7c\x00\x00\x00\x00\x00\x00\x00\x6c\x78\x70\x60\x00\x00\x00\x00'
data.write_value(bs)
time.sleep(0.1)
bs = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\xce\xc6\xc6\xc6\xc6'
data.write_value(bs)
time.sleep(0.1)
bs = b'\xce\xf8\x00\x00\x00\x30\x30\x30\x30\x30\x30\x30\x30\x00\x00\x00'
data.write_value(bs)
time.sleep(0.1)
bs = b'\xfe\xc0\xc0\xfe\xc0\xc0\xc0\xfe\x00\x00\x00\x00\x00\x00\x00\x00'
data.write_value(bs)
time.sleep(3)
print('Writing done.')
finally:
device.disconnect()
provider.initialize()
provider.run_mainloop_with(main)
| 37.02381 | 82 | 0.632797 | 479 | 3,110 | 4.008351 | 0.208768 | 0.303125 | 0.370313 | 0.3875 | 0.398958 | 0.395833 | 0.395833 | 0.372396 | 0.372396 | 0.372396 | 0 | 0.160212 | 0.211254 | 3,110 | 83 | 83 | 37.46988 | 0.622503 | 0 | 0 | 0.355263 | 0 | 0.157895 | 0.327115 | 0.270183 | 0 | 0 | 0 | 0 | 0 | 1 | 0.013158 | false | 0 | 0.052632 | 0 | 0.065789 | 0.144737 | 0 | 0 | 0 | null | 1 | 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 | 3 |
9ad4238b4ae5b1bf04e852349b10a5a6489f5283 | 105 | py | Python | city.py | cromermw/gen_pop | 74541590b0142fac5178e7db25b068d967618dfb | [
"CC0-1.0"
] | null | null | null | city.py | cromermw/gen_pop | 74541590b0142fac5178e7db25b068d967618dfb | [
"CC0-1.0"
] | null | null | null | city.py | cromermw/gen_pop | 74541590b0142fac5178e7db25b068d967618dfb | [
"CC0-1.0"
] | null | null | null | class City:
name = "city"
size = "default"
draw = -1
danger = -1
population = [] | 17.5 | 21 | 0.47619 | 11 | 105 | 4.545455 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03125 | 0.390476 | 105 | 6 | 22 | 17.5 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0.108911 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 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 | 1 | 0 | 0 | 3 |
9add394027ddb25c4a3c822d581f2bbeacc67447 | 245 | py | Python | variables.py | bestend/korquad | 3b92fffcc950ff584e0f9755ea9b04f8bece7a31 | [
"MIT"
] | 1 | 2019-09-06T04:47:14.000Z | 2019-09-06T04:47:14.000Z | variables.py | bestend/korquad | 3b92fffcc950ff584e0f9755ea9b04f8bece7a31 | [
"MIT"
] | 6 | 2020-01-28T22:12:50.000Z | 2022-02-09T23:30:45.000Z | variables.py | bestend/korquad | 3b92fffcc950ff584e0f9755ea9b04f8bece7a31 | [
"MIT"
] | null | null | null | import os
import re
MODEL_FILE_FORMAT = 'weights.{epoch:02d}-{val_loss:.2f}.h5'
MODEL_REGEX_PATTERN = re.compile(r'^.*weights\.(\d+)\-\d+\.\d+\.h5$')
LAST_MODEL_FILE_FORMAT = 'last.h5'
TEAMS_WEBHOOK_URL = os.environ.get('TEAMS_WEBHOOK_URL', '') | 35 | 69 | 0.714286 | 40 | 245 | 4.075 | 0.6 | 0.110429 | 0.184049 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026316 | 0.069388 | 245 | 7 | 70 | 35 | 0.688596 | 0 | 0 | 0 | 0 | 0 | 0.378049 | 0.280488 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
9ae9da1c04d49fc47628f3418837d002feeee3c7 | 3,096 | py | Python | back/src/crud.py | Celeo/wiki_elm | 620caf74b4cc17d3ffe3231493df15e84bfcf67f | [
"MIT"
] | null | null | null | back/src/crud.py | Celeo/wiki_elm | 620caf74b4cc17d3ffe3231493df15e84bfcf67f | [
"MIT"
] | null | null | null | back/src/crud.py | Celeo/wiki_elm | 620caf74b4cc17d3ffe3231493df15e84bfcf67f | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import List, Optional
import bcrypt
from sqlalchemy.orm import Session
from . import models, schemas
def get_user(db: Session, id: int) -> models.User:
"""Return a single user by id.
Args:
db (Session): database connection
id (int): id of the user
Returns:
models.User: user
"""
return db.query(models.User).filter(models.User.id == id).first()
def get_user_by_name(db: Session, name: str) -> models.User:
"""Return a single user by name.
Args:
db (Session): database connection
name (str): name of the user
Returns:
models.User: user
"""
return db.query(models.User).filter(models.User.name == name).first()
def get_all_articles(db: Session) -> List[models.Article]:
"""Return all articles.
Args:
db (Session): database connection
Returns:
List[models.Article]: list of articles
"""
return db.query(models.Article).all()
def get_article(db: Session, id: int) -> models.Article:
"""Return a single article by id.
Args:
db (Session): database connection
id (int): id of the article
Returns:
models.Article: article
"""
return db.query(models.Article).filter(models.Article.id == id).first()
def create_user(db: Session, user: schemas.UserCreate) -> None:
"""Create a new user.
Args:
db (Session): database connection
user: (schemas.UserCreate): creation data
"""
new_user = models.User(name=user.name)
new_user.password = bcrypt.hashpw(user.password, bcrypt.gensalt())
db.add(new_user)
db.commit()
def check_user(db: Session, name: str, password: str) -> Optional[models.User]:
"""Return true if the name and password match.
Args:
db (Session): database connection
name (str): name of the user to check
password (str): password to check against
Returns:
Optional[models.User]: user if the password matches, otherwise None
"""
from_db = get_user_by_name(db, name)
if not from_db:
return None
if bcrypt.checkpw(password.encode('UTF-8'), from_db.password.encode('UTF-8')):
return from_db
return None
def create_article(db: Session, article: schemas.ArticleCreate, creator_id: int) -> None:
"""Create a new article.
Args:
db (Session): database connection
article (schemas.ArticleCreate): data creation data
creator_id (int): user id of the creator
"""
new_article = models.Article(**article.dict(), created_by=creator_id, time_created=datetime.utcnow())
db.add(new_article)
db.commit()
def update_article(db: Session, article: schemas.ArticleUpdate) -> None:
"""Update an article.
Args:
db (Session): database connection
article (schemas.ArticleUpdate): data update data
"""
from_db = get_article(db, article.id)
if article.title:
from_db.title = article.title
if article.content:
from_db.content = article.content
db.commit()
| 26.016807 | 105 | 0.648256 | 405 | 3,096 | 4.876543 | 0.177778 | 0.072911 | 0.052658 | 0.085063 | 0.363544 | 0.243038 | 0.243038 | 0.214684 | 0.162025 | 0.162025 | 0 | 0.000847 | 0.23708 | 3,096 | 118 | 106 | 26.237288 | 0.835309 | 0.385336 | 0 | 0.138889 | 0 | 0 | 0.005945 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0.083333 | 0.138889 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
b119bf6083a2cc2bfb9320284b71a47bcee04389 | 159 | py | Python | kido/settings/production.example.py | alanhamlett/kid-o | 18f88f7dc78c678e017fdc7e0dfb2711bcf2bf74 | [
"BSD-3-Clause"
] | 34 | 2015-08-22T06:57:26.000Z | 2021-11-08T10:47:23.000Z | kido/settings/production.example.py | alanhamlett/kid-o | 18f88f7dc78c678e017fdc7e0dfb2711bcf2bf74 | [
"BSD-3-Clause"
] | 15 | 2015-08-21T20:25:49.000Z | 2022-03-11T23:25:44.000Z | kido/settings/production.example.py | dominino/kid-o | 18f88f7dc78c678e017fdc7e0dfb2711bcf2bf74 | [
"BSD-3-Clause"
] | 5 | 2016-08-22T08:23:45.000Z | 2019-05-07T01:38:38.000Z | SECRET_KEY = None
DB_HOST = "localhost"
DB_NAME = "kido"
DB_USERNAME = "kido"
DB_PASSWORD = "kido"
COMPRESSOR_DEBUG = False
COMPRESSOR_OFFLINE_COMPRESS = True
| 19.875 | 34 | 0.773585 | 22 | 159 | 5.227273 | 0.727273 | 0.104348 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.132075 | 159 | 7 | 35 | 22.714286 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0.132075 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.142857 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
b17abbe2c8f968394190d9316ec3a085ca24ece7 | 197 | py | Python | addons/stats/scripts/predictors/abstract_predictor.py | Kait-tt/tacowassa | 7e71c6ef6b5f939a99a3600025b26d459ebc0233 | [
"MIT"
] | null | null | null | addons/stats/scripts/predictors/abstract_predictor.py | Kait-tt/tacowassa | 7e71c6ef6b5f939a99a3600025b26d459ebc0233 | [
"MIT"
] | 141 | 2016-08-23T03:44:17.000Z | 2017-10-08T02:39:36.000Z | addons/stats/scripts/predictors/abstract_predictor.py | Kait-tt/tacowassa | 7e71c6ef6b5f939a99a3600025b26d459ebc0233 | [
"MIT"
] | 1 | 2019-04-05T15:19:43.000Z | 2019-04-05T15:19:43.000Z | # coding:utf-8
from abc import ABCMeta, abstractmethod
class AbstractPredictor(metaclass=ABCMeta):
@classmethod
@abstractmethod
def predicate(cls, tasks, user_id, cost):
pass
| 19.7 | 45 | 0.720812 | 22 | 197 | 6.409091 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006329 | 0.19797 | 197 | 9 | 46 | 21.888889 | 0.886076 | 0.060914 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0.166667 | 0.166667 | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
b17ac66814a8b6950eb9f7e8278e334fa9498901 | 216 | py | Python | day11/eqatri.py | nikhilsamninan/python-files | 15198459081097058a939b40b5e8ef754e578fe0 | [
"Apache-2.0"
] | null | null | null | day11/eqatri.py | nikhilsamninan/python-files | 15198459081097058a939b40b5e8ef754e578fe0 | [
"Apache-2.0"
] | null | null | null | day11/eqatri.py | nikhilsamninan/python-files | 15198459081097058a939b40b5e8ef754e578fe0 | [
"Apache-2.0"
] | null | null | null | size = 5
m = (2 * size)-2
for i in range(0, size):
for j in range(0, m):
print(end=" ")
m = m - 1
for j in range(0, i + 1):
if(m%2!=0):
print("*", end=" ")
print("") | 12.705882 | 31 | 0.388889 | 37 | 216 | 2.27027 | 0.378378 | 0.25 | 0.285714 | 0.261905 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0.077519 | 0.402778 | 216 | 17 | 32 | 12.705882 | 0.573643 | 0 | 0 | 0 | 0 | 0 | 0.013825 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.3 | 0 | 0 | 0 | null | 1 | 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 | 3 |
b17cbc82703ac9fc882cd99a409335fa53853226 | 226 | py | Python | samples-python/datalayer.calc/calculations/__init__.py | bracoe/ctrlx-automation-sdk | 6b2e61e146c557488125baf941e4d64c6fa6d0fb | [
"MIT"
] | 16 | 2021-08-23T13:07:12.000Z | 2022-02-21T13:29:21.000Z | samples-python/datalayer.calc/calculations/__init__.py | bracoe/ctrlx-automation-sdk | 6b2e61e146c557488125baf941e4d64c6fa6d0fb | [
"MIT"
] | null | null | null | samples-python/datalayer.calc/calculations/__init__.py | bracoe/ctrlx-automation-sdk | 6b2e61e146c557488125baf941e4d64c6fa6d0fb | [
"MIT"
] | 10 | 2021-09-29T09:58:33.000Z | 2022-01-13T07:20:00.000Z | __version__ = '2.0.0'
__description__ = 'Sample for calculations with data from the ctrlX Data Layer'
__author__ = 'Fantastic Python Developers'
__licence__ = 'MIT License'
__copyright__ = 'Copyright (c) 2021 Bosch Rexroth AG' | 45.2 | 79 | 0.778761 | 29 | 226 | 5.37931 | 0.896552 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035897 | 0.137168 | 226 | 5 | 80 | 45.2 | 0.764103 | 0 | 0 | 0 | 0 | 0 | 0.603524 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b17e60242b5d5da25f1f85bc29429ee00fd48f19 | 320 | py | Python | sqlalchemist/models/definitions.py | pmav99/sqlalchemist | af784f8d6e7c6c7298ad273c481af748cc0332d5 | [
"BSD-3-Clause"
] | 7 | 2019-09-06T21:58:42.000Z | 2021-12-02T21:48:35.000Z | sqlalchemist/models/definitions.py | pmav99/sqlalchemy_playground | af784f8d6e7c6c7298ad273c481af748cc0332d5 | [
"BSD-3-Clause"
] | null | null | null | sqlalchemist/models/definitions.py | pmav99/sqlalchemy_playground | af784f8d6e7c6c7298ad273c481af748cc0332d5 | [
"BSD-3-Clause"
] | 1 | 2021-01-22T03:23:21.000Z | 2021-01-22T03:23:21.000Z | import sqlalchemy as sa
from .meta import Base
class Person(Base):
__tablename__ = "person"
id = sa.Column(sa.Integer, primary_key=True)
name = sa.Column(sa.String)
date_of_birth = sa.Column(sa.Date)
height = sa.Column(sa.Integer)
weight = sa.Column(sa.Numeric)
__all__ = [
"Person",
]
| 16.842105 | 48 | 0.6625 | 45 | 320 | 4.466667 | 0.555556 | 0.199005 | 0.248756 | 0.169154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2125 | 320 | 18 | 49 | 17.777778 | 0.797619 | 0 | 0 | 0 | 0 | 0 | 0.0375 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.75 | 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 | 1 | 0 | 0 | 3 |
b1a35e06a9245c638232ac973c3cdcca21d276f6 | 980 | py | Python | project/tests/scripts/system_vars.py | LeDron12/c2eo | 4f0dc6ed79df0739bd834eda6a0f77f3caf4292c | [
"MIT"
] | 12 | 2021-08-05T12:12:09.000Z | 2022-03-08T13:33:53.000Z | project/tests/scripts/system_vars.py | LeDron12/c2eo | 4f0dc6ed79df0739bd834eda6a0f77f3caf4292c | [
"MIT"
] | 26 | 2021-08-23T10:25:37.000Z | 2022-03-30T12:56:08.000Z | project/tests/scripts/system_vars.py | LeDron12/c2eo | 4f0dc6ed79df0739bd834eda6a0f77f3caf4292c | [
"MIT"
] | 12 | 2021-08-17T09:20:07.000Z | 2022-03-31T13:37:28.000Z | integer = [
['lld', 'long long', 9223372036854775807, -9223372036854775808],
['ld', 'long', 9223372036854775807, -9223372036854775808],
['lu', 'unsigned long', 18446744073709551615, 0],
['d', 'signed', 2147483647, -2147483648],
['u', 'unsigned', 4294967295, 0],
['hd', 'short', 32767, -32768],
['hu', 'unsigned short', 65535, 0],
['c', 'char', 127, -128],
['c', 'unsigned char', 255, 0],
['d', '_Bool', 1, 0],
]
real = [
['f', 'float', 3.40282e+38, -3.40282e+38],
['f', 'double', 1.79769e+308, -1.79769e+308],
['Lf', 'long double', 1.79769e+308, -1.79769e+308]
]
# todo: fix path
path = ''
directory = 'env'
filename1 = f'{directory}/code1.c'
filename2 = f'{directory}/code2.c'
logfile1 = f'{directory}/log1.txt'
logfile2 = f'{directory}/log2.txt'
eo_out = f'{directory}/eo_out.txt'
c_out = f'{directory}/c_out.txt'
c_bin = f'{directory}/a.out'
launcher = '../../bin/launcher.py'
full_log = None
resultDir = '../../../result'
| 29.69697 | 68 | 0.596939 | 126 | 980 | 4.587302 | 0.507937 | 0.121107 | 0.069204 | 0.055363 | 0.089965 | 0.089965 | 0.089965 | 0 | 0 | 0 | 0 | 0.263094 | 0.162245 | 980 | 32 | 69 | 30.625 | 0.440926 | 0.014286 | 0 | 0 | 0 | 0 | 0.311203 | 0.06639 | 0 | 0 | 0 | 0.03125 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
491612be631c7616e895777f18a1f1f4ec09ba72 | 15,815 | py | Python | src/goesrecv/support/generate_interpolator_taps.py | codient/goestools | 862600960681a1a1f3942f18f40b1f17dcdffc40 | [
"BSD-2-Clause"
] | 244 | 2017-11-07T12:12:23.000Z | 2022-03-24T07:24:53.000Z | src/goesrecv/support/generate_interpolator_taps.py | codient/goestools | 862600960681a1a1f3942f18f40b1f17dcdffc40 | [
"BSD-2-Clause"
] | 116 | 2018-03-07T04:02:26.000Z | 2022-03-27T12:08:01.000Z | src/goesrecv/support/generate_interpolator_taps.py | codient/goestools | 862600960681a1a1f3942f18f40b1f17dcdffc40 | [
"BSD-2-Clause"
] | 65 | 2018-05-28T02:44:21.000Z | 2022-03-18T12:27:58.000Z | #!/usr/bin/env python
#
# Create filter taps to use for interpolation filter in
# clock recovery algorithm. These taps are copied from
# GNU Radio at gnuradio/filter/interpolator_taps.h.
#
# This file includes them in natural order and I want
# them stored in reversed order such that they can be
# used directly.
#
filters = [
[ 0.00000e+00, 0.00000e+00, 0.00000e+00, 0.00000e+00, 1.00000e+00, 0.00000e+00, 0.00000e+00, 0.00000e+00 ],
[ -1.54700e-04, 8.53777e-04, -2.76968e-03, 7.89295e-03, 9.98534e-01, -5.41054e-03, 1.24642e-03, -1.98993e-04 ],
[ -3.09412e-04, 1.70888e-03, -5.55134e-03, 1.58840e-02, 9.96891e-01, -1.07209e-02, 2.47942e-03, -3.96391e-04 ],
[ -4.64053e-04, 2.56486e-03, -8.34364e-03, 2.39714e-02, 9.95074e-01, -1.59305e-02, 3.69852e-03, -5.92100e-04 ],
[ -6.18544e-04, 3.42130e-03, -1.11453e-02, 3.21531e-02, 9.93082e-01, -2.10389e-02, 4.90322e-03, -7.86031e-04 ],
[ -7.72802e-04, 4.27773e-03, -1.39548e-02, 4.04274e-02, 9.90917e-01, -2.60456e-02, 6.09305e-03, -9.78093e-04 ],
[ -9.26747e-04, 5.13372e-03, -1.67710e-02, 4.87921e-02, 9.88580e-01, -3.09503e-02, 7.26755e-03, -1.16820e-03 ],
[ -1.08030e-03, 5.98883e-03, -1.95925e-02, 5.72454e-02, 9.86071e-01, -3.57525e-02, 8.42626e-03, -1.35627e-03 ],
[ -1.23337e-03, 6.84261e-03, -2.24178e-02, 6.57852e-02, 9.83392e-01, -4.04519e-02, 9.56876e-03, -1.54221e-03 ],
[ -1.38589e-03, 7.69462e-03, -2.52457e-02, 7.44095e-02, 9.80543e-01, -4.50483e-02, 1.06946e-02, -1.72594e-03 ],
[ -1.53777e-03, 8.54441e-03, -2.80746e-02, 8.31162e-02, 9.77526e-01, -4.95412e-02, 1.18034e-02, -1.90738e-03 ],
[ -1.68894e-03, 9.39154e-03, -3.09033e-02, 9.19033e-02, 9.74342e-01, -5.39305e-02, 1.28947e-02, -2.08645e-03 ],
[ -1.83931e-03, 1.02356e-02, -3.37303e-02, 1.00769e-01, 9.70992e-01, -5.82159e-02, 1.39681e-02, -2.26307e-03 ],
[ -1.98880e-03, 1.10760e-02, -3.65541e-02, 1.09710e-01, 9.67477e-01, -6.23972e-02, 1.50233e-02, -2.43718e-03 ],
[ -2.13733e-03, 1.19125e-02, -3.93735e-02, 1.18725e-01, 9.63798e-01, -6.64743e-02, 1.60599e-02, -2.60868e-03 ],
[ -2.28483e-03, 1.27445e-02, -4.21869e-02, 1.27812e-01, 9.59958e-01, -7.04471e-02, 1.70776e-02, -2.77751e-03 ],
[ -2.43121e-03, 1.35716e-02, -4.49929e-02, 1.36968e-01, 9.55956e-01, -7.43154e-02, 1.80759e-02, -2.94361e-03 ],
[ -2.57640e-03, 1.43934e-02, -4.77900e-02, 1.46192e-01, 9.51795e-01, -7.80792e-02, 1.90545e-02, -3.10689e-03 ],
[ -2.72032e-03, 1.52095e-02, -5.05770e-02, 1.55480e-01, 9.47477e-01, -8.17385e-02, 2.00132e-02, -3.26730e-03 ],
[ -2.86289e-03, 1.60193e-02, -5.33522e-02, 1.64831e-01, 9.43001e-01, -8.52933e-02, 2.09516e-02, -3.42477e-03 ],
[ -3.00403e-03, 1.68225e-02, -5.61142e-02, 1.74242e-01, 9.38371e-01, -8.87435e-02, 2.18695e-02, -3.57923e-03 ],
[ -3.14367e-03, 1.76185e-02, -5.88617e-02, 1.83711e-01, 9.33586e-01, -9.20893e-02, 2.27664e-02, -3.73062e-03 ],
[ -3.28174e-03, 1.84071e-02, -6.15931e-02, 1.93236e-01, 9.28650e-01, -9.53307e-02, 2.36423e-02, -3.87888e-03 ],
[ -3.41815e-03, 1.91877e-02, -6.43069e-02, 2.02814e-01, 9.23564e-01, -9.84679e-02, 2.44967e-02, -4.02397e-03 ],
[ -3.55283e-03, 1.99599e-02, -6.70018e-02, 2.12443e-01, 9.18329e-01, -1.01501e-01, 2.53295e-02, -4.16581e-03 ],
[ -3.68570e-03, 2.07233e-02, -6.96762e-02, 2.22120e-01, 9.12947e-01, -1.04430e-01, 2.61404e-02, -4.30435e-03 ],
[ -3.81671e-03, 2.14774e-02, -7.23286e-02, 2.31843e-01, 9.07420e-01, -1.07256e-01, 2.69293e-02, -4.43955e-03 ],
[ -3.94576e-03, 2.22218e-02, -7.49577e-02, 2.41609e-01, 9.01749e-01, -1.09978e-01, 2.76957e-02, -4.57135e-03 ],
[ -4.07279e-03, 2.29562e-02, -7.75620e-02, 2.51417e-01, 8.95936e-01, -1.12597e-01, 2.84397e-02, -4.69970e-03 ],
[ -4.19774e-03, 2.36801e-02, -8.01399e-02, 2.61263e-01, 8.89984e-01, -1.15113e-01, 2.91609e-02, -4.82456e-03 ],
[ -4.32052e-03, 2.43930e-02, -8.26900e-02, 2.71144e-01, 8.83893e-01, -1.17526e-01, 2.98593e-02, -4.94589e-03 ],
[ -4.44107e-03, 2.50946e-02, -8.52109e-02, 2.81060e-01, 8.77666e-01, -1.19837e-01, 3.05345e-02, -5.06363e-03 ],
[ -4.55932e-03, 2.57844e-02, -8.77011e-02, 2.91006e-01, 8.71305e-01, -1.22047e-01, 3.11866e-02, -5.17776e-03 ],
[ -4.67520e-03, 2.64621e-02, -9.01591e-02, 3.00980e-01, 8.64812e-01, -1.24154e-01, 3.18153e-02, -5.28823e-03 ],
[ -4.78866e-03, 2.71272e-02, -9.25834e-02, 3.10980e-01, 8.58189e-01, -1.26161e-01, 3.24205e-02, -5.39500e-03 ],
[ -4.89961e-03, 2.77794e-02, -9.49727e-02, 3.21004e-01, 8.51437e-01, -1.28068e-01, 3.30021e-02, -5.49804e-03 ],
[ -5.00800e-03, 2.84182e-02, -9.73254e-02, 3.31048e-01, 8.44559e-01, -1.29874e-01, 3.35600e-02, -5.59731e-03 ],
[ -5.11376e-03, 2.90433e-02, -9.96402e-02, 3.41109e-01, 8.37557e-01, -1.31581e-01, 3.40940e-02, -5.69280e-03 ],
[ -5.21683e-03, 2.96543e-02, -1.01915e-01, 3.51186e-01, 8.30432e-01, -1.33189e-01, 3.46042e-02, -5.78446e-03 ],
[ -5.31716e-03, 3.02507e-02, -1.04150e-01, 3.61276e-01, 8.23188e-01, -1.34699e-01, 3.50903e-02, -5.87227e-03 ],
[ -5.41467e-03, 3.08323e-02, -1.06342e-01, 3.71376e-01, 8.15826e-01, -1.36111e-01, 3.55525e-02, -5.95620e-03 ],
[ -5.50931e-03, 3.13987e-02, -1.08490e-01, 3.81484e-01, 8.08348e-01, -1.37426e-01, 3.59905e-02, -6.03624e-03 ],
[ -5.60103e-03, 3.19495e-02, -1.10593e-01, 3.91596e-01, 8.00757e-01, -1.38644e-01, 3.64044e-02, -6.11236e-03 ],
[ -5.68976e-03, 3.24843e-02, -1.12650e-01, 4.01710e-01, 7.93055e-01, -1.39767e-01, 3.67941e-02, -6.18454e-03 ],
[ -5.77544e-03, 3.30027e-02, -1.14659e-01, 4.11823e-01, 7.85244e-01, -1.40794e-01, 3.71596e-02, -6.25277e-03 ],
[ -5.85804e-03, 3.35046e-02, -1.16618e-01, 4.21934e-01, 7.77327e-01, -1.41727e-01, 3.75010e-02, -6.31703e-03 ],
[ -5.93749e-03, 3.39894e-02, -1.18526e-01, 4.32038e-01, 7.69305e-01, -1.42566e-01, 3.78182e-02, -6.37730e-03 ],
[ -6.01374e-03, 3.44568e-02, -1.20382e-01, 4.42134e-01, 7.61181e-01, -1.43313e-01, 3.81111e-02, -6.43358e-03 ],
[ -6.08674e-03, 3.49066e-02, -1.22185e-01, 4.52218e-01, 7.52958e-01, -1.43968e-01, 3.83800e-02, -6.48585e-03 ],
[ -6.15644e-03, 3.53384e-02, -1.23933e-01, 4.62289e-01, 7.44637e-01, -1.44531e-01, 3.86247e-02, -6.53412e-03 ],
[ -6.22280e-03, 3.57519e-02, -1.25624e-01, 4.72342e-01, 7.36222e-01, -1.45004e-01, 3.88454e-02, -6.57836e-03 ],
[ -6.28577e-03, 3.61468e-02, -1.27258e-01, 4.82377e-01, 7.27714e-01, -1.45387e-01, 3.90420e-02, -6.61859e-03 ],
[ -6.34530e-03, 3.65227e-02, -1.28832e-01, 4.92389e-01, 7.19116e-01, -1.45682e-01, 3.92147e-02, -6.65479e-03 ],
[ -6.40135e-03, 3.68795e-02, -1.30347e-01, 5.02377e-01, 7.10431e-01, -1.45889e-01, 3.93636e-02, -6.68698e-03 ],
[ -6.45388e-03, 3.72167e-02, -1.31800e-01, 5.12337e-01, 7.01661e-01, -1.46009e-01, 3.94886e-02, -6.71514e-03 ],
[ -6.50285e-03, 3.75341e-02, -1.33190e-01, 5.22267e-01, 6.92808e-01, -1.46043e-01, 3.95900e-02, -6.73929e-03 ],
[ -6.54823e-03, 3.78315e-02, -1.34515e-01, 5.32164e-01, 6.83875e-01, -1.45993e-01, 3.96678e-02, -6.75943e-03 ],
[ -6.58996e-03, 3.81085e-02, -1.35775e-01, 5.42025e-01, 6.74865e-01, -1.45859e-01, 3.97222e-02, -6.77557e-03 ],
[ -6.62802e-03, 3.83650e-02, -1.36969e-01, 5.51849e-01, 6.65779e-01, -1.45641e-01, 3.97532e-02, -6.78771e-03 ],
[ -6.66238e-03, 3.86006e-02, -1.38094e-01, 5.61631e-01, 6.56621e-01, -1.45343e-01, 3.97610e-02, -6.79588e-03 ],
[ -6.69300e-03, 3.88151e-02, -1.39150e-01, 5.71370e-01, 6.47394e-01, -1.44963e-01, 3.97458e-02, -6.80007e-03 ],
[ -6.71985e-03, 3.90083e-02, -1.40136e-01, 5.81063e-01, 6.38099e-01, -1.44503e-01, 3.97077e-02, -6.80032e-03 ],
[ -6.74291e-03, 3.91800e-02, -1.41050e-01, 5.90706e-01, 6.28739e-01, -1.43965e-01, 3.96469e-02, -6.79662e-03 ],
[ -6.76214e-03, 3.93299e-02, -1.41891e-01, 6.00298e-01, 6.19318e-01, -1.43350e-01, 3.95635e-02, -6.78902e-03 ],
[ -6.77751e-03, 3.94578e-02, -1.42658e-01, 6.09836e-01, 6.09836e-01, -1.42658e-01, 3.94578e-02, -6.77751e-03 ],
[ -6.78902e-03, 3.95635e-02, -1.43350e-01, 6.19318e-01, 6.00298e-01, -1.41891e-01, 3.93299e-02, -6.76214e-03 ],
[ -6.79662e-03, 3.96469e-02, -1.43965e-01, 6.28739e-01, 5.90706e-01, -1.41050e-01, 3.91800e-02, -6.74291e-03 ],
[ -6.80032e-03, 3.97077e-02, -1.44503e-01, 6.38099e-01, 5.81063e-01, -1.40136e-01, 3.90083e-02, -6.71985e-03 ],
[ -6.80007e-03, 3.97458e-02, -1.44963e-01, 6.47394e-01, 5.71370e-01, -1.39150e-01, 3.88151e-02, -6.69300e-03 ],
[ -6.79588e-03, 3.97610e-02, -1.45343e-01, 6.56621e-01, 5.61631e-01, -1.38094e-01, 3.86006e-02, -6.66238e-03 ],
[ -6.78771e-03, 3.97532e-02, -1.45641e-01, 6.65779e-01, 5.51849e-01, -1.36969e-01, 3.83650e-02, -6.62802e-03 ],
[ -6.77557e-03, 3.97222e-02, -1.45859e-01, 6.74865e-01, 5.42025e-01, -1.35775e-01, 3.81085e-02, -6.58996e-03 ],
[ -6.75943e-03, 3.96678e-02, -1.45993e-01, 6.83875e-01, 5.32164e-01, -1.34515e-01, 3.78315e-02, -6.54823e-03 ],
[ -6.73929e-03, 3.95900e-02, -1.46043e-01, 6.92808e-01, 5.22267e-01, -1.33190e-01, 3.75341e-02, -6.50285e-03 ],
[ -6.71514e-03, 3.94886e-02, -1.46009e-01, 7.01661e-01, 5.12337e-01, -1.31800e-01, 3.72167e-02, -6.45388e-03 ],
[ -6.68698e-03, 3.93636e-02, -1.45889e-01, 7.10431e-01, 5.02377e-01, -1.30347e-01, 3.68795e-02, -6.40135e-03 ],
[ -6.65479e-03, 3.92147e-02, -1.45682e-01, 7.19116e-01, 4.92389e-01, -1.28832e-01, 3.65227e-02, -6.34530e-03 ],
[ -6.61859e-03, 3.90420e-02, -1.45387e-01, 7.27714e-01, 4.82377e-01, -1.27258e-01, 3.61468e-02, -6.28577e-03 ],
[ -6.57836e-03, 3.88454e-02, -1.45004e-01, 7.36222e-01, 4.72342e-01, -1.25624e-01, 3.57519e-02, -6.22280e-03 ],
[ -6.53412e-03, 3.86247e-02, -1.44531e-01, 7.44637e-01, 4.62289e-01, -1.23933e-01, 3.53384e-02, -6.15644e-03 ],
[ -6.48585e-03, 3.83800e-02, -1.43968e-01, 7.52958e-01, 4.52218e-01, -1.22185e-01, 3.49066e-02, -6.08674e-03 ],
[ -6.43358e-03, 3.81111e-02, -1.43313e-01, 7.61181e-01, 4.42134e-01, -1.20382e-01, 3.44568e-02, -6.01374e-03 ],
[ -6.37730e-03, 3.78182e-02, -1.42566e-01, 7.69305e-01, 4.32038e-01, -1.18526e-01, 3.39894e-02, -5.93749e-03 ],
[ -6.31703e-03, 3.75010e-02, -1.41727e-01, 7.77327e-01, 4.21934e-01, -1.16618e-01, 3.35046e-02, -5.85804e-03 ],
[ -6.25277e-03, 3.71596e-02, -1.40794e-01, 7.85244e-01, 4.11823e-01, -1.14659e-01, 3.30027e-02, -5.77544e-03 ],
[ -6.18454e-03, 3.67941e-02, -1.39767e-01, 7.93055e-01, 4.01710e-01, -1.12650e-01, 3.24843e-02, -5.68976e-03 ],
[ -6.11236e-03, 3.64044e-02, -1.38644e-01, 8.00757e-01, 3.91596e-01, -1.10593e-01, 3.19495e-02, -5.60103e-03 ],
[ -6.03624e-03, 3.59905e-02, -1.37426e-01, 8.08348e-01, 3.81484e-01, -1.08490e-01, 3.13987e-02, -5.50931e-03 ],
[ -5.95620e-03, 3.55525e-02, -1.36111e-01, 8.15826e-01, 3.71376e-01, -1.06342e-01, 3.08323e-02, -5.41467e-03 ],
[ -5.87227e-03, 3.50903e-02, -1.34699e-01, 8.23188e-01, 3.61276e-01, -1.04150e-01, 3.02507e-02, -5.31716e-03 ],
[ -5.78446e-03, 3.46042e-02, -1.33189e-01, 8.30432e-01, 3.51186e-01, -1.01915e-01, 2.96543e-02, -5.21683e-03 ],
[ -5.69280e-03, 3.40940e-02, -1.31581e-01, 8.37557e-01, 3.41109e-01, -9.96402e-02, 2.90433e-02, -5.11376e-03 ],
[ -5.59731e-03, 3.35600e-02, -1.29874e-01, 8.44559e-01, 3.31048e-01, -9.73254e-02, 2.84182e-02, -5.00800e-03 ],
[ -5.49804e-03, 3.30021e-02, -1.28068e-01, 8.51437e-01, 3.21004e-01, -9.49727e-02, 2.77794e-02, -4.89961e-03 ],
[ -5.39500e-03, 3.24205e-02, -1.26161e-01, 8.58189e-01, 3.10980e-01, -9.25834e-02, 2.71272e-02, -4.78866e-03 ],
[ -5.28823e-03, 3.18153e-02, -1.24154e-01, 8.64812e-01, 3.00980e-01, -9.01591e-02, 2.64621e-02, -4.67520e-03 ],
[ -5.17776e-03, 3.11866e-02, -1.22047e-01, 8.71305e-01, 2.91006e-01, -8.77011e-02, 2.57844e-02, -4.55932e-03 ],
[ -5.06363e-03, 3.05345e-02, -1.19837e-01, 8.77666e-01, 2.81060e-01, -8.52109e-02, 2.50946e-02, -4.44107e-03 ],
[ -4.94589e-03, 2.98593e-02, -1.17526e-01, 8.83893e-01, 2.71144e-01, -8.26900e-02, 2.43930e-02, -4.32052e-03 ],
[ -4.82456e-03, 2.91609e-02, -1.15113e-01, 8.89984e-01, 2.61263e-01, -8.01399e-02, 2.36801e-02, -4.19774e-03 ],
[ -4.69970e-03, 2.84397e-02, -1.12597e-01, 8.95936e-01, 2.51417e-01, -7.75620e-02, 2.29562e-02, -4.07279e-03 ],
[ -4.57135e-03, 2.76957e-02, -1.09978e-01, 9.01749e-01, 2.41609e-01, -7.49577e-02, 2.22218e-02, -3.94576e-03 ],
[ -4.43955e-03, 2.69293e-02, -1.07256e-01, 9.07420e-01, 2.31843e-01, -7.23286e-02, 2.14774e-02, -3.81671e-03 ],
[ -4.30435e-03, 2.61404e-02, -1.04430e-01, 9.12947e-01, 2.22120e-01, -6.96762e-02, 2.07233e-02, -3.68570e-03 ],
[ -4.16581e-03, 2.53295e-02, -1.01501e-01, 9.18329e-01, 2.12443e-01, -6.70018e-02, 1.99599e-02, -3.55283e-03 ],
[ -4.02397e-03, 2.44967e-02, -9.84679e-02, 9.23564e-01, 2.02814e-01, -6.43069e-02, 1.91877e-02, -3.41815e-03 ],
[ -3.87888e-03, 2.36423e-02, -9.53307e-02, 9.28650e-01, 1.93236e-01, -6.15931e-02, 1.84071e-02, -3.28174e-03 ],
[ -3.73062e-03, 2.27664e-02, -9.20893e-02, 9.33586e-01, 1.83711e-01, -5.88617e-02, 1.76185e-02, -3.14367e-03 ],
[ -3.57923e-03, 2.18695e-02, -8.87435e-02, 9.38371e-01, 1.74242e-01, -5.61142e-02, 1.68225e-02, -3.00403e-03 ],
[ -3.42477e-03, 2.09516e-02, -8.52933e-02, 9.43001e-01, 1.64831e-01, -5.33522e-02, 1.60193e-02, -2.86289e-03 ],
[ -3.26730e-03, 2.00132e-02, -8.17385e-02, 9.47477e-01, 1.55480e-01, -5.05770e-02, 1.52095e-02, -2.72032e-03 ],
[ -3.10689e-03, 1.90545e-02, -7.80792e-02, 9.51795e-01, 1.46192e-01, -4.77900e-02, 1.43934e-02, -2.57640e-03 ],
[ -2.94361e-03, 1.80759e-02, -7.43154e-02, 9.55956e-01, 1.36968e-01, -4.49929e-02, 1.35716e-02, -2.43121e-03 ],
[ -2.77751e-03, 1.70776e-02, -7.04471e-02, 9.59958e-01, 1.27812e-01, -4.21869e-02, 1.27445e-02, -2.28483e-03 ],
[ -2.60868e-03, 1.60599e-02, -6.64743e-02, 9.63798e-01, 1.18725e-01, -3.93735e-02, 1.19125e-02, -2.13733e-03 ],
[ -2.43718e-03, 1.50233e-02, -6.23972e-02, 9.67477e-01, 1.09710e-01, -3.65541e-02, 1.10760e-02, -1.98880e-03 ],
[ -2.26307e-03, 1.39681e-02, -5.82159e-02, 9.70992e-01, 1.00769e-01, -3.37303e-02, 1.02356e-02, -1.83931e-03 ],
[ -2.08645e-03, 1.28947e-02, -5.39305e-02, 9.74342e-01, 9.19033e-02, -3.09033e-02, 9.39154e-03, -1.68894e-03 ],
[ -1.90738e-03, 1.18034e-02, -4.95412e-02, 9.77526e-01, 8.31162e-02, -2.80746e-02, 8.54441e-03, -1.53777e-03 ],
[ -1.72594e-03, 1.06946e-02, -4.50483e-02, 9.80543e-01, 7.44095e-02, -2.52457e-02, 7.69462e-03, -1.38589e-03 ],
[ -1.54221e-03, 9.56876e-03, -4.04519e-02, 9.83392e-01, 6.57852e-02, -2.24178e-02, 6.84261e-03, -1.23337e-03 ],
[ -1.35627e-03, 8.42626e-03, -3.57525e-02, 9.86071e-01, 5.72454e-02, -1.95925e-02, 5.98883e-03, -1.08030e-03 ],
[ -1.16820e-03, 7.26755e-03, -3.09503e-02, 9.88580e-01, 4.87921e-02, -1.67710e-02, 5.13372e-03, -9.26747e-04 ],
[ -9.78093e-04, 6.09305e-03, -2.60456e-02, 9.90917e-01, 4.04274e-02, -1.39548e-02, 4.27773e-03, -7.72802e-04 ],
[ -7.86031e-04, 4.90322e-03, -2.10389e-02, 9.93082e-01, 3.21531e-02, -1.11453e-02, 3.42130e-03, -6.18544e-04 ],
[ -5.92100e-04, 3.69852e-03, -1.59305e-02, 9.95074e-01, 2.39714e-02, -8.34364e-03, 2.56486e-03, -4.64053e-04 ],
[ -3.96391e-04, 2.47942e-03, -1.07209e-02, 9.96891e-01, 1.58840e-02, -5.55134e-03, 1.70888e-03, -3.09412e-04 ],
[ -1.98993e-04, 1.24642e-03, -5.41054e-03, 9.98534e-01, 7.89295e-03, -2.76968e-03, 8.53777e-04, -1.54700e-04 ],
[ 0.00000e+00, 0.00000e+00, 0.00000e+00, 1.00000e+00, 0.00000e+00, 0.00000e+00, 0.00000e+00, 0.00000e+00 ]
]
print("static const int NUM_TAPS = 8;")
print("static const int NUM_STEPS = 128;")
print("static const mmseTaps[NUM_STEPS+1][NUM_TAPS] = {")
for taps in filters:
body = ", ".join("%.5e" % t for t in reversed(taps))
print("{ " + body + " },")
print("};")
| 104.735099 | 117 | 0.613152 | 3,187 | 15,815 | 3.041104 | 0.181362 | 0.03343 | 0.013 | 0.018572 | 0.021977 | 0.014961 | 0.014961 | 0.014961 | 0.014961 | 0.014961 | 0 | 0.605896 | 0.137781 | 15,815 | 150 | 118 | 105.433333 | 0.104869 | 0.018716 | 0 | 0 | 0 | 0 | 0.007995 | 0.001999 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.036232 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4921f463d2a5ff012c886046b237e9741fc7a1a8 | 2,328 | py | Python | nats/aio/errors.py | sr34/asyncio-nats | 347a8e4b3eab275085858a6c8016feb3457905a3 | [
"Apache-2.0"
] | null | null | null | nats/aio/errors.py | sr34/asyncio-nats | 347a8e4b3eab275085858a6c8016feb3457905a3 | [
"Apache-2.0"
] | null | null | null | nats/aio/errors.py | sr34/asyncio-nats | 347a8e4b3eab275085858a6c8016feb3457905a3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2018 The NATS Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import asyncio
STALE_CONNECTION = b"'Stale Connection'"
AUTHORIZATION_VIOLATION = b"'Authorization Violation'"
class NatsError(Exception):
pass
class ErrConnectionClosed(NatsError):
def __str__(self):
return "nats: Connection Closed"
class ErrSecureConnRequired(NatsError):
def __str__(self):
return "nats: Secure Connection required"
class ErrSecureConnWanted(NatsError):
def __str__(self):
return "nats: Secure Connection not available"
class ErrSecureConnFailed(NatsError):
def __str__(self):
return "nats: Secure Connection failed"
class ErrBadSubscription(NatsError):
def __str__(self):
return "nats: Invalid Subscription"
class ErrBadSubject(NatsError):
def __str__(self):
return "nats: Invalid Subject"
class ErrSlowConsumer(NatsError):
def __init__(self, subject=None, sid=None):
self.subject = subject
self.sid = sid
def __str__(self):
return "nats: Slow Consumer, messages dropped"
class ErrTimeout(asyncio.TimeoutError):
def __str__(self):
return "nats: Timeout"
class ErrBadTimeout(NatsError):
def __str__(self):
return "nats: Timeout Invalid"
class ErrAuthorization(NatsError):
def __str__(self):
return "nats: Authorization Failed"
class ErrNoServers(NatsError):
def __str__(self):
return "nats: No servers available for connection"
class ErrJsonParse(NatsError):
def __str__(self):
return "nats: Connect message, json parse err"
class ErrStaleConnection(NatsError):
def __str__(self):
return "nats: Stale Connection"
class ErrMaxPayload(NatsError):
def __str__(self):
return "nats: Maximum Payload Exceeded"
| 24.25 | 74 | 0.717354 | 274 | 2,328 | 5.868613 | 0.434307 | 0.052239 | 0.087065 | 0.139303 | 0.288557 | 0.276119 | 0.128731 | 0.083955 | 0 | 0 | 0 | 0.006448 | 0.200601 | 2,328 | 95 | 75 | 24.505263 | 0.857603 | 0.237973 | 0 | 0.28 | 0 | 0 | 0.249432 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0.02 | 0.02 | 0.28 | 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 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
49233a1586edace305f6bd1e93ae01acb6ace60f | 4,381 | py | Python | map_methods_to_mach_ports/parseXcodeLogs.py | malus-security/kobold | 2ae23b75ec503ef3702ad297ddbb7824ac4da53c | [
"BSD-3-Clause"
] | 3 | 2020-06-26T19:44:46.000Z | 2021-03-25T07:00:04.000Z | map_methods_to_mach_ports/parseXcodeLogs.py | malus-security/kobold | 2ae23b75ec503ef3702ad297ddbb7824ac4da53c | [
"BSD-3-Clause"
] | null | null | null | map_methods_to_mach_ports/parseXcodeLogs.py | malus-security/kobold | 2ae23b75ec503ef3702ad297ddbb7824ac4da53c | [
"BSD-3-Clause"
] | 1 | 2020-09-14T23:46:31.000Z | 2020-09-14T23:46:31.000Z | #Input
#Xcode logs output by autogenerated method invocations
#Requirements
#Infer which invocation numbers failed/succeeded
#Infer apparent entitlement requirements based on error message from completion handlers
#Detect which invocation numbers should have had completion handlers
#Map new information to mach-port and method declaration
import pickle
import re
#TODO: this code needs to get a lot smarter as we collect more entitlement samples
def lookForEntReqs(id, thisInvocation, knownEntKeyList):
errorString = "NSError * var"
for line in thisInvocation["logLines"]:
if errorString in line:
if "entitlement" in line:
#We can use a corpus of known entitlement keys and search for those values in the error message
for key in knownEntKeyList:
if key in line:
thisInvocation["entitlementRequirement"].add(key)
#If the word entitlement is in the error message, but we don't find a key then something went wrong.
if len(thisInvocation["entitlementRequirement"]) == 0:
print "ERROR: No known entitlement key found in message that mentions the word 'entitlement'. Likely false negative."
#If we find more than one key in the error message, then something went wrong.
if len(thisInvocation["entitlementRequirement"]) > 1:
print "ERROR: More than one known entitlement key was detected in the same message. Likely false positive."
#this is some old code that assumed entitlement keys would be surrounded by fancy quotes, but that is not always the case.
"""
fancyQuoteSlices= line.split('\xe2\x80\x9c')[1:]
for slice in fancyQuoteSlices:
thisInvocation["entitlementRequirement"].add(slice.split('\xe2\x80\x9d')[0])
"""
def parseRelevantLogs(id, thisInvocation, logLines):
#logLines = raw_xcode_logs.split("\n")
for line in logLines:
idTag = "id "+id+": "
if idTag in line:
#break off the text before the id tag
#TODO this system will miss array output that uses multiple lines.
thisInvocation["logLines"].append(line.split(idTag)[-1])
def checkForCompletionStatus(id, thisInvocation):
completionString = "Completion message"
if completionString in thisInvocation["logLines"]:
thisInvocation["valid"] = True
raw_xcode_logs = open("input_data/xcode_results.txt","rb").read().strip().split("\n")
sanitized_logs = []
for log in raw_xcode_logs:
if re.match('^[0-9][0-9][0-9][0-9]\-.*$', log):
sanitized_logs.append(log)
else:
sanitized_logs[-1] += " " + log
#TODO I need to know how many invocations to search for.
# Perhaps it would be easier to deal with this if I could import a pickle file with data from map_potential_methods_to_mach-ports.py
with open('./input_data/invocationDictionary.pk', 'rb') as handle:
invocationDictionary = pickle.load(handle)
#print invocationDictionary
knownEntKeyList = open('./input_data/ent_key_corpus.txt', 'rb').read().strip().split('\n')
for id in invocationDictionary:
thisInvocation = invocationDictionary[id]
id = str(id)
thisProtocol = thisInvocation["protocol"]
thisMethod = thisInvocation["method"]
thisMachPort = thisInvocation["mach-port"]
thisInvocation["valid"] = False
thisInvocation["entitlementRequirement"] = set()
thisInvocation["logLines"] = []
#The invocation is the correct combination of accessible mach-port and remote method
#Note that a valid invocation could still be inaccessible due to decentralized checks
#run various tests to see if the connection should be considered valid or not
parseRelevantLogs(id, thisInvocation, sanitized_logs)
#block based tests
hasBlockString = "Invocation has a completion handler"
if hasBlockString in thisInvocation["logLines"]:
checkForCompletionStatus(id, thisInvocation)
lookForEntReqs(id, thisInvocation, knownEntKeyList)
#if thisInvocation["valid"] and len(thisInvocation["entitlementRequirement"]) == 0:
if thisInvocation["valid"]:
print id
#print " "+thisProtocol
print " "+thisMethod
print " "+thisMachPort
#print " "+str(thisInvocation["valid"])
print " "+str(thisInvocation["entitlementRequirement"])
for line in thisInvocation["logLines"]:
print "****"+line
#for line in thisInvocation["logLines"]:
# print " "+line
| 40.564815 | 132 | 0.716047 | 541 | 4,381 | 5.761553 | 0.377079 | 0.056465 | 0.038499 | 0.022137 | 0.091434 | 0.081489 | 0.066089 | 0.040423 | 0 | 0 | 0 | 0.006475 | 0.189226 | 4,381 | 107 | 133 | 40.943925 | 0.871059 | 0.367268 | 0 | 0.037037 | 1 | 0 | 0.247244 | 0.090945 | 0 | 0 | 0 | 0.018692 | 0 | 0 | null | null | 0 | 0.037037 | null | null | 0.12963 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4925282781ec37ab8cc1089001ebc7822dc2c473 | 366 | py | Python | systemtest/users/apps.py | IBM-Power-SystemTest/systemtest | a29e6d54500ca13f554073cc66a4a2d403ea5b14 | [
"BSD-3-Clause"
] | 1 | 2022-03-09T18:07:11.000Z | 2022-03-09T18:07:11.000Z | systemtest/users/apps.py | IBM-Power-SystemTest/systemtest | a29e6d54500ca13f554073cc66a4a2d403ea5b14 | [
"BSD-3-Clause"
] | null | null | null | systemtest/users/apps.py | IBM-Power-SystemTest/systemtest | a29e6d54500ca13f554073cc66a4a2d403ea5b14 | [
"BSD-3-Clause"
] | null | null | null | """
Users app config
References:
https://docs.djangoproject.com/en/3.1/ref/applications/
"""
from django.apps import AppConfig
class UsersConfig(AppConfig):
name = "systemtest.users"
verbose_name = "Users"
def ready(self):
try:
import systemtest.users.signals # noqa F401
except ImportError:
pass
| 19.263158 | 63 | 0.628415 | 40 | 366 | 5.725 | 0.825 | 0.131004 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018727 | 0.270492 | 366 | 18 | 64 | 20.333333 | 0.838951 | 0.29235 | 0 | 0 | 0 | 0 | 0.083665 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0.111111 | 0.333333 | 0 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
492f40da8141b4f392fd82f2242b755c0bb7c8b7 | 1,406 | py | Python | app/view/forms.py | weizy1981/WatsonRobot | bb718a589a8f2d394fbc86582bff29c1015e79fc | [
"Apache-2.0"
] | null | null | null | app/view/forms.py | weizy1981/WatsonRobot | bb718a589a8f2d394fbc86582bff29c1015e79fc | [
"Apache-2.0"
] | null | null | null | app/view/forms.py | weizy1981/WatsonRobot | bb718a589a8f2d394fbc86582bff29c1015e79fc | [
"Apache-2.0"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, FileField
from wtforms.validators import DataRequired
from app.view import errormessage
class LoginForm(FlaskForm):
username = StringField(label='username', validators=[DataRequired(errormessage.LOGIN002)])
password = PasswordField(label='password', validators=[DataRequired(errormessage.LOGIN003)])
submit = SubmitField(label='GO')
class FileForm(FlaskForm):
file = FileField(label='File')
submit = SubmitField(label='GO')
class QuestionForm(FlaskForm):
question = StringField(label='Question',
validators=[DataRequired(errormessage.ONLINE_SERVICE001)])
submit = SubmitField(label='GO')
class QuerySNForm(FlaskForm):
customer_id = StringField(label='Customer_Id', validators=[DataRequired(errormessage.QUERY_SN001)])
submit = SubmitField(label='GO')
action = ''
class CustomerForm(FlaskForm):
customer_id = StringField(label='Customer_Id', validators=[DataRequired(errormessage.CUSTOMER_INPUT001)])
name = StringField(label='Name', validators=[DataRequired(errormessage.CUSTOMER_INPUT002)])
age = StringField(label='Age', validators=[DataRequired(errormessage.CUSTOMER_INPUT003)])
sex = StringField(label='Sex', validators=[DataRequired(errormessage.CUSTOMER_INPUT004)])
submit = SubmitField(label='GO')
action = ''
| 43.9375 | 109 | 0.753201 | 137 | 1,406 | 7.649635 | 0.321168 | 0.167939 | 0.259542 | 0.114504 | 0.291031 | 0.150763 | 0.150763 | 0.150763 | 0.150763 | 0.150763 | 0 | 0.019592 | 0.128734 | 1,406 | 31 | 110 | 45.354839 | 0.835918 | 0 | 0 | 0.269231 | 0 | 0 | 0.049787 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.076923 | 0.153846 | 0 | 0.961538 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
49397d33975fc946c23e0dd90e4f51ce16027f86 | 1,978 | py | Python | tests/dummypredictor/predictors.py | kiconiaworks/igata | 1d8a4b82a65eb936d5d8f8ff70747ba82ddef31a | [
"BSD-2-Clause"
] | 1 | 2021-12-31T14:29:44.000Z | 2021-12-31T14:29:44.000Z | tests/dummypredictor/predictors.py | kiconiaworks/igata | 1d8a4b82a65eb936d5d8f8ff70747ba82ddef31a | [
"BSD-2-Clause"
] | 6 | 2019-11-25T04:20:26.000Z | 2021-12-13T05:23:16.000Z | tests/dummypredictor/predictors.py | kiconiaworks/igata | 1d8a4b82a65eb936d5d8f8ff70747ba82ddef31a | [
"BSD-2-Clause"
] | null | null | null | from time import sleep
from igata.predictors import PredictorBase
class DummyPredictorNoInputNoOutput(PredictorBase):
def predict(self, inputs, meta):
result = {"result": 0.222, "class": "car", "is_valid": True}
return result
class DummyPredictorNoInputNoOutputVariableOutput(PredictorBase):
def __init__(self, *args, **kwargs):
default_result = {"result": 0.222, "class": "car", "is_valid": True}
self.result = kwargs.get("result", default_result)
def predict(self, input, meta=None):
return self.result
class DummyPredictorNoOutput(PredictorBase):
def preprocess_input(self, record, meta=None):
return {}
def predict(self, record, meta):
return record
class DummyPredictorNoInputNoOutputWithPredictTimeout5s(PredictorBase):
def predict(self, inputs, meta):
self.set_predict_timeout(3)
sleep(10)
result = {"result": 0.222, "class": "car", "is_valid": True}
return result
class DummyPredictorOptionalValidStaticMethods(PredictorBase):
@staticmethod
def get_pandas_read_csv_kwargs(self):
return {"x": 1}
def predict(self, inputs, meta):
return {"result": 0.222, "class": "car", "is_valid": True}
@staticmethod
def get_pandas_to_csv_kwargs(self):
return {"y": 2}
@staticmethod
def set_additional_dynamodb_request_update_attributes(self):
return {"v": True}
class DummyPredictorOptionalInValidStaticMethods(PredictorBase):
def get_pandas_read_csv_kwargs(self):
return {"x": 1}
def predict(self, inputs, meta):
return {"result": 0.222, "class": "car", "is_valid": True}
def get_pandas_to_csv_kwargs(self):
return {"y": 2}
def set_additional_dynamodb_request_update_attributes(self):
return {"v": True}
class DummyInPandasDataFrameOutPandasCSVPredictor(PredictorBase):
def predict(self, inputs, meta):
raise NotImplementedError
| 27.859155 | 76 | 0.68453 | 215 | 1,978 | 6.111628 | 0.269767 | 0.053272 | 0.074581 | 0.076104 | 0.491629 | 0.491629 | 0.407154 | 0.407154 | 0.407154 | 0.380518 | 0 | 0.017767 | 0.203236 | 1,978 | 70 | 77 | 28.257143 | 0.81599 | 0 | 0 | 0.553191 | 0 | 0 | 0.061678 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.319149 | false | 0 | 0.042553 | 0.234043 | 0.787234 | 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 | 1 | 0 | 0 | 3 |
494b2faa96115baf8681d111a98a087de5ebcb59 | 476 | py | Python | lib/dyson/utils/module.py | luna-test/luna | 6d94439f2747daf96e295837684bdc6607f507dc | [
"Apache-2.0"
] | 3 | 2018-05-21T14:35:11.000Z | 2021-03-25T12:32:25.000Z | lib/dyson/utils/module.py | dyson-framework/dyson | e5a2e12c7bb0ba21ff274feff34c184576d08ff5 | [
"Apache-2.0"
] | 13 | 2018-05-22T01:01:08.000Z | 2018-09-16T22:12:10.000Z | lib/dyson/utils/module.py | luna-test/luna | 6d94439f2747daf96e295837684bdc6607f507dc | [
"Apache-2.0"
] | 1 | 2018-05-21T14:35:17.000Z | 2018-05-21T14:35:17.000Z | import os
from dyson import constants
from abc import abstractmethod
import sys
from dyson.constants import to_boolean
class DysonModule:
def __init__(self):
pass
@abstractmethod
def run(self, webdriver, params):
pass
def fail(self, msg):
print(msg, file=sys.stderr)
if not to_boolean(constants.DEFAULT_SELENIUM_PERSIST):
exit(2)
def get_module_path():
return os.path.dirname(os.path.realpath(__file__))
| 18.307692 | 62 | 0.686975 | 62 | 476 | 5.048387 | 0.596774 | 0.057508 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002747 | 0.235294 | 476 | 25 | 63 | 19.04 | 0.857143 | 0 | 0 | 0.117647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.235294 | false | 0.117647 | 0.294118 | 0.058824 | 0.647059 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
496a50df8aab51c7339b1ff94cb179d8c9744ace | 1,272 | py | Python | sdc/ysdc_dataset_api/utils/serialization.py | sty61010/shifts | d3bb3086d8f2581f74644585701f4b1db4338483 | [
"Apache-2.0"
] | 156 | 2021-07-16T08:54:39.000Z | 2022-03-24T11:49:36.000Z | sdc/ysdc_dataset_api/utils/serialization.py | sty61010/shifts | d3bb3086d8f2581f74644585701f4b1db4338483 | [
"Apache-2.0"
] | 18 | 2021-07-21T14:02:46.000Z | 2022-02-26T04:07:12.000Z | sdc/ysdc_dataset_api/utils/serialization.py | sty61010/shifts | d3bb3086d8f2581f74644585701f4b1db4338483 | [
"Apache-2.0"
] | 41 | 2021-07-21T05:38:07.000Z | 2022-01-13T15:25:51.000Z | import io
import zlib
import numpy as np
def maybe_compress(str, compress):
return zlib.compress(str) if compress else str
def maybe_decompress(str, decompress):
return zlib.decompress(str) if decompress else str
def serialize_numpy(arr: np.ndarray, compress: bool = False) -> str:
"""Serializes numpy array to string with optional zlib compression.
Args:
arr (np.ndarray): Numpy array to serialize.
compress (bool, optional): Whether to compress resulting string with zlib or not.
Defaults to False.
Returns:
str: serialized string
"""
buf = io.BytesIO()
assert isinstance(arr, np.ndarray)
np.save(buf, arr)
result = buf.getvalue()
return maybe_compress(result, compress)
def deserialize_numpy(serialized_string: str, decompress: bool = False) -> np.ndarray:
"""Deserializes numpy array from compressed string.
Args:
serialized_string (str): Serialized numpy array
decompress (bool, optional): Whether to decompress string with zlib before laoding.
Defaults to False.
Returns:
np.ndarray: deserialized numpy array
"""
str = maybe_decompress(serialized_string, decompress)
buf = io.BytesIO(str)
return np.load(buf)
| 27.06383 | 91 | 0.687893 | 158 | 1,272 | 5.481013 | 0.310127 | 0.051963 | 0.04157 | 0.048499 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.22956 | 1,272 | 46 | 92 | 27.652174 | 0.883673 | 0.426887 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.058824 | 1 | 0.235294 | false | 0 | 0.176471 | 0.117647 | 0.647059 | 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 | 1 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.